/* Originium design tokens v0.3, "quiet instrument" (owner's direction A, 2026-11-05, with the 2026-11-05 type scale).
   ONE source for Token Flow, the admin console and the Gateway page. This file, design/tokens.css, is the only place
   a colour is written; the served copies tokenflow/web/css/tokens.css and console/console/static/tokens.css are
   byte-identical copies made by scripts/sync-tokens.mjs (each app serves only its own static root), and
   scripts/check-tokens.mjs fails on a drifted copy or on a colour literal in any other stylesheet of either app.
   Rules: dark is the default; light switches on html[data-theme="light"]. Trouble is the brightest ink with the
   hatch, never a hue; unknown is dashed; there is no red or amber, except the model-family identity colours
   (--fam-*), which name a vendor and never a state. Page code names these tokens; Token Flow's theme.css maps its
   older names (--bg0, --text, --flow-*, --series-*) onto them with var(), and charts resolve those at paint time. */

/* ---------- Core: the reference's values (previews/a.html, direction A) ---------- */
:root {
  --bg: #0b0c0f; --surface: #121419; --surface-2: #181b21; --hover: rgba(255,255,255,.035);
  --edge: rgba(255,255,255,.07); --edge-2: rgba(255,255,255,.13); --edge-3: rgba(255,255,255,.22);
  --ink: #eceef2; --ink-2: #a3a8b3; --ink-3: #878d98;
  --accent: #5b84ff; --accent-ink: #8ea8ff; --accent-soft: rgba(91,132,255,.14); --track: #22262e;
  --hatch: repeating-linear-gradient(135deg, var(--ink) 0 1.5px, transparent 1.5px 4.5px);
  --f-xs: 12px; --f-sm: 13px; --f-md: 14px; --f-lg: 16px; --f-xl: 24px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --r-panel: 10px; --r-ctl: 7px; --r-pill: 999px; --head: 48px;
  /* Header glass and tooltip surface: the reference's literal values, named so the light theme can swap them. */
  --head-bg: rgba(11,12,15,.82); --bar-bg: rgba(11,12,15,.96); --tip-bg: #22252c; --tip-shadow: 0 8px 24px rgba(0,0,0,.4);
  --current: rgba(255,255,255,.07);
}
:root[data-theme="light"] {
  --bg: #f6f6f4; --surface: #ffffff; --surface-2: #f0f1f3; --hover: rgba(0,0,0,.035);
  --edge: rgba(0,0,0,.08); --edge-2: rgba(0,0,0,.14); --edge-3: rgba(0,0,0,.26);
  --ink: #16181d; --ink-2: #474d58; --ink-3: #5c6370;
  --accent: #155bd7; --accent-ink: #155bd7; --accent-soft: rgba(21,91,215,.12); --track: #e2e4e8;
  --head-bg: rgba(246,246,244,.86); --bar-bg: rgba(246,246,244,.97); --tip-bg: #ffffff; --tip-shadow: 0 8px 24px rgba(0,0,0,.12);
  --current: rgba(0,0,0,.06);
}

/* ---------- Shared type and page inset ---------- */
:root {
  color-scheme: dark;
  --font: "Inter", "Helvetica Neue", "Helvetica", "Nimbus Sans", "Arial", "Liberation Sans",
    "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --inset: 24px;                                 /* the page inset; 16 px on phones (app.css) */
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- Data colours: rules, chart series and scales (Token Flow's charts read them at paint time) ---------- */
:root {
  /* opaque rules: a hairline (edge-2 over the page) and a control outline at 3:1 */
  --rule: #26282d; --outline: #6b717c;
  /* the accent as a quiet plane (a selected row or chip behind accent ink) */
  --accent-plane: #182039;
  /* the modal scrim, the same in both themes */
  --scrim: rgb(0 0 0 / .6);
  /* token-type roles: input is the accent; the others are greys of distinct lightness */
  --data-cache-read: #dce0e4; --data-cache-write: #646f7a; --data-output: #9ca7b2; --data-reasoning: #a6b2bf;
  --data-spend: #8bb4ff; --data-value: #c4c9ce; --data-ok: #a1a8af; --data-bad: #eceef2;
  /* a heatmap's low end, rising to the accent */
  --data-heat-low: #2c4f8f;
  /* categorical series after the accent: greys of alternating lightness */
  --data-1: #c4c9ce; --data-2: #9ca7b2; --data-3: #8994a0; --data-4: #a6b2bf; --data-5: #dce0e4; --data-6: #7f8d9c;
  --data-7: #9a9fa4; --data-8: #737e89; --data-9: #b3b5b8; --data-10: #92989e; --data-11: #e4e6e8;
  /* the low-evidence hatch drawn over a chart mark, the same in both themes */
  --data-decal: rgba(128,128,128,0.55);
  /* a sequential fill: one blue ramp, five steps (dark -> light from the page plane), each with an ink that clears
     4.5:1 on its step (validated with .ref/dataviz/validate_palette.js --ordinal) */
  --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #6da7ec; --seq-5: #9ec5f4;
  --seq-ink-1: #f0f1f2; --seq-ink-2: #f0f1f2; --seq-ink-3: #111315; --seq-ink-4: #111315; --seq-ink-5: #111315;
  /* model-family identity colours, one per vendor (validated with .ref/validate_palette.js, dark surface #1b1e21) */
  --fam-google: #2a78d6; --fam-anthropic: #e0602a; --fam-openai: #1baf7a; --fam-minimax: #c08a00;
  --fam-xai: #d0608f; --fam-zhipu: #2e9a2e; --fam-moonshot: #7a6ae0; --fam-deepseek: #e34948; --fam-other: #8994a0;
}
:root[data-theme="light"] {
  --rule: #dcdee2; --outline: #858b95;
  --accent-plane: #e7efff;
  --data-cache-read: #29333d; --data-cache-write: #7b8691; --data-output: #4f5964; --data-reasoning: #5e6974;
  --data-spend: #155bd7; --data-value: #414d59; --data-ok: #59636d; --data-bad: #181c20;
  --data-heat-low: #86a8ea;
  --data-1: #414d59; --data-2: #596775; --data-3: #53616f; --data-4: #69747f; --data-5: #29333d; --data-6: #687480;
  --data-7: #575c61; --data-8: #737e89; --data-9: #4a4d50; --data-10: #666e76; --data-11: #21262b;
  /* light -> dark from the page plane */
  --seq-1: #6da7ec; --seq-2: #3987e5; --seq-3: #256abf; --seq-4: #184f95; --seq-5: #0d366b;
  --seq-ink-1: #181c20; --seq-ink-2: #181c20; --seq-ink-3: #ffffff; --seq-ink-4: #ffffff; --seq-ink-5: #ffffff;
  --fam-google: #2a78d6; --fam-anthropic: #d9531e; --fam-openai: #12936a; --fam-minimax: #a87400;
  --fam-xai: #c84a7e; --fam-zhipu: #2a7f2a; --fam-moonshot: #6250d6; --fam-deepseek: #d23a39; --fam-other: #596775;
}

/* ---------- Console additions: values the console's app.css needs, under the same naming ---------- */
:root {
  /* the fourth grey of a stacked bar's parts: 3:1 against the track and apart from --ink, its neighbour */
  --ink-4: #6b707a;
  /* the hatch at a tighter period, for a 3-6 px wide cap (a troubled row's edge, an alert strip) */
  --hatch-dense: repeating-linear-gradient(135deg, var(--ink) 0 1.5px, transparent 1.5px 3px);
  /* the hatch drawn in the page colour, on an inverted (hovered) destructive button */
  --hatch-inverse: repeating-linear-gradient(135deg, var(--bg) 0 1.5px, transparent 1.5px 4.5px);

  /* Type: below --f-xs only the count badges on the tabs (Token Flow's shell.css: 11 px, 10 px on phones) */
  --f-badge: 11px; --f-badge-sm: 10px;
  --w-normal: 400; --w-medium: 500; --w-semibold: 600; --w-bold: 680;   /* 680: trouble words only */
  --ls-title: -.012em; --ls-display: -.022em; --ls-text: -.005em;       /* Token Flow's brand, h1 and body tracking */

  /* Radii below a control's: a marker square, an inline code or tag, a chip that wraps to two lines */
  --r-mark: 2px; --r-tag: 4px; --r-wrap: 12px;

  /* Sizes */
  --tabbar: 56px; --frame: 1280px; --measure: 65; --hair: 1px;
  --ctl-sm: 30px; --ctl-md: 36px; --ctl-lg: 44px;                       /* the header tabs, form fields, touch */

  /* Focus: Token Flow's ring (app.css :focus-visible), named */
  --focus-width: 2px; --focus-offset: 2px; --focus-radius: 4px;

  /* Motion and layers */
  --quick: 120ms; --z-head: 100;
}
:root[data-theme="light"] { --ink-4: #7a808b; }
