/* NoMissedJobs v2 "Paper and Steel" tokens + components. GENERATED by tools/design/build_tokens.py from one table.
   Day = chalk paper you read, steel you press. Night = cab dark, the same steel, one dimmed amber light.
   Theme: follows the phone (prefers-color-scheme) unless html[data-theme] says day or night. */

:root {
  /* ---- Brand constants (never used directly by components) ---- */
  --brand-charcoal: #242A27; --brand-yellow: #FFCB32; --brand-chalk: #F3F1E9; --brand-grey: #646D66;

  /* ---- Type. 1rem = 16 px, stated on html below. Never size against the body. ---- */
  --font-ui: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-1: 1rem;      /* 16 px floor: meta, chips, captions, table cells */
  --fs-2: 1.125rem;  /* 18 px  field body, button labels */
  --fs-3: 1.25rem;   /* 20 px  card titles, list addresses, sheet options */
  --fs-4: 1.5rem;    /* 24 px  hero main line on desk, sheet titles (display) */
  --fs-5: 1.875rem;  /* 30 px  job address */
  --fs-6: 2.75rem;   /* 44 px  windshield address, money amount */
  --lh-body: 1.45; --lh-tight: 1.15;
  --type-hero: 1.375rem; --type-sheet-title: 1.625rem;
  --w-body-field: 400; --w-body-desk: 400; --w-label: 600; --w-strong: 600;
  --track-caps: .04em;

  /* ---- Space (4-based) ---- */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;

  /* ---- Radii: rounded = routine, chamfer = safety only, pill = label only ---- */
  --r-1: 8px; --r-2: 12px; --r-3: 16px; --r-4: 24px; --r-pill: 999px; --chamfer: 10px;

  /* ---- Targets and gaps (gloves: contact patch 75 to 100 pt) ---- */
  --tap-hero: 72px; --tap-1: 60px; --tap-2: 52px; --tap-row: 56px; --tap-desk: 44px;
  --gap-stack: 12px;   /* between any two stacked controls; 0 is never allowed */
  --gap-safety: 16px;  /* around anything irreversible or safety */
  --topbar-h: 68px;    /* 64 + the 4 px rule; holds the 52 px Stop pill */
  --dock-h: 218px;     /* tall phones (screen >= 740): 1 line + 7 + status 48 + 12 + row 52 + 12 + hero 72 + 14 = 218; 25.8% of 844 */
  --dock-h-short: 192px; /* short phones (screen < 740, iPhone SE): 1 + 5 + status 40 + 8 + row 52 + 12 + hero 64 + 10 = 192; 28.8% of 667 */
  --rail-w: 300px;     /* landscape (dash mount): the dock becomes a right-hand rail */

  /* ---- Motion: only to show what changed ---- */
  --m-fast: 120ms;  /* hero label crossfade */
  --m-base: 180ms;  /* sheet rise */
  --m-exit: 140ms;  /* sheet drop */
  --m-band: 200ms;  /* safety band, list collapse */
  --m-slow: 300ms;  /* tick draw */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --settle: 500ms;  /* hero ignores taps this long after its label changes */
  --settle-sheet: 300ms; /* and this long after a sheet opens or closes */
}

@font-face { font-family: Barlow; src: url('/app/dashboard/brand/fonts/barlow-latin-400-normal.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url('/app/dashboard/brand/fonts/barlow-latin-600-normal.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/app/dashboard/brand/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/app/dashboard/brand/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-style: normal; font-weight: 500; font-display: swap; }

:root, :root[data-theme="day"] {
  color-scheme: light;
  --bg: #F3F1E9;
  --surface: #FFFFFF;
  --surface-sunk: #E8E5DA;
  --sheet: #F3F1E9;
  --tile: #FFFFFF;
  --line: #D4D0C3;
  --line-strong: #7D857F;
  --ink: #242A27;
  --ink-2: #4A524C;
  --ink-3: #5F6761;
  --steel: #242A27;
  --steel-2: #2F3632;
  --steel-line: #48504B;
  --on-steel: #F3F1E9;
  --on-steel-2: #C9CCC5;
  --on-steel-line: #8A928B;
  --action: #FFCB32;
  --action-press: #F0B400;
  --on-action: #242A27;
  --rule: #FFCB32;
  --now: #FFCB32;
  --flag: #242A27;
  --on-flag: #FFFFFF;
  --focus: #242A27;
  --focus-steel: #FFCB32;
  --safety: #B42318;
  --on-safety: #FFFFFF;
  --safety-edge: #B42318;
  --safety-ink: #8F1D14;
  --safety-tint: #FBE3DF;
  --safety-on-steel: #FF8A7A;
  --ok: #2E6B45;
  --ok-tint: #E1EDE2;
  --ok-on-steel: #86C99A;
  --attn: #8A4F00;
  --attn-tint: #F6E8CC;
  --scrim: rgba(18, 22, 20, .5);
  --shadow-1: 0 1px 2px rgba(36, 42, 39, .08);
  --shadow-2: 0 -12px 32px rgba(36, 42, 39, .22);
  --photo-veil: rgba(0, 0, 0, 0);
  --fill-ring: #242A27;   /* the hero ring on paper (sun: yellow on white has no edge) */
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #141816;
  --surface: #1F2522;
  --surface-sunk: #101312;
  --sheet: #1A1F1C;
  --tile: #283029;
  --line: #343C37;
  --line-strong: #848C85;
  --ink: #D6D2C6;
  --ink-2: #A3A79F;
  --ink-3: #8A918A;
  --steel: #0B0E0D;
  --steel-2: #181C1A;
  --steel-line: #2E3532;
  --on-steel: #D6D2C6;
  --on-steel-2: #A3A79F;
  --on-steel-line: #737B74;
  --action: #D4A01F;
  --action-press: #BC8D18;
  --on-action: #141816;
  --rule: #8F6E18;
  --now: #D4A01F;
  --flag: #D4A01F;
  --on-flag: #141816;
  --focus: #D6D2C6;
  --focus-steel: #D4A01F;
  --safety: #A3241B;
  --on-safety: #FBEDEA;
  --safety-edge: #FF8A7A;
  --safety-ink: #FF9C8E;
  --safety-tint: #3A1714;
  --safety-on-steel: #FF8A7A;
  --ok: #86C99A;
  --ok-tint: #17301F;
  --ok-on-steel: #86C99A;
  --attn: #E8A25A;
  --attn-tint: #33260F;
  --scrim: rgba(0, 0, 0, .62);
  --shadow-1: none;
  --shadow-2: 0 -1px 0 #343C37;
  --photo-veil: rgba(0, 0, 0, .18);
  --fill-ring: transparent;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    color-scheme: dark;
    --bg: #141816;
    --surface: #1F2522;
    --surface-sunk: #101312;
    --sheet: #1A1F1C;
    --tile: #283029;
    --line: #343C37;
    --line-strong: #848C85;
    --ink: #D6D2C6;
    --ink-2: #A3A79F;
    --ink-3: #8A918A;
    --steel: #0B0E0D;
    --steel-2: #181C1A;
    --steel-line: #2E3532;
    --on-steel: #D6D2C6;
    --on-steel-2: #A3A79F;
    --on-steel-line: #737B74;
    --action: #D4A01F;
    --action-press: #BC8D18;
    --on-action: #141816;
    --rule: #8F6E18;
    --now: #D4A01F;
    --flag: #D4A01F;
    --on-flag: #141816;
    --focus: #D6D2C6;
    --focus-steel: #D4A01F;
    --safety: #A3241B;
    --on-safety: #FBEDEA;
    --safety-edge: #FF8A7A;
    --safety-ink: #FF9C8E;
    --safety-tint: #3A1714;
    --safety-on-steel: #FF8A7A;
    --ok: #86C99A;
    --ok-tint: #17301F;
    --ok-on-steel: #86C99A;
    --attn: #E8A25A;
    --attn-tint: #33260F;
    --scrim: rgba(0, 0, 0, .62);
    --shadow-1: none;
    --shadow-2: 0 -1px 0 #343C37;
    --photo-veil: rgba(0, 0, 0, .18);
    --fill-ring: transparent;
  }
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; /* 1rem = 16 px. The 15.2 px bug came from .95rem against an unset root. */
  -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: var(--w-body-field) var(--fs-2)/var(--lh-body) var(--font-ui);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.desk, body.customer { font-weight: var(--w-body-desk); }
body.desk { font-size: var(--fs-1); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-2); }
.on-steel :focus-visible, .topbar :focus-visible, .dock :focus-visible, .sheet-foot :focus-visible, .desk-top :focus-visible, .bnav :focus-visible { outline-color: var(--focus-steel); }

.mono, .hn { font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero; word-spacing: -.3em; }
/* Times and durations: Barlow with tabular figures. JetBrains Mono centres its colon in a full cell,
   so "10:50 PM" read as "10 : 50 PM" in every stage 2 shot. Mono stays for house numbers, phone numbers and money. */
.tnum, .t-time, time { font-family: var(--font-ui); font-variant-numeric: tabular-nums lining-nums; word-spacing: 0; }
.ic { width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle; }
.ic-16 { width: 16px; height: 16px; } .ic-20 { width: 20px; height: 20px; } .ic-22 { width: 22px; height: 22px; }
.ic-28 { width: 28px; height: 28px; } .ic-32 { width: 32px; height: 32px; }
.dim { color: var(--ink-2); }
.caps { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track-caps); }

/* Address lockup: the house number is the thing a tech matches against the house,
   so it is set in the one face built for unambiguous digits. Never condensed, never caps. */
.addr { font-weight: 600; line-height: var(--lh-tight); letter-spacing: -.005em; }
.addr .hn { font-weight: 500; letter-spacing: -.03em; margin-right: .18em; }

/* =====================================================================
   Phone frame (prototype only: centres the 390 layout on a laptop)
   ===================================================================== */
.phone-frame { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; background: var(--bg); }
.phone-frame main { padding: 0 0 calc(var(--dock-h) + 24px); }
.pad { padding: 0 16px; }
.stack > * + * { margin-top: var(--s-4); }

/* =====================================================================
   Safety shape: the chamfer (octagon corners). Reserved for the safety role.
   Rounded = routine. Pill = a label. Chamfer = stop. Reads in glare and in greyscale.
   ===================================================================== */
.chamfer { --c: var(--chamfer);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c)); }
.chamfer-edge { --c: var(--chamfer); --ci: calc(var(--chamfer) - 1.2px); position: relative; isolation: isolate; border: 0 !important;
  background: var(--edge, var(--safety-edge)) !important;
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c)); }
.chamfer-edge:focus-visible { outline: none; --edge: var(--focus); }
.dock .chamfer-edge:focus-visible, .sheet-foot .chamfer-edge:focus-visible, .topbar .chamfer-edge:focus-visible { --edge: var(--focus-steel); }
.chamfer-edge:focus-visible::before { inset: 3px; }
.chamfer-edge::before { content: ""; position: absolute; inset: 2px; z-index: -1; background: var(--fill, var(--surface));
  clip-path: polygon(var(--ci) 0, calc(100% - var(--ci)) 0, 100% var(--ci), 100% calc(100% - var(--ci)), calc(100% - var(--ci)) 100%, var(--ci) 100%, 0 calc(100% - var(--ci)), 0 var(--ci)); }

/* =====================================================================
   Top bar (steel). Never covered: sheets and scrims start below it,
   so the Stop control is in the same place over every sheet.
   ===================================================================== */
.topbar { position: sticky; top: 0; z-index: 70; height: var(--topbar-h); background: var(--steel); color: var(--on-steel);
  border-bottom: 4px solid var(--rule); display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.tb-btn { min-height: 52px; min-width: 52px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; border-radius: var(--r-2); color: var(--on-steel); font-weight: 600; font-size: var(--fs-2); text-decoration: none; }
.tb-btn:active { background: var(--steel-2); }
.tb-title { flex: 1; min-width: 0; padding-left: 8px; line-height: 1.1; }
.tb-title b { display: block; font: 700 var(--fs-3)/1.05 var(--font-display); text-transform: uppercase; letter-spacing: var(--track-caps); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title span { font-size: var(--fs-1); color: var(--on-steel-2); }
.tb-spacer { flex: 1; }
.tb-clock { flex: 1; text-align: right; padding-right: 12px; font-size: var(--fs-1); color: var(--on-steel-2); white-space: nowrap; } /* not used in v2: the phone shows the time */

/* Stop: outline = available, filled = a stop is open. 16 px exclusion zone. */
.stop-pill { --edge: var(--safety-on-steel); --fill: var(--steel); --c: 9px; --ci: 7.8px; margin-left: var(--gap-safety);
  min-height: 52px; padding: 0 18px 0 12px; display: inline-flex; align-items: center; gap: 8px; flex: none;
  color: var(--on-steel); font: 600 var(--fs-2)/1 var(--font-ui); text-decoration: none; white-space: nowrap; }
.stop-pill .ic { color: var(--safety-on-steel); }
.stop-pill.is-open { --fill: var(--safety); color: var(--on-safety); }
.stop-pill.is-open .ic { color: var(--on-safety); }
.stop-pill:active { --fill: var(--steel-2); }

/* =====================================================================
   The dock (steel). Fixed height, three rows; only the words change.
   ===================================================================== */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 480px; margin: 0 auto;
  min-height: var(--dock-h); background: var(--steel); color: var(--on-steel); border-top: 1px solid var(--steel-line);
  padding: 7px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.dock > .dock-row { margin-top: 12px; min-height: 52px; }
.dock > .btn-hero { margin-top: 12px; flex: none; }
/* The status line is the only feedback channel. It wraps to two lines inside its 48 px row and never ends in "...".
   Priority (one message at a time): safety > error > feedback with Undo > ambient. Offline has its own icon slot. */
.dock-status { min-height: 48px; flex: none; display: flex; align-items: center; gap: 8px; font-size: var(--fs-1); line-height: 1.2; color: var(--on-steel-2); }
.dock-status b { color: var(--on-steel); font-weight: 600; }
.dock-status .grow { flex: 1; min-width: 0; }
.dock-status .off { color: var(--on-steel); }
.dock-status .ic { width: 20px; height: 20px; color: var(--on-steel); }
.dock-status.is-ok .lead-ic { color: var(--ok-on-steel); }
.dock-status.is-safety { color: var(--on-steel); }
.dock-status.is-safety .lead-ic { color: var(--safety-on-steel); }
.dock-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-stack); }
.dock-row > :only-child { grid-column: 1 / -1; }

.btn-steel { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px;
  background: transparent; color: var(--on-steel); border: 2px solid var(--on-steel-line); border-radius: var(--r-2);
  font: 600 var(--fs-2)/1.1 var(--font-ui); text-decoration: none; white-space: nowrap; }
.btn-steel .ic { width: 22px; height: 22px; }
.btn-steel:active { background: var(--steel-2); }
.btn-steel.safety { --edge: var(--safety-on-steel); --fill: var(--steel); }
.btn-steel.safety .ic { color: var(--safety-on-steel); }
.btn-steel.sm { min-height: 48px; padding: 0 14px; font-size: var(--fs-1); flex: none; }
.btn-steel.tall { min-height: var(--tap-1); font-size: var(--fs-2); width: 100%; white-space: normal; text-align: center; }

/* The hero: the one filled button on any screen. */
.btn-hero { width: 100%; min-height: var(--tap-hero); display: grid; grid-template-columns: 32px minmax(0, 1fr) 24px; align-items: center; gap: 12px;
  padding: 8px 16px 8px 18px; background: var(--action); color: var(--on-action); border: 0; border-radius: 14px; text-align: left; text-decoration: none;
  font: 600 max(16px, 1.375rem)/1.1 var(--font-ui); transition: background var(--m-fast); }
.btn-hero .ic { width: 30px; height: 30px; }
.btn-hero .go { width: 24px; height: 24px; }
.hero-label { display: block; min-width: 0; transition: opacity var(--m-fast) var(--ease-out); }
.hero-kicker { display: block; font: 700 var(--fs-1)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px;
  text-wrap: balance; } /* never truncated either: it carries the side effect ("no text at night"). Copy budget 28 characters
  so it is one line at 390 pt; with large text it wraps and the hero grows upward. */
.hero-main { display: block; white-space: normal; text-wrap: balance; overflow-wrap: break-word; }
.hero-main.s20 { font-size: max(16px, 1.25rem); }
.hero-main .hn { letter-spacing: -.04em; }
.hero-main small { font: 600 var(--fs-1) var(--font-mono); margin-left: 6px; }
.btn-hero:active { background: var(--action-press); transform: translateY(1px); }
.btn-hero.is-swapping .hero-label { opacity: 0; }
.btn-hero.is-settling { pointer-events: none; }
.btn-hero.is-sending .hero-main::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.btn-hero.safety { --edge: var(--safety-on-steel); --fill: var(--safety); background: var(--safety); color: var(--on-safety); border-radius: 0; }
.btn-hero.safety:active { --fill: var(--steel-2); }
/* The stop hero keeps its full words ("Stop work and text the office"): it may wrap to two lines, never truncate. */
.btn-hero.safety.two { grid-template-columns: 32px minmax(0, 1fr); padding: 8px 18px; }
.btn-hero.safety.two .hero-main { white-space: normal; line-height: 1.1; text-wrap: balance; }
.foot-note { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: var(--fs-1); color: var(--on-steel-2); }
.foot-note b { color: var(--on-steel); font-weight: 600; }
.foot-note .ic { width: 20px; height: 20px; color: var(--on-steel); }
/* When a stop is open the brand rule under the top bar turns safety: the whole page says "stopped". */
.topbar.stopped { border-bottom-color: var(--safety-on-steel); }

/* =====================================================================
   Buttons on paper
   ===================================================================== */
.btn { min-height: var(--tap-1); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px;
  background: var(--tile); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r-2);
  font: 600 var(--fs-2)/1.15 var(--font-ui); text-decoration: none; text-align: center; }
.btn .ic { width: 22px; height: 22px; }
.btn.sm { min-height: var(--tap-2); padding: 0 14px; }
.btn.block { display: flex; width: 100%; }
.btn:active { background: var(--surface-sunk); }
.btn-quiet { min-height: var(--tap-2); display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; background: none; border: 0;
  color: var(--ink); font: 600 var(--fs-2)/1.1 var(--font-ui); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.btn-quiet .ic { width: 20px; height: 20px; }
.btn.safety { --edge: var(--safety-edge); --fill: var(--tile); color: var(--safety-ink); }
.btn.safety .ic { color: var(--safety-edge); }
/* states (shared by .btn and .btn-steel) */
.is-loading .ic-spin, .is-loading .btn-dots { display: inline-block; }
.btn[disabled], .btn-steel[disabled] { border-style: solid; border-color: var(--line); color: var(--ink-3); background: var(--surface-sunk); cursor: not-allowed; }
.btn-steel[disabled] { background: transparent; border-color: var(--steel-line); color: var(--on-steel-2); }
.btn.is-queued { border-color: var(--line-strong); }
.btn.is-done { border-color: var(--ok); color: var(--ok); }

/* Tick draw: the one confirmation that must be seen at a glance (kept under reduced motion as a plain tick). */
.tick path { stroke-dasharray: 24; stroke-dashoffset: 0; }
.tick.draw path { animation: draw var(--m-slow) var(--ease-out) both; }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }

/* =====================================================================
   Status chips: a pill is a label (never tappable). Icon + word, always.
   ===================================================================== */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 9px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 var(--fs-1)/1 var(--font-ui); white-space: nowrap; }
.chip .ic { width: 20px; height: 20px; color: var(--ink-2); }
.chip.ok .ic { color: var(--ok); }
.chip.attn .ic { color: var(--attn); }
.chip.live .ic { color: var(--ink); }
.chip.live::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 2px var(--ink); margin-left: 4px; }
.chip.hazard .ic { color: var(--attn); }
.chip.stopped { --c: 7px; border: 0; border-radius: 0; background: var(--safety); color: var(--on-safety); padding: 0 12px 0 9px; }
.chip.stopped .ic { color: var(--on-safety); }
.chip.quiet { border-style: solid; border-color: var(--line); background: transparent; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-1)/1.2 var(--font-ui); color: var(--ink-2); }
.tag .ic { width: 20px; height: 20px; }

/* =====================================================================
   Segmented control and filter chips (tappable = rounded rectangle, never a pill)
   ===================================================================== */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { min-height: var(--tap-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--line-strong); background: var(--tile); border-radius: var(--r-2); font: 600 var(--fs-2)/1 var(--font-ui); color: var(--ink); }
.seg button .n { font: 400 var(--fs-1) var(--font-ui); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.seg button .ic { display: none; width: 20px; height: 20px; }
.seg button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg button[aria-pressed="true"] .ic { display: inline-block; }
.desk .seg button { min-height: var(--tap-desk); font-size: var(--fs-1); }

/* =====================================================================
   Cards and sections
   ===================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 16px; box-shadow: var(--shadow-1); }
.sec { padding: 20px 16px 4px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px;
  font: 700 var(--fs-2)/1.15 var(--font-display); text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--ink); }
.sec-h small { font: 500 var(--fs-1)/1.2 var(--font-ui); text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.fold { display: flex; align-items: center; gap: 12px; min-height: var(--tap-row); padding: 0 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-1); }
.fold b { color: var(--ink); font-weight: 600; }
.fold .ic { color: var(--ink-2); }
.fold .grow { flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--fs-1); }
.kv dt { font: 700 var(--fs-1)/1.4 var(--font-display); text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--ink-2); }
.kv dd { margin: 0; color: var(--ink); }

/* =====================================================================
   Job header
   ===================================================================== */
.jh { padding: 18px 16px 6px; }
.eyebrow { font: 700 var(--fs-1)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.jh .addr { font-size: var(--fs-5); margin-top: 6px; }
.jh-sub { margin-top: 6px; color: var(--ink-2); font-size: var(--fs-2); }
.jh-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.jh-chips .when { font-size: var(--fs-1); color: var(--ink-2); }
.windshield .addr { font-size: var(--fs-6); line-height: 1.04; letter-spacing: -.015em; }
.windshield .addr .hn { display: block; }

/* =====================================================================
   Ticket cards (the route and the job list)
   ===================================================================== */
.tickets { display: grid; gap: var(--gap-stack); padding: 0 16px; }
.ticket { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 96px; background: var(--surface); border: 1px solid var(--line-strong);
  border-left-width: 6px; border-radius: var(--r-3); text-decoration: none; color: inherit; }
.ticket .t-time { padding: 16px 0 14px 12px; font-size: var(--fs-3); font-weight: 600; line-height: 1.05; }
.ticket .t-time small { display: block; font-size: var(--fs-1); font-weight: 500; color: var(--ink-2); margin-top: 2px; }
.ticket .t-body { padding: 14px 14px 14px 0; min-width: 0; }
.ticket .addr { font-size: var(--fs-3); }
.ticket .t-sub { color: var(--ink-2); font-size: var(--fs-1); margin-top: 4px; }
.ticket .t-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ticket.is-next { border: 2px solid var(--ink); border-left: 8px solid var(--now); box-shadow: inset 2px 0 0 var(--ink); }
.ticket.is-live { border-left-color: var(--ink); }
.ticket.is-stopped { border-left-color: var(--safety); }
.next-flag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--flag); color: var(--on-flag);
  font: 700 var(--fs-1)/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.row-done { display: flex; align-items: center; gap: 12px; min-height: var(--tap-row); padding: 0 16px; color: var(--ink-2); font-size: var(--fs-1); border-bottom: 1px solid var(--line); }
.row-done .ic { color: var(--ok); }
.row-done .addr { color: var(--ink); font-size: var(--fs-2); font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-done time { font-weight: 600; color: var(--ink); }
.row-done.just { animation: collapse var(--m-band) var(--ease-out) both; }
@keyframes collapse { from { min-height: 96px; } to { min-height: var(--tap-row); } }

/* Route strip: one segment per property. Progress of the route, never of a person. */
.route { padding: 16px 16px 20px; }
.route-big { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.route-big b { font: 700 var(--fs-6)/1 var(--font-display); letter-spacing: -.01em; }
.route-big span { font-size: var(--fs-2); color: var(--ink-2); }
.route-strip { display: grid; grid-template-columns: repeat(var(--n, 20), 1fr); gap: 3px; height: 14px; margin-top: 12px; }
.route-strip i { border-radius: 2px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.route-strip i.d { background: var(--ink); box-shadow: none; }
.route-strip i.n { background: var(--now); box-shadow: inset 0 0 0 2px var(--ink); }
.route-meta { margin-top: 10px; display: flex; justify-content: space-between; font-size: var(--fs-1); color: var(--ink-2); }

/* =====================================================================
   Sheets. Paper body, steel foot (you press on steel), ticket stub on top.
   The top bar is never covered: the scrim starts under it.
   ===================================================================== */
.scrim { position: fixed; left: 0; right: 0; bottom: 0; top: var(--topbar-h); z-index: 30; background: var(--scrim); }
.scrim.over { z-index: 50; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-width: 480px; margin: 0 auto;
  max-height: calc(100dvh - var(--topbar-h) - 10px); display: flex; flex-direction: column; background: var(--sheet);
  border-radius: var(--r-4) var(--r-4) 0 0; box-shadow: var(--shadow-2); overflow: hidden; animation: rise var(--m-base) var(--ease-out); }
.sheet.over { z-index: 60; }
.sheet.under { top: calc(var(--topbar-h) + 8px); transform: scale(.94); transform-origin: 50% 0; }
.sheet.over { max-height: calc(100dvh - var(--topbar-h) - 30px); }
.sheet.full { height: calc(100dvh - var(--topbar-h) - 10px); }
@keyframes rise { from { transform: translateY(28px); opacity: .6; } to { transform: none; opacity: 1; } }
.stub { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 20px; background: var(--surface-sunk); color: var(--ink-2);
  font-size: var(--fs-1); border-bottom: 1px dashed var(--line-strong); }
.stub b { color: var(--ink); font-weight: 600; }
.stub .hn { font-weight: 500; }
.stub .ic { width: 20px; height: 20px; }
.sheet-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 6px 10px 2px 6px; }
.sheet-head h2 { font: 700 max(16px, 1.625rem)/1.05 var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.sheet-head .back { min-height: 52px; min-width: 52px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: var(--r-2); color: var(--ink); }
.sheet-head .step { font: 400 var(--fs-1) var(--font-ui); font-variant-numeric: tabular-nums; color: var(--ink-2); padding-right: 6px; }
.sheet-lead { padding: 4px 18px 0; color: var(--ink-2); font-size: var(--fs-2); }
.sheet-body { flex: 1; overflow: auto; padding: 12px 16px 16px; }
/* Scrolled option sheets (short phones): a shade at the top edge says there is more above. */
.sheet-body.more-above { box-shadow: inset 0 16px 12px -12px rgba(0, 0, 0, .28); }
:root[data-theme="night"] .sheet-body.more-above { box-shadow: inset 0 16px 12px -12px rgba(0, 0, 0, .85); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) .sheet-body.more-above { box-shadow: inset 0 16px 12px -12px rgba(0, 0, 0, .85); } }
.sheet-foot { background: var(--steel); color: var(--on-steel); padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: var(--gap-stack); }
.sheet-foot .safety-gap { margin-top: 4px; }
.steps { display: flex; gap: 6px; padding: 0 18px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-sunk); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.steps i.d { background: var(--ink); box-shadow: none; }

/* Options (Finish outcomes, reasons): outline tiles with their consequence. */
.options { display: grid; gap: var(--gap-stack); }
.option { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 14px; align-items: start; min-height: 64px; padding: 12px 16px;
  background: var(--tile); border: 2px solid var(--line-strong); border-radius: var(--r-2); color: var(--ink); text-align: left; }
.option .ic { width: 28px; height: 28px; grid-row: span 2; margin-top: 1px; color: var(--ink-2); }
.option b { font: 600 var(--fs-3)/1.2 var(--font-ui); }
.option span { font-size: var(--fs-1); color: var(--ink-2); line-height: 1.35; }
.option.hz .ic { color: var(--attn); }
.option.attn .ic { color: var(--attn); }
.option:active { border-color: var(--ink); }

/* Tiles: hazard picks, stop reasons. 2-up only for <= 10 options of equal weight. */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-stack); }
.tile { display: flex; align-items: center; gap: 12px; min-height: var(--tap-row); padding: 8px 12px; background: var(--tile);
  border: 2px solid var(--line-strong); border-radius: var(--r-2); font: 600 var(--fs-2)/1.15 var(--font-ui); color: var(--ink); text-align: left; }
.tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tile.wide { grid-column: 1 / -1; }

/* One checkbox, drawn in tokens, everywhere (28 px box, whole row is the target). */
.box { width: 28px; height: 28px; flex: none; border-radius: 7px; border: 2px solid var(--line-strong); background: var(--surface); display: inline-grid; place-items: center; }
.box .ic { width: 20px; height: 20px; color: var(--surface); visibility: hidden; stroke-width: 3; }
[aria-pressed="true"] > .box, [aria-checked="true"] > .box, .box.on { background: var(--ink); border-color: var(--ink); }
[aria-pressed="true"] > .box .ic, [aria-checked="true"] > .box .ic, .box.on .ic { visibility: visible; }
.check-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: var(--tap-row); padding: 8px 14px; background: var(--tile);
  border: 2px solid var(--line-strong); border-radius: var(--r-2); text-align: left; color: var(--ink); font: 500 var(--fs-2)/1.25 var(--font-ui); }
.check-rows { display: grid; gap: var(--gap-stack); }

/* Who's signing: people as 60 pt rows with a method and a state word. */
.person { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: var(--tap-1); padding: 8px 12px;
  background: var(--tile); border: 2px solid var(--line-strong); border-radius: var(--r-2); color: var(--ink); text-align: left; width: 100%; }
.person .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunk); font: 600 var(--fs-1) var(--font-ui); color: var(--ink); }
.person b { display: block; font-weight: 600; font-size: var(--fs-2); }
.person small { display: block; font-size: var(--fs-1); color: var(--ink-2); }
.person .state { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-1)/1 var(--font-ui); }
.person .state .ic { width: 22px; height: 22px; }
.person[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.person .state.ok .ic { color: var(--ok); }

/* =====================================================================
   Safety components
   ===================================================================== */
.danger-line { text-wrap: balance; --edge: var(--safety-edge); --fill: var(--safety-tint); display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; padding: 14px 16px; color: var(--ink); font: 600 var(--fs-2)/1.3 var(--font-ui); }
.danger-line .ic { width: 28px; height: 28px; color: var(--safety-edge); }
.legal { font-size: var(--fs-1); color: var(--ink); line-height: 1.45; padding: 12px 2px 0; }
.band-stop { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 12px; padding: 14px 16px 16px; background: var(--safety-tint);
  border-bottom: 1px solid var(--line); animation: band var(--m-band) var(--ease-out); }
@keyframes band { from { transform: translateY(-12px); opacity: .4; } to { transform: none; opacity: 1; } }
.band-stop > .ic { width: 30px; height: 30px; color: var(--safety-edge); grid-row: span 3; }
.band-stop .k { font: 700 var(--fs-1)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--safety-ink); }
.band-stop h2 { font: 600 var(--fs-3)/1.2 var(--font-ui); color: var(--ink); }
.band-stop .seen { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: var(--fs-1); font-weight: 600; color: var(--ink); }
.band-stop .seen .ic { width: 22px; height: 22px; color: var(--ink-2); }
.band-stop .seen.is-seen .ic { color: var(--ok); }

/* =====================================================================
   Photos, shot list, Talk
   ===================================================================== */
.shots { display: flex; flex-wrap: wrap; gap: 10px; }
.shot { min-height: var(--tap-2); display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 10px; background: var(--tile);
  border: 2px solid var(--line-strong); border-radius: var(--r-2); font: 600 var(--fs-2)/1 var(--font-ui); color: var(--ink); }
.shot .ic { width: 22px; height: 22px; color: var(--ink-2); }
.shot.taken { border-color: var(--ok); background: var(--ok-tint); }
.shot.taken .ic { color: var(--ok); }
.shot.next { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.shot.next .ic { color: var(--ink); }
.shot em { font-style: normal; font-weight: 500; font-size: var(--fs-1); color: var(--ink-2); }
.last-shot { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); margin-top: 14px; }
.ph { width: 96px; height: 128px; border-radius: 10px; object-fit: cover; background: var(--surface-sunk); }
.ph-stand { display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-2); font-size: var(--fs-1); text-align: center;
  background: repeating-linear-gradient(135deg, var(--surface-sunk) 0 8px, var(--surface) 8px 16px); border: 1px solid var(--line); }
.last-shot .stage { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.last-shot .stage b { font: 600 var(--fs-3)/1.1 var(--font-ui); }
.vis-note { display: flex; align-items: center; gap: 8px; font-size: var(--fs-1); color: var(--ink-2); margin-top: 8px; }
.vis-note .ic { width: 20px; height: 20px; }
.talk-row { display: flex; gap: var(--gap-stack); margin-top: 12px; align-items: center; }
.levels { display: inline-flex; align-items: center; gap: 3px; height: 28px; }
/* Level meter: in the product the bar heights come from the mic level (Web Audio AnalyserNode), so the tech
   sees the phone hearing them over wind and engines. The prototype fakes it with a gentle loop. */
.levels i { width: 4px; border-radius: 2px; background: currentColor; height: 100%; transform-origin: 50% 50%; animation: lv 900ms ease-in-out infinite alternate; }
.levels i:nth-child(1) { transform: scaleY(.35); } .levels i:nth-child(2) { transform: scaleY(.7); animation-delay: -.2s; } .levels i:nth-child(3) { transform: scaleY(1); animation-delay: -.5s; }
.levels i:nth-child(4) { transform: scaleY(.55); animation-delay: -.1s; } .levels i:nth-child(5) { transform: scaleY(.85); animation-delay: -.7s; }
.levels i:nth-child(6) { transform: scaleY(.45); animation-delay: -.35s; } .levels i:nth-child(7) { transform: scaleY(.25); animation-delay: -.6s; }
@keyframes lv { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
.rec-bar { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-height: 52px; padding: 0 6px 0 16px;
  border: 2px solid var(--on-steel); border-radius: var(--r-2); color: var(--on-steel); }
.rec-bar .t { font: 600 var(--fs-2) var(--font-ui); font-variant-numeric: tabular-nums; }
.rec-bar .lbl { font-size: var(--fs-1); color: var(--on-steel-2); white-space: nowrap; }
.transcript { margin-top: 10px; padding: 12px 14px; border: 2px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); font-size: var(--fs-2); line-height: 1.45; }
.skel { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--surface-sunk), var(--line), var(--surface-sunk)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* =====================================================================
   Inputs (one style; visible in Night)
   ===================================================================== */
.field { display: grid; gap: 6px; }
.field > span { font: 600 var(--fs-1) var(--font-ui); color: var(--ink); }
.input, textarea.input, select.input { width: 100%; min-height: var(--tap-2); padding: 12px 14px; background: var(--surface); color: var(--ink);
  border: 2px solid var(--line-strong); border-radius: var(--r-2); font: 500 var(--fs-2)/1.4 var(--font-ui); -webkit-appearance: none; appearance: none; }
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--ink-3); }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.desk .input { min-height: var(--tap-desk); font-size: var(--fs-1); padding: 9px 12px; }

/* =====================================================================
   Empty, skeleton, toast
   ===================================================================== */
.empty { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--ink-2); font-size: var(--fs-2); }
.empty .ic { color: var(--ok); }
.toast { position: fixed; left: 12px; right: 12px; bottom: 80px; z-index: 65; max-width: 456px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 6px 6px 6px 14px; background: var(--steel); color: var(--on-steel); border-radius: var(--r-2); border-left: 4px solid var(--ok-on-steel); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast .grow { flex: 1; font-size: var(--fs-1); }
.toast .ic { color: var(--ok-on-steel); }

/* =====================================================================
   Desk
   ===================================================================== */
.desk-top { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 24px; background: var(--steel); color: var(--on-steel); border-bottom: 4px solid var(--rule); }
.brandlock { display: flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none; color: var(--on-steel); min-width: 0; }
.brandlock .mark { width: 30px; height: 30px; color: var(--brand-yellow); }
:root[data-theme="night"] .brandlock .mark { color: var(--action); }
.brandlock b { font: 700 max(16px, 1.375rem)/1 var(--font-display); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.dnav { display: flex; align-items: stretch; height: 64px; margin-left: 12px; }
.dnav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 16px; color: var(--on-steel-2); text-decoration: none; font: 600 var(--fs-2)/1 var(--font-ui); border-bottom: 4px solid transparent; margin-bottom: -4px; }
.dnav a[aria-current="page"] { color: var(--on-steel); background: var(--steel-2); border-bottom-color: var(--action); }
.dnav a .ic { width: 22px; height: 22px; }
.badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--on-steel); color: var(--steel); font: 600 max(16px, 14px)/1 var(--font-ui); }
.badge.safety { --c: 6px; border-radius: 0; background: var(--safety); color: var(--on-safety); outline: 0; }
.desk-top .spacer { flex: 1; }
.recep { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-1); color: var(--on-steel-2); white-space: nowrap; }
.recep b { color: var(--on-steel); font-weight: 600; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok-on-steel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-on-steel) 30%, transparent); }
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 480px; margin: 0 auto; height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--steel); border-top: 1px solid var(--steel-line); }
.bnav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--on-steel-2); text-decoration: none; font: 600 var(--fs-1)/1 var(--font-ui); }
.bnav a .ic { width: 26px; height: 26px; }
.bnav a[aria-current="page"] { color: var(--on-steel); box-shadow: inset 0 4px 0 var(--action); }
.bnav .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 22px; height: 22px; font-size: max(16px, 13px); }
.desk-phone main { padding-bottom: 96px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px 16px 8px; }
.page-h h1 { font: 700 var(--fs-5)/1.05 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.page-h p { color: var(--ink-2); font-size: var(--fs-1); margin-top: 4px; }

/* Needs you: one line, one button, Open. Ordered by severity. */
.needs { display: grid; gap: var(--gap-stack); }
.need { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 14px 14px 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.need > .ic { width: 28px; height: 28px; margin-top: 2px; color: var(--ink-2); }
.need .what { font: 600 var(--fs-2)/1.3 var(--font-ui); color: var(--ink); }
.need .what .hn { font-weight: 500; }
.need .why { grid-column: 2; font-size: var(--fs-1); color: var(--ink-2); line-height: 1.4; }
.need .acts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: var(--gap-stack); margin-top: 10px; align-items: center; }
.need .acts .open { margin-left: auto; }
.need.attn > .ic { color: var(--attn); }
.need.ok > .ic { color: var(--ok); }
.need.stop { --edge: var(--safety-edge); --fill: var(--safety-tint); --c: 12px; --ci: 10.8px; border: 0; border-radius: 0; padding: 16px 16px 16px 18px; }
.need.stop > .ic { color: var(--safety-edge); }
.need.stop .k { font: 700 var(--fs-1)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--safety-ink); }
.need .folded { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: var(--fs-1); color: var(--ink-2); }
.desk .btn { min-height: 48px; font-size: var(--fs-1); padding: 0 16px; }
.desk .btn-quiet { min-height: 44px; font-size: var(--fs-1); }
.btn-fill { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 0; border-radius: var(--r-2);
  background: var(--action); color: var(--on-action); font: 600 var(--fs-1)/1 var(--font-ui); text-decoration: none; box-shadow: inset 0 0 0 2px var(--fill-ring); }
.btn-fill.safety { --edge: var(--safety-edge); --fill: var(--safety); color: var(--on-safety); box-shadow: none; }
.btn-fill.safety .ic { color: var(--on-safety); }
.btn-fill .ic, .desk .btn .ic { width: 20px; height: 20px; }

/* The board: who is where, from their own taps. No map, no speeds, no rank. */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.board-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.board-row:last-child { border-bottom: 0; }
.board-row .who { font: 600 var(--fs-2)/1.2 var(--font-ui); }
.board-row .where { grid-column: 1; font-size: var(--fs-1); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row .where .hn { color: var(--ink); font-weight: 500; }
.board-row .chip { grid-row: 1 / span 2; grid-column: 2; justify-self: end; }
.board-row .t { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.board-foot { padding: 12px 16px; font-size: var(--fs-1); color: var(--ink-2); background: var(--surface-sunk); }

/* Schedule rows: phone <= 96 pt, two lines; wide = table. */
.sched { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.srow { display: grid; grid-template-columns: 76px minmax(0, 1fr) 44px; gap: 2px 10px; align-items: center; padding: 10px 6px 10px 14px; border-bottom: 1px solid var(--line); min-height: 76px; }
.srow:last-child { border-bottom: 0; }
.srow .tm { font: 600 var(--fs-1)/1.2 var(--font-ui); font-variant-numeric: tabular-nums; }
.srow .addr { font-size: var(--fs-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .meta { grid-column: 2; display: flex; align-items: center; gap: 8px; font-size: var(--fs-1); color: var(--ink-2); min-width: 0; }
.srow .meta .chip { height: 28px; }
.srow .dots { grid-row: 1 / span 2; grid-column: 3; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--ink); border-radius: var(--r-2); }
.icon-btn:active { background: var(--surface-sunk); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.tbl th { text-align: left; font: 700 var(--fs-1)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--ink-2); padding: 10px 12px; border-bottom: 2px solid var(--line-strong); background: var(--surface); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .tm { font: 600 var(--fs-1) var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .addr { font-size: var(--fs-1); }
.tbl td.act { width: 1%; white-space: nowrap; text-align: right; }

/* =====================================================================
   Customer documents
   ===================================================================== */
.doc-band { background: var(--steel); color: var(--on-steel); border-bottom: 4px solid var(--rule); padding: 22px 20px 20px; }
.doc-band .k { font: 700 var(--fs-1)/1 var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--on-steel-2); }
.doc-band h1 { font: 700 max(16px, 2.125rem)/1.05 var(--font-display); text-transform: uppercase; letter-spacing: .01em; margin-top: 6px; }
.doc-band .line { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--on-steel-2); font-size: var(--fs-1); }
.where-strip { display: flex; gap: 6px; align-items: center; padding: 12px 20px; font-size: var(--fs-1); color: var(--ink-2); background: var(--surface-sunk); overflow-x: auto; white-space: nowrap; }
.where-strip b { color: var(--ink); }
.doc, .phone-frame main.doc { padding: 0 20px 32px; }
.facts { margin: 20px 0 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 4px 18px; }
.facts > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 2px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font: 700 var(--fs-1)/1.45 var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.facts dd { margin: 0; font: 600 var(--fs-2)/1.35 var(--font-ui); color: var(--ink); }
.facts dd small { display: block; font: 400 var(--fs-1)/1.4 var(--font-ui); color: var(--ink-2); margin-top: 4px; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.ba figure { margin: 0; }
.ba .frame { position: relative; border-radius: var(--r-3); overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface-sunk); }
.ba img { width: 100%; height: 100%; object-fit: cover; }
.ba .frame::after { content: ""; position: absolute; inset: 0; background: var(--photo-veil); }
.ba .lbl { position: absolute; left: 8px; top: 8px; z-index: 1; display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--brand-charcoal); color: var(--brand-chalk); font: 700 var(--fs-1)/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; box-shadow: inset 0 -3px 0 var(--brand-yellow); }
.ba figcaption { font-size: var(--fs-1); color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
.ba figcaption time { display: block; font-weight: 600; color: var(--ink); margin-top: 2px; }
.doc-actions { margin-top: 24px; background: var(--steel); border-radius: var(--r-3); padding: 14px; display: grid; gap: var(--gap-stack); }
.doc-actions .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-stack); }
.privacy { margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: var(--tap-row); font-weight: 600; cursor: pointer; }
.privacy summary::-webkit-details-marker { display: none; }
.doc-foot { padding: 20px 20px 112px; color: var(--ink-2); font-size: var(--fs-1); line-height: 1.5; }
/* The record's one action stays at the thumb: a slim steel bar, not an app dock (no status, no secondary row). */
.doc-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 480px; margin: 0 auto; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--steel); border-top: 1px solid var(--steel-line); }


/* =====================================================================
   Photo pair as thumbnails while working (Night: a full-size sunny snow photo is the one
   bright slab the tokens cannot dim). Full 3:4 pair only on finished screens and the record.
   ===================================================================== */
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.thumb { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.thumb img { width: 72px; height: 96px; border-radius: 8px; object-fit: cover; }
.thumb .frame { position: relative; width: 72px; height: 96px; border-radius: 8px; overflow: hidden; }
.thumb .frame::after { content: ""; position: absolute; inset: 0; background: var(--photo-veil); }
.thumb b { display: block; font: 600 var(--fs-2)/1.1 var(--font-ui); }
.thumb span { display: block; font-size: var(--fs-1); color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.thumb .ic { width: 20px; height: 20px; color: var(--ok); vertical-align: -4px; }

/* Judgement sheets (carry on after a stop, resolve): no filled button. Two tall outlines, 16 px apart,
   the riskier answer never in the bottom slot by default. */
.judge { display: grid; gap: var(--gap-safety); }
.check-quote { padding: 14px 16px; border-left: 4px solid var(--line-strong); background: var(--surface); border-radius: 0 var(--r-2) var(--r-2) 0; font-size: var(--fs-2); }
.check-quote cite { display: block; font-style: normal; font-size: var(--fs-1); color: var(--ink-2); margin-top: 6px; }

/* Solo shops: no board; one line about the day. */
.your-day { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); font-size: var(--fs-1); color: var(--ink-2); }
.your-day b { color: var(--ink); font-weight: 600; }

/* =====================================================================
   Dock classes. The class is chosen once from the phone's screen, not the viewport,
   so Safari's toolbar collapsing on scroll never resizes the dock under a thumb.
   tall: screen >= 740 (default) · short: html.dock-short (iPhone SE 667) · landscape: the rail.
   Large text: every row is min-height, so the dock grows instead of clipping.
   While the keyboard is open the dock hides (html.kb-open), so it never floats over a field.
   ===================================================================== */
html.dock-short { --dock-h: var(--dock-h-short); }
html.dock-short .dock { padding-top: 5px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
html.dock-short .dock-status { min-height: 40px; }
html.dock-short .dock > .dock-row { margin-top: 8px; }
html.dock-short .dock > .btn-hero { min-height: 64px; margin-top: 12px; }
html.dock-short .dock-status .undo { display: none; }       /* short phones: Undo takes the row's right-hand slot */
html:not(.dock-short) .dock-row .undo-slot { display: none; }
html.dock-short .dock-row .hide-short { display: none; }
html.kb-open .dock { display: none; }

@media (orientation: landscape) and (max-height: 500px) {
  .phone-frame { max-width: none; }
  .phone-frame main { padding: 0 calc(var(--rail-w) + 16px) 24px 0; }
  .dock { left: auto; right: 0; top: var(--topbar-h); bottom: 0; width: var(--rail-w); max-width: none; margin: 0;
    justify-content: flex-end; border-top: 0; border-left: 1px solid var(--steel-line); padding: 8px 14px calc(12px + env(safe-area-inset-bottom)); }
  .dock-row { grid-template-columns: 1fr; }
  .dock-row > * + * { margin-top: 0; }
  .windshield .addr { font-size: max(16px, 2.25rem); }
  .windshield .addr .hn { display: inline; }
  .windshield .jh { padding-top: 12px; }
}

@media print {
  :root { color-scheme: light; }
  .dock, .topbar, .bnav, .doc-actions, .doc-dock { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
  .levels i { animation: none !important; }
}

/* Prototype-only chrome (state switcher on wide screens; hidden in shots) */
.proto-nav { position: fixed; right: 12px; top: 72px; z-index: 90; display: none; flex-direction: column; gap: 6px; font: 500 max(16px, 14px)/1.2 var(--font-ui); }
@media (min-width: 900px) { .phone-page .proto-nav { display: flex; } }
.proto-nav a, .proto-nav button { display: block; padding: 8px 12px; border-radius: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); text-decoration: none; text-align: left; cursor: pointer; }
.proto-nav [aria-current="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.shot-mode .proto-nav { display: none !important; }

/* =====================================================================
   Forced states for the specimen sheet (same look as the live states)
   ===================================================================== */
.btn-hero.is-pressed { background: var(--action-press); transform: translateY(1px); }
.btn-steel.is-pressed { background: var(--steel-2); }
.btn.is-pressed { background: var(--surface-sunk); }
.btn-hero.is-done { background: var(--action); }
.btn-hero.is-done .ic:first-child path { stroke-dasharray: 24; animation: draw var(--m-slow) var(--ease-out) both; }
.btn .spin, .btn-steel .spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.queued-note { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-1); color: var(--ink-2); }


@media print { :root, :root[data-theme="night"], :root:not([data-theme="day"]) { color-scheme: light; } :root, :root[data-theme="night"], :root:not([data-theme="day"]) {
  --bg: #F3F1E9;
  --surface: #FFFFFF;
  --surface-sunk: #E8E5DA;
  --sheet: #F3F1E9;
  --tile: #FFFFFF;
  --line: #D4D0C3;
  --line-strong: #7D857F;
  --ink: #242A27;
  --ink-2: #4A524C;
  --ink-3: #5F6761;
  --steel: #242A27;
  --steel-2: #2F3632;
  --steel-line: #48504B;
  --on-steel: #F3F1E9;
  --on-steel-2: #C9CCC5;
  --on-steel-line: #8A928B;
  --action: #FFCB32;
  --action-press: #F0B400;
  --on-action: #242A27;
  --rule: #FFCB32;
  --now: #FFCB32;
  --flag: #242A27;
  --on-flag: #FFFFFF;
  --focus: #242A27;
  --focus-steel: #FFCB32;
  --safety: #B42318;
  --on-safety: #FFFFFF;
  --safety-edge: #B42318;
  --safety-ink: #8F1D14;
  --safety-tint: #FBE3DF;
  --safety-on-steel: #FF8A7A;
  --ok: #2E6B45;
  --ok-tint: #E1EDE2;
  --ok-on-steel: #86C99A;
  --attn: #8A4F00;
  --attn-tint: #F6E8CC;
  --scrim: rgba(18, 22, 20, .5);
  --shadow-1: 0 1px 2px rgba(36, 42, 39, .08);
  --shadow-2: 0 -12px 32px rgba(36, 42, 39, .22);
  --photo-veil: rgba(0, 0, 0, 0);
  --fill-ring: #242A27;   /* the hero ring on paper (sun: yellow on white has no edge) */
} }
