/* =============================================================================
   WheelShop design system: "Sleek" (docs/research/10-sleek-look.md, D-87)
   A calm, precise operations tool: closer to Linear, Stripe or Vercel than to
   iOS Settings or a dealer management system. Replaces Floor Ticket (07).
   Tokens, then base, then the shell, then components. Plain CSS, no build.

   The system in nine lines:
   1  Type: Instrument Sans for all UI text, sentence case; large titles are
      semibold with slightly tight tracking. Geist Mono for job numbers, wheel
      tags, timers, times and counts (tabular by nature). No all-caps headings;
      tiny mono labels only for table heads. Never the system / SF stack.
   2  Surfaces: a warm off-white page, white panels, 1 px hairlines and a very
      soft shadow, 10-12 px radii. Dark: #0C0D0F page, #151619 panels. No
      textures, grids or noise.
   3  One brand token (--brand, white label: settings.brandColor, ui/brand.js)
      drives primary buttons, the active nav item, focus rings, progress and
      selected states. Tints come from color-mix(); readable on-brand text and
      brand-as-text colours are worked out in ui/brand.js.
   4  Navigation: an ink sidebar (both themes) with a 2 px brand bar on the
      current item; a light bottom bar on phones; the employee top bar holds a
      segmented My work | Station switch with a sliding brand thumb.
   5  Buttons: primary = brand fill; secondary = white with a hairline; quiet =
      text only; destructive = red. Floor buttons stay 64-72 px.
   6  Status: soft tinted chips with an icon (or a dot) and a word: green
      running, amber waiting / at risk, red down / problem, grey idle. Safety
      and machine-down get a solid red left edge and a light red tint. Never
      colour alone.
   7  Lists are rows with hairlines inside ONE container (09-declutter). Job
      numbers are Geist Mono medium. Placeholder marks: a grey dot + "est.".
   8  Timers: big mono digits, the phase word and a thin progress bar in brand
      colour; amber once ended (ready), red when overdue.
   9  Motion 150-200 ms ease-out; route change = fade + 6 px rise; Reduce Motion
      fades only. WCAG AA text, visible focus rings, 44 px targets, safe areas.
   Legacy token names (--label, --bg-card, --accent, --paper ...) stay as
   aliases so every stylesheet and the inline tints in the views keep working.
   ============================================================================= */

/* ----- 1. Tokens: colour (light) ------------------------------------------- */
:root {
  color-scheme: light;

  /* brand (white label). ui/brand.js overrides --brand, --on-brand, --brand-ink-l/-d */
  --brand: #2F5BFF;
  --on-brand: #FFFFFF;
  --brand-ink: var(--brand-ink-l, #2F5BFF);        /* brand as text on panels, AA */
  --brand-soft: color-mix(in srgb, var(--brand) 9%, var(--panel));
  --brand-soft-2: color-mix(in srgb, var(--brand) 16%, var(--panel));
  --brand-line: color-mix(in srgb, var(--brand) 38%, var(--panel));
  --brand-press: color-mix(in srgb, var(--brand) 84%, #000);
  --focus: var(--brand-ink);

  /* surfaces */
  --page: #F7F7F5;
  --panel: #FFFFFF;
  --panel-2: #F4F4F1;            /* wells, table heads */
  --panel-3: #ECECE8;            /* pressed */
  --line: #E7E6E2;               /* hairline */
  --line-strong: #D5D4CF;
  --text: #111214;
  --text-2: #55575D;             /* 7.3:1 on white */
  --text-3: #6C6E74;             /* 5.2:1 on white, 4.9:1 on the page */
  --text-4: #A3A5AA;             /* decorative only */

  /* the ink sidebar (same in both themes) */
  --rail: #111214;
  --rail-2: #1C1D21;
  --rail-line: #24262B;
  --on-rail: #F4F4F5;
  --on-rail-2: #A1A3A9;          /* 7.4:1 on the rail */

  /* status: fill, text (AA on panel), soft tint */
  --green: #16A34A;  --green-ax: #157A3B;
  --amber: #D97706;  --amber-ax: #A34E05;
  --red: #DC2626;    --red-ax: #B4181B;  --red-fill: #D42A23;
  --blue: #2563EB;   --blue-ax: #1D4FCC;
  --cyan: #0E8A9A;   --cyan-ax: #0B6672;
  --violet: #7C3AED;
  --gray: #8A8C92; --gray2: #A3A5AA; --gray3: #C2C3C7; --gray4: #D9D9DC; --gray5: #E7E7E9; --gray6: #F1F1F2;
  --orange: var(--amber);  --orange-ax: var(--amber-ax);
  --yellow: #EAB308;       --yellow-ax: #8A6100;

  /* shadows: hairline-soft, never heavy */
  --shadow-1: 0 1px 2px rgb(17 18 20 / .04), 0 1px 1px rgb(17 18 20 / .02);
  --shadow-2: 0 2px 8px rgb(17 18 20 / .05), 0 1px 2px rgb(17 18 20 / .04);
  --shadow-pop: 0 18px 48px rgb(17 18 20 / .16), 0 3px 10px rgb(17 18 20 / .07);

  /* semantic aliases (legacy names, Sleek values) */
  --accent: var(--brand);         --accent-text: var(--brand-ink); --accent-strong: var(--brand);
  --success: var(--green);        --success-text: var(--green-ax);
  --warning: var(--amber);        --warning-text: var(--amber-ax);
  --critical: var(--red);         --critical-text: var(--red-ax);  --critical-strong: var(--red-fill);
  --info: var(--blue);            --info-text: var(--blue-ax);
  --caution: var(--amber);        --caution-text: var(--amber-ax);
  --success-soft: color-mix(in srgb, var(--green) 10%, var(--panel));
  --warning-soft: color-mix(in srgb, var(--amber) 11%, var(--panel));
  --critical-soft: color-mix(in srgb, var(--red) 8%, var(--panel));
  --info-soft: color-mix(in srgb, var(--blue) 8%, var(--panel));

  --bg: var(--panel);
  --bg-grouped: var(--page);
  --bg-card: var(--panel);
  --bg-card-2: var(--panel-2);
  --bg-elevated: var(--panel);
  --bg-sidebar: var(--rail);
  --ground: var(--page);
  --paper: var(--panel); --paper-2: var(--panel-2); --paper-3: var(--panel-3);
  --ink: var(--text); --ink-2: var(--text-2); --ink-3: var(--text-3);
  --edge: var(--line-strong); --rule: var(--line); --rule-strong: var(--line-strong);
  --btn-edge: var(--line-strong); --btn-quiet: var(--line-strong); --band: var(--panel-2);
  --graphite: var(--rail); --graphite-2: var(--rail-2); --graphite-edge: var(--rail-line);
  --on-graphite: var(--on-rail); --on-graphite-2: var(--on-rail-2);
  --safety: var(--brand); --on-safety: var(--on-brand); --safety-press: var(--brand-press);

  --label: var(--text);
  --label-2: var(--text-2);
  --label-3: var(--text-3);
  --label-4: var(--text-4);
  --separator: var(--line);
  --separator-opaque: var(--line);
  --fill: #E4E4E1;
  --fill-2: rgb(17 18 20 / .09);
  --fill-3: rgb(17 18 20 / .055);
  --fill-4: rgb(17 18 20 / .03);
  --press: rgb(17 18 20 / .05);
  --hover: rgb(17 18 20 / .028);
  --seg-thumb: var(--text);
  --on-accent: var(--on-brand);

  --hairline: inset 0 -1px 0 var(--line);
  --shadow-sheet: var(--shadow-pop);
  --shadow-float: var(--shadow-2);
  --avatar-bg: #E9E9E6;
  --avatar-ink: #3B3D42;

  /* stage ticks: small marks only, always beside the stage name */
  --stage-checkin: var(--gray);
  --stage-strip: #9A6B47;
  --stage-repair: #5462C6;
  --stage-paint: #B347A8;
  --stage-machine: #1D8C9C;
  --stage-qc: #188A6F;
  --stage-ready: var(--green);
}

/* ----- dark (system, unless the page forces light) ------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand-ink: var(--brand-ink-d, #5075FF);
    --brand-soft: color-mix(in srgb, var(--brand) 16%, var(--panel));
    --brand-soft-2: color-mix(in srgb, var(--brand) 26%, var(--panel));
    --brand-line: color-mix(in srgb, var(--brand) 50%, var(--panel));
    --brand-press: color-mix(in srgb, var(--brand) 82%, #fff);
    --page: #0C0D0F; --panel: #151619; --panel-2: #1B1C20; --panel-3: #222328;
    --line: #25272B; --line-strong: #33363B;
    --text: #EDEDEF; --text-2: #A6A8AE; --text-3: #8D9096; --text-4: #5C5F65;
    --rail: #111214; --rail-2: #1C1D21; --rail-line: #222428;
    --green: #3FB862; --green-ax: #5BD07D;
    --amber: #E99A2C; --amber-ax: #F2B154;
    --red: #EF4444; --red-ax: #FF7A73; --red-fill: #D93630;
    --blue: #5B8DEF; --blue-ax: #8AB0FF;
    --cyan: #3BB3C2; --cyan-ax: #6CCBD7;
    --gray: #7E8187; --gray2: #5F6268; --gray3: #46494E; --gray4: #36383D; --gray5: #2A2C30; --gray6: #1F2024;
    --yellow: #EAB308; --yellow-ax: #F2C94C;
    --success-soft: color-mix(in srgb, var(--green) 14%, var(--panel));
    --warning-soft: color-mix(in srgb, var(--amber) 14%, var(--panel));
    --critical-soft: color-mix(in srgb, var(--red) 14%, var(--panel));
    --info-soft: color-mix(in srgb, var(--blue) 14%, var(--panel));
    --fill: #2A2C31; --fill-2: rgb(237 237 239 / .12); --fill-3: rgb(237 237 239 / .07); --fill-4: rgb(237 237 239 / .04);
    --press: rgb(237 237 239 / .07); --hover: rgb(237 237 239 / .035);
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-2: 0 2px 10px rgb(0 0 0 / .35), 0 1px 2px rgb(0 0 0 / .3);
    --shadow-pop: 0 20px 56px rgb(0 0 0 / .55), 0 0 0 1px #2A2C31;
    --avatar-bg: #2A2C31; --avatar-ink: #D6D7DA;
    --stage-strip: #C08E68; --stage-repair: #8590E8; --stage-paint: #D677CD; --stage-machine: #45B8C7; --stage-qc: #46C4A2;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-ink: var(--brand-ink-d, #5075FF);
  --brand-soft: color-mix(in srgb, var(--brand) 16%, var(--panel));
  --brand-soft-2: color-mix(in srgb, var(--brand) 26%, var(--panel));
  --brand-line: color-mix(in srgb, var(--brand) 50%, var(--panel));
  --brand-press: color-mix(in srgb, var(--brand) 82%, #fff);
  --page: #0C0D0F; --panel: #151619; --panel-2: #1B1C20; --panel-3: #222328;
  --line: #25272B; --line-strong: #33363B;
  --text: #EDEDEF; --text-2: #A6A8AE; --text-3: #8D9096; --text-4: #5C5F65;
  --rail: #111214; --rail-2: #1C1D21; --rail-line: #222428;
  --green: #3FB862; --green-ax: #5BD07D;
  --amber: #E99A2C; --amber-ax: #F2B154;
  --red: #EF4444; --red-ax: #FF7A73; --red-fill: #D93630;
  --blue: #5B8DEF; --blue-ax: #8AB0FF;
  --cyan: #3BB3C2; --cyan-ax: #6CCBD7;
  --gray: #7E8187; --gray2: #5F6268; --gray3: #46494E; --gray4: #36383D; --gray5: #2A2C30; --gray6: #1F2024;
  --yellow: #EAB308; --yellow-ax: #F2C94C;
  --success-soft: color-mix(in srgb, var(--green) 14%, var(--panel));
  --warning-soft: color-mix(in srgb, var(--amber) 14%, var(--panel));
  --critical-soft: color-mix(in srgb, var(--red) 14%, var(--panel));
  --info-soft: color-mix(in srgb, var(--blue) 14%, var(--panel));
  --fill: #2A2C31; --fill-2: rgb(237 237 239 / .12); --fill-3: rgb(237 237 239 / .07); --fill-4: rgb(237 237 239 / .04);
  --press: rgb(237 237 239 / .07); --hover: rgb(237 237 239 / .035);
  --shadow-1: 0 1px 2px rgb(0 0 0 / .3);
  --shadow-2: 0 2px 10px rgb(0 0 0 / .35), 0 1px 2px rgb(0 0 0 / .3);
  --shadow-pop: 0 20px 56px rgb(0 0 0 / .55), 0 0 0 1px #2A2C31;
  --avatar-bg: #2A2C31; --avatar-ink: #D6D7DA;
  --stage-strip: #C08E68; --stage-repair: #8590E8; --stage-paint: #D677CD; --stage-machine: #45B8C7; --stage-qc: #46C4A2;
}

/* ----- Increased contrast: stronger secondary text and hairlines ----------- */
@media (prefers-contrast: more) {
  :root { --text-2: #3A3C41; --text-3: #4A4C51; --line: #B9B8B3; --line-strong: #8E8D88; --on-rail-2: #D4D5D8; }
  :root[data-theme="dark"] { --text-2: #CFD0D4; --text-3: #B8BABF; --line: #4A4D53; --line-strong: #63666C; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --text-2: #CFD0D4; --text-3: #B8BABF; --line: #4A4D53; --line-strong: #63666C; }
}

/* ----- 1b. Tokens: type, space, shape, motion ------------------------------ */
/* Sizes in rem of a 17 px body. Each chrome scales them: floor x1.235 (body 21 px), wall TV x1.706. */
:root, [data-chrome] {
  --scale: 1;
  --t-large: calc(2rem * var(--scale));        /* 34   screen titles */
  --t-title1: calc(1.647rem * var(--scale));   /* 28   KPI numbers */
  --t-title2: calc(1.294rem * var(--scale));   /* 22   card titles */
  --t-title3: calc(1.176rem * var(--scale));   /* 20   floor task name */
  --t-headline: calc(1rem * var(--scale));     /* 17   row titles */
  --t-body: calc(1rem * var(--scale));         /* 17   default */
  --t-callout: calc(.941rem * var(--scale));   /* 16   toolbar buttons */
  --t-subhead: calc(.882rem * var(--scale));   /* 15   row secondary */
  --t-footnote: calc(.765rem * var(--scale));  /* 13   headers, times */
  --t-caption1: calc(.706rem * var(--scale));  /* 12   tags, badges */
  --t-caption2: calc(.647rem * var(--scale));  /* 11   tab labels only */
}
[data-chrome="floor"] { --scale: 1.235; --row-min: 64px; }
[data-chrome="kiosk"] { --scale: 1.706; }
@media (min-width: 2400px) { [data-chrome="kiosk"] { --scale: 2.2; } }

:root {
  --font: "Instrument Sans", "Arial", "Liberation Sans", sans-serif;
  --font-display: var(--font);   /* legacy name: titles are Instrument Sans semibold now */
  --font-mono: "Geist Mono", "Cascadia Mono", "Consolas", "Liberation Mono", monospace;
  --font-rounded: var(--font);   /* legacy name */
  --cond: 100%;                  /* legacy: no condensed labels */
  --track-title: -.022em;        /* large titles */
  --track-head: -.012em;         /* card and section titles */

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 44px; --sp-9: 64px;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --tap: 44px;
  --row-min: 44px;
  --stripe-w: 3px;

  --r-group: 12px; --r-tile: 12px; --r-sheet: 16px; --r-control: 10px; --r-chip: 8px; --r-tag: 6px; --r-capsule: 10px;

  --navbar-h: 56px;
  --tabbar-h: 60px;
  --tabbar-space: 0px;          /* set on compact shells */
  --sidebar-w: 248px;

  /* motion: 150-200 ms ease-out, no bounce */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-ui: 160ms;
  --dur-press: 90ms;
  --dur-spring: 200ms;
  --spring: cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 768px) { :root { --gutter: max(24px, env(safe-area-inset-left), env(safe-area-inset-right)); } }
@media (min-width: 1200px) { :root { --gutter: max(32px, env(safe-area-inset-left), env(safe-area-inset-right)); } }
@media (min-width: 768px) and (max-width: 1023.98px) { :root { --sidebar-w: 220px; } }

/* ----- 2. Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* On iOS the root size follows the user's text size (Dynamic Type); the family is ours. */
html {
  font: -apple-system-body;
  font-family: var(--font);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
@supports not (-webkit-touch-callout: none) { html { font-size: 106.25%; } }

body {
  margin: 0; min-height: 100dvh;
  background: var(--page); color: var(--text);
  font-family: var(--font); font-size: var(--t-body); line-height: 1.4; letter-spacing: 0;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
a { color: var(--brand-ink); text-decoration: none; }
img, svg { display: block; }
.ico { flex: none; }
.ico .f { fill: currentColor; stroke: none; }
.ico .knock { stroke: var(--bg-card); }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus { outline: none; }
/* one ring everywhere: brand, with a panel-coloured gap so it shows on any surface */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-control); }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.mono, .num.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: -.01em; }

/* type utilities */
.t-large { font-size: calc(var(--t-large) * .94); line-height: 1.1; font-weight: 600; letter-spacing: var(--track-title); }
.t-title1 { font-size: var(--t-title1); line-height: 1.15; font-weight: 600; letter-spacing: var(--track-title); }
.t-title2 { font-size: var(--t-title2); line-height: 1.25; font-weight: 600; letter-spacing: var(--track-head); }
.t-title3 { font-size: var(--t-title3); line-height: 1.3; font-weight: 600; letter-spacing: var(--track-head); }
.t-headline { font-size: var(--t-headline); line-height: 1.35; font-weight: 600; }
.t-body { font-size: var(--t-body); line-height: 1.4; }
.t-callout { font-size: var(--t-callout); line-height: 1.35; }
.t-subhead { font-size: var(--t-subhead); line-height: 1.4; }
.t-footnote { font-size: var(--t-footnote); line-height: 1.4; }
.t-caption1 { font-size: var(--t-caption1); line-height: 1.35; font-weight: 500; }
.t-caption2 { font-size: var(--t-caption2); line-height: 1.25; }
.c-2 { color: var(--text-2); } .c-3 { color: var(--text-3); }
.c-accent { color: var(--brand-ink); } .c-critical { color: var(--critical-text); } .c-warning { color: var(--warning-text); } .c-success { color: var(--success-text); }

/* ----- 3. Shell ------------------------------------------------------------- */
/* .shell[data-chrome="app" | "floor" | "kiosk" | "bare"] fills the window below the test bar (--td-h). */
.shell {
  position: fixed; inset: var(--td-h, 0px) 0 0 0;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  background: var(--page);
}
.shell[data-chrome="app"] { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); transition: grid-template-columns var(--dur-spring) var(--spring); }
.shell[data-chrome="app"][data-sidebar="collapsed"] { grid-template-columns: 0 minmax(0, 1fr); }

.main {
  position: relative; min-width: 0; height: 100%;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
  scroll-padding-top: var(--navbar-h);
  outline: none;
  background: var(--page);
}
.col { width: 100%; max-width: var(--col-max, 1180px); margin-inline: auto; }
.main[data-width="readable"] { --col-max: 780px; }
.main[data-width="full"] { --col-max: none; }

/* top bar: the page colour, quiet; a hairline appears once the page scrolls under it.
   The page title lives in the header below it; the bar shows it only on pages without one (.inline). */
.navbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px;
  min-height: var(--navbar-h); padding: env(safe-area-inset-top) calc(var(--gutter) - 8px) 0;
  background: var(--page); color: var(--text);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow var(--dur-ui) var(--ease);
}
.navbar.scrolled-any { box-shadow: 0 1px 0 var(--line); }
.navbar-lead, .navbar-trail { display: flex; align-items: center; gap: 4px; min-width: 0; }
.navbar-trail { justify-content: flex-end; }
.navbar-title {
  font-size: var(--t-headline); font-weight: 600; letter-spacing: var(--track-head);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; visibility: hidden;
}
.navbar.inline .navbar-title, .navbar.scrolled .navbar-title { max-width: 50vw; visibility: visible; }
.navbar-back {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); padding: 0 10px 0 4px; border: 0; background: none;
  color: var(--text-2); font-size: var(--t-subhead); font-weight: 500;
  cursor: pointer; border-radius: var(--r-control); max-width: 100%;
  transition: color var(--dur-ui) var(--ease), background-color var(--dur-ui) var(--ease);
}
.navbar-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-back .ico { color: currentColor; }
.navbar-back:hover { color: var(--text); background: var(--hover); }
.navbar-back:active { background: var(--press); }

/* page header: the title, then one line of plain-text summary numbers */
.lt { padding: 8px var(--gutter) 20px; }
.lt h1 {
  font-size: calc(var(--t-large) * .9); line-height: 1.12; font-weight: 600;
  letter-spacing: var(--track-title); overflow-wrap: anywhere; text-wrap: balance;
}
.lt-sub { margin-top: 6px; font-size: var(--t-subhead); font-weight: 400; color: var(--text-2); line-height: 1.7; }
/* summary numbers live here as plain text (09 rule 11); a number that leads somewhere is a link */
.lt-sub a, .lt-sub button {
  display: inline; padding: 10px 0; margin: -10px 0; border: 0; background: none; font: inherit; cursor: pointer;
  color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--line-strong);
  transition: text-decoration-color var(--dur-ui) var(--ease);
}
.lt-sub a:hover, .lt-sub button:hover { text-decoration-color: currentColor; }
.lt-sub [data-tone="critical"] { color: var(--critical-text); }
.lt-sub [data-tone="warning"] { color: var(--warning-text); }
.lt-sub [aria-pressed="true"] { color: var(--brand-ink); text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.lt-sub .sub-sep { margin: 0 .35em; color: var(--text-4); }
.lt-sub > * { white-space: nowrap; }
.lt.hidden { display: none; }
.view { padding: 0 var(--gutter) calc(var(--sp-8) + var(--tabbar-space) + env(safe-area-inset-bottom)); }
.view > * + * { margin-top: var(--sp-7); }
.view.flush > * + * { margin-top: 0; }

/* sidebar (regular width): ink, full height, two levels at most */
.sidebar {
  position: relative; z-index: 30; min-width: 0; overflow: hidden;
  background: var(--rail); color: var(--on-rail);
}
.sidebar-panel {
  height: 100%; width: var(--sidebar-w);
  display: flex; flex-direction: column; gap: 0;
  padding: max(10px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
  transition: transform var(--dur-spring) var(--spring), opacity var(--dur-ui) var(--ease);
}
.shell[data-sidebar="collapsed"] .sidebar-panel { transform: translateX(-100%); opacity: 0; }
.shell[data-sidebar="collapsed"] .sidebar { pointer-events: none; }
.sidebar-head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 6px 0 18px; margin-top: -4px; }
/* the shop's mark: a brand tile with a wheel ring (white label: it follows --brand) */
.sidebar-head::before {
  content: ""; flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: radial-gradient(circle at 50% 50%, transparent 0 4.5px, var(--on-brand) 5px 7.5px, transparent 8px), var(--brand);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
}
.sidebar-brand {
  flex: 1; min-width: 0; font-size: var(--t-subhead); font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--on-rail);
}
.sidebar-nav { flex: 1; overflow-y: auto; margin: 10px 0 0; padding: 0 10px; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px 0 12px; border-radius: 8px;
  color: var(--on-rail-2); font-size: var(--t-subhead); font-weight: 500;
  transition: background-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease);
}
.side-item .ico { color: currentColor; width: 20px; height: 20px; opacity: .9; }
.side-item:hover { background: rgb(255 255 255 / .04); color: var(--on-rail); }
.side-item:active { background: rgb(255 255 255 / .07); transition-duration: 0s; }
.side-item[aria-current="page"] { background: rgb(255 255 255 / .07); color: #fff; }
.side-item[aria-current="page"] .ico { opacity: 1; }
.side-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 2px; border-radius: 0 2px 2px 0; background: var(--brand); }
.side-item .side-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-count { color: var(--on-rail-2); font-family: var(--font-mono); font-size: var(--t-footnote); }
.sidebar-primary { margin: 10px 10px 4px; width: calc(100% - 20px); }
.sidebar-foot { padding: 8px 10px 0; margin-top: 4px; border-top: 1px solid var(--rail-line); }
.account {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 8px;
  border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; color: var(--on-rail);
  transition: background-color var(--dur-ui) var(--ease);
}
.account:hover { background: rgb(255 255 255 / .04); }
.account:active { background: rgb(255 255 255 / .07); }
.account-text { flex: 1; min-width: 0; display: grid; }
.account-name { font-size: var(--t-subhead); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-role { font-size: var(--t-footnote); color: var(--on-rail-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .avatar { background: #2A2C31; color: #E6E7EA; }
.sidebar :focus-visible { outline-color: color-mix(in srgb, var(--brand) 60%, #fff); }

/* bottom bar (compact width): panel colour, full width, 3-5 items; the current one in brand */
.tabbar { display: none; }
@media (max-width: 767.98px) {
  .shell[data-chrome="app"], .shell[data-chrome="app"][data-sidebar="collapsed"] { grid-template-columns: minmax(0, 1fr); --tabbar-space: calc(var(--tabbar-h) + 8px); }
  .shell[data-chrome="app"] .sidebar { display: none; }
  .shell[data-chrome="app"] .tabbar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    display: flex; align-items: stretch; gap: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--panel); border-top: 1px solid var(--line);
  }
  .shell[data-chrome="app"] .navbar-sidebar-toggle { display: none; }
}
.tab {
  position: relative; flex: 1 1 0; min-width: 0;
  display: grid; justify-items: center; align-content: center; gap: 3px;
  color: var(--text-3);
  font-size: var(--t-caption1); font-weight: 500; letter-spacing: 0;
  transition: color var(--dur-ui) var(--ease);
}
.tab .ico { width: 23px; height: 23px; }
.tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.tab[aria-current="page"] { color: var(--brand-ink); font-weight: 600; }
.tab:active { color: var(--text); transition-duration: 0s; }
.tab .badge { position: absolute; top: 2px; left: calc(50% + 6px); }

@media (min-width: 768px) { .navbar .navbar-account { display: none; } }

/* floor chrome (employee, their own iPad): one light bar: shop and time,
   the My work | Station switch in the middle, Help (always) and Me on the right */
.shell[data-chrome="floor"] { grid-template-rows: auto auto minmax(0, 1fr); }
/* status strip: one line under the bar (clocked in, today's note, a ready timer) */
.statusstrip {
  position: relative; z-index: 19; display: flex; align-items: center; gap: 8px; min-height: 52px;
  padding: 8px var(--gutter); overflow-x: auto; scrollbar-width: none;
  background: var(--page); border-bottom: 1px solid var(--line);
}
.statusstrip::-webkit-scrollbar { display: none; }
.strip-item {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; padding: 0 14px 0 11px;
  border-radius: 999px; background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  font-size: var(--t-subhead); font-weight: 500; white-space: nowrap;
}
.strip-item .ico { width: 18px; height: 18px; color: var(--strip-tone, var(--text-3)); }
.strip-item .num, .strip-item .cd-digits { font-family: var(--font-mono); }
.strip-item.note { flex: 0 1 auto; min-width: 0; }
.strip-item.note span { overflow: hidden; text-overflow: ellipsis; }
a.strip-item { position: relative; cursor: pointer; transition: background-color var(--dur-press) var(--ease); }
a.strip-item::after { content: ""; position: absolute; inset: -6px 0; }
a.strip-item:active { background: var(--panel-3); }
.strip-item[data-tone="success"] { --strip-tone: var(--success-text); }
.strip-item[data-tone="warning"], .strip-item[data-tone="caution"] { --strip-tone: var(--warning-text); background: var(--warning-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 35%, transparent); }
.strip-item[data-tone="critical"] { --strip-tone: var(--critical-text); background: var(--critical-soft); color: var(--critical-text); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent); }
.strip-item .cd-inline { min-height: 0; padding: 0; background: none; box-shadow: none; border: 0; font-size: inherit; color: inherit; }
.strip-item .cd-inline .cd-icon { color: inherit; }
.floorbar {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 16px;
  min-height: 72px; padding: env(safe-area-inset-top) var(--gutter) 0;
  background: var(--panel); color: var(--text); border-bottom: 1px solid var(--line);
}
.floorbar-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.floorbar-lead::before {
  content: ""; flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: radial-gradient(circle at 50% 50%, transparent 0 5.5px, var(--on-brand) 6px 9px, transparent 9.5px), var(--brand);
}
.floorbar-title { min-width: 0; display: grid; line-height: 1.2; }
.floorbar-title b { font-size: var(--t-subhead); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.floorbar-title span { font-family: var(--font-mono); font-size: var(--t-footnote); font-weight: 400; color: var(--text-3); white-space: nowrap; }
.floorbar-center { width: min(420px, 40vw); display: flex; align-items: center; }
.floorbar-center .seg { margin: 0; }
/* One place only (a shop collecting data, iteration 8): its name instead of a one-segment switch. */
.floorbar-one { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: var(--r-control); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.floorbar-one[aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.floorbar-trail { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.help-btn { padding: 0 16px 0 13px; min-height: 48px; }
.help-btn .ico { width: 22px; height: 22px; }
.me-btn { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 999px; flex: none; transition: box-shadow var(--dur-ui) var(--ease); }
.me-btn:hover { box-shadow: 0 0 0 1px var(--line-strong); }
.me-btn[aria-current="page"] { box-shadow: 0 0 0 2px var(--brand); }
.me-btn .avatar { border-radius: 999px; }
.shell[data-chrome="floor"] .main { scroll-padding-top: 0; }
.shell[data-chrome="floor"] .lt { padding-top: 24px; }
@media (max-width: 767.98px) {
  [data-chrome="floor"] { --scale: 1.12; }
  .floorbar { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; gap: 8px; }
  .floorbar-lead { display: none; }
  .floorbar-center { width: auto; }
  .help-btn { padding: 0; width: 48px; }
  .help-btn span { display: none; }
  .me-btn { width: 48px; height: 48px; }
}

/* actions pinned to the bottom of a floor screen (the Now task): never scroll away */
.floor-actions {
  position: sticky; bottom: 0; z-index: 10;
  display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin: var(--sp-6) calc(-1 * var(--gutter)) 0; padding: var(--sp-4) var(--gutter) max(var(--sp-4), env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line);
}

/* kiosk chrome (wall TV): read-only, dark, no navigation, no scrolling */
.shell[data-chrome="kiosk"] .main { overflow: hidden; }
.shell[data-chrome="kiosk"] .view { padding: 32px 40px; height: 100%; }

/* bare chrome: sign-in and start screens */
.shell[data-chrome="bare"] .main { display: grid; }
.bare { display: grid; align-content: safe center; justify-items: center; gap: var(--sp-6); padding: max(32px, env(safe-area-inset-top)) var(--gutter) max(32px, env(safe-area-inset-bottom)); min-height: 100%; }
.bare-card { width: min(100%, 520px); display: grid; gap: var(--sp-6); }
.bare-title { text-align: center; display: grid; gap: 8px; justify-items: center; }
.app-mark { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--on-brand); background: var(--brand); box-shadow: var(--shadow-2), inset 0 0 0 1px rgb(255 255 255 / .12); }
.app-mark .ico { width: 30px; height: 30px; }

/* boot skeleton (index.html), never a blank screen */
.boot { position: fixed; inset: 0; display: grid; grid-template-columns: 248px 1fr; gap: 32px; padding: 0 24px 0 0; background: var(--page); }
.boot i { display: block; background: var(--fill-3); border-radius: 8px; }
.boot-side { display: grid; align-content: start; gap: 10px; background: var(--rail); padding: 18px 14px; }
.boot-side i { background: rgb(255 255 255 / .06); }
.boot-main { display: grid; align-content: start; gap: 16px; padding-top: 72px; max-width: 760px; }
@media (max-width: 767.98px) { .boot { grid-template-columns: 1fr; padding: 0 16px; } .boot-side { display: none; } }

/* ----- 4. Components -------------------------------------------------------- */

/* buttons: 10 px radius, semibold sentence case, a subtle press (scale + shade), 44 px minimum.
   Default (gray / tinted) = secondary: white with a hairline. filled = primary: brand. */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); min-width: var(--tap); padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-control); cursor: pointer;
  font-size: var(--t-subhead); font-weight: 600; letter-spacing: -.005em;
  line-height: 1.1; text-align: center; text-decoration: none;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-1);
  transition: transform var(--dur-press) var(--ease), background-color var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease);
}
.btn .ico { width: 18px; height: 18px; }
@media (hover: hover) { .btn:hover { background: var(--panel-2); } }
.btn:active { transform: scale(.98); background-color: var(--panel-3); transition-duration: 40ms; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; }
.btn.btn-filled, :root .btn.btn-filled { background: var(--brand); color: var(--on-brand); border-color: transparent; box-shadow: var(--shadow-1), inset 0 1px 0 rgb(255 255 255 / .1); }
@media (hover: hover) { .btn.btn-filled:hover { background: color-mix(in srgb, var(--brand) 92%, #000); } }
.btn.btn-filled:active { background: var(--brand-press); }
.btn.btn-tinted { background: var(--panel); color: var(--text); }
.btn.btn-gray { background: var(--panel); color: var(--text); }
.btn.btn-plain { background: none; border-color: transparent; box-shadow: none; padding: 0 10px; color: var(--text-2); }
@media (hover: hover) { .btn.btn-plain:hover { background: var(--hover); color: var(--text); } }
.btn-plain:active { background: var(--press); }
.btn-plain.strong { font-weight: 700; color: var(--text); }
.btn.btn-critical, :root .btn.btn-critical { background: var(--red-fill); color: #fff; border-color: transparent; }
@media (hover: hover) { .btn.btn-critical:hover { background: color-mix(in srgb, var(--red-fill) 90%, #000); } }
.btn-critical:active { filter: brightness(.94); }
.btn.btn-critical-tinted, :root .btn.btn-critical-tinted { background: var(--panel); color: var(--critical-text); border-color: color-mix(in srgb, var(--red) 55%, var(--panel)); }
@media (hover: hover) { .btn.btn-critical-tinted:hover { background: var(--critical-soft); } }
.btn-small { min-height: 34px; padding: 0 12px; font-size: var(--t-footnote); border-radius: 8px; }
.btn-small::after { content: ""; position: absolute; inset: -6px -2px; } /* keeps a 44 px hit area */
.btn-small .ico { width: 16px; height: 16px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 0; width: var(--tap); }
.btn-icon.btn-plain { padding: 0; color: var(--text-2); }
.btn-icon .ico { width: 20px; height: 20px; }
/* the floor button: full width, 72 px, big label with an icon */
.btn-floor {
  display: flex; width: 100%; min-height: 72px; gap: 12px; padding: 0 24px; border-radius: 14px;
  font-size: var(--t-title3); font-weight: 600; letter-spacing: -.01em;
}
.btn-floor .ico { width: 26px; height: 26px; }
.btn-floor:active { transform: scale(.985); }

/* list: ONE panel, hairlines between rows, a thin status stripe only on exceptions.
   Header: a sentence-case section title with space around it (no rule line). */
:where(.group) { margin: 0; }
.group + .group { margin-top: 36px; }
.group-header {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 0 2px 10px;
  font-size: var(--t-subhead); line-height: 1.3; font-weight: 600; letter-spacing: -.005em; color: var(--text);
}
.group-header.prominent { font-size: var(--t-title3); letter-spacing: var(--track-head); }
.group-body { margin: 0; padding: 0; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-group); overflow: hidden; box-shadow: var(--shadow-1); }
.group-footer { margin: 0; padding: 10px 2px 0; font-size: var(--t-footnote); line-height: 1.45; color: var(--text-2); }
.cell { position: relative; }
.cell + .cell { border-top: 1px solid var(--line); }
.row {
  --stripe: transparent;
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: var(--row-min); padding: 11px 16px;
  border: 0; background: none; color: inherit; text-align: left; font: inherit;
  box-shadow: inset var(--stripe-w) 0 0 var(--stripe);
}
.row:has(.pill[data-tone="critical"]) { --stripe: var(--red); }
.row:has(.pill[data-tone="warning"]) { --stripe: var(--amber); }
a.row, button.row, label.row { cursor: pointer; transition: background-color var(--dur-ui) var(--ease); }
a.row:active, button.row:active, label.row:active { background-color: var(--press); transition-duration: 0s; }
@media (hover: hover) { a.row:hover, button.row:hover { background-color: var(--hover); } }
.row-icon {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--panel-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line);
}
.row-icon .ico { width: 18px; height: 18px; }
.row-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.row-title { font-size: var(--t-body); line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.row-title.bold { font-weight: 600; }
.row-subtitle { font-size: var(--t-subhead); line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.row-value { flex: 0 1 auto; min-width: 0; color: var(--text-2); font-size: var(--t-subhead); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row-trail { flex: none; display: flex; align-items: center; gap: 8px; }
.row-chevron { flex: none; color: var(--text-4); width: 14px; height: 14px; margin-right: -4px; }
.row.destructive .row-title { color: var(--critical-text); font-weight: 600; }
.row.accent .row-title { color: var(--brand-ink); font-weight: 600; }
.row.accent .row-icon { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.row.center { justify-content: center; } .row.center .row-text { flex: 0 1 auto; text-align: center; }
.row[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* switch: a compact track with a square-ish knob (not an iOS capsule). <input type=checkbox switch> */
.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
  width: 46px; height: 28px; border-radius: 8px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease);
}
.switch::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 6px;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2), 0 0 0 1px rgb(0 0 0 / .04);
  transition: transform var(--dur-ui) var(--ease);
}
.switch:checked { background: var(--brand); box-shadow: none; }
.switch:checked::before { transform: translateX(18px); }
.switch:focus-visible { outline-offset: 3px; }
/* the on state also has a mark, never colour alone */
.switch:checked::after { content: ""; position: absolute; left: 10px; top: 9px; width: 2px; height: 10px; border-radius: 1px; background: var(--on-brand); opacity: .9; }

/* tiles: two hit zones (the key acts, the name opens) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--sp-3); }
.tile {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-tile); min-width: 0; box-shadow: var(--shadow-1);
}
.tile-act {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px;
  border: 1px solid var(--line-strong); cursor: pointer; background: var(--panel); color: var(--text);
  transition: transform var(--dur-press) var(--ease), background-color var(--dur-ui) var(--ease);
}
.tile-act .ico { width: 24px; height: 24px; }
.tile-act:active { transform: scale(.96); }
.tile[data-on] .tile-act { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.tile[data-tone="warning"] { box-shadow: inset var(--stripe-w) 0 0 var(--amber), var(--shadow-1); }
.tile[data-tone="critical"] { box-shadow: inset var(--stripe-w) 0 0 var(--red), var(--shadow-1); background: var(--critical-soft); }
.tile[data-tone="warning"] .tile-act { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.tile[data-tone="critical"] .tile-act { background: var(--red-fill); color: #fff; border-color: transparent; }
.tile-open {
  flex: 1; min-width: 0; align-self: stretch; display: grid; align-content: center; gap: 2px;
  margin: -12px -14px -12px 0; padding: 12px 14px 12px 0; border: 0; background: none; text-align: left; cursor: pointer;
  border-radius: 0 var(--r-tile) var(--r-tile) 0; color: inherit;
}
a.tile-open { color: inherit; }
.tile-open:active { background: var(--press); }
.tile-title { font-size: var(--t-headline); font-weight: 600; overflow-wrap: anywhere; }
.tile-status { font-size: var(--t-subhead); color: var(--text-2); overflow-wrap: anywhere; }
.tile.large { grid-column: span 2; flex-direction: column; align-items: flex-start; min-height: 168px; padding: 16px; }
.tile.large .tile-open { margin: 0; padding: 0; width: 100%; align-content: end; border-radius: 0; flex: 1; }
.tile.large .tile-title { font-size: var(--t-title2); letter-spacing: var(--track-head); }
@container (max-width: 420px) { .tile.large { grid-column: auto; } }

/* segmented control: a recessed track with a sliding ink thumb (brand on the floor bar).
   2-5 equal segments; the thumb moves with --i (ui/components.js segmented()). */
.seg {
  --n: 2; --i: 0; --pad: 3px;
  position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  min-height: 40px; padding: var(--pad); margin: 6px 0; border-radius: var(--r-control); background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  max-width: 100%; isolation: isolate;
}
.seg.block { display: grid; width: 100%; }
.seg-thumb {
  position: absolute; z-index: 0; top: var(--pad); bottom: var(--pad); left: var(--pad);
  width: calc((100% - 2 * var(--pad)) / var(--n)); border-radius: 7px;
  background: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .18);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform var(--dur-spring) var(--spring), background-color var(--dur-ui) var(--ease);
}
.seg button {
  position: relative; z-index: 1; min-width: 0; padding: 0 14px; border: 0; background: none; cursor: pointer;
  font-size: var(--t-subhead); font-weight: 500; letter-spacing: -.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-2); border-radius: 7px;
  transition: color var(--dur-ui) var(--ease);
}
.seg button::after { content: ""; position: absolute; inset: -8px 0; }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { color: var(--panel); font-weight: 600; }
.seg button .ico { width: 18px; height: 18px; margin: auto; }
.seg.lg { min-height: 48px; }
.seg.lg button { font-size: var(--t-body); padding: 0 18px; }
.seg.lg button::after { inset: -2px 0; }
/* on the floor bar the switch is navigation: brand thumb */
.floorbar .seg { min-height: 50px; }
.floorbar .seg-thumb { background: var(--brand); }
.floorbar .seg button { font-size: var(--t-subhead); }
.floorbar .seg button[aria-checked="true"] { color: var(--on-brand); }

/* search field */
.search {
  display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0; padding: 0 4px 0 12px;
  border-radius: var(--r-control); background: var(--panel); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1);
  transition: box-shadow var(--dur-ui) var(--ease);
}
.search .ico { width: 18px; height: 18px; }
.search input {
  flex: 1; min-width: 0; height: 42px; border: 0; background: none; color: var(--text); outline: none;
  font-size: var(--t-subhead);
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 8px; }
.search-clear .ico { width: 18px; height: 18px; }
.search:focus-within { box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }

/* chips: filter keys and counters ("2 Problems"): 8 px radius, hairline, mono counts */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 10px; position: relative;
  border: 0; border-radius: var(--r-chip); background: var(--panel); color: var(--text-2); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: var(--t-subhead); font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease);
}
.chip::after { content: ""; position: absolute; inset: -4px 0; } /* 44 px hit area */
.chip .ico { width: 16px; height: 16px; color: var(--chip-tone, var(--text-3)); }
.chip .chip-count { font-family: var(--font-mono); font-weight: 500; font-size: .95em; color: var(--chip-tone, var(--text)); }
@media (hover: hover) { .chip:hover { color: var(--text); background: var(--panel-2); } }
.chip:active { background: var(--panel-3); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--panel); box-shadow: none; }
.chip[aria-pressed="true"] .ico, .chip[aria-pressed="true"] .chip-count { color: inherit; }
.chip[data-tone="critical"] { --chip-tone: var(--critical-text); }
.chip[data-tone="warning"] { --chip-tone: var(--warning-text); }
.chip[data-tone="success"] { --chip-tone: var(--success-text); }
.chip[data-tone="accent"] { --chip-tone: var(--brand-ink); }

/* status chip: soft tint, an icon (or a dot) and a word. Never colour alone. */
.pill {
  --tone: var(--gray); --tone-text: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 8px; flex: none;
  border-radius: var(--r-tag); background: color-mix(in srgb, var(--tone) 12%, var(--panel)); color: var(--tone-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 22%, transparent);
  font-size: var(--t-footnote); font-weight: 500; letter-spacing: 0;
  line-height: 1; white-space: nowrap;
}
.pill:not(:has(.ico))::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.pill .ico { width: 14px; height: 14px; color: var(--tone-text); }
.pill[data-tone="accent"] { --tone: var(--brand); --tone-text: var(--brand-ink); }
.pill[data-tone="success"] { --tone: var(--green); --tone-text: var(--success-text); }
.pill[data-tone="warning"] { --tone: var(--amber); --tone-text: var(--warning-text); }
.pill[data-tone="critical"] { --tone: var(--red); --tone-text: var(--critical-text); font-weight: 600; }
.pill[data-tone="info"] { --tone: var(--blue); --tone-text: var(--info-text); }
.pill[data-tone="caution"] { --tone: var(--amber); --tone-text: var(--warning-text); font-weight: 600; }
.pill[data-tone="neutral"] { --tone: var(--gray); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.pill.large { height: 32px; padding: 0 12px 0 10px; font-size: var(--t-subhead); border-radius: 8px; }
.pill.large .ico { width: 16px; height: 16px; }
[data-chrome="floor"] .pill { height: 32px; padding: 0 11px 0 9px; border-radius: 8px; }
[data-chrome="floor"] .pill .ico { width: 17px; height: 17px; }

/* badge: red count, mono digits */
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--red-fill); color: #fff;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; line-height: 1; letter-spacing: 0;
}
.badge.gray { background: var(--fill-2); color: var(--text); }
.sidebar .badge { box-shadow: 0 0 0 2px var(--rail); }

/* placeholder mark (09 rule 8; Saul's policy): a small quiet dot and a short grey mono word ("est.").
   The full "uncalibrated" explanation lives in Owner > Shop > Setup. */
.ph-mark {
  display: inline-flex; align-items: center; gap: 5px; flex: none; vertical-align: baseline;
  font-family: var(--font-mono); font-size: var(--t-caption1); font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--text-3); white-space: nowrap;
}
.ph-mark::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--text-4); }
.ph-mark.dot-only { gap: 0; }

/* stage tick: colour as a small mark only, always with the stage name */
.stage { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-subhead); color: var(--text); white-space: nowrap; }
.stage::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--stage-c, var(--stage-checkin)); }

/* job numbers and wheel tags: Geist Mono medium, never a tag shape */
.tagshape, .emp-tag, .emp-gate-tag, .mgr-q-job, .mgr-jobno, .pb-job, .wall-jobno, .emp-task-job {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: -.01em;
}

/* avatar: initials on a soft neutral (photo when there is one) */
.avatar {
  --size: 32px;
  flex: none; display: grid; place-items: center; width: var(--size); height: var(--size); border-radius: 999px; overflow: hidden;
  background: var(--avatar-bg); color: var(--avatar-ink); font-size: calc(var(--size) * .36); font-weight: 600;
  letter-spacing: 0; line-height: 1; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .05);
  -webkit-user-select: none; user-select: none;
}
:root .avatar { color: var(--avatar-ink); }   /* beats "card span { secondary colour }" rules in the views */
:root .sidebar .avatar { color: #E6E7EA; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.s44 { --size: 44px; } .avatar.s56 { --size: 56px; } .avatar.s120 { --size: 120px; }

/* gauge: a single open 270-degree capacity dial, round ends */
.gauge { position: relative; display: inline-grid; place-items: center; flex: none; }
.gauge svg { overflow: visible; }
.gauge circle { stroke-linecap: round; }
.gauge-track { stroke: var(--fill); }
.gauge-value { stroke: var(--gauge-tone, var(--brand)); transition: stroke-dashoffset var(--dur-spring) var(--spring); }
.gauge-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.gauge-num { font-family: var(--font-mono); font-weight: 500; letter-spacing: -.03em; }
.gauge-label { color: var(--text-2); font-weight: 500; }
.gauge[data-tone="success"] { --gauge-tone: var(--green); }
.gauge[data-tone="warning"] { --gauge-tone: var(--amber); }
.gauge[data-tone="critical"] { --gauge-tone: var(--red); }
.gauge[data-tone="neutral"] { --gauge-tone: var(--gray); }

/* empty state: names the next step */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 44px 24px; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 14px; color: var(--text-3); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.empty-icon .ico { width: 28px; height: 28px; }
.empty-title { font-size: var(--t-title3); font-weight: 600; letter-spacing: var(--track-head); }
.empty-text { max-width: 44ch; font-size: var(--t-subhead); color: var(--text-2); line-height: 1.5; }
.empty .btn { margin-top: 12px; }
.empty.card { background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--r-group); }

/* skeleton blocks (static: no looping shimmer) */
.skel { display: block; background: var(--fill-3); border-radius: 6px; min-height: 1em; }
.skel-group { display: grid; gap: 1px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-group); padding: 6px 16px; }
.skel-row { display: flex; align-items: center; gap: 12px; height: 44px; }

/* error box */
.alert-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-group); background: var(--critical-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--red) 30%, var(--panel)); box-shadow: inset 3px 0 0 var(--red); }
.alert-box .ico { color: var(--critical-text); width: 20px; height: 20px; }

/* sheet: <dialog>. Phone: bottom sheet with a grip and detents. Regular: centred panel */
dialog { color: var(--text); }
.sheet {
  --detent: 52dvh;
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 0; border: 0;
  width: 100%; max-width: none; height: var(--detent); max-height: calc(100dvh - max(44px, env(safe-area-inset-top)));
  display: none; flex-direction: column; overflow: hidden;
  background: var(--panel); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-sheet);
  overscroll-behavior: contain;
}
.sheet[open] { display: flex; animation: sheet-up var(--dur-spring) var(--spring); }
.sheet.large { --detent: calc(100dvh - max(44px, env(safe-area-inset-top))); }
.sheet.closing { animation: sheet-down 160ms cubic-bezier(.4, 0, 1, 1) forwards; }
.sheet.dragging { animation: none; transition: none; }
.sheet::backdrop { background: rgb(12 13 15 / .42); animation: fade-in 160ms var(--ease); }
.sheet.closing::backdrop { animation: fade-out 160ms var(--ease) forwards; }
@media (min-width: 768px) {
  .sheet, .sheet.large {
    inset: 0; margin: auto; width: min(560px, calc(100vw - 40px)); height: min(var(--form-h, 640px), calc(100dvh - 80px));
    border-radius: var(--r-sheet); border: 1px solid var(--line);
  }
  .sheet.auto-h { height: auto; max-height: calc(100dvh - 80px); }
  .sheet .grabber { display: none; }
}
.grabber { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
.sheet-head {
  position: relative; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  min-height: 58px; padding: 10px 8px 4px; touch-action: none; background: var(--panel); border-bottom: 1px solid var(--line);
}
.sheet-title {
  font-size: var(--t-headline); font-weight: 600; letter-spacing: var(--track-head);
  text-align: center; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-head .btn-plain { justify-self: start; }
.sheet-head .sheet-done { justify-self: end; font-weight: 600; color: var(--brand-ink); }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px var(--gutter) max(24px, env(safe-area-inset-bottom)); overscroll-behavior: contain; background: var(--page); }
.sheet-body > * + * { margin-top: var(--sp-6); }
.sheet.pin-sheet { --form-h: 680px; }
.sheet.pin-sheet .sheet-body { background: var(--panel); }

/* action sheet: phone bottom (destructive first, Cancel separate); iPad popover */
.asheet { margin: 0; padding: 0; border: 0; background: transparent; max-width: none; max-height: none; overflow: visible; }
.asheet::backdrop { background: rgb(12 13 15 / .38); animation: fade-in 160ms var(--ease); }
.asheet[open] { position: fixed; inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px; width: auto; display: grid; gap: 8px; animation: sheet-up var(--dur-spring) var(--spring); }
.asheet.closing { animation: sheet-down 160ms cubic-bezier(.4, 0, 1, 1) forwards; }
.asheet-group { overflow: hidden; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-pop); padding: 4px; }
.asheet-head { padding: 10px 12px 8px; text-align: left; display: grid; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.asheet-title { font-size: var(--t-footnote); font-weight: 600; color: var(--text); }
.asheet-msg { font-size: var(--t-footnote); color: var(--text-2); }
.asheet-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 50px; padding: 8px 12px;
  border: 0; border-radius: 9px; background: none; cursor: pointer; color: var(--text);
  font-size: var(--t-body); font-weight: 500; text-align: left;
  transition: background-color var(--dur-ui) var(--ease);
}
.asheet-btn .ico { color: var(--text-3); }
@media (hover: hover) { .asheet-btn:hover { background: var(--hover); } }
.asheet-btn:active { background: var(--press); }
.asheet-btn.destructive { color: var(--critical-text); }
.asheet-btn.destructive .ico { color: currentColor; }
.asheet-btn.cancel { justify-content: center; font-weight: 600; }
.asheet.popover { inset: auto; width: 300px; display: block; animation: pop-in 160ms var(--ease); }
.asheet.popover::backdrop { background: transparent; }
.asheet.popover .asheet-btn { min-height: 44px; font-size: var(--t-subhead); }
.asheet.popover.closing { animation: fade-out 120ms var(--ease) forwards; }

/* toast with Undo: an ink strip, role=status */
.toasts { position: fixed; z-index: 90; left: 0; right: 0; bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--toast-lift, 0px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 var(--gutter); }
/* the host is a manual popover on <body> (ui/sheet.js): top layer above open sheets, never inside one */
.toasts[popover] { top: auto; width: auto; height: auto; margin: 0; border: 0; background: none; color: inherit; overflow: visible; }
.toasts[popover]:not(:popover-open) { display: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(100%, 540px); min-height: 50px; padding: 6px 6px 6px 16px;
  border-radius: 12px; background: #17181B; color: #F4F4F5;
  box-shadow: 0 12px 32px rgb(0 0 0 / .28), 0 0 0 1px rgb(255 255 255 / .06); font-size: var(--t-subhead); font-weight: 500;
  animation: toast-in 180ms var(--ease);
}
.toast > .ico { width: 18px; height: 18px; color: #5BD07D; }
.toast-text { flex: 1; min-width: 0; padding-right: 4px; }
@media (max-width: 767.98px) { body:has(.shell[data-chrome="app"]) .toasts { --toast-lift: calc(var(--tabbar-h) + 4px); } }
.toast .btn { min-height: 38px; background: rgb(255 255 255 / .1); color: #fff; border-color: transparent; box-shadow: none; }
.toast .btn:hover { background: rgb(255 255 255 / .16); }
.toast.leaving { animation: fade-out 140ms var(--ease) forwards; }
.toast:not(:has(.btn)) { padding-right: 18px; }

/* PIN pad: a calm 3x4 keypad of rounded keys, mono digits, dot progress */
.pinpad { display: grid; justify-items: center; gap: 22px; padding: 8px 0 16px; --key: 78px; }
.pinpad-prompt { text-align: center; display: grid; gap: 4px; }
.pinpad-prompt b { font-size: var(--t-title2); font-weight: 600; letter-spacing: var(--track-head); }
.pinpad-prompt span { font-size: var(--t-subhead); color: var(--text-2); min-height: 1.4em; }
.pinpad-prompt span.bad { color: var(--critical-text); font-weight: 600; }
.pinpad-dots { display: flex; gap: 14px; height: 14px; }
.pinpad-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); background: transparent; transition: background-color 100ms var(--ease), box-shadow 100ms var(--ease); }
.pinpad-dot.on { background: var(--brand); box-shadow: none; }
.pinpad-grid { display: grid; grid-template-columns: repeat(3, var(--key)); gap: 10px; }
.pinpad-key {
  display: grid; place-content: center; width: var(--key); height: var(--key); border-radius: 16px; border: 0; cursor: pointer;
  background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  font-family: var(--font-mono); font-size: 1.75rem; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums;
  transition: background-color 90ms var(--ease), transform 90ms var(--ease);
}
.pinpad-key:hover { background: var(--panel-2); }
.pinpad-key:active { background: var(--brand-soft-2); transform: scale(.96); transition-duration: 0s; }
.pinpad-key.fn { background: transparent; box-shadow: none; color: var(--text-2); font-family: var(--font); font-size: var(--t-subhead); font-weight: 500; }
.pinpad-key.fn:active { background: var(--press); }
.pinpad-key.fn .ico { width: 26px; height: 26px; }
.pinpad-key.blank { visibility: hidden; }
.pinpad.shake .pinpad-dots { animation: shake 300ms var(--ease); }
.pinpad[aria-busy="true"] .pinpad-grid { opacity: .5; pointer-events: none; }
@media (max-height: 860px) { .pinpad { --key: 68px; gap: 16px; } .pinpad-grid { gap: 8px; } }

/* master jobs table: sticky header, hairline rows, a thin stripe on exceptions; collapses to list rows when narrow */
.tbl { container-type: inline-size; container-name: tbl; }
.tbl-grid { display: grid; grid-template-columns: var(--cols); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-group); box-shadow: var(--shadow-1); }
.tbl-head, .tbl-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; }
.tbl-head {
  position: sticky; top: var(--navbar-h); z-index: 5; min-height: 40px;
  background: var(--panel-2); border-bottom: 1px solid var(--line); border-radius: var(--r-group) var(--r-group) 0 0;
}
/* the one place for tiny mono labels: table column heads */
.tbl-th { padding: 8px 12px; font-family: var(--font-mono); font-size: var(--t-caption2); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.tbl-row { position: relative; min-height: 56px; cursor: pointer; transition: background-color var(--dur-ui) var(--ease); box-shadow: inset var(--stripe-w) 0 0 var(--tbl-stripe, transparent); }
.tbl-row + .tbl-row { border-top: 1px solid var(--line); }
.tbl-row:last-child { border-radius: 0 0 var(--r-group) var(--r-group); }
.tbl-row:has(.pill[data-tone="critical"]), .tbl-row:has(.late) { --tbl-stripe: var(--red); }
.tbl-row:has(.pill[data-tone="warning"]) { --tbl-stripe: var(--amber); }
@media (hover: hover) { .tbl-row:hover { background: var(--hover); } }
.tbl-row:active { background: var(--press); transition-duration: 0s; }
.tbl-row[aria-selected="true"] { background: var(--brand-soft); --tbl-stripe: var(--brand); }
.tbl-cell { padding: 10px 12px; min-width: 0; font-size: var(--t-subhead); overflow-wrap: anywhere; }
.tbl-th:first-child, .tbl-cell:first-child { padding-left: 18px; }
.tbl-th:last-child, .tbl-cell:last-child { padding-right: 16px; }
.tbl-cell[data-align="end"], .tbl-th[data-align="end"] { text-align: right; justify-self: stretch; }
.tbl-cell .sub { display: block; color: var(--text-2); font-size: var(--t-footnote); }
.tbl-open { color: inherit; font-weight: 600; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; font-size: inherit; letter-spacing: inherit; }
.tbl-open::after { content: ""; position: absolute; inset: 0; } /* the whole row is the hit area */
.tbl-chev, .tbl-metas { display: none; }
.tbl-empty { grid-column: 1 / -1; }
@container tbl (max-width: 620px) {
  .tbl-grid { display: block; }
  .tbl-head { display: none; }
  .tbl-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "title trail chev" "sub trail chev" "meta meta meta";
    column-gap: 10px; padding: 12px 14px 12px 16px; min-height: 64px;
  }
  .tbl-row:first-of-type { border-radius: var(--r-group) var(--r-group) 0 0; }
  .tbl-cell { padding: 0; }
  .tbl-cell:first-child, .tbl-cell:last-child { padding: 0; }
  .tbl-cell[data-slot="title"] { grid-area: title; font-weight: 600; font-size: var(--t-body); }
  .tbl-cell[data-slot="subtitle"] { grid-area: sub; color: var(--text-2); font-size: var(--t-subhead); }
  .tbl-cell[data-slot="trailing"] { grid-area: trail; text-align: right; align-self: center; }
  .tbl-cell[data-slot="meta"], .tbl-cell[data-slot="hide"] { display: none; }
  .tbl-metas { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: var(--t-footnote); color: var(--text-2); }
  .tbl-chev { display: block; grid-area: chev; align-self: center; color: var(--text-4); width: 14px; height: 14px; }
}

/* form fields inside lists */
.field { display: flex; align-items: center; gap: 12px; min-height: var(--row-min); padding: 0 16px; }
.field label { flex: none; min-width: 7.5em; }
.field input, .field select, .field textarea { flex: 1; min-width: 0; min-height: var(--row-min); border: 0; background: none; outline: none; font-size: var(--t-body); text-align: right; color: var(--text); }
.field input::placeholder { color: var(--text-3); }

/* layout helpers for views */
.stack { display: grid; gap: var(--gap, var(--sp-4)); }
.hstack { display: flex; align-items: center; gap: var(--gap, var(--sp-3)); flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-group); padding: var(--sp-5); box-shadow: var(--shadow-1); }
/* the one hero element of a screen: a touch more presence, never a heavy edge */
.card.hero, .hero-edge { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
/* a section label (office screens): sentence case, space does the separating */
.sec-label {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px; min-height: 24px;
  font-size: var(--t-subhead); line-height: 1.3; font-weight: 600; color: var(--text);
}
.sec-label > :first-child { flex: 1; min-width: 0; }
.section-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 var(--sp-2);
  font-size: var(--t-title3); font-weight: 600; letter-spacing: var(--track-head);
}
.grid-2 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.kpis { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-tile); padding: 14px 16px 16px; display: grid; gap: 6px; box-shadow: var(--shadow-1); }
.kpi-label { font-size: var(--t-footnote); color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: var(--t-title1); font-weight: 600; line-height: 1.05; letter-spacing: var(--track-title); font-variant-numeric: tabular-nums; }
.kpi-note { font-size: var(--t-footnote); color: var(--text-2); }

/* the one loop allowed: an unacknowledged Problem pulses (static under Reduce Motion) */
.pulse { animation: pulse 1.8s var(--ease) infinite; }

/* down and safety: a solid red left edge and a light red tint (plus the icon and word the view prints) */
.hazard-edge { position: relative; background: var(--critical-soft); box-shadow: inset 4px 0 0 var(--red-fill); }

/* ----- 4c. Office patterns (09-declutter: manager and owner) --------------- */
/* the ⋯ button: secondary actions live behind it */
.dco-more { flex: none; color: var(--text-3); }
.dco-more .ico { width: 20px; height: 20px; }
.dco-seeall { justify-self: start; margin-top: -8px; }
/* Jobs | Customers */
.dco-switch .seg { min-width: min(100%, 320px); margin: 0; }
.view > .dco-switch + * { margin-top: 20px; }
/* needs you: rows with hairlines inside one container; down and safety get the red edge and tint */
.dco-needs { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-group); overflow: hidden; box-shadow: var(--shadow-1); }
.dco-needs > li + li { border-top: 1px solid var(--line); }
.dco-need {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px;
  min-height: 76px; padding: 14px 12px 14px 18px;
}
.dco-need::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--stripe-w); background: transparent; }
.dco-need[data-tone="critical"]::before { background: var(--red); }
.dco-need[data-tone="warning"]::before { background: var(--amber); }
.dco-need[data-hazard] { background: var(--critical-soft); }
.dco-need[data-hazard]::before { width: 4px; background: var(--red-fill); }
.dco-need-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--text-2); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.dco-need[data-tone="critical"] .dco-need-ico { color: var(--critical-text); background: var(--critical-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 22%, transparent); }
.dco-need[data-hazard] .dco-need-ico { color: #fff; background: var(--red-fill); box-shadow: none; }
.dco-need[data-tone="warning"] .dco-need-ico { color: var(--warning-text); background: var(--warning-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 24%, transparent); }
.dco-need-ico .ico { width: 19px; height: 19px; }
.dco-need-text {
  display: grid; gap: 2px; min-width: 0; padding: 2px 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left;
}
button.dco-need-text { cursor: pointer; border-radius: 6px; }
button.dco-need-text:active { background: var(--press); }
@media (hover: hover) { button.dco-need-text:hover .dco-need-title { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; } }
.dco-need-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dco-need-kind { font-size: var(--t-footnote); font-weight: 600; color: var(--text-2); }
.dco-need[data-tone="critical"] .dco-need-kind { color: var(--critical-text); }
.dco-need[data-tone="warning"] .dco-need-kind { color: var(--warning-text); }
.dco-need-resp { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-footnote); color: var(--text-2); }
.dco-need-when { margin-left: auto; font-family: var(--font-mono); font-size: var(--t-caption1); color: var(--text-3); white-space: nowrap; }
.dco-need-title { font-size: var(--t-body); font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; letter-spacing: -.005em; }
.dco-need-sub { font-size: var(--t-subhead); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dco-need-acts { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.dco-need-acts .btn-filled { white-space: nowrap; }
@media (max-width: 767.98px) {
  .dco-need { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding-right: 8px; }
  .dco-need-acts { grid-column: 2; justify-content: flex-start; }
  .dco-need-sub { white-space: normal; }
}
/* one primary action per list (09 rule 1): the first (most urgent) row keeps the brand button,
   the rows below get calm secondary buttons; a safety or machine-down row always keeps it */
.dco-needs > li:not(:first-child) .dco-need:not([data-hazard]) .dco-need-acts .btn.btn-filled { background: var(--panel); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
@media (hover: hover) { .dco-needs > li:not(:first-child) .dco-need:not([data-hazard]) .dco-need-acts .btn.btn-filled:hover { background: var(--panel-2); } }
.dco-needs > li:not(:first-child) .dco-need:not([data-hazard]) .dco-need-acts .btn.btn-filled .ico { color: var(--text-3); }
/* one quiet line instead of a panel ("All stations running") */
.dco-okline { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 2px; font-size: var(--t-subhead); color: var(--text-2); }
.dco-okline > .ico { color: var(--success-text); }
.dco-okline.quiet > .ico { color: var(--text-3); }
.dco-okline .mgr-seclink { margin-left: auto; }

/* ----- 4b. Shell parts ------------------------------------------------------ */
.view-host { min-width: 0; }
.view-host > .skel-wrap { padding: 0 var(--gutter); }
.navbar-backslot, .navbar-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.navbar-trail .btn-plain { padding: 0 10px; }
.shell:not([data-sidebar="collapsed"]) .navbar-sidebar-toggle { display: none; }
@media (min-width: 768px) { .navbar-primary { display: none; } }
.navbar-account .avatar { --size: 32px; }
.lt { display: flex; align-items: flex-end; gap: 12px; }
.lt-text { flex: 1; min-width: 0; }
.lt-actions { flex: none; display: flex; gap: 8px; }
.lt-actions:empty { display: none; }
.nav-badge:empty { display: none; }
.side-item .nav-badge { margin-left: auto; }
.tab .nav-badge { position: absolute; top: 6px; left: calc(50% + 7px); }
.tab .nav-badge .badge { position: static; box-shadow: 0 0 0 2px var(--panel); }
.sidebar-primary { min-height: 44px; }
.account-more { color: var(--on-rail-2); width: 20px; height: 20px; }
.sidebar-head .btn-icon, .sidebar-head .btn-icon.btn-plain { color: var(--on-rail-2); }
.sidebar-head .btn-plain:hover { background: rgb(255 255 255 / .05); color: var(--on-rail); }
.sidebar-head .btn-plain:active { background: rgb(255 255 255 / .08); }

/* bare screens: start, sign in, lock */
.bare-card.narrow { width: min(100%, 400px); justify-items: center; }
.bare-card.wide { width: min(100%, 760px); }
.bare-title h1 { overflow-wrap: anywhere; }
.bare-title .t-title2 { font-size: var(--t-title2); font-weight: 600; letter-spacing: var(--track-head); }
.bare-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; }
.bare-mode { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.bare-back { padding-left: 6px; }
.center { text-align: center; }
.lang-seg { min-width: 220px; margin: 0; }
.people-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, 172px); justify-content: center; }
.person-tile {
  display: grid; justify-items: center; gap: 10px; width: 100%; padding: 18px 8px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel); cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease), transform var(--dur-press) var(--ease);
}
@media (hover: hover) { .person-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); } }
.person-tile:active { transform: scale(.98); }
.person-tile .avatar.s120 { --size: 80px; font-size: 28px; }
.person-name { font-size: var(--t-subhead); font-weight: 600; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .people-grid .avatar.s120 { --size: 72px; }
}
.pinpad-key { gap: 2px; }
.pinpad-key span { line-height: 1; }
.pinpad-letters { display: none; }   /* a keypad, not a phone dialler */

/* kiosk (wall TV): TV type (29 px minimum at 1920 wide), no scrolling */
.kiosk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.kiosk-title { font-size: var(--t-large); font-weight: 600; letter-spacing: var(--track-title); }
.kiosk-clock { font-family: var(--font-mono); font-size: var(--t-large); font-weight: 400; color: var(--text-2); }
.kiosk-empty { min-height: 60vh; align-content: center; }
.kiosk-empty .empty-title { font-size: var(--t-title1); }
.kiosk-empty .empty-text { font-size: var(--t-body); max-width: 40ch; }
.kiosk-empty .empty-icon { width: 120px; height: 120px; border-radius: 28px; }
.kiosk-empty .empty-icon .ico { width: 64px; height: 64px; }

/* countdown (ui/countdown.js): big mono digits, the phase word and a thin progress bar.
   running/holding/heating = brand, done (ready to unload) = amber, overdue = red. Always icon + word.
   countdown.js sets --cd-frac (0-1, time elapsed) on every tick. */
.cd { --cd-c: var(--brand); --cd-tone: var(--text-3); --cd-text: var(--text); --cd-ring: var(--brand);
  display: inline-flex; align-items: center; gap: 6px; color: var(--cd-text); font-variant-numeric: tabular-nums; }
.cd[data-state="heating"] { --cd-c: var(--amber); --cd-ring: var(--amber); }
.cd[data-state="done"] { --cd-c: var(--amber); --cd-tone: var(--warning-text); --cd-text: var(--warning-text); --cd-ring: var(--amber); --cd-bg: var(--warning-soft); --cd-edge: color-mix(in srgb, var(--amber) 35%, transparent); }
.cd[data-state="overdue"] { --cd-c: var(--red); --cd-tone: var(--critical-text); --cd-text: var(--critical-text); --cd-ring: var(--red); --cd-bg: var(--critical-soft); --cd-edge: color-mix(in srgb, var(--red) 35%, transparent); }
.cd-icon { display: grid; color: var(--cd-tone); }
.cd-digits { font-family: var(--font-mono); font-weight: 500; letter-spacing: -.02em; }
.cd-word { font-weight: 500; }
.cd-inline {
  min-height: 28px; padding: 0 10px 0 8px; border-radius: 8px; background: var(--cd-bg, var(--panel-2));
  box-shadow: inset 0 0 0 1px var(--cd-edge, var(--line)); font-size: var(--t-footnote);
}
.cd-inline .cd-word { color: var(--cd-tone); font-size: .95em; }
.cd-inline .cd-icon .ico { width: 15px; height: 15px; }
.cd-inline .cd-word::before { content: "\00b7"; margin-right: 6px; opacity: .6; }
/* the readout: phase word, big digits, a thin progress bar, the time it ends */
.cd-large {
  display: inline-grid; justify-items: start; gap: 2px; padding: 14px 16px 14px; min-width: 12rem;
  background: var(--panel); color: var(--cd-text); border-radius: var(--r-tile); box-shadow: inset 0 0 0 1px var(--line);
}
.cd-large .cd-top { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; font-size: var(--t-footnote); font-weight: 600; color: var(--cd-tone); }
.cd-large .cd-top .ico { width: 16px; height: 16px; }
.cd-large .cd-digits { font-size: calc(var(--t-large) * 1.3); font-weight: 400; line-height: 1.05; letter-spacing: -.04em; }
.cd-large::after { content: ""; justify-self: stretch; height: 4px; margin: 6px 0 4px; border-radius: 2px; background: linear-gradient(var(--cd-c), var(--cd-c)) 0 0 / calc(var(--cd-frac, 0) * 100%) 100% no-repeat, var(--fill); order: 2; }
.cd-large .cd-caption { order: 3; font-family: var(--font-mono); font-size: var(--t-caption1); color: var(--text-3); }
.cd-large[data-state="done"], .cd-large[data-state="overdue"] { background: var(--cd-bg); box-shadow: inset 0 0 0 1px var(--cd-edge); }
.cd-caption { font-size: var(--t-footnote); color: var(--text-2); }
.cd-ring { display: inline-grid; justify-items: center; gap: 6px; position: relative; }
.cd-ring > svg { display: block; }
.cd-ring circle { stroke-linecap: round; }
.cd-track { stroke: var(--fill); }
.cd-value { stroke: var(--cd-ring); }
.cd-center { position: absolute; top: 0; left: 0; width: var(--cd-size); height: var(--cd-size); display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; }
.cd-ring .cd-digits { font-size: calc(var(--cd-size) * .22); font-weight: 400; line-height: 1; letter-spacing: -.04em; }
.cd-ring .cd-icon .ico { width: calc(var(--cd-size) * .14); height: calc(var(--cd-size) * .14); }
.cd-ring .cd-word { font-size: var(--t-caption1); color: var(--cd-tone); }
.cd-ring[data-state="done"] .cd-digits { color: var(--warning-text); }
.cd-ring[data-state="overdue"] .cd-digits { color: var(--critical-text); }

/* a two-column iPad/laptop layout for views that want one (list + detail) */
.split { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); } }

/* ----- 5. Motion ------------------------------------------------------------ */
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@media (min-width: 768px) {
  @keyframes sheet-up { from { opacity: 0; transform: translateY(12px) scale(.985); } }
  @keyframes sheet-down { to { opacity: 0; transform: translateY(12px) scale(.985); } }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--red) 22%, transparent); } }
/* route change: a subtle fade and a 6 px rise */
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.view.entering { animation: view-in 200ms var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 120ms !important; transition-property: opacity, background-color, color !important; }
  .sheet[open], .asheet[open], .toast, .view.entering { animation: fade-in 120ms linear; }
  .sheet.closing, .asheet.closing, .toast.leaving { animation: fade-out 120ms linear forwards; }
  .pinpad.shake .pinpad-dots, .pulse { animation: none; }
  .pulse { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 22%, transparent); }
  .seg-thumb { transition: none; }
}

/* ----- 6. Print / misc ------------------------------------------------------ */
@media print { .sidebar, .tabbar, .navbar, .floorbar { display: none !important; } .shell { position: static; display: block; } }

/* Demo-only helper under the PIN pad: "Demo code is 2222. Tap to use it" (each person has their own, D-131) */
.pinpad-demo { display: block; margin: 12px auto 0; min-height: 44px; padding: 8px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-control);
  background: transparent; color: var(--text-2); font: inherit; font-family: var(--font-mono); font-size: var(--t-footnote); cursor: pointer; }
.pinpad-demo:hover { color: var(--text); border-color: var(--text-3); }

/* Phones: filter chips wrap onto a second line instead of running off the edge (mobile check 2026-10-14). */
@media (max-width: 600px) {
  .chips { flex-wrap: wrap; overflow-x: visible; margin-inline: 0; padding-inline: 0; }
}

/* ===== Iteration 10, workstream D (docs/research/16-ui-audit.md) ===========================
   Touch targets as tokens (U-07, U-08): office controls are 44 px on a touch screen, every
   floor control 56 px (gloves). app.js mirrors the chrome on <html data-chrome>, so sheets and
   toasts on <body> follow it. The :root prefix lets these win over the per-view sheets. */
:root { --control-h: 34px; --seg-h: 40px; --chip-h: 36px; --field-h: 42px; }
@media (pointer: coarse) { :root:not([data-chrome="floor"]) { --control-h: 44px; --seg-h: 50px; --chip-h: 44px; --field-h: 44px; } }
:root[data-chrome="floor"] { --tap: 56px; --control-h: 56px; --seg-h: 62px; --chip-h: 56px; --field-h: 56px; --row-min: 56px; }
:root .btn-small { min-height: var(--control-h); }
:root .seg { min-height: var(--seg-h); }
:root .chip { min-height: var(--chip-h); }
:root .search input { height: var(--field-h); }
:root .search-clear { width: var(--tap); height: var(--tap); }
:root .tbl-open { display: flex; align-items: center; width: 100%; min-height: var(--tap); }
:root .mgr-seclink { min-width: var(--tap); justify-content: center; }
:root .navbar .navbar-signout { min-height: max(36px, var(--control-h)); }
@media (pointer: coarse) { :root .tip-inline .tip-x { width: var(--tap); height: var(--tap); } }
@media (pointer: coarse) {
  :root:not([data-chrome="floor"]) .lt-sub a, :root:not([data-chrome="floor"]) .lt-sub button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 2px; margin: 0; vertical-align: middle;
  }
  :root .switch { width: 64px; height: 44px; border-radius: 12px; }
  :root .switch::before { top: 4px; left: 4px; width: 36px; height: 36px; border-radius: 9px; }
  :root .switch:checked::before { transform: translateX(20px); }
}
/* the floor bar and everything the floor taps: 56 px */
:root .floorbar .seg { min-height: var(--seg-h); }
:root[data-chrome="floor"] .help-btn, :root[data-chrome="floor"] .floor-signout { min-height: var(--tap); }
:root[data-chrome="floor"] .me-btn { width: var(--tap); height: var(--tap); }
:root[data-chrome="floor"] .tip-x, :root[data-chrome="floor"] .tip-inline .tip-x { width: var(--tap); height: var(--tap); margin: -6px 0; }
:root[data-chrome="floor"] .emp-noteline-x { width: var(--tap); height: var(--tap); }
:root[data-chrome="floor"] .emp-st-where, :root[data-chrome="floor"] .side-link, :root[data-chrome="floor"] .strip-item { min-height: var(--tap); }
:root[data-chrome="floor"] .emp-choice { min-height: var(--tap); }
:root[data-chrome="floor"] .sheet-head .btn { min-height: var(--tap); min-width: var(--tap); }
:root[data-chrome="floor"] .sheet-head { min-height: 68px; }
.emp-stlink { display: inline-flex; align-items: center; min-height: var(--tap); }
@media (max-width: 767.98px) {
  :root[data-chrome="floor"] .help-btn, :root[data-chrome="floor"] .floor-signout { width: var(--tap); }
}
/* U-06: at iPad portrait the trail (Help, Me, Sign out) needs its room: the switch stops being centred
   and Help shows its icon only (its name stays the accessible name). */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .floorbar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .floorbar-center { width: min(360px, 40vw); }
  :root[data-chrome="floor"] .help-btn { width: var(--tap); padding: 0; }
  .help-btn span { display: none; }
}

/* U-09: a toast never covers the floor's pinned Done / More time / Problem bar */
:root[data-chrome="floor"]:has(.floor-actions) .toasts { --toast-lift: 112px; }

/* U-05: the Test drive pill never sits on the shop name or logo. Bottom left above the safe area
   (beside the sidebar, above the phone tab bar), under the floor bar on the floor, and not on a
   TV unless the address has ?td=1. Tooling only. */
:root .td-btn-corner { top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); left: 8px; }
:root .td-panel { top: auto; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); max-height: calc(100vh - 56px); }
@media (min-width: 768px) {
  /* in the sidebar's empty space, just above the account button: over nothing */
  :root[data-chrome="app"]:has(.shell[data-sidebar="open"]) .td-btn-corner { left: 18px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  :root[data-chrome="app"]:has(.shell[data-sidebar="open"]) .td-panel { bottom: calc(116px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 767.98px) {
  :root[data-chrome="app"] .td-btn-corner { bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom, 0px)); }
  :root[data-chrome="app"] .td-panel { bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom, 0px)); }
}
:root[data-chrome="floor"] .td-btn-corner { top: calc(72px + env(safe-area-inset-top, 0px) + 3px); bottom: auto; }
/* on the floor the pill gets its own lane under the bar (test shops only), so it covers no content */
:root[data-chrome="floor"]:has(.td-btn-corner) .shell[data-chrome="floor"] .main > .col { padding-top: 28px; }
:root[data-chrome="app"]:has(.td-btn-corner) .shell[data-chrome="app"] .main > .col { padding-bottom: 32px; }
:root[data-chrome="floor"] .td-panel { top: calc(100px + env(safe-area-inset-top, 0px)); bottom: auto; }
@media (max-width: 767.98px) { :root[data-chrome="floor"] .td-btn-corner { top: calc(64px + env(safe-area-inset-top, 0px) + 3px); } }
/* U-09: on the office screens a toast sits top right, under Sign out, clear of the lists and their buttons */
@media (min-width: 768px) {
  :root[data-chrome="app"] .toasts { top: calc(var(--navbar-h) + 4px); bottom: auto; justify-items: end; }
}
:root[data-chrome="kiosk"]:not([data-td]) .td-btn-corner { display: none; }

/* U-22: "+ New job" in the phone bar has its word; the bar gives the trail its room */
:root .navbar-primary { padding: 0 12px 0 9px; white-space: nowrap; flex: none; }
@media (max-width: 767.98px) { :root .navbar { grid-template-columns: auto minmax(0, 1fr) auto; } }
/* U-23: a Needs-you card keeps two lines for its reason or time */
:root .dco-need-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* U-21: the New job quick starts wrap on a phone instead of running off the edge */
@media (max-width: 767.98px) { :root .i4b-presets .chips.i4b-chips { flex-wrap: wrap; overflow-x: visible; margin-inline: 0; padding: 2px 0; } }
/* U-20: the sticky Total bar never hides the "not realistic" warning */
:root .mgr-warn { scroll-margin-bottom: 140px; }

/* U-28, U-29: the three contrast failures. "Total" on the dark New job bar uses the rail's
   secondary ink (7.4:1); brand text on a brand tint (selected chips, Learning) uses a stronger ink. */
:root .mgr-savebar .mgr-muted-inline { color: var(--on-rail-2, #A1A3A9); }
:root { --brand-ink-strong: color-mix(in srgb, var(--brand-ink) 78%, #000); }
:root[data-theme="dark"] { --brand-ink-strong: color-mix(in srgb, var(--brand-ink) 70%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --brand-ink-strong: color-mix(in srgb, var(--brand-ink) 70%, #fff); } }
:root .pill[data-tone="accent"] { --tone-text: var(--brand-ink-strong); }
:root .chip[data-tone="accent"] { --chip-tone: var(--brand-ink-strong); }
:root .emp-choice[aria-pressed="true"] { color: var(--brand-ink-strong); }

/* U-30 (D-224): High contrast, per device (Me > Settings, the account menu): <html data-contrast="more">.
   Darker secondary text, 3:1 control edges, heavier text and solid status colours, for bright shops. */
:root[data-contrast="more"] { --text-2: #2E3035; --text-3: #3A3C41; --line: #8E8D88; --line-strong: #5F5E5A; --on-rail-2: #D4D5D8; --brand-ink-strong: color-mix(in srgb, var(--brand-ink) 65%, #000); }
:root[data-contrast="more"][data-theme="dark"] { --text-2: #DCDDE0; --text-3: #C6C8CC; --line: #5A5D63; --line-strong: #8A8D93; --brand-ink-strong: color-mix(in srgb, var(--brand-ink) 55%, #fff); }
@media (prefers-color-scheme: dark) {
  :root[data-contrast="more"]:not([data-theme="light"]) { --text-2: #DCDDE0; --text-3: #C6C8CC; --line: #5A5D63; --line-strong: #8A8D93; --brand-ink-strong: color-mix(in srgb, var(--brand-ink) 55%, #fff); }
}
:root[data-contrast="more"] body { font-weight: 500; }
:root[data-contrast="more"] :is(b, strong, h1, h2, h3, .row-title) { font-weight: 700; }
:root[data-contrast="more"] .btn:not(.btn-plain):not(.btn-filled) { border-width: 2px; }
:root[data-contrast="more"] .chip { box-shadow: inset 0 0 0 2px var(--line-strong); }
:root[data-contrast="more"] .search { box-shadow: inset 0 0 0 2px var(--line-strong); }
:root[data-contrast="more"] .seg { box-shadow: inset 0 0 0 2px var(--line-strong); }
:root[data-contrast="more"] .pill[data-tone]:not([data-tone="neutral"]) { background: var(--tone-text); color: var(--panel); box-shadow: none; font-weight: 700; }
:root[data-contrast="more"] .pill[data-tone]:not([data-tone="neutral"]) .ico { color: inherit; }
:root[data-contrast="more"] .pill[data-tone="neutral"], :root[data-contrast="more"] .pill:not([data-tone]) { box-shadow: inset 0 0 0 2px var(--line-strong); color: var(--text); }
:root[data-contrast="more"] .switch { box-shadow: inset 0 0 0 2px var(--line-strong); }

/* U-12: the setup row on the owner's Overview (until setup reaches 100 %) */
.om-setup-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(80px, 160px) auto; align-items: center; gap: 12px;
  min-height: 56px; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r-group);
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); color: var(--text); text-decoration: none;
}
.om-setup-row > .ico:first-child { color: var(--brand-ink); }
.om-setup-text { display: grid; gap: 2px; min-width: 0; }
.om-setup-text span { font-size: var(--t-footnote); color: var(--text-2); }
@media (max-width: 767.98px) { .om-setup-row { grid-template-columns: auto minmax(0, 1fr) auto; } .om-setup-row .om-progress { display: none; } }
.om-quiet-numbers { text-decoration: none; }
/* U-41: Skip to content, visible only while focused */
.skip-link { position: fixed; z-index: 200; top: 8px; left: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-control); background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 600; transform: translateY(-200%); }
.skip-link:focus, .skip-link:focus-visible { transform: none; }
