/* Phone kit (Ali, 22 Oct 2026): the pages share ONE header, ONE search + Filters line (filters in a bottom sheet) and ONE slim sort row.
   Phones only; computers are not touched. Complaints list rows are in css/complaints-phone.css. */
@media (max-width: 700px) {
  /* 2. one header: title at one size, the count beside it, the main button on the same row (44px) */
  main .page-head h1 { font-size: 1.75rem; line-height: 1.15; margin: 0; }
  .page-head:has(#new-inst), .page-head.reg-top { flex-wrap: nowrap; align-items: center; gap: 10px; margin-bottom: 10px; }
  .page-head:has(#new-inst) > div, .page-head.reg-top > div { flex: 1 1 auto; min-width: 0; }
  .page-head:has(#new-inst) p { margin: 2px 0 0; font-size: 0.88rem; }
  .page-head:has(#new-inst) .head-btns { width: auto; flex: none; }
  .page-head:has(#new-inst) .head-btns .btn, .reg-actions .btn { flex: none; min-height: 44px; }
  .reg-top p, .page-head:has(+ .amc-tabs) p { display: none; }
  .page-head:has(+ .amc-tabs) { margin-bottom: 8px; }
  .reg-pin .reg-actions { flex: none; }
  /* 1. search and Filters on ONE line: Register and AMC (Complaints and Installations: complaints-phone.css) */
  .reg-filters:has(> .reg-fold-btn), .amc-bar:not([hidden]):has(> .reg-fold-btn) { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin-bottom: 8px; }
  .reg-filters:has(> .reg-fold-btn) #r-search, .amc-bar:has(> .reg-fold-btn) .search-box { flex: 1 1 0; min-width: 0; margin: 0; }
  .reg-filters #r-search, .amc-bar .search-box input { min-height: 36px; height: 36px; }
  .btn.reg-fold-btn { width: auto; flex: none; min-height: 36px; height: 36px; padding: 0 12px; }
  .reg-fold { display: none; }
  .filters:has(> .reg-fold:not([hidden]))::before { content: ""; position: fixed; inset: 0; z-index: 60; background: rgba(13, 27, 42, 0.4); }
  .reg-fold:not([hidden]) { display: flex; flex-wrap: wrap; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; width: auto; max-height: 80vh; overflow-y: auto; background: var(--surface);
    border-radius: 18px 18px 0 0; padding: 20px 16px calc(var(--safe-b, 0px) + 16px); box-shadow: 0 -8px 30px rgba(13, 27, 42, 0.25); }
  .reg-fold:not([hidden]) > * { flex: 1 1 100%; }
  .reg-fold:not([hidden]) > .check, .reg-fold:not([hidden]) > label { flex: 1 1 auto; }
  .reg-fold .f-done { display: flex; order: 9; justify-content: center; }
  /* 3. one slim sort row on every list */
  .ls-sortbox { padding: 4px 12px; gap: 8px; align-items: center; }
  .ls-sortbox label { display: flex; align-items: center; gap: 6px; }
  .ls-sortbox select, .ls-sortbox .btn { min-height: 36px; height: 36px; padding-top: 0; padding-bottom: 0; font-size: 0.85rem; margin-left: 0; }
}
@media (max-width: 700px) {
  /* 5. Board cards follow the list: Late is said once (the red word), tighter card */
  .b-card.is-late .b-due { display: none; }
  .b-card { padding: 8px 10px; gap: 2px; }
  .b-foot { margin-top: 2px; min-height: 28px; }
  .b-tech .av, .b-tech .wt-noav { width: 24px !important; height: 24px !important; }
  .b-cards { gap: 6px; }
}
@media (max-width: 700px) {
  /* 6. Home Installations card: the visit date is never split across two lines */
  .inst-sub > span { white-space: nowrap; }
}
@media (max-width: 700px) {
  /* 7. an empty section is one line, not a card */
  .panel.is-empty { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; }
  .panel.is-empty h2 { margin: 0; }
  .panel.is-empty p { margin: 0; }
}
@media (max-width: 700px) {
  /* the Filters button looks the same on every page: a bordered button, never plain text */
  .c-tools .filters-btn.btn.ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
}
/* Motion (Emil review, 22 Oct 2026): the sheets slide up like the app's other pop-up sheets (0.26s, drawer curve) and the dark area fades; the folded statuses fade in;
   the new controls give press feedback. Only transform and opacity; nothing moves when the phone asks for reduced motion. */
@keyframes pk-sheet { from { transform: translateY(100%); } }
@keyframes pk-fade { from { opacity: 0; } }
@media (max-width: 700px) {
  .c-tools.f-open .filters, .reg-fold:not([hidden]) { overscroll-behavior: contain; }
  .filters-btn, .reg-fold-btn, .f-done, .sl-more, .ls-sortbox .btn, .c-sortli .btn { transition: transform 160ms var(--ease-out), background-color 0.12s, border-color 0.12s; }
}
@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  .filters-btn:active, .reg-fold-btn:active, .f-done:active, .sl-more:active, .ls-sortbox .btn:active, .c-sortli .btn:active { transform: scale(0.97); }
  .c-tools.f-open .filters, .reg-fold:not([hidden]) { animation: pk-sheet 0.26s cubic-bezier(0.32, 0.72, 0, 1); }
  .c-tools.f-open::before, .filters:has(> .reg-fold:not([hidden]))::before { animation: pk-fade 0.18s var(--ease-out); }
  .sline-compact.sl-open .sline-legend { animation: pk-fade 0.18s var(--ease-out); }
}
/* Home on phones (Ali, 14 Nov 2026: the phone standards of docs/redesign/TEXTBOOK.md). Computers are not touched. */
@media (max-width: 700px) {
  /* Pending Tasks | Activity are parts of the card: underline tabs, as on every page (not a second row of dark chips above the filter chips) */
  .wt-panel .mgr-tabs { flex-wrap: nowrap; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
  .mgr-tabs button, .mgr-tabs button[aria-selected="true"] { background: none; color: var(--muted); border-radius: 0; padding: 8px 12px 9px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
  .mgr-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
  /* the plan warning is never cut: the words wrap, the button stays on the right */
  .crew-warn { white-space: normal; }
  .crew-warn > span { overflow: visible; }
  /* View More / Show All: the tap height of a row button */
  .wt-panel .link { display: inline-flex; align-items: center; min-height: 30px; }
  /* ONE gap between the cards (16): the task card's own bottom margin was added to the column gap (32) */
  .home-grid .wt-panel { margin-bottom: 0; }
  .home-grid .home-side { gap: 16px; }
}
