/* ============================ Fluid layout (Ali, 7 Oct 2026) ============================
   Parts size themselves from the room they have, not from the window's width: auto-fit grids, clamp() sizes, wrapping rows
   and container queries (a part looks at the width of the box it sits in). The only fixed switch left is phone mode
   (bottom menu, pop-ups as sheets) at 700px; the top bar's own steps are measured by js/nav-fit.js.
   Rules: no page may scroll sideways; give a part a minimum width and let it wrap or drop columns; never a window size. */

/* ---- one set of fluid sizes, used by every page ---- */
:root {
  --fl-gap: clamp(10px, 1.2vw + 6px, 16px);        /* space between cards and columns (Home reference: 16px on computers) */
  --fl-pad: clamp(14px, 2.4vw, 28px);             /* page side padding */
}

/* ---- safety: nothing may push the page sideways ---- */
html, body { max-width: 100%; }
main, .page-head, .page-head > *, .panel, .rows, .c-tools { min-width: 0; }
.page-head { flex-wrap: wrap; }
.head-btns { flex-wrap: wrap; }
img, svg, video, canvas { max-width: 100%; }

/* ---- Service Line (Complaints and Home): looks at its own width ---- */
.sline { container: sline / inline-size; }
/* wide: the journey in one row (office.css); narrower: the phone-style summary (headline, gauge, chips). No in-between look (Ali, 8 Oct 2026).
   Home's compact strip (.sline-hover) keeps its own, lower width. */
@media (min-width: 701px) and (not ((pointer: coarse) and (max-height: 500px))) {
  @container sline (min-width: 46.7em) and (max-width: 63.95em) {
    .sline:not(.sline-hover) .sflow { display: none; }
    .sline:not(.sline-hover) .sline-head { display: flex; }
    .sline:not(.sline-hover) .sline-bar { display: flex; }
    .sline:not(.sline-hover) .sline-legend { display: flex; }
    .sline:not(.sline-hover) .sline-key { display: flex; }
  }
}

.c-list { container: crows / inline-size; }
/* wide: Technician, Owner and Updated are columns with the headings once; the Next Step button sits at the right edge (Ali, 7 Oct 2026) */
@container crows (min-width: 68em) {
  .c-row { grid-template-columns: 6rem minmax(0, 1fr) 14.5rem 13.5rem; padding-right: 10.13rem; }
  .with-days .c-row { grid-template-columns: 6rem minmax(0, 1fr) 14.5rem 4rem 13.5rem; }
  .c-row .row-people.kv { grid-template-columns: 4.5rem 3.5rem minmax(0, 1fr); grid-auto-flow: row; gap: 0 0.5rem; align-items: center; }
  .c-row .row-people.kv dt { display: none; }
  .c-row .row-people.kv dd { display: flex; align-items: center; min-height: 1.75rem; }
  .c-row .row-people.kv dd:nth-of-type(3) { font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
  .c-head { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 14.5rem 13.5rem; gap: 1rem; align-items: center; padding: 0.5rem 10.13rem 0.5rem 1rem; font: 600 0.78rem var(--font); color: var(--muted); background: var(--sunken); position: relative; }
  .with-days .c-head { grid-template-columns: 6rem minmax(0, 1fr) 14.5rem 4rem 13.5rem; }
  .c-head .ch-people { display: grid; grid-template-columns: 4.5rem 3.5rem minmax(0, 1fr); gap: 0 0.5rem; }
  .c-head .ch-days { text-align: center; }
  .c-head .ch-stage { text-align: right; }
  .c-head .ch-next { position: absolute; right: 1rem; width: 8.13rem; text-align: center; }
  .row-next { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: 8.13rem; }
  .row-next:active:not(:disabled) { transform: translateY(-50%) scale(0.97); } /* keeps its centring while pressed, so it does not jump and the click lands */
}
/* middle: tighter columns, the Next Step button on a line of its own under the row */
@container crows (min-width: 60em) and (max-width: 67.95em) {
  .c-head { display: none; }
  .c-row, .with-days .c-row { grid-template-columns: 5.62rem minmax(0, 1fr) 14rem 3.25rem 12.5rem; gap: 0.75rem; }
  .c-row .row-people.kv { grid-template-rows: auto auto; grid-auto-flow: column; grid-template-columns: 4.4rem 3.5rem minmax(0, 1fr); gap: 0 0.5rem; }
  .c-row.has-next { padding-bottom: 3.5rem; }
  .row-next { position: absolute; right: 0.88rem; bottom: 0.75rem; }
}
/* narrow: one card per complaint */
@container crows (max-width: 59.95em) {
  .c-head { display: none; }
  .c-row, .with-days .c-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ref stage" "main main"; gap: 0.5rem 0.63rem; padding: 0.87rem; }
  .c-row .row-ref { grid-area: ref; display: flex; align-items: center; gap: 8px; }
  .c-row .row-main { grid-area: main; }
  .c-row .row-main small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .c-row .row-stage { grid-area: stage; }
  .c-row .row-people { grid-column: 1 / -1; max-width: 300px; }
  .c-row .row-days { grid-column: 1 / -1; display: flex; gap: 6px; align-items: baseline; text-align: left; }
  .c-row .row-days b { display: inline; font-size: 1rem; }
  .c-row .row-people.kv { grid-template-rows: auto auto; grid-auto-flow: column; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 0.87rem; max-width: none; }
  .c-row .row-people.kv dt { font-size: 0.78rem; }
  .c-row.has-next { padding-bottom: 3.5rem; }
  .row-next { position: absolute; right: 0.88rem; bottom: 0.75rem; }
}
/* ---- Complaints and Installations filter bar: search box, dropdowns and tick boxes are ONE row that wraps by itself when the room runs out (no forced break) ---- */
@media (min-width: 701px) {
  .c-tools { gap: 10px 12px; }
  .c-tools .search-box { flex: 1 1 280px; max-width: 420px; }
  .c-tools::after { display: none; }
  .c-tools .filters select, .c-tools .filters .check, .c-tools .filters .clear-filters { flex: 0 1 auto; }
}

/* ---- Touch screens (phones and tablets): every control is at least 44px, the same on every page ---- */
@media (pointer: coarse) {
  button, .btn, a.btn, label.btn, .btn.small, a.btn.small, label.btn.small, .qtn-row .btn.small, .reg-card .btn.small, .reg-chip, .tab, .seg button, .chip, .reg-fchip, select, details > summary, .fold-btn, .info, .icon-btn, .wt-owner, button.link { min-height: 44px; }
  .icon-btn, .fold-btn, .info, .wt-owner { min-width: 44px; }
  button.link { display: inline-flex; align-items: center; }
  .menu button, .menu a { min-height: 40px; }      /* full-width menu rows: 40px keeps a long menu inside the screen */
  .cal-cell { min-height: 40px; }                 /* the AMC calendar is a dense grid: 40px */
  .tabbar > a, .tab-more > summary { min-height: var(--tab-h); }
  .check input, input[type="checkbox"], input[type="radio"] { min-width: 20px; min-height: 20px; }
}

/* ---- Complaint card on a very narrow list: tag, status and text each get their own line instead of squeezing ---- */
@container crows (max-width: 21.5em) {
  .c-row, .with-days .c-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ref" "stage" "main"; }
  .c-row .row-stage { justify-self: start; }
}

/* ============================ Home task rows (Admin and Manager): fluid ============================
   One grid by named areas; the list looks at its own width. Wide: every column. Middle: the Manager row drops "last update".
   Narrow: the row stacks on lines (name / owner and update / status, Late and button). Replaces the layered window-width rules above. */
.wt-list { container: wtl / inline-size; }
#page .wt { display: grid; align-items: center; column-gap: 10px; row-gap: 6px; padding: 8px 0; min-height: 62px;
  grid-template-columns: minmax(0, 1fr) 11.5rem 2.75rem 8.75rem; grid-template-areas: "main pill late btn"; }
#page .wt > .wt-main { grid-area: main; }
#page .wt > .wt-owner { grid-area: owner; }
#page .wt > .wt-upd { grid-area: upd; }
#page .wt > .wt-pill { grid-area: pill; justify-self: start; min-width: 0; max-width: 100%; }
#page .wt > .wt-late { grid-area: late; display: block; justify-self: start; }
#page .wt > .btn { grid-area: btn; justify-self: end; width: 8.75rem; min-width: 0; padding-inline: 0.5rem; }
#page .wt:has(> .wt-upd) { grid-template-columns: minmax(0, 1fr) 2.75rem 9.25rem 11.5rem 2.37rem 8rem; grid-template-areas: "main owner upd pill late btn"; column-gap: 0.5rem; }
#page .wt:has(> .wt-upd) > .btn { width: 8rem; }
#page .wt.wt-free { grid-template-areas: "main main main pill late btn"; }
#page .wt.wt-free > .wt-owner, #page .wt.wt-free > .wt-upd { display: none; }
/* Manager rows (Ali, 8 Oct 2026). Wide: the update text ("Sachin · 2 d ago", "13 days in status") has its own column again, now that the status names are shorter.
   Medium: only the days in status ("13 d") under the owner photo, the full text in the hover. Narrow: the stacked card (below). */
@container wtl (max-width: 57.28em) {
  #page .wt:has(> .wt-upd) { grid-template-columns: minmax(0, 1fr) 3.5rem 11.5rem 2.37rem 8rem; grid-template-areas: "main owner pill late btn"; }
  #page .wt.wt-free { grid-template-areas: "main main pill late btn"; }
}
@container wtl (min-width: 44em) and (max-width: 57.28em) {
  #page .wt:has(> .wt-upd):not(.wt-free) > .wt-owner { grid-area: owner; align-self: center; justify-self: center; margin-top: -0.75rem; }
  #page .wt:has(> .wt-upd):not(.wt-free) > .wt-upd { grid-area: owner; align-self: center; justify-self: center; margin-top: 2.25rem; font-size: 0.7rem; line-height: 1; color: var(--muted); pointer-events: none; }
  #page .wt:has(> .wt-upd):not(.wt-free) > .wt-upd > * { display: none; }
  #page .wt:has(> .wt-upd):not(.wt-free) > .wt-upd::after { content: attr(data-d); }
}
/* the grey line under the title may wrap to two lines before it is cut (was one) */
#page .wt-text small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@container wtl (max-width: 43.95em) {
  #page .wt { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main main main" "pill late btn"; min-height: 0; padding: 0.63rem 0; }
  #page .wt > .btn { width: 8.0rem; }
  #page .wt > .wt-pill .status-pill { white-space: normal; line-height: 1.25; }
  #page .wt:has(> .wt-upd) { grid-template-columns: 2.13rem minmax(0, 1fr) auto 6.75rem; grid-template-areas: "main main main main" "owner upd upd upd" "pill pill late btn"; }
  #page .wt:has(> .wt-upd) > .wt-upd { display: flex; flex-direction: row; gap: 6px; }
  #page .wt:has(> .wt-upd) > .wt-upd:empty { display: none; }
  #page .wt:has(> .wt-upd) > .wt-upd b, #page .wt:has(> .wt-upd) > .wt-upd small { white-space: normal; }
  #page .wt:has(> .wt-upd) > .wt-upd small::before { content: "· "; }
  #page .wt:has(> .wt-upd) > .wt-owner { width: 34px; }
  #page .wt:has(> .wt-upd) > .btn { width: 6.75rem; padding-inline: 0.38rem; }
  #page .wt.wt-free { grid-template-areas: "main main main main" "pill pill late btn"; }
}

/* ============================ Complaint page header: wraps by itself (title and buttons | journey | facts) ============================ */
@media (min-width: 701px) {
  .case-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
  .case-head > .case-name { flex: 100 1 340px; min-width: 0; max-width: 35rem; }   /* the same width on the Complaint, AMC and Installation pages (35rem, room for the buttons), so the journey bar is the same size everywhere; narrower windows shrink it down to 340px, buttons wrap, never squeezed */
  .case-head .case-eq { width: 0; min-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }   /* the line under the name never widens the box; a long description wraps onto as many lines as it needs */
  .case-head > .case-mid { flex: 1 1 240px; }   /* once the name has what it needs, the journey takes all the empty space between the name and the facts (Ali, 8 Oct 2026) */
  .case-head > .case-status { flex: 0 1 270px; align-self: flex-start; }
  /* the journey bar runs from the first dot to the last dot across the whole space: the last step is only as wide as its own label (Complaint, AMC, Installation pages) */
  .case-mid .journey { display: flex; }
  .case-mid .journey li { flex: 1 1 0; min-width: 0; }
  .case-mid .journey li:last-child { flex: 0 0 auto; min-width: 1.5rem; }
  .case-head .case-actions { flex-wrap: wrap; }
  .case-head .case-actions .btn, .case-head .case-actions .menu-wrap { flex: none; white-space: nowrap; }
}

/* ---- Filter bars on every page: dropdowns keep a natural size (never stretched across the page), the search box takes what is left ---- */
@media (min-width: 701px) {
  .filters select { flex: 0 1 auto; min-width: 150px; max-width: 100%; }
}

/* two-row top bar: the menu row scrolls sideways by itself when a long menu does not fit (never cut or wrapped) */
@media (min-width: 701px) {
  .nav-2row .topnav { overflow-x: auto; scrollbar-width: none; }
  .nav-2row .topnav::-webkit-scrollbar { display: none; }
  .nav-2row .topnav a { flex: none; }
}

/* ============================ Users list: columns by the list's own width ============================ */
ul.users { container: ulist / inline-size; }
@container ulist (max-width: 72em) {
  .users .row { grid-template-columns: 1fr; gap: 0.38rem; padding: 0.87rem; }
  .users .row > :nth-child(2), .users .row > :nth-child(3) { padding-left: 52px; text-align: left; }
  .users .row > :nth-child(2) { display: flex; flex-wrap: wrap; gap: 6px; }
  .users .row .u-tags > span:empty { display: none; }
  .users .row .row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.25rem; justify-content: stretch; }
  .users .row .row-actions .btn { min-height: 40px; white-space: nowrap; padding: 6px 8px; }
  .users .row .row-actions:empty { display: none; }
}

/* the second row of the top bar with a long menu: closer links, so every link shows without sideways scrolling */
@media (min-width: 701px) {
  .nav-2row-tight .topnav a { padding: 0 8px; font-size: 0.9rem; }
  .nav-2row-tight .topnav a.active::after { left: 8px; right: 8px; }
}
/* the closest links: the Manager's ten links (Site Visits added) on a small tablet (Ali, 5 Nov 2026) */
@media (min-width: 701px) {
  .nav-2row-tighter .topnav a { padding: 0 5px; font-size: 0.86rem; }
  .nav-2row-tighter .topnav a.active::after { left: 5px; right: 5px; }
}

/* ============================ Tablets with a soft keyboard ============================
   Pop-ups on a touch tablet (wider than a phone) are centred, not sheets, but must still sit above the keyboard like the phone ones do. */
@media (pointer: coarse) and (min-width: 701px) {
  .dialog:not(.finder), .dialog:not(.finder) form { max-height: calc(var(--vv-height, 100dvh) - 24px); }
  .kb-open .dialog:not(.finder) { margin: calc(var(--vv-top, 0px) + 12px) auto auto; }
  .dialog:not(.finder) .dialog-body { flex: 1 1 auto; min-height: 0; }   /* the form scrolls inside the pop-up, its buttons stay in view */
  .dialog footer { padding-bottom: max(12px, var(--safe-b)); }
}


/* ============================ Larger text (phone text size, browser text size) ============================
   Layouts switch by the list's width in em (above), so bigger text moves to the card layout earlier. Boxes that hold text grow with it. */
#page .wt-main { grid-template-columns: 4.75rem minmax(0, 1fr); }
#page .wt-tag, #page .hi-tag { width: 4.75rem; box-sizing: border-box; }
.tc-n, .tc-l { flex-wrap: wrap; white-space: normal; row-gap: 0; }
@media (max-width: 700px) { .tc-grid .tc { flex-basis: 13em; } }
.rows .row b, .rows .row small, .rows .row span { overflow-wrap: anywhere; }
.fd-tag { width: 4.75rem; box-sizing: border-box; }
.pl-jobtab { white-space: normal; line-height: 1.15; }

/* ============================ Long lists: first 20 rows, then View More (js/view-more.js) ============================ */
.vm-hidden { display: none !important; }
.view-more { list-style: none; display: flex; justify-content: center; padding: 0.75rem; border-top: 1px solid var(--line); }
.view-more .btn { min-width: 12rem; justify-content: center; }

/* ============================ Installations list: by the list's own width; the compact card has three lines, not four ============================
   IN-0004 ............... Internal
   TEST Paint Booth        ● Ongoing
   customer · branch        Target Sat, 3 Oct */
ul.inst-rows { container: instl / inline-size; }
@container instl (max-width: 54.95em) {
  .inst-line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ref kind" "main status" "main when"; column-gap: 0.75rem; row-gap: 0.125rem; align-items: center; padding: 0.625rem 0.875rem 0.625rem 1.125rem; min-height: 0; }
  .inst-line .inst-ref { grid-area: ref; } .inst-line .inst-main { grid-area: main; } .inst-line .inst-kind { grid-area: kind; justify-self: end; }
  .inst-line .inst-state { grid-area: status; justify-self: end; } .inst-line .inst-when { grid-area: when; justify-self: end; }
  .inst-line .inst-when small:last-child { display: none; }
}
@container instl (min-width: 55em) {
  .inst-line { grid-template-columns: 5.25rem minmax(0, 1fr) 5.25rem 11.5rem 14.38rem; grid-template-areas: none; column-gap: 0.75rem; row-gap: 0; padding: 0.625rem 1rem 0.625rem 1.25rem; min-height: 4rem; }
  .inst-line .inst-ref, .inst-line .inst-main, .inst-line .inst-kind, .inst-line .inst-state, .inst-line .inst-when { grid-area: auto; }
  .inst-line .inst-kind, .inst-line .inst-state { justify-self: start; }
  .inst-line .inst-when small:last-child { display: block; }
}

/* ============================ AMC visit rows (Due This Month): two lines when narrow (Ali, 8 Oct 2026) ============================
   [M] DENSO · Arad [Equipment] ................. OCT
   ● Scheduled  Ajith · Sun, 4 Oct ......... Reassign  View   (the old phone look had five lines) */
ul.amc-rows { container: amcl / inline-size; }
@container amcl (max-width: 46em) {
  .amc-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name name name" "people state actions"; gap: 0.5rem 0.75rem; padding: 0.75rem 0.875rem; align-items: center; }
  .amc-row .amc-name { grid-area: name; }
  .amc-row .amc-people { grid-area: people; }
  .amc-row .amc-state { grid-area: state; display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; min-width: 0; }
  .amc-row .row-actions { grid-area: actions; justify-content: flex-end; flex-wrap: nowrap; }
  .amc-row .amc-nm { flex-wrap: nowrap; align-items: flex-start; }
  .amc-row .amc-nm-main { flex: 1 1 auto; min-width: 0; }
  .amc-row .amc-nm > .amc-mon { margin-left: auto; }
}

/* very narrow in em (a phone with the largest text size): the status and the buttons get a line each instead of sitting on top of each other */
@container amcl (max-width: 18em) {
  .amc-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "people" "state" "actions"; }
  .amc-row .row-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* Complaints list order (Ali, 8 Oct 2026): clickable column headings on wide lists, a Sort box when the headings are hidden */
.ch-sort { all: unset; box-sizing: border-box; cursor: pointer; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 0.3em; min-height: 0; border-radius: 4px; padding: 0.15rem 0.25rem; margin: -0.15rem -0.25rem; white-space: nowrap; }
.ch-sort:hover { color: var(--ink, #0D1B2A); }
.ch-sort:focus-visible { outline: 2px solid #1F5FD1; outline-offset: 1px; }
.ch-sort[aria-sort="ascending"]::after { content: "\25B2"; font-size: 0.7em; }
.ch-sort[aria-sort="descending"]::after { content: "\25BC"; font-size: 0.7em; }
.ch-sort[aria-sort="ascending"], .ch-sort[aria-sort="descending"] { color: var(--ink, #0D1B2A); }
.ch-stage .ch-sort { justify-content: flex-end; }
.c-sortli { display: none; align-items: center; gap: 0.75rem; padding: 0.5rem 0.87rem; background: var(--sunken); font: 600 0.78rem var(--font); color: var(--muted); }
.c-sortli select { margin-left: 0.4rem; }
@media (pointer: fine) { .c-sortli .btn { min-height: 0; padding: 0.25rem 0.6rem; } }
@container crows (max-width: 67.95em) { .c-sortli { display: flex; } }
/* Check Stock pop-up: the complaint's parts as tags above the question (Ali, 8 Oct 2026) */
.ps-sum { margin: 0 0 0.5rem; color: #5A6677; }
.ps-sum b { color: #0D1B2A; }
.ps-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; max-height: 12rem; overflow: auto; }
.ps-chip { display: inline-flex; gap: 0.45rem; align-items: baseline; max-width: 100%; border: 1px solid #E1E6EC; background: #fff; border-radius: 8px; padding: 0.3rem 0.7rem; overflow-wrap: anywhere; }
.ps-chip b { color: #0D1B2A; }
.ps-chip span { color: #0D1B2A; min-width: 0; }
.ps-chip b + span { color: #5A6677; }
.ps-chip i { font-style: normal; color: #5A6677; white-space: nowrap; }
.stock-box .muted { margin: 0 0 0.75rem; }

/* Activity (Ali, 8 Oct 2026): a status change and its reason on one row; a visit is one compact line that opens its card in the Visits box */
.visit-card.is-jump { animation: hx-jump 2.4s ease-out; }

/* Complaint page side (Ali, 8 Oct 2026): the blocker on the Quotation card; People Involved is one line that opens to the full list */
.qtn-card .panel-head h2 { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.4rem; white-space: nowrap; }
.qtn-wait { margin: 0 0 0.6rem; padding: 0.4rem 0.7rem; border: 1px solid #F3D38F; background: #FBF3E4; border-radius: 8px; color: #6b4300; font-weight: 600; }
.fold > summary { flex-wrap: wrap; gap: 0.5rem 0.9rem; }
.fold > summary h2 { margin: 0; }
.fold-faces { display: inline-flex; }
.fold-faces > span { margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.fold > summary h2 { white-space: nowrap; }
.fold-faces > span:first-child { margin-left: 0; }
.fold-more { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; background: #E1E6EC; color: #0D1B2A; font: 600 0.72rem var(--font); }
.fold-count { color: #5A6677; font-size: 0.86rem; }
.fold-tools { margin: 0 0 0.5rem; }
.fold > summary h2 small { font-weight: 500; }
.side-wide { grid-column: 1 / -1; }
.other-nums { display: block; margin-top: 2px; }
.fold[open] > summary { margin-bottom: 0.5rem; }

.qtn-card .panel-head { flex-wrap: nowrap; align-items: flex-start; gap: 0.75rem; }
.qtn-card .panel-head h2 { min-width: 0; }
.qtn-card .panel-head .btn { flex: none; }

/* heading rows with sorting for Installations, AMC and Register (Ali, 10 Oct 2026), the look of the Complaints heading row */
.ls-head { display: none; align-items: center; background: var(--sunken); font: 600 0.78rem var(--font); color: var(--muted); list-style: none; }
.ls-head .ch-sort, .ls-sortbox .ch-sort { all: unset; cursor: pointer; font: inherit; color: inherit; padding: 2px 4px; border-radius: 4px; }
.ls-head .ch-sort:hover, .ls-head .ch-sort:focus-visible { color: var(--ink); }
.ls-head .ch-sort[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; }
.ls-head .ch-sort[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; }
.ls-head .ch-sort[aria-sort="ascending"], .ls-head .ch-sort[aria-sort="descending"] { color: var(--ink); }
.ls-sortbox { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; list-style: none; background: var(--sunken); font: 600 0.8rem var(--font); }
.ls-sortbox select { font: inherit; margin-left: 6px; }
@container instl (min-width: 55em) {
  .inst-head { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr) 5.25rem 11.5rem 14.38rem; column-gap: 0.75rem; padding: 0.5rem 1rem 0.5rem 1.25rem; }
  .inst-head .ih-when { display: flex; justify-content: flex-end; gap: 10px; }
  ul.inst-rows > .ls-sortbox { display: none; }
}
@container instl (max-width: 54.95em) { ul.inst-rows > .inst-head { display: none; } }
.reg-head { display: none; }
.reg-sortbox, .ls-sortbox { }
@media (min-width: 1101px) {
  .reg-head { display: grid; grid-template-columns: minmax(0, 1fr) 150px 390px; gap: 4px 14px; align-items: center; padding: 0.45rem 16px 0.45rem 19px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; }
  .reg-head .rh-main { display: flex; align-items: center; gap: 22px; }
  .reg-head .rh-status { margin-left: auto; }
  .reg-head + .ls-sortbox { display: none; }
  .reg-head ~ .reg-rows { border-top-left-radius: 0; border-top-right-radius: 0; }
}
@media (max-width: 1100px) { .reg-head ~ .ls-sortbox { display: flex; margin-bottom: 8px; border-radius: 10px; } }
@media (min-width: 1101px) { .reg-head .rh-status { width: 98px; text-align: center; margin-left: auto; } .reg-head > span:nth-child(2) { text-align: right; } .reg-head .rh-status .ch-sort { display: block; width: 100%; } }
@media (min-width: 701px) { .amc-head { display: grid; grid-template-columns: minmax(0, 1fr) 76px 150px 70px; gap: 14px; padding: 0.5rem 18px; border-radius: 10px; margin: 0 0 8px; } .amc-head > span:first-child { display: flex; gap: 14px; } .amc-head > span:nth-child(2), .amc-head > span:nth-child(3) { display: flex; gap: 10px; } }
.ls-head .ch-sort { white-space: nowrap; }
.ls-head .ch-sort { display: inline-flex; align-items: center; min-height: 36px; padding: 0 6px; margin: 0 -6px; } /* a comfortable tap size */
.ls-head { padding-top: 0 !important; padding-bottom: 0 !important; }
/* Register cards on a phone with the largest text size: the amount drops under the number and customer instead of sitting on the status tag */
ul.reg-rows { container: regl / inline-size; }
@container regl (max-width: 22em) {
  .reg-card { grid-template-columns: minmax(0, 1fr); }
  .reg-card .reg-amount { text-align: left; }
  .reg-line .reg-badge { min-width: 0; }
}

/* Manager Home on a phone (Ali, 21 Oct 2026): no Team list; a Pending Task is one short row (photo, tag, name, Late, status, time) that opens in place on tap to show the text, the Open link and the next-step button */
.wt-open { display: none; }
@media (max-width: 700px) {
  .mgr-page #team { display: none; }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) { grid-template-columns: 2.4rem auto minmax(0, 1fr) auto; grid-template-areas: "owner main main late" "owner pill upd upd"; row-gap: 4px; padding: 0.5rem 0; align-items: center; }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .wt-main .wt-text small { display: none; }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .wt-owner { align-self: center; justify-self: start; width: 2.4rem; min-width: 0; }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .wt-late { justify-self: end; }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .wt-upd { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.78rem; color: var(--muted); }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .wt-upd > b { display: none; } /* the photo is the owner; the row keeps only the days in status */
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .wt-upd small { white-space: nowrap; }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .wt-upd small::before { content: none; }
  #page .manager-home .wt:has(> .wt-upd):not(.wt-free) > .btn { display: none; }
  /* opened: the row's top two lines stay; the full text comes under them, then the Open link on the left and the next-step button on the right.
     The link and its text are flattened so the tag, name and description are items of the row's grid. */
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) { grid-template-columns: 2.4rem 4.75rem minmax(0, 1fr) auto; grid-template-areas: "owner tag name late" "owner pill pill upd" "owner desc desc desc" "owner open btn btn"; row-gap: 8px; }
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) > .wt-main, #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) > .wt-main > .wt-text { display: contents; }
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) .wt-tag { grid-area: tag; align-self: start; }
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) .wt-text > b { grid-area: name; min-width: 0; }
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) .wt-text > b .wt-name { white-space: normal; }
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) .wt-text > small { grid-area: desc; display: block; -webkit-line-clamp: unset; overflow: visible; font-size: 0.9rem; line-height: 1.35; padding-top: 2px; }
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) > .wt-upd { justify-self: end; }
  #page .manager-home .wt.is-open:has(> .wt-upd):not(.wt-free) > .btn { display: inline-flex; grid-area: btn; justify-self: end; }
  #page .manager-home .wt.is-open > .wt-open { display: inline; grid-area: open; color: var(--link); font-weight: 600; justify-self: start; }
}

/* ---- Touch screens: buttons and chips are 30px, the height of the Service Line group tiles (Ali, 22 Oct 2026: one button size on phones; 44px was too tall).
   Above the 24px WCAG 2.2 minimum, with at least 8px between neighbours. Left taller on purpose: the main next-step buttons (.next-btn, .big), the pinned action bar
   (.case-actions), pop-up buttons, the technician wizard, inputs, selects, icon buttons and the bottom bar. ---- */
@media (pointer: coarse) {
  .btn:where(:not(.next-btn, .big)), .btn.small, a.btn.small, label.btn.small, .reg-card .btn.small, .qtn-row .btn.small, .reg-chip, .reg-fchip, .chip, .seg button, .wt-filters button, [role="tab"] { min-height: 30px; }
  .fold-btn { min-height: 30px; min-width: 30px; }                 /* the group fold arrow on the AMC and Zones lists */
  .btn.reg-fold-btn { padding-top: 4px; padding-bottom: 4px; }     /* the Filters bar on the Register and AMC pages */
}
