/* grothendieck canon tokens — the single source of truth (canon#1,4,5,8,9).
   Light + dark via prefers-color-scheme AND [data-theme] overrides (a host
   theme toggle stamps data-theme on :root; it must win in both directions).
   Dark is re-stepped, not inverted (canon#8).
   `--code` is a FILL, not a ground: it has to read against every surface it can be
   set on — paper, panel and panel-2 — so it sits above all three rather than
   between two of them. Dark's old #1c1c1c was two steps off --panel (#1a1a1a),
   which meant an inline path inside a panel had a background nobody could see.
   Substrates may APPEND substrate-local tokens (e.g. the report's --col)
   below a mirrored copy of this block — they may never redefine these. */
:root{
  /* surface + text roles (canon#1).
     --ink-2 and --ink-3 are RE-STEPPED PER THEME like everything else here
     (canon#8), and light is the theme that had never been done. Both carried a
     value picked against a dark ground and left unchanged when light was added,
     which is why they measured worst exactly where the grounds are lightest:
     --ink-2 #8e8e8e ran 3.28:1 on --paper and 2.82:1 on --panel-2, so every
     secondary role it carries — narration, captions, meta lines, table cells,
     figure sub-labels, code comments — sat under 4.5:1 on every light surface,
     and worst on the panels it is most often set on. #6a6a6a clears 4.5:1 on all
     four (paper 5.41, code 5.18, panel 5.00, panel-2 4.66) and stays 2.80:1 off
     --ink, so the junior rank canon#7 depends on is still legible AS a rank.
     --ink-3 is the faint/hairline tier and is NOT a 4.5:1 role — but light's
     #cfcfcf was 1.56:1 on --paper against dark's 2.34:1, the same tier reading as
     two different things depending on the theme. #afafaf puts light on dark's
     rank (2.19:1 on paper) without promoting a hairline into a rule. */
  --paper:#ffffff; --panel:#f6f6f6; --panel-2:#eeeeee; --code:#fafafa;
  --ink:#262626; --ink-2:#6a6a6a; --ink-3:#afafaf;
  --accent:#262626; --accent-soft:#26262610;
  /* data palette — ONE blue, six steps (lightness/saturation only), fixed order (canon#2).
     --c1 is the brand anchor (#3363FF): theme-INVARIANT, never re-stepped. */
  --c1:#3363FF; --c2:#A9BFFF; --c3:#1B2F8C; --c4:#6E8FFF; --c5:#46529E; --c6:#91A3D6;
  /* The label ON a filled chip — the pair of roles a coloured ground needs, and
     both theme-INVARIANT, because a label that re-steps on a chip that does not is
     the whole bug they exist to end. Without them there was no token to reach for,
     so such labels were typed as `#fff` (the one colour a restyle can never reach)
     or set to --ink / --paper, which re-step: --paper goes near-black on a still-blue
     chip in dark, and --ink goes 1.32:1 on a --c3 chip in light.
       --on-c1  white, for the chips that are DEEP in both themes: --c1 (4.81:1),
                --c3 (11.46 light / 6.57 dark)
       --on-c2  dark, for the chips that are PALE in both themes: --c2 (8.35/10.10),
                --c4 (5.07/6.69). It is --ink's light value, held fixed.
     NOTHING ELSE IS A CHIP GROUND. --c5, --c6, --good and --warn change rank between
     themes (--c5 is deep in light and pale in dark; --c6 the reverse), so no fixed
     label clears 4.5:1 on both — and --crit, though deep in both, is a mid-tone in
     dark where neither white (3.84:1) nor dark ink (3.95:1) lands. Those steps are
     fills, strokes and marks, and a mark that needs words takes them BESIDE it. */
  --on-c1:#ffffff; --on-c2:#262626;
  /* status ROLES, not extra hues: the palette is monochrome + one blue, so good and
     warn are steps of the same blue (good = the vivid core, warn = the desaturated
     slate — quieter by construction). `--crit` is the single reserved exception:
     an error must not be mistakable for data, and red is the one hue allowed to
     carry that. Green and orange are NOT in this language. */
  --good:#3363FF; --warn:#46529E; --crit:#C23A2C;
  /* type stack (canon#5,6) */
  --font-title:'DM Sans',-apple-system,BlinkMacSystemFont,system-ui,sans-serif;
  --font-body:'Manrope',-apple-system,BlinkMacSystemFont,system-ui,sans-serif;
  --font-emph:'DM Mono','SF Mono',ui-monospace,Menlo,monospace;
  --font-mono:ui-monospace,'SF Mono',Menlo,Consolas,monospace;
  /* radius scale (canon#4) */
  --r-lg:26px; --r-md:18px; --r-sm:12px; --r-xs:8px; --r-full:999px;
  /* motion (canon#9) */
  --t-fast:120ms; --t-med:240ms; --ease:cubic-bezier(.25,.6,.3,1);
}
@media (prefers-color-scheme:dark){:root{
  /* --ink-3 dark is re-stepped for the --panel ground (#1a1a1a): the old #3a3a3a was
     chosen against --paper and fell to ~1.5:1 once surfaces moved up a step — faint
     text (figure sub-labels, disabled states) disappeared entirely. #4f4f4f keeps
     the "faint" rank while staying visible on panel and panel-2.
     --ink-2 dark holds its own value (light re-steps down, dark re-steps UP): it
     already cleared 4.5:1 on paper, panel and panel-2, but --code is a FILL that
     sits above all three, and #8e8e8e measured 4.32:1 on it — so code comments,
     the one place --ink-2 is set on --code, were the single role still under.
     #949494 takes that to 4.67:1 and leaves the rest wider than they were. */
  --paper:#0f0f0f; --panel:#1a1a1a; --panel-2:#232323; --code:#2b2b2b;
  --ink:#f2f2f2; --ink-2:#949494; --ink-3:#4f4f4f;
  --accent:#f2f2f2; --accent-soft:#ffffff10;
  --c1:#3363FF; --c2:#C4D2FF; --c3:#3452C9; --c4:#8FA9FF; --c5:#7C8FCC; --c6:#49619C;
  --on-c1:#ffffff; --on-c2:#262626;
  /* dark crit re-stepped toward true red: the old #E7654E read salmon-orange, and
     orange is not in this language. */
  --good:#8FA9FF; --warn:#7C8FCC; --crit:#E0524A;
}}
:root[data-theme="light"]{
  --paper:#ffffff;--panel:#f6f6f6;--panel-2:#eeeeee;--code:#fafafa;--ink:#262626;--ink-2:#6a6a6a;--ink-3:#afafaf;
  --accent:#262626;--accent-soft:#26262610;
  --c1:#3363FF;--c2:#A9BFFF;--c3:#1B2F8C;--c4:#6E8FFF;--c5:#46529E;--c6:#91A3D6;--on-c1:#ffffff;--on-c2:#262626;--good:#3363FF;--warn:#46529E;--crit:#C23A2C;}
:root[data-theme="dark"]{
  --paper:#0f0f0f;--panel:#1a1a1a;--panel-2:#232323;--code:#2b2b2b;--ink:#f2f2f2;--ink-2:#949494;--ink-3:#4f4f4f;
  --accent:#f2f2f2;--accent-soft:#ffffff10;
  --c1:#3363FF;--c2:#C4D2FF;--c3:#3452C9;--c4:#8FA9FF;--c5:#7C8FCC;--c6:#49619C;--on-c1:#ffffff;--on-c2:#262626;--good:#8FA9FF;--warn:#7C8FCC;--crit:#E0524A;}
