/* css/tokens.css
   Owns: the design tokens (the UI plan §3.1), on :root. The only file allowed a colour literal: every other sheet,
   and every script through core/tokens.js, reads these.

   Dark is the only theme. A camera wall lives in a back office at 2am; a bright UI next to a black frame destroys
   whatever night vision the person looking at it has, and washes out exactly the dark detail they are reading. */

:root {
  /* Native form controls (Safari/iPhone above all) follow the dark palette: a <select> would otherwise paint white
     with our light text on it. */
  color-scheme: dark;

  /* surfaces */
  --bg: #0b0e13;  --bg-video: #05070a;  --panel: #11151b;  --panel-2: #161b23;  --panel-3: #1d2430;  /* hover */
  --line: #232a34;  --line-2: #3a434f;  --scrim: rgba(0,0,0,.55);  --scrim-strong: rgba(0,0,0,.9);  --scrim-soft: rgba(0,0,0,.3);
  --row-line: #161a21;  --tip-bg: #1b222c;                                    /* a table row's rule; a tooltip */
  --region-fill: rgba(77,163,255,.16);  --region-dim: rgba(0,0,0,.45);   /* Enhance: the box being drawn, the picture outside it */
  --black: #000;  --white: #fff;                                              /* pictures sit on black */
  /* text */
  --text: #e6edf5;  --text-2: #cfd6df;  --muted: #8b96a5;  --faint: #6f7f92;  --on-accent: #04121f;
  --on-err: #2a0b0b;                                                          /* text on a red (or amber) fill */
  /* accent and status: base / readable fg / tinted bg / border */
  --accent: #4da3ff;  --accent-hi: #58a6ff;  --accent-bg: #16283a;
  --ok: #3fb950;    --ok-fg: #6fd48a;    --ok-bg: #10281a;    --ok-line: #1d5233;
  --on-fg: #7ee0a0; --on-bg: #14331f;    --on-line: #266b3c;                 /* a toggle that is on */
  --warn: #d29922;  --warn-fg: #e8c46a;  --warn-bg: #2a2010;  --warn-line: #5a4416;
  --warnb-bg: #2e2408;  --warnb-line: #6b5410;                                /* a warn badge */
  --amber-fg: #f0c04a; --amber-bg: #3a2a08; --amber-line: #6b4f10;           /* SD, SIM, admin chip */
  --err: #ff6b6b;   --err-fg: #ff9a9a;   --err-bg: #2c1416;   --err-line: #6b2429;
  --danger: var(--err);  --danger-line: #5c2a2e;                              /* destructive actions */
  --info-bg: #0f1e30;  --info-line: #1f4a7a;                                  /* info (a toast) */
  --live-fg: #ff8f8f; --live-bg: #331414; --live-line: #7a2626;              /* LIVE pill, record dot */
  --bw-bg: #1c1f24;  --bw-line: #3a414b;                                      /* the DELAYED badge */

  /* event kinds: the timeline, the event rows, the kinds picker and the contact sheet's stripes all read these;
     a kind without a token of its own is drawn as --kind-other */
  /* each kind also has a .k-<kind> line in css/kit.css; a new kind needs both */
  --kind-motion: #5a7f9e; --kind-vehicle: #4da3ff; --kind-person: #ffb454; --kind-tamper: #ff6b6b;
  --kind-video_loss: #e03e3e; --kind-manual: #9d7cff; --kind-dwell: #e879f9; --kind-unpaid: #22d3ee;
  --kind-door_open: #a3e635; --kind-short_visit: #fb923c; --kind-animal: #c98a3a; --kind-overstay: #e0623a;
  --kind-acw_attend: #f97316;   /* a money or service problem at a bay */
  --kind-paid: #10b981;         /* the self-serve paid by card (its pay box, via DAN) */
  --kind-dial: #eab308;         /* the self-serve run by the office's manual dial */
  --kind-wash: #34d399;         /* a wash bay's paid wash (inc/bayvisits.php) */
  --kind-aborted: #f43f5e;      /* paid, and the wash stopped early */
  --kind-no_sale: #94a3b8;      /* in a wash bay with no card sale */
  --kind-other: #7a8797;

  /* timeline canvas (core/tokens.js palette('--tl-'): colours only) */
  --tl-bg: #0e1116;  --tl-lane-alt: #11151b;  --tl-grid: #20262f;  --tl-text: #6b7787;
  --tl-day: #3b4656;  --tl-day-text: #9aa7b6;  --tl-noon: #2a333f;
  /* the footage bar: red where nothing was recorded, hatched across a gap; green = continuous recording,
     amber = motion-only (it cannot be trusted complete), blue = recovered from the camera's own card */
  --tl-gap: #2a1416;  --tl-gap-edge: #a03030;
  --tl-cover: #1f6f43;  --tl-cover-motion: #8a6d1f;  --tl-cover-backfill: #2f6f8a;
  --tl-alert: #ff5a5a;  --tl-focus: #ffffff;  --tl-future: rgba(5, 7, 10, .6);
  --tl-playhead: #ff4d4d; --tl-sel: rgba(77,163,255,.16); --tl-sel-edge: var(--accent);
  /* before a security responder's hours (stage/access.js): its own slate hatch, never the red of missing footage */
  --tl-denied: #161b24;  --tl-denied-edge: #2a3240;  --tl-denied-text: #8b96a5;
  /* the same for a pane asked to show such a moment ("OUTSIDE YOUR HOURS") and a sheet tile that rolled out */
  --denied-bg: #12161d;  --denied-bg-2: #19202a;  --denied-fg: #b4c0cf;
  /* missing footage: a pane with no signal and a contact-sheet gap, red stripes (the timeline's own: --tl-gap*) */
  --err-bg-deep: #1e0d0e;  --err-bg-deeper: #180a0b;  --gap-line: #4a1c1f;  --gap-text: #a97b7b;
  /* the clip being marked (stage.css .selection-box; the canvas's is --tl-sel) */
  --sel-bg: #10222f;  --sel-line: #1d4a6b;

  /* the transport's kinds of button, one colour each (Wade, 2026-10-26): the ±10 s steps, the events, the tools */
  --nav-step-fg: #8ec5ff;  --nav-step-bg: #12233a;  --nav-step-line: #24476e;
  --nav-event-fg: var(--amber-fg); --nav-event-bg: #2a2108; --nav-event-line: #5c4612;
  --nav-tool-fg: #c9b2ff;  --nav-tool-bg: #1d1736;  --nav-tool-line: #42347a;
  /* events and alerts (side.css): an unread alert row, a high alert's rule, the alert ring on a kind dot, the event
     under the playhead, what the classifier saw */
  --unread-bg: #14181f;  --err-fg-hi: #ffb3b3;  --alert-ring: #c0392b;  --row-now-bg: #15291f;
  --obj-fg: #9fd3a6;  --desc-fg: #e8d9a0;  --desc-line: #6b5a1d;
  /* the contact sheet: a tile with an event in it */
  --tile-event-line: #6b5a2a;
  /* tank levels (Chemicals tiles, a notice's error edge) */
  --lvl-good: #2f9e5a;  --lvl-mid: #5a6470;  --lvl-bad: #d64545;
  /* the TV wall: the pane ring while the remote is on the scrubber */
  --tv-scrub-ring: #3d6b99;
  /* the zone editor: an outline being drawn, the zone being edited (its cells), the camera's other zones, an outline's
     inside, the cell lines */
  --zone-draw: #ffe066;
  --zone-on: rgba(77,163,255,.34); --zone-on-line: rgba(77,163,255,.6);
  --zone-taken: rgba(240,192,74,.22); --zone-taken-line: rgba(240,192,74,.45);
  --zone-fill: rgba(111,212,138,.18); --zone-grid: rgba(255,255,255,.08);
  /* the zone editor's layers: each zone its own colour (fill / edge), in list order, the ninth starting over */
  --zone-c1: rgba(77,163,255,.40);  --zone-l1: #4da3ff;
  --zone-c2: rgba(240,192,74,.40);  --zone-l2: #f0c04a;
  --zone-c3: rgba(63,185,80,.40);   --zone-l3: #3fb950;
  --zone-c4: rgba(232,121,249,.40); --zone-l4: #e879f9;
  --zone-c5: rgba(34,211,238,.40);  --zone-l5: #22d3ee;
  --zone-c6: rgba(251,146,60,.40);  --zone-l6: #fb923c;
  --zone-c7: rgba(157,124,255,.40); --zone-l7: #9d7cff;
  --zone-c8: rgba(255,107,107,.40); --zone-l8: #ff6b6b;

  /* charts */
  --chart-1: #3987e5; --chart-grid: var(--line-2); --chart-text: var(--muted);
  /* the packages, cheapest first: one blue, darker to lighter (validated as an ordered ramp against the panel) */
  --chart-tier-1: #1c5cab; --chart-tier-2: #2a78d6; --chart-tier-3: #5598e7; --chart-tier-4: #9ec5f4;
  /* the bays' lines in Sales */
  --chart-bay-touchless: #4da3ff; --chart-bay-xl: #b78cff; --chart-bay-softtouch: #3fb950;
  --chart-bay-selfserve: #d29922; --chart-bay-selfserve2: #8b96a5;

  /* the share page (public/share.php): a clip's SHA-256 */
  --hash-fg: #9fb0c4;

  /* Help's tables (the legacy dialog of kit.css; goes with it) */
  --log-line: #1a1f27;

  /* type */
  --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-base: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-code: 34px; --lh: 1.45;
  /* space, shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --radius-sm: 4px; --radius: 6px; --radius-lg: 10px; --radius-pill: 999px;
  /* sizes */
  --topbar-h: 44px; --rail-w: 72px; --pagebar-h: 40px; --ctl-h: 30px; --ctl-h-sm: 26px; --row-h: 32px; --row-h-dense: 26px;
  --side-w: clamp(340px, 22vw, 440px); --pane-w: 400px; --list-w: 560px; --page-max: 1680px; --form-max: 880px;
  --subnav-w: 200px; --tile-min: 150px; --transport-h: 40px;
  --side-row-h: 30px; --side-head-h: 24px;                                     /* the side pane's tables: a row, the sticky head */
  /* breakpoints (UI plan step 21): css/mobile.css holds every width query. A media query cannot read a custom property,
     so the numbers are written there too and jscheck holds them equal to these; JS asks core/tokens.js media(name).
     compact = the 1366-class screen; small = a small laptop or a tablet held sideways; narrow = phones and small
     tablets (the ☰ rail, the stacked stage, sheets for popovers); slim = a phone held upright. */
  --bp-compact: 1440px;  --bp-small: 1200px;  --bp-narrow: 1000px;  --bp-slim: 520px;
  /* layers, as the kit stacks them: dialogs ABOVE the frame viewer; ring, toasts, menus and the tip above dialogs.
     A few rules keep a number of their own: the phone rail 47/48 and the update bar 48 (shell), the Frame menu 55,
     the TV help 60, the scrub preview 40, the boot notice 200. */
  --z-pane-ui: 3; --z-sticky: 10; --z-topbar: 20; --z-tltip: 30; --z-frameviewer: 49; /* above the pages, their side panels and the phone rail (47-48); under dialogs */
  --z-dialog: 50; /* +2 per stacked dialog */ --z-dialog-top: 78; /* session ended */
  --z-popover: 60;   /* kit/menu.js popover(): above dialogs, under the scroll-focus ring so its list gets the ring */
  --z-scrollfocus: 70; --z-toast: 80; --z-menu: 85; --z-tip: 90;
  /* motion: JS reads --dur instead of repeating 260 */
  --dur-fast: 120ms; --dur: 260ms; --ease: cubic-bezier(.2,.8,.2,1);
}
@media (prefers-reduced-motion: reduce) { :root { --dur-fast: 0ms; --dur: 0ms; } }
