/* Colour and size tokens for /play. Dark first (SSOT: Light and dark); tenshin_nav sets data-theme on <html> and keeps
 * `tn-theme` in localStorage. Every colour is a six-digit hex so tests/test_client_contrast.py can read both themes.
 * The canvas reads the map colours (--soil-*, --surf-*, --water, --design, --area-*, --cut, --fill, --on-grade, --thing-*,
 * --void) by name through getComputedStyle; data/ui.yaml `client` says which token each soil and area uses. The map looks the same in
 * both themes (it is ground, not page), so its marks keep the dark theme's values in light. */
:root {
  color-scheme: dark;
  --bg: #14161a;
  --panel: #1d2025;
  --panel2: #272b31;
  --ink: #ece6d6;
  --dim: #b0b4ba;
  --line: #7d8794;
  --rule: #33383f;           /* hairlines inside a sheet: ruled rows, the bid sheet's columns (decoration, not a control edge) */
  --accent: #f2b705;         /* gold: what is picked, focus rings */
  --accent-ink: #1a1400;
  --sel-bg: #3a3220;         /* a pressed toggle and a picked card: gold edge on a dark gold wash, so solid gold stays for the one commit button */
  --hazard: #f2b705;         /* safety yellow: the commit button of a screen, and the tape stripe that echoes the map's design line */
  --hazard-ink: #17140c;
  --warn: #ff8a3d;           /* hi-vis orange: a deadline today or tomorrow, a machine low on fuel */
  --good: #7fd99a;
  --bad: #ff8a80;
  --void: #0b0d10;
  --design: #ffd23f;
  --mark: #ffb0f0;             /* a pipe's or piece's mark: apart from the design's yellow and the water's blue */
  --water: #2f7fb8;
  --water-deep: #123f66;
  --water-edge: #d6ecff;
  --water-ripple: #e8f4ff;
  --thing-slab: #b9b5ac;
  --thing-slab-joint: #6f6b63;
  --thing-wall: #8a5a3c;
  --thing-roof: #a8463a;
  --thing-pipe: #9c9a94;
  --thing-beam: #5d7187;
  --shade: #000000;
  --light: #ffffff;
  --ground-wet: #806656;      /* the ground is multiplied toward this as it soaks: darker, richer */
  --mud-shine: #e8f0ff;      /* wet highlights on mud */
  --pit: #2a1a10;            /* dug ground is laid over with this, a step deeper each terrace (#340) */
  --contour: #1a140e;
  --soil-topsoil: #5f4a32;
  --soil-clay: #8f5e3c;
  --soil-sand: #c2a46c;
  --soil-gravel: #8e8a82;
  --soil-rock: #6c6b70;
  --soil-silt: #7a7058;
  --soil-base: #9a948a;
  --soil-asphalt: #2c2b2e;
  --soil-mud: #4a3e30;
  --soil-other: #75654f;
  --surf-gravel: #a29e95;
  --surf-paved: #3a393d;
  --surf-deck: #7a5b3a;
  --area-entry: #7fd99a;
  --area-spoil: #f2c96a;
  --area-keep: #ffb0a8;
  --area-tip: #d8ccff;
  --area-drop: #8fd3ff;
  --area-heap: #ffa8e0;
  --mud-mark: #b04ad8;
  --rut-mark: #1c120a;
  --drag-ok: #7dff8f;
  --drag-bad: #ffb4a3;
  --cut: #e0473c;
  --fill: #3b7bea;
  --on-grade: #3fbf5a;
  --elev-lo: #1f4e8c;         /* the height scale (0.6 layer switch): low ground blue, middle sand, high ground rust */
  --elev-mid: #e3d08a;
  --elev-hi: #b4462b;
  --wet-dry: #e8d6a0;         /* the wetness scale: dry straw, damp teal, mud in --mud-mark */
  --wet-mid: #2e8f99;
  --thing-shadow: #000000;
  --exhaust: #4a4d52;
  --thing-select: #ffffff;
  --thing-dark: #15181d;
  --thing-canopy: #2f6b34;
  --thing-canopy-hi: #4a8f45;
  --thing-trunk: #5a3b22;
  --thing-stump: #7a5634;
  --thing-debris: #8a8178;
  --thing-other: #a0a0a0;
  --thing-fallback: #8a8f99;
  --badge-bg: #1b2027;
  --badge-ink: #ece9e0;
  --badge-bad: #ff8a80;
  --mini-view: #ffffff;
  --seat-0: #ffd23f;
  --seat-1: #4fd1ff;
  --seat-2: #ff7ad9;
  --seat-3: #9dff6a;
  --tap: 32px;
  --radius: 3px;
  --font: "Overpass", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "Overpass Mono", ui-monospace, "Cascadia Mono", monospace;
  --gap: 8px;
  --tasks-w: clamp(200px, 16vw, 340px);
  --mini-w: clamp(120px, 14vw, 190px);
  /* The engine kit (tenshin_kit.css) draws Help, Settings, the yes/no boxes and the toasts in these; both themes follow from the
     names above. Danger ink: the dark theme's bad is a light red, so it takes dark ink; light's is deep, so white. */
  --tn-bg: var(--bg); --tn-panel: var(--panel); --tn-ink: var(--ink); --tn-muted: var(--dim); --tn-edge: var(--line);
  --tn-accent: var(--accent); --tn-on-accent: var(--accent-ink); --tn-danger: var(--bad); --tn-on-danger: #17140c;
  --tn-good: var(--good); --tn-font: var(--font); --tn-font-ui: var(--font); --tn-radius: var(--radius);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e6ddc6;
  --panel: #f8f3e6;
  --panel2: #ede5d0;
  --ink: #1d2433;
  --dim: #4a5263;
  --line: #6f6a5c;
  --rule: #d6ccb2;
  --accent: #8a5a00;
  --accent-ink: #ffffff;
  --tn-on-danger: #ffffff;
  --sel-bg: #f3e2b0;
  --hazard: #f2b705;
  --hazard-ink: #17140c;
  --warn: #a84300;
  --good: #1b6b3a;
  --bad: #b3261e;
  --void: #0b0d10;
  --design: #ffd23f;
  --mark: #ffb0f0;             /* a pipe's or piece's mark: apart from the design's yellow and the water's blue */
  --water: #2f7fb8;
  --water-deep: #123f66;
  --water-edge: #d6ecff;
  --water-ripple: #e8f4ff;
  --thing-slab: #b9b5ac;
  --thing-slab-joint: #6f6b63;
  --thing-wall: #8a5a3c;
  --thing-roof: #a8463a;
  --thing-pipe: #9c9a94;
  --thing-beam: #5d7187;
  --shade: #000000;
  --light: #ffffff;
  --ground-wet: #806656;      /* the ground is multiplied toward this as it soaks: darker, richer */
  --mud-shine: #e8f0ff;      /* wet highlights on mud */
  --pit: #2a1a10;            /* dug ground is laid over with this, a step deeper each terrace (#340) */
  --contour: #1a140e;
  --soil-topsoil: #5f4a32;
  --soil-clay: #8f5e3c;
  --soil-sand: #c2a46c;
  --soil-gravel: #8e8a82;
  --soil-rock: #6c6b70;
  --soil-silt: #7a7058;
  --soil-base: #9a948a;
  --soil-asphalt: #2c2b2e;
  --soil-mud: #4a3e30;
  --soil-other: #75654f;
  --surf-gravel: #a29e95;
  --surf-paved: #3a393d;
  --surf-deck: #7a5b3a;
  --area-entry: #7fd99a;
  --area-spoil: #f2c96a;
  --area-keep: #ffb0a8;
  --area-tip: #d8ccff;
  --area-drop: #8fd3ff;
  --area-heap: #ffa8e0;
  --mud-mark: #b04ad8;
  --rut-mark: #1c120a;
  --drag-ok: #7dff8f;
  --drag-bad: #ffb4a3;
  --cut: #e0473c;
  --fill: #3b7bea;
  --on-grade: #3fbf5a;
  --elev-lo: #1f4e8c;         /* the height scale (0.6 layer switch): low ground blue, middle sand, high ground rust */
  --elev-mid: #e3d08a;
  --elev-hi: #b4462b;
  --wet-dry: #e8d6a0;         /* the wetness scale: dry straw, damp teal, mud in --mud-mark */
  --wet-mid: #2e8f99;
  --thing-shadow: #000000;
  --exhaust: #a7abb2;
  --thing-select: #ffffff;
  --thing-dark: #15181d;
  --thing-canopy: #2f6b34;
  --thing-canopy-hi: #4a8f45;
  --thing-trunk: #5a3b22;
  --thing-stump: #7a5634;
  --thing-debris: #8a8178;
  --thing-other: #a0a0a0;
  --thing-fallback: #8a8f99;
  --badge-bg: #1b2027;
  --badge-ink: #ece9e0;
  --badge-bad: #ff8a80;
  --mini-view: #ffffff;
  --seat-0: #ffd23f;
  --seat-1: #4fd1ff;
  --seat-2: #ff7ad9;
  --seat-3: #9dff6a;
}
/* A phone's thumb is 44 px (design section 11). */
@media (max-width: 600px) {
  :root { --tap: 44px; --gap: 4px; --mini-w: 88px; }
}
