/* The look (desk v2 spec › 3, Decision 118: dense-desk's frame and page shapes, portal-panel's bottom bar; DESIGN 1
   to 18): the site's own stylesheet, the only one the base loads. Every rule lives here: the Content-Security-Policy
   allows only this file, no inline style, and only the site's own script files (js/desk.js and its modules, which
   set no style). A frame (the header across the top, the navigation down the left) in the scheme's colours, white with
   hairlines in light and the darkest surface in dark (DESIGN 10), round a canvas of white panels, one accent, the
   system font. Computer first (Decision 102): the
   desk layout from 960 CSS pixels; below 960 the navigation is a bar at the bottom, below 760 a grid's rows are
   cards, the phone the floor at 375. Rests on WCAG 2.2 (SC 1.4.3 and 1.4.11 contrast, 1.4.10 reflow, 2.4.1 bypass
   blocks, 2.4.7 and 2.4.11 focus, 2.5.5 and 2.5.8 target size), the Web Interface Guidelines (tabular figures,
   reduced motion, a skip link) and MDN on `position: sticky`, `:has()` and `<details>`. */

/* --- The tokens: the one place the look lives (desk v2 Task 19, Charlie 13 Oct 21:2x: "an airbnb-like aesthetics in
   terms of font, colours, design hierarchy, emphasis on important stuff ... and a dark version too", the grid "like a
   very nice excel template"). Airbnb's hierarchy: one typeface on a real scale (a large 600 title, the body at 400,
   small muted labels), near-black text on white with a grey for what is secondary, hairline borders, 8 and 12 px
   radii, generous room round the grid and tight inside it, one accent for the primary action and the marks only;
   emphasis by weight and size, never by more colour. The fine spreadsheet's: banded rows, a tinted header band, a
   totals bar at the foot. The typeface is the system's (SF on the Apple devices the co-founders use, Segoe UI on
   Windows): it carries the same hierarchy at no download, no flash of unstyled text and no font licence to vendor;
   a self-hosted Inter was weighed and not taken (tests/test_look.py pins that no font is loaded).

   Every colour a six-digit hex so tests/test_look.py measures each pair with the WCAG relative-luminance formula:
   text, muted text and the accent at least 4.5:1 on every surface a row or panel takes; white on the accent fill
   6.75:1; the control border, the focus ring and the mark at least 3:1; the frame's words 4.5:1 on it; each chip's
   words 4.5:1 on its tint; a grid's link 4.5:1 on every row tone and, in light, 3:1 against the row's text, so it
   may drop its underline at rest (WCAG 1.4.1, G183; in dark no colour meets both, so the customer's link carries its
   weight as the second cue). In dark the surfaces step up in tone with elevation (Material 3's surface tones; Apple's
   base and elevated backgrounds; Decision 121): the frame darkest, then the canvas, the panels and rows, the stripe,
   the header band and the inputs' field; text and borders lighten and the accent softens; the mark (a set filter,
   the open row, a button's edge) is the accent at reduced strength, so nothing set reads as a stuck focus ring. */
:root {
  color-scheme: light dark;
  /* type: one family, a scale of six sizes and three weights (DESIGN 15 and 16) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-title: 1.75rem;
  --fs-h2: 1.125rem;
  --fs-body: 0.9375rem;
  --fs-table: 0.875rem;
  --fs-small: 0.8125rem;
  --fs-label: 0.75rem;
  --fs-soft: 0.6875rem; /* the soft text under a Lines description: a step under the dense 12 px cell (DR77), as the headers' */
  --fw-body: 400;
  --fw-medium: 500;
  --fw-strong: 600;
  /* room, corners and lines */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 6px; /* the legacy's md: buttons, badges, menu rows */
  --radius-xs: 4px; /* the legacy's sm */
  --radius-pill: 999px; /* a chip */
  --z-menu: 20; /* the layers, low to high: a menu, a floating panel, a popover, the popup (the legacy's 40 and 60) */
  --z-float: 30;
  --z-popover: 40;
  --z-modal: 60;
  --row-h: 2rem;
  --chev-w: 1.625rem;
  --cell-y: 0.375rem; /* a table cell: 6 px above and below, 8 px at the sides (slice 5e; the header the same at the sides) */
  --cell-x: 0.5rem;
  --row-dense: 2.5rem; /* the Lines row: the legacy's dense 40 px as the floor; Comfortable is --row-comfy */
  --row-comfy: 3.25rem;
  --head-h: 2.5rem; /* a funnel grid's header cell: the icon row (--fn-w, 16 px) over the label's 24 px (WCAG 2.5.8), 40 px; the icon row 24 px and the label 44 px (DESIGN 12) on a coarse pointer */
  --fn-slot: 1.25rem; /* the plain tables' (i): a 12 px glyph in a 20 px slot, beside the resize handle at the edge */
  --bch: 0.75ch; /* one character of the grid's 12 px body font, in the face the page has ("0", tabular digits): a default width is its characters times this plus its fixed px, so a wider face widens the column instead of wrapping its figure (Linux's faces are wider than the Mac's); registered below, so it is a length computed here at the root and inherited as pixels; this needs `@property` (Chrome 85, Safari 16.4, Firefox 128) and has no fallback: a browser without it resolves the token in each element's own font */
  --fn-w: 1rem; /* the Lines header's funnel and (i): a 12 px glyph in a 16 px button (2 px each side: the hairline to its label), drawn right after the label; 24 px on a coarse pointer (WCAG 2.5.8's size), below */
  --rz-w: 0.5rem; /* the resize handle's hit area, a strip at each header cell's right edge */
  --rz-dense: 0.375rem; /* the Lines header's: 6 px, the funnel button's own spare 6 px lies under it */
  --cols-w: calc(var(--bch) * 68.75 + 20rem); /* the Lines table's fixed columns together with the chevron's (about 840 px on the Mac, the dense defaults: Ton off); a page's own region (data-grid) sums the columns it shows, this is the fallback; the description takes the rest, from --desc-min */
  --desc-min: 8rem; /* 128 px (was 160: the figures' columns are sized to their characters now, a wider face widens them and the description gives way first): about 20 characters a line, so the median description (38 characters of 111,169 live lines) shows whole; the description takes every pixel the other columns leave, from here up */
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 12px rgb(0 0 0 / 0.06);
  --shadow-menu: 0 8px 24px rgb(0 0 0 / 0.3); /* a menu or panel that floats over the page */
  --shadow-pop: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4); /* a popover (the legacy's shadow-xl) */
  --shadow-search: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.2); /* the search box and its list (shadow-lg) */
  --shadow-lift: 0 8px 16px -4px rgb(0 0 0 / 0.25); /* a banner stuck over the table */
  --shadow-modal: 0 25px 50px -12px rgb(0 0 0 / 0.5); /* the popup (shadow-2xl) */
  --scrim: rgb(0 0 0 / 0.6); /* behind a popup */
  --press: rgb(0 0 0 / 0.15); /* a button under the pointer */
  --side-head-h: 3.53rem; /* the navigation's head, the legacy's 56.5 px */
  --above-box: 7rem; /* what stands above a grid's box (the search row, its counts): the box ends at the window's foot */
  --nav-w: 14rem;
  --rail-w: 3.5rem;
  --bar-h: 3.5rem;
  /* colours, light: near-black on white, two greys, hairlines; the frame white with a hairline */
  --bg: #ffffff;
  --canvas: #f7f7f7;
  --surface: #f2f2f2;
  --field: #ffffff;
  --text: #222222;
  --muted: #6a6a6a;
  --rule: #ebebeb;
  --control: #858585;
  --zebra: #ffffff;
  --hover: #f0f4fc;
  --accent: #2453c4;
  --accent-fill: #2453c4;
  --accent-soft: #e8eefb;
  --on-accent: #ffffff;
  --focus: #2453c4;
  --mark: #2453c4;
  --link: #3966d0;
  --chrome: #ffffff;
  --chrome-2: #f2f2f2;
  --on-chrome: #222222;
  --chrome-muted: #6a6a6a;
  --chrome-accent: #2453c4;
  --dealer: #5b3fc4;
  --dealer-bg: #ede9fe;
  --end-user: #0f766e;
  --end-user-bg: #ccfbf1;
  --tyre-bg: #e4f3e6;
  --recon: #3d6e45;
  --recon-bg: #f4faf5;
  --check: #6b4f00;
  --check-bg: #fff4cc;
  --wrong: #9b1c1c;
  --wrong-bg: #fde8e8;
  --up: #1a7f37; /* a change above 0 beside its + sign (the Business overview V2, 9 Nov 2026); --down is below 0 */
  --down: #b42318;
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; /* V2's chart series, in this order (the dataviz reference palette, validated on --bg) */
  --text-2: #3d3d3d;
  --faint: #8a8a8a;
  --status-completed: #1a7f37; /* ServiceM8's Completed green: the job card's band and chip (Charlie, 28 Oct 2026, "ServiceM8 layout"; the one exception to DESIGN 10's one accent colour) */
  --on-status-completed: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.3);
    --bg: #0f1626;
    --canvas: #030712;
    --surface: #182033;
    --field: #0f1626;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --rule: #1f2937;
    --control: #6b7280;
    --zebra: #0f1626;
    --hover: #182033;
    --accent: #93c5fd;
    --accent-fill: #2563eb;
    --accent-soft: #162645;
    --on-accent: #ffffff;
    --focus: #93c5fd;
    --mark: #3b82f6;
    --link: #93c5fd;
    --chrome: #0f1626;
    --chrome-2: #182033;
    --on-chrome: #f3f4f6;
    --chrome-muted: #9ca3af;
    --chrome-accent: #93c5fd;
    --dealer: #c4b5fd;
    --dealer-bg: #25234b;
    --end-user: #5eead4;
    --end-user-bg: #103039;
    --tyre-bg: #1f4528;
    --recon: #8fcc9a;
    --recon-bg: #2a3d31;
    --check: #f0d36b;
    --check-bg: #463c0e;
    --wrong: #f4a3a3;
    --wrong-bg: #5c2828;
    --up: #6ee7a0;
    --down: #f4a3a3;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300;
  --text-2: #d1d5db;
  --faint: #6b7280;
  --status-completed: #166534;
  --on-status-completed: #ffffff;
  }
}

/* A chosen theme (the header's control, desk v2 Task 19): Light keeps the light tokens above whatever the device;
   Dark takes the same dark values as the block above (tests/test_look.py pins the copy equal), and the browser's
   own controls and scrollbars follow through `color-scheme`. Auto sets nothing and follows the device. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.3);
  --bg: #0f1626;
  --canvas: #030712;
  --surface: #182033;
  --field: #0f1626;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --rule: #1f2937;
  --control: #6b7280;
  --zebra: #0f1626;
  --hover: #182033;
  --accent: #93c5fd;
  --accent-fill: #2563eb;
  --accent-soft: #162645;
  --on-accent: #ffffff;
  --focus: #93c5fd;
  --mark: #3b82f6;
  --link: #93c5fd;
  --chrome: #0f1626;
  --chrome-2: #182033;
  --on-chrome: #f3f4f6;
  --chrome-muted: #9ca3af;
  --chrome-accent: #93c5fd;
  --dealer: #c4b5fd;
  --dealer-bg: #25234b;
  --end-user: #5eead4;
  --end-user-bg: #103039;
  --tyre-bg: #1f4528;
  --recon: #8fcc9a;
  --recon-bg: #2a3d31;
  --check: #f0d36b;
  --check-bg: #463c0e;
  --wrong: #f4a3a3;
  --wrong-bg: #5c2828;
  --up: #6ee7a0;
  --down: #f4a3a3;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300;
  --text-2: #d1d5db;
  --faint: #6b7280;
  --status-completed: #166534;
  --on-status-completed: #ffffff;
}

/* --- The page and the type scale (DESIGN 15 and 16): the tokens' family, nothing loaded; body --fs-body, tables
   --fs-table, small --fs-small, labels --fs-label, h1 --fs-title; weights 400, 500 and 600. */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-family: var(--font); } /* the face on the root too, so `--bch` (one body character) is measured in the page's own face */
@property --bch { syntax: "<length>"; inherits: true; initial-value: 7px; } /* the initial value applies only where @property is understood; below Chrome 85, Safari 16.4 and Firefox 128 there is no fallback (the project's popover and anchor rules need newer browsers anyway) */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: var(--space-4) 0 var(--space-2); text-wrap: balance; overflow-wrap: anywhere; font-weight: var(--fw-strong); }
h1 { font-size: var(--fs-title); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-body); }
small { font-size: var(--fs-small); }
p, ul, ol, dl, form, fieldset, details, article { margin: 0 0 var(--space-3); }
ul, ol { padding-left: 1.25rem; }
main > p { max-width: 75ch; }
main > :first-child { margin-top: 0; }
.muted { color: var(--muted); }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em; }
/* a long refusal message wraps at 375 rather than pushing the page sideways (DESIGN 1) */
mark { color: var(--check); background: var(--check-bg); padding: 0 0.2em; border-radius: 2px; overflow-wrap: anywhere; }
del { color: var(--muted); }
del a { text-decoration-line: line-through; color: var(--muted); } /* a decoration never reaches an inline-flex box
   (CSS Text Decoration 3, 2.1), so a struck linked description is struck here */
hr { border: 0; border-top: 1px solid var(--rule); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* An icon from the sprite (screens/static/screens/icons.svg), drawn in its text's colour beside the words it stands
   for, so it is hidden from assistive technology. */
.icon { flex: none; width: 1.125rem; height: 1.125rem; vertical-align: -0.2em; }

/* The skip link (SC 2.4.1): the keyboard's first stop, out of sight until focused, to `<main id="main">`. */
.skip { position: absolute; left: var(--space-2); top: -4rem; z-index: var(--z-float); padding: var(--space-2) var(--space-3); color: var(--accent); background: var(--bg); border-radius: var(--radius); }
.skip:focus { top: var(--space-2); }
main:focus:not(:focus-visible) { outline: none; } /* the skip link moves focus here; a mouse never rings the page */

/* --- The frame (DESIGN 10 and 17; spec › 3; slice 5e): the navigation down the left and the bottom bar hold everything the
   header across the top held (it is gone, Charlie 14 Oct 18:5x); only a signed-out page has a slim header with the name. */
body > header {
  display: flex;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--chrome);
  color: var(--on-chrome);
  border-bottom: 1px solid var(--rule); /* a hairline: the white frame against the page (desk v2 Task 19) */
}
body > header .name { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 1.0625rem; color: var(--on-chrome); text-decoration: none; }
/* The mark: a letter in the accent's fill, its alternative text empty, so a screen reader reads the name once. */
body > header .name::before { content: "A" / ""; display: inline-grid; place-items: center; width: 1.625rem; height: 1.625rem; border-radius: var(--radius); background: var(--accent-fill); color: var(--on-accent); font-size: 0.875rem; font-weight: 600; }
.side :focus-visible,
.bottom-bar :focus-visible,
body > header :focus-visible { outline-color: var(--chrome-accent); }

/* The left navigation from 960 pixels, the legacy page's (the study's 1.2; Charlie 14 Oct 2026: "copy it exactly"): the
   brand "Aexus Search" and the collapse chevron in a 56.5 px head, the entries 14 px medium in 6 px-rounded rows (the
   page shown in the accent's tint with a 2 px bar at the left, aria-current), then Work and Admin as before, the role and
   address and "All prices pre-GST" at the foot. Collapsed to a 56 px rail of icons the words stay as each link's accessible
   name and tooltip; the width moves over 150 ms (the script flips the class, the server renders it the same). */
.side {
  display: none;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid var(--rule);
  background: var(--chrome);
  color: var(--on-chrome);
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); height: var(--side-head-h); flex: none; padding: 0 0.75rem; border-bottom: 1px solid var(--rule); }
.side .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 700; color: var(--text); text-decoration: none; }
.side .brand:hover { color: var(--accent); }
.side ul { list-style: none; margin: 0; padding: 0.5rem 0.5rem 0; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-h { margin: var(--space-3) 1.25rem 0; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--chrome-muted); }
.side a,
.side summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.side .icon { color: inherit; width: 1.125rem; height: 1.125rem; }
.side a:hover,
.side summary:hover { background: var(--chrome-2); color: var(--text); }
.side a[aria-current=page] { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--mark); color: var(--accent); }
.side details { margin: var(--space-2) 0.5rem 0; padding: 0; border: 0; background: none; }
.side summary { list-style: none; cursor: pointer; }
.side summary::-webkit-details-marker { display: none; }
.side summary::after { content: "▾" / ""; margin-left: auto; font-size: 0.75rem; color: var(--chrome-muted); }
.side details:not([open]) > summary::after { content: "▸" / ""; }
.side details ul { margin: 2px 0 0; padding: 0 0 0 1.75rem; }
.side details a { padding-block: 0.25rem; font-weight: 400; color: var(--chrome-muted); }
.side details a:hover,
.side details a[aria-current=page] { color: var(--text); }
.side-foot { margin-top: auto; padding: 0.75rem; border-top: 1px solid var(--rule); font-size: 0.75rem; color: var(--chrome-muted); }
.side .who { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.side .who span { color: var(--on-chrome); }
.side .note { margin: var(--space-2) 0 0; }
/* The account strip (`_account.html`), in the navigation's foot and the bottom bar's Account menu: the as-of time, then the
   theme control and Sign out side by side, small; a collapsed rail stacks their icons, the words kept as tooltips. */
.asof { display: flex; align-items: center; gap: 0.375rem; margin: 0 0 var(--space-2); font-size: 0.75rem; color: var(--chrome-muted); }
.asof time { color: var(--on-chrome); }
.asof.refused { align-items: flex-start; } /* a co-founder's refused rebuild (live refresh Task 7): the info mark for the clock and the Questions banner's colour (`--check`), with its words */
.asof.refused .icon { margin-top: 0.125rem; color: var(--check); }
.asof .why { display: block; color: var(--check); font-weight: var(--fw-medium); }
.acts { display: flex; align-items: center; gap: var(--space-2); }
.acts form { margin: 0; }
.acts :is(details.theme > summary, .signout button) { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 1.75rem; padding: 0 0.5rem; color: var(--on-chrome); background: transparent; border: 1px solid var(--control); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: var(--fw-medium); white-space: nowrap; box-shadow: none; }
.acts .icon { width: 0.875rem; height: 0.875rem; }
.side .acts details.theme > summary::after { content: none; } /* the navigation's own caret is for its disclosures */
.side .nav-admin,
.side .nav-pop { display: none; } /* the rail's Admin menu, shown below with `.narrow` */
main { flex: 1 0 auto; min-width: 0; padding: var(--space-3); }

/* From 960 pixels the desk: the navigation sticky at the left at the viewport's height, the content using the remaining
   width, its first row the page's own (no strip above it, slice 5e). */
.bottom-bar { display: none; }
@media (min-width: 960px) {
  body.desk {
    display: grid;
    grid-template-columns: var(--nav-w) minmax(0, 1fr);
  }
  body.desk > .side { display: flex; grid-column: 1; grid-row: 1 / -1; position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; z-index: 11; }
  body.desk > main { grid-column: 2; grid-row: 1; padding: var(--space-3) 1.25rem var(--space-5); } /* the legacy's 16 px above the page's first row */
}
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  body.desk { transition: grid-template-columns 150ms cubic-bezier(0.4, 0, 0.2, 1); }
}

/* Below 960 pixels the navigation is a bar at the bottom of the screen (from portal-panel), in thumb reach (DESIGN 1):
   an icon over a word per screen, the page shown in the frame's accent; Admin a menu whose list opens above the bar.
   The page keeps the bar's height free at its foot, so its last line is never under the bar. */
@media (max-width: 959.98px) {
  body.desk > main { padding-bottom: calc(var(--bar-h) + var(--space-4) + env(safe-area-inset-bottom)); }
  /* A focused control scrolled into view clears the bottom bar (SC 2.4.11; WCAG Technique C43). */
  html { scroll-padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  .desk > .bottom-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-menu);
    padding: 0 0 env(safe-area-inset-bottom);
    background: var(--chrome);
    border-top: 1px solid var(--chrome-2);
  }
  .bottom-bar > ul { list-style: none; margin: 0; padding: 0; display: flex; }
  .bottom-bar > ul > li { flex: 1 1 0; min-width: 0; }
  .bottom-bar > ul > li > a,
  .bottom-bar summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--bar-h);
    padding: 0.25rem 0.125rem;
    color: var(--chrome-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    text-decoration: none;
    list-style: none;
    cursor: pointer;
  }
  .bottom-bar summary::-webkit-details-marker { display: none; }
  .bottom-bar .icon { width: 1.375rem; height: 1.375rem; }
  .bottom-bar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-bar a[aria-current=page],
  .bottom-bar details[open] > summary,
  .bottom-bar details:has([aria-current=page]) > summary { color: var(--on-chrome); box-shadow: inset 0 2px 0 var(--chrome-accent); }
  .bottom-bar a[aria-current=page] .icon,
  .bottom-bar details:has([aria-current=page]) > summary .icon { color: var(--chrome-accent); }
  .bottom-bar details,
  .bottom-bar details[open] { margin: 0; padding: 0; border: 0; background: none; } /* [open] too: the page's `details[open]` adds 0.5rem under the Admin tab, a bar 8 px taller open than shut (bug walk N9) */
  .bottom-bar details[open] > ul {
    position: fixed;
    right: var(--space-2);
    bottom: calc(var(--bar-h) + var(--space-2) + env(safe-area-inset-bottom));
    width: min(16rem, calc(100vw - 2 * var(--space-2)));
    margin: 0;
    padding: var(--space-1);
    list-style: none;
    background: var(--chrome);
    border: 1px solid var(--chrome-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    max-height: calc(100dvh - var(--bar-h) - 3 * var(--space-2) - env(safe-area-inset-bottom)); /* a short screen: the list scrolls, its first row reachable */
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .bottom-bar details[open] > .acct-panel { /* the Account menu (`_account.html`): the same box as the Admin list */
    position: fixed; right: var(--space-2); bottom: calc(var(--bar-h) + var(--space-2) + env(safe-area-inset-bottom));
    width: min(16rem, calc(100vw - 2 * var(--space-2))); padding: var(--space-3); font-size: 0.8125rem;
    background: var(--chrome); border: 1px solid var(--chrome-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-menu);
  }
  .acct-panel .acts { flex-wrap: wrap; }
  .acct-panel details.theme { flex: 1 1 100%; }
  .acct-panel details.theme > summary { flex-direction: row; min-height: 2.75rem; padding: 0 0.75rem; font-size: 0.8125rem; color: var(--on-chrome); box-shadow: none; }
  .acct-panel details.theme[open] > summary { box-shadow: none; }
  .acct-panel .theme-form { position: static; min-width: 0; margin-top: var(--space-1); box-shadow: none; }
  .acct-panel .signout { flex: 1 1 100%; }
  .acct-panel .signout button { width: 100%; min-height: 2.75rem; justify-content: center; }
  .bottom-bar details[open] > ul a { display: flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem; border-radius: var(--radius); color: var(--on-chrome); text-decoration: none; }
  .bottom-bar details[open] > ul a[aria-current=page] { background: var(--chrome-2); box-shadow: inset 3px 0 0 var(--chrome-accent); }
}

/* --- The ordering entries' colours (ordering v4, Task 7; Charlie: "the tab will be highlighted in red or some colour on the
   left tab so i know its time to order"). A brand that is red ("order now") or amber ("order by <date>", "answer
   withheld", stale figures) wears the flag tokens every grid already uses, --wrong on --wrong-bg and --check on
   --check-bg, in light and dark, with its words beside the label and a dot on the icon: red a solid dot, amber a ring,
   so the state is never the colour alone (WCAG 1.4.1). Plain wears nothing. The icon rail keeps the tint and the dot;
   the words stay in the link's accessible name and its tooltip (`.lbl` is hidden there, not removed). On the phone
   the Admin tab carries a dot in the worst colour, with the words in its accessible name, and its menu items wear
   the sidebar's marker. */
.side .ic { position: relative; display: inline-flex; flex: none; }
.side a.alert-red { --ring: var(--wrong-bg); background: var(--wrong-bg); color: var(--wrong); }
.side a.alert-amber { --ring: var(--check-bg); background: var(--check-bg); color: var(--check); }
.side a.alert-red:hover,
.side a.alert-amber:hover { background: var(--ring); color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.side a.alert-red[aria-current=page],
.side a.alert-amber[aria-current=page] { background: var(--ring); box-shadow: inset 2px 0 0 currentColor; }
.side a.alert-red .lbl,
.side a.alert-amber .lbl { min-width: 0; overflow-wrap: anywhere; }
.alert-words { display: block; font-size: 0.75rem; font-weight: 400; line-height: 1.3; }
.alert-dot { position: absolute; top: -0.1875rem; right: -0.25rem; width: 0.5rem; height: 0.5rem; box-sizing: border-box; border: 2px solid currentColor; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px var(--ring); }
.alert-amber .alert-dot { background: var(--check-bg); }
.bottom-bar summary, .bottom-bar > ul > li > a { position: relative; }
.tab-count { position: absolute; top: 0.25rem; left: calc(50% + 0.25rem); min-width: 1rem; box-sizing: border-box; padding: 0 0.25rem; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 2px var(--chrome); font-size: 0.6875rem; font-weight: 600; line-height: 1rem; text-align: center; font-variant-numeric: tabular-nums; } /* Questions' count over its icon, the desk navigation's `.side .count` (#742); the Admin tab's dot sits in the same place */
.tab-dot { position: absolute; top: 0.4375rem; left: calc(50% + 0.5rem); width: 0.625rem; height: 0.625rem; box-sizing: border-box; border: 2px solid var(--wrong); border-radius: 50%; background: var(--wrong); box-shadow: 0 0 0 2px var(--chrome); }
.tab-dot.alert-amber { border-color: var(--check); background: var(--check-bg); }
@media (max-width: 959.98px) {
  .bottom-bar details[open] > ul a.alert-red,
  .bottom-bar details[open] > ul a.alert-amber { margin-block: 2px; padding-block: 0.375rem; }
  .bottom-bar details[open] > ul a .lbl,
  .bottom-bar details[open] > ul a .alert-words { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; } /* the words wrap, never an ellipsis */
  .bottom-bar details[open] > ul a.alert-red { background: var(--wrong-bg); color: var(--wrong); }
  .bottom-bar details[open] > ul a.alert-amber { background: var(--check-bg); color: var(--check); }
  .bottom-bar details[open] > ul a.alert-red[aria-current=page],
  .bottom-bar details[open] > ul a.alert-amber[aria-current=page] { box-shadow: inset 3px 0 0 currentColor; }
}

/* --- A page's head (spec › 3): a breadcrumb, the title and a line of facts; the customer's figures as tiles; the
   invoice and the Questions' groups as panels. */
.crumbs ol { list-style: none; margin: 0 0 var(--space-1); padding: 0; display: flex; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); }
.crumbs li + li::before { content: "/" / ""; margin: 0 0.375rem; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); }
.page-head h1 { margin: 0; }
.page-head p { margin: 0; }
.page-head .totals { flex: 1 1 100%; font-size: var(--fs-small); }
/* The Lines summary (Task 18's live region, `#grid-summary`, read aloud when the grid updates in place) shows only its
   muted sentence under the title: its counts are in the totals bar at the grid's foot (Task 19), so they are kept for
   a screen reader alone; with no line on the page, and so no totals bar, the sentence goes too (review m-7). */
#grid-region > .page-head:has(> #grid-summary.totals) { margin: 0; } /* the Lines page's head holds only words for a screen reader: no gap above the search row */
#grid-summary.totals > span:first-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.grid-region:not(:has(tfoot)) #grid-summary.totals > .muted { display: none; }
dl.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) 2rem; margin: 0 0 var(--space-3); }
dl.facts dt { font-size: 0.75rem; color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
dl.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-2); max-width: 50rem; margin: 0 0 var(--space-3); }
dl.stats > div { padding: 0.625rem 0.875rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
dl.stats dt { font-size: 0.75rem; color: var(--muted); }
dl.stats dd { margin: 0; font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
dl.stats.figs { grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1fr); max-width: 34rem; }  /* the item's figures row: three tiles in one row at 375 (#696) */
dl.stats.figs > div { padding: 0.5rem 0.625rem; }
dl.stats.figs dd { font-size: 1rem; overflow-wrap: anywhere; }
.panel { padding: var(--space-3) 1.25rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg); margin: 0 0 var(--space-3); }
.panel > :last-child { margin-bottom: 0; }
.panel > h2:first-child { margin-top: 0; }
.panel .page-head .btn .icon { width: 1rem; height: 1rem; }
ul.flags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }  /* one wrapping row of chips (#696) */
ul.flags li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1); min-width: 0; max-width: 100%; }  /* a flex item, so no line-height strut makes a row taller than its chip */
ul.flags .chip { white-space: normal; border-radius: var(--radius); }  /* a long chip wraps inside itself, never past the page (375) */
@media not all and (min-width: 760px) { ul.flags { gap: 0.25rem; margin: 0 0 var(--space-3); } ul.flags .chip { padding-inline: 0.35em; } } /* the head's chips on a phone: tight, so two short ones share a row (PC-6) */
.q-actions { align-items: center; margin: 0 0 var(--space-3); }
.q-actions p { margin: 0; }

/* --- Tables (DESIGN 5 and 16): each in its own scroll box, so the page never scrolls sideways (SC 1.4.10); from 960
   pixels the box is bounded by the viewport and scrolls both ways, so its header rows stick inside it; dense rows,
   zebra stripes, numbers right-aligned in tabular figures, long text cut to one line (the full text in its title). */
.table-box {
  overflow-x: auto;
  width: max-content;
  max-width: 100%;
  margin: 0 0 var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  /* A shadow at the right edge while there is more to the right (DESIGN 1): the cover travels with the content
     (local) and hides the shadow once the end is reached; CSS only, as the CSP allows no script. */
  background-color: var(--bg);
  background-image: linear-gradient(to left, var(--bg) 30%, transparent),
    radial-gradient(farthest-side at 100% 50%, var(--control), transparent);
  background-position: right center, right center;
  background-size: 2.5rem 100%, 0.75rem 100%;
  background-repeat: no-repeat;
  background-attachment: local, scroll;
}
.table-box.wide { width: 100%; } /* a record grid uses the width, not its content's (the look panel, plan C) */
[data-plain].table-box { width: 100%; } /* the Business page's plain tables are one width, the main column's, not each its content's (N13, 5 Nov 2026) */
nav.sections ~ section, nav.sections ~ section h3[id] { scroll-margin-top: var(--space-3); } /* the Business overview's section links land with the heading a little clear of the screen's top edge (walk 2, N6) */
.table-box :focus { scroll-margin-top: 4.5rem; } /* SC 2.4.11: a focused control clears the sticky header rows */
.table-box form[id^="v-"] { scroll-margin-top: 3rem; } /* a Hide or Show returns to its row (#882): the row lands clear of the sticky heading, with its line in view */
@media (min-width: 960px) {
  .table-box { overflow: auto; max-height: calc(100vh - var(--above-box) - 1rem); }
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; line-height: 1.35; }
th, td { padding: 0.375rem 0.625rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid var(--control);
}
thead th a { color: var(--text); text-decoration: none; }
.grid thead th { font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: 0.01em; } /* small labels, so no
   label widens a number's column */
.grid thead th a { color: var(--muted); }
.grid thead th[aria-sort] a { color: var(--accent); }
thead th a:hover { color: var(--accent); text-decoration: underline; }
/* The sorted column says so beside its label, in the accent; aria-sort carries it for a screen reader, so the arrow's
   own alternative text is empty. */
thead th[aria-sort] a { color: var(--accent); }
thead th[aria-sort=ascending] a::after { content: " ▲" / ""; font-size: 0.75em; }
thead th[aria-sort=descending] a::after { content: " ▼" / ""; font-size: 0.75em; }
/* The stripes count a table's rows but a lines table's opened rows (`tr.more`, desk v2 spec › 4.4), so they alternate
   line by line whether a row is open or not; every other table keeps its stripes (the `of S` form: Baseline 2023). */
tbody tr:nth-child(even of :not(.more)) { background: var(--zebra); }
tbody tr:last-child > * { border-bottom: 0; }
tfoot th, tfoot td { border-top: 1px solid var(--rule); border-bottom: 0; }
tfoot tr.total > * { font-weight: 600; border-top: 2px solid var(--control); }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; } /* dates align, as numbers do */
/* The totals bar (desk v2 Task 19, a fine spreadsheet's): the count and the totals under their columns, in the header
   band's tint, pinned at the grid's foot while its rows scroll in the box. */
.grid tfoot tr.sum > * { position: sticky; bottom: 0; z-index: 1; padding-block: 0.5rem; background: var(--surface); border-top: 1px solid var(--control); border-bottom: 0; font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: left; }
.grid tfoot tr.sum > .num { text-align: right; }
.grid tfoot th[colspan] { overflow: hidden; text-overflow: ellipsis; } /* the count's cell holds the typical price too (#272); its title says it whole */
.grid tfoot .typical { font-weight: var(--fw-body); font-size: var(--fs-small); color: var(--muted); }
.grid tfoot th:has(> .typical) { white-space: normal; text-wrap: pretty; } /* two figures outgrow the cell at 1280: wrapped, not cut */
th.num,
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.wrap { overflow-wrap: anywhere; min-width: 12rem; }
.cut { max-width: 24rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:not(td, th).cut { display: inline-block; vertical-align: bottom; } /* beats `td a`, so a cut link shows its "…" */
/* A record grid's columns: each cell on one line, narrower padding, a wrong line's reason cut short, each full text
   in its title (a re-saved copy's link to the counted copy stays whole beside its cut words). Below 1280 the
   description and the customer's name are capped, so the box fits at 960 with the navigation open; from 1280 (desk
   v2 Task 19) a lines grid's Customer and Description share the free width instead (a cell's `max-width: 0` takes
   it out of the columns' content widths, so the two take what the other columns leave, each by its share), and a
   name or a description is cut only when the window is narrower than it; a floor keeps a few words of each beside
   the free width. From 1500 the reason takes the room there is. */
.wide th, .wide td { padding-inline: 0.35rem; white-space: nowrap; }
.wide .cut { max-width: 11rem; }
.wide .cut.why { max-width: 4rem; }
@media not all and (min-width: 1280px) {
  .wide .cut.desc { max-width: 11rem; } /* with its sales arrow beside it */
  .wide .cut.name { max-width: 8rem; }
}
@media (min-width: 1280px) {
  .grid td.c-customer:has(.name) { width: 28%; max-width: 0; min-width: 7rem; }
  .grid td.c-description:has(.desc) { width: 72%; max-width: 0; min-width: 9rem; }
  .grid .cut.name,
  .grid .cut.desc { max-width: 100%; }
}
/* The Customers and Items grids' five or six columns leave their name or description the room of a plain cut, so two
   labels that share their first 11rem still tell apart; at phone width they are cards. */
@media (min-width: 960px) {
  .wide .cut.label { max-width: 24rem; }
}
@media (min-width: 1440px) {
  .wide .cut.why { max-width: 10rem; } /* a wrong line's reason reads from 1440, where the description has room (m-1) */
}
@media (min-width: 1500px) {
  .wide .cut { max-width: 20rem; }
  .wide .cut.why { max-width: 20rem; }
}

/* --- A description and the row that opens (desk v2 spec › 4.4, 4.9, 4.10; plan Task 1). A description is text in its
   lines (`.lines`, never on a cut element: a grid cell keeps one line); its item's sales link is left out of a drag,
   so a drag inside the text selects the text alone: in a grid a quiet arrow at the cell's right edge, held out of the
   text's box (desk v2 Task 19), on the invoice page "sales ›" after the text. A lines table's first column holds a chevron, a native
   disclosure (`<details name="row">`, one open at a time; the APG Disclosure pattern), and the row beneath each line
   shows only while the line's disclosure is open. Its cell wraps within the table (`contain: inline-size` gives the
   panel no width of its own), so no column moves when it opens; where the table scrolls in its box, the panel stays
   at the box's left at the box's width (a container query unit), so its text reads without scrolling sideways. */
.lines { white-space: pre-line; }
.sales { font-size: 0.75rem; white-space: nowrap; -webkit-user-select: none; user-select: none; }
.wide .cut.desc,
.wide .sales { vertical-align: top; } /* level with the row's other cells, whatever the link's height */
/* The "sales ›" link is 24 pixels tall on a mouse (DESIGN 12; SC 2.5.8) and 44 on a touch screen (SC 2.5.5) without
   moving its line: a 1rem line and padding above and below, which a matching negative margin takes back out of the
   line box, so a row stays one line tall and a description's last line keeps its height. */
td a.sales { display: inline-block; min-height: 0; line-height: 1rem; padding-block: 4px; margin-block: -4px; }
/* A grid's arrow: 24 by 24 at the cell's right edge, centred on the row, muted at rest and in the link's colour on
   a hover or a focus; the cell keeps its room, so the text never runs under it. */
.grid td.c-description:has(> .sales) { position: relative; padding-right: 1.625rem; }
.grid tbody tr:not(.more) > td:not([colspan]) > a.sales { position: absolute; top: 50%; right: 0; display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -12px 0 0; padding: 0; line-height: 1; font-size: 0.875rem; color: var(--muted); border-radius: var(--radius); }
.grid tbody tr:not(.more) > td:not([colspan]) > a.sales:hover,
.grid tbody tr:not(.more) > td:not([colspan]) > a.sales:focus-visible { color: var(--link); background: var(--hover); }
/* At rest on a mouse the arrow waits for its row (review I-2: from 1280 a column of arrows beside Qty read as stray
   glyphs): shown while the row is hovered or holds the focus, so a keyboard's Tab still lands on it and shows it, as
   Airtable reveals a row's icons; on a touch screen it always shows, having no hover. */
@media (hover: hover) and (pointer: fine) {
  .grid tbody tr:not(.more, :hover, :focus-within) > td:not([colspan]) > a.sales { opacity: 0; }
}
.grid { container-type: inline-size; }
.grid .c-x { width: 1.625rem; padding-inline: 0.125rem 0; text-align: center; }
.grid td.c-x details,
.grid td.c-x details[open] { margin: 0; padding: 0; border: 0; min-width: 0; background: none; }
.grid td.c-x summary { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; padding: 0; color: var(--muted); border-radius: var(--radius); list-style: none; }
.grid td.c-x summary::-webkit-details-marker { display: none; }
.grid td.c-x summary:hover { color: var(--text); background: var(--rule); }
.grid td.c-x details[open] summary { color: var(--accent); }
.chev { width: 1rem; height: 1rem; }
.grid td.c-x details[open] .chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: no-preference) {
  .grid td.c-x .chev { transition: transform 120ms ease-out; }
}
.grid tbody tr.row:hover { background: var(--hover); }
/* A grid's rows are dense on a fine pointer (DESIGN 16; desk v2 Task 19): 2.25rem at 0.875rem type, every cell
   centred on the row; a coarse pointer's 44 px targets make its rows taller (below). Its links are quiet at rest: no
   underline, the link's colour (above, the tokens), the customer's name a little heavier; a hover or a keyboard focus
   underlines one; the invoice's number keeps its underline, the row's anchor. A struck row's links stay struck. */
@media (min-width: 760px) { /* the table's rows (below 760 they are cards); a cut name or description is a block of
     one line, centred with the row's other cells */
  .grid tbody tr:not(.more) > td:not([colspan]) { height: var(--row-h); vertical-align: middle; }
  .grid tbody tr .cut:is(.name, .desc, .label) { display: block; }
  .grid tbody tr a.cut:is(.name, .label) { line-height: 24px; } /* 24 px tall (SC 2.5.8) */
}
@media (min-width: 1280px) { /* the free width goes to the customer and the description (above) */
  .grid th,
  .grid td { padding-inline: 0.2rem; } /* a spreadsheet's tight cells */
  .grid :is(th, td):last-child { padding-right: var(--space-2); } /* the last cell clear of the box's edge (m-1) */
}
.grid tbody tr:not(.more) > td:not([colspan]) a { color: var(--link); text-decoration: none; }
.grid tbody tr:not(.more) > td:not([colspan]) a:hover,
.grid tbody tr:not(.more) > td:not([colspan]) a:focus-visible { text-decoration-line: underline; }
.grid tbody tr:not(.more) > td:not([colspan]).c-invoice a { text-decoration-line: underline; }
.grid tbody tr:not(.more) > td:not([colspan]) a.cut { font-weight: var(--fw-medium); } /* a customer's or an item's name */
/* In dark no link colour is both AA on every row tone and 3:1 against the text (G183; measured, and confirmed by the
   review), so a name's link carries a real weight step as its non-colour cue (WCAG 1.4.1: bold, review I-5): under
   the device's dark scheme unless Light was chosen, and under a chosen Dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grid tbody tr:not(.more) > td:not([colspan]) a.cut { font-weight: var(--fw-strong); }
}
:root[data-theme="dark"] .grid tbody tr:not(.more) > td:not([colspan]) a.cut { font-weight: var(--fw-strong); }
/* The Business page's plain tables (UX pass, 1 Nov 2026, P3): a figure that opens its lines keeps the link colour and
   loses its underline at rest in light, the underline coming back on hover and focus, as the grid's links above (--link
   is 3:1 against --text in light, WCAG G183; tests/test_look.py pins it). Where colour cannot carry it (dark, 1.64:1
   from the text) or nothing can be hovered (a touch screen), a thin underline at 75 % of the link colour stays. A link
   inside a sentence (the verdict) is not in a table cell and keeps its own. */
[data-plain] table.invoice-lines td > a { color: var(--link); text-decoration-line: none; text-decoration-thickness: 1px; text-underline-offset: 3px; }
[data-plain] table.invoice-lines td > a:is(:hover, :focus-visible) { text-decoration-line: underline; text-decoration-color: currentColor; }
@media (hover: none) {
  [data-plain] table.invoice-lines td > a { text-decoration-line: underline; text-decoration-color: color-mix(in srgb, var(--link) 75%, transparent); }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-plain] table.invoice-lines td > a { text-decoration-line: underline; text-decoration-color: color-mix(in srgb, var(--link) 75%, transparent); }
}
:root[data-theme="dark"] [data-plain] table.invoice-lines td > a { text-decoration-line: underline; text-decoration-color: color-mix(in srgb, var(--link) 75%, transparent); }
/* and each linked figure on its row's line: with a fine pointer the link's 24 px target (SC 2.5.8) is padding round the
   text, taken back out of the line by the negative margin, not a centred box that sits 2.5 px below the row's plain
   figures; the cell padding takes the row's height back. A coarse pointer keeps the 44 px box of `td a`; the phone's
   cards have their own padding (below 760 px). */
@media (min-width: 760px) and (pointer: fine) {
  [data-plain] table.invoice-lines td { padding-block: 8.55px; }
  [data-plain] table.invoice-lines td > a { min-height: 0; padding-block: 2.55px; margin-block: -2.55px; }
}
/* A short word ("End-User") never breaks at its hyphen in a plain table's Kind cell; below 760 the cell is a card line. */
@media (min-width: 760px) { [data-plain] table.invoice-lines td.c-kind { white-space: nowrap; } }
/* The Business page's two kinds of link (P6): the section links are plain links in one quiet line that wraps (on a touch
   screen each keeps the 44 px of `nav a`, DESIGN 12); the period and the mix's cut are the segmented control (.seg2
   with .sw, above), which wraps rather than scrolls the page. */
/* N8 (5 Nov walk): the gap between two section words is the links' own side padding, never a box's spare width: a short word
   ("Mix") sat centred in a 24 px (desk) or 44 px (touch) minimum box, so the gaps were uneven. Each link is the word and
   0.75 rem of padding a side (every word is wider than 44 px with it), and the line starts that padding to the left so the
   first word meets the page's edge. */
nav.sections { --pad: calc(var(--space-2) + var(--space-1)); display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 var(--space-4) calc(-1 * var(--pad)); font-size: var(--fs-small); }
nav.sections a { padding-inline: var(--pad); }
nav.seg2 { flex-wrap: wrap; margin: 0 0 var(--space-2); }
.jobs-head .jobs-views { margin: 0 auto 0 var(--space-3); } /* on the desk the switch sits in the head's row beside the title */
.grid tbody tr:not(.more) > td:not([colspan]) del a,
.grid tbody tr:not(.more) > td:not([colspan]).c-invoice del a { color: var(--muted); text-decoration-line: line-through; } /* the
   anchor's own underline rule outweighs the first (review I-1) */
.grid tbody tr.row:has(details[open]:not(.all)) { background: var(--accent-soft); } /* `.all` is the ordering card's All figures (phone only): it opens no row panel */
.grid tr.more { display: none; }
.grid tr.row:has(details[open]) + tr.more { display: table-row; }
.grid tr.more > td { white-space: normal; padding: 0; background: var(--surface); box-shadow: inset 3px 0 0 var(--mark); }
.grid .more-panel { contain: inline-size; position: sticky; left: 0; max-width: 100cqi; padding: var(--space-1) var(--space-3) var(--space-2); }
.grid tbody tr.row:nth-last-child(2):not(:has(details[open]:not(.all))) > * { border-bottom: 0; } /* the last line, its panel shut */
@media (min-width: 760px) { /* a plain row (Customers, Items) has no panel after it: the last row is the last child (the phone's cards have no row lines) */
  .grid tbody tr.row:not(:has(details[name=row])):nth-last-child(2) > * { border-bottom: 1px solid var(--rule); }
  .grid tbody tr.row:not(:has(details[name=row])):last-child > * { border-bottom: 0; }
}
/* The grid in place (desk v2 Task 18): while a sort, page or filter loads, the rows dim, a tone and nothing moved;
   the region takes focus to be announced, never ringed for a mouse. */
.grid-region[aria-busy=true] tbody { opacity: 0.55; }
.grid-region:focus:not(:focus-visible) { outline: none; }
.grid-region > p { max-width: 75ch; } /* a message and the hidden sentence keep main > p's measure */
.more-panel p { margin: 0; }
.more-panel .actions { display: flex; align-items: center; }
.more-panel .job-note + .job-preview { margin-top: var(--space-1); } /* the preview button under the note */
@media not all and (min-width: 760px), (pointer: coarse) {
  .more-panel a.btn { min-height: 44px; padding-inline: 1.25rem; } /* "Open invoice" is a touch target (DESIGN 12) */
}
.lines-grid tbody tr.row:has(details[name=row]) { cursor: pointer; } /* the whole row opens it (js/rows.js); a link in it keeps its own; a Customers or Items row is its name's link alone */

/* --- Chips (DESIGN 13 and 16): a small label per meaning, always holding its words, so colour never carries the
   meaning alone; the Kind chip says "dealer" or "end user" (desk v2 spec › 3). Quiet (desk v2 Task 19): a squared
   tag of medium weight; Kind and Class hold the body's text on their column's tint, one hue a column (Kind blue,
   Class green), the first word filled and the second outlined, so "dealer" and "end user", "tyre" and "recon" read
   apart at a glance; a flag (check, wrong, credit note) keeps its own colour, the row's one alert. A "check" chip is
   the link to its invoice's PDF, its icon saying where it goes. */
.chip {
  display: inline-block;
  padding: 0 0.4em;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  white-space: nowrap;
}
.chip:not([class*=" chip-"]) { color: var(--text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--control); }
del .chip { text-decoration-line: line-through; } /* a chip is an atomic box: a struck row's decoration skips it */
.chip-dealer { color: var(--text); background: var(--dealer-bg); }
.chip-end-user { color: var(--text); background: var(--end-user-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--end-user) 55%, transparent); }
.chip-tyre { color: var(--text); background: var(--tyre-bg); }
.chip-recon { color: var(--text); background: var(--recon-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--recon) 55%, transparent); }
.chip-check { color: var(--check); background: var(--check-bg); }
.chip-wrong { color: var(--wrong); background: var(--wrong-bg); }
.chip-job { color: var(--text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--control); } /* a completed job's line: FOC or Not invoiced, in words (DR63, DR64) */
.lines-grid td.c-flags .chip-job { white-space: normal; line-height: 1rem; padding: 0.125rem 0.4em; } /* the Flags column is narrow (8.5 characters): "Not invoiced" wraps to two lines instead of being cut */
.lines-grid td.c-flags { white-space: normal; } /* a struck line's phrase and its check chip stack in that narrow column: the chip was clipped at 1280 (seam review M3) */
a.chip { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 24px; text-decoration: none; }
a.chip .icon { width: 0.875rem; height: 0.875rem; }
.grid tbody tr:not(.more) > td:not([colspan]) a.chip { color: var(--check); }
.grid tbody tr:not(.more) > td:not([colspan]) a.chip:hover,
.grid tbody tr:not(.more) > td:not([colspan]) a.chip:focus-visible { text-decoration-line: underline; box-shadow: inset 0 0 0 1px var(--check); }

/* A grid's pager: a row of links with a gap, the page shown marked (aria-current). */
nav.pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); font-size: 0.875rem; }
nav.pager [aria-current=page] { font-weight: 600; }

/* The run log's counts: one short line, its parts separated by a dot, the full record one click away. */
.counts > span + span::before { content: " · "; }
.counts { white-space: nowrap; }
td pre { margin: var(--space-1) 0 0; font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 40rem; }

/* --- The toolbar (desk v2 spec › 3 and 4.1): the grid's one GET form (From and To, Apply, Clear), each control
   keeping its own width, so a date input shows its whole year (#167); on the phone the Filters disclosure. Under it
   the filters in force as chips, each a link that drops its own filter. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: 0; }
.filter-bar { align-items: center; }
.filter-bar label { flex: 0 0 auto; display: flex; align-items: center; gap: 0.375rem; margin: 0; font-size: 0.8125rem; color: var(--muted); }
.filter-bar label > input { margin: 0; color: var(--text); }
.filter-bar label > input[type=date] { width: auto; }
details.filters { display: none; }
.chips { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: 0.8125rem; }
.fchip { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 24px; padding: 0 0.625rem; border: 1px solid var(--mark); border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.fchip:hover { text-decoration: underline; }
/* The search box (the Lines page v3, R-L6): one wide box in the filter bar, the count of lines and invoices and a chip a
   word beside it (each a link that drops its word, its own count in bold), the two switches as chips in the accent when
   on and outlined when off; a match in a cell is a <mark class="hit"> in the amber the check chip uses, 4.5:1 both ways. */
.fchip .count { font-weight: 600; font-variant-numeric: tabular-nums; }
.fchip.neg { border-style: dashed; }
.fchip.switch.off { border-color: var(--control); background: transparent; color: var(--muted); }
.hint { margin: 0 0 var(--space-2); font-size: 0.8125rem; } /* how a number filter reads (the look panel's M-1) */
/* The toolbar's buttons (desk v2 Task 19): Apply the one filled button; Clear and Columns one secondary
   style, an outline in the accent's words; every control 2rem tall on a fine pointer, so the row reads as one line. */
.toolbar button { min-height: 2rem; }
.toolbar .filter-bar label > input { min-height: 2rem; padding-block: 0; }
.toolbar .filter-bar > a,
details.columns > summary,
tr.filters td.c-apply > a { /* the phone panel's own Clear */
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text); /* near-black words in a grey outline: the accent is Apply's and the marks' alone (review I-4) */
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}
.toolbar .filter-bar > a:hover,
details.columns > summary:hover { background: var(--hover); }
/* From 760 on a mouse the number filters' hint leaves the page: each number filter's title says it on hover and a
   screen reader hears it as the filter's description (review m-2: a note floating over the toolbar hid its buttons).
   On a touch screen, which shows no title, it stays in the flow; below 760 the Filters panel shows it (below). */
@media (min-width: 760px) and (pointer: fine) {
  .hint { display: none; }
}
@media (min-width: 1440px) { /* generous room round the grid where the width allows it */
  body.desk > main { padding: var(--space-3) var(--space-5) 3rem; }
}
/* The filter row under a grid's headers (desk v2 spec › 4.1): one small control a column, joined to the toolbar's
   form by `form="grid"`; each takes its column's width, from a floor that still shows a few characters, so the row
   widens no column but the Customers grid's dates, which stack From over To. A filter holding a value carries the
   accent's edge. The Kind select reads its choice whole once the column is as wide as its "end user" chip. */
thead .filters td { background: var(--surface); padding: 0.2rem; border-bottom: 2px solid var(--control); }

thead .filters input,
thead .filters select { display: block; width: 100%; min-width: 2rem; min-height: 24px; padding: 0 0.2rem; font-size: 0.75rem; }
thead .filters select { min-width: 2.25rem; padding-inline: 0; } /* "any" and its arrow */
.filters select[name=kind],
.filters select[name=class],
.filters select[name=flags] { min-width: 3.5rem; } /* "any" reads whole, a page of unflagged lines too */
thead tr:has(+ tr.filters) th { border-bottom-width: 1px; } /* one heavy rule, under the filters (review M-3) */
.filters input[type=date] { width: auto; }
.filters input[type=date] + input[type=date] { margin-top: 2px; }
.grid tr.filters td.c-apply { display: none; } /* the phone's Filters panel's own Apply, below 760 */
.filters .set,
.filter-bar .set { border-color: var(--mark); box-shadow: inset 0 0 0 1px var(--mark); }
.totals { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-2); font-variant-numeric: tabular-nums; }
.answers { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.answers form { margin: 0; }
/* In a wide table a row's answers wrap inside their cell, the why box on its own line when the row is full, and a
   row's flags wrap too, so the buttons stay in the box at 1280; the cut columns keep their one line (review I-1). */
.wide td .answers { white-space: normal; min-width: 12rem; }
.wide td.c-guess, .wide td.c-signs { white-space: normal; min-width: 11rem; } /* the dealer list's guess and signs wrap, so the answer stays in view */
.wide td.flags { white-space: normal; min-width: 8rem; }  /* a row's flag chips wrap, a long one inside itself */
.wide td.flags .chip { white-space: normal; border-radius: var(--radius); }
.answers input[name^=why] { width: 12rem; }
.grid td.c-answer input[name^=why] { width: 100%; } /* a question's why on a line of its own, its answers together under it */

/* --- Elements styled one by one, since no framework does it: forms, buttons, disclosures, fieldsets, cards. */
label { display: block; margin: 0 0 0.75rem; }
input,
select,
textarea,
button { font: inherit; }
input:not([type=checkbox], [type=radio], [type=hidden]),
select,
textarea {
  max-width: 100%;
  padding: var(--space-1) var(--space-2);
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--control);
  border-radius: var(--radius);
  min-height: 24px;
}
label > input:not([type=checkbox], [type=radio]),
label > select,
label > textarea { display: block; width: 100%; max-width: 32rem; margin-top: var(--space-1); }
[type=checkbox],
[type=radio] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-fill); }
button,
[role=button],
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 24px;
  min-width: 24px;
  padding: 0.3125rem 0.875rem;
  color: var(--on-accent);
  background: var(--accent-fill);
  border: 1px solid var(--mark); /* dark mode's edge in #6d93e3, 4.82:1 on a panel, the fill being 2.16:1 */
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
/* A secondary button (Find, Filter, sign-out) is an outline; a destructive one (Remove, Revoke) an outline in the
   wrong pair (6.94:1 light, 8.06:1 dark), so neither reads as the page's main action. */
.signout button,
button.secondary { background: transparent; color: var(--accent); border-color: var(--control); }
button.danger { color: var(--wrong); background: var(--wrong-bg); border-color: var(--wrong); }
button:hover,
a.btn:hover { box-shadow: inset 0 0 0 100vmax var(--press); }
form.inline { display: inline; margin: 0; }
form > button + button { margin-left: var(--space-1); }
header a,
nav a,
td a,
.way a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  min-width: 24px;
}
td.num > a { justify-content: flex-end; } /* a one- or two-digit linked figure ends where "1,204" ends, not at the left of its 24 px box (#862) */
details { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 0.75rem; background: var(--bg); }
details[open] { padding-bottom: var(--space-2); }
summary { padding-block: var(--space-1); cursor: pointer; }
details.panel > summary { font-weight: 600; }
/* A disclosure in a cell (the chevron's, the customer page's): the row stays one line until it is opened. */
td details { margin: 0; border: 0; padding: 0; white-space: nowrap; background: none; } /* a row stays one line tall */
td details[open] { white-space: normal; min-width: 14rem; padding-bottom: 0; }
td details form { margin: var(--space-1) 0 0; }
td details label { margin-bottom: var(--space-1); }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-2) 0.75rem; }
legend { padding: 0 var(--space-1); font-weight: 600; }
/* A radio or checkbox and its label are one target; a count after the text (the customer's names) its own line. */
fieldset label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: var(--space-2);
  min-height: 24px;
  margin: 0;
}
fieldset label > small { grid-column: 2; }
/* The people page's three choices (team, individual, none) in a row that wraps at 375, with the Save beside or below. */
fieldset.pchoice { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); border: 0; padding: 0; margin: 0 0 var(--space-1); }
@media (max-width: 599px) { table.pstructure thead { display: none; } table.pstructure :is(tbody, tr, td) { display: block; } table.pstructure td { border-top: 0; } table.pstructure tr + tr { margin-top: var(--space-3); } } /* a person's two cells read as one; the people are apart */
@media (min-width: 760px) { /* the choice, the date and Save in one row */
  table.pstructure form.inline { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-1) var(--space-3); }
  table.pstructure form.inline fieldset.pchoice { margin: 0; }
}
/* The people page's "To verify" list and points table (Charlie, 9 Nov 2026): a person the jobs only suggested, with Confirm and Change at 44 px on a phone. */
.pverify { margin: 0 0 var(--space-4); padding: var(--space-3); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.pverify h2 { margin-top: 0; }
.pverify-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.pverify-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.pverify-who { flex: 1 1 14rem; min-width: 0; }
.pverify-list form { margin: 0; }
table.ptable-grid { width: 100%; border-collapse: collapse; }
table.ptable-grid th, table.ptable-grid td { padding: var(--space-1) var(--space-2); text-align: left; border-top: 1px solid var(--rule); }
table.ptable-grid thead th { border-top: 0; font-size: var(--fs-label); color: var(--muted); }
table.ptable-grid td { width: 5.5rem; }
table.ptable-grid td input { width: 100%; min-width: 0; box-sizing: border-box; }
@media not all and (min-width: 760px), (pointer: coarse) {
  .pverify-list button, .pverify-list a.btn { min-height: 44px; display: inline-flex; align-items: center; }
}
article { padding: 0.75rem var(--space-3); background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
article > :last-child { margin-bottom: 0; }

/* A search form (the header's and home's): the field and the button side by side; the button keeps its width, since a
   min-width replaces a flex item's automatic minimum (it read "Sea / rch" at 375). */
[role=search] { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
[role=search] label { flex: 0 1 32rem; margin: 0; }
[role=search] button { flex: none; }

/* --- Focus is always visible (DESIGN 14; SC 2.4.7): a solid ring in the focus token, 6.75:1 light and 8.35:1 dark;
   on the frame its own accent (above). */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --- Below 760 pixels a grid's rows are cards (DESIGN 1 as amended; spec › 3), so nothing scrolls sideways: a lines
   card holds the invoice, the date and the amount on its first line, then the customer, the description over two
   lines at most, the chips, quantity and price, and the chevron at its lower right, its opened row beneath it; the
   Customers' and Items' cards their name first. The roles table, row and cell in the markup keep the table's meaning
   once its display changes [assumed: holds in VoiceOver on iOS; plan Task 15 checks by hand]. The header row becomes
   a strip of sort pills that scrolls in its own box; the filter row shows when the Filters disclosure is open. An
   invoice's lines become a list, so its amount is never off-screen. */
@media (max-width: 759.98px) {
  .grid.table-box { overflow: visible; max-height: none; border: 0; background: none; }
  .wide.grid > table,
  .wide.grid > table > thead,
  .wide.grid > table > tbody { display: block; }
  .wide.grid thead tr:first-child { display: flex; gap: var(--space-1); overflow-x: auto; padding: 0 2rem var(--space-2) 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); } /* the cue that the strip scrolls: its last 2 rem fade out; the padding there is empty once scrolled to the end, so nothing is hidden then (6 Nov walk) */
  .wide.grid thead th { position: static; display: block; padding: 0; background: none; border: 0; }
  .wide.grid thead th.c-x { display: none; }
  .wide.grid thead th a { display: inline-flex; align-items: center; min-height: 2rem; padding: 0 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius-pill); background: var(--bg); font-weight: 500; font-size: 0.8125rem; white-space: nowrap; }
  .wide.grid thead th[aria-sort] a { border-color: var(--mark); background: var(--accent-soft); }
  .wide.grid tr.filters { display: none; }
  main:has(details.filters[open]) .wide.grid tr.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: 0 0 var(--space-2); padding: var(--space-2); background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
  .wide.grid tr.filters td { display: block; padding: 0; border: 0; background: none; white-space: normal; } /* a long label wraps */
  .wide.grid tr.filters td:empty { display: none; }
  .wide.grid tr.filters input[type=date] { width: 100%; min-width: 0; } /* a 16 px date box keeps to its column */
  .wide.grid tr.filters td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.75rem; color: var(--muted); } /* the control's name, seen (its aria-label is heard) */
  .wide.grid tr.filters input,
  .wide.grid tr.filters select { min-height: 2.5rem; font-size: max(1rem, 16px); padding-inline: var(--space-2); }
  details.filters { display: block; margin: 0; padding: 0; border: 0; background: none; }
  details.filters > summary { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; padding: 0 0.75rem; border: 1px solid var(--control); border-radius: var(--radius); background: var(--bg); font-size: 0.875rem; list-style: none; }
  details.filters > summary::-webkit-details-marker { display: none; }
  details.filters[open] > summary { border-color: var(--mark); background: var(--accent-soft); color: var(--accent); }
  /* From and To and the number filters' hint show while Filters is open, so the first purchase or sale on a customer
     or item page sits higher (a date in force still shows as its chip; the look panel's M-2). Apply shows in the
     toolbar only where its form holds a control of its own (the form, not the toolbar: the Columns menu beside it
     holds a checkbox per column) and while Filters is closed; the panel ends in its own Apply, the one Apply while it
     is open (M-4). */
  main:not(:has(details.filters[open])) .filter-bar > label,
  main:not(:has(details.filters[open])) .hint { display: none; }
  .toolbar .filter-bar > :is(button, a) { display: none; } /* the panel's own Apply and Clear are the only pair (#336) */
  /* One block, #336: Filters owns From and To, Same words, the panel's fields, Apply and Clear. The page's one flow
     (the toolbar and the form take no box of their own, their parts ordered with the rest): Filters and Columns,
     what is in force, From and To side by side and Same words, the number filters' hint, then the panel (the header's
     second row, put before the sort pills by the header's own column), ending in Apply and Clear; then the pills and
     the cards. Closed, none of it but the two buttons and the chips shows. */
  .grid-region:has(> .toolbar) { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); }
  .grid-region:has(> .toolbar) > * { order: 5; flex: 1 1 100%; min-width: 0; }
  .grid-region > .toolbar, .grid-region > .toolbar > .filter-bar { display: contents; }
  .toolbar > :is(details.filters, details.columns) { order: 1; flex: 0 0 auto; margin: 0 0 var(--space-2); }
  .grid-region:has(> .toolbar) > .chips { order: 2; }
  .filter-bar > :is(label, .badge) { order: 3; margin: 0 0 var(--space-2); }
  .grid-region:has(> .toolbar) > .hint { order: 4; }
  .filter-bar > label:has(> input[type=date], > input[name=year]) { flex: 1 1 calc(50% - var(--space-2)); flex-direction: column; align-items: stretch; gap: 2px; font-size: 0.75rem; }
  .filter-bar > label > input[type=date] { width: 100%; min-width: 0; min-height: 2.5rem; }
  .filter-bar > label:has(> input[type=checkbox]) { flex: 1 1 100%; min-height: 2.75rem; }
  .wide.grid > table > thead { display: flex; flex-direction: column; }
  .wide.grid thead tr:first-child { order: 2; min-width: 0; } /* the sort pills close the block */
  .wide.grid tr.filters td.c-apply { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-2); min-height: 2.75rem; }
  .wide.grid tbody tr,
  .wide:not(.grid):has(.answers) tbody tr { /* the Questions tables without a grid's classes (brands, pairs, versions) are cards too (#334) */
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.625rem;
    margin: 0 0 var(--space-2);
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
  }
  .wide.grid tbody tr > td,
  .wide:not(.grid):has(.answers) tbody tr > td { display: block; padding: 0; border: 0; white-space: normal; }
  .wide:not(.grid):has(.answers) tbody td.num { text-align: left; }
  .wide:not(.grid):has(.answers) tbody tr > td:has(> .answers) { flex: 1 1 100%; min-width: 0; } /* the answer closes the card, the why box above its buttons */
  .wide:not(.grid):has(.answers) tbody td:has(> .answers) input[name^=why] { width: 100%; }
  .wide:not(.grid):has(.answers) tbody td.c-lines::after { content: " tyre lines" / ""; }
  .wide:not(.grid):has(.answers) tbody td.c-similarity::before { content: "Similarity " / ""; }
  .wide:not(.grid):has(.answers) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* the labels are heard, not seen */
  .wide.grid tbody .cut { max-width: none; white-space: normal; }
  .wide.grid tbody .cut.desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .wide.grid tbody tr > .c-invoice,
  .wide.grid tbody tr > .c-name { font-weight: 600; }
  .wide.grid tbody tr > .c-invoice { order: 1; }
  .wide.grid tbody tr > .c-date { order: 2; color: var(--muted); font-size: 0.8125rem; }
  .wide.grid tbody tr > .c-revenue { order: 3; margin-left: auto; font-weight: 600; font-size: 0.9375rem; }
  .wide.grid tbody tr > .c-name,
  .wide.grid tbody tr > .c-customer,
  .wide.grid tbody tr > .c-description { order: 4; flex: 1 1 100%; } /* a Customers card's name heads it, alone on its line */
  .wide.grid tbody tr > .c-name { order: 1; }
  .wide.grid tbody td.num { text-align: left; }
  .wide.grid tbody tr > .c-kind,
  .wide.grid tbody tr > .c-seg,
  .wide.grid tbody tr > .c-segment,
  .wide.grid tbody tr > .c-category,
  .wide.grid tbody tr > .c-type,
  .wide.grid tbody tr > .c-class,
  .wide.grid tbody tr > .c-flags,
  .wide.grid tbody tr > .c-guess { order: 5; }
  .wide.grid tbody tr > .c-signs { order: 5; flex: 1 1 100%; } /* the Questions dealer list's signs, a line of their own */
  /* a Customers card's segment badge sits on the name's line and says its words: the name shrinks to its text (a long one still fills the line and wraps), the badge follows at order 2 (#340) */
  .wide.grid[aria-label=Customers] tbody tr > .c-name { flex: 0 1 auto; max-width: 100%; }
  .wide.grid[aria-label=Customers] tbody tr > .c-segment { order: 2; display: flex; align-items: center; gap: var(--space-1); }
  .wide.grid tbody td.c-segment .seg-words { display: inline; font-size: var(--fs-small); color: var(--muted); }
  .wide.grid tbody tr > :is(.c-industry, .c-country) { order: 5; color: var(--muted); } /* a Customers card's second line: the badges, then industry and country, as the legacy's card */
  .wide.grid tbody tr > .c-contact { order: 5; flex: 1 1 100%; } /* then the contact, a line of its own */
  .wide.grid thead:has(a) th:not(:has(a)) { display: none; } /* a column with no sort has no pill (the Customers' Contact); a header with no sort at all is hidden whole, its labels still read (the Questions dealer tables) */
  .wide.grid tbody tr.row::after { content: ""; order: 6; flex: 1 1 100%; } /* quantity and price start a line */
  .wide.grid tbody tr > .c-ton,
  .wide.grid tbody tr > .c-qty,
  .wide.grid tbody tr > .c-price,
  .wide.grid tbody tr > .c-discount,
  .wide.grid tbody tr > .c-net,
  .wide.grid tbody tr > .c-invoices,
  .wide.grid tbody tr > .c-first,
  .wide.grid tbody tr > .c-last,
  .wide.grid tbody tr > .c-size,
  .wide.grid tbody tr > .c-brand,
  .wide.grid tbody tr > .c-sold,
  .wide.grid tbody tr > .c-questions,
  .wide.grid tbody tr > .c-completed,
  .wide.grid tbody tr > .c-job_category,
  .wide.grid tbody tr > .c-tyre_size,
  .wide.grid tbody tr > .c-tyre_brand,
  .wide.grid tbody tr > .c-condition,
  .wide.grid tbody tr > .c-forklift,
  .wide.grid tbody tr > .c-serial,
  .wide.grid tbody tr > .c-wheel,
  .wide.grid tbody tr > .c-repair,
  .wide.grid tbody tr > .c-context,
  .wide.grid tbody tr > .c-item_code,
  .wide.grid tbody tr > .c-item_name,
  .wide.grid tbody tr > .c-queue,
  .wide.grid tbody tr > .c-status,
  .wide.grid tbody tr > .c-payment { order: 7; color: var(--muted); }
  .wide.grid tbody tr > .c-year { order: 8; color: var(--muted); }
  .wide.grid tbody tr > td.c-x { order: 9; margin-left: auto; width: auto; padding: 0; }
  .wide.grid tbody tr > td.c-answer { order: 9; flex: 1 1 100%; } /* a question's answer closes its card */
  .wide.grid thead:not(:has(a)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* no sort pills to show: the labels are heard, not seen */
  .wide.grid tbody td.c-ton::before { content: "Ton " / ""; }
  .wide.grid tbody td.c-qty::before { content: "Qty " / ""; }
  .wide.grid tbody td.c-price::before { content: "at " / ""; }
  .wide.grid tbody td.c-discount::before { content: "Disc " / ""; }
  .wide.grid tbody td.c-net::before { content: "Net " / ""; }
  .wide.grid tbody td:has(> .nil) { display: none; } /* a blank cell says nothing on a card (the grid's dash is for the table) */
  .wide.grid tbody td.c-item_code:not(:empty)::before { content: "Code " / ""; }
  .wide.grid tbody td.c-item_name:not(:empty)::before { content: "Item " / ""; }
  .wide.grid tbody td.c-tyre_size:not(:empty)::before { content: "Size " / ""; }
  .wide.grid tbody td.c-tyre_brand:not(:empty)::before { content: "Brand " / ""; }
  .wide.grid tbody td.c-condition:not(:empty)::before { content: "Condition " / ""; }
  .wide.grid tbody td.c-forklift:not(:empty)::before { content: "Forklift " / ""; }
  .wide.grid tbody td.c-serial:not(:empty)::before { content: "Serial " / ""; }
  .wide.grid tbody td.c-wheel:not(:empty)::before { content: "Wheel " / ""; }
  .wide.grid tbody td.c-repair:not(:empty)::before { content: "Repair " / ""; }
  .wide.grid tbody td.c-invoices::before { content: "Invoices " / ""; }
  .wide.grid tbody td.c-first::before { content: "First " / ""; }
  .wide.grid tbody td.c-last::before { content: "Last " / ""; }
  .wide.grid[aria-label=Items] tbody td.c-last::before { content: "Last sold " / ""; }
  .wide.grid tbody td.c-sold::before { content: "Times sold " / ""; }
  .wide.grid tbody td.c-questions:not(:empty)::before { content: "Questions " / ""; }
  /* The ordering section's cards (Task 3; both brands, ordering v4 Task 6a): the size heads the card with its chips, the
     order beside it at the right (the answer visible at 375: the panel), then each figure named; a blank says nothing,
     as on every card */
  #grid-region[data-ordering] .wide.grid tbody tr > .c-size { order: 1; flex: 1 1 auto; color: var(--text); font-weight: 600; }
  #grid-region[data-ordering] .wide.grid tbody tr > .c-size .chip { font-weight: 400; }
  #grid-region[data-ordering] .wide.grid tbody tr > .c-order { order: 2; margin-left: auto; font-size: 0.9375rem; }
  #grid-region[data-ordering] .wide.grid tbody tr > :is(.c-stock, .c-on_order, .c-demand, .c-safety, .c-at_arrival, .c-cover, .c-after, .c-in_xero, .c-on_jobs, .c-quoted, .c-change, .c-sold_last, .c-sold_before, .c-weight, .c-volume, .c-last_box, .c-swing, .c-demand_day, .c-swing_day, .c-kind, .c-lifted, .c-target, .c-raw_order) { order: 7; flex: 1 1 calc(50% - 0.5rem); min-width: 0; }
  #grid-region[data-ordering] .wide.grid tbody td.c-order::before { content: "Order " / ""; color: var(--text-2); font-weight: 400; }
  /* Reaches safety (Task 6b) is the card's second line, the "when" under the size; a blank one, and a Stock that reads 0
     for a size not stocked in Xero, say why in words, since a title cannot be hovered on a phone */
  #grid-region[data-ordering] .wide.grid tbody tr > .c-reaches { order: 4; flex: 1 1 100%; color: var(--text-2); }
  #grid-region[data-ordering] .wide.grid tbody td.c-reaches::before { content: "Reaches safety " / ""; color: var(--text-2); }
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-stock, .c-reaches):has(> .nil) { display: block; }
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-stock, .c-reaches) > .nil { display: none; }
  #grid-region[data-ordering] .wide.grid tbody td.c-reaches > .nil:has(+ .cell-why.shared) { display: inline; } /* a waiting size's reason is the banner's and not drawn: its dash stays (U4) */
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-stock, .c-reaches) > .cell-why:not(.shared) { position: static; display: block; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; font-size: 0.8125rem; color: var(--muted); }
  #grid-region[data-ordering] .wide.grid tbody tr.row.due > .c-reaches { color: var(--wrong); }
  /* A size that is not ordered keeps Cover, Needed at arrival and Raw order on its card with the reason in words (#489), each on a line of its own under its label; a reason every blank of a withheld answer shares carries no .card-why, so it is not said on every card */
  #grid-region[data-ordering] .wide.grid tbody td:has(> .card-why) { display: block; flex: 1 1 100%; }
  #grid-region[data-ordering] .wide.grid tbody td:has(> .card-why) > .nil { display: none; }
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-target, .c-raw_order):has(> .card-why)::after { content: none; }
  #grid-region[data-ordering] .wide.grid tbody td > .card-why { position: static; display: block; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
  #grid-region[data-ordering] .wide.grid tbody td.c-stock::before { content: "Stock " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-on_order::before { content: "On order " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-demand::before { content: "Demand / mo " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-safety::before { content: "Safety stock " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-at_arrival::before { content: "At arrival (days) " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-cover::before { content: "Cover (days) " / ""; } /* the unit in the label, as the desk's header reads: a ::after " days" cannot make a singular ("Cover 1 days") */
  #grid-region[data-ordering] .wide.grid tbody td.c-after::before { content: "After (months) " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-in_xero::before { content: "In Xero " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-on_jobs::before { content: "On jobs " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-quoted::before { content: "Quoted " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-change::before { content: "Change " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-sold_last::before { content: "Sold / mo, last 12 " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-sold_before::before { content: "Sold / mo, prior 12 " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-weight::before { content: "Box kg " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-volume::before { content: "Box m³ " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-last_box::before { content: "Last box " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-swing::before { content: "Swing / mo " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-demand_day::before { content: "Demand / day " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-swing_day::before { content: "Swing / day " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-kind::before { content: "Kind " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-lifted::before { content: "Lifted months " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-target::before { content: "Needed at arrival " / ""; }
  #grid-region[data-ordering] .wide.grid tbody td.c-raw_order::before { content: "Raw order " / ""; }
  /* a rate that reads 0.00 gives its figure beside it: a card has no title to hover */
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-demand_day, .c-swing_day) > .cell-why { position: static; display: inline; width: auto; height: auto; margin: 0 0 0 0.25rem; overflow: visible; clip-path: none; white-space: normal; }
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-demand_day, .c-swing_day) > .cell-why::before { content: "(" / ""; }
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-demand_day, .c-swing_day) > .cell-why::after { content: ")" / ""; }
  /* The order columns (Task 8): the next order's box sits at the card's right where the Order figure was, the two
     past orders named by their numbers (the cell's data-label) among the muted figures */
  #grid-region[data-ordering] .wide.grid tbody tr > :is(.c-past_2, .c-past_1) { order: 7; flex: 1 1 calc(50% - 0.5rem); min-width: 0; }
  #grid-region[data-ordering] .wide.grid tbody td:is(.c-past_2, .c-past_1)::before { content: attr(data-label) " " / ""; }
  #grid-region[data-ordering] .wide.grid tbody tr > .c-next { order: 2; margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }
  #grid-region[data-ordering] .wide.grid tbody td.c-next::before { content: attr(data-label) / ""; color: var(--text-2); font-weight: 400; }
  /* A card has its own label and value (28 Oct UX pass, finding 3): the label above the figure at normal weight, two figures to a line; the not-ordered reasons keep the line they have. The labels (here and the three above) are the second text colour at the table's 14 px, not the muted grey at 12 px: in sunlight the label half of "Stock 10" was the part that faded, and it is the half that says which figure is which (mobile review, C12; 4.5:1 or better on a card of either ground, both schemes: tests/browser/test_ordering_phone.py). The label is as large and nearly as dark as its figure now, so the figure is told by its weight, not the reasons under it (they keep 400) */
  #grid-region[data-ordering] .wide.grid tbody td:not(.c-size, .c-order, .c-next, .c-reaches)::before { display: block; font-size: var(--fs-table); font-weight: 400; color: var(--text-2); }
  #grid-region[data-ordering] .wide.grid tbody td:not(.c-size, .c-order, .c-next, .c-reaches) { font-weight: var(--fw-medium); }
  #grid-region[data-ordering] .wide.grid tbody td > :is(.cell-why, .card-why) { font-weight: 400; }
  /* A slow size that is not ordered says so once, in a line under its name (finding 2) */
  #grid-region[data-ordering] .wide.grid tbody tr > td.c-size:has(> .card-note) { flex: 1 1 0; min-width: 0; }
  #grid-region[data-ordering] .wide.grid tbody td.c-size > .card-note { display: block; margin-top: 0.125rem; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
  /* The size's other spellings (question 73), on their own line under the name, before any card-note */
  #grid-region[data-ordering] .wide.grid tbody td.c-size > .size-also { display: block; margin-top: 0.125rem; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
  /* E3 (1 Nov 2026): the next order's line, the card's full width under its head (the size and the box), only when the
     order is not Raw order rounded up and the card has no note of its own; the box's description already says it to a
     screen reader, so the generated text is hidden from one ("/ ''") */
  #grid-region[data-ordering] .wide.grid tbody tr.row[data-why]::before { content: attr(data-why) / ""; order: 3; flex: 1 1 100%; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
  /* A card is short by default (6 Nov 2026, #696 finding 3): the size with its chips and note, the Order box, Reaches
     safety, Stock, On order and Demand / mo (`ordering_words.CARD_FIGURES`); every other figure the person has shown waits
     behind "All figures", a native <details> in the card's last cell whose open state `:has` reads, as the fold's does.
     A column he hid is not in the card at all. Without `:has` every figure shows and the toggle is not drawn. */
  @supports selector(:has(*)) {
    #grid-region[data-ordering] .wide.grid tbody td.c-all { display: block; order: 8; flex: 1 1 100%; padding: 0; }
    #grid-region[data-ordering] .wide.grid tbody td.c-all summary { box-sizing: border-box; display: list-item; list-style-position: inside; min-height: 44px; padding: 0.6875rem 0; color: var(--text-2); font-weight: 400; cursor: pointer; }
    #grid-region[data-ordering] .wide.grid tbody tr.row > td:not(.c-size, .c-next, .c-reaches, .c-stock, .c-on_order, .c-demand, .c-all) { order: 9; margin-left: 0; }
    #grid-region[data-ordering] .wide.grid tbody tr.row:not(:has(details.all[open])) > td:not(.c-size, .c-next, .c-reaches, .c-stock, .c-on_order, .c-demand, .c-all) { display: none; }
  }
  /* Row density and Wrap cells do nothing to a card (finding 11) */
  .menu.settings .setting:is([action$="/prefs/density"], [action$="/prefs/wrap"]) { display: none; }
  /* The Business overview's Top 20 cards (Task 4; U2 of the 5 Nov walk): the customer alone on the card's first line (the
     card rule's full width), its revenue always on the line under it (beside the name for a short one and under it for a
     long one was two rules in one), then each other figure as a pair: a muted label and its value in the text colour,
     the pairs in two fixed columns; a blank shows the dash in its own place (walk 2, U5) */
  #grid-region[data-grid="business"] .wide.grid tbody tr > .c-customer { order: 1; color: var(--text); font-weight: 600; }
  #grid-region[data-grid="business"] .wide.grid tbody tr > .c-revenue { order: 2; margin-left: 0; font-size: 0.9375rem; }
  #grid-region[data-grid="business"] .wide.grid tbody tr > :is(.c-rank, .c-kind, .c-group, .c-share, .c-change, .c-invoices, .c-last) { order: 7; color: var(--text); }
  /* walk 2, U5: the pairs sit in two fixed columns after the customer and revenue, and a blank shows the dash in its own place, so a label is where it is on every card (a run-on line wrapped differently card to card) */
  #grid-region[data-grid="business"] .wide.grid tbody tr.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #grid-region[data-grid="business"] .wide.grid tbody tr.row::after { display: none; }
  #grid-region[data-grid="business"] .wide.grid tbody tr > :is(.c-customer, .c-revenue) { grid-column: 1 / -1; }
  #grid-region[data-grid="business"] .wide.grid tbody tr > .c-last { order: 8; grid-column: 1 / -1; } /* the day takes the card's whole row, last, so its year stays on its line (walk 3, N2) */
  #grid-region[data-grid="business"] .wide.grid tbody td:has(> .nil) { display: block; }
  #grid-region[data-grid="business"] .wide.grid tbody td:is(.c-rank, .c-kind, .c-group, .c-share, .c-change, .c-invoices, .c-last)::before { color: var(--muted); font-size: 0.8125rem; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-rank::before { content: "# " / ""; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-kind::before { content: "Kind " / ""; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-group::before { content: "Status " / ""; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-revenue::before { content: "Revenue (S$) " / ""; color: var(--muted); font-size: 0.8125rem; font-weight: 400; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-share::before { content: "Share " / ""; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-change::before { content: "Change " / ""; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-invoices::before { content: "Invoices " / ""; }
  #grid-region[data-grid="business"] .wide.grid tbody td.c-last::before { content: "Last invoice " / ""; }
  /* set B's job columns (Task B2): named, as quantity and price are; a workbook line's are empty and say nothing */
  .wide.grid tbody td.c-completed:not(:empty)::before { content: "Completed by " / ""; }
  .wide.grid tbody td.c-job_category:not(:empty)::before { content: "Job category " / ""; }
  .wide.grid tbody td.c-queue:not(:empty)::before { content: "Queue " / ""; }
  .wide.grid tbody td.c-status:not(:empty)::before { content: "Job status " / ""; }
  .wide.grid tbody td.c-payment:not(:empty)::before { content: "Payment " / ""; }
  .wide.grid td.c-x summary { width: 2.25rem; height: 2.25rem; border: 1px solid var(--rule); }
  .wide.grid tbody tr.row:has(details[open]:not(.all)) { margin-bottom: 0; border-color: var(--mark); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .wide.grid tbody tr.more { display: none; margin: 0; padding: 0; }
  .wide.grid tbody tr.row:has(details[open]) + tr.more { display: block; margin: 0 0 var(--space-2); border: 1px solid var(--mark); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
  .wide.grid tbody tr.more > td { display: block; }
  .wide.grid tbody tr > td[colspan]:not(.c-x) { flex: 1 1 100%; }
  /* the totals bar under the cards: one band, the count, then each total named */
  .wide.grid > table > tfoot { display: block; }
  .wide.grid tfoot tr.sum { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
  .wide.grid tfoot tr.sum > * { position: static; display: block; padding: 0; border: 0; background: none; }
  .wide.grid tfoot tr.sum > :empty { display: none; }
  .wide.grid tfoot th[colspan] { white-space: normal; }
  .wide.grid tfoot td.c-qty::before { content: "Qty " / ""; font-weight: var(--fw-body); color: var(--muted); }
  .wide.grid tfoot td.c-revenue::before { content: "Revenue " / ""; font-weight: var(--fw-body); color: var(--muted); }
  /* An invoice's lines: the description full width, then quantity, price and amount at the right, each labelled; the
     totals a line each; the header row visually hidden, read as before. */
  .table-box:has(> table.invoice-lines) { overflow: visible; border: 0; background: none; width: 100%; }
  table.invoice-lines,
  table.invoice-lines > tbody { display: block; }
  table.invoice-lines > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.invoice-lines tr { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 0 0.75rem; padding: 0.5rem; border-bottom: 1px solid var(--rule); background: none; }
  table.invoice-lines tr > * { display: block; padding: 0; border: 0; }
  table.invoice-lines td.desc { flex: 1 1 100%; }
  table.invoice-lines td:empty { display: none; }
  /* The Business overview's plain tables as cards: the first cell heads the card, each other figure names itself (the head is hidden here, so the glossary and the (i) in the desk's head carry the meanings). The pairs are boxes of one grid, a hairline above each, so a figure is in the same place on every card; a link figure keeps its 44 px reach as padding that a negative margin takes back, so it and a plain figure share one line and one baseline (C5). */
  [data-plain] table.invoice-lines tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0 var(--space-3); align-items: start; }
  [data-plain] table.invoice-lines td:first-child { grid-column: 1 / -1; margin-bottom: var(--space-1); color: var(--text); font-weight: 600; }
  [data-plain] table.invoice-lines td:not(:first-child) { display: flex; flex-direction: column; align-items: flex-start; padding-block: var(--space-1); border-top: 1px solid var(--rule); }
  [data-plain] table.invoice-lines td a { min-height: 0; padding-block: 0.7rem; margin-block: -0.7rem; }
  [data-plain] table.invoice-lines td.num { text-align: left; }
  [data-plain] table.invoice-lines td.c-revenue::before { content: "Revenue (S$) " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-prior::before { content: "A year earlier (S$) " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-change::before { content: "Change " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-invoices::before { content: "Invoices " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-customers::before { content: "Customers " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-average::before { content: "Avg invoice (S$) " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-dealer::before { content: "Dealer share " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-share::before { content: "Share " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-kind::before { content: "Kind " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-group::before { content: "Status " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-delta::before { content: "Revenue change (S$) " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-lines::before { content: "Lines " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-all_time::before { content: "All-time share " / ""; color: var(--muted); font-size: 0.75rem; }
  [data-plain] table.invoice-lines td.c-prior_share::before { content: "Share a year earlier " / ""; color: var(--muted); font-size: 0.75rem; }
  /* a blank figure keeps its box and shows the page's dash (`.nil`; walk 2, U5), so each label is in one place on every card */
}

/* N2 of the 5 Nov walk: a phone's linked figure in a plain-table card has the full 44 px reach on a touch screen (SC
   2.5.5): the 18.9 px line and 12.6 px a side, taken back out of the line by the same negative margin as the 0.7rem
   above, which made 41.3 px. A mouse at a narrow width and the desk keep their own rules. */
@media (pointer: coarse) and (max-width: 759.98px) { [data-plain] table.invoice-lines td a { padding-block: 12.6px; margin-block: -12.6px; } }

/* --- Targets fit the pointer (DESIGN 12, Decision 102): at least 24 by 24 CSS pixels everywhere (SC 2.5.8, AA),
   above; on a coarse pointer (a phone or a touch screen) buttons, inputs and links that stand alone at least 44 by 44
   (SC 2.5.5), the phone's sort pills and the filter chips among them. A link inside a sentence keeps its line, so no
   rule sizes a bare a. */
@media (pointer: coarse) {
  button,
  [role=button],
  a.btn,
  header a,
  nav a,
  td a,
  th a,
  .way a,
  .fchip {
    display: inline-flex;
    min-height: 44px;
    min-width: 44px;
  }
  input:not([type=checkbox], [type=radio], [type=hidden]),
  select,
  summary,
  fieldset label { min-height: 44px; }
  .grid td.c-x summary,
  .wide.grid td.c-x summary { width: 44px; height: 44px; } /* DESIGN 12; the cards' 2.25rem has this weight, so the
     later rule wins (review I-1) */
  .wide.grid thead th a { min-height: 44px; } /* the phone's sort pills, past the cards' 2rem (spec › 3) */
  .wide.grid tr.filters input,
  .wide.grid tr.filters select,
  .wide.grid tr.filters td.c-apply > :is(button, a) { min-height: 44px; } /* the Filters panel's controls, past the cards' 2.5rem */
  .toolbar a,
  .chips a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; } /* Clear, Clear all */
  td a.sales { padding-block: 14px; margin-block: -14px; }
  /* a card's name, customer, description and invoice links (#314 item 1): the 44 px is padding, taken back out of the line by
     the same negative margin, so the cell is one line tall, not a 44 px box with its words at the top and a blank band
     under them; the check chip keeps its own hit area (its ::after, below) and the sales arrow its own (above) */
  .grid tbody tr:not(.more) > td:not([colspan]) a:not(.sales, .chip, .btn) { min-height: 0; padding-block: 13px; margin-block: -13px; }
  .grid[aria-label=Lines] tbody tr:not(.more) > td:not([colspan]) a:not(.sales, .chip, .btn) { padding-block: 2px; margin-block: -2px; line-height: 20px; } /* a Lines card stacks its links 4 px apart: 44 px would overlap and steal taps, so each keeps 24 px (SC 2.5.8) and no overlap */
  /* desk v2 Task 19's heavier toolbar and grid rules, named again so the coarse 44 wins at equal weight: the toolbar's
     buttons and fields, the grid's sales arrow (its cell keeps the room), the check chip's hit area past its tag */
  .toolbar button,
  .toolbar .filter-bar > a,
  .toolbar .filter-bar label > input { min-height: 44px; }
  .grid td.c-description:has(> .sales) { padding-right: 2.875rem; }
  .grid tbody tr:not(.more) > td:not([colspan]) > a.sales { width: 44px; height: 44px; margin-top: -22px; }
  .grid tbody tr:not(.more) > td:not([colspan]) a.chip { position: relative; }
  .grid tbody tr:not(.more) > td:not([colspan]) a.chip::after { content: ""; position: absolute; inset: -10px -4px; }
  details.filters > summary { min-height: 44px; }
  th, td { padding-block: 0.5rem; }
  /* A form control is at least 16 pixels on a touch screen, so iOS Safari never zooms the page when one takes focus
     (the look panel's S-1); the viewport never blocks zoom (SC 1.4.4). The rules that size a control smaller are
     named here, after them, so at equal weight this one wins. */
  input:not([type=checkbox], [type=radio], [type=hidden]),
  select,
  textarea,
  .filter-bar label > input,
  thead .filters input,
  thead .filters select,
  .wide.grid tr.filters input,
  .wide.grid tr.filters select { font-size: max(1rem, 16px); }
}

/* --- The Run log on a phone (#342): below 760 a run is a card, as a grid's rows are: when, step and status on the first
   line, the Error (only a failed run has one) and the counts under them, so the figures are on the screen and no empty
   column takes the room; the desk keeps its table. */
@media not all and (min-width: 760px) {
  .table-box:has(> table.runlog) { overflow: visible; border: 0; background: none; }
  table.runlog, table.runlog > tbody { display: block; }
  table.runlog > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* the labels are heard, not seen */
  table.runlog tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.625rem; margin: 0 0 var(--space-2); padding: 0.625rem 0.75rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
  table.runlog tbody td { display: block; padding: 0; border: 0; white-space: normal; }
  table.runlog td:empty { display: none; }
  table.runlog td.c-started { order: 1; font-weight: var(--fw-strong); }
  table.runlog td.c-step { order: 2; color: var(--muted); }
  table.runlog td.c-status { order: 3; margin-left: auto; }
  table.runlog td.c-error { order: 4; flex: 1 1 100%; }
  table.runlog td.c-counts { order: 5; flex: 1 1 100%; }
  table.runlog td[colspan] { flex: 1 1 100%; }
  table.runlog .counts { white-space: normal; }
  table.runlog summary { display: flex; align-items: center; } /* the 44 px target holds its words at the middle, no blank band under them */
}

/* --- The Access log on a phone (PR-9), after the Run log's cards above: below 760 a read is a card, When and Who on the
   first line, What under them (its `td.wrap` and its disclosure stay), the channel at the end of the first line. */
@media not all and (min-width: 760px) {
  .table-box:has(> table.accesslog) { overflow: visible; border: 0; background: none; }
  table.accesslog, table.accesslog > tbody { display: block; }
  table.accesslog > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.accesslog tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.625rem; margin: 0 0 var(--space-2); padding: 0.625rem 0.75rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
  table.accesslog tbody td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  table.accesslog td.c-when { order: 1; font-weight: var(--fw-strong); }
  table.accesslog td.c-who { order: 2; color: var(--muted); overflow-wrap: anywhere; }
  table.accesslog td.c-channel { order: 3; margin-left: auto; color: var(--muted); }
  table.accesslog td.wrap { order: 4; flex: 1 1 100%; }
  table.accesslog td[colspan] { flex: 1 1 100%; }
}

/* --- The Run log's "Last night" panel and the filters of the two logs (PR-1, PR-9): the head line, then a step to a line
   (its words, its status, when it finished); the status wraps under the words at 375 and the page never scrolls sideways. */
.last-night { margin: 0 0 var(--space-3); }
.last-night .head { font-weight: var(--fw-strong); }
.last-night .steps { list-style: none; margin: 0; padding: 0; }
.last-night .steps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.125rem 0.625rem; padding: 0.25rem 0; border-top: 1px solid var(--rule); }
.last-night .steps .what { flex: 1 1 12rem; }
.last-night .steps .chip { white-space: normal; }
.log-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.75rem; margin: 0 0 var(--space-2); }
.log-filter label { display: flex; flex-direction: column; gap: 0.125rem; max-width: 100%; }
.log-filter select, .log-filter input { max-width: 100%; }

/* --- Forced colours (Windows High Contrast): box-shadow and the author's colours are dropped, so the page shown in
   the navigation and a filter holding a value keep a mark of their own, an outline in the system's Highlight. */
@media (forced-colors: active) {
  .side a[aria-current=page],
  .bottom-bar a[aria-current=page],
  .bottom-bar details:has([aria-current=page]) > summary,
  .filters .set,
  .filter-bar .set { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* --- Task 13, same words (desk v2 spec › 4.3): the badge beside its switch while it is on, in the accent so it reads
   apart from the line chips; its words say it, so colour never carries it alone (DESIGN 13). */
.filter-bar .badge { color: var(--accent); box-shadow: inset 0 0 0 1px var(--mark); }

/* --- Desk v2 Task 8 (spec › 4.7, 4.8): the Columns menu, a disclosure under the toolbar holding one POST form, and
   the header's switch that narrows the navigation to an icon rail from 960 pixels: each word kept as the link's
   accessible name and tooltip (the template marks it `sr`), Admin a popover menu beside the rail (the Popover API,
   no script). Below 960 the navigation is the bottom bar, so the switch is not offered. */
details.columns, details.columns[open] { margin: 0; padding: 0; border: 0; background: none; } /* a button that opens a panel, not the bordered disclosure */
details.columns > summary { cursor: pointer; } /* its look is the toolbar's secondary style (above) */
@media (pointer: coarse) { details.columns > summary { min-height: 44px; } } /* DESIGN 12: the site's coarse rule, which the line above outranks */
details.columns form { width: max-content; max-width: 100%; margin: var(--space-1) 0 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); }
details.columns fieldset { margin: 0 0 var(--space-2); padding: 0; border: 0; }
details.columns ol { list-style: none; margin: 0; padding: 0; }
details.columns li { display: flex; align-items: center; gap: var(--space-1); }
details.columns li label { flex: 1 1 auto; margin: 0 var(--space-2) 0 0; }
details.columns li button { padding-inline: var(--space-2); }
details.columns li button:disabled { opacity: 0.4; cursor: default; box-shadow: none; } /* the first can go no higher, the last no lower */
/* The chevron at the navigation's top (Charlie, 14 Oct: as the legacy): at the head's right pointing left, centred in the
   rail pointing right; 32 px on a mouse, 44 on touch (the coarse rule); the form is its own, so it works without a script. */
.nav-switch { display: none; margin: 0; }
.nav-switch button { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--chrome-muted); box-shadow: none; }
.nav-switch button:hover { background: var(--chrome-2); color: var(--text); box-shadow: none; }
.nav-switch .icon { width: 1.25rem; height: 1.25rem; transform: rotate(180deg); }
.nav-switch button[aria-expanded=false] .icon { transform: none; }
@media (min-width: 960px) {
  .nav-switch { display: block; }
  .narrow .side-head { justify-content: center; padding: 0; }
  .narrow .side .brand { display: none; }
}
@media (min-width: 960px) {
  /* From 960 the open menu floats under its button, so the toolbar and the table do not move. */
  details.columns { position: relative; }
  details.columns form { position: absolute; top: 100%; left: 0; z-index: var(--z-menu); max-width: none; box-shadow: var(--shadow-menu); }
  body.desk.narrow { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .narrow .side ul { padding-inline: 0.375rem; }
  .narrow .side a,
  .narrow .side .nav-admin { justify-content: center; padding: 0.5rem 0; }
  .narrow .side .lbl,
  .narrow .side .nav-h,
  .narrow .side .who { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .narrow .side .note,
  .narrow .side .nav-admin-open { display: none; }
  .narrow .side .icon { width: 1.25rem; height: 1.25rem; }
  .narrow .side-foot { border-top: 0; padding: 0; }
  .narrow .side .nav-admin { display: flex; align-items: center; width: calc(100% - 0.75rem); margin: var(--space-2) 0.375rem 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-2); font: inherit; cursor: pointer; }
  .narrow .side .nav-admin:hover,
  .narrow .side .nav-admin.here { background: var(--chrome-2); box-shadow: none; color: var(--text); }
  .narrow .side .nav-admin.here .icon { color: var(--accent); }
  .side .nav-pop:not(:popover-open) { display: none; } /* `.side ul`'s flex would outrank the browser's own hiding */
  .side .nav-pop:popover-open {
    position: fixed; inset: auto; top: var(--side-head-h); left: var(--rail-w); margin: 0; min-width: 13rem; padding: var(--space-2);
    list-style: none; background: var(--chrome-2); color: var(--on-chrome); border: 1px solid var(--control); border-radius: var(--radius);
    display: flex;
  }
  .side .nav-pop a { justify-content: flex-start; padding: 0.375rem 0.625rem; color: var(--on-chrome); }
}

/* --- The invoice popup (desk v2 Task 9; spec › 4.5, DESIGN 3 and 18): the page's one modal <dialog id="sheet">,
   which js/sheet.js fills with the invoice's body part (no script, no popup: the link opens the page). From 760 CSS
   pixels a panel over the dimmed grid, at most 64rem wide, the × at its top right; below 760 it fills the screen, an
   invoice's lines a list (the phone rules above), its footer padded for the home indicator. Its body scrolls inside
   it and never chains to the grid behind (`overscroll-behavior: contain`). The dialog has no padding of its own, so a
   click on the dialog element itself is a click on the backdrop, which closes it (APG Dialog (Modal) pattern). */
#sheet { width: min(64rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); padding: 0; color: var(--text); background: var(--bg); border: 1px solid var(--rule); overflow: hidden; }
#sheet[open] { display: flex; flex-direction: column; }
#sheet .sheet-close { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 1; padding: 0.125rem 0.625rem; font-size: 1.25rem; line-height: 1.2; color: var(--accent); background: var(--bg); border-color: var(--control); }
#sheet .sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#sheet .sheet-status { margin: 0; padding: var(--space-4) 1.25rem; padding-right: 3.5rem; color: var(--muted); }
#sheet .table-box { max-height: none; }
#sheet .sheet-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); margin: var(--space-3) -1.25rem 0; padding: var(--space-2) 1.25rem calc(var(--space-2) + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--rule); }
#sheet .sheet-foot p { margin: 0 auto 0 0; }
#sheet a.btn.secondary { color: var(--accent); background: transparent; border-color: var(--control); }
/* Below 760, written as "not 760 and wider" so the coarse-pointer block above stays the last rule at the cards'
   width (tests/test_look.py's 16 px pin); the sheet sets no control's size. */
@media not all and (min-width: 760px) {
  #sheet { width: 100%; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; }
  #sheet .sheet-foot { margin-inline: calc(-1 * var(--space-3)); margin-top: auto; padding-inline: var(--space-3); } /* at the foot, in thumb reach */
}

/* --- The theme control (desk v2 Task 19; Charlie, 13 Oct 22:4x "allow us to toggle between light and dark mode"; moved from
   the header to the navigation's foot and the bottom bar's Account menu in slice 5e): a native disclosure (the APG
   Disclosure pattern; keyboard and no-script for free), its summary the state's icon and word (Auto, Light or Dark, named
   "Theme: …"), its panel one form of three buttons, the chosen one pressed and ticked, fixed beside the navigation's foot
   (inline in the phone's menu). A collapsed rail shows the icon alone, the word kept for a screen reader. */
details.theme,
details.theme[open] { position: relative; margin: 0; padding: 0; border: 0; background: none; }
details.theme > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2rem;
  padding: 0 0.75rem;
  color: var(--on-chrome);
  border: 1px solid var(--chrome-muted);
  border-radius: var(--radius);
  font-size: var(--fs-table);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}
details.theme > summary::-webkit-details-marker { display: none; }
details.theme > summary:hover,
details.theme[open] > summary { background: var(--chrome-2); }
.theme-form {
  position: fixed; /* out of the navigation's scrolling box, beside its foot */
  bottom: var(--space-3);
  left: calc(var(--nav-w) + var(--space-2));
  z-index: var(--z-float);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 13rem;
  margin: 0;
  padding: var(--space-1);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.theme-form > button,
.theme-form > button + button {
  justify-content: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.375rem 0.625rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  font-weight: var(--fw-medium);
  text-align: left;
}
.theme-form > button small { color: var(--muted); font-weight: var(--fw-body); }
.theme-form > button:hover { background: var(--hover); box-shadow: none; }
.theme-form > button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.theme-form > button[aria-pressed="true"]::after { content: "✓" / ""; margin-left: auto; }
.theme-form :focus-visible { outline-color: var(--focus); }
.narrow .theme-form { left: calc(var(--rail-w) + var(--space-2)); }
.narrow .side .acts { flex-direction: column; }
.narrow .side .asof { justify-content: center; margin: 0 0 var(--space-2); }
.narrow .side .acts :is(.word, .asof .lbl) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.narrow .side .acts :is(details.theme > summary, .signout button) { justify-content: center; width: 2rem; min-height: 2rem; padding: 0; }
.narrow .side-foot { display: flex; flex-direction: column; align-items: center; padding-bottom: var(--space-3); }
@media (pointer: coarse) { /* DESIGN 12: the site's coarse rule, which the lines above outrank (and the base rule far below outranks again: the strip's winning rule is by "View as employee", #814) */
  .acts :is(details.theme > summary, .signout button) { min-height: 44px; min-width: 44px; }
  .theme-form button { min-height: 44px; }
}

/* --- The page's one look, "Airtable" (desk v2 Task 19's variant B, made the only look in the Lines page v3, Charlie
   14 Oct 13:4x: "i dont need both look a and b, just one will do"; the per-browser Look switch and look A's own
   rules are gone). A's tokens and hierarchy with Airtable's grid: compact 2rem rows, a line round every cell, the
   chevron and the invoice frozen at the left while the rest scrolls sideways in the box, a small type glyph before
   each header's label (A text, # number, ◷ date, ◉ a chip), and the toolbar a row of pills at the top left:
   Filters (the disclosure that shows the filter row and From and To, on the desk as on the phone) and Columns. Every glyph's alternative text is
   empty: the label is the name. */
details.filters > summary,
details.columns > summary { border-radius: var(--radius-pill); }
details.filters > summary::after { content: none; }
@media (min-width: 760px) {
  details.filters { display: block; margin: 0; padding: 0; border: 0; background: none; }
  details.filters > summary { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; padding: 0 0.75rem; border: 1px solid var(--control); background: transparent; color: var(--text); font-size: var(--fs-table); font-weight: var(--fw-medium); list-style: none; cursor: pointer; }
  details.filters > summary:hover { background: var(--hover); }
  details.filters > summary::-webkit-details-marker { display: none; }
  details.filters[open] > summary { border-color: var(--mark); background: var(--accent-soft); color: var(--accent); }
  main:not(:has(details.filters[open])) .grid tr.filters { display: none; }
  main:not(:has(details.filters[open])) .filter-bar { display: contents; } /* no gap of its own while shut */
  main:not(:has(details.filters[open])) .filter-bar > :is(label, button, a) { display: none; } /* the chips say what is in force */
  main:not(:has(details.filters[open])) .grid thead th { border-bottom-width: 2px; }
  .grid :is(th, td) { border-right: 1px solid var(--rule); }
  .grid tbody tr:not(.more) > td:not([colspan]) { padding-block: 0.125rem; } /* A's 24 px link targets fit the 2rem row */
  .grid :is(th, td):last-child { border-right: 0; }
  .grid :is(th, td).c-x { position: sticky; left: 0; z-index: 1; width: var(--chev-w); min-width: var(--chev-w); background: inherit; }
  .grid :is(th, td).c-invoice { position: sticky; left: var(--chev-w); z-index: 1; background: inherit; }
  .grid thead :is(th, td):is(.c-x, .c-invoice) { z-index: 3; background: var(--surface); }
  :where(.grid) tbody tr:not(.more) { background-color: var(--bg); }
  .grid tbody tr.more > td { background: var(--surface); } /* opaque under the frozen cells */
  .grid thead th > a::before { margin-right: 0.3rem; color: var(--muted); font-weight: var(--fw-body); font-size: 0.6875rem; }
  .grid thead th:is(.c-invoice, .c-customer, .c-description, .c-name, .c-industry, .c-country, .c-size, .c-brand, .c-category, .c-type, .c-job_category, .c-queue, .c-status, .c-tyre_size, .c-tyre_brand, .c-condition, .c-forklift, .c-serial, .c-wheel, .c-repair, .c-context, .c-item_code, .c-item_name) > a::before { content: "A" / ""; }
  .grid thead th.num > a::before { content: "#" / ""; }
  .grid thead th:is(.c-date, .c-first, .c-last, .c-year, .c-completed) > a::before { content: "◷" / ""; }
  .grid thead th:is(.c-kind, .c-class, .c-seg, .c-segment, .c-flags) > a::before { content: "◉" / ""; }
}
@media (pointer: coarse) { /* DESIGN 12: the site's coarse rule, which B's 2rem pills above outrank on a tablet */
  details.filters > summary { min-height: 44px; }
}

/* --- The Lines grid's columns and density (the Lines page v3, R-L2; the legacy's grid: fixed widths by the kind of
   content, a description of two lines, everything else on one). The segment is the legacy's small D or E badge, its
   words in the title; a blank cell in the legacy's columns is a dash. From 760 the table lays out fixed: the
   numbers, the year and the date narrow and right-aligned, the invoice and the segment narrow, the customer medium,
   the description taking what is left (and wrapping to two lines, the whole text kept in its cell); a box narrower
   than the columns scrolls, the chevron and invoice columns staying. The
   phone's cards above 760 are untouched. */
.nil { color: var(--muted); }
.ign { color: var(--muted); } /* a Dealers job's points cells say "ignored" (Decision 178): a word, so it stays on a card */
/* the reason behind a dash (ordering v4, Task 6b; its own class, the Lines page has a `.cut.why`): read aloud and held in the cell's title; seen on a phone's card for the two cells it matters (Stock, Reaches safety) */
.cell-why { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* the ordering table's rows that matter (Task 6b): a due row, the ones that make it time to order, is filled in the flag colours and its date is in the flag's text; with none due, the size that sets the date keeps a rule on its left edge */
.grid tbody tr.row.due { background: var(--wrong-bg); }
.lines-grid.grid tbody tr.row.due > td.c-reaches { color: var(--wrong); font-weight: 600; }
.lines-grid.grid tbody tr.row.due > td.c-size .chip-wrong { display: block; width: max-content; max-width: 100%; margin-top: 0.125rem; font-weight: 400; box-shadow: inset 0 0 0 1px var(--wrong); }
.grid tbody tr.row.next > td.c-size { box-shadow: inset 3px 0 0 var(--check); }
details.panel > summary .glance { margin-left: var(--space-2); font-weight: 400; color: var(--muted); }
details.panel > summary .glance .gl { display: inline-block; } /* each part wraps whole, the separator between them can break (a phone) */
.lines-grid { position: relative; } /* the box holds its cells' visually hidden words: left to the page, a wide table's last cell widened it */
@media (min-width: 760px) {
  .lines-grid > table { table-layout: fixed; width: 100%; }
  .lines-grid :is(th, td) { overflow: hidden; text-overflow: ellipsis; }
  .lines-grid thead th:is(.c-tyre_size, .c-tyre_brand, .c-condition, .c-forklift, .c-serial, .c-wheel, .c-repair, .c-job_category, .c-completed, .c-queue, .c-status) { width: 6rem; }
  .lines-grid thead th.c-payment { width: 5rem; }
  .lines-grid thead th.c-context { width: 9rem; }
  .lines-grid thead th.c-item_code { width: 6.5rem; } /* a catalogue code, e.g. PH-650-10 (ruling 8) */
  .lines-grid thead th.c-item_name { width: 9rem; }
  .lines-grid td.c-customer:has(.name),
  .lines-grid td.c-description:has(.desc) { width: auto; max-width: none; min-width: 0; } /* the earlier auto layout's shares */
  .lines-grid.grid tbody td .cut:not(.why) { display: block; max-width: none; }
  /* Wrap cells (F5), the account's switch: on, a text or date cell takes two lines and is cut after them (the whole value in its title; the opened row shows it all); off, one line clipped with an ellipsis */
  .lines-grid.wrap.grid tbody td .cut:not(.why) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow: hidden; overflow-wrap: anywhere; }
  .lines-grid.wrap.grid tbody td a.cut.name { line-height: 1.375; } /* two lines of the link take the text's height, not the 24 px target line (SC 2.5.8's spacing exception holds: the rows' neighbours are far) */
  .lines-grid.clip.grid tbody td .cut:not(.why) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The Customers' Contact at 130 px (Decisions 140, 142): the name and its number on one line, cut, the whole in its title; the day of its invoice on a line of its own, never cut, so an old contact never passes as current; the same with cells wrapped or clipped */
  .lines-grid:is(.wrap, .clip).grid tbody td.c-contact > .cut:not(.why) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lines-grid.grid tbody td.c-contact > .muted { display: block; white-space: nowrap; }
  .lines-grid.grid tr.row:has(details[open]) .cut.desc { display: block; -webkit-line-clamp: none; line-clamp: none; } /* the opened row takes the height its whole description needs (R-L3) */
  .lines-grid tbody tr > td:not([colspan]) { padding-block: 0.1875rem; } /* below the compact rows' own rule, which keeps them tight */
  .lines-grid.grid td.c-description:has(> .sales) { padding-right: 1.625rem; }
}
/* Column widths by drag (js/widths.js; R-L1): a handle on each edge of a header cell, inside it (the cell clips what
   overflows), the column-resize cursor, a thin accent line on hover and while dragging; 20 px wide on a touch screen. The
   phone's cards have none. */
.rz, [data-reset-widths] { display: none; }
@media (min-width: 760px) {
  [data-reset-widths]:not([hidden]) { display: inline-block; }
  .lines-grid thead .rz { display: block; position: absolute; top: 0; bottom: 0; right: 0; width: var(--rz-dense); cursor: col-resize; touch-action: none; user-select: none; outline: none; } /* the legacy's separator at the cell's edge (the study's 4.3), 8 px of hit area so the funnel can sit flush beside it */
  .lines-grid thead .rz:hover::after,
  .lines-grid thead .rz:focus-visible::after,
  .lines-grid thead .rz:active::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 2px; background: var(--mark); } /* the 2 px accent line */
}

/* The button's line stays in view while the box is scrolled sideways: a cell that clips (the rule above) is the scrollport
   its sticky child sticks to, so this one does not. */
@media (min-width: 760px) { .lines-grid.grid tr.more > td { overflow: visible; } }
/* The opened row is the row itself, taller (Charlie, 14 Oct 2026): every cell shows its whole content, wrapping inside
   its column's width, the cells aligned at the top; numbers and dates stay on one line. The one line under it holds the
   button (`tr.more`). */
.lines-grid.grid tr.row:has(details[open]) .cut { display: block; max-width: none; overflow: visible; white-space: normal; text-overflow: clip; overflow-wrap: anywhere; -webkit-line-clamp: none; line-clamp: none; }
/* DR77, the soft text (Charlie, 21 Oct 2026): a line's own part of the job text, else the whole text or the heading,
   under the description in a smaller and softer type (--fs-small in --muted, both passing SC 1.4.3 on either
   surface). Collapsed it takes the cells' clamp: two lines with Wrap on, one with Wrap off, three on a phone's card
   (`--soft-lines` is the wrap-on count, so a variant can be rendered); the opened row shows it whole with its line
   breaks, and a search's pieces ("..." for the rest) give way to the whole text with every match marked. */
.cut.soft { color: var(--muted); font-size: var(--fs-small); line-height: 1.3; }
.soft-all { display: none; }
@media (min-width: 760px) { .lines-grid.grid tbody td .cut.soft { font-size: var(--fs-soft); } } /* the dense rows' 12 px description (21 Oct) leaves --fs-small above it: 11 px is the smaller step, as the headers' */
@media (min-width: 760px) { .lines-grid.wrap.grid tbody td .cut.soft { -webkit-line-clamp: var(--soft-lines, 2); line-clamp: var(--soft-lines, 2); } }
.lines-grid.grid tr.row:has(details[open]) .cut.soft { white-space: pre-line; }
.lines-grid.grid tr.row:has(details[open]) .soft-cut { display: none; }
.lines-grid.grid tr.row:has(details[open]) .soft-all { display: inline; }
@media (max-width: 759.98px) {
  .wide.grid tbody .cut.soft { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--soft-lines-phone, 3); line-clamp: var(--soft-lines-phone, 3); overflow: hidden; overflow-wrap: anywhere; }
}
/* Charlie, 14 Oct, 17:3x: the first line of every column sits on one line and no cell is cut, the date wrapping if its
   column is narrower than "30 Dec 2008". The selector outranks the closed rows' (`tr.row > td:not([colspan])`, which
   centres them in 52 px with no padding above or below), so the numbers and dates join the text at the top. */
.lines-grid.grid:not(:has(td.c-all)) tbody tr.row:has(details[open]) > td:not([colspan]) { vertical-align: top; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
@media (min-width: 760px) { .lines-grid.grid:not(:has(td.c-all)) tbody tr.row:has(details[open]) > td:not([colspan], .c-x) { padding-block: 0.5rem; } }
/* A touch screen at desk width (a tablet) has no title to read a cut cell by (Charlie, 28 Oct 2026: "the features available on mobile"): a grid with no chevron to open a row by (Customers, Items, the Business and ordering tables) shows every cell whole, wrapping inside its column, where the mouse's grid cuts it with an ellipsis; a grid with a chevron (Lines, Jobs) keeps its cut cells and opens the row. */
@media (min-width: 760px) and (pointer: coarse) {
  .lines-grid.grid:not(:has(td.c-x)) tbody td:not([colspan]) { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .lines-grid.grid:not(:has(td.c-x)) tbody td .cut:not(.why) { display: block; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; -webkit-line-clamp: none; line-clamp: none; }
}

/* --- The Lines page copied from the legacy (the Lines page v3, slice 5a; Charlie 14 Oct 2026: "try to copy it exactly";
   the study's 1.3 to 1.11, 2.2, 2.5 and 3). The top of page: one wrapping row with the search box (40 px, 8 px radius, the
   "/" key badge inside), the count, and 28 px buttons (13 px, 6 px radius) for Syntax and Settings, whose menus are native
   <details> (288 px and 384 px; fixed and centred on the phone). Then the term chips, the table's
   header (36.5 px, 11 px uppercase, a 24 px funnel at the right) and rows (52 px, 40 compact, 12 px cells, no stripes), the
   footer's expander. Colours are the tokens, the legacy's values in dark (the nearest that keep the 3:1 edges in light). */
.lbar { gap: 0.5rem; margin: 0 0 0.5rem; }
.lbar details { margin: 0; padding: 0; border: 0; background: none; position: relative; }
.lform { flex: 1 1 18rem; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; }
.lform .lsearch { position: relative; display: block; flex: 1 1 14rem; max-width: none; min-width: 0; margin: 0; } /* the free width (#269): `[role=search] label` (32rem) is no cap on this box */
.lsearch > .icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lsearch > input { display: block; width: 100%; max-width: none; height: 2.5rem; margin: 0; padding: 0 2.25rem 0 2.5rem; border-radius: var(--radius); background: var(--field); border-color: var(--control); font-size: 0.875rem; box-shadow: var(--shadow-search); }
.lform .lsearch > input { max-width: none; } /* `label > input` (32rem, one more class in its :not) outranks `.lsearch > input` (#269) */
input::placeholder { color: var(--muted); opacity: 1; } /* every input's hint wears the muted token: the browser's own grey was 3.92:1 in dark (DESIGN 13); the phone's transparent one below outranks it */
.lsearch > input { text-overflow: ellipsis; } /* a hint longer than the box ends in "…", not mid-letter (#280) */
.lsearch .phint { display: none; } /* the phone's short hint (#269), below */
.lsearch > input:focus { border-color: var(--mark); }
.lsearch kbd { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); padding: 2px 6px; border: 1px solid var(--control); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font: 0.6875rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; pointer-events: none; }
.lcount { padding: 0 0.375rem; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lcount .n { font-weight: 600; color: var(--text); }
.lcount .dot { color: var(--faint); }
.lbar .lbtn { display: inline-flex; align-items: center; gap: 0.375rem; height: 1.75rem; min-height: 1.75rem; padding: 0 0.625rem; border: 1px solid var(--control); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 0.8125rem; font-weight: 500; line-height: 1; list-style: none; cursor: pointer; }
.lbar .lbtn::-webkit-details-marker { display: none; }
.lbar .lbtn:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.lbar details[open] > .lbtn { border-color: var(--mark); background: var(--accent-soft); color: var(--accent); }
.lbar .lbtn .icon { width: 0.9375rem; height: 0.9375rem; }
.menu .pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: var(--z-popover); width: 24rem; max-width: 92vw; padding: 1rem; border: 1px solid var(--control); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-pop); text-align: left; }
.menu.settings .pop { width: 18rem; padding: 0.75rem; max-height: 78vh; overflow-y: auto; }
.pop h2, .pop .eh { margin: 0 0 0.5rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pop .eh { margin-top: 0.75rem; }
.tries { list-style: none; margin: 0; padding: 0; }
.tries a { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.75rem; text-decoration: none; }
.tries a:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.tries code { color: var(--accent); font-size: 0.75rem; }
.tries.pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.tries.pills a { padding: 0.125rem 0.5rem; border: 1px solid var(--control); border-radius: var(--radius-pill); background: var(--bg); }
.tries.pills code { color: var(--text-2); }
.pop .keys { margin: 0.75rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--rule); font-size: 0.75rem; color: var(--muted); }
.pop .keys .kw { font-weight: 500; color: var(--text-2); }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: inherit; color: var(--text-2); }
.tilde { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
/* The Legend (slice 5c): a term and its meaning, two columns; the sample sits in the term's column in its own real style. */
.menu.legend-menu .pop { width: 28rem; padding: 0.75rem; max-height: 78vh; overflow-y: auto; }
.lg { display: grid; grid-template-columns: minmax(4.5rem, max-content) 1fr; gap: var(--space-1) var(--space-3); margin: 0; font-size: 0.75rem; color: var(--muted); }
.lg dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem; margin: 0; font-weight: 500; color: var(--text-2); }
.lg dd { margin: 0; }
.lg .icon { width: 0.75rem; height: 0.75rem; }
.lg .red { font-weight: 600; color: var(--wrong); }
.pop .note { margin: 0 0 var(--space-1); font-size: 0.75rem; color: var(--muted); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0; padding: 0.375rem 0; }
.setting .sl { display: block; font-size: 0.875rem; color: var(--text-2); }
.setting small { display: block; font-size: 0.75rem; color: var(--muted); }
.setting form, form.setting { margin: 0; }
.sw, .seg2 button { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; margin: 0; padding: 0 0.5rem; border: 1px solid var(--control); border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); font-size: 0.75rem; font-weight: 400; line-height: 1.2; text-decoration: none; cursor: pointer; }
.sw.on, .seg2 button[aria-pressed=true] { border-color: var(--mark); background: var(--accent-soft); color: var(--accent); }
.seg2 { display: inline-flex; gap: 0.25rem; }
.seg2 button + button { margin-left: 0; }
.columns-in { margin: 0.5rem 0 0; }
.columns-in .ch { display: flex; align-items: center; justify-content: space-between; }
.columns-in .ch .eh { margin: 0 0 0.25rem; }
.columns-in form { margin: 0; }
.columns-in fieldset { height: 15rem; overflow-y: auto; margin: 0 0 0.5rem; padding: 0.25rem; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--bg); }
.columns-in legend { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.columns-in ol { margin: 0; padding: 0; list-style: none; }
.columns-in li label { font-size: 0.8125rem; color: var(--text-2); }
button.linkish { min-height: 24px; padding: 0 0.25rem; border: 0; background: none; color: var(--accent); font-size: 0.75rem; }
button.linkish:hover { box-shadow: none; text-decoration: underline; }
/* the term chips (the study's 1.5): one pill a word, a count of what it alone finds, the x; a word that finds nothing red */
.tchips { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.375rem 0.75rem; margin: 0 0 0.5rem; }
.tchips .chips { margin: 0; gap: 0.375rem; }
.tchips .fchip { min-height: 1.5rem; padding: 0 0.625rem; font-size: 0.75rem; }
.tchips .fchip.term { border-color: var(--control); background: var(--surface); color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-decoration: none; max-width: 100%; overflow-wrap: anywhere; } /* a word of 44 letters wraps in its chip, not past the screen (#329) */
.tchips .fchip.term .count { font-family: var(--font); font-weight: 400; color: var(--muted); }
.tchips .fchip.zero { border-color: var(--wrong); background: var(--wrong-bg); color: var(--wrong); }
.tchips .fchip.zero .count { font-weight: 600; color: var(--wrong); }
.tchips .fchip.refused { border-color: var(--wrong); background: var(--wrong-bg); color: var(--wrong); } /* a day filter the page refused (the walk of 6 Nov 2026): its chip says "not understood" and shows the wrong tone, never the tone alone */
.tchips .fchip.mode { text-decoration: none; }
.tchips .fchip.mode.off { border-color: var(--control); background: transparent; color: var(--muted); }
.order { display: inline-flex; gap: 0.375rem; }
.obtn { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 1.5rem; padding: 0 0.5rem; border: 0; border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 0.75rem; text-decoration: none; }
.obtn.on { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.obtn.soon { opacity: 0.6; }
.obtn .icon { width: 0.75rem; height: 0.75rem; }
.clearall { flex: 1 1 100%; font-size: 0.8125rem; color: var(--muted); }
/* The foot of the segmented Lines table (slice 5c): what is loaded, the way to load more, and one quiet "Loading more…" row
   (`tr.lmore-wait`) while a segment arrives. */
.lmore { margin: var(--space-2) 0; }
.lmore-wait td { padding: var(--space-3) var(--space-3); border: 0; background: none; color: var(--muted); font-size: 0.8125rem; text-align: left; } /* the one quiet row at the end while the next segment is on its way: no colour */
.lmore-wait span { position: sticky; left: var(--space-3); } /* in view while the box is scrolled sideways */
.js .lmore:not([data-failed]) .lmore-link { display: none; } /* the script loads the next segment as the reader nears the end */
.lmore-link { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ltop { margin: 0 0 var(--space-2); font-size: 0.8125rem; color: var(--muted); }
/* the table (the study's 1.7 to 1.9) */
.lines-grid.table-box { border-radius: var(--radius-lg); }
@media (min-width: 760px) {
  .lines-grid > table { min-width: calc(var(--cols-w) + var(--desc-min)); } /* the fixed columns and the description's floor: a box narrower scrolls in itself */
  /* The default widths come from the cells, not the header (F5): the widest typical value plus the 16 px of padding and the 1 px rule: "17 Oct 2026", an invoice number, one segment badge, a few digits, money to "99,999.00", a customer of about 16 characters (cut with an ellipsis). A header label wider than its column is cut with an ellipsis (its full name in the link's title and aria-label); the funnel's slot and the sort arrow keep theirs. The fixed ones together with the chevron's are --cols-w; the description is the one auto column */
  /* Dense (Charlie, 21 Oct 2026: "prioritize squeezing as much info as I can into the column headers"): each width is the larger of the header (4 px, the label, the funnel's 24 px less the 4 px it overlaps, the border) and the widest typical value at the grid's 12 px font plus 4 px of padding each side and the border (the date and the numbers with no slack; the type, customer and invoice 8 % for Linux's wider face), the foot's totals in the regular weight so a column is not sized for them. Lengths from the live record (111,169 lines; p99 in characters): quantity 2, unit and net 8, discount 7, revenue 10 (its foot sum, millions, bold), invoice 10, the type word 9, the date a fixed 11; the customer about its p75 (33 characters) and the description the rest. The sorted column adds --sa (its arrow) to its own width and, through --sa-w, to the floor. */
  .lines-grid thead th[aria-sort] { --sa: 0.75rem; }
  .lines-grid thead th.c-date { width: calc(var(--bch) * 10.5 + 0.5625rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-year { width: calc(2.75rem + var(--sa, 0rem)); } /* four digits, and YEAR over them (the icons are above the words since 28 Oct 2026, so no header width is held for them) */
  .lines-grid thead th.c-invoice { width: calc(5.125rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-customer { width: calc(var(--f-customer, 7rem) + var(--sa, 0rem)); } /* 112 px at 1280, about 20 of its 27-character median; from 1400 px 13.5rem (216 px, the p75), beyond that the description grows */
  .lines-grid thead th.c-seg { width: calc(var(--bch) * 2 + 1.25rem + var(--sa, 0rem)); } /* one badge (D, E or E?) and "Seg", 35 px: the badge's 25 px and the 4 px sides with the rule; the label (23 px) and its funnel above it fit (it was 40 with SEG in capitals, 51.5 with the funnel beside the word) */
  .lines-grid thead th.c-category { width: calc(5.5rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-type { width: calc(var(--bch) * 7.5 + 0.5625rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-ton { width: calc(var(--bch) * 4.5 + 0.5625rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-qty { width: calc(var(--bch) * 4.5 + 0.5625rem + var(--sa, 0rem)); } /* its p99 is 2 digits, so 4 characters hold "-2" and "1234" (43 px, it was 52.5); a longer figure is cut with an ellipsis, its whole value in the cell's title, and the opened row shows it whole; the foot's total passes over the empty cell beside it */
  .lines-grid thead th.c-price { width: calc(var(--bch) * 8 + 0.5625rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-discount { width: calc(var(--bch) * 8 + 0.5625rem + var(--sa, 0rem)); } /* "-1,000.00" whole (DR76 fills it with negative figures on Xero lines): 62 px of figure, the 4 px sides and the rule */
  .lines-grid thead th.c-net { width: calc(var(--bch) * 8 + 0.5625rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-revenue { width: calc(var(--bch) * 11.75 + 0.5625rem + var(--sa, 0rem)); } /* the body's p99 is 8 characters; the foot's amount, millions, 12,345,678.90 whole in the regular weight (review I1) */
  .lines-grid thead th.c-flags { width: calc(var(--bch) * 8.5 + 1.0625rem + var(--sa, 0rem)); }
  .lines-grid thead th.c-description { width: auto; } /* the one auto column: what the box leaves, from --desc-min (160 px) up */
  /* The Lines table's floor is the columns SHOWN, as the Customers' and Items' are (Charlie, 20 Oct 2026: a Lines grid with Year and Ton on gave the description no room, one letter or none, since the constant --cols-w held the default set only): a column's presence sets its --f-<word> (its width above), the chevron's and these make --cols-w, and the description keeps --desc-min whatever is shown. */
  #grid-region[data-grid="lines"] { --cols-w: calc(var(--chev-w) + var(--sa-w, 0rem) + var(--f-date, 0rem) + var(--f-year, 0rem) + var(--f-invoice, 0rem) + var(--f-customer, 0rem) + var(--f-seg, 0rem) + var(--f-category, 0rem) + var(--f-type, 0rem) + var(--f-ton, 0rem) + var(--f-qty, 0rem) + var(--f-price, 0rem) + var(--f-discount, 0rem) + var(--f-net, 0rem) + var(--f-revenue, 0rem) + var(--f-flags, 0rem) + var(--f-tyre_size, 0rem) + var(--f-tyre_brand, 0rem) + var(--f-condition, 0rem) + var(--f-forklift, 0rem) + var(--f-serial, 0rem) + var(--f-wheel, 0rem) + var(--f-repair, 0rem) + var(--f-job_category, 0rem) + var(--f-completed, 0rem) + var(--f-queue, 0rem) + var(--f-status, 0rem) + var(--f-payment, 0rem) + var(--f-context, 0rem) + var(--f-item_code, 0rem) + var(--f-item_name, 0rem)); }
  #grid-region[data-grid="lines"]:has(th[aria-sort]) { --sa-w: 0.75rem; }
  #grid-region[data-grid="lines"]:has(th.c-date) { --f-date: calc(var(--bch) * 10.5 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-year) { --f-year: 2.75rem; }
  #grid-region[data-grid="lines"]:has(th.c-invoice) { --f-invoice: 5.125rem; }
  #grid-region[data-grid="lines"]:has(th.c-customer) { --f-customer: 7rem; }
  @media (min-width: 1400px) { #grid-region[data-grid="lines"]:has(th.c-customer) { --f-customer: 13.5rem; } }
  #grid-region[data-grid="lines"]:has(th.c-seg) { --f-seg: calc(var(--bch) * 2 + 1.25rem); }
  #grid-region[data-grid="lines"]:has(th.c-category) { --f-category: 5.5rem; }
  #grid-region[data-grid="lines"]:has(th.c-type) { --f-type: calc(var(--bch) * 7.5 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-ton) { --f-ton: calc(var(--bch) * 4.5 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-qty) { --f-qty: calc(var(--bch) * 4.5 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-price) { --f-price: calc(var(--bch) * 8 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-discount) { --f-discount: calc(var(--bch) * 8 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-net) { --f-net: calc(var(--bch) * 8 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-revenue) { --f-revenue: calc(var(--bch) * 11.75 + 0.5625rem); }
  #grid-region[data-grid="lines"]:has(th.c-flags) { --f-flags: calc(var(--bch) * 8.5 + 1.0625rem); }
  #grid-region[data-grid="lines"]:has(th.c-tyre_size) { --f-tyre_size: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-tyre_brand) { --f-tyre_brand: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-condition) { --f-condition: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-forklift) { --f-forklift: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-serial) { --f-serial: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-wheel) { --f-wheel: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-repair) { --f-repair: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-job_category) { --f-job_category: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-completed) { --f-completed: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-queue) { --f-queue: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-status) { --f-status: 6rem; }
  #grid-region[data-grid="lines"]:has(th.c-payment) { --f-payment: 5rem; }
  #grid-region[data-grid="lines"]:has(th.c-context) { --f-context: 9rem; }
  #grid-region[data-grid="lines"]:has(th.c-item_code) { --f-item_code: 6.5rem; }
  #grid-region[data-grid="lines"]:has(th.c-item_name) { --f-item_name: 9rem; }
  /* The Customers and Items grids (the Customers and Items tables plan, Task 1): the same rule for their columns, each
     at least its label + 16 px + 32 px + the padding, and 16 px or 30 % of the label more, since the label's face
     differs by platform (Linux's is wider: the CI's Chromium cut "Last sold" at 8rem). Name is the Customers' auto
     column (the legacy's Company 280 as its floor), Description the Items'; Kind the legacy's Segment 110. Each grid's
     floor is its own columns' sum. */
  .lines-grid thead th.c-name { width: auto; }
  .lines-grid thead th.c-kind { width: 6.875rem; }
  .lines-grid thead th.c-segment, .lines-grid thead th.c-country { width: 8.125rem; } /* the legacy's Segment 110 and Country 120 widened to this rule for their labels; its Industry 220 (the customers study's § 2) */
  .lines-grid thead th.c-industry { width: 13.75rem; } /* the legacy's Industry 220 */
  .lines-grid thead th.c-contact { width: 8.125rem; } /* not the legacy's 220: on by default (Decision 142), it fits at 1280 in Country's place; the name reads, the number and the day are cut, whole in the title */
  .lines-grid thead th.c-invoices { width: 3.75rem; } /* a count and "Invoices": the label's 49 px with its sides (it was 5.5rem in capitals, 8.5rem with the funnel beside it) */
  .lines-grid thead th.c-first, .lines-grid thead th.c-last { width: 6.75rem; }
  .lines-grid thead th.c-questions { width: 8.25rem; }
  .lines-grid thead th.c-class { width: 7rem; }
  .lines-grid thead th.c-size { width: 7rem; }
  .lines-grid thead th.c-brand { width: 8rem; }
  #grid-region[data-grid="items"] .lines-grid thead th.c-last { width: 6.75rem; } /* "Last sold" over a day (it was 9.125rem) */
  .lines-grid thead th.c-sold { width: 4.75rem; }  /* "Times sold" (64 px) with its sides, its (i) and funnel above it (it was 6rem in capitals, 7.75rem with them beside it) */
  /* The table's floor is the columns SHOWN, each adding its own width (an employee, or a reader who hid a column in Settings, has no Questions to make room for; Task 1's m2): a column's presence sets its --f-<word>, the sum is --cols-w. */
  #grid-region[data-grid="customers"] { --cols-w: calc(var(--f-segment, 0rem) + var(--f-industry, 0rem) + var(--f-country, 0rem) + var(--f-contact, 0rem) + var(--f-kind, 0rem) + var(--f-invoices, 0rem) + var(--f-first, 0rem) + var(--f-last, 0rem) + var(--f-questions, 0rem)); --desc-min: 17.5rem; }
  #grid-region[data-grid="customers"]:has(th.c-segment) { --f-segment: 8.125rem; }
  #grid-region[data-grid="customers"]:has(th.c-industry) { --f-industry: 13.75rem; }
  #grid-region[data-grid="customers"]:has(th.c-country) { --f-country: 8.125rem; }
  #grid-region[data-grid="customers"]:has(th.c-contact) { --f-contact: 8.125rem; }
  #grid-region[data-grid="customers"]:has(th.c-kind) { --f-kind: 6.875rem; }
  #grid-region[data-grid="customers"]:has(th.c-invoices) { --f-invoices: 3.75rem; }
  #grid-region[data-grid="customers"]:has(th.c-first) { --f-first: 6.75rem; }
  #grid-region[data-grid="customers"]:has(th.c-last) { --f-last: 6.75rem; }
  #grid-region[data-grid="customers"]:has(th.c-questions) { --f-questions: 8.25rem; }
  #grid-region[data-grid="items"] { --cols-w: calc(var(--f-class, 0rem) + var(--f-size, 0rem) + var(--f-brand, 0rem) + var(--f-last, 0rem) + var(--f-sold, 0rem)); --desc-min: 24rem; } /* the description from 384 px, so the floor (1,006 px) fits the 1,014 px box at 1280 */
  #grid-region[data-grid="items"]:has(th.c-class) { --f-class: 7rem; }
  #grid-region[data-grid="items"]:has(th.c-size) { --f-size: 7rem; }
  #grid-region[data-grid="items"]:has(th.c-brand) { --f-brand: 8rem; }
  #grid-region[data-grid="items"]:has(th.c-last) { --f-last: 6.75rem; }
  #grid-region[data-grid="items"]:has(th.c-sold) { --f-sold: 4.75rem; }
  /* The ordering section (Task 3; both brands, Task 6a; snug, Charlie 22 Oct 2026: "the width fits the data"): each column
     takes what its header and its figures need and no more. A header label wraps at its spaces, so a column is the
     label's longest word + 9 px (the link's 8 px sides and the rule: the (i) and the funnel are a row above the label
     since #561, so nothing beside it is held for them, 5 Nov 2026; --sa adds the arrow of the sorted column) or its widest
     cell (a five-digit figure, a date, +9 px), whichever is wider, measured at 1280 on the system face with 5 % to spare for a wider one, and never
     under the icon row's own width, --hd-min (two icons, 41 px; 57 on a touch screen, where --fn-w is 24 px and the old
     --ca added the 16 to every column; the label link's `max-width` that kept the (i) and the funnel their room beside it, 32 px, is gone for the same reason). Size, which carries
     the chips (wrapping under the name), is the one auto column from --desc-min, and the table is as wide as its
     columns, never stretched to the box. The due row's chip ("before a container lands") stands under the size, in the Size column (#465). */
  #grid-region[data-ordering] .lines-grid thead th.c-size { width: auto; }
  #grid-region[data-ordering] { --cols-w: calc(var(--f-reaches, 0rem) + var(--f-order, 0rem) + var(--f-stock, 0rem) + var(--f-on_order, 0rem) + var(--f-demand, 0rem) + var(--f-safety, 0rem) + var(--f-at_arrival, 0rem) + var(--f-cover, 0rem) + var(--f-after, 0rem) + var(--f-in_xero, 0rem) + var(--f-on_jobs, 0rem) + var(--f-quoted, 0rem) + var(--f-change, 0rem) + var(--f-sold_last, 0rem) + var(--f-sold_before, 0rem) + var(--f-weight, 0rem) + var(--f-volume, 0rem) + var(--f-last_box, 0rem) + var(--f-past_2, 0rem) + var(--f-past_1, 0rem) + var(--f-next, 0rem) + var(--f-swing, 0rem) + var(--f-demand_day, 0rem) + var(--f-swing_day, 0rem) + var(--f-kind, 0rem) + var(--f-lifted, 0rem) + var(--f-target, 0rem) + var(--f-raw_order, 0rem) + var(--sa-w, 0rem)); --desc-min: 10rem; }
  #grid-region[data-ordering] .lines-grid > table { width: calc(var(--cols-w) + var(--desc-min)); }
  #grid-region[data-ordering][data-widths="{}"] .lines-grid.table-box { width: min(100%, calc(var(--cols-w) + var(--desc-min) + 2px)); } /* the box hugs its columns until the account drags a width (the 2 px are its border) */
  #grid-region[data-ordering] .lines-grid.grid tbody tr.row.due > td.c-size .chip-wrong { white-space: normal; line-height: 1.25; }
  #grid-region[data-ordering] .lines-grid.grid tbody td.c-size { white-space: normal; }
  /* the words never widen the Size column (sticky from 760 px): they take no width of their own and wrap inside it */
  #grid-region[data-ordering] .wide.grid tbody td.c-size > .size-also { display: block; margin-top: 0.125rem; font-size: 0.8125rem; font-weight: 400; color: var(--muted); width: 0; min-width: 100%; overflow-wrap: anywhere; }
  #grid-region[data-ordering] .lines-grid thead th.c-reaches { width: calc(var(--f-reaches) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-order { width: calc(var(--f-order) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-stock { width: calc(var(--f-stock) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-on_order { width: calc(var(--f-on_order) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-demand { width: calc(var(--f-demand) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-safety { width: calc(var(--f-safety) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-at_arrival { width: calc(var(--f-at_arrival) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-cover { width: calc(var(--f-cover) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-after { width: calc(var(--f-after) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-in_xero { width: calc(var(--f-in_xero) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-on_jobs { width: calc(var(--f-on_jobs) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-quoted { width: calc(var(--f-quoted) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-change { width: calc(var(--f-change) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-sold_last { width: calc(var(--f-sold_last) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-sold_before { width: calc(var(--f-sold_before) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-weight { width: calc(var(--f-weight) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-volume { width: calc(var(--f-volume) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-last_box { width: calc(var(--f-last_box) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-past_2 { width: calc(var(--f-past_2) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-past_1 { width: calc(var(--f-past_1) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-next { width: calc(var(--f-next) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-swing { width: calc(var(--f-swing) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-demand_day { width: calc(var(--f-demand_day) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-swing_day { width: calc(var(--f-swing_day) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-kind { width: calc(var(--f-kind) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-lifted { width: calc(var(--f-lifted) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-target { width: calc(var(--f-target) + var(--sa, 0rem)); }
  #grid-region[data-ordering] .lines-grid thead th.c-raw_order { width: calc(var(--f-raw_order) + var(--sa, 0rem)); }
  #grid-region[data-ordering]:has(th.c-reaches) { --f-reaches: max(5.5rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-order) { --f-order: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-stock) { --f-stock: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-on_order) { --f-on_order: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-demand) { --f-demand: max(4.0625rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-safety) { --f-safety: max(4.0625rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-at_arrival) { --f-at_arrival: max(3.75rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-cover) { --f-cover: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-after) { --f-after: max(4.5rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-in_xero) { --f-in_xero: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-on_jobs) { --f-on_jobs: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-quoted) { --f-quoted: max(3.75rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-change) { --f-change: max(3.8125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-sold_last) { --f-sold_last: max(4.6875rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-sold_before) { --f-sold_before: max(4.75rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-weight) { --f-weight: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-volume) { --f-volume: max(4.5625rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-last_box) { --f-last_box: max(3.3125rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-past_2) { --f-past_2: max(3.25rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-past_1) { --f-past_1: max(3.25rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-next) { --f-next: max(5rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-swing) { --f-swing: max(4.0625rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-demand_day) { --f-demand_day: max(4.5625rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-swing_day) { --f-swing_day: max(4.5625rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-kind) { --f-kind: max(2.4375rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-lifted) { --f-lifted: max(3.9375rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-target) { --f-target: max(4.75rem, var(--hd-min)); }
  #grid-region[data-ordering]:has(th.c-raw_order) { --f-raw_order: max(4.0625rem, var(--hd-min)); }
  #grid-region[data-ordering] { --hd-min: calc(1rem * 2 + 0.5625rem); } /* the icon row's own width, the (i) and the funnel side by side (16 px each), plus the cell's 8 px and rule: 41 px, and no column is narrower, so the (i) never steps aside */
  @media (pointer: coarse) { #grid-region[data-ordering] { --hd-min: calc(1.5rem * 2 + 0.5625rem); } #grid-region[data-ordering]:has(th.c-next) { --f-next: max(6rem, var(--hd-min)); } } /* the next order's box is 44 px tall on a touch screen and its input wider than 71 px, so that column keeps the 96 px it had (5rem and the old --ca): at 80 px every box was cut (the review of 5 Nov, M6). */ /* a touch screen at desk width: the icons are 24 px each, 57 px with the cell (the old --ca, 16 px more in every column). Spelled in rem here, not from `--fn-w`: that is set on `.lines-grid`, below this element, so `--hd-min` read here would keep :root's 16 px and Kind (41 px) would fall under the icon row's 48 px container rule and lose its (i) (the review of 5 Nov) */
  #grid-region[data-ordering]:has(th[aria-sort]:not(.c-size)) { --sa-w: 0.75rem; } /* the sorted column's arrow (--sa, 12 px) is in the table's width, so Size, the auto column, keeps its 160 px when a sort moves (U3: it was 148, and the due chip wrapped) */
  #grid-region[data-ordering] .lines-grid.grid thead .lbl { overflow: clip; white-space: normal; line-height: 1.15; max-height: 100%; } /* a label wraps at its spaces onto two lines ("Reaches / safety"), never cut at its natural width (the column is its longest word wide); a column dragged narrower clips it at its own box, which ends before the (i), not over it: with the icons in the row above (#561) that box is its link's 24 px, so a label squeezed into three lines is cut there, not painted up over them */
  #grid-region[data-ordering] .lines-grid thead :is(.c-past_2, .c-past_1, .c-next) .lbl { overflow-wrap: anywhere; } /* an order's number is any 1 to 20 letters, digits and dashes ("78-REV"): it wraps at a dash, or anywhere, in its 52 px; the full number is in the link's title */
  /* The Business overview's Top 20 (Task 4): each column its label + 68 px (the padding, the sort arrow, the funnel's
     slot, the (i) and the handle); the customer is the auto column from --desc-min, so a company's name keeps room and the table scrolls in its box. */
  #grid-region[data-grid="business"] .lines-grid thead th.c-customer { width: auto; }
  #grid-region[data-grid="business"] { --desc-min: 12rem; --cols-w: calc(var(--f-rank, 0rem) + var(--f-kind, 0rem) + var(--f-group, 0rem) + var(--f-revenue, 0rem) + var(--f-share, 0rem) + var(--f-change, 0rem) + var(--f-invoices, 0rem) + var(--f-last, 0rem)); }
  #grid-region[data-grid="business"] .lines-grid.grid tbody td.c-customer { white-space: normal; }
  #grid-region[data-grid="business"] .lines-grid thead th.c-rank { width: var(--f-rank); }
  #grid-region[data-grid="business"] .lines-grid thead th.c-kind { width: var(--f-kind); }
  #grid-region[data-grid="business"] .lines-grid thead th.c-group { width: var(--f-group); }
  #grid-region[data-grid="business"] .lines-grid thead th.c-revenue { width: var(--f-revenue); }
  #grid-region[data-grid="business"] .lines-grid thead th.c-share { width: var(--f-share); }
  #grid-region[data-grid="business"] .lines-grid thead th.c-change { width: var(--f-change); }
  #grid-region[data-grid="business"] .lines-grid thead th.c-invoices { width: var(--f-invoices); }
  #grid-region[data-grid="business"] .lines-grid thead th.c-last { width: var(--f-last); }
  #grid-region[data-grid="business"]:has(th.c-rank) { --f-rank: 4.75rem; }
  #grid-region[data-grid="business"] .lines-grid.grid thead th.c-rank.num > .ic { margin-right: 1rem; } /* the funnel (and the dot of the 20-row filter that is on by default) has room before the "#" (walk 2, N4): the icons stand on a number's last letter (6 Nov 2026), and over a one-character label they would stand on the "#" itself, so this column's row ends 16 px short of it; the selector named #723's `.hc` wrapper, gone with its revert (#755) */
  #grid-region[data-grid="business"]:has(th.c-kind) { --f-kind: 6.25rem; }
  #grid-region[data-grid="business"]:has(th.c-group) { --f-group: 7.25rem; }
  #grid-region[data-grid="business"]:has(th.c-revenue) { --f-revenue: 10.25rem; }
  #grid-region[data-grid="business"]:has(th.c-share) { --f-share: 6.75rem; }
  #grid-region[data-grid="business"]:has(th.c-change) { --f-change: 7.25rem; }
  #grid-region[data-grid="business"]:has(th.c-invoices) { --f-invoices: 8.25rem; }
  #grid-region[data-grid="business"]:has(th.c-last) { --f-last: 10.25rem; }
  .lines-grid { --cell-x: 0.25rem; } /* dense (Charlie, 21 Oct 2026): 4 px each side of a cell, header and body */
  @media (pointer: coarse) { .lines-grid { --fn-w: 1.5rem; --head-h: calc(1.5rem + 44px); } } /* a touch screen at desk width (a tablet): the funnel back at WCAG 2.5.8's 24 px, 4 px more at each side of the glyph */
  .lines-grid.grid thead th { position: sticky; height: var(--head-h); padding: 0; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); background: var(--surface); font-weight: var(--fw-strong); letter-spacing: 0; text-transform: none; color: var(--muted); white-space: nowrap; text-align: left; text-overflow: clip; font-size: var(--fs-label); } /* the label, the (i) and the funnel follow each other on one line (inline), so the funnel sits right after its label (`_grid_head.html` is spaceless: no line break between them); no letter-spacing; the cell never shows an ellipsis of its own: a narrowed column cuts the label's words (.lbl), not the funnel */
  .lines-grid.grid thead th[aria-sort] { box-shadow: inset 0 -2px 0 var(--accent); } /* the sorted column: its label and arrow in the accent over a 2 px accent bar, the mark of a chosen tab, in place of a tinted cell (a block of tint in dark) */
  .lines-grid.grid thead th:has(:focus-visible) { background: color-mix(in srgb, var(--surface) 92%, var(--text)); } /* the cell the keyboard is in has a faint fill */
  @media (hover: hover) { .lines-grid.grid thead th:has(a, .fn, .hb):hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); } } /* so has the cell under a mouse, if it has something to click */
  .lines-grid.grid thead th.num { text-align: right; }
  .lines-grid.grid thead th > .hd { display: flex; align-items: center; height: calc(var(--head-h) - var(--fn-w)); padding: 0 var(--cell-x) 0.1875rem; color: var(--muted); } /* a label with no sort (the Customers' Contact; the Jobs grid's Amount ex GST, which has icons and no sort link): the row under the icons */
  .lines-grid.grid thead th > .hd:first-child { margin-top: var(--fn-w); } /* a cell with no icon row lowers it to the same line (it was lowered always, so a no-sort label with icons sat a row too low: the Jobs grid, #612) */
  .lines-grid.grid thead th > a:not(.fn) { display: flex; align-items: center; justify-content: flex-start; gap: 0.125rem; box-sizing: border-box; min-width: min(1.5rem, 100%); height: calc(var(--head-h) - var(--fn-w)); padding: 0 var(--cell-x) 0.1875rem; color: var(--muted); } /* the sort link is the label and its arrow, the row under the icons, 24 px at least (WCAG 2.5.8); a cell with no icon row (a header with no meaning and no funnel) lowers it to the same line, below */
  .lines-grid.grid thead th > a:not(.fn):first-child { margin-top: var(--fn-w); }
  .lines-grid.grid thead th.num > a:not(.fn), .lines-grid.grid thead th.num > .hd { justify-content: flex-end; }
  /* A column narrower than its header (Charlie, 1 Nov 2026: "the filters and (i) needs to be shown somehow still", #613): the label gives way with an ellipsis, in every grid; with the icons in a row above it (#561) the (i) and the funnel keep their own row, so nothing beside the label needs to be saved for them and the label takes the whole row. */
  .lines-grid thead :is(.fn, .hb) { flex: none; } /* an icon never shrinks in its row */
  .lines-grid thead .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* a label wider than its column is cut with an ellipsis; its full name is in the link's title and aria-label (F5) */
  .lines-grid.grid thead th > .ic { display: flex; align-items: center; justify-content: flex-start; height: var(--fn-w); padding: 0 calc(var(--cell-x) - (var(--fn-w) - 0.75rem) / 2); }
  .lines-grid.grid thead th.num > .ic { justify-content: flex-end; } /* the icons stand on their label's edge (6 Nov 2026: centred over the column they floated, "not tied to their labels"): over its first letter, a number's over its last, each glyph's edge on the label's (the 16 px button's 2 px inset taken off the cell's 4 px) */
  @media (pointer: coarse) { .lines-grid.grid thead th > :is(a:not(.fn), .hd) { align-items: flex-start; padding-top: 0.375rem; } } /* a touch screen's 44 px label row holds its words at its top, under their icons, not 14 px below them */
  #grid-region[data-ordering] .lines-grid.grid thead th { font-size: var(--fs-soft); } /* the ordering tables' labels wrap onto two lines in the 24 px under the icons: 11 px type, */
  #grid-region[data-ordering] .lines-grid.grid thead th > :is(a:not(.fn), .hd) { padding-bottom: 0; } /* the whole 24 px row (the other grids' 3 px under a one-line label would cut a second line: the review of #758, F1) */
  #grid-region[data-ordering] .lines-grid.grid thead th .lbl { line-height: 0.75rem; } /* and two 12 px lines, exactly the 24 px (1.15 overran it by a pixel and a half) */
  /* The narrowest columns (Charlie, 4 Nov 2026: the SEG column "reduced alot more"; 6 Nov, H2: a floor of 24 px, 32 on a touch screen): the icon row is a size container (a table cell cannot be one); below two icons wide the (i) steps aside, its meaning kept in the label's title, and the funnel stays centred; the label is already cut with an ellipsis. */
  .lines-grid.grid thead th > .ic { container-type: inline-size; }
  @container (max-width: 29.99px) { .lines-grid.grid thead th > .ic:has(> .fn) > .hb { display: none; } } /* the row's content box is the cell less its rule and 2 px sides: the (i) shows from a 36 px cell (48 on a touch screen), the two icons overhanging those sides by their glyphs' own inset; an (i) with no funnel beside it never steps aside */
  @media (pointer: coarse) { @container (max-width: 45.99px) { .lines-grid.grid thead th > .ic:has(> .fn) > .hb { display: none; } } }
  .lines-grid thead .sa { flex: none; }
  .lines-grid.grid thead th > a::before { content: none; } /* the Airtable type marks are not the legacy's */
  .lines-grid.grid thead th > a::after { content: none; }
  .lines-grid.grid thead th > a:not(.fn):hover { color: var(--text); text-decoration: none; }
  .lines-grid.grid thead th[aria-sort] > a:not(.fn) { color: var(--accent); }
  .lines-grid thead .sa { width: 0.625rem; height: 0.625rem; }
  .lines-grid thead .fn { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: var(--fn-w); height: var(--fn-w); min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; } /* the funnel: a button right after the label, --fn-w wide (its glyph 12 px, centred, so 2 px each side) and no padding box of its own; z-index 1 so the resize handle at the cell's edge does not cover it */
  .lines-grid thead .fn:hover, .lines-grid thead .fn:focus-visible, .lines-grid thead .fn[aria-expanded=true], .lines-grid thead .fn.on { opacity: 1; background: color-mix(in srgb, var(--surface) 92%, var(--text)); box-shadow: none; color: var(--text); } /* muted at rest, full on hover and focus; the button no longer lies over the label, and the global inset press veil is off */
  .lines-grid thead .fn.on { color: var(--accent); background: var(--accent-soft); }
  .lines-grid thead .fn.on::after { content: ""; position: absolute; top: 0; right: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); } /* the small dot of an applied filter */
  .lines-grid thead .fn:focus-visible { outline: 2px solid var(--mark); outline-offset: -2px; } /* inside the button, so the cell does not clip it */
  .lines-grid thead .fn .icon { width: 0.75rem; height: 0.75rem; }
  /* A header's (i) (`_col_help.html`, every grid that gives meanings): the funnel's slot style, one slot left of the
     funnel; the label's link reserves that slot too, so label, (i) and funnel never meet */
  table.invoice-lines thead .hb { position: absolute; top: calc(50% - var(--fn-slot) / 2); right: calc(var(--rz-w) + var(--fn-slot)); display: flex; align-items: center; justify-content: center; width: var(--fn-slot); height: var(--fn-slot); min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); opacity: 0.8; cursor: help; }
  .lines-grid thead .hb { position: relative; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: var(--fn-w); height: var(--fn-w); min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: help; } /* the (i) follows the label like the funnel */
  .lines-grid thead .hb:hover, .lines-grid thead .hb:focus-visible, table.invoice-lines thead .hb:hover, table.invoice-lines thead .hb:focus-visible { opacity: 1; background: color-mix(in srgb, var(--surface) 92%, var(--text)); color: var(--text); }
  .lines-grid thead .hb:focus-visible, table.invoice-lines thead .hb:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; }
  .lines-grid thead .hb .icon, table.invoice-lines thead .hb .icon { width: 0.75rem; height: 0.75rem; }
  /* At rest the icons wear the labels' muted grey (4.8:1 light, 6.4:1 dark; their thin 12 px strokes keep them quieter
     than the words; the faint grey, 3.1:1, was barely there in dark: the review of #758, M4); the cell under the pointer
     or the keyboard brings its own up to the second text tone; a funnel whose column filters is in the accent. */
  .lines-grid.grid thead th:is(:hover, :focus-within) :is(.fn, .hb):not(.on) { color: var(--text-2); }
  table.invoice-lines thead th { position: relative; } /* the plain tables' head: the (i) sits in the grid head's slot */
  table.invoice-lines thead th:has(.hb) { padding-right: calc(var(--fn-slot) + var(--rz-w) + var(--space-2)); }
  table.invoice-lines thead .hb { right: var(--rz-w); }
  /* N13: a Business plain table's (i) follows its label (left- or right-aligned as the header is), not the far end of a wide cell */
  [data-plain] table.invoice-lines thead th:has(.hb) { padding-right: 0.625rem; }
  [data-plain] table.invoice-lines thead .hb { position: static; display: inline-flex; vertical-align: middle; margin-left: var(--space-1); }
  .lines-grid.grid tbody tr.row > td:not([colspan]) { height: var(--row-dense); padding: var(--cell-y) var(--cell-x); border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); vertical-align: middle; font-size: 0.75rem; line-height: 1.35; color: var(--text-2); }
  .lines-grid.comfortable.grid tbody tr.row > td:not([colspan]) { height: var(--row-comfy); padding-block: 0; } /* the earlier look, kept as a setting */
  .lines-grid.grid tbody tr.row > td.c-x { padding: 0; }
  .lines-grid.grid tfoot tr.sum > .num { font-weight: var(--fw-body); font-size: 0.75rem; overflow: visible; text-overflow: clip; z-index: 2; } /* the totals in the body's weight and size: a column is sized for its values, not for the foot (Charlie, 21 Oct 2026); the bar's rule and background still set them off; a figure wider than its cell (nine digits) shows whole over the empty cell beside it, above that cell's background */
  .lines-grid.grid :is(thead th.num, tbody td.num, tfoot td.num) { white-space: nowrap; } /* a number never wraps, in the body, the foot or the header: a cell too narrow for its figure clips it, it does not break it (Charlie: "-200.0" over "0") */
  .lines-grid.wrap.grid tbody td.c-date .cut:not(.why) { white-space: nowrap; } /* a date never breaks into two lines (the wrap switch is for text): its column is as wide as its characters */
  .lines-grid.grid tbody td.c-flags a.chip { white-space: nowrap; } /* a flag chip is one line, its column as wide as its words */
  .lines-grid.grid tbody td a.chip { position: relative; } /* a chip wider than its column is cut by the cell; its hidden words (`.sr`, absolute) stay inside the chip and so inside the cell, not widening the box (#335) */
  .lines-grid.grid tbody tr.row > td:is(.c-net, .c-revenue) { color: var(--text); }
  .lines-grid.grid tbody td.c-invoice a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; }
  .lines-grid.grid tbody tr.row:hover { background-color: var(--hover); }
  .lines-grid.grid tbody td .cut.desc { line-height: 1.375; }
}
.seg { display: inline-block; padding: 2px 6px; border-radius: var(--radius-sm); font-size: 0.6875rem; font-weight: 500; line-height: 1.3; text-align: center; } /* the segment badge, the legacy's: D or E, its words in the title */
.seg-d { color: var(--dealer); background: var(--dealer-bg); }
.seg-e { color: var(--end-user); background: var(--end-user-bg); }
.seg-guess { background: transparent; box-shadow: inset 0 0 0 1px var(--end-user-bg); } /* the Customers grid's "E?": End-User by default, not decided (Decision 140), outlined where a decided one is filled */
.seg-words { display: none; } /* a phone's card says it in words (below, #340) */
mark.hit { color: var(--check); background: var(--check-bg); border-radius: 3px; padding: 0; }
@media not all and (min-width: 760px) { /* the phone: the box over the full width, its words short, the menus fixed and centred (the study's 1.3, 2.2) */
  .lform { flex: 1 1 12rem; } /* the search shares its row with the two buttons; the count goes under (#280) */
  .lcount { order: 2; flex-basis: 100%; padding-block: 0; white-space: normal; } /* "N lines, M counted · …" may take two lines on a phone, never the page's width */
  .lsearch kbd { display: none; } /* a phone has no "/" key */
  .lsearch:has(.phint) > input::placeholder { color: transparent; } /* the long hint lost its tail here (#269) */
  .lsearch > input:placeholder-shown + .phint { display: block; position: absolute; left: 2.5rem; right: 2.25rem; top: 50%; transform: translateY(-50%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: max(1rem, 16px); pointer-events: none; }
  .lsearch > input { height: 2.25rem; font-size: max(1rem, 16px); }
  .lsearch > input::-webkit-search-cancel-button { margin-inline: 0.5rem 0; } /* the text stops a gap before the cross (#302) */
  .lbar .lbtn .word { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lbar details { position: static; }
  .menu .pop, .menu.settings .pop, .menu.legend-menu .pop { position: fixed; left: 50%; right: auto; top: 5rem; transform: translateX(-50%); width: min(92vw, 24rem); max-height: 72dvh; overflow-y: auto; }
}
@media (pointer: coarse) {
  .lbar .lbtn, .sw, .seg2 button, .obtn, .tries a, .clearall, button.linkish, .tchips .fchip { min-height: 44px; min-width: 44px; }
  .tries a { align-items: center; } /* the 44 px pill's words in its middle, not at its top on the baseline (bug walk N1) */
  /* a search's chips in one block (#280): the default order is a status, not a button, so it goes, and Clear all ends
     the chips' last row instead of a 44 px row of its own (the list's items flow in the block, its label kept) */
  .tchips { justify-content: flex-start; gap: 0.375rem; }
  .tchips .chips.terms { display: contents; }
  .tchips .order:has(> .obtn.on) { display: none; }
  .tchips .fchip.mode.dflt { display: none; } /* a mode in the account's default state is no status (and its two chips would push Clear all to a row of its own); one set against the default stays, as the way back (#280) */
  .tchips .clearall { flex: 0 0 auto; display: inline-flex; align-items: center; }
}
@media (forced-colors: active) {
  .sw.on, .seg2 button[aria-pressed=true] { outline: 2px solid Highlight; }
}
@media (min-width: 760px) {
  .lines-grid :is(th, td):is(.c-year, .c-date) { text-align: left; } /* only Qty, Unit, Disc, Net and Revenue are right-aligned (the study's 1.9) */
}
.columns-in li { display: flex; align-items: center; gap: 0.25rem; padding: 0 0.375rem; border-radius: var(--radius-xs); }
.columns-in li:hover { background: color-mix(in srgb, var(--bg) 92%, var(--text)); }
.columns-in li label { flex: 1 1 auto; margin: 0; padding: 0.25rem 0; }
.columns-in li button { min-height: 24px; min-width: 24px; padding: 0 0.25rem; border-radius: var(--radius-xs); font-size: 0.75rem; line-height: 1; }
.columns-in .cfoot { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.columns-in .cfoot button { min-height: 24px; padding: 0 0.625rem; font-size: 0.75rem; }
/* Save and Reset stay in reach at the foot of the Settings menu, which scrolls inside itself (#314 item 2): the foot is
   sticky at the menu's own bottom edge, over the menu's padding, on the menu's tone */
.columns-in .cfoot { position: sticky; bottom: -0.75rem; margin: 0 -0.75rem -0.75rem; padding: var(--space-1) 0.75rem 0.75rem; border-top: 1px solid var(--rule); background: var(--surface); }
[data-script] [data-tick-save] { display: none; } /* a tick applies at once (js/columns.js) */
@media not all and (min-width: 760px) { [data-script] .columns-in .cfoot { display: none; } } /* with the script a phone's foot holds nothing (Save hidden; Reset widths is the desk's) */
@media (pointer: coarse) { /* DESIGN 12: the arrows and Save, past the 24 px rules above; the site's coarse rule sits before them */
  .columns-in li button,
  .columns-in .cfoot button { min-height: 44px; min-width: 44px; }
}
/* the empty result (the study's 1.7): a card in place of the table, with the legacy's title, line and button, and the examples to try */
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--bg); text-align: center; }
.empty-card .card { max-width: 32rem; padding: 1rem 1.5rem; border: 1px solid var(--control); border-radius: var(--radius-lg); background: var(--surface); }
.empty-card h2 { margin: 0 0 0.25rem; font-size: 1rem; }
.empty-card p { margin: 0 0 0.5rem; overflow-wrap: anywhere; }
.empty-card code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875rem; }
td.empty-cell { padding: 0; white-space: normal; } /* the empty result under a header that stays (filters in force): the card fills the table's one row */
td.empty-cell .empty-card { border: 0; border-radius: 0; background: transparent; }
.empty-card .try { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.375rem; margin: 0; font-size: 0.75rem; color: var(--muted); }
.empty-card .try a { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border: 1px solid var(--control); border-radius: var(--radius-pill); background: var(--bg); color: var(--text-2); text-decoration: none; }
.empty-card a.btn.secondary { background: transparent; color: var(--accent); border-color: var(--control); } /* beside "Try fuzzy match": the way back is the outline, as button.secondary is (#310) */
.empty-card a.btn { margin: var(--space-1); } /* the stacked pair at 375 no longer touch */
@media (pointer: coarse) { .empty-card .try a, .empty-card .btn { min-height: 44px; } }

/* --- The header filter menus (the Lines page v3, slice 5b; the study's 4.2): a funnel on each of nine headers is a native
   <details>; its popover is the legacy's: 280 px wide, at most 72vh high, above the sticky header (z 60), surface-2 with the
   default line and an 8 px radius, padding 8 px; the column's name in 11 px capitals with Clear at the right, two segmented
   tabs (radios and their labels, the panes shown by CSS, so no script is needed), the Values list of checkboxes with their
   lines at the right (28 px rows), the Condition pane's operator, value (and for between its upper end) and a full-width
   Apply. Fixed, so a header cell's clipping never cuts it; with no script it sits under its funnel (the right-hand
   columns open leftwards), and `js/menus.js` places it by the funnel and keeps it on the screen. */
.fpop, .ppop { width: 17.5rem; max-width: calc(100vw - 1rem); max-height: 72vh; margin: 0; overflow-y: auto; padding: 0.5rem; background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius); box-shadow: var(--shadow-modal); text-align: left; color: var(--text); font-size: 0.8125rem; }
.fpop:not(:popover-open):not(.shown), .ppop:not(:popover-open) { display: none; }
.fpop[data-stale] > * { visibility: hidden; } /* a menu a typed swap left where it was, until `js/menus.js` has it as the address says */
.fpop.shown:not(:popover-open) { position: fixed; z-index: var(--z-modal); inset: 6rem auto auto 50%; transform: translateX(-50%); } /* the address asked for it open (no script): the same box, over the page */
.fpop[popover]:popover-open, .ppop[popover]:popover-open { inset: 6rem auto auto 50%; transform: translateX(-50%); } /* where nothing places it: centred under the header */
/* A header's (i) popover (`_col_help.html`): .fpop's tokens, 16rem of plain text; it sits in the header cell, so the
   header's capitals, tracking and weight are put back. Where nothing places it, centred under the header. */
.hpop { width: 16rem; max-width: calc(100vw - 1rem); margin: 0; padding: var(--space-2) var(--space-3); background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius); box-shadow: var(--shadow-modal); color: var(--text); font-size: var(--fs-small); font-weight: 400; line-height: 1.45; letter-spacing: normal; text-align: left; text-transform: none; white-space: normal; }
.hpop[popover]:popover-open { inset: 6rem auto auto 50%; transform: translateX(-50%); }
@supports (position-area: bottom) { /* under its button, its implicit anchor (the invoker), flipping to the side with room */
  .hpop { position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline; } /* above the (i) when the page leaves no room under it (the order form pushes the table down, Task 8) */
  .hpop[popover]:popover-open { inset: auto; transform: none; margin: 4px 0 0; position-area: bottom span-left; }
}
@supports (position-area: bottom) { /* a browser with anchor positioning puts it under its funnel, flipping to the side with room */
  .fpop { position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline; } /* both flips too: a funnel on the left edge of a frozen first column, low on the window (an ordering table's Size), opens above it and to its right */
  .fpop[popover]:popover-open { inset: auto; transform: none; margin: 4px 0 0; position-area: bottom span-left; max-height: max(12rem, min(72vh, 100%)); } /* no taller than the room under its funnel (the area is its containing block), so Apply stays on the screen when the table starts low on the page (the Phoenix section); with under 12rem of room it flips above */
  .fpop[data-col=year] { position-anchor: --fn-year; } .fpop[data-col=invoice] { position-anchor: --fn-invoice; } .fpop[data-col=date] { position-anchor: --fn-date; }
  .fpop[data-col=customer] { position-anchor: --fn-customer; } .fpop[data-col=seg] { position-anchor: --fn-seg; } .fpop[data-col=category] { position-anchor: --fn-category; }
  .fpop[data-col=type] { position-anchor: --fn-type; } .fpop[data-col=description] { position-anchor: --fn-description; } .fpop[data-col=ton] { position-anchor: --fn-ton; }
  .fpop[data-col=flags] { position-anchor: --fn-flags; }
  .fpop[data-col=tyre_size] { position-anchor: --fn-tyre_size; } .fpop[data-col=tyre_brand] { position-anchor: --fn-tyre_brand; } .fpop[data-col=condition] { position-anchor: --fn-condition; }
  .fn[data-col=tyre_size] { anchor-name: --fn-tyre_size; } .fn[data-col=tyre_brand] { anchor-name: --fn-tyre_brand; } .fn[data-col=condition] { anchor-name: --fn-condition; }
  .fn[data-col=year] { anchor-name: --fn-year; } .fn[data-col=invoice] { anchor-name: --fn-invoice; } .fn[data-col=date] { anchor-name: --fn-date; }
  .fn[data-col=customer] { anchor-name: --fn-customer; } .fn[data-col=seg] { anchor-name: --fn-seg; } .fn[data-col=category] { anchor-name: --fn-category; }
  .fn[data-col=type] { anchor-name: --fn-type; } .fn[data-col=description] { anchor-name: --fn-description; } .fn[data-col=ton] { anchor-name: --fn-ton; }
  /* the Customers' and Items' columns (Description is the Lines' already; Last is both grids'): a menu the address opens has no button for an implicit anchor */
  .fpop[data-col=name] { position-anchor: --fn-name; } .fpop[data-col=kind] { position-anchor: --fn-kind; } .fpop[data-col=invoices] { position-anchor: --fn-invoices; }
  .fpop[data-col=first] { position-anchor: --fn-first; } .fpop[data-col=last] { position-anchor: --fn-last; } .fpop[data-col=class] { position-anchor: --fn-class; }
  .fpop[data-col=size] { position-anchor: --fn-size; } .fpop[data-col=brand] { position-anchor: --fn-brand; } .fpop[data-col=sold] { position-anchor: --fn-sold; }
  .fn[data-col=name] { anchor-name: --fn-name; } .fn[data-col=kind] { anchor-name: --fn-kind; } .fn[data-col=invoices] { anchor-name: --fn-invoices; }
  .fn[data-col=first] { anchor-name: --fn-first; } .fn[data-col=last] { anchor-name: --fn-last; } .fn[data-col=class] { anchor-name: --fn-class; }
  .fn[data-col=size] { anchor-name: --fn-size; } .fn[data-col=brand] { anchor-name: --fn-brand; } .fn[data-col=sold] { anchor-name: --fn-sold; }
  .fn[data-col=flags] { anchor-name: --fn-flags; }
  /* the Phoenix section's columns (Task 3; Size is the Items' already) */
  .fpop[data-col=order] { position-anchor: --fn-order; } .fpop[data-col=demand] { position-anchor: --fn-demand; } .fpop[data-col=change] { position-anchor: --fn-change; }
  .fpop[data-col=stock] { position-anchor: --fn-stock; } .fpop[data-col=on_order] { position-anchor: --fn-on_order; } .fpop[data-col=at_arrival] { position-anchor: --fn-at_arrival; }
  .fpop[data-col=safety] { position-anchor: --fn-safety; } .fpop[data-col=after] { position-anchor: --fn-after; } .fpop[data-col=sold_last] { position-anchor: --fn-sold_last; }
  .fpop[data-col=sold_before] { position-anchor: --fn-sold_before; } .fpop[data-col=weight] { position-anchor: --fn-weight; } .fpop[data-col=volume] { position-anchor: --fn-volume; }
  .fpop[data-col=last_box] { position-anchor: --fn-last_box; }
  .fn[data-col=order] { anchor-name: --fn-order; } .fn[data-col=demand] { anchor-name: --fn-demand; } .fn[data-col=change] { anchor-name: --fn-change; }
  .fn[data-col=stock] { anchor-name: --fn-stock; } .fn[data-col=on_order] { anchor-name: --fn-on_order; } .fn[data-col=at_arrival] { anchor-name: --fn-at_arrival; }
  .fn[data-col=safety] { anchor-name: --fn-safety; } .fn[data-col=after] { anchor-name: --fn-after; } .fn[data-col=sold_last] { anchor-name: --fn-sold_last; }
  .fn[data-col=sold_before] { anchor-name: --fn-sold_before; } .fn[data-col=weight] { anchor-name: --fn-weight; } .fn[data-col=volume] { anchor-name: --fn-volume; }
  .fn[data-col=last_box] { anchor-name: --fn-last_box; }
  /* the Customers' Segment, Industry and Country (batch 3) */
  .fpop[data-col=segment] { position-anchor: --fn-segment; } .fpop[data-col=industry] { position-anchor: --fn-industry; } .fpop[data-col=country] { position-anchor: --fn-country; }
  .fn[data-col=segment] { anchor-name: --fn-segment; } .fn[data-col=industry] { anchor-name: --fn-industry; } .fn[data-col=country] { anchor-name: --fn-country; }
}
.fhead { display: flex; align-items: center; justify-content: space-between; margin: 0 0 0.5rem; }
.fname { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.fclear { display: inline-flex; align-items: center; min-height: 24px; padding: 0.125rem 0.375rem; border-radius: var(--radius-xs); font-size: 0.75rem; font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--accent); }
.ftabs { position: relative; display: flex; gap: 2px; margin: 0 0 0.5rem; padding: 2px; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.ftabs input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.ftabs label { flex: 1 1 0; margin: 0; padding: 0.25rem 0.5rem; border-radius: var(--radius-xs); text-align: center; font-size: 0.75rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.ftabs input:checked + label { background: var(--accent-soft); color: var(--accent); }
.ftabs input:focus-visible + label { outline: 2px solid var(--mark); outline-offset: 1px; }
.fpop:has(.t-v:checked) .fcond, .fpop:has(.t-c:checked) .fvals { display: none; }
.fform { margin: 0; }
.fsort { display: flex; gap: 2px; margin: 0 0 0.5rem; }
.fsort a { flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 1.75rem; padding: 0 0.375rem; border: 1px solid var(--rule); border-radius: var(--radius-xs); font-size: 0.75rem; font-weight: 500; text-align: center; color: var(--text-2); text-decoration: none; }
.fsort a:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.fsort a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fsort a.on::before { content: "✓ "; white-space: pre; }
.fpick { display: flex; gap: 0.75rem; margin: 0 0 0.375rem; }
.fpick[hidden] { display: none; }
.flink { min-height: 1.5rem; padding: 0 0.25rem; border: 0; background: transparent; font-size: 0.75rem; font-weight: 500; color: var(--accent); text-decoration: underline; cursor: pointer; }
button.fapply:disabled { opacity: 0.5; cursor: not-allowed; }
.fsearch { display: block; width: 100%; height: 2rem; margin: 0 0 0.375rem; padding: 0 0.5rem; font-size: 0.8125rem; border-color: var(--control); background: var(--field); }
.fsearch:focus { border-color: var(--mark); }
.fsearch[hidden], .fhint[hidden], .fload[hidden], .fapply[hidden] { display: none; }
.fhint, .fload { margin: 0 0 0.375rem; font-size: 0.75rem; color: var(--muted); }
.flist { list-style: none; margin: 0 0 0.5rem; padding: 0; max-height: 14rem; overflow-y: auto; }
.flist label { display: flex; align-items: center; gap: 0.5rem; min-height: 28px; margin: 0; padding: 0 0.375rem; border-radius: var(--radius-xs); font-size: 0.75rem; color: var(--text-2); cursor: pointer; }
.flist label:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.flist .fv { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist .fc { color: var(--muted); font-variant-numeric: tabular-nums; }
.fcond { display: grid; gap: 0.5rem; }
.fcond select, .fcond input:not([type=checkbox]) { display: block; width: 100%; max-width: none; height: 2rem; margin: 0; padding: 0 0.5rem; font-size: 0.8125rem; }
.fin { display: grid; gap: 0.5rem; }
.fto { display: none; align-items: center; gap: 0.375rem; color: var(--muted); }
.fto input { flex: 1 1 auto; }
.fcond:has(option[value=between]:checked) .fto, .fcond:has(option[value="!between"]:checked) .fto { display: flex; }
.fcond:has(option[data-none]:checked) .fin { display: none; } /* is empty, today ...: no value to type */
.fsame { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.75rem; color: var(--text-2); }
button.fapply { width: 100%; min-height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.fchip.menu { border-color: var(--mark); }
/* The Date menu (Charlie, 5 Nov 2026, "Picks+range+months"; `_filter_dates.html`): six one-tap picks (links, two to a row),
   From and To (a text box that reads a typed date, a calendar button over a date input kept out of sight), and the months
   by year (a year's row: the caret opens its months, the box takes the whole year). */
.fpicks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.375rem; margin: 0 0 0.5rem; }
.fpickb { display: flex; align-items: center; justify-content: center; min-height: 1.75rem; padding: 0 0.375rem; border: 1px solid var(--rule); border-radius: var(--radius-xs); font-size: 0.75rem; font-weight: 500; text-align: center; color: var(--text-2); text-decoration: none; }
.fpickb:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.fpickb.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fpickb.on::before { content: "✓ "; white-space: pre; }
.frange { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0 0 0.5rem; }
.fend { display: grid; gap: 0.125rem; min-width: 0; align-content: start; }
.fend label { margin: 0; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.fbox { position: relative; display: block; }
.fbox input[type=text] { display: block; width: 100%; max-width: none; height: 2rem; margin: 0; padding: 0 2rem 0 0.5rem; font-size: 0.8125rem; }
.fcalb { position: absolute; top: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; width: 2rem; padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted); cursor: pointer; }
.fcalb[hidden] { display: none; }
.fcalb:hover { color: var(--accent); }
.fcalb .icon { width: 1rem; height: 1rem; }
.fcal { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.fnone { margin: 0 0 0.375rem; font-size: 0.75rem; color: var(--muted); }
.fnone[hidden] { display: none; }
.fyr { position: relative; }
.fyr > .fyb { position: absolute; top: 0; left: 1.25rem; display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 28px; margin: 0; padding: 0; cursor: pointer; } /* the year's own box, beside its row: a box inside the summary would be a control in a control */
.fyr > details > summary { display: flex; align-items: center; gap: 0.5rem; min-height: 28px; padding: 0 0.375rem 0 0; list-style: none; cursor: pointer; font-size: 0.75rem; color: var(--text-2); }
.fyr > details > summary::-webkit-details-marker { display: none; }
.fyr > details > summary::before { content: "▸"; flex: 0 0 1.25rem; text-align: center; color: var(--muted); font-size: 0.75rem; }
.fyr > details[open] > summary::before { content: "▾"; }
.fyr > details > summary > .fv { margin-left: 1.75rem; font-weight: 600; }
.ferror { margin: 0.125rem 0 0.375rem; font-size: 0.75rem; color: var(--wrong); overflow-wrap: anywhere; }
.fbox input[aria-invalid=true] { border-color: var(--wrong); border-width: 2px; }
.fpop > .ffoot { position: sticky; bottom: -0.5rem; z-index: 1; margin: 0.25rem -0.5rem -0.5rem; padding: 0.5rem; background: var(--surface); border-top: 1px solid var(--rule); } /* Apply is a foot that stays in view while the menu scrolls: on a phone the menu is a box shorter than its months, on the desk an error or a short window does the same */
.frange .ferror { grid-column: 1 / -1; margin: 0; }
.ffoot .fapply { width: 100%; }
.fneed { margin: 0 0 0.375rem; font-size: 0.75rem; color: var(--muted); } /* why Apply is off: "Tick a month or type a date" */
.fneed:empty, .fnone:empty { height: 0; margin: 0; overflow: hidden; } /* a live region present from the start, empty until it has something to say */
.fyr > details > summary:focus-visible { outline: 2px solid var(--mark); outline-offset: -2px; border-radius: var(--radius-xs); }
.fyr .fmo { list-style: none; margin: 0; padding: 0 0 0 1.25rem; }
@media (pointer: coarse) {
  .fclear, .ftabs label, .fcond select, .fcond input:not([type=checkbox]), .fsearch, button.fapply { min-height: 44px; }
  .fpop :is(select, input:not([type=checkbox])) { font-size: max(1rem, 16px); } /* iOS zooms a focused field under 16 px; the .fcond rule's 0.8125rem is the desk's */
  .flist label { min-height: 44px; }
  .fsort a, .flink { min-height: 44px; }
  .fclear { display: inline-flex; align-items: center; }
  .ftabs label { display: flex; align-items: center; justify-content: center; } /* N1: the word is in the middle of its 44 px half, not at its top */
  .fpickb, .fbox input[type=text], .fyr > details > summary { min-height: 44px; } /* the Date menu's taps */
  .fyr > .fyb { left: 44px; width: 44px; height: 44px; }
  .fyr > details > summary > .fv { margin-left: 44px; }
  .fcalb { width: 44px; }
  .fpop .fclear { min-width: 44px; justify-content: center; }
  .fbox input[type=text] { padding-right: 44px; }
  .frange { grid-template-columns: 1fr; }
  .fyr > details > summary::before { flex-basis: 44px; font-size: 0.875rem; } /* the caret is a 44 px tap */
  .fyr .fmo { padding-left: 2rem; }
  .fmonths { max-height: none; } /* the menu scrolls in its own box on a phone, not a second box inside it */
}
.phsf { display: none; } /* the phone's two buttons (`_grid_head.html`, 12 Nov 2026) are drawn below 760 px only; the desk's header is as it was */
@media not all and (min-width: 760px) { /* the phone: the pill strip holds a funnel after each sort pill; the popover is centred under the header as the Settings menu is */
  .wide.grid thead th:has(.fn) { display: flex; align-items: center; gap: 0.25rem; }
  .wide.grid thead th > .ic { display: contents; } /* the desk's icon row (Charlie, 28 Oct 2026) is no box on the phone: the pill strip keeps its pill, then (i), then funnel, as before; the DOM puts the icons first, so they are ordered after the pill */
  .wide.grid thead th > .ic > * { order: 2; }
  .wide.grid thead th > a { order: 1; }
  .lines-grid thead .fn { display: inline-flex; align-items: center; justify-content: center; position: static; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius-pill); background: var(--bg); color: var(--muted); cursor: pointer; }
  .lines-grid thead .fn.on, .lines-grid thead .fn[aria-expanded=true] { border-color: var(--mark); background: var(--accent-soft); color: var(--accent); }
  .lines-grid thead .fn .icon { width: 0.875rem; height: 0.875rem; }
  .wide.grid thead th:has(.hb) { display: flex; align-items: center; gap: 0.25rem; }
  /* One pill a column (6 Nov 2026): the sort pill, its (i) and its funnel joined as one segmented control, a hairline
     between the parts, so each funnel reads as its column's; each part keeps its 44 px. */
  .wide.grid thead th:has(.ic) { gap: 0; }
  .wide.grid thead th:has(.ic) a { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
  .wide.grid thead th .ic > :is(.fn, .hb) { margin-left: -1px; border-radius: 0; }
  .wide.grid thead th .ic > :last-child { border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
  .wide.grid thead th .ic > .fn.on { position: relative; z-index: 1; } /* its accent edge over the hairline it shares */
  .lines-grid.grid thead th > a::after { content: none; } /* the svg arrow is the sorted pill's one arrow (the plain tables' ▲ is not drawn twice) */
  .lines-grid thead .hb, table.invoice-lines thead .hb { display: inline-flex; align-items: center; justify-content: center; position: static; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius-pill); background: var(--bg); color: var(--muted); cursor: pointer; }
  .lines-grid thead .hb:focus-visible, table.invoice-lines thead .hb:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; }
  .lines-grid thead .hb .icon, table.invoice-lines thead .hb .icon { width: 0.875rem; height: 0.875rem; }
  .hpop, .hpop[popover]:popover-open { width: min(92vw, 20rem); inset: 5rem auto auto 50%; transform: translateX(-50%); margin: 0; position-area: none; }
  .fpop, .fpop[popover]:popover-open { width: min(92vw, 20rem); max-height: 72dvh; inset: 5rem auto auto 50%; transform: translateX(-50%); margin: 0; position-area: none; }
  /* The Date menu on a phone (walk of 6 Nov 2026, finding 14): 7.5 rem short of the screen (692 px at 812), not 72% (585),
     so the months list shows about 3 rows under the search at open instead of a 15 px sliver; the menu scrolls to the
     rest of it above the sticky Apply. Never so tall that it stops scrolling: #731's test needs 200 px more content
     than the menu shows, so Apply's foot always has something to stay in view over. One scroll, the menu's own */
  .fpop[data-dates]:popover-open { top: 3rem; max-height: calc(100dvh - 7.5rem); }
  /* Sort and Filter (12 Nov 2026, #673 finding 2): where a grid has the two buttons (`tr.phsf`), they stand in the place
     of the strip of pills. The strip stays in the page, a zero-height clipped row, its links and buttons not shown
     and not tabbable (visibility), but its cells stay, so each column keeps its header role and name for a screen
     reader; the funnels' popovers are drawn after the table, so they need nothing. The two lists (Sort: every column
     with a sort; Filter: every column with a funnel) reach the same links and popovers, and a column's (i) is the
     small text under its name in the Sort list. */
  .wide.grid thead:has(.phsf) tr:first-child { display: block; height: 0; overflow: hidden; padding: 0; -webkit-mask-image: none; mask-image: none; }
  .wide.grid thead:has(.phsf) tr:first-child :is(a, button) { visibility: hidden; }
  .wide.grid thead tr.phsf { display: block; order: 2; padding: 0 0 var(--space-2); } /* where the label row sat: the Filters panel first, the buttons close the block (#336) */
  .wide.grid thead tr.phsf > td { display: flex; gap: var(--space-2); padding: 0; border: 0; background: none; }
  .phb { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 0.75rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; border: 1px solid var(--rule); border-radius: var(--radius-pill); background: var(--bg); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; cursor: pointer; }
  .phb.on { border-color: var(--mark); background: var(--accent-soft); color: var(--accent); }
  .phb .icon { width: 0.875rem; height: 0.875rem; flex: none; }
  .phpop { max-height: 72dvh; overflow-y: auto; padding: 0.25rem; }
  .phpop ul { list-style: none; margin: 0; padding: 0; }
  .phpop li > :is(a, button, span) { display: flex; align-items: center; gap: 0.375rem; box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 0.75rem; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
  .phpop li > span { cursor: default; color: var(--muted); }
  .phpop li > :is(a, button).on { color: var(--accent); font-weight: 600; }
  .phpop .icon { width: 0.875rem; height: 0.875rem; }
  .phpop small { display: block; margin-top: -0.5rem; padding: 0 0.75rem 0.5rem; color: var(--muted); font-size: var(--fs-small); line-height: 1.35; }
}
@media (forced-colors: active) { .lines-grid thead .fn.on { outline: 2px solid Highlight; } }

/* The selected row (the study's 1.9: the accent tint and a 2 px accent bar at the left; `js/keys.js` marks it with the arrow keys) */
.lines-grid.grid tr.row[aria-selected=true] > td { background-color: var(--accent-soft); }
.lines-grid.grid tr.row[aria-selected=true] > td:first-child { box-shadow: inset 2px 0 0 var(--mark); }
.lines-grid.grid tr.row:is(:focus-visible, :target) { outline: 2px solid var(--mark); outline-offset: -2px; } /* a link to a size's card (the empties line) rings it */
/* The typeahead under the search box (the study's 2.4: the box's width, surface-2, the default line, an 8 px radius, a shadow;
   a letter glyph, the word in mono, a muted count; the foot's 11 px capitals) */
.lform { position: relative; }
.sugg { position: absolute; top: 2.75rem; z-index: var(--z-popover); overflow: hidden; background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.sugg ul { list-style: none; margin: 0; padding: 0.25rem; }
.sugg li { display: flex; align-items: center; gap: 0.5rem; min-height: 28px; padding: 0 0.5rem; border-radius: var(--radius-sm); font-size: 0.8125rem; color: var(--text); cursor: pointer; }
.sugg li[aria-selected=true], .sugg li:hover { background: var(--accent-soft); }
.sugg .sg-g { width: 1rem; text-align: center; font: 0.75rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.sugg .sg-w { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; }
.sugg .sg-n { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sugg .sfoot { display: flex; justify-content: space-between; gap: 0.5rem; margin: 0; padding: 0.375rem 0.75rem; border-top: 1px solid var(--rule); font-size: 0.6875rem; color: var(--muted); }
.sugg .sfoot span:first-child { text-transform: uppercase; letter-spacing: 0.05em; }
@media (pointer: coarse) {
  .sugg li { min-height: 44px; }
  .sugg .sfoot, .pop .keys { display: none; } /* a phone has no keys to press: the suggestions' and the Legend's keyboard lines go (#341); after their own rules, which set display */
}

/* The invoice popup in the legacy modal's look (the Lines page v3, slice 5b; the study's 1.12): a dialog of 12 px radius with the
   default line and the large shadow over a dimmed, blurred page; the title in bold mono 18 px with the customer, date and
   line count in muted type under it; "Copy (Excel)" beside the ×; the line it was opened from marked as a selected row. */
#sheet { border-color: var(--control); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); }
#sheet::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
#sheet .sheet-head h2 { margin: 0; font: 700 1.125rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
#sheet .sheet-sub { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--muted); }
#sheet .sheet-copy { position: absolute; top: var(--space-2); right: 3.25rem; z-index: 1; min-height: 28px; padding: 0 0.625rem; font-size: 0.8125rem; border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); border-color: var(--control); }
#sheet .sheet-copy[hidden] { display: none; }
#sheet .copycol { min-height: 24px; min-width: 24px; margin-left: 0.25rem; padding: 0 0.25rem; border-radius: var(--radius-xs); font-size: 0.75rem; line-height: 1; color: var(--muted); background: transparent; border-color: transparent; }
#sheet .copycol:hover { color: var(--text); border-color: var(--control); }
.invoice tr.here > * { background-color: var(--accent-soft); }
.invoice tr.here > :first-child { box-shadow: inset 2px 0 0 var(--mark); } /* the line it was opened from, on the page and in the popup */
@media (pointer: coarse) { #sheet .sheet-copy, #sheet .copycol { min-height: 44px; min-width: 44px; } }


/* The invoice in the popup, the legacy modal's content (the Lines page v3, slice 5b; the study's 1.12): Bill to and Deliver to
   side by side, a line of small fields, the note banner, the lines' table with the marked line, the totals right-aligned,
   the original invoice below (a PDF the height of a page, or the sheet's cells), the footnote. Eyebrows, banners and chips are
   the site's; the tokens are the root's. */
.eyebrow { margin: 0 0 0.375rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sheetbody { padding: 1rem 1.25rem; }
.sheetbody .sheet-head { margin: 0 0 0.75rem; padding-right: 13rem; }
.sheetbody .parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem 2rem; margin: 0 0 0.75rem; }
.sheetbody .parties p { margin: 0 0 0.125rem; overflow-wrap: anywhere; }
.sheetbody .pname { font-weight: 600; }
.sheetbody .fields { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 0.75rem; font-size: 0.8125rem; }
.sheetbody .fields .muted { margin-right: 0.25rem; }
.banner { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border: 1px solid var(--check); border-radius: var(--radius); background: var(--check-bg); color: var(--text); font-size: 0.8125rem; overflow-wrap: anywhere; white-space: pre-line; }
.sheetbody .invoice-lines th { font-size: 0.6875rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sheetbody .invoice-lines .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; white-space: nowrap; }
.sheetbody dl.totals { display: block; margin: 0.75rem 0 0 auto; width: fit-content; max-width: 100%; }
.sheetbody .totals div { display: flex; justify-content: space-between; gap: 2rem; padding: 0.125rem 0; font-variant-numeric: tabular-nums; }
.sheetbody .totals dt { color: var(--muted); text-wrap: balance; } /* "Counted lines total (pre-GST, N lines)" breaks in the middle on a phone, not before its last word */
.sheetbody .totals dd { margin: 0; text-align: right; }
.sheetbody .totals .total { border-top: 1px solid var(--rule); font-weight: 600; }
.sheetbody .totals .total dt { color: var(--text); }
/* A Xero invoice's ServiceM8 job (batch 3 part D): its two texts stacked in full, each under ServiceM8's label, the breaks kept (`.lines`). */
.sheetbody .sm-job { margin: 1rem 0 0; }
.sheetbody .sm-job dl { display: grid; gap: var(--space-2); margin: 0; }
.sheetbody .sm-job dt { font-size: 0.75rem; color: var(--muted); }
.sheetbody .sm-job dd { margin: 0; max-width: 72ch; overflow-wrap: anywhere; }
.sheetbody .original { margin: 1rem 0; } /* the PDF comes first (Charlie, 21 Oct 2026), after the head and the lines that change how it is read: its height fills what the popup or the page shows (dvh: a phone's moving toolbar counted), less the head, its heading and the sticky foot; room below it before the addresses */
.sheetbody .orig-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); margin: 0 0 var(--space-2); font-size: 0.8125rem; } /* Decision 150: the issue date, then Xero's copy */
.sheetbody .orig-meta a { display: inline-flex; align-items: center; min-height: 1.5rem; overflow-wrap: anywhere; }
@media (pointer: coarse) { .sheetbody .orig-meta a { min-height: 44px; } } /* DESIGN 12 */
.sheetbody .orig-pdf { display: block; width: 100%; height: calc(100dvh - 14rem); min-height: 24rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.sheetbody .orig-pages { display: grid; gap: var(--space-3); } /* the PDF's first pages as images, where the browser cannot frame it (js/pdfpages.js): each as wide as the sheet, one under the other */
.sheetbody .orig-pages[hidden], .sheetbody .orig-pages-none[hidden] { display: none; }
.sheetbody .orig-pages img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; } /* a page is white paper in both colour schemes: its ink is dark */
.sheetbody .orig-pages-none { margin: 0; }
@media not all and (min-width: 760px), (pointer: coarse) { .sheetbody .sheet-foot a.btn { min-height: 44px; padding-inline: 1.25rem; } } /* the preview's Open the PDF and Open as a page are touch targets (DESIGN 12) */
.sheetbody .orig-sheet { max-height: 70vh; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); }
.orig { border-collapse: collapse; width: auto; min-width: 100%; font-size: 0.75rem; }
.orig td { padding: 0.125rem 0.375rem; border: 0; vertical-align: top; white-space: pre; color: var(--text); background: none; } /* a label, a date or a figure keeps its line, as in the source (#314 item 3); a long value, marked `wr` (sources/original.py), wraps and takes the width the others leave */
.orig td.wr { white-space: pre-wrap; }
.orig .b { font-weight: 700; } .orig .ac { text-align: center; } .orig .ar { text-align: right; }
.orig .bt { border-top: 1px solid var(--control); } .orig .bb { border-bottom: 1px solid var(--control); }
.orig .bl { border-left: 1px solid var(--control); } .orig .br { border-right: 1px solid var(--control); }
/* On a phone the source's cells flow as a wrapping row (a label and its value stay together when they fit, the value goes whole to the next line when they do not), so the box shows every value whole instead of cutting "INV-2003" at its edge (#314 item 4, PC-11 c). The rows' columns no longer line up; the PDF is the original, this is its cells. */
@media not all and (min-width: 760px) {
  .orig, .orig tbody { display: block; min-width: 0; }
  .orig tr { display: flex; flex-wrap: wrap; column-gap: var(--space-3); }
  .orig td { display: block; min-width: 0; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
  .orig td:empty { display: none; }
  .orig td.wr { flex: 1 1 100%; }
}
.sheetbody .sheet-note { margin: 1rem 0 0; font-size: 0.75rem; }
/* The customer in the popup (slice 5e): the same dialog and head, narrower, its name in the page's sans, the segment badge beside it,
   the other spellings and the contacts as short lists, the two actions in the foot. */
#sheet:has(.customer-card) { width: min(32rem, calc(100vw - 2rem)); }
.customer-card .sheet-head { padding-right: 2.5rem; }
#sheet .customer-card .sheet-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; font: 700 1.125rem/1.3 var(--font); overflow-wrap: anywhere; }
.customer-card section { margin: 0 0 0.75rem; }
.customer-card .spellings { margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; overflow-wrap: anywhere; }
.customer-card .spellings li { padding: 0.125rem 0; }
#sheet .customer-card { padding-bottom: 0; }
#sheet .customer-card .sheet-foot { margin-top: 0.5rem; }
@media not all and (min-width: 760px) { #sheet:has(.customer-card) { width: calc(100vw - 2rem); height: fit-content; max-height: calc(100dvh - 2rem); margin: auto; border: 1px solid var(--control); border-radius: var(--radius-lg); } #sheet .customer-card .sheet-foot { margin-top: 0.5rem; margin-inline: calc(-1 * var(--space-3)); } #sheet .customer-card .sheet-head { padding-right: 2.5rem; } }
@media not all and (min-width: 760px) { /* the phone: the lines are cards of a line id and category, the description, then five labelled figures */
  .sheetbody { padding: 0.75rem var(--space-3); }
  .sheetbody .sheet-head { padding-right: 9.5rem; }
  .sheetbody .invoice-lines, .sheetbody .invoice-lines tbody { display: block; }
  .sheetbody .invoice-lines thead { display: none; }
  .sheetbody .invoice-lines tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.125rem 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
  .sheetbody .invoice-lines td { display: block; padding: 0; border: 0; min-width: 0; }
  .sheetbody .invoice-lines td:nth-child(1) { grid-column: 1 / 4; }
  .sheetbody .invoice-lines td:nth-child(2) { grid-column: 4 / 6; text-align: right; }
  .sheetbody .invoice-lines td:nth-child(4) { grid-column: 1 / -1; grid-row: 2; }
  .sheetbody .invoice-lines td[data-label]::before { display: block; content: attr(data-label); font-size: 0.6875rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
  .sheetbody .invoice-lines td:nth-child(2)::before { display: none; }
  /* the card is the marked row, not each cell of it: one tint and one bar, with no gaps between the grid's cells */
  .invoice tbody tr.here { padding-left: 0.25rem; background-color: var(--accent-soft); box-shadow: inset 2px 0 0 var(--mark); }
  .invoice tr.here > *, .invoice tr.here > :first-child { background-color: transparent; box-shadow: none; }
}
/* The same sheet as the invoice page's one panel (polish slice 1): no × or Copy in its head to clear, the title the page's h1
   in the popup's mono, its foot a plain row under the original invoice. */
.invoice.panel .sheet-head { padding-right: 0; }
.invoice.panel .sheet-sub { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.invoice.panel .table-box { width: 100%; max-height: none; } /* the lines fill the panel and never scroll inside the page */
.invoice.panel .sheet-head h1 { margin: 0; font: 700 1.125rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.invoice.panel .sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); margin: var(--space-3) 0 0; }
.invoice.panel .sheet-foot p { margin: 0 auto 0 0; }

/* --- The job card (the Jobs tab, Task 4; spec R13 to R20): ServiceM8's layout, Charlie 28 Oct 2026. One article for the
   popup (`#sheet`, `?part=body`) and the page (`.jc-page`): a band in the status colour (`--status-completed`, the
   words on it `--on-status-completed`, 4.5:1 in both schemes: tests/test_job_card_screens.py), a sub-line, then three
   columns from 760 px (the rail of two views, the chosen view's sections, the Diary) and one column below, where every
   section shows and the rail is gone. The server marks the chosen view `data-current`; no script chooses. */
.jobcard { margin: 0; padding: 0; color: var(--text); background: var(--bg); border: 0; border-radius: 0; } /* the bare `article` rule's box (padding, hairline) is the page's panel here, not the popup's */
.jc-page { border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: clip; margin: 0 0 var(--space-3); }
.jc-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: 0.75rem 1.25rem; padding-right: 3.5rem; color: var(--on-status-completed); background: var(--status-completed); }
.jc-page .jc-band { padding-right: 1.25rem; }
.jc-titles { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.jc-band h1, .jc-band h2 { margin: 0; font: 700 1.125rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.jc-status { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; }
.jc-letter { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; font-size: 0.75rem; font-weight: 700; color: var(--status-completed); background: var(--on-status-completed); border-radius: var(--radius-pill); }
a.jc-open { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 24px; font-size: 0.8125rem; font-weight: 600; color: var(--on-status-completed); text-decoration: underline; text-underline-offset: 2px; }
.jc-open .icon { width: 1rem; height: 1rem; }
a.jc-open:focus-visible { outline: 2px solid var(--on-status-completed); outline-offset: 2px; }
.jc-sub { margin: 0; padding: 0.5rem 1.25rem; font-size: 0.8125rem; color: var(--muted); border-bottom: 1px solid var(--rule); }
.jc-cols { display: block; }
.jc-rail { display: none; }
.jc-main, .jc-diary { padding: var(--space-3) 1.25rem; min-width: 0; }
.jc-view + .jc-view, .jc-diary { border-top: 1px solid var(--rule); }
.jobcard .eyebrow { margin-top: 0; }
.jc-block, .jc-points { margin: 1rem 0 0; }
.jc-client { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.jc-client p, .jc-aud { margin: 0; }
.jc-company { font-weight: 600; overflow-wrap: anywhere; }
.jc-addr, .jc-text, .jc-cname, .jc-iname { overflow-wrap: anywhere; }
.jc-text { max-width: 72ch; }
.jc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-2) var(--space-3); margin: 0.75rem 0 0; }
.jc-facts dt { font-size: 0.75rem; color: var(--muted); }
.jc-facts dd { margin: 0; overflow-wrap: anywhere; }
.jc-dot { display: inline-block; width: 0.625rem; height: 0.625rem; margin-right: 0.375rem; vertical-align: baseline; background: var(--status-completed); border-radius: var(--radius-pill); }
.jc-list { margin: 0; padding: 0; list-style: none; }
.jc-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; padding: 0.125rem 0; overflow-wrap: anywhere; }
.jc-tick { width: 1rem; height: 1rem; flex: none; align-self: center; color: var(--status-completed); }
.jc-open-tick { display: inline-block; width: 0.875rem; height: 0.875rem; margin: 0 0.0625rem; flex: none; align-self: center; border: 1.5px solid var(--control); border-radius: var(--radius-pill); }
.jc-contact { margin: 0 0 0.5rem; }
.jc-contact p { margin: 0; overflow-wrap: anywhere; }
.jc-contact a { display: inline-flex; align-items: center; min-height: 24px; }
.jc-items th { font-size: 0.6875rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.jc-items .num { text-align: right; font-variant-numeric: tabular-nums; }
.jc-totals { display: block; margin: 0.75rem 0 0 auto; width: fit-content; max-width: 100%; }
.jc-totals div { display: flex; justify-content: space-between; gap: 2rem; padding: 0.125rem 0; font-variant-numeric: tabular-nums; }
.jc-totals dt { color: var(--muted); }
.jc-totals dd { margin: 0; text-align: right; }
.jc-totals .total { border-top: 1px solid var(--rule); font-weight: 600; }
.jc-totals .total dt { color: var(--text); }
.jc-note { margin: 0.5rem 0 0; font-size: 0.75rem; }
.jc-entries { margin: 0; padding: 0; list-style: none; }
.jc-entry { display: flex; gap: 0.625rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.jc-entry:last-child { border-bottom: 0; }
.jc-entry > .icon { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.125rem; color: var(--muted); }
.jc-entry > div { min-width: 0; }
.jc-entry p { margin: 0; overflow-wrap: anywhere; }
.jc-ewhen { font-size: 0.75rem; }
.jc-ebody { font-size: 0.875rem; }
.jc-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-2) 1.25rem calc(var(--space-2) + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--rule); }
.jc-foot a.btn { display: inline-flex; align-items: center; gap: 0.375rem; }
.jc-foot .icon { width: 1rem; height: 1rem; }
.jc-page .jc-foot { position: static; }
@media (pointer: coarse) {
  .jc-foot a.btn, a.jc-open, .jc-rail a, .jc-contact a, .jc-entry a { min-height: 44px; }
}
@media (width < 760px) {
  .jc-band { padding: 0.625rem var(--space-3); padding-right: 3.5rem; }
  .jc-page .jc-band { padding-right: var(--space-3); }
  .jc-sub, .jc-main, .jc-diary, .jc-foot { padding-inline: var(--space-3); }
  a.jc-open-band { display: none; } /* the foot holds it on a phone, in thumb reach */
  .jc-foot a.btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .jc-items, .jc-items tbody { display: block; }
  .jc-items thead { display: none; }
  .jc-items tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.125rem 0.5rem; padding: 0.5rem 0.625rem; margin: 0 0 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); }
  .jc-items td { display: block; padding: 0; border: 0; min-width: 0; }
  .jc-items td.jc-iname { grid-column: 1 / -1; font-weight: 600; }
  .jc-items td[data-label]::before { display: block; content: attr(data-label); font-size: 0.6875rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
  .jc-items td.num { text-align: left; }
}
@media (width >= 760px) {
  .jc-cols { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) minmax(16rem, 20rem); align-items: start; }
  .jc-rail { display: flex; flex-direction: column; gap: 0.125rem; padding: var(--space-3) 0.5rem var(--space-3) 0.75rem; position: sticky; top: 0; }
  .jc-rail a { display: block; padding: 0.375rem 0.625rem; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); border-left: 3px solid transparent; }
  .jc-rail a:hover { background: var(--hover); }
  .jc-rail a[aria-current] { font-weight: 600; background: var(--surface); border-left-color: var(--status-completed); }
  .jc-view:not([data-current]) { display: none; }
  .jc-view + .jc-view { border-top: 0; }
  .jc-diary { border-top: 0; border-left: 1px solid var(--rule); }
  .jc-view > .eyebrow:first-child { display: none; } /* the rail names the view; the sections' own headings stay */
}

/* Where a search word matched, when the cell does not show it as typed (F1, #274): a quiet note under the description,
   and in the opened row the whole description with its matches marked. */
.via { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 0.75rem; line-height: 1rem; color: var(--muted); }
.more-panel .found { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.more-panel .found .via { display: inline-block; margin-left: var(--space-2); }

/* The wait under the search box (F4: "a loading bar for searches, before the results are displayed"): a thin line at
   the foot of the field, inside it (the focus ring, 2 px out in the same blue, hid it below the field), that runs while
   a search typed or sent from the box is on its way; `js/grid.js` sets the grid's aria-busy from the key typed (batch 3
   part E), a sent search's after 150 ms, so a quicker answer shows nothing. Still, full width, where motion is reduced. */
.lsearch::after { content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: 1px; height: 2px; border-radius: 1px; background: var(--accent); opacity: 0; transform-origin: left; pointer-events: none; }
.grid-region[aria-busy=true]:has(.lsearch input:focus) .lsearch::after { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .grid-region[aria-busy=true]:has(.lsearch input:focus) .lsearch::after { animation: search-wait 1.2s ease-in-out infinite; }
}
@keyframes search-wait { from { transform: scaleX(0.05); } 70% { transform: scaleX(1); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }
#search-found button.linkish { margin-left: 0.25rem; }

/* Phoenix ordering (Task 4c) */
/* A bar with no search box (the Phoenix section's) has its menus at the page's left edge, so they open from the button's
   left edge, not hung from its right (that put the 18 rem Settings panel over the sidebar, and off the screen beside the
   icon rail). From 760 only: below it the phone's fixed, centred panel stays. The panel already paints over the sidebar
   (z-popover 40 against its 11, no ancestor makes a stacking context), so this is geometry alone. */
@media (min-width: 760px) { .lbar:not(:has(> .lform)) .menu .pop { left: 0; right: auto; } }
/* `js/shell.js` scrolls an opening menu into view; this leaves a little air below it. */
.menu .pop { scroll-margin-block-end: 0.5rem; }
/* --- The Points tab (the points-tab plan, Task 3), `/admin/jobs`: tokens only. Its columns keep a width that shows
   a whole value and its chip (the table is fixed, so the headers say it; the box scrolls inside itself, as the Lines'), the opened row's facts sit in a grid
   of six, and a phone's card puts the number, day and total on the first line, the company and the description under
   them, then who and the points, then the type and the audience; the rules are scoped to the tab because the Lines'
   own cards give `c-date`, `c-description` and `c-completed` another order. */
.pnote { margin: 0 0 var(--space-2); }
/* A job with no points yet: the person shown is the last visit's guess, so it reads as one (muted and italic: never colour alone) until Confirm saves it. */
#grid-region[data-grid="admin_invoices"] .grid tr.unrated td.c-completed a.pe { color: var(--muted); font-style: italic; }
/* The jobs grid's columns. The header is two stacked rows (the (i) and funnel icons above the label), so a column needs only its label's width. Each --f-<word> is AT LEAST its label, or the widest content expected where that is wider, plus the cell's 8 px sides and its 1 px rule, up to a whole px (C-079): Job no. "888888", Points "ignored", Final team "888.8" with its "check" chip, Date "28 May 2026", Amount "888,888.88" or "Enter price", Deduction "Deduct". Points (typed), Total inc. GST and Job Audience are unchanged (off by default). Charlie's chain of 31 Oct 2026 is among them. A column's presence sets its --f-<word> and their sum is the table's floor (--cols-w) beside the description's (--desc-min, 120 px): the twelve default columns fit the box from a window of about 1,360 px with the sidebar open; at 1280 in the default sort every column to Date is in view and Paid in is a short scroll inside the box (sorted by Job no., Deduction or Completed by, Date's last 11 px are behind it too), never squeezing the description or the page. */
#grid-region[data-grid="admin_invoices"] { --cols-w: calc(var(--chev-w) + var(--f-number, 0rem) + var(--f-company, 0rem) + var(--f-completed, 0rem) + var(--f-points, 0rem) + var(--f-amount, 0rem) + var(--f-auto, 0rem) + var(--f-deduction, 0rem) + var(--f-team, 0rem) + var(--f-individual, 0rem) + var(--f-date, 0rem) + var(--f-paid, 0rem) + var(--f-total, 0rem) + var(--f-job_type, 0rem) + var(--f-audience, 0rem)); --desc-min: 5rem; } /* 80 px since 18 Nov 2026: the 40 px Final indiv. took so a person's name reads at 1280 (its header label may end in an ellipsis there) */
#grid-region[data-grid="admin_invoices"]:has(th.c-number) { --f-number: 3.5rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-company) { --f-company: 7.5rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-completed) { --f-completed: 5.75rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-points) { --f-points: 4.75rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-amount) { --f-amount: 6.375rem; } /* its label (91.07 px) or "Enter price" (85.14), plus the cell's 9 px */
#grid-region[data-grid="admin_invoices"]:has(th.c-auto) { --f-auto: 3.5rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-deduction) { --f-deduction: 4.4375rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-team) { --f-team: 5.75rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-individual) { --f-individual: clamp(8.5rem, calc(8.5rem + (100vw - 1360px) * 0.3), 11rem); } /* a share chip, "Technici… 124.7" up to a window of 1,360 px, then wider from the description's spare to "Technician Bee 124.7" whole by 1,500 (18 Nov 2026); the figure never gives way */
#grid-region[data-grid="admin_invoices"]:has(th.c-date) { --f-date: 5.375rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-paid) { --f-paid: 5rem; } /* Paid in (Decision 182): the pay period's label, on up to two lines and whole in the title */
#grid-region[data-grid="admin_invoices"]:has(th.c-total) { --f-total: 8rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-job_type) { --f-job_type: 6rem; }
#grid-region[data-grid="admin_invoices"] .grid td.c-job_type.unknown { background: var(--wrong-bg); box-shadow: inset 3px 0 0 var(--wrong); } /* a blank or unknown ServiceM8 category: red cell and bar (the title says why), never colour alone */
#grid-region[data-grid="admin_invoices"]:has(th.c-audience) { --f-audience: 8rem; }
/* A sorted header adds its arrow (10 px and a 2 px gap) after the label: that column is 12 px wider while it is sorted. */
#grid-region[data-grid="admin_invoices"]:has(th.c-number[aria-sort]) { --f-number: 4.25rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-deduction[aria-sort]) { --f-deduction: 5.1875rem; }
#grid-region[data-grid="admin_invoices"]:has(th.c-completed[aria-sort]) { --f-completed: 6.5rem; }
@media (min-width: 760px) { /* the desk's fixed column widths; on a phone the header is a strip of pills that take their own width, so no label is cut and no funnel covers one (#569, #622) */
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-number { width: var(--f-number); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-company { width: var(--f-company); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-completed { width: var(--f-completed); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-points { width: var(--f-points); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-amount { width: var(--f-amount); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-auto { width: var(--f-auto); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-deduction { width: var(--f-deduction); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-team { width: var(--f-team); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-individual { width: var(--f-individual); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-date { width: var(--f-date); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-paid { width: var(--f-paid); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-total { width: var(--f-total); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-job_type { width: var(--f-job_type); }
  #grid-region[data-grid="admin_invoices"] .lines-grid thead > tr > th.c-audience { width: var(--f-audience); }
}
/* Task 6 (simplified): the amount and the points, which do not sort (a label, no funnel), so they are narrower than a
   sorted column of the same words. */
#grid-region[data-grid="admin_invoices"] .grid td.c-amount { white-space: nowrap; }
/* The company and the description keep one line on the desk, an ellipsis at the end and the whole text in the title (as the cards do), so the columns after them are reached at 1280 with the sidebar open. */
@media (min-width: 760px) {
  #grid-region[data-grid="admin_invoices"] .lines-grid.grid tbody td:is(.c-company, .c-description, .c-job_type) .cut { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Paid in wraps to two lines, so "Oct 2026 pay" reads whole in its column; a longer label ends in an ellipsis after the second, whole in the title (18 Nov 2026) */
  #grid-region[data-grid="admin_invoices"] .lines-grid.grid tbody td.c-paid .cut { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; white-space: normal; }
}
/* .sub: a small label that belongs to a figure ("typed", "no price", "team only", "ignored") on its own soft line below
   it, in the figure's alignment (Charlie, 31 Oct 2026); a warning ("check") stays a chip beside the figure. On a card it
   rejoins the chain's one line. */
.sub { display: block; color: var(--muted); font-size: var(--fs-small); line-height: 1.25; }
#grid-region[data-grid="admin_invoices"] .grid td.c-individual .ind { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
/* A person's share is a pill in the filter chips' frame (.fchip: border, radius, padding, colours) minus the ×; it is no link, so no hover and no pointer. */
#grid-region[data-grid="admin_invoices"] .grid td.c-individual .ind li { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 24px; max-width: 100%; min-width: 0; padding: 0 0.625rem; border: 1px solid var(--mark); border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); cursor: default; }
#grid-region[data-grid="admin_invoices"] .grid td.c-individual .ind .cut { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#grid-region[data-grid="admin_invoices"] .grid td.c-individual .ind .share { flex: none; white-space: nowrap; } /* the figure is never cut or wrapped; only the name gives way, and the chip's title holds both (18 Nov 2026) */
/* Enter price: an action in words (never a bare icon), a 44 px target where the pointer is coarse or the card is narrow. */
a.enter { color: var(--text-2); font-weight: var(--fw-medium); white-space: nowrap; } /* one neutral outline chip in the person-share pills' frame, so an unpriced row is as tall as the others; "no price" is kept for a screen reader and in the title */
@media (pointer: fine) and (width >= 760px) { #grid-region[data-grid="admin_invoices"] .grid td.c-amount a.enter { min-height: 24px; } } /* the 44px tap floor stays on touch and phones */
#grid-region[data-grid="admin_invoices"] .grid td.c-amount a.enter { padding: 0 0.625rem; border: 1px solid var(--control); border-radius: var(--radius-pill); background: var(--surface); }
#grid-region[data-grid="admin_invoices"] .grid td.c-amount a.enter:hover { background: var(--hover); text-decoration: none; }
#grid-region[data-grid="admin_invoices"] .grid td.c-amount a.enter:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media not all and (min-width: 760px), (pointer: coarse) {
  a.enter { display: inline-flex; align-items: center; min-height: 44px; }
}
#grid-region[data-grid="admin_invoices"] .grid td.c-deduction a.ded { color: var(--muted); font-size: var(--fs-small); } /* "Deduct": a quiet link until a row has one */
#grid-region[data-grid="admin_invoices"] .grid td.c-total { white-space: nowrap; }
/* The review flag (Task 3): a flagged row has a left bar in --check and the word "check" in its Review cell, so colour
   never carries it alone. The bar is the first cell's on the desk (a table row paints no box-shadow of its own) and
   the card's on a phone. */
#grid-region[data-grid="admin_invoices"] .grid tr.flag > td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--check) 55%, var(--check-bg)); }

.pfacts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
.pfacts > div { grid-column: span 1; min-width: 0; }
.pfacts > .pf-half { grid-column: span 3; }
.pfacts > .pf-wide { grid-column: span 4; }
.pfacts dt { font-size: var(--fs-label); color: var(--muted); }
.pfacts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.pvisits { margin: 0; padding: 0; list-style: none; }
@media (width < 760px) { /* the cards' width, in the range syntax: the stylesheet's touch rules stay last */
  .pfacts > div, .pfacts > .pf-half, .pfacts > .pf-wide { grid-column: span 6; }
  .pfacts > div:nth-last-child(-n+2) { grid-column: span 3; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-number { order: 1; font-weight: var(--fw-strong); color: var(--text); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-date { order: 2; color: var(--muted); font-size: var(--fs-small); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-total { order: 3; margin-left: auto; font-weight: var(--fw-strong); min-width: 0; color: var(--text); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-company { order: 4; flex: 1 1 100%; font-weight: var(--fw-medium); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-company { min-width: 0; overflow: hidden; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody .cut.label { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line, like the description (the generic phone rule wraps a cut); the full name is in its title */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-description { order: 5; flex: 1 1 100%; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-completed { order: 6; flex: 1 1 100%; min-width: 0; color: var(--text); } /* who, on a line of its own: the chain (order 7) keeps its one line under it */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-points { order: 8; color: var(--muted); min-width: 0; }
  /* Charlie's chain on a card, one line: "1,070.00 · 10.7 −1.0 → Team 9.7", the people's shares under it (31 Oct). */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-amount { order: 7; font-weight: var(--fw-strong); min-width: 0; color: var(--text); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-auto { order: 7; color: var(--muted); min-width: 0; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > td.c-auto:has(.nil) { display: none; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-auto:not(:has(.nil))::before { content: "· " / ""; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-auto:not(:has(.nil))::after { content: " pts" / ""; } /* the figure before the deduction says what it is: "6.4 pts −1.0 → Team 5.4" */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-deduction { order: 7; min-width: 0; }
  /* Both ticked on: the amount keeps the first line's right edge and Total, now the lesser figure, follows it with its own words. */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr:has(> .c-amount) > .c-total { margin-left: 0; font-weight: normal; color: var(--muted); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr:has(> .c-amount) > td.c-total::before { content: "inc. GST " / ""; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-team { order: 7; font-weight: var(--fw-strong); min-width: 0; color: var(--text); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-individual { order: 8; flex: 1 1 100%; color: var(--muted); min-width: 0; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody .sub { display: inline; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-team:not(:has(.nil))::before { content: "→ Team " / ""; font-weight: normal; color: var(--muted); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-individual:not(:has(.nil)) .ind { flex-direction: row; flex-wrap: wrap; gap: 0.25rem var(--space-1); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > td.c-individual:has(.nil:not(.team-only)), #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > td.c-team:has(.nil):not(:has(.chip)) { display: none; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > td.c-individual:has(> .team-only) { display: block; } /* a rental says so, as the desk does: not a blank to hide */
  /* Job type (the ServiceM8 category) on its own muted line, below the first line's number, date and total; a blank or unknown one is a small red "no job type" */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-job_type { order: 8; flex: 1 1 100%; color: var(--muted); font-size: var(--fs-small); min-width: 0; overflow: hidden; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > td.c-job_type.unknown { color: var(--wrong); background: var(--wrong-bg); box-shadow: none; padding: 0 0.375rem; border-radius: var(--radius); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > td.c-job_type.unknown::before { content: "no job type" / ""; }
  /* The review flag on a card (the Final team cell's "check" chip says it): the card's left bar in --check, so colour never carries it alone. */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr.flag { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--check) 55%, var(--check-bg)); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr.flag > td:first-child { box-shadow: none; }
  /* Task 2, a card is four lines (number, day, total; company; one line of description; who, points and the row's
     chevron): the job's type, deduction and audience are for the table and the job card; a type that asks for an
     action (a chip) keeps a fifth line. */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-completed:not(:empty) { display: flex; align-items: center; gap: var(--space-1); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-completed:not(:empty)::before { content: "By " / ""; color: var(--muted); flex: none; } /* short, so who, the points and the chevron share a line at 375 */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-completed .cut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr.row { gap: 0 0.625rem; padding-block: 0.375rem; line-height: 1.25; } /* the four lines hold in 120 px: the 44 px of the last line is the floor */
  /* The chevron is pinned to the card's top-right corner (its 44 px target kept) instead of closing the last line on its own; the card's right padding keeps the lines clear of it. */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr.row { position: relative; padding-right: calc(44px + var(--space-2)); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr.row > td.c-x { position: absolute; top: var(--space-2); right: var(--space-2); margin: 0; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr.row > td.c-number a { padding-inline: 0; } /* the number sits against its day with the card's own gap, not the link's */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-individual:not(:has(.nil)) { display: flex; align-items: baseline; gap: var(--space-1); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-individual:not(:has(.nil))::before { content: "Indiv." / ""; flex: none; color: var(--muted); }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-individual:not(:has(.nil)) .ind { flex: 1 1 auto; min-width: 0; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr.row::after { display: none; } /* the Lines cards' line break before the figures */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > :is(.c-audience, .c-paid) { display: none; } /* a card keeps its four lines: the pay run is in the opened row's facts */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > .c-description { min-width: 0; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody .cut.desc { display: block; white-space: nowrap; text-overflow: ellipsis; } /* one line, not the Lines cards' two */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td.c-points::before { content: "Typed " / ""; } /* always: a blank typed Points is the one cell to tap on an unrated card */
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody td:is(.c-points, .c-deduction) { display: flex; align-items: center; gap: var(--space-1); } /* the label and its value on one line */
}

/* --- The points edit (the points-tab plan, Task 4): a link in a cell, the edit on its page and in the popover that
   js/points.js shows under the cell (the header filter menu's box, `.fpop`, wider; over the page on a phone), and the
   opened row's history. Tokens only; a refusal is the wrong tone with its words, never colour alone. */
a.pe { display: block; min-width: 0; }
.grid td:is(.c-points, .c-deduction) a.pe { display: flex; align-items: center; justify-content: flex-end; } /* the link's 24 px minimum puts a block's text at its top, 3 px above the other number cells; centred, it shares their line */
.ppop { width: 22rem; max-height: calc(100dvh - 1rem); }
.ppage { max-width: 28rem; }
.pedit { display: grid; gap: var(--space-2); }
.pedit label, .pedit legend { display: block; font-size: var(--fs-label); color: var(--muted); }
.pedit input:not([type=checkbox]), .pedit select { width: 100%; min-width: 0; }
.pedit summary { cursor: pointer; font-size: var(--fs-small); color: var(--accent); }
.pedit details[open] > summary { margin-bottom: var(--space-2); }
.ptitle { margin: 0; font-size: 1rem; font-weight: var(--fw-strong); }
.pedit legend { padding: 0; }
.ppeople { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: var(--space-2); }
.pperson { display: grid; gap: var(--space-1); }
.pwarn { margin: 0 0 var(--space-2); padding: var(--space-2); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); font-size: var(--fs-small); } /* a heads-up above a form, not a refusal: the pay record has already counted these jobs (walk 4) */
.pall { margin-top: var(--space-1); color: var(--muted); font-size: var(--fs-small); } /* the history's every value, closed: the list shows what each change changed */
.pall summary { cursor: pointer; }
.perror { margin: 0; padding: var(--space-2); border-radius: var(--radius); color: var(--wrong); background: var(--wrong-bg); font-size: var(--fs-small); }
.pedit [aria-invalid=true] { border-color: var(--wrong); border-width: 2px; }
.pactions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.pedit .pcancel { display: inline-flex; align-items: center; padding: 0 var(--space-3); color: var(--text); background: var(--field); border: 1px solid var(--control); border-radius: var(--radius); text-decoration: none; }
.phist { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); }
.phist .revoked s { color: var(--muted); }
.pwith { color: var(--muted); font-size: var(--fs-small); }
.pdrift { display: block; margin: var(--space-1) 0 0; padding: 0; list-style: none; font-size: var(--fs-small); } /* a pay run's recorded totals against what its period holds now (P3) */
ul.pdrift li { margin: 0; }
@media (width < 760px) {
  .ppop, .ppop[popover]:popover-open { width: min(92vw, 22rem); max-height: calc(100dvh - 2rem); inset: 1rem auto auto 50%; transform: translateX(-50%); margin: 0; }
}
@media not all and (min-width: 760px), (pointer: coarse) {
  a.pe, .pedit .pcancel, .pedit button, .pedit input:not([type=checkbox]), .pedit select, .pedit summary { min-height: 44px; }
  a.pe { display: flex; align-items: center; }
  .grid td:is(.c-points, .c-deduction) a.pe { min-width: 44px; justify-content: center; } /* a bare dash is a fair target too */
  .pedit summary { display: flex; align-items: center; }
  .pall summary { padding-block: 0.8rem; } /* 44 px with its marker kept (a flex summary loses it) */
  .pedit label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; } /* the amount page's repair tick */
}

/* --- Download for Excel (the points-tab plan, Task 5): an outlined button in the page head on the desk; on a phone the
   same link is in the Settings menu (#673 finding 6; the head's is hidden there and the menu's on the desk), a touch
   target where the pointer is coarse (DESIGN 12). The full view's "Employee view" entry (13 Nov) is placed likewise. */
a.btn[data-excel], a.btn[data-jobs-view] { display: inline-flex; align-items: center; padding: 0 var(--space-3); min-height: 2rem; color: var(--text); background: var(--field); border: 1px solid var(--control); border-radius: var(--radius); text-decoration: none; }
a.btn[data-excel]:hover, a.btn[data-jobs-view]:hover { background: var(--hover); }
@media not all and (min-width: 760px), (pointer: coarse) {
  a.btn[data-excel], a.btn[data-jobs-view] { min-height: 44px; }
}
/* The cleaning's marks (DR67 to DR73; Task 8): what the rules changed on a line, in words, in the opened row, a quiet
   list above the button; DR67's flags in the check chip the popup's flag list draws. */
.more-panel .marks { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-2); padding: 0; list-style: none; font-size: 0.8125rem; line-height: 1.25rem; color: var(--muted); }
.more-panel .marks li { max-width: 100%; overflow-wrap: anywhere; }

/* --- The order columns and the draft form (ordering v4, Task 8; Place removed, Charlie 29 Oct 2026). The next order's column is the one editable column: a
   box a size, tinted in the accent's soft tone so the eye finds where to type, under a header marked with the accent's
   rule (never colour alone: its number heads it and its (i) says what it is). */
/* The foot of the ordering table (UX pass, 1 Nov 2026; E2, E4, P8): the box's fill line, Back to the suggestion, the note that
   says how an order is recorded and Export CSV, in the form after the table (`_ordering_draft.html`). While a box holds a figure
   (`data-held`) it is pinned to the window's foot (above a phone's bar), opaque with a rule above, so no row shows through;
   the page's and the table box's scroll padding are its height (`--foot-h`, which `js/ordering.js` keeps), so a box focused by
   Enter or Tab is never under it (SC 2.4.11). Over a limit it answers in words, red, and a red edge, never a red slab; on a
   phone the sentence gives way to one short line and stays the live region, and while the foot is pinned the note on how an
   order is recorded is read, not drawn. */
.draft-foot { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "say say say" "back how act"; align-items: center; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); } /* the panels' own surface, radius and edge: no hard line above it (look 4, A6) */
.draft-foot p { margin: 0; }
.draft-foot [hidden] { display: none; }
.draft-foot .say { position: relative; grid-area: say; min-width: 0; }
.draft-foot .fill, .draft-foot .fill-short { font-variant-numeric: tabular-nums; }
.draft-foot .fill-short { display: none; font-size: var(--fs-body); }
.draft-foot .fill strong, .draft-foot .fill-short strong { font-weight: var(--fw-strong); }
.draft-foot .lim-narrow { display: none; } /* F3: the short line names 548 the box's limit: "of the box's 548 tyres" under 600 px, "of 548 tyres (the box's limit)" from it */
.draft-foot.over { box-shadow: inset 3px 0 0 var(--wrong); }
.draft-foot.over :is([data-f=over], [data-s=over]) { color: var(--wrong); }
.draft-foot .no-sug { margin-top: var(--space-1); }
.draft-foot [data-f=hid] { display: block; margin-top: var(--space-1); font-size: var(--fs-small); } /* what Export CSV includes that a filter hides: drawn on a phone's pinned foot too */
.draft-foot [data-f=hid]:empty { display: none; }
.draft-foot .back { grid-area: back; }
.draft-foot .how { grid-area: how; min-width: 0; text-align: right; font-size: var(--fs-small); }
.draft-foot .how > p { display: inline; }
.draft-foot .draft-act { grid-area: act; }
.draft-foot .draft-act > button { flex: none; }
.draft-foot[data-held] { position: sticky; bottom: 0; z-index: 4; } /* pinned while a box holds a figure; its own edge and radius set it off, no shadow band above it (look 4, A6) */
html:has(.draft-foot[data-held]) { scroll-padding-bottom: var(--foot-h, 5rem); }
.order-rows:has(.draft-foot[data-held]) .table-box { scroll-padding-bottom: var(--foot-h, 5rem); }
/* The pinned foot never lies over the top of the table (walk list #904, 12 Nov 2026: at first load it covered the desk table's
   header with no row in view, and the foot of a phone's sort pills). A sticky box's margin stays inside its parent, so the
   foot's top margin is the part of the table it keeps clear (the desk's header and first row; a phone's pills and the top of
   its first card); the table box's bottom margin takes the same length back, so the gap between the two is still --space-3
   and nothing moves when `data-held` is set or cleared. One rule at every width. */
.order-rows { --foot-clear: 7rem; }
.order-rows:has(> .draft-foot[data-held]) > .table-box { margin-bottom: calc(var(--space-3) - var(--foot-clear)); }
.order-rows > .draft-foot[data-held] { margin-top: var(--foot-clear); }
@media (max-width: 959.98px) {
  .draft-foot[data-held] { bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  html:has(.draft-foot[data-held]) { scroll-padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + var(--foot-h, 5rem)); }
}
@media (max-width: 759.98px) {
  .draft-foot { grid-template-columns: 1fr auto; grid-template-areas: "say say" "how act"; padding: var(--space-2); }
  .draft-foot:not([data-held]):has(.back:not([hidden])) { grid-template-areas: "say say" "back act" "how how"; }
  /* pinned: the short line and Export CSV on one row, Back or Undo beside Export CSV on a row of its own once it is shown;
     the note on how an order is recorded is read, not drawn (it comes back with the foot at its place in the page) */
  .draft-foot[data-held] { grid-template-areas: "say act"; }
  .draft-foot[data-held]:has(.back:not([hidden])) { grid-template-areas: "say say" "back act"; }
  .draft-foot[data-held] .how { position: absolute; grid-area: auto; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .draft-foot .fill { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* still read whole, in its live region */
  .draft-foot .fill-short { display: block; }
  .draft-foot[data-held] .no-sug { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* typing already: the foot is the fill and the buttons; the sentence is still read */
  .draft-foot .how { text-align: left; }
  .draft-foot .back { justify-self: start; }
}
/* the Save buttons' line, while boxes hold typed figures (M2): saving reloads the page, and the boxes go back */
.typed-warn { display: block; flex: 1 1 100%; margin: 0 0 var(--space-1); padding-left: var(--space-2); border-left: 3px solid var(--check); font-size: var(--fs-small); line-height: 1.35; color: var(--text-2); }
.typed-warn[hidden] { display: none; }
.setting > .typed-warn { order: -1; } /* a Settings switch is a row, its words at the left and its buttons at the right: the line takes a row of its own above it */
.setting:has(> .typed-warn:not([hidden])) { flex-wrap: wrap; }
/* a box's "Suggested N": read with the box, drawn on a phone's card once the box differs from it */
.sug { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.order-fields { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.order-fields > label { display: flex; align-items: center; gap: var(--space-1); margin: 0; }
.order-fields > label > input { width: 8rem; margin: 0; }
.order-fields > label > input[type=date] { width: 9.5rem; }
.order-fields > label.why { flex: 1 1 14rem; }
.order-fields > label.why > input { flex: 1 1 auto; width: auto; min-width: 0; max-width: none; }
.order-fields > button { flex: none; }
.grid thead th.c-next { box-shadow: inset 0 -2px 0 var(--accent); }
@media (min-width: 760px) { .lines-grid.grid tbody tr.row:not(.due) > td.c-next { background: var(--accent-soft); } } /* the desk's column; on a card the box stands alone */
/* the editable column stays in view when the box scrolls sideways (#443, 17 default columns at 1280): pinned to the box's right edge on its row's own ground, its header on the header's; an opaque cell hides the box's edge shadow (DESIGN 1), so it casts its own to the left in the same token (#465) */
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid :is(th, td).c-next { position: sticky; right: 0; } }
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid tbody td.c-next { z-index: 1; background: var(--accent-soft); box-shadow: inset 1px 0 0 var(--control); } }
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid tbody tr.row.due > td.c-next { background: var(--wrong-bg); } }
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid thead th.c-next { z-index: 3; box-shadow: inset 0 -2px 0 var(--accent), inset 1px 0 0 var(--control); } }
/* the Size column is pinned at the left the way the next-order column is at the right (EXP2-3): a row of the formula columns is told by its size when the box scrolls; on its row's own ground (`inherit`: the row's opaque --bg, zebra, hover or due follows), a right edge in the box's edge token, the "next" row's mark kept */
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid :is(th, td).c-size { position: sticky; left: 0; } }
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid tbody td.c-size { z-index: 1; background: inherit; box-shadow: inset -1px 0 0 var(--control); } }
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid tbody tr.row.next > td.c-size { box-shadow: inset 3px 0 0 var(--check), inset -1px 0 0 var(--control); } }
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid thead th.c-size { z-index: 3; box-shadow: inset -1px 0 0 var(--control); } }
/* Tab or a focus scrolls the box by the least that shows the control; with two pinned columns over its edges, "shown" can mean under one of them, out of sight with the focus on it (#495). The scroll padding is their two widths, the variables the columns take theirs from: Size is the auto column, so --desc-min is its floor and its width; the next-order column is --f-next. */
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.table-box { scroll-padding-inline: var(--desc-min, 10rem) var(--f-next, 5rem); } }
/* Between 760 and 959 px the Lines table (the Lines page, and a customer's or an item's purchases) is wider than its box and still a table, so Revenue is pinned to the box's right edge the way the next-order column is (PC-4, S1b): the figure stays in sight and the box's edge line says the rest scrolls. On its row's own ground (`inherit`), its header on the header's; its edge line is the rule colour, painted outside the cell over the neighbour's own right border, so a table that fits its box shows not one pixel more. Never the ordering section or the Business page. */
@media (min-width: 760px) { #grid-region[data-grid="lines"] .lines-grid.grid :is(th, td).c-revenue { position: sticky; right: 0; } }
@media (min-width: 760px) { #grid-region[data-grid="lines"] .lines-grid.grid tbody td.c-revenue { z-index: 1; background: inherit; box-shadow: -1px 0 0 var(--rule); } }
@media (min-width: 760px) { #grid-region[data-grid="lines"] .lines-grid.grid thead th.c-revenue { z-index: 3; box-shadow: -1px 0 0 var(--rule); } }
@media (min-width: 760px) { #grid-region[data-grid="lines"] .lines-grid.grid thead th.c-revenue[aria-sort] { box-shadow: inset 0 -2px 0 var(--accent), -1px 0 0 var(--rule); } }
@media (min-width: 760px) { #grid-region[data-grid="lines"] .lines-grid.grid tr.row[aria-selected=true] > td.c-revenue { background: var(--accent-soft); } } /* the selection's tint is on the row's cells (2263), not the row, so `inherit` above would leave this cell untinted; --accent-soft is opaque in both themes. Zebra, hover and the open row tint the row itself, which the cell inherits */
/* Tab or a focus scrolls the box by the least that shows the control, which can leave it under the pinned Revenue (the same as #495 for the ordering section): the scroll padding is its width, the variable its column takes its width from */
@media (min-width: 760px) { #grid-region[data-grid="lines"] .lines-grid.table-box { scroll-padding-inline-end: var(--f-revenue, 0rem); } }
.lines-grid.grid tbody td.c-next { padding-block: 2px; }
.lines-grid.grid tbody td.c-next input { width: 100%; max-width: 5rem; min-width: 3.5rem; padding: 0 var(--space-1); text-align: right; font-variant-numeric: tabular-nums; }
.lines-grid.grid tbody td.c-next input:focus-visible { outline-offset: 0; }
/* The ordering rows' states, one block and one precedence (UX pass, 1 Nov 2026; P8, E4): DUE over FOCUS over CHANGED, each in
   its own part of the row so none replaces another. A due row's tint is the row's own: a hover or the focus never takes it.
   The row whose box has focus gets an edge, in the mark, on its size cell at the desk and on the card on a phone, laid over
   whatever the row's tint is (a due row stays red while typed in; the "next" row's own rule gives way while it is lit). A box
   that differs from the suggestion is marked on the box (a heavier border, a bold figure and a corner, never colour alone),
   apart from the focus ring and from the lit row, so the three can stand together on one due row. Written in this order:
   later wins. */
#grid-region[data-ordering] .lines-grid.grid tbody td.c-next input.changed { font-weight: var(--fw-strong); border-color: var(--mark); box-shadow: inset 0 0 0 1px var(--mark); background-image: linear-gradient(135deg, var(--mark) 0, var(--mark) 0.625rem, transparent 0.625rem); }
@media (min-width: 760px) {
  #grid-region[data-ordering] .lines-grid.grid tbody tr.row:focus-within > td.c-size { box-shadow: inset 4px 0 0 var(--mark), inset -1px 0 0 var(--control); }
  #grid-region[data-ordering] .lines-grid.grid tbody tr.row.next:focus-within > td.c-size { box-shadow: inset 4px 0 0 var(--mark), inset 7px 0 0 var(--check), inset -1px 0 0 var(--control); } /* the row that sets the date keeps its own edge, inside the lit one */
}
#grid-region[data-ordering] .lines-grid.grid tbody tr.row.due:is(:hover, :focus-within) { background-color: var(--wrong-bg); }
@media (max-width: 759.98px) {
  #grid-region[data-ordering] .wide.grid tbody tr.row:focus-within { box-shadow: inset 4px 0 0 var(--mark); }
  #grid-region[data-ordering] .wide.grid tbody tr > .c-next { flex-wrap: wrap; justify-content: flex-end; }
  #grid-region[data-ordering] .wide.grid tbody td.c-next > input.changed + .sug { position: static; flex: 1 1 100%; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; text-align: right; font-size: var(--fs-small); font-weight: 400; color: var(--text-2); }
  #grid-region[data-ordering] .wide.grid tbody tr.row[data-why] td.c-next > input.changed + .sug { display: none; } /* the card's own line (the row's data-why) begins "Suggested N": never drawn twice */
}
/* A figure the export would refuse (above 9,999, below 0, or not whole) is marked in the page's wrong colour, with a dashed
   edge and its range in words under the box, so colour is not the only sign (walk 3, U3). `:invalid` reads the box's own
   min, max and step, so no script is involved; it follows the changed-box rule so it wins over the mark. */
#grid-region[data-ordering] .lines-grid.grid tbody td.c-next input:invalid { border: 1px dashed var(--wrong); box-shadow: inset 0 0 0 1px var(--wrong); background-color: var(--wrong-bg); background-image: none; color: var(--wrong); }
#grid-region[data-ordering] .lines-grid.grid tbody td.c-next:has(> input:invalid)::after { content: "0 to 9,999"; display: block; flex: 1 1 100%; font-size: 0.6875rem; line-height: 1.2; text-align: right; color: var(--wrong); }
.orders details.placed { margin: 0 0 var(--space-2); scroll-margin-top: var(--space-3); } /* a link to an order's form (E1) scrolls its summary to the top, a little clear of it */
.orders details.placed form { margin: 0 0 var(--space-3); }
.orders details.placed h3 { margin: var(--space-3) 0 var(--space-1); font-size: 1rem; }
.lines-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-2); }
.lines-edit > label { margin: 0; font-variant-numeric: tabular-nums; }
.lines-edit > label > input { max-width: none; }
@media not all and (min-width: 760px), (pointer: coarse) {
  .order-fields > button, .draft-act > button, .draft-foot .back, .orders button { min-height: 44px; }
  .order-fields > label { flex: 1 1 100%; display: block; }
  .order-fields > label > input, .order-fields > label > input[type=date], .order-fields > label.why > input { display: block; width: 100%; margin-top: var(--space-1); }
  .wide.grid tbody td.c-next input { min-height: 44px; min-width: 5rem; }
  .assumptions :is(input:not([type=hidden]), select, button) { min-height: 44px; }
}
.banner.wrong { color: var(--wrong); background: var(--wrong-bg); border-color: var(--wrong); } /* a refusal: the flag pair, with its words */
.banner.empties { font-size: var(--fs-body); } /* the ordering page's empties line is the answer's warning: body size, not a note's small one */
.banner .banner-sizes { display: block; margin: var(--space-1) 0 0; } /* a long list of sizes a reason counts instead of naming: shut, on its own line (U1, 5 Nov 2026) */
.banner .banner-sizes > p { margin: var(--space-1) 0 0; }
@media not all and (min-width: 760px), (pointer: coarse) { .banner .banner-sizes > summary { padding-block: 0.875rem; } } /* a thumb: over 44 px */
.assumed li .banner-sizes > p { margin: var(--space-1) 0 0; } /* the Still assumed lines use the banner's details (N12, 5 Nov 2026): the same shut list, in the list's type */
@media not all and (min-width: 760px), (pointer: coarse) { .assumed li .banner-sizes > summary { padding-block: 0.875rem; } }
@media not all and (min-width: 760px), (pointer: coarse) { .banner a.go { display: inline-flex; align-items: center; min-height: 44px; } } /* a banner's way on (the withheld answer's link to the order's form, E1) is 44 px for a thumb, DESIGN 12 */

/* The strip "How the answer is worked out", compact (Charlie, 28 Oct 2026: "concise, and compact, but I can hover over
   (i) for extra details ... better visual hierarchy"). One panel: a one-line summary, then the figures that stand
   outside the bar, the assumptions' bar (small labelled boxes sized to their values, in two groups; the source and
   note of each in its (i)), the figures the answer worked out, and under it all, shut or open, the two formulas with
   every term marked a column of the table, an assumption or worked out. The look plan's hierarchy rules, on today's
   tokens: a heading (the summary, "Assumptions", the two formulas, a group's name) at 600 in the text colour,
   sentence case; a label small, at 500, muted; a value at body size, 400; the answer said once, in the tiles above
   (the summary's glance is a muted 400 line, 1 Nov 2026); a reference (the formulas) small, in the second text colour; a note in an (i),
   a provenance as a marker, no outline; no rule under a row, groups apart by space. Tokens only: no colour of
   its own. */
.panel.strip { padding-block: var(--space-1); }
.strip details.strip-d, .strip details.strip-d[open], .strip details.more, .strip details.more[open], .strip details.steps, .strip details.steps[open] { margin: 0; padding: 0; border: 0; background: none; } /* the panel is the box: a disclosure inside it is a row, not another frame */
.strip details.strip-d > summary { padding-block: var(--space-1); font-weight: var(--fw-strong); } /* the heading: `details.panel > summary` no longer reaches it, the panel being the wrapper */
.strip summary .glance { margin-left: var(--space-2); font-weight: var(--fw-body); color: var(--muted); }
.strip summary .glance .gl { display: inline-block; }
.strip .k { margin-right: var(--space-1); font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--muted); }
.strip .facts { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); margin: 0 0 var(--space-1); font-size: var(--fs-small); line-height: 1.5; }
.strip .worked { margin: var(--space-1) 0 0; font-size: var(--fs-small); line-height: 1.6; color: var(--text-2); }
/* an (i) beside a term or a box: the header's (i) (`.hb`, `_col_help.html`) outside a table head; the popover is the header's `.hpop`. On a coarse pointer its box is 44 px square (a negative margin keeps the line as it was), so a thumb finds it. */
.strip .hb { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 1.25rem; height: 1.25rem; min-width: 0; min-height: 0; margin: 0 0 0 1px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: help; vertical-align: -0.3em; }
.strip .hb:hover, .strip .hb:focus-visible { color: var(--text); background: var(--surface); box-shadow: none; }
.strip .hb:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; }
.strip .hb .icon { width: 0.75rem; height: 0.75rem; }
.strip .hpop { width: 18rem; }
@media (pointer: coarse) {
  .strip .hb { width: 2.75rem; height: 2.75rem; margin: -1rem -0.5rem; }
  .strip .f .hb { margin: -1rem 0; } /* in a box's row it has width of its own, so it never reaches into the input beside it */
  .strip .fl { min-height: 2.75rem; } /* and its label's row holds the box, so it never reaches into the input above or below when the row wraps */
  .strip .bar-head .ttl { min-height: 2.75rem; } /* and the heading's row holds its box, so it never reaches into the Reason box below */
  .strip .worked:has(.hb) { line-height: 2.75rem; } /* a line with an (i) is as tall as its target, so two (i)s on neighbouring lines never overlap */
  .strip .facts .fact:has(.hb) { padding-block: calc((2.75rem - 1.5 * var(--fs-small)) / 2); } /* a fact's target is room above and below its text, not a taller line (walk 2, N1: its wrapped lines sat 45 px apart); its one (i) ends its last line */
}
@media (pointer: coarse) and (max-width: 639.98px) { /* a phone: the two reference lines go without (i)s, their terms are in the bar and in the worked-out line, each with its own */
  .strip .defs .hb { display: none; }
  .strip .defs .worked { line-height: 1.6; }
}
@media not all and (min-width: 640px) { /* on a phone the (i)'s words are a sheet across the foot of the screen: an anchored 18 rem box would run off one edge of a 375 px one */
  .strip .hpop[popover]:popover-open { position-area: none; inset: auto 0.5rem 1rem 0.5rem; width: auto; max-height: 60dvh; margin: 0; overflow-y: auto; transform: none; }
}
/* the bar: a group a row, its name in a column of its own at the left, each box a small muted label then its value (body size, weight 400) and unit, so the boxes read across and the groups line up */
.strip .bar { margin: 0 0 var(--space-1); }
.strip .bar form { margin: 0; }
.strip .bar-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-1); }
.strip .bar-head .ttl { display: inline-flex; align-items: center; gap: var(--space-1); }
.strip .bar-head h2, .strip .fm h3 { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-strong); }
.strip .bar .save { display: flex; align-items: center; gap: var(--space-2); }
.strip .bar .save label { margin: 0; font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--muted); }
.strip .bar .save input { width: 14rem; margin: 0; }
.strip .group { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-1); }
.strip .group h3 { margin: 0; font-size: var(--fs-small); font-weight: var(--fw-strong); line-height: 1.3; color: var(--text); }
.strip .fields { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.strip .more > .fields { margin: var(--space-2) 0; }
.strip .f { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1); min-width: 0; }
.strip .fl { display: inline-flex; align-items: center; }
.strip .fl label { margin: 0; font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--muted); white-space: nowrap; }
.strip .ctl { display: inline-flex; align-items: center; gap: var(--space-1); }
.strip .bar :is(input:not([type=hidden]), select), .strip .more :is(input:not([type=hidden]), select) { width: auto; max-width: 100%; margin: 0; padding: 2px var(--space-2); font-size: var(--fs-body); font-weight: var(--fw-body); font-variant-numeric: tabular-nums; }
.strip .ctl .u, .strip .ctl .pm { font-size: var(--fs-small); color: var(--muted); }
.strip .bar select, .strip .more .f select { font-size: var(--fs-small); }
.strip .f .fformat { flex-basis: 100%; margin: 2px 0 0; font-size: var(--fs-label); } /* how to type a box's value, always drawn: not the grids' `.hint`, nor the filter menu's `.fhint` (menus.js queries it), which is hidden on a mouse from 760 px (its filter's title says it there) and on a phone until Filters is open; a strip box has no title to say it */
.strip .f .fnote { flex-basis: 100%; margin: 4px 0 0; padding: 1px var(--space-2); font-size: var(--fs-label); color: var(--text); background: var(--check-bg); border: 1px solid var(--check); border-radius: var(--radius); } /* a box's note, words on the amber "check" ground and always drawn: the Lead time outside the recorded lead times, a stock-out month the window does not reach */
.strip .f .dot { flex: none; width: 0.5rem; height: 0.5rem; margin-left: var(--space-1); border-radius: var(--radius-pill); background: var(--check); } /* still assumed: the amber the "check" marks use; its words are in the box's label, for a screen reader */
.strip .defs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-4); }
.strip .orders { margin: 0 0 var(--space-2); font-size: var(--fs-small); }
.strip details.more > summary, .strip details.steps > summary { display: inline-block; padding-block: var(--space-1); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.strip details.steps { margin: var(--space-2) 0 0; }
.strip details.steps ol { margin: var(--space-1) 0 0; padding-left: 1.25rem; font-size: var(--fs-small); }
.strip .more h2 { margin: var(--space-2) 0 var(--space-1); font-size: var(--fs-body); font-weight: var(--fw-strong); } /* a size's figures, inside More: a heading of the same size as "Assumptions" (the old `.assumptions h2` rule went with the rows) */
.strip .more .pick > select { width: 22rem; max-width: 100%; } /* a size's name and figures in a choice: a box of its own, not the width of its longest option */
.strip .more .figs { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.strip .more .figs > label > input { width: 9rem; }
.strip .more .order-fields > label.why > input { width: 16rem; max-width: 100%; flex: none; }
/* the two formulas: under the summary, shut or open; a desk's two columns, a phone's one with the short forms. Where the rows are cards (below 760 px) they show only while the strip is open: 360 px of reference put the first card below the first screen (U7, 5 Nov 2026) */
.strip .formulas { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1) var(--space-4); margin: var(--space-2) 0 0; }
@media not all and (min-width: 760px) { .strip > details.strip-d:not([open]) ~ .formulas { display: none; } }
.strip .legend { margin: 0; font-size: var(--fs-label); }
.strip .fm.spikes { grid-column: 1 / -1; } /* the demand rule: one line across both formulas' columns */
.strip .fm .wide { display: none; }
.strip .fm .narrow { display: block; }
.strip .fl-line { font-size: var(--fs-small); line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
.strip .t-col { font-size: var(--fs-soft); font-weight: var(--fw-strong); color: var(--text); } /* a column of the table below, in the header's own case, bold */
.strip .t-as { padding: 0 var(--space-1); border-radius: var(--radius-xs); background: var(--surface); color: var(--text); font-weight: var(--fw-medium); white-space: nowrap; } /* an assumption of the bar: a tint of the panel, no outline */
.strip a.t-as { text-decoration: none; } /* an assumption's chip that links to its box (E6) keeps the chip's look; a hover and the focus ring (the global one) say it is a link */
.strip a.t-as:hover { background: color-mix(in srgb, var(--surface) 86%, var(--text)); text-decoration: underline dotted; text-underline-offset: 0.2em; }
.strip a.t-as:focus-visible { background: color-mix(in srgb, var(--surface) 86%, var(--text)); }
.strip .t-wo { color: var(--text); font-style: italic; font-weight: var(--fw-strong); border-bottom: 1px dotted var(--muted); } /* worked out for this answer */
.strip .legend .sample { font-size: var(--fs-soft); }
@media (min-width: 640px) { .strip .fm .wide { display: block; } .strip .fm .narrow { display: none; } }
@media (min-width: 1100px) { .strip .formulas, .strip .defs { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } .strip .legend { grid-column: 1 / -1; } } /* the left formula is the longer one */
@media not all and (min-width: 640px) { .strip .group { grid-template-columns: minmax(0, 1fr); } }
/* N11 of the 5 Nov walk: on a phone every box of the assumptions is one row on one grid, its label above it, its box as wide
   as the row leaves after a fixed column for the unit (and for the Lead time's (i), which sits where the unit does), so the
   boxes' left and right edges line up instead of each being as wide as its value. The Lead time's two boxes share the one width. */
@media not all and (min-width: 640px) {
  .strip .fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2) 0; }
  .strip .f { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .strip .ctl { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: 0; }
  .strip .ctl .u, .strip .ctl .pm { padding-inline: var(--space-1); }
  .strip .ctl:has(.pm) { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 2.75rem 2.75rem; }
  .strip .ctl:has(.pm) .u { grid-column: 4; }
  .strip .f .ctl :is(input:not([type=hidden]), select) { width: 100%; min-width: 0; max-width: none; }
}
@media not all and (min-width: 760px), (pointer: coarse) {
  .strip .bar :is(input:not([type=hidden]), select, button:not(.hb)), .strip .more :is(input:not([type=hidden]), select, button:not(.hb)) { min-height: 44px; }
  .strip .bar .save { flex: 1 1 100%; flex-wrap: wrap; }
  .strip .bar .save label { flex: 1 1 100%; }
  .strip .bar .save input { flex: 1 1 8rem; width: auto; min-width: 0; }
  .strip details.more > summary, .strip details.steps > summary { min-height: 44px; display: flex; align-items: center; }
}

/* A size's figures and Confirm (ordering v4, Task 9): the figures' boxes wrap to as many as fit a row; a Still assumed line is its words, then its Confirm form (a reason and a button) on a row of its own; the phone's touch targets are 44 px. */
.pick { display: block; margin: 0 0 var(--space-2); }
.pick > select { display: block; width: 100%; max-width: none; margin-top: var(--space-1); }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-2); margin: 0 0 var(--space-2); }
.figs > label { margin: 0; }
.figs > label > :is(input, select) { display: block; width: 100%; max-width: none; margin-top: var(--space-1); }
.assumed ul { padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.assumed li { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.assumed li form.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: var(--space-1) 0 0; }
.assumed li form.confirm > label { display: flex; flex: 1 1 14rem; align-items: center; gap: var(--space-1); margin: 0; }
.assumed li form.confirm > label > input { flex: 1 1 auto; width: auto; min-width: 0; max-width: none; margin: 0; }
@media not all and (min-width: 760px), (pointer: coarse) {
  .assumed li form.confirm :is(input:not([type=hidden]), button) { min-height: 44px; }
  .assumed li form.confirm > label { display: block; flex: 1 1 100%; }
  .assumed li form.confirm > label > input { display: block; width: 100%; margin-top: var(--space-1); }
  .assumed li > a { display: inline-block; padding: var(--space-1) 0; }
}
/* U5 of the 5 Nov walk: on a touch screen "Change the figures" is a 44 px target (SC 2.5.5; it was 30.5, the 22.5 px line
   and 0.25rem a side), by the pattern the other touch targets use: a minimum height, its words centred in it. The
   line below it moves down by what the link grew; nothing overlaps it. The desk and a mouse keep the rules above. */
@media (pointer: coarse) {
  .assumed li > a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* #338 and #203 (task int): a link that looks like a button (Remove, Revoke, Cancel) wears the button variants, and the
   question pages' buttons stand apart. The coarse rule above already gives a.btn its 44 px. */
a.btn.danger { color: var(--wrong); background: var(--wrong-bg); border-color: var(--wrong); }
a.btn.secondary { background: transparent; color: var(--accent); border-color: var(--control); }
form.ask { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
form.ask > label { flex: 1 1 100%; }

/* The sign-in page (#313): the .panel component narrowed and centred, the name, one line and the one primary button; the
   signed-out strip is not drawn above it, so the name is said once. Existing tokens only. */
main > .signin { max-width: 24rem; margin: clamp(var(--space-4), 18vh, 8rem) auto 0; text-align: center; }
.signin > h1 { margin-top: 0; }
.signin .btn { width: 100%; min-height: 2.75rem; }

/* The invoice sheet's figures now carry thousands separators (#141), so on the phone each of a line card's five columns is at
   least as wide as its figure: two money cells never run into each other. */
@media not all and (min-width: 760px) {
  .sheetbody .invoice-lines tr { grid-template-columns: repeat(5, minmax(max-content, 1fr)); }
  .sheetbody .invoice-lines td.desc { contain: inline-size; overflow-wrap: anywhere; } /* a description with no space breaks inside its card (it no longer sets the five columns' widths) */
}

/* The totals bar's clause for the lines still marked check (#135): quiet like the typical price beside it, wrapped where it outgrows the count's cell */
.grid tfoot .marked { font-weight: var(--fw-body); font-size: var(--fs-small); color: var(--muted); }
.grid tfoot th:has(> .marked) { white-space: normal; text-wrap: pretty; }

/* Phone and pages, wave 2 (#402, #414). The item page's title is cut to two lines like a grid's description (the whole
   label stands under Spellings and in the title; DESIGN 16). The original invoice's box scrolls sideways, so it wears the
   table box's right-edge shadow (DESIGN 1; the same technique as .table-box, tokens only). */
.page-head h1.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.sheetbody .orig-sheet {
  background-color: var(--bg);
  background-image: linear-gradient(to left, var(--bg) 30%, transparent),
    radial-gradient(farthest-side at 100% 50%, var(--control), transparent);
  background-position: right center, right center;
  background-size: 2.5rem 100%, 0.75rem 100%;
  background-repeat: no-repeat;
  background-attachment: local, scroll;
}
.sheetbody table.orig tbody tr { background: none; } /* the source sheet has no stripes, and an opaque row would hide the shadow above (#414) */
/* The Questions page's one form a group (#144) wraps the tables without a box of its own; its first button is a
   disabled one, kept out of sight, so Enter in a why box presses nothing. */
form.q-group { display: contents; }
form.q-group > button[hidden] { display: none; }

/* A Lines card's description with no space (#510: 270 letters made the page 1193 px wide at 375). The card is a flex row whose
   description cell takes a whole line (`flex: 1 1 100%`), but a flex item never goes narrower than its longest word, so the
   word set the card's width. `contain: inline-size` (what #500 gave the invoice card) makes the cell's width its line's, and
   `overflow-wrap: anywhere` breaks the word inside it. The desk's table is unchanged. */
@media not all and (min-width: 760px) {
  .lines-grid.grid tbody tr.row > td.c-description { contain: inline-size; overflow-wrap: anywhere; }
}
/* --- The screens of 28 Oct, shoulds (#515): the invoice sheet's headers may wrap. The ⧉ copy button each header gains
   widened the table past its box at every desk width and pushed the Line total column out of sight with no cue that
   the box scrolls; the labels wrap now (the buttons stay beside their words) so the whole table fits. --- */
#sheet table.invoice-lines thead th { white-space: normal; }

/* Selecting in a table stays in its column (Charlie, 28 Oct 2026): `js/colselect.js` marks the table with the column pressed in; the others cannot be selected until the mouse is released. Without the script nothing is marked. */
table[data-select-col="1"] :is(td, th):not(:nth-child(1)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="2"] :is(td, th):not(:nth-child(2)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="3"] :is(td, th):not(:nth-child(3)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="4"] :is(td, th):not(:nth-child(4)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="5"] :is(td, th):not(:nth-child(5)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="6"] :is(td, th):not(:nth-child(6)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="7"] :is(td, th):not(:nth-child(7)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="8"] :is(td, th):not(:nth-child(8)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="9"] :is(td, th):not(:nth-child(9)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="10"] :is(td, th):not(:nth-child(10)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="11"] :is(td, th):not(:nth-child(11)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="12"] :is(td, th):not(:nth-child(12)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="13"] :is(td, th):not(:nth-child(13)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="14"] :is(td, th):not(:nth-child(14)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="15"] :is(td, th):not(:nth-child(15)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="16"] :is(td, th):not(:nth-child(16)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="17"] :is(td, th):not(:nth-child(17)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="18"] :is(td, th):not(:nth-child(18)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="19"] :is(td, th):not(:nth-child(19)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="20"] :is(td, th):not(:nth-child(20)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="21"] :is(td, th):not(:nth-child(21)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="22"] :is(td, th):not(:nth-child(22)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="23"] :is(td, th):not(:nth-child(23)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="24"] :is(td, th):not(:nth-child(24)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="25"] :is(td, th):not(:nth-child(25)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="26"] :is(td, th):not(:nth-child(26)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="27"] :is(td, th):not(:nth-child(27)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="28"] :is(td, th):not(:nth-child(28)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="29"] :is(td, th):not(:nth-child(29)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="30"] :is(td, th):not(:nth-child(30)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="31"] :is(td, th):not(:nth-child(31)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="32"] :is(td, th):not(:nth-child(32)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="33"] :is(td, th):not(:nth-child(33)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="34"] :is(td, th):not(:nth-child(34)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="35"] :is(td, th):not(:nth-child(35)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="36"] :is(td, th):not(:nth-child(36)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="37"] :is(td, th):not(:nth-child(37)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="38"] :is(td, th):not(:nth-child(38)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="39"] :is(td, th):not(:nth-child(39)) { -webkit-user-select: none; user-select: none; }
table[data-select-col="40"] :is(td, th):not(:nth-child(40)) { -webkit-user-select: none; user-select: none; }
.sheetbody .orig-hint { margin: 0.5rem 0 0; font-size: 0.875rem; } /* the hint under the original PDF */
/* --- "View as employee" (a co-founder's toggle, Charlie, 28 Oct 2026). The button joins the account strip's two
   (same look, same 44 px coarse target); the bar is the site's banner ground, one line at 375 (the words may wrap
   under the button when the room is short, never off the page). */
.acts :is(details.theme > summary, .signout button, .view-as button) { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 1.75rem; padding: 0 0.5rem; color: var(--on-chrome); background: transparent; border: 1px solid var(--control); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: var(--fw-medium); white-space: nowrap; box-shadow: none; }
.narrow .side .acts :is(.view-as button) { justify-content: center; width: 2rem; min-height: 2rem; padding: 0; }
@media (pointer: coarse) { .acts :is(details.theme > summary, .signout button, .view-as button) { min-height: 44px; min-width: 44px; } }
@media (pointer: coarse) { td.wrap .keysep { visibility: hidden; } } /* the access log's comma between two names: each link is its own 44 px box on a touch screen, so a comma would sit alone on a line (#816) */
.side .acts, .acct-panel .acts { flex-wrap: wrap; }
.viewing-as { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 0 0.75rem; padding: 0.375rem 0.75rem; border: 1px solid var(--check); border-radius: var(--radius); background: var(--check-bg); color: var(--text); font-size: 0.8125rem; }
.viewing-as form { margin: 0; flex: none; }
.viewing-as button { display: inline-block; min-height: 1.75rem; padding: 0 0.625rem; font-size: 0.75rem; white-space: nowrap; }
@media (pointer: coarse) { .viewing-as button { min-height: 44px; } }
@media (max-width: 480px) { .viewing-as .more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .viewing-as { padding: 0.25rem 0.5rem; font-size: 0.75rem; } .viewing-as button { padding: 0 0.375rem; font-size: 0.6875rem; } }

/* --- The foot's second line (Charlie, 28 Oct): which version of the app runs, under the record's as-of; the same
   small muted type, the date in the chrome's text colour. --- */
.appver { display: flex; align-items: center; gap: 0.375rem; margin: 0 0 var(--space-2); font-size: 0.75rem; color: var(--chrome-muted); }
.appver time { color: var(--on-chrome); }
.narrow .side .appver { justify-content: center; }
.narrow .side .appver .lbl { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The card's one-line note is for the phone's card alone (28 Oct UX pass, finding 2) */
.card-note { display: none; }
.banner.empties a { white-space: nowrap; } /* a size's name stays whole where the line wraps */
.banner.empties .banner-sizes { display: inline-block; vertical-align: top; max-width: 100%; margin: 0; padding: 0; border: 0; background: none; } /* the sizes past the third: "and 1 more." goes on the line's own last row and opens the rest under it (walk 3, N4), not a card of its own */
.banner.empties .banner-sizes > summary { display: inline-block; padding-block: 0; } /* inline-block, not the list item, so it stays on the line's last row when it fits; its triangle is drawn below */
.banner.empties .banner-sizes > summary::before { content: "▸ " / ""; }
.banner.empties .banner-sizes[open] > summary::before { content: "▾ " / ""; }
@media not all and (min-width: 760px), (pointer: coarse) { .banner.empties .banner-sizes > summary { box-sizing: border-box; min-height: 44px; padding-block: 0.6875rem; } } /* a thumb: 44 px */
.grid tbody td.c-all { display: none; } /* "All figures" is the phone's card alone (above); the desk table shows every column */
/* The slow sizes with nothing to order, folded into one line, "N slow sizes, none to order" (the phone's, mobile review of
   28 Oct, C2: a Tantor page of 60 cards is 22,000 px tall; the desk's, UX review of 5 Nov, finding 5: 55 of its 60 rows
   were zeros). The line is a native <details> in a row of its own (`_ordering_rows.html`); closed, the rows marked `quiet`
   are not drawn, open they are, which `:has` reads, so no script opens it. A browser without `:has` shows every row and no
   line (`@supports`). The line is a card below 760 px and one table row spanning the columns from there, which keeps the
   Size and the next-order pins and the column widths as they are. A phone's way to a size, the box above the cards
   (`_ordering_find.html`: the Size column's own "contains" filter), is the phone's alone: from 760 px the funnel in the
   header is that filter. */
.size-find, .lines-grid.grid tbody tr.fold { display: none; }
@supports selector(:has(*)) {
  .lines-grid.grid tbody tr.fold details, .lines-grid.grid tbody tr.fold details[open] { margin: 0; padding: 0; border: 0; background: none; }
  .lines-grid.grid tbody tr.fold summary { display: list-item; box-sizing: border-box; color: var(--text-2); }
  .lines-grid.grid tbody:not(:has(tr.fold details[open])) tr.row.quiet { display: none; }
}
@media not all and (min-width: 760px) {
  .size-find { display: block; margin: 0 0 var(--space-2); }
  .size-find .lsearch { display: block; position: relative; max-width: none; margin: 0; }
  .size-find .lsearch > input { min-height: 44px; }
  /* The ordering page's gear and the size box share one row (walk 3, U7c): the region is a wrapping flex row here; the gear
     keeps its width, the box takes the rest, and the chips (order 2) wrap below. Scoped to this page: the shared bar is
     Lines', Items', Customers' and Invoices' too. */
  #grid-region[data-ordering] > .toolbar > details.settings { order: 1; flex: 0 0 auto; align-self: flex-end; margin: 0 0 var(--space-2); } /* the same bottom margin and edge as the box's input, which sits at the foot of its form */
  #grid-region[data-ordering] > .size-find { order: 1; flex: 1 1 0; min-width: 0; align-self: flex-end; }
  @supports selector(:has(*)) {
    .lines-grid.grid tbody tr.fold { display: block; padding: 0; }
    .lines-grid.grid tbody tr.fold summary { min-height: 44px; padding: 0.6875rem 0.75rem; font-size: var(--fs-body); }
  }
}
@media (min-width: 760px) {
  @supports selector(:has(*)) {
    .lines-grid.grid tbody tr.fold { display: table-row; }
    .lines-grid.grid tbody tr.fold > td { padding: 0; overflow: visible; border-bottom: 1px solid var(--rule); } /* visible: a cell that clips is its own scroll box, and the line's `sticky` would pin to the cell, not the table's box */
    .lines-grid.grid tbody tr.fold details { width: max-content; max-width: 100%; position: sticky; left: 0; } /* the click target and the focus ring are the line's words, not the table's width; pinned to the box's left edge while the table scrolls sideways (walk 2, B1), under the pinned Size column (its z-index 1 is above the row's other cells, and the line's row has no Size cell) */
    .lines-grid.grid tbody tr.fold summary { min-height: 2rem; padding: 0.375rem 0.75rem; font-size: 0.75rem; line-height: 1.35; outline-offset: -2px; } /* inside the row: the cell clips an outline outside it */
    .lines-grid.grid tbody tr.fold summary:hover { color: var(--text); }
  }
  @media (pointer: coarse) { .lines-grid.grid tbody tr.fold summary { min-height: 44px; } } /* a touch screen at desk width (a tablet): the line is a 44 px target */
}
/* The pinned Size column hides the sliver of the next cell that scrolls past its edge (finding 13): a strip of its own background just outside it, no wider than a cell's side padding so a left-aligned neighbour loses none of its text */
@media (min-width: 760px) { #grid-region[data-ordering] .lines-grid.grid :is(th, td).c-size::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: var(--cell-x, 4px); background: inherit; } }

/* --- The error pages (500.html, down.html; mobile slice M1): plain pages with no header, so the text sits in a column
   and both buttons are 44 px touch targets (DESIGN 12). `a.btn.secondary` is the outline Lines beside the main Try again. --- */
.errpage main { width: min(100%, 32rem); margin: 0 auto; padding: var(--space-4); }
.errpage-acts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.errpage a.btn { min-height: 44px; min-width: 44px; padding-inline: 1.25rem; }
a.btn.secondary { background: transparent; color: var(--accent); border-color: var(--control); }

/* --- Who may see what, in the desk navigation (usability round, Charlie 28 Oct 2026: "the features and nuances to all
   be discoverable"). One mark, the lock in a quiet pill, says "employees cannot see this", in two places only: "Hidden
   for now" on Jobs (it is meant for employees later) and "Co-founders only" on a hairline over the whole co-founder
   block (Questions, Analytics, Admin: always theirs). The words carry it, never the colour (WCAG 1.4.1); the rail keeps
   the Jobs lock beside its icon with the words as the link's accessible name, and the divider as a hairline alone with
   its words as the tooltip. Questions shows its count, none at 0. */
.side a { position: relative; }
.tag { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0 0.4375rem; border: 1px solid var(--rule); border-radius: var(--radius-pill); background: var(--chrome); color: var(--chrome-muted); font-size: var(--fs-soft); font-weight: 500; line-height: 1.125rem; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.side .tag .icon { width: 0.6875rem; height: 0.6875rem; flex: none; }
.side a .tag { margin-left: auto; }
.side a:has(> .tag) { flex-wrap: wrap; } /* "Jobs" and its chip may not both fit the 14rem sidebar (and the collapsed rail): the chip takes a line of its own, whole, rather than leaving the link (S1b) */
.nav-lock { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-4) 0.75rem 0; }
.nav-lock::before,
.nav-lock::after { content: ""; flex: 1 1 auto; border-top: 1px solid var(--rule); }
.nav-lock::before { flex: 0 0 0.5rem; }
.side .count { margin-left: auto; min-width: 1.25rem; padding: 0 0.375rem; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--fs-label); font-weight: 600; line-height: 1.125rem; text-align: center; font-variant-numeric: tabular-nums; }
.side summary:focus-visible { outline-offset: -2px; }
@media (min-width: 960px) {
  /* The rail: the Jobs lock sits at the link's top-right corner, outside the 20 px icon (the link is 44 px wide at
     the rail's width and the icon centred, so the lock has the margin the way the ordering dot has); the divider is
     its hairline alone; the count a small badge at the same corner. */
  .narrow .side a .tag { position: absolute; top: 0.125rem; right: 0.125rem; margin: 0; padding: 0; border: 0; background: none; color: var(--text-2); }
  .narrow .side a .tag .icon { width: 0.75rem; height: 0.75rem; }
  .narrow .side .tag-w { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .narrow .nav-lock { margin-inline: 0.75rem; gap: 0; }
  .narrow .nav-lock::before { display: none; }
  .narrow .nav-lock .tag { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* the words stay in the accessibility tree; touch has the divider's own title and the expanded sidebar */
  .narrow .nav-lock::after { border-top-color: var(--rule); }
  .narrow .side .count { position: absolute; top: -0.125rem; right: -0.125rem; min-width: 0.875rem; padding: 0 0.1875rem; margin: 0; font-size: 0.6875rem; line-height: 0.875rem; }
}
@media (min-width: 960px) and (pointer: coarse) {
  /* Touch has no tooltip: the divider shows its lock beside the hairline (the words stay the accessible name). */
  .narrow .nav-lock { gap: 0.25rem; }
  .narrow .nav-lock::before { display: block; flex: 1 1 auto; }
  .narrow .nav-lock .tag { position: static; width: auto; height: auto; margin: 0; padding: 0.125rem; clip-path: none; overflow: visible; }
}
.side .nav-admin-open > summary::after { font-size: 1rem; color: var(--text-2); } /* the only cue a closed group has (devil's advocate S2): a step larger than the 12 px glyph */
.side .nav-admin-open ul a { padding-block: 0.1875rem; } /* eight links, 4 px less each: the foot stays nearer the fold on Admin pages */

/* points summary: the section on top of the Jobs page, `/admin/jobs` (Jobs points V1's totals, moved there on 31 Oct 2026). One bar (the month, Previous and Next, the jobs and no-price links) and one row of totals above the grid, each person's tile one link; on a phone the bar's two buttons share a line and the totals sit three to a row, and the section stays first where the grid's toolbar is lifted above the page's other blocks. */
.pp-summary { margin: 0 0 var(--space-2); }
.pp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); }
.pp-bar span.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; min-height: 24px; min-width: 24px; padding: 0.3125rem 0.875rem; color: var(--accent); border: 1px solid var(--control); border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; line-height: 1.35; } /* the end of the months: the outline button's size, dimmed, no link */
.pp-bar .btn.off { opacity: 0.4; pointer-events: none; }
@media (pointer: coarse) { .pp-bar span.btn { min-height: 44px; } }
.pp-month { margin: 0 var(--space-2) 0 0; font-size: 1.125rem; }
.pp-unpriced { margin: 0 0 0 auto; color: var(--muted); font-size: var(--fs-small); } /* the section's three muted lines are small text at every width (12 Nov 2026): with "N to check" the links still share one line at 1280 */
.pp-unpriced a, .pp-nowrap { white-space: nowrap; } /* a link is never cut across two lines, and "N with no price: show them" moves as one on a phone */
.pp-none { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--fs-small); }
.pp-paid { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--fs-small); } /* the pay record's one plain line under the tiles (Decision 182) */
.pp-totals { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); margin: 0; }
.pp-totals > div:first-child:not(:last-child) { margin-right: var(--space-3); } /* two groups: Team, then Individual and the people */
.pp-totals > div { position: relative; flex: 0 1 11.5rem; min-width: 0; padding: var(--space-1) var(--space-2); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.pp-totals dt { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.pp-totals dt a { color: var(--text); font-weight: var(--fw-medium); text-decoration: none; }
.pp-totals > div:hover dt a, .pp-totals > div:has(dt a:focus-visible) dt a { text-decoration: underline; }
.pp-totals dt a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* the whole tile is the link: a thumb finds it anywhere */
.pp-totals > div:has(dt a):hover { background: var(--hover); }
.pp-totals > div:has(dt a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pp-totals dt a:focus-visible { outline: none; } /* the tile carries the ring */
.pp-totals > div:has(dt a[aria-current]) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); } /* the person the grid is showing; aria-current says it to a screen reader */
.pp-totals dd { margin: 0; font-size: 1.125rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.pp-totals dd.pp-split { color: var(--muted); font-size: 0.75rem; font-weight: normal; line-height: 1.4; }
.pp-split ul { margin: 0; padding: 0; list-style: none; }
.pp-split li { display: flex; justify-content: space-between; gap: var(--space-1); overflow-wrap: normal; } /* a type a line, laid out like a ledger: the label left, its points right */
.pp-lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* a long label is cut with an ellipsis (the full text is its title) */
.pp-pts { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; } /* the number never wraps and never leaves the tile */
.pp-split li.pp-added { margin-top: 0.125rem; padding-top: 0.125rem; border-top: 1px solid var(--rule); color: var(--text); font-weight: var(--fw-medium); } /* Decision 181: points added by hand, the ledger's last line */
.pp-totals dd.pp-addto { margin-top: 0.25rem; font-size: 0.75rem; font-weight: normal; }
.pp-add { position: relative; z-index: 1; display: inline-block; padding: 0.25rem 0; color: var(--accent); } /* above the person tile's whole-tile link layer */
@media (pointer: coarse) { .pp-add { min-height: 44px; display: inline-flex; align-items: center; } }
@media (width < 760px) { /* the cards' width, in the range syntax: the stylesheet's touch rules stay last */
  .grid-region:has(> .toolbar) > .pp-summary { order: 0; } /* the toolbar's parts are ordered 1 to 4 above the page's other blocks (order 5): the points stay first */
  .pp-month, .pp-unpriced { flex: 1 1 100%; margin: 0; }
  .pp-bar .btn { flex: 1 1 0; min-width: 44px; justify-content: center; } /* Previous and Next share a line, a half each */
  .pp-dot { display: none; }
  .pp-nowrap { display: block; } /* the two links a line each: no dot to strand at a line's end */
  .pp-totals > div, .pp-totals > div:first-child:not(:last-child) { flex: 0 0 calc(50% - var(--space-1)); margin-right: 0; } /* two tiles a row on a phone */
}
.pinline { display: inline; margin: 0 0 0 var(--space-1); } /* Remove, beside the adjustment it removes (Decision 181) */

/* === Phones: taps, overflow and cut labels (branch phone-taps-1104): this block holds every rule added by that branch,
   so a merge with another branch's edits to this file stays easy. === */
.size { white-space: nowrap; } /* a tyre size such as 6.50-10 stays on one line (`size_nowrap`, #567): the browser would break it after its hyphen */
/* #517, #568: the 44 px tap target is a hit area, not layout: the link keeps its look and its box, and an empty ::after
   (position: absolute, no content) reaches past it, so a card keeps its height (165 px on the fixture) and the Bill-to
   line its 22.5. A Lines card's invoice number and customer are stacked with no gap, so the space round them is shared
   and no two hit areas overlap: the invoice number takes the card's top padding and half the gap above the card (38 px
   tall on the first card, which stops below the sort pills; 44 px on the others), the customer the plain description line under it (44 px); each reaches 12 px left into the card's padding, so
   a short name is 44 px wide. The check chip's own ::after (below the customer by 40 px) and the sales arrow (to the
   right) are left alone; 24 x 24 holds for every link (SC 2.5.8). The customer link is `overflow: hidden` on the desk's
   one-line cut; on a card its text wraps, so `overflow: visible` (with `overflow-wrap: anywhere` for a long word)
   changes nothing a person sees and lets the ::after out. */
@media (pointer: coarse) and (width < 760px) { /* the cards only: a touch screen at desk width draws the Lines table, whose links keep their one-line cut */
  .grid[aria-label=Lines] tbody tr:not(.more) > td:not([colspan]) a:not(.sales, .chip, .btn) { position: relative; overflow: visible; overflow-wrap: anywhere; }
  .grid[aria-label=Lines] tbody tr:not(.more) > td:not([colspan]) a:not(.sales, .chip, .btn)::after { content: ""; position: absolute; z-index: 1; left: -12px; right: 0; top: 0; bottom: 0; } /* above the description cell, which is positioned and later */
  .grid[aria-label=Lines] tbody tr:not(.more) > td.c-invoice a:not(.sales, .chip, .btn)::after { top: -14px; }
  .grid[aria-label=Lines] tbody tr:not(.more) > td.c-customer a:not(.sales, .chip, .btn)::after { bottom: -20px; }
  .grid[aria-label=Lines] tbody tr.row ~ tr.row > td.c-invoice a:not(.sales, .chip, .btn)::after { top: -20px; } /* every card but the first: 44 px, the gap of 8 px shared with the card above (nothing tappable at its left); the first stops below the sort pills */
}
@media (pointer: coarse) {
  .sheetbody .pname a { position: relative; }
  .sheetbody .pname a::after { content: ""; position: absolute; left: -8px; right: -8px; top: -13px; bottom: -13px; } /* 18 px of line, 44 px of target; nothing tappable above or below */
}
/* #534: an invoice line card (the sheet and the invoice page) with an item code, an item name and a long description. The
   five money tracks are `minmax(max-content, 1fr)` (#141), so the item code and name, each in one track, set widths of 116
   and 214 px and the grid ran past the card, starting left of the sheet's edge. They now take a full row of their own,
   after the five figures (`order`), and, as the description does, `contain: inline-size` keeps their text from setting a
   track; the category cell is held the same way. */
@media not all and (min-width: 760px) {
  .sheetbody .invoice-lines td:nth-child(2) { contain: inline-size; overflow-wrap: break-word; } /* #714: a word breaks only when it is longer than the cell */
  .sheetbody .invoice-lines td:is([data-label="Item code"], [data-label="Item name"]) { grid-column: 1 / -1; order: 1; contain: inline-size; overflow-wrap: anywhere; }
}

/* --- The table's rest recedes, the answer's tiles ranked (UX pass, 1 Nov 2026; the devil's advocate's changes to the
   look panel's C2 and C1). Rank by weight and size inside the density, not by looser rows: the norm stops
   outshouting the exception. Never colour alone: a slow size still says "slow" in its Kind column and in its tag, the
   due row keeps its chip. Tiles are picked by the role the template prints (`data-stat`, `data-verdict`), never by
   place, so a stat added or dropped cannot move a size onto the wrong tile. No status colour on the tiles (no red, no
   amber, no edge): Charlie decides that, with v5's "while a proforma is out". */

/* The ordering table. A slow size with nothing suggested (`slow-none`, printed whatever the sort, the filter or the
   withheld state; `quiet` is the fold's alone) and any figure that reads 0 (`zero`) take the muted grey. The
   next-order box (`.c-next`) is left out of the first rule: his typed figure is never grey, and CSS cannot tell a served
   0 from a figure typed over it (the `value` attribute does not follow typing; `:placeholder-shown` would need the box
   served empty), so the box keeps its colour. */
#grid-region[data-ordering] .lines-grid.grid tbody tr.row.slow-none > td:not(.c-size, .c-next),
#grid-region[data-ordering] .lines-grid.grid tbody td.zero { color: var(--muted); }
/* the size is the row's name: 600 in the text colour on the desk, as on the card (the desk's cells read the second text colour) */
#grid-region[data-ordering] .lines-grid.grid tbody td.c-size > span:first-child { font-weight: var(--fw-strong); color: var(--text); }
/* "slow" and "Phoenix only" are quiet words, "sets the date" a word in the text colour at 500; the due tag keeps its chip */
#grid-region[data-ordering] .lines-grid.grid tbody td.c-size .chip.chip-quiet { box-shadow: none; background: none; padding-inline: 0.125rem; color: var(--muted); font-weight: var(--fw-body); }
#grid-region[data-ordering] .lines-grid.grid tbody td.c-size .chip.chip-sets { box-shadow: none; background: none; padding-inline: 0; color: var(--text); font-weight: var(--fw-medium); }

/* The answer's tiles, ordering. Order by and Arrives are the answer: a 22 px figure (20 px and one line on a phone).
   Volume and Weight are the check figures: a quiet pair at body size in the second text colour, out of their boxes. */
dl.stats:has(> [data-stat]) { grid-template-columns: minmax(9rem, 14rem) minmax(9rem, 16rem) max-content; grid-template-rows: auto auto; gap: var(--space-2) var(--space-3); max-width: none; margin-bottom: var(--space-4); }
dl.stats > [data-stat="order-by"] { grid-column: 1; grid-row: 1 / span 2; padding: 0.75rem 1rem; }
dl.stats > [data-stat="arrives"] { grid-column: 2; grid-row: 1 / span 2; padding: 0.75rem 1rem; }
dl.stats > :is([data-stat="order-by"], [data-stat="arrives"]) dt { font-size: var(--fs-small); }
dl.stats > :is([data-stat="order-by"], [data-stat="arrives"]) dd { font-size: 1.375rem; line-height: 1.25; margin-top: 0.125rem; white-space: nowrap; }
dl.stats > :is([data-stat="volume"], [data-stat="weight"]) { grid-column: 3; display: flex; align-items: baseline; gap: var(--space-2); padding: 0; background: none; border: 0; border-radius: 0; }
dl.stats > [data-stat="volume"] { grid-row: 1; align-self: end; }
dl.stats > [data-stat="weight"] { grid-row: 2; align-self: start; }
dl.stats > :is([data-stat="volume"], [data-stat="weight"]) dt { min-width: 3.75rem; font-size: var(--fs-small); }
dl.stats > :is([data-stat="volume"], [data-stat="weight"]) dd { font-size: var(--fs-body); font-weight: var(--fw-body); color: var(--text-2); }
@media (max-width: 599.98px) {
  dl.stats:has(> [data-stat]) { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  dl.stats > [data-stat="order-by"] { grid-column: 1; grid-row: 1; }
  dl.stats > [data-stat="arrives"] { grid-column: 2; grid-row: 1; }
  dl.stats > :is([data-stat="volume"], [data-stat="weight"]) { display: none; } /* the panel's sentence above already says both per cents; a phone's first screen keeps the room (walk 3, U7a) */
  dl.stats > :is([data-stat="order-by"], [data-stat="arrives"]) dd { font-size: 1.25rem; white-space: nowrap; }
  .draft-foot .lim-narrow { display: inline; } /* F3: the foot's short line names 548 the box's limit as "of the box's 548 tyres" under 600 px (the .lim-wide suffix is from 600 up) */
  .draft-foot.over .lim-narrow { display: none; } /* over a limit the line also says which, and must stay one line beside Export CSV (objectives 13) */
  .draft-foot .lim-wide { display: none; }
}

/* Business: the verdict is the page's answer, at the same figure size; the note under it at 13 px. */
section[data-verdict] > h2 { font-size: 1.375rem; line-height: 1.25; margin-bottom: var(--space-2); }
section[data-verdict] > p.muted { font-size: var(--fs-small); margin-bottom: 0; }

/* --- Split line (Charlie, 1 Nov 2026; `record.splits`): the form's line panel, its five part rows and the live remaining
   sum, the parts of a split line on the invoice sheet. Tokens only; the remaining sum says "done" or "over" in words as
   well as colour (the form's status line is an aria-live region). Touch targets from the form's own (.pedit). */
.split-line { margin-bottom: var(--space-3); }
.split-line p { margin: 0 0 var(--space-1); }
.split-row { margin: 0; padding: var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius); display: grid; gap: var(--space-2); min-width: 0; }
.split-row legend { padding: 0 var(--space-1); font-size: var(--fs-label); color: var(--muted); }
.split-left { margin: 0; padding: var(--space-2); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--rule); font-size: var(--fs-small); }
.split-left.split-done { border-color: var(--status-completed); }
.split-left.split-over { border-color: var(--wrong); color: var(--wrong); }
.split-parts { margin: var(--space-1) 0 var(--space-2); padding-left: 1.25rem; display: grid; gap: var(--space-1); }
.split-parts li { overflow-wrap: anywhere; }
.split-tag, .split-note { color: var(--muted); font-size: var(--fs-small); }
.split-link { font-size: var(--fs-small); }
.split-pending { margin-top: var(--space-1); padding: var(--space-2); border: 1px dashed var(--rule); border-radius: var(--radius); background: var(--surface); }
.split-pending[data-state="unapplied"] { border-style: solid; border-color: var(--wrong); } /* a split left whole: "Not applied" in words too */
.split-lost strong { color: var(--wrong); }
@media not all and (min-width: 760px), (pointer: coarse) {
  .split-link, .split-note a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* --- UI words and a quieter look (#673), one block a finding, each after the rules it overrides ------------------ */

/* Finding 12: an invoice number is a quiet link, not the loudest mark in the grid. Body face with tabular figures and the
   link colour; underlined on hover or focus only, as a customer's name is. A struck line keeps its strike. */
.grid tbody tr:not(.more) > td:not([colspan]).c-invoice a { text-decoration-line: none; font-family: inherit; font-variant-numeric: tabular-nums; }
.grid tbody tr:not(.more) > td:not([colspan]).c-invoice a:hover,
.grid tbody tr:not(.more) > td:not([colspan]).c-invoice a:focus-visible { text-decoration-line: underline; }
.grid tbody tr:not(.more) > td:not([colspan]).c-invoice del a,
.grid tbody tr:not(.more) > td:not([colspan]).c-invoice del a:hover { text-decoration-line: line-through; }

/* Finding 10: the invoice sheet. The title is in the body face (it was bold monospace); the item code is one line
   at the desk (it broke into TYR- / 650- / 10-BRO); the copy mark of a column sits in the header's corner, shown on
   hover or focus, so no header carries a second line of its own (the band was about 60 px). Where there is no hover
   (a touch screen) the mark stays in the flow, as it was, 44 px. */
#sheet .sheet-head h2, .invoice.panel .sheet-head h1 { font: var(--fw-strong) 1.125rem/1.3 var(--font); }
@media (min-width: 760px) {
  .sheetbody .invoice-lines td[data-label="Item code"] { white-space: nowrap; }
}
@media (hover: hover) {
  /* the mark sits in a margin of its own, at the label's far end (the left of a right-aligned figure's header), so it
     never covers a word; 1.125 rem square, its glyph the body's size (review of #686, minor 5) */
  #sheet table.invoice-lines thead th { padding-right: 1.25rem; }
  #sheet table.invoice-lines thead th.num { padding-right: 0.5rem; padding-left: 1.25rem; }
  #sheet table.invoice-lines thead th .copycol { position: absolute; top: 50%; right: 0.125rem; transform: translateY(-50%); width: 1.125rem; height: 1.125rem; min-width: 0; min-height: 0; margin: 0; padding: 0; font-size: 0.875rem; background: var(--surface); opacity: 0; }
  #sheet table.invoice-lines thead th.num .copycol { right: auto; left: 0.125rem; }
  #sheet table.invoice-lines thead th:hover .copycol,
  #sheet table.invoice-lines thead th:focus-within .copycol,
  #sheet table.invoice-lines thead th .copycol:focus-visible { opacity: 1; color: var(--text-2); }
}

/* Finding 8: the Questions page. A brand word is answered by one primary and one secondary button (the template gives
   "not a brand" and "not a duplicate" the secondary class). No glyphs on them: a tick and a cross widened the buttons
   so "skip" wrapped under them and each brand card grew by about 60 px on a phone (review of #686, minor 2). */
/* A Workbooks row's cells share a baseline: the invoice link (a 24 px or 44 px target) sat a line below its date. */
#workbooks .table-box td { vertical-align: baseline; }

/* === Task density, finding 1 (#673): the Lines card at 375 is one tap and one chip line. Below 760 the card's row opens by
   a tap anywhere on it: its `summary` (the chevron's, native, so the keyboard and the no-script page still open it) is
   stretched over the card and shows nothing, the chevron button of 44 px is gone, and a link, a chip or the check mark
   keeps its own tap above it (z-index 1, so #672's invisible hit areas are untouched). Quantity, net and revenue follow
   the chips on one line, read as "3 x 120.00 = 360.00" (qty x net = revenue; with no net, "2 x 210.00"); the line break
   before them and the labelled "Qty", "at", "Disc" and "Net" are gone. The "sales of this item" arrow floats in no shut card; the opened card shows it as a labelled
   link at the foot of its description. The desk's table is untouched (all of it is inside the phone's query). === */
@media (width < 760px) {
  .wide.grid[aria-label=Lines] tbody tr.row { position: relative; column-gap: 0.375rem; }
  .wide.grid[aria-label=Lines] tbody tr.row > td.c-x { position: absolute; inset: 0; margin: 0; padding: 0; width: auto; border-radius: inherit; background: transparent; box-shadow: none; }
  .wide.grid[aria-label=Lines] tbody td.c-x details { display: block; height: 100%; border-radius: inherit; }
  .wide.grid[aria-label=Lines] tbody td.c-x summary { display: block; width: 100%; height: 100%; border: 0; border-radius: inherit; }
  .wide.grid[aria-label=Lines] tbody td.c-x .chev { display: none; }
  [data-rows] .wide.grid[aria-label=Lines] tbody tr.row > td.c-x { pointer-events: none; } /* with the script (js/rows.js) a tap on the card, its words too, opens it and a drag over words selects them (DR77); the summary stays for the keyboard and shows its focus */
  .wide.grid[aria-label=Lines] tbody tr.row:active { background: var(--hover); } /* the press tint: the row, not the summary, which takes no pointer with the script */
  .wide.grid[aria-label=Lines] tbody tr.row > td:not(.c-x) a:not(.sales) { position: relative; z-index: 1; }
  .wide.grid[aria-label=Lines] tbody tr.row > td.c-description { position: static; padding-right: 0; } /* the description's room for the arrow, and its box over the summary, go */
  .wide.grid[aria-label=Lines] tbody tr.row::after { display: none; }
  .wide.grid[aria-label=Lines] tbody tr > :is(.c-qty, .c-price, .c-discount, .c-net) { order: 6; }
  .wide.grid[aria-label=Lines] tbody tr > td.c-qty { margin-left: auto; }
  .wide.grid[aria-label=Lines] tbody td.c-qty::before { content: "" / ""; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-price:empty) > td.c-qty::before { content: "Qty " / ""; } /* a Not invoiced line with no price: the quantity in words, no dangling "×" (6 Nov walk) */
  .wide.grid[aria-label=Lines] tbody td.c-price:empty { display: none; }
  .wide.grid[aria-label=Lines] tbody td.c-price::before, .wide.grid[aria-label=Lines] tbody td.c-net::before { content: "× " / ""; }
  /* "qty × net = revenue" (Net is the unit price after the discount, Revenue the line's total: the stored one, `data-sum`, set only where it is qty × net to the cent); where the revenue is not, "qty × net" and no equals, the revenue on the card's right; where the net is blank, "qty × price" and no equals; the price and the discount give way to the net (a nonzero discount stays; a net cell with a value has its title, a blank one the dash) */
  .wide.grid[aria-label=Lines] tbody td.c-net[data-sum]:not([data-sum=""])::after { content: " = " attr(data-sum) / ""; }
  .wide.grid[aria-label=Lines] tbody td.c-net:has(del)::after { text-decoration: line-through; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-net:not([title])) > td.c-discount::before { content: "· disc " / ""; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-net:not([title])) > td.c-discount::after { content: " each" / ""; } /* the figure is a unit's discount, as on the desk's Disc column; a blank net: "qty × price · disc -20.00", the discount the desk shows, never hidden */
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-net[title]) > td.c-price,
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-net[title]) > td.c-discount:not(.has-disc) { display: none; } /* an undiscounted line: the one-line card (#673 finding 1) */
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-net[title]) > td.c-discount.has-disc { order: 7; } /* a discounted line keeps its discount after the sum: "2 × 170.00 = 340.00 · disc -15.00" (#787; a title is no help on a touch screen) */
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-net[title]) > td.c-discount.has-disc::before { content: "· disc " / ""; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(td.c-net[title]) > td.c-discount.has-disc::after { content: " each" / ""; } /* a unit's discount, not the line's */
  .wide.grid[aria-label=Lines] tbody tr.row > td.c-flags:has(.why) { order: 8; display: flex; align-items: center; gap: 0.375rem; flex: 1 1 100%; min-width: 0; } /* a struck line's reason ("not counted: ...", the longest text of the card) is one line, its words cut, with the check chip after it; the whole phrase is in its title and shows in the opened card */
  .wide.grid[aria-label=Lines] tbody td.c-flags .cut.why { flex: 0 1 auto; min-width: 0; max-width: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .wide.grid[aria-label=Lines] tbody td.c-flags:has(.why) > :is(a.chip, .chip) { flex: none; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(details[open]) td.c-flags .cut.why { white-space: normal; overflow: visible; }
  .wide.grid[aria-label=Lines] tbody td:has(.nil) { display: none; } /* a struck line's dash sits inside its <del>, which the grid's own `:has(> .nil)` misses */
  .wide.grid[aria-label=Lines] tbody td.c-description > a.sales { display: none; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(details[open]) td.c-description > a.sales { position: relative; z-index: 1; display: flex; align-items: center; gap: 0.375rem; width: auto; height: auto; min-height: 44px; margin: 0; padding: 0; opacity: 1; font-size: 0.8125rem; color: var(--link); }
  .wide.grid[aria-label=Lines] tbody tr.row:has(details[open]) td.c-description > a.sales > span:first-child { order: 1; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(details[open]) td.c-description > a.sales .sr { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; }
  .wide.grid[aria-label=Lines] tbody tr.row:has(details[open]) td.c-description > a.sales .sr::first-letter { text-transform: uppercase; }
}

/* === Task density, finding 9 (#673): the Items card at 375. A cell with no value shows nothing (no "Last sold" label
   alone, no empty cell holding a gap, so a card with no size starts at the name's edge). After the name the class chip,
   size, brand, last date and times sold read as one line, a dot between those that are there: "tyre · 8.15-15 ·
   last 12 Mar 2014 · sold 3×" (in the order of the columns the person chose). The labels are the words themselves. === */
@media (width < 760px) {
  .wide.grid[aria-label=Items] tbody tr.row { column-gap: 0.25rem; }
  .wide.grid[aria-label=Items] tbody tr.row::after { display: none; } /* the line break before the stats: the chip and the stats are one line */
  .wide.grid:is([aria-label=Items], [aria-label=Customers]) tbody tr.row > td:empty { display: none; } /* #792: a Customers card with no last date shows no bare "Last" */
  .wide.grid[aria-label=Items] tbody tr.row > :is(.c-size, .c-brand, .c-last, .c-sold) { font-size: 0.8125rem; }
  .wide.grid[aria-label=Items] tbody td.c-size::before, .wide.grid[aria-label=Items] tbody td.c-brand::before { content: none; }
  .wide.grid[aria-label=Items] tbody tr.row > td.c-last::before { content: "last " / ""; }
  .wide.grid[aria-label=Items] tbody tr.row > td.c-sold::before { content: "sold " / ""; }
  .wide.grid[aria-label=Items] tbody tr.row > td.c-sold::after { content: "×" / ""; }
  .wide.grid[aria-label=Items] tbody tr.row > :is(.c-class, .c-size, .c-brand, .c-last, .c-sold):not(:empty) ~ :is(.c-size, .c-brand, .c-last, .c-sold):not(:empty)::before { content: "· " / ""; }
  .wide.grid[aria-label=Items] tbody tr.row > :is(.c-class, .c-size, .c-brand, .c-last, .c-sold):not(:empty) ~ td.c-last:not(:empty)::before { content: "· last " / ""; }
  .wide.grid[aria-label=Items] tbody tr.row > :is(.c-class, .c-size, .c-brand, .c-last, .c-sold):not(:empty) ~ td.c-sold:not(:empty)::before { content: "· sold " / ""; }
}

/* --- Task density (#673 findings 5, 6 and 7): more of the content on one phone screen. One block a finding. -------- */

/* Finding 5: the invoice page and the sheet at 375. The total is a line of the head (it was about 1,400 px down on a
   nine-line invoice, 2,400 on a long one); a line's item code sits on its number's row, between the number and the
   category, with no label; an item name its description already holds, and a blank code or name, leave the card, so no
   card has a label with no value. The desk keeps its columns; the head total shows at every width (#696 item 11: on a long
   invoice the totals block is below all the lines). */
.sheet-total { display: block; margin-top: 0.125rem; font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; color: var(--text); }
@media not all and (min-width: 760px) {
  .sheetbody .invoice-lines td:nth-child(1) { grid-column: 1 / 4; grid-row: 1; white-space: normal; contain: inline-size; } /* #714: the code may wrap under the number; the number is one word and never splits */
  .sheetbody .invoice-lines td:nth-child(2) { grid-column: 4 / 6; grid-row: 1; }
  .sheetbody .invoice-lines td[data-label="Item code"] { display: none; } /* #714: the code shows as the line cell's ::after, so the category keeps two tracks (a screen reader meets it once) */
  .sheetbody .invoice-lines td:nth-child(1)[data-code]::after { content: attr(data-code); display: block; font-size: var(--fs-small); color: var(--muted); overflow-wrap: anywhere; } /* pseudo content is no textContent: Copy (Excel) still reads the number alone */
  .sheetbody .invoice-lines td[data-label="Item name"] { font-size: var(--fs-small); color: var(--muted); }
  .sheetbody .invoice-lines td:is([data-label="Item code"], [data-label="Item name"])::before { display: none; }
  .sheetbody .invoice-lines td:is([data-label="Item code"], [data-label="Item name"]):is(:empty, [data-same]) { display: none; }
}

/* Finding 6: the Jobs head at 375. The title is the pager, "‹ October 2026 ›" (the page's "Jobs" stays for a screen
   reader, and "Points for" with it; Previous and Next keep their words in the label); Excel and the full view's Employee view link are in the gear (the desk keeps its head switch and button, the gear's entries are hidden there); the links
   are one wrapping row of small chips (32 px high, outlined, one line each, a 44 px hit area past the chip, no two hit
   areas touching); the tiles are one strip that scrolls in its own box, still the first thing under the pager (C-027). */
@media (width < 760px) {
  .jobs-head { margin: 0; }
  .jobs-head .jobs-views { margin: 0 0 var(--space-2); flex-wrap: nowrap; }
  .jobs-head .jobs-views[data-view=full] { display: none; }
  .page-head a.btn[data-excel=head] { display: none; }
  .jobs-head h1, .pp-for, .pp-word { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .pp-bar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 0 var(--space-1); margin: 0 0 var(--space-1); }
  .pp-bar > .pp-month { grid-column: 2; grid-row: 1; flex: none; text-align: center; }
  .pp-bar > :nth-child(2) { grid-column: 1; grid-row: 1; }
  .pp-bar > :nth-child(3) { grid-column: 3; grid-row: 1; }
  .pp-bar > .btn { min-width: 0; padding-inline: 0; font-size: 1.25rem; line-height: 1; }
  .pp-bar > p.pp-unpriced { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 0.375rem; margin: var(--space-1) 0 var(--space-1); }
  .pp-unpriced .pp-nowrap { display: inline-flex; align-items: center; gap: 0.25rem; }
  .pp-unpriced a { position: relative; display: inline-flex; align-items: center; height: 2rem; min-height: 0; padding: 0 0.5rem; border: 1px solid var(--control); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-2); text-decoration: none; white-space: nowrap; max-width: 100%; }
  .pp-unpriced a:hover { background: var(--hover); }
  .pp-unpriced a::after { content: ""; position: absolute; inset: -6px 0; }
  .pp-totals { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: var(--space-1); }
  .pp-totals > div, .pp-totals > div:first-child:not(:last-child) { flex: 0 0 9rem; scroll-snap-align: start; margin-right: 0; padding: 0.25rem var(--space-1); }
  .pp-totals dd { font-size: 1rem; }
  .pp-totals dd.pp-split { font-size: 0.6875rem; line-height: 1.25; }
  .pp-totals dd.pp-addto { margin-top: 0.125rem; }
  .pp-none, .pp-paid { margin-top: 0; }
}

/* Finding 7: the Jobs cards at 375. The "Enter price" pill is a small outlined pill (24 px) and "Deduct" a muted underlined
   link (20 px), each with a 44 px hit area that stays inside the card's width: they took the card's 13 px negative margins
   and sat over the line above. "no job type" is as wide as its words, not the card. */
@media (width < 760px) {
  #grid-region[data-grid="admin_invoices"] .grid td.c-amount a.enter { position: relative; min-height: 0; height: 1.5rem; margin-block: 0; }
  #grid-region[data-grid="admin_invoices"] .grid td.c-amount a.enter::after { content: ""; position: absolute; inset: -10px 0; }
  #grid-region[data-grid="admin_invoices"] .grid td.c-deduction a.ded { position: relative; display: inline-flex; align-items: center; min-height: 0; height: 1.25rem; margin-block: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
  #grid-region[data-grid="admin_invoices"] .grid td.c-deduction a.ded::after { content: ""; position: absolute; inset: -12px 0; }
  #grid-region[data-grid="admin_invoices"] .wide.grid tbody tr > td.c-job_type.unknown { flex: 0 0 auto; max-width: 100%; }
}
/* The Download for Excel entry of the Settings menu is for the phone: the desk has the page head's button. */
@media (min-width: 760px) {
  .lbar .setting:has(> :is(a[data-excel=menu], a[data-jobs-view=menu])) { display: none; }
}

/* The Business overview V2 (9 Nov 2026): the range picker, the tiles, and the charts. A chart is SVG with its sizes in
   attributes (no style=); its series wear --cat-1.. in a fixed order, the rest a grey; a key in words beside it, and
   the table it draws one click away. A section's Chart and Table are two radio buttons read here with :has (no
   script; without :has both show), as are the sales lines' boxes. Gridlines are three hairlines, recessive. */
.bz-head { align-items: flex-start; }
.bz-pick { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.bz-pick details { position: relative; }
.bz-pick .lbtn { height: auto; min-height: 2.25rem; padding: 0.375rem 0.75rem; font-size: var(--fs-small); }
.bz-pick .lbtn .chev { width: 0.75rem; height: 0.75rem; transform: rotate(90deg); }
.bz-pick details[open] > .lbtn .chev { transform: rotate(-90deg); }
.bz-pl { font-weight: 600; color: var(--text); }
.bz-pd { color: var(--muted); font-weight: 400; }
.bz-pick .pop.bz-pop { width: auto; padding: 0.75rem; }
.bz-range .pop.bz-pop { display: grid; grid-template-columns: 11rem 15rem; gap: var(--space-3); }
.bz-pop ul { margin: 0; padding: 0; list-style: none; }
.bz-pop li a { display: block; padding: 0.375rem 0.5rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: var(--fs-small); white-space: nowrap; }
.bz-pop li a:hover, .bz-pop li a:focus-visible { background: var(--hover); }
.bz-pop li a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* The popup hangs from the button's right edge (the button sits at the head's right end); if the heading ever grows and
   the button wraps to the left, a right-hung popup would leave the left edge. */
@media (min-width: 760px) { .lbar.bz-pick .menu .pop.bz-pop { left: auto; right: 0; } }
.bz-lbl { margin: 0 0 var(--space-1); font-size: var(--fs-label); font-weight: 600; color: var(--muted); }
.bz-custom { display: grid; gap: var(--space-2); align-content: start; margin: 0; padding-left: var(--space-3); border-left: 1px solid var(--rule); }
.bz-custom label { display: grid; gap: 2px; font-size: var(--fs-small); }
.bz-custom input[type=date] { width: 100%; }
.bz-hint { margin: 0; font-size: var(--fs-label); }
.bz-now { margin: 0 0 var(--space-3); font-size: var(--fs-small); }
/* dl.stats (0,1,1) sets the shared 50rem cap and the auto-fit columns, so the tiles name it too: five in one row, the page's full width */
dl.stats.bz-tiles { max-width: none; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bz-tiles dd a { color: inherit; text-decoration: none; }
.bz-tiles dd a:hover, .bz-tiles dd a:focus-visible { text-decoration: underline; }
.bz-tiles dd.bz-chg { font-size: var(--fs-small); font-weight: 500; color: var(--text-2); }
.bz-tiles dd.bz-chg.up, [data-plain] td.up, .bz-wl .up { color: var(--up); }
.bz-tiles dd.bz-chg.down, [data-plain] td.down, .bz-wl .down { color: var(--down); }
.bz-card { padding: var(--space-3) 1.25rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg); margin: 0 0 var(--space-3); min-width: 0; }
.bz-card[id] { scroll-margin-top: var(--space-3); }
.bz-card > h2, .bz-card > h3 { margin-top: 0; }
.bz-cardhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
.bz-cardhead h2 { margin: 0; }
/* The Chart / Table switch (and the movers' status): one joined pill, unlike the step's or the cut's separate chips on
   the row below the head, so the view and the split never read as one control (9 Nov). */
.bz-view { display: inline-flex; gap: 0; margin: 0; padding: 2px; border: 1px solid var(--control); border-radius: 999px; background: var(--hover); min-inline-size: 0; }
.bz-view input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bz-view label { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 24px; padding: 0 0.75rem; border-radius: 999px; color: var(--muted); font-size: 0.75rem; cursor: pointer; }
.bz-view label svg { width: 0.875rem; height: 0.875rem; }
.bz-view input:checked + label { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--control); }
.bz-view input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.bz-card:has(.bz-view input[id$="-g"]:checked) .bz-t, .bz-card:has(.bz-view input[id$="-t"]:checked) .bz-g { display: none; }
.bz-sub { margin: 0 0 var(--space-2); font-size: var(--fs-small); }
nav.seg2.bz-by { align-items: center; margin: 0 0 var(--space-3); }
.bz-by .bz-lbl { margin: 0 0.25rem 0 0; }
.bz-cardhead h4 { margin: 0; }
.bz-movers { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--rule); }
.bz-movers:has(#mv-retained:checked) .bz-mv:not([data-status=retained]),
.bz-movers:has(#mv-new:checked) .bz-mv:not([data-status=new]),
.bz-movers:has(#mv-lapsed:checked) .bz-mv:not([data-status=lapsed]) { display: none; }
.bz-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-3) 2rem; align-items: center; }
.bz-split .bz-chart { margin: 0; }
.bz-split .bz-pie { justify-content: center; }
.bz-legend.bz-simple { flex: 0 1 auto; }
/* From 960 px the key's columns take their content's width (the longest name, 18 rem at most), figures right-aligned,
   so a row reads as one row; the legend is a grid its rows share (subgrid) */
@media (min-width: 960px) {
  .bz-legend:not(.bz-simple) { flex: 0 1 auto; grid-template-columns: auto minmax(0, max-content) auto auto; column-gap: var(--space-2); }
  .bz-legend:not(.bz-simple) .bz-bl { max-width: 18rem; }
  .bz-legend:not(.bz-simple) li { grid-template-columns: subgrid; grid-column: 1 / -1; }
}
.bz-legend.bz-simple li { grid-template-columns: auto minmax(0, 1fr); }
[data-plain] td .bz-chg { font-size: var(--fs-small); color: var(--text-2); white-space: nowrap; }
[data-plain] td .bz-chg.up { color: var(--up); }
[data-plain] td .bz-chg.down { color: var(--down); }
/* From 760 px the cells are table cells: the bracket gets one width, right-aligned, so the figures before it end at one x (a row with no change holds an empty bracket box). Below, the cells are phone cards. */
@media (min-width: 760px) {
  [data-plain] td .bz-chg { display: inline-block; min-width: 11ch; text-align: right; font-variant-numeric: tabular-nums; }
  [data-plain] td.num > a:has(+ .bz-chg) { justify-content: flex-end; } /* a short linked figure ends at the right of its link box, as a plain one does */
}
/* On a phone the Top 10 card is its two figures that carry a change side by side, then its three small facts in one row; the Dealer mix card is its three figures in one row. No cell sits alone in a half row (12 Nov 2026). */
@media (max-width: 759.98px) {
  .bz-card:is(#top, #segment) [data-plain] table.invoice-lines tbody tr { grid-template-columns: repeat(6, minmax(0, 1fr)); } /* the cards only: the hidden head row keeps the sheet's own columns */
  .bz-card#top [data-plain] table.invoice-lines td:is(.c-revenue, .c-invoices) { grid-column: span 3; order: 1; }
  .bz-card#top [data-plain] table.invoice-lines td:is(.c-kind, .c-group, .c-share) { grid-column: span 2; order: 2; }
  .bz-card#segment [data-plain] table.invoice-lines td:not(:first-child) { grid-column: span 2; }
}
.bz-chart { margin: 0 0 var(--space-3); }
.bz-chart .now { fill: var(--cat-1); }
.bz-series { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-2); padding: 0; border: 0; font-size: var(--fs-small); color: var(--text-2); }
.bz-ser { display: inline-flex; align-items: center; gap: 0.375rem; cursor: pointer; }
.bz-ser .muted { font-size: var(--fs-soft); }
.bz-sw { display: inline-block; flex: none; width: 0.75rem; height: 0.75rem; border-radius: 2px; background: var(--faint); }
.bz-sw.l-revenue, .bz-sw.s1 { background: var(--cat-1); }
.bz-sw.l-invoices, .bz-sw.s2 { background: var(--cat-2); }
.bz-sw.l-customers, .bz-sw.s3 { background: var(--cat-3); }
.bz-sw.l-dealer, .bz-sw.s4 { background: var(--cat-4); }
.bz-sw.s5 { background: var(--cat-5); }
.bz-sw.s6 { background: var(--cat-6); }
.bz-plot { position: relative; margin-top: 1.25rem; } /* the room a figure printed above the line's top step takes */
.bz-plot svg { display: block; width: 100%; height: 14rem; overflow: visible; }
/* the figures on the lines: a second box over the plot with no viewBox, so its text keeps its shape (percent positions) */
.bz-plot svg.bz-lb { position: absolute; top: 0; left: 0; pointer-events: none; }
.bz-lb text { fill: var(--text); font-size: var(--fs-soft); font-variant-numeric: tabular-nums; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; paint-order: stroke; }
.bz-plot .grid line { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bz-plot .grid line.base { stroke: var(--control); }
.bz-plot .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bz-plot .ln polyline { vector-effect: non-scaling-stroke; }
.bz-plot .ln line { stroke-width: 7; vector-effect: non-scaling-stroke; } /* a zero-length round cap: a dot that keeps its shape when the box stretches */
.bz-plot .l-revenue { stroke: var(--cat-1); }
.bz-plot .l-invoices { stroke: var(--cat-2); }
.bz-plot .l-customers { stroke: var(--cat-3); }
.bz-plot .l-dealer { stroke: var(--cat-4); }
.bz-plot .hit { fill: var(--text); fill-opacity: 0; }
.bz-plot .hit:hover { fill-opacity: 0.06; }
.bz-lines:has(#ln-revenue:not(:checked)) .ln.l-revenue, .bz-lines:has(#ln-invoices:not(:checked)) .ln.l-invoices,
.bz-lines:has(#ln-customers:not(:checked)) .ln.l-customers, .bz-lines:has(#ln-dealer:not(:checked)) .ln.l-dealer,
.bz-lines:has(#ln-revenue:not(:checked)) .lb.l-revenue, .bz-lines:has(#ln-invoices:not(:checked)) .lb.l-invoices,
.bz-lines:has(#ln-customers:not(:checked)) .lb.l-customers, .bz-lines:has(#ln-dealer:not(:checked)) .lb.l-dealer { display: none; }
/* the printed figures are placed against their own line only, so they show while one line is drawn */
.bz-lines:has(#ln-revenue:checked):has(#ln-invoices:checked) .lb, .bz-lines:has(#ln-revenue:checked):has(#ln-customers:checked) .lb,
.bz-lines:has(#ln-revenue:checked):has(#ln-dealer:checked) .lb, .bz-lines:has(#ln-invoices:checked):has(#ln-customers:checked) .lb,
.bz-lines:has(#ln-invoices:checked):has(#ln-dealer:checked) .lb, .bz-lines:has(#ln-customers:checked):has(#ln-dealer:checked) .lb { display: none; }
.bz-xt { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.bz-tick { display: block; padding-top: var(--space-1); font-size: var(--fs-soft); color: var(--muted); text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.bz-tick small { display: block; font-size: inherit; }
.bz-tick small.narrow { display: none; }
/* A step the range cuts short names its months on a line of its own: the tick may spill, centred, and the first and last
   flush to the plot's edge so the words spill inward (a flex line spills away from its aligned edge) */
.bz-tick.bz-cuttick { overflow: visible; }
.bz-tick small.bz-cut { display: flex; justify-content: center; }
.bz-tick:first-child small.bz-cut { justify-content: flex-start; }
.bz-tick:last-child small.bz-cut { justify-content: flex-end; }
.bz-pie { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) 2rem; }
.bz-pie svg { display: block; flex: none; width: min(100%, 15rem); height: auto; aspect-ratio: 1; }
.bz-pie polygon, .bz-pie circle { fill: var(--faint); stroke: var(--bg); stroke-width: 1; stroke-linejoin: round; } /* about 2 px of surface between slices at the pie's size */
.bz-pie .s1 { fill: var(--cat-1); }
.bz-pie .s2 { fill: var(--cat-2); }
.bz-pie .s3 { fill: var(--cat-3); }
.bz-pie .s4 { fill: var(--cat-4); }
.bz-pie .s5 { fill: var(--cat-5); }
.bz-pie .s6 { fill: var(--cat-6); }
.bz-legend { flex: 1 1 16rem; display: grid; gap: var(--space-1); max-width: 32rem; margin: 0; padding: 0; list-style: none; font-size: var(--fs-small); }
.bz-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2); }
.bz-pie > p { flex-basis: 100%; margin: 0; } /* the key's note (a row below 0): its own row under the pie and its key */
.bz-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bz-bv { min-width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.bz-trend { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2); }
.bz-axis { display: flex; flex-direction: column; justify-content: space-between; height: 12rem; font-size: var(--fs-soft); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.bz-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none;
  background: linear-gradient(var(--rule), var(--rule)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--rule), var(--rule)) 0 6rem / 100% 1px no-repeat, linear-gradient(var(--control), var(--control)) 0 12rem / 100% 1px no-repeat; }
.bz-cols li { display: flex; flex-direction: column; min-width: 0; }
.bz-cols .bz-bar { display: block; height: 12rem; }
.bz-cols svg { display: block; width: 100%; height: 100%; }
.bz-walk .total { fill: var(--cat-1); }
.bz-walk .up { fill: var(--up); }
.bz-walk .down { fill: var(--down); }
.bz-wl { display: grid; gap: 1px; padding-top: var(--space-1); font-size: var(--fs-soft); text-align: center; font-variant-numeric: tabular-nums; line-height: 1.25; }
.bz-wl b { font-weight: 600; color: var(--text); }
.bz-wl small { font-size: inherit; color: var(--muted); }
.bz-wl .narrow { display: none; }
.bz-phone { display: none; } /* a phone's one line under the bridge: what its figures and small numbers are */
.bz-more > summary { cursor: pointer; font-size: var(--fs-small); color: var(--accent); }
#glossary > summary { cursor: pointer; list-style-position: outside; }
#glossary > summary h2 { display: inline; margin: 0; }
@media (max-width: 599.98px) {
  .bz-pick .pop.bz-pop { width: min(92vw, 24rem); } /* the site's phone sheet (fixed, centred) places it */
  .bz-range .pop.bz-pop { grid-template-columns: 1fr; }
  .bz-pick .lbtn { min-height: 2.75rem; }
  .bz-quick ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-1); }
  .bz-quick li a { display: flex; align-items: center; min-height: 2.75rem; }
  .bz-custom { padding: var(--space-3) 0 0; border-left: 0; border-top: 1px solid var(--rule); }
  .bz-pd { display: none; }
  dl.stats.bz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.stats.bz-tiles > div:last-child:nth-child(odd) { grid-column: 1 / -1; } /* a fifth tile alone in its row spans both */
  .bz-plot svg { height: 10rem; }
  .bz-axis, .bz-cols .bz-bar { height: 9rem; }
  .bz-cols { background-position: 0 0, 0 4.5rem, 0 9rem; }
  .bz-view label { min-height: 44px; min-width: 44px; justify-content: center; }
  .bz-split { grid-template-columns: 1fr; }
  .bz-tick { overflow: visible; margin: 0 -1rem; } /* every other step is named, so a name may spill into its neighbour's room */
  .bz-tick:not(.narrow) { visibility: hidden; }
  .bz-tick small.wide { display: none; }
  .bz-tick small.narrow { display: block; }
  .bz-tick:first-child small.bz-cut { padding-left: 1rem; } /* the tick's -1rem margin reaches past the plot: the words start at the plot */
  .bz-tick:last-child small.bz-cut { padding-right: 1rem; }
  .bz-pie svg { margin: 0 auto; }
  .bz-g .bz-pie svg { width: min(100%, 11rem); }
  .bz-phone { display: block; }
  .bz-more > summary { min-height: 0; padding-block: 0.8125rem; } /* 44 px with its words in the middle, not at the top of a taller box */
  .bz-wl { font-size: 0.6875rem; }
  .bz-wl .wide { display: none; }
  .bz-wl .narrow { display: inline; }
  .bz-series { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-2); }
  .bz-ser { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 0.375rem; align-content: center; min-height: 2.75rem; } /* a phone: each line's range goes under its label; beside it, both wrapped */
  .bz-ser .muted { grid-column: 1 / -1; } /* the whole row, so an eight-digit top fits at 320 px; a longer one wraps inside its column, never over the next */
}
@media (forced-colors: active) {
  .bz-chart .now, .bz-walk rect, .bz-pie polygon, .bz-pie circle { fill: Highlight; }
  .bz-plot .ln { stroke: CanvasText; }
  .bz-view input:checked + label { outline: 2px solid Highlight; }
}

/* --- The month line's "+ Add" on a touch screen (the Jobs page; moved here unchanged, 12 Nov 2026): the 44 px is a hit
   area past the link, not a band of the tile. It stands after the sheet's last `(max-width: 759.98px)` block because
   `tests/test_look.py` (S-1) holds that a touch block follows that one. The employees' own page block did so by
   chance, until that page became the Jobs page (Charlie, 12 Nov). Its other rules stand with the month line's. */
@media (pointer: coarse) {
  .pp-add { position: relative; min-height: 0; }
  .pp-add::after { content: ""; position: absolute; inset: -10px 0; }
}

/* Look 4 (7 Nov 2026), the analytics pages' layout, spacing, weight and shape: no colour, no script. Every rule is scoped to
   the ordering pages (`.an-top`, the eyebrow over the page's blocks, `#grid-region[data-ordering]`, the panels they hold) or
   to the box's own parts, so Lines, Items, Customers, Invoices and the shared banner, bar and header rules are as they were. */
/* A3: one gap between the page's blocks, as Business has it: the as-of line, the answer panel, the tiles, the banners, the strip, the tools and the table */
.an-top ~ :is(.banner, dl.stats, .panel, #grid-region) { margin-top: 0; margin-bottom: var(--space-3); }
.an-top ~ dl.stats:has(> [data-stat]) { margin-bottom: var(--space-3); }
/* A4: the two answer tiles share a baseline: the figure sits at the tile's bottom, whatever the label's lines */
dl.stats > :is([data-stat="order-by"], [data-stat="arrives"]) { display: flex; flex-direction: column; }
dl.stats > :is([data-stat="order-by"], [data-stat="arrives"]) dt { margin-bottom: 0.125rem; }
dl.stats > :is([data-stat="order-by"], [data-stat="arrives"]) dd { margin-top: auto; }
/* A5: a card's three shown figures (Stock, On order, Demand / mo) in one row, each value at 600 weight, the labels as they were (14 px, muted).
   Below 360 px the three cannot hold their labels whole, so there they keep the two-column grid. */
@media (min-width: 360px) and (max-width: 759.98px) {
  #grid-region[data-ordering] .wide.grid tbody tr > :is(.c-stock, .c-on_order, .c-demand) { flex: 1 1 0; min-width: 0; }
}
@media not all and (min-width: 760px) {
  #grid-region[data-ordering] .wide.grid tbody tr > :is(.c-stock, .c-on_order, .c-demand) { font-weight: var(--fw-strong); }
}
/* A8: figures do not butt against the pinned next-order column at the desk: the cell before it keeps a little room */
@media (min-width: 760px) {
  #grid-region[data-ordering] .lines-grid.grid td:has(+ .c-next) { padding-right: calc(var(--cell-x) + var(--space-2)); }
}
/* A10: a link or a summary inside a banner keeps its 44 px target without stretching its line: an inline link's padding, an inline-block summary's padding and an equal negative margin, neither one in the line box */
@media not all and (min-width: 760px), (pointer: coarse) {
  .an-top ~ .banner a.go { display: inline; min-height: 0; padding-block: 0.875rem; }
  .an-top ~ .banner.empties .banner-sizes > summary { min-height: 0; padding-block: 0.8125rem; margin-block: -0.8125rem; }
}
/* A12: Past orders and Still assumed are rows in their panel, as Business sets its sections: a hairline between them, no box and no second radius inside the panel */
.an-top ~ .panel.orders > details.placed { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: none; }
.an-top ~ .panel.orders > details.placed:last-child { border-bottom: 1px solid var(--rule); }
.an-top ~ .panel.orders > details.placed[open] { padding-bottom: var(--space-2); }
.an-top ~ .panel.assumed li .banner-sizes { padding: 0; border: 0; border-radius: 0; background: none; }

/* --- The worker-location page (12 Nov 2026; a first look with made-up positions): the notice, a sketch map in SVG
   (sizes in attributes, colours here from the existing tokens), then one list item per worker or timeline leg. Lists,
   no table. The map sits above the list at every width; from 960 px it stops at 40rem and a worker's four facts
   stand in one line. */
.lo-notice { margin: 0 0 var(--space-3); }
.lo-now { margin: 0 0 var(--space-2); }
.lo-h { margin: var(--space-3) 0 var(--space-1); font-size: var(--fs-h2); }
.lo-back { margin: 0 0 var(--space-2); }
.lo-back a, .lo-link, .lo-pick a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.lo-pick ul { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-2); padding: 0; list-style: none; }
.lo-pick a { padding: 0 var(--space-3); border: 1px solid var(--control); border-radius: var(--radius-pill); color: var(--text-2); text-decoration: none; }
.lo-pick a.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-strong); }
.lo-map { margin: 0 0 var(--space-3); }
.lo-map svg { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); }
.lo-map figcaption { margin-top: var(--space-1); font-size: var(--fs-small); }
.lo-grid { stroke: var(--rule); stroke-width: 0.3; }
.lo-place rect { fill: none; stroke: var(--muted); stroke-width: 0.6; }
.lo-place text { fill: var(--muted); font-size: 3px; font-family: var(--font); }
.lo-pin circle { fill: var(--accent-fill); stroke: var(--bg); stroke-width: 0.6; }
.lo-pin text { fill: var(--on-accent); font-size: 4px; font-weight: var(--fw-strong); font-family: var(--font); }
.lo-pin.stale circle { fill: var(--muted); }
.lo-pin.stale circle.ring { fill: none; stroke: var(--muted); stroke-width: 0.6; stroke-dasharray: 1.6 1.2; }
.lo-pin.stale text { fill: var(--bg); }
.lo-pin.stale text.age { fill: var(--text); font-size: 3px; font-weight: var(--fw-body); }
.lo-trail { stroke: var(--accent); stroke-width: 0.8; stroke-dasharray: 2 1.2; stroke-linejoin: round; }
.lo-stop circle { fill: var(--accent-fill); stroke: var(--bg); stroke-width: 0.6; }
.lo-stop text { fill: var(--on-accent); font-size: 3.6px; font-weight: var(--fw-strong); font-family: var(--font); }
.lo-rows, .lo-legs { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.lo-row { padding: var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); }
.lo-who { margin: 0 0 var(--space-2); font-size: var(--fs-body); }
.lo-row dl { display: grid; gap: var(--space-1); margin: 0; }
.lo-row dl div { display: flex; gap: var(--space-2); }
.lo-row dt { flex: 0 0 8rem; color: var(--muted); font-size: var(--fs-small); }
.lo-row dd { margin: 0; overflow-wrap: anywhere; }
.lo-status { font-weight: var(--fw-strong); }
.lo-row.stale .lo-status { color: var(--muted); }
.lo-legs li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); }
.lo-legs li.move { background: var(--canvas); }
.lo-time { grid-column: 1 / -1; color: var(--muted); font-size: var(--fs-small); }
.lo-n { display: inline-block; min-width: 1.5rem; padding: 0 0.25rem; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); text-align: center; }
@media (min-width: 960px) {
  .lo-map { max-width: 40rem; }
  .lo-row dl { grid-template-columns: repeat(4, 1fr); }
  .lo-row dl div { flex-direction: column; gap: 0; }
  .lo-row dt { flex: none; }
}
/* --- "New version" (the way to the new app while both run): a link in the account strip, drawn as its buttons are; the
   words stay as the name and the tooltip when the rail is narrowed. */
.acts a.swap-app { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 1.75rem; padding: 0 0.5rem; color: var(--on-chrome); background: transparent; border: 1px solid var(--control); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: var(--fw-medium); white-space: nowrap; text-decoration: none; }
.acts a.swap-app:hover { box-shadow: inset 0 0 0 100vmax var(--press); }
.narrow .side .acts a.swap-app { justify-content: center; width: 2rem; min-height: 2rem; padding: 0; }
.acct-panel a.swap-app { flex: 1 1 100%; min-height: 2.75rem; justify-content: center; }
@media (pointer: coarse) { .acts a.swap-app { min-height: 44px; min-width: 44px; } }
