/**
 * @platform/design-tokens — Layer 2 (Semantic)
 *
 * Single source of truth for the platform's visual language.
 * The web app (Tailwind) imports this file.
 *
 * Color values reference primitives from ./primitives.css (Layer 1).
 * Do not hardcode hex values here — use var(--dt-prim-*) instead.
 * To change a color, update the primitive in primitives.css.
 *
 * Usage:
 *   @import '@platform/design-tokens/tokens.css';
 *   (primitives.css is auto-imported below)
 *
 * Naming convention:
 *   --dt-{category}-{name}
 *   Categories: bg, text, border, accent, status, shadow, radius, z, font
 *
 * Adding tokens:
 *   1. Add the primitive color to primitives.css if needed
 *   2. Add the semantic token here referencing var(--dt-prim-*)
 *   3. Both apps pick it up automatically on next build
 *   4. App-specific tokens stay in each app's own CSS
 */

@import './primitives.css';

:root,
[data-theme='dark'] {
  /* Native controls and scrollbars draw for the ground they sit on. */
  color-scheme: dark;

  /* ─── Backgrounds ──────────────────────────────────────────────
   * FOUR LEVELS, and the lowest one is the new part. `recess` is the level
   * BELOW the page — run logs, terminals, inputs, code wells — and it exists
   * because the ground used to be pure black, so there was nowhere to go
   * beneath it and every well had to be raised into a card to be visible at
   * all. Order, darkest first: recess < primary < secondary < elevated. */
  --dt-bg-recess: var(--dt-prim-black);
  --dt-bg-primary: var(--dt-prim-carbon-950);
  --dt-bg-secondary: var(--dt-prim-carbon-900);
  --dt-bg-tertiary: var(--dt-prim-carbon-800);
  --dt-bg-elevated: var(--dt-prim-carbon-850);
  --dt-bg-overlay: rgba(0, 0, 0, 0.7);
  --dt-bg-surface-overlay: var(--dt-prim-carbon-850);

  /* ─── Text ─────────────────────────────────────────────────── */
  --dt-text-primary: var(--dt-prim-carbon-50);
  --dt-text-secondary: var(--dt-prim-carbon-200);
  --dt-text-tertiary: var(--dt-prim-carbon-200);
  --dt-text-muted: var(--dt-prim-carbon-300);
  --dt-text-placeholder: var(--dt-prim-carbon-400);

  /* ─── Borders ──────────────────────────────────────────────── */
  --dt-border-primary: var(--dt-prim-carbon-500);
  --dt-border-secondary: var(--dt-prim-carbon-600);
  --dt-border-muted: var(--dt-prim-carbon-400);
  --dt-border-subtle: var(--dt-prim-carbon-700);

  /* ─── Accent (brand gold) ──────────────────────────────────── */
  --dt-accent-primary: var(--dt-prim-gold-400);
  --dt-accent-primary-fill: var(--dt-prim-gold-fill);
  --dt-accent-hover: var(--dt-prim-gold-hi);
  --dt-accent-visited: var(--dt-prim-gold-visited);
  --dt-accent-dim: var(--dt-prim-gold-edge);
  --dt-accent-muted: color-mix(in srgb, var(--dt-accent-primary) 10%, transparent);
  --dt-accent-on-accent: var(--dt-prim-gold-on-fill);
  --dt-accent-selection: color-mix(in srgb, var(--dt-accent-primary) 25%, transparent);

  /* ─── Status colors ────────────────────────────────────────── */
  --dt-status-success: var(--dt-prim-green-400);
  --dt-status-success-bg: color-mix(in srgb, var(--dt-status-success) 12%, transparent);
  --dt-status-success-border: color-mix(in srgb, var(--dt-status-success) 35%, transparent);

  --dt-status-warning: var(--dt-status-warning-text);
  --dt-status-warning-bg: color-mix(in srgb, var(--dt-status-warning-text) 8%, transparent);
  --dt-status-warning-border: color-mix(in srgb, var(--dt-status-warning) 82%, transparent);
  --dt-status-warning-text: var(--dt-prim-pink-400);

  --dt-status-error: var(--dt-prim-red-400);
  --dt-status-error-bg: color-mix(in srgb, var(--dt-status-error) 10%, transparent);
  --dt-status-error-border: color-mix(in srgb, var(--dt-status-error) 35%, transparent);

  --dt-status-promoted: var(--dt-text-subdued);
  --dt-status-promoted-bg: color-mix(in srgb, var(--dt-status-promoted) 10%, transparent);
  --dt-status-promoted-border: color-mix(in srgb, var(--dt-status-promoted) 30%, transparent);
  --dt-status-promoted-text: var(--dt-status-promoted);

  --dt-status-info: var(--dt-prim-blue-500);
  --dt-status-info-bg: color-mix(in srgb, var(--dt-status-info) 10%, transparent);

  /* ─── What a colour MEANS (the coach, 2026-11-22) ──────────────
   * Six meanings and a neutral; colour follows the meaning, never a count. Each reads the status or
   * accent step it is, so a theme that repoints those repoints these. The `Status` primitive paints
   * its dot from them; `check-text-contrast` holds each to 3:1 (a mark, not text) on every ground.
   *   act     gold    yours / the one primary act
   *   wait    pink    waiting / held
   *   fail    red     failed
   *   run     blue    in progress
   *   done    green   done
   *   admin   violet  the admin hat, nowhere else
   *   neutral grey    not measured, nothing to say */
  --dt-mean-act: var(--dt-accent-primary);
  --dt-mean-wait: var(--dt-status-warning);
  --dt-mean-fail: var(--dt-status-error);
  --dt-mean-run: var(--dt-status-info);
  --dt-mean-done: var(--dt-status-success);
  --dt-mean-admin: var(--dt-admin);
  --dt-mean-neutral: var(--dt-text-muted);

  /* ─── Interactive ──────────────────────────────────────────── */
  --dt-interactive-bg: var(--dt-prim-carbon-800);
  --dt-interactive-hover: var(--dt-prim-carbon-700);
  --dt-interactive-active: var(--dt-prim-gold-tint);

  /* Inputs sit in the RECESS, not on the surface — a field is cut into the page. */
  --dt-interactive-input-bg: var(--dt-bg-recess);
  --dt-interactive-input-border: var(--dt-prim-carbon-600);
  --dt-interactive-input-focus-border: var(--dt-accent-dim);

  /* ─── Shadows ──────────────────────────────────────────────── */
  --dt-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.1);
  --dt-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.15);
  --dt-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --dt-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
  --dt-shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.4);
  --dt-shadow-2xl: 0 20px 40px rgba(0, 0, 0, 0.3);

  /* ─── Named shadows and glows ──────────────────────────────────
   * The shadows components wrote inline as `shadow-[…rgba(0,0,0,…)]`, lifted
   * here with their exact values so the light theme can soften them: a black
   * shadow tuned to sink into near-black reads as a smudge on white, and a bright
   * glow around a dot reads as neon. Named for what wears them. */
  --dt-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
  --dt-shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
  --dt-shadow-header: 0 8px 24px rgba(0, 0, 0, 0.35);
  --dt-shadow-menu: 0 8px 24px rgba(0, 0, 0, 0.4);
  --dt-shadow-dialog: 0 16px 48px rgba(0, 0, 0, 0.5);
  --dt-shadow-popover: 0 16px 48px rgba(0, 0, 0, 0.6);
  --dt-shadow-ask: 0 0 0 3px var(--dt-status-warning-bg), 0 8px 24px rgba(0, 0, 0, 0.45);
  --dt-ring-accent: 0 0 0 3px color-mix(in srgb, var(--dt-accent-primary) 10%, transparent);
  --dt-glow-accent: 0 0 0 4px color-mix(in srgb, var(--dt-accent-primary) 18%, transparent);
  --dt-glow-warning: 0 0 0 4px color-mix(in srgb, var(--dt-status-warning-text) 18%, transparent);
  --dt-glow-warning-sm: 0 0 0 3px color-mix(in srgb, var(--dt-status-warning-text) 15%, transparent);
  /* The live dot fades this sRGB color in its keyframes. */
  --dt-halo: var(--dt-accent-primary);
  --dt-halo-end: color-mix(in srgb, var(--dt-halo) 0%, transparent);
  /* The rule under a header band: the default border in Dark, the faint one where it is flat. */
  --dt-border-header: var(--dt-border-secondary);

  /* ─── Border radius ────────────────────────────────────────── */
  --dt-radius-xs: 2px;
  --dt-radius-chip: 3px;
  --dt-radius-sm: 4px;
  --dt-radius-md: 6px;
  --dt-radius-lg: 8px;
  --dt-radius-card: 10px;
  --dt-radius-xl: 12px;
  --dt-radius-full: 9999px;

  /* ─── Z-index layers ───────────────────────────────────────── */
  --dt-z-base: 1;
  --dt-z-raised: 10; /* a mark or handle over its neighbours; a hover cue over a scroller */
  --dt-z-sticky: 20; /* a sticky header, a card opened under its row */
  --dt-z-dock: 30; /* a bar, side sheet or panel laid over the page it belongs to */
  --dt-z-drawer: 40; /* a drawer over the docks (the Sideline) */
  --dt-z-overlay: 1000; /* the page's grain; a diagram's line labels over its cards */
  --dt-z-modal: 1001; /* a dialog and its scrim */
  --dt-z-popover: 1100; /* a menu, select list, popover or hover card — over a dialog it opens from */
  --dt-z-tooltip: 1200;
  --dt-z-top: 9999; /* the toasts */

  /* ─── Typography ───────────────────────────────────────────── */
  --dt-font-ui: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --dt-font-mono:
    'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --dt-font-display:
    'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --dt-font-prose: var(--dt-font-ui);

  /* ─── Font sizes: THE SCALE ───────────────────────────────────
   * Five steps and nothing else (the coach, 2026-11-22: "12/13/15/20 plus one display size,
   * nothing under 12"). Each step has one job, so neighbouring sizes 0.5px apart cannot exist:
   *   xs 12      meta: labels, time, counts, section labels, a row's second line
   *   sm 13      body: rows, prose, controls
   *   base 15    a title: a card's, a panel's, a section's
   *   xl 20      a page title, a headline number
   *   display 28 the one display size: a figure that leads a page
   * `check-text-contrast` holds the floor (12) and the set; `check-design-tokens` refuses any
   * other `text-*` size or a `text-[…]` in the app. */
  --dt-text-xs: 12px;
  --dt-text-sm: 13px;
  --dt-text-base: 15px;
  --dt-text-xl: 20px;
  --dt-text-display: 28px;
  --dt-text-inline-code: 0.85em; /* code inside a sentence, relative to that sentence */

  /* ─── Font weights ─────────────────────────────────────────── */
  --dt-weight-normal: 400;
  --dt-weight-medium: 500;
  --dt-weight-semibold: 600;
  --dt-weight-bold: 700;

  /* ─── Line heights ─────────────────────────────────────────── */
  --dt-leading-tight: 1.25;
  --dt-leading-normal: 1.5;
  --dt-leading-relaxed: 1.625;
  --dt-leading-loose: 1.8;
  --dt-leading-log: 1.55; /* a log surface: fixed, so a long log scrolls predictably */

  /* ─── Letter spacing ───────────────────────────────────────── */
  /* The tracking of uppercase labels — the 0.08em–0.14em the console hard-coded as
     `tracking-[…]`. Named `caps-*`, NOT wide/wider/widest: those are Tailwind's own steps
     (0.025/0.05/0.1em), used across the console, and repointing them would move every one. */
  --dt-tracking-caps-sm: 0.08em;
  --dt-tracking-caps-md: 0.1em;
  --dt-tracking-caps-lg: 0.12em;
  --dt-tracking-caps-xl: 0.14em;

  /* ─── Spacing (4px base) ───────────────────────────────────── */
  --dt-space-0: 0px;
  --dt-space-px: 1px;
  --dt-space-0_5: 2px;
  --dt-space-1: 4px;
  --dt-space-1_5: 6px;
  --dt-space-2: 8px;
  --dt-space-3: 12px;
  --dt-space-4: 16px;
  --dt-space-5: 20px;
  --dt-space-6: 24px;
  --dt-space-8: 32px;
  --dt-space-10: 40px;
  --dt-space-12: 48px;
  --dt-space-16: 64px;

  /* ─── Transitions ──────────────────────────────────────────── */
  --dt-duration-fast: 100ms;
  --dt-duration-normal: 150ms;
  --dt-duration-slow: 200ms;
  --dt-duration-slower: 300ms;
  --dt-ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --dt-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dt-ease-out: cubic-bezier(0, 0, 0.2, 1);
  /* A pane arriving beside what was pressed: fast out of the press, a long settle. */
  --dt-ease-arrive: cubic-bezier(0.32, 0.72, 0, 1);
  --dt-duration-arrive: 180ms;
  /* The live dot's halo, one breath. */
  --dt-duration-breath: 2.2s;
  /* An indeterminate band's trip across its track. */
  --dt-duration-travel: 1.4s;
  /* Reduced motion: lands on the final state at once, and still fires transitionend. */
  --dt-duration-instant: 0.01ms;
  --dt-transition-colors:
    color var(--dt-duration-normal) var(--dt-ease-default),
    background-color var(--dt-duration-normal) var(--dt-ease-default),
    border-color var(--dt-duration-normal) var(--dt-ease-default);
  --dt-transition-all: all var(--dt-duration-normal) var(--dt-ease-default);

  /* ─── Interactive states ───────────────────────────────────── */
  --dt-opacity-disabled: 0.5;
  --dt-opacity-hover: 0.8;
  --dt-focus-ring: 0 0 0 2px var(--dt-bg-primary), 0 0 0 4px var(--dt-accent-primary);
  --dt-focus-ring-offset: 2px;

  /* ─── Sizing ───────────────────────────────────────────────── */
  /* THE ROW'S THREE DENSITIES (the `Row` primitive): a side-bar list, a table or list, and a row whose
     second line earns its place. Every row in the console is one of these heights. */
  --dt-density-side: 22px;
  --dt-density-list: 32px;
  --dt-density-two-line: 44px;
  /* Control heights: the 22/26/30/34px rows, bars and buttons the console hard-coded as h-[…]. */
  --dt-size-control-sm: 22px;
  --dt-size-control-md: 26px;
  --dt-size-control-lg: 30px;
  --dt-size-control-xl: 34px;
  /* THE TREE — a list of rows that fold: every view in the console's left side bar
     (`console/sidebar/`) and any section in the main area that lists rows in groups. VS Code's
     density: a row is one line at 22px, or two (label over detail) at 36px; its text starts at the
     inset, plus one indent step per level, past a chevron slot every row keeps, so a row that folds
     and one that does not line up. */
  --dt-tree-row: 22px;
  --dt-tree-row-2: 36px;
  --dt-tree-inset: 8px;
  --dt-tree-indent: 12px;
  --dt-chevron-slot: 16px;
  --dt-chevron: 12px;
  --dt-icon-slot: 14px;
  --dt-slot-gap: 6px;
  --dt-title-bar: 35px; /* a side bar's title bar */
  /* The work graph's layout: values its run-time math reads (rows, lanes, the merge gate). */
  --dt-row-height: 58px;
  --dt-landing-height: 18px;
  --dt-gate-base-height: 56px;
  --dt-lane-width: 16px;
  --dt-gutter-pad: 14px;
  --dt-dot-offset: 17px;
  /* The Build view's branch row: its title line, its pill-and-summary line and the gap between. */
  --dt-branch-row-height: 48px;
  /* A hover preview card's gap from its anchor, and its distance from the viewport's edge. */
  --dt-preview-gap: 6px;
  --dt-size-icon-sm: 16px;
  --dt-size-icon-md: 20px;
  --dt-size-icon-lg: 24px;
  --dt-size-touch-target: 36px;
  --dt-size-avatar-sm: 24px;
  --dt-size-avatar-md: 32px;
  --dt-size-avatar-lg: 40px;
  /* The intent page's own layout values — the question box's option area cap, the landings table's
     columns, the active panel button's edge and the facts line's fade — once hard-coded as […]. */
  --dt-size-question-acts-max: max(6rem, 22vh);
  --dt-grid-landings: minmax(0, 1fr) 3.5rem 3rem auto;
  --dt-grid-landing-facts: 5rem minmax(0, 1fr);

  /* ─── The intent page's remaining layout sizes (named, not hard-coded) ─────────── */
  --dt-size-seam: 3px; /* the draggable divider's rule */
  --dt-size-grip: 5px; /* the divider's grip thickness */
  --dt-size-sheet: 22.5rem; /* the your-move side sheet's width */
  --dt-size-dialog-height: 85vh; /* the step transcript dialog, and the tallest a dialog stands */
  --dt-size-alert-height: 90vh; /* the tallest a confirm (AlertDialog) stands */
  --dt-size-hero-min: var(
    --dt-size-inventory-max
  ); /* a page that is one centred message: the same 70vh */
  --dt-size-document-max: 60vh; /* a long document read in place before accepting it (the terms) */
  --dt-size-modal-height: 88vh; /* the exhibit modal */
  --dt-size-modal-width: 92vw;
  --dt-size-exhibit-inline-max: min(
    60vh,
    32rem
  ); /* the tallest a design drawn in a message stands */
  --dt-grid-now-pinned: 6.5rem minmax(0, 1fr);
  --dt-grid-task-mark: 0.875rem minmax(0, 1fr);
  --dt-grid-flow-step: 24px minmax(0, 1fr); /* a flow's node column, then its text */
  --dt-grid-task-facts: 3.5rem minmax(0, 1fr);
  /* A scout run's row in the Field's Scouts: what it read, what called it, how it ended, took, when. */
  --dt-grid-scout-row: minmax(0, 1fr) 11rem 6rem 5rem 4rem;
  /* THE ROW (`components/ui/Row`): status · title · meta · count · time, always in that order. */
  --dt-grid-row: var(--dt-icon-slot) minmax(0, 1fr) auto auto 3rem;
  --dt-edge-active: inset -2px 0 0;
  --dt-fade-edge: 32px;

  /* ─── The org/console screens' layout sizes (once hard-coded as […]) ─────────────
     Each is the exact value the call site used, so moving onto the token shifts nothing.
     The shadow GEOMETRY lives here; the app pairs it with its own colour in @theme, as
     --dt-edge-active above is paired. */
  --dt-z-above: 2; /* a control raised over its row's full-width open target (z-base) */
  --dt-tracking-caps-090: 0.09em;
  --dt-tracking-caps-110: 0.11em;
  --dt-tracking-caps-130: 0.13em;
  --dt-tracking-caps-150: 0.15em;
  --dt-tracking-heading: -0.012em; /* the home greeting's heading */
  --dt-tracking-figure: -0.035em; /* a headline number, set tight */
  --dt-tracking-display: -0.03em; /* a display headline */
  --dt-tracking-display-sm: -0.02em;
  --dt-tracking-caps-020: 0.02em;
  --dt-leading-display: var(--dt-leading-chip); /* a display headline's line: the same 1.1 */
  --dt-tracking-caps-030: 0.03em;
  --dt-tracking-caps-040: 0.04em;
  --dt-tracking-caps-050: 0.05em;
  --dt-tracking-caps-160: 0.16em;
  --dt-leading-figure: 0.92; /* a headline number's line, tighter than its glyphs */
  --dt-radius-hair: 1px; /* a bar's corner, just off square */
  --dt-size-box-18: 18px; /* the scope badge */
  --dt-size-box-24: 24px;
  --dt-size-box-35: 35px;
  --dt-size-dot: 7px;
  --dt-size-dot-inset: 3.5px; /* the side inset that centres a dot in a 14px icon slot (the palette) */
  --dt-size-keycap: 16px; /* a keycap's min width and line height */
  --dt-size-line-min: 1.35rem;
  --dt-size-dock-sm: 24rem;
  --dt-size-dock-md: 26rem;
  --dt-size-dock-lg: 30rem;
  --dt-size-palette: 640px;
  --dt-gap-hair: 3px;
  --dt-measure-xs: 22ch;
  --dt-measure-sm: 36ch;
  --dt-measure-md: 46ch;
  --dt-measure-lg: 82ch;
  /* ─── Page width (one system: PageFrame) ─────────────────────
   * A page is sized by the space IT gets — the left pane, the bottom panel and the Radio all
   * change that — so its breakpoints are container widths, never the viewport's.
   *   wide   ≥ page-wide:    panels side by side
   *   medium ≥ page-medium:  panels stacked, tables keep their key columns
   *   narrow <  page-medium: one column; a peek or detail goes full width
   * Prose reads at page-prose; tables, graphs and code take the full width.
   * page-fixed-max is the widest fixed width a page may set (check-page-width.mjs). */
  --dt-page-prose: 80ch;
  --dt-page-medium: 760px;
  --dt-page-wide: 1200px;
  --dt-page-fixed-max: 320px;
  --dt-shadow-keycap: inset 0 -1px 0;
  --dt-shadow-edge-top: inset 0 1px 0;
  --dt-shadow-rail: inset 2px 0 0;
  --dt-shadow-group-rule: 0 -3px 0 -2px;
  --dt-grid-adopt: 0.5rem 5rem 7rem minmax(0, 1fr) 8.5rem minmax(0, 0.9fr) 3.5rem 7rem;
  --dt-grid-org-connections: 200px minmax(0, 1fr);
  --dt-grid-change-row: 8px minmax(0, 1fr) auto; /* a Changes row: dot, title, kind */
  --dt-grid-change-facts: 120px minmax(0, 1fr); /* a change's facts: name, value */
  --dt-grid-card-facts: 6rem minmax(0, 1fr); /* a row's hover card: label, words */
  --dt-grid-home-row: 3px 84px minmax(0, 1fr) auto auto;
  --dt-grid-principle: 14rem minmax(0, 1fr) 5.5rem auto;
  --dt-grid-principle-act: 1rem minmax(0, 1fr) 3.5rem auto;
  --dt-grid-principle-meter: 4fr 1fr;
  --dt-grid-principle-part: minmax(0, 1fr) 7.5rem 3.25rem 3.25rem 5.5rem;
  --dt-grid-how-row: minmax(0, 1fr) 13rem 7.5rem 1.375rem;
  --dt-grid-roster-row: 9rem minmax(0, 1fr) 10rem minmax(0, 1.3fr);
  --dt-grid-rung-row: 8rem 15rem minmax(0, 1fr);
  --dt-grid-to-fix-row: 4.625rem minmax(0, 1fr) 10.625rem 6.875rem 7.5rem;
  --dt-grid-to-fix-line: 4.625rem minmax(0, 2fr) minmax(0, 1.25fr) minmax(0, 0.8fr) auto;
  /* A line of code in the Problems view: its gutter (a severity glyph or the light bulb), its number, its text. */
  --dt-grid-code-line: 1.375rem 2.875rem minmax(0, 1fr);
  /* A row of the Problems view: its severity glyph, its message (truncated), its `[Ln N]`. */
  --dt-grid-problem-row: var(--dt-size-glyph) minmax(0, 1fr) auto;
  --dt-grid-panel-history: 5rem minmax(0, 1fr) minmax(0, 13.75rem) auto;
  --dt-grid-add-rule: 1.5rem minmax(0, 1fr);
  --dt-grid-team-rule: minmax(0, 1fr) 11rem 7rem 12rem 4rem;
  /* A Playbook section's row: the fold chevron, the lead (a score), the name and its line, the value. */
  --dt-grid-section-row: 1rem 2.5rem minmax(0, 1fr) minmax(0, max-content);
  /* A check inside an opened row, one shared template so every row aligns: its name, its status, when it was
     checked, how it is checked, its acts (one width every row). */
  --dt-grid-section-detail: minmax(0, 1fr) 8.5rem 5.5rem 10.5rem 10rem;
  --dt-grid-scan-tiles: repeat(auto-fit, minmax(8.5rem, 1fr));
  --dt-grid-scan-list: repeat(auto-fit, minmax(14rem, 1fr));
  --dt-grid-new-word: minmax(0, 14rem) 1fr;
  --dt-grid-console-bar: minmax(0, 1fr) auto minmax(0, 1fr);
  --dt-grid-onboard-steps: repeat(auto-fit, minmax(190px, 1fr));
  --dt-grid-account-row: 200px minmax(0, 1fr);
  /* The conversation's turn line: time, dot, then the flexible column that fills the section. */
  --dt-grid-turn-line: 2.75rem 0.5rem minmax(0, 1fr);
  /* A tool row: chevron, glyph, the verb track (a floor, not a ceiling), the summary, the time. */
  --dt-grid-tool-row: 14px 12px minmax(5.25rem, max-content) minmax(0, 1fr) auto;
  /* Viewport-bounded popover and panel sizes, and the bar's dropdown offset. */
  --dt-size-viewport-less-3rem: calc(100vw - 3rem);
  --dt-size-viewport-less-2rem: calc(100vw - 2rem);
  --dt-size-viewport-less-24: calc(100vw - 24px);
  --dt-size-filter-panel: min(48rem, calc(100vw - 2rem));
  --dt-size-command-center: clamp(220px, 30vw, 480px);
  --dt-size-palette-list-max: min(440px, 60vh);
  --dt-offset-dropdown: calc(100% + 6px);

  /* ─── The Field's sizes (console/field, once hard-coded as […]) ─────────────────
     Field-only: each is the exact value its call site used, so the dense IDE look does not move.
     A value already named above (13px, 18/22/26/30/34/35px, the 3px gap and radius, the caps tracking,
     z 1/2, the rail and edge geometry) is reused through its own token, never declared twice. */
  --dt-tracking-caps-060: 0.06em;
  --dt-leading-chip: 1.1;
  --dt-leading-natural: normal;
  --dt-z-float: 5; /* quick open, over the editor */
  --dt-radius-input: 5px;
  --dt-radius-pill-sm: 11px;
  --dt-size-row-dense: 25px; /* a panel's problem or output row */
  --dt-size-node-head: 29px; /* a diagram card's title band */
  --dt-size-peek: 300px;
  --dt-size-glyph: 14px; /* a row's icon slot, and the panel gaps of the same step */
  --dt-size-line-number: 38px;
  --dt-size-hover-card: 270px;
  --dt-size-peek-list: 320px;
  --dt-size-search-box: 520px;
  --dt-size-share-55: 55%; /* a key column's (or a skeleton bar's) share of its row */
  --dt-size-share-22: 22%; /* a table's bar column (the billing attribution's share) */
  --dt-size-key-min: 84px;
  --dt-size-span-7: 7rem;
  --dt-size-span-8-5: 8.5rem;
  --dt-size-span-9: 9rem;
  --dt-size-span-12: 12rem;
  --dt-size-span-14: 14rem;
  --dt-size-span-16: 16rem;
  --dt-size-rungs-min: 50rem;
  --dt-size-open-list-max: 110px;
  --dt-size-inventory-max: 70vh;
  --dt-size-diagram: min(70vh, 40rem);
  --dt-size-diagram-sm: min(56vh, 30rem);
  --dt-size-canvas: min(60vh, 36rem);
  --dt-squiggle-offset: 4px; /* how far a problem's wavy underline sits below its text */
  --dt-size-problems: min(44rem, 75vh); /* the Problems view on a page: the file over the list */
  --dt-size-parent-less-32: calc(100% - 32px);
  --dt-space-tight: 9px; /* a pill's side padding, and a legend's lift over its border */
  --dt-space-label: 5px; /* a line label's side padding */
  --dt-indent-head: 40px; /* a section head's text: 8 + 14 + 18 */
  --dt-shrink-crumbs: 0.15;
  --dt-measure-xl: 90ch;
  --dt-grid-cards: repeat(auto-fill, minmax(15.5rem, 1fr));
  --dt-grid-cards-10-5: repeat(auto-fill, minmax(10.5rem, 1fr));
  --dt-grid-tiles-6-5: repeat(auto-fit, minmax(6.5rem, 1fr));
  --dt-grid-tiles-10: repeat(auto-fit, minmax(10rem, 1fr));
  --dt-grid-tiles-11: repeat(auto-fit, minmax(11rem, 1fr));
  --dt-grid-tiles-13: repeat(auto-fit, minmax(13rem, 1fr));
  --dt-grid-tiles-16: repeat(auto-fit, minmax(16rem, 1fr));
  --dt-grid-tiles-18: repeat(auto-fit, minmax(18rem, 1fr));
  --dt-grid-line: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  --dt-grid-line-pair: minmax(0, 1fr) minmax(0, 1.6fr);
  --dt-grid-line-pair-act: minmax(0, 1fr) minmax(0, 1.6fr) auto;
  --dt-grid-line-detail: minmax(0, 1fr) minmax(0, 1.4fr);
  --dt-grid-line-lead: minmax(0, 1.3fr) minmax(0, 1fr);
  --dt-grid-line-name: minmax(0, 14rem) minmax(0, 1fr);
  --dt-grid-line-name-wide: minmax(0, 16rem) minmax(0, 1fr);
  --dt-grid-line-name-via: minmax(0, 14rem) auto minmax(0, 1fr);
  --dt-grid-route: minmax(0, 1fr) 7.5rem minmax(0, 1fr);
  --dt-grid-tool: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  --dt-grid-setup: minmax(0, 0.6fr) minmax(0, 1fr) minmax(0, 1.6fr);
  --dt-grid-env: minmax(0, 0.7fr) minmax(0, 1fr) minmax(0, 1.2fr);
  --dt-grid-secret: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  --dt-grid-trigger: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr);
  --dt-grid-dependency: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
  --dt-grid-build: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  --dt-grid-field-word: minmax(0, 10rem) minmax(0, 1fr) 7rem 3.5rem;
  --dt-grid-tested-facts: 8rem minmax(0, 1fr);
  --dt-grid-tested-matrix: minmax(9rem, 1.6fr) repeat(7, minmax(3.5rem, 1fr));
  --dt-grid-matrix-wide: minmax(9rem, 1.6fr) 5rem repeat(4, minmax(3.5rem, 1fr));
  --dt-grid-matrix-narrow: 5.5rem repeat(4, minmax(4rem, 1fr));
  --dt-grid-screen-nav: 7.5rem 1fr;
  --dt-grid-rungs: 6.5rem minmax(0, 0.9fr) 4.5rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, auto);
  --dt-grid-table-board: 32px 1.4fr 1fr 0.8fr 1.3fr;
  --dt-grid-numbered: 2rem minmax(0, 1fr);
  /* Source identifiers on pinned cards: named and labelled, not progress states. */
  --dt-source-docs: var(--dt-status-info);
  --dt-source-docs-line: color-mix(in srgb, var(--dt-source-docs) 33.33%, transparent);
  --dt-source-scan: var(--dt-accent-primary);
  --dt-source-scan-line: color-mix(in srgb, var(--dt-source-scan) 33.33%, transparent);
  --dt-source-lesson: var(--dt-status-error);
  --dt-source-lesson-line: color-mix(in srgb, var(--dt-source-lesson) 33.33%, transparent);
  --dt-source-lesson-edge: color-mix(in srgb, var(--dt-source-lesson) 20%, transparent);

  /* ─── Chart palette ──────────────────────────────────────── */
  --dt-chart-grid: var(--dt-prim-carbon-700);
  --dt-chart-label: var(--dt-text-muted);
  --dt-chart-tooltip-bg: var(--dt-prim-carbon-850);
  --dt-chart-tooltip-border: var(--dt-prim-carbon-600);
  --dt-chart-tooltip-text: var(--dt-text-primary);
  --dt-chart-reference: var(--dt-chart-series-4);
  --dt-chart-primary: var(--dt-chart-series-1);
  --dt-chart-pattern-ink: var(--dt-bg-secondary);

  /* Measurements and categories are achromatic, never assigned a status by order. */
  --dt-chart-series-1: #d4d4d4;
  --dt-chart-series-2: #a6a6a6;
  --dt-chart-series-3: #888888;
  --dt-chart-series-4: #767676;
  --dt-chart-series-5: #bdbdbd;
  --dt-chart-series-6: #969696;

  /* ─── Bottom panel (--dt-bp-*) ─────────────────────────────────
   * EVERY BOTTOM PANEL IN THE CONSOLE IS ONE, drawn as the intent page's is (the coach's
   * ruling, 2026-11-17): the intent's, the Locker's conversation, one repo's Field and a
   * workspace's. The primitive is `console/panel/` in the web app. Geometry and type only —
   * its colours are the console's semantic ones (foreground, dim, accent, border-subtle,
   * state-blocked), so a page that repoints them (the Field's IDE look) wears its own. A value
   * already named elsewhere is reused through its own token. */
  --dt-bp-strip-height: var(--dt-size-control-md); /* 26px: the tab strip */
  --dt-bp-strip-inset: var(--dt-space-2); /* 8px: the strip's side padding */
  --dt-bp-tab-inset: var(--dt-space-3); /* 12px: a tab's side padding */
  --dt-bp-tab-text: var(--dt-text-xs); /* 12px tracked mono, upper-case */
  --dt-bp-tab-tracking: var(--dt-tracking-caps-xl);
  --dt-bp-tab-rule: var(--dt-border-width-normal); /* 2px: the tab in front's underline */
  --dt-bp-count-text: var(--dt-text-xs); /* a tab's count pill */
  --dt-bp-count-inset: var(--dt-space-1_5); /* 6px: the pill's side padding */
  --dt-bp-action-inset: var(--dt-space-1); /* 4px: a header action's padding (close, open) */
  --dt-bp-action-icon: 14px; /* its icon; zen's is the one control every pane's title row shares */
  --dt-bp-body-inset-x: 14px; /* a note's and a list's side inset */
  --dt-bp-body-inset-y: var(--dt-space-3); /* 12px: a note's top and bottom */
  --dt-bp-note-text: var(--dt-text-sm); /* empty, loading and error words: the body step */

  /* ─── Border widths ────────────────────────────────────────── */
  --dt-border-width-thin: 1px;
  --dt-border-width-normal: 2px;
  /* 1.5px: the emphasis edge the console hard-coded as border-[1.5px]. */
  --dt-border-width-thick: 1.5px;

  /* ─── Diff colors ──────────────────────────────────────────────── */
  --dt-diff-add: var(--dt-mean-done);
  --dt-diff-remove: var(--dt-mean-fail);

  /* ─── Git status colors ─────────────────────────────────────────── */
  --dt-git-modified: var(--dt-status-warning-text);
  --dt-git-added: var(--dt-mean-done);
  --dt-git-deleted: var(--dt-mean-fail);
  --dt-git-renamed: var(--dt-text-subdued);
  --dt-git-untracked: var(--dt-text-subdued);

  /* ─── The Field as an IDE (#6500) ──────────────────────────────
   * The approved design's shell, by role: its grounds (the editor, the
   * chrome of the title, activity and tab bars, the side bars, a raised
   * card, the bottom panel, a code well), its lines, its text steps, the
   * gold that lights what is open, and a neutral ink for object kinds. */
  --dt-ide-ground: var(--dt-prim-field-980);
  --dt-ide-chrome: var(--dt-prim-field-950);
  --dt-ide-side: var(--dt-prim-field-940);
  --dt-ide-raised: var(--dt-prim-field-920);
  --dt-ide-panel: var(--dt-prim-field-960);
  --dt-ide-well: var(--dt-prim-field-990);
  --dt-ide-line: var(--dt-prim-field-840);
  --dt-ide-line-strong: var(--dt-prim-field-820);
  --dt-ide-line-faint: var(--dt-prim-field-880);
  --dt-ide-on: var(--dt-prim-field-860);
  --dt-ide-lit: var(--dt-prim-gold-tint);
  --dt-ide-fg: var(--dt-prim-field-100);
  --dt-ide-text: var(--dt-prim-field-150);
  --dt-ide-code: var(--dt-prim-field-200);
  --dt-ide-muted: var(--dt-prim-field-300);
  --dt-ide-icon: var(--dt-prim-field-400);
  --dt-ide-dim: var(--dt-prim-field-450);
  /* Faint is still text: it reads at AA (4.5:1) on every IDE ground, one step under dim in name only. */
  --dt-ide-faint: var(--dt-prim-field-450);
  --dt-ide-status: var(--dt-prim-field-gold-status);
  --dt-ide-status-line: var(--dt-prim-field-gold-status-line);
  --dt-ide-status-text: var(--dt-prim-field-gold-status-text);
  --dt-ide-accent: var(--dt-accent-primary);
  --dt-ide-accent-hi: var(--dt-accent-hover);
  --dt-ide-wait: var(--dt-status-warning-text);
  --dt-ide-run: var(--dt-mean-run);
  --dt-ide-accent-on-accent: var(--dt-accent-on-accent);
  --dt-ide-category: var(--dt-ide-muted);
  /* Quick open and peek (A3): the palette's and a card's border, a pill
   * that is on (fill, line, bright text), the peek's ground and its inner
   * rule, and the row a peek is open under. */
  --dt-ide-line-node: var(--dt-prim-field-810);
  --dt-ide-accent-fill: var(--dt-prim-gold-fill);
  --dt-ide-accent-line: var(--dt-prim-field-gold-line);
  --dt-ide-peek: var(--dt-prim-field-gold-peek);
  --dt-ide-peek-line: var(--dt-prim-field-gold-peek-line);
  --dt-ide-row-lit: var(--dt-prim-field-gold-row);
  /* The admin's hat (`.admin-hat`, index.css): its violet, bright text, ground, line, fill, selected row and
   * the ink on a violet fill. */
  --dt-admin: var(--dt-prim-field-violet);
  --dt-admin-warning: var(--dt-prim-admin-warning);
  --dt-admin-warning-text: var(--dt-prim-amber-400);
  --dt-admin-warning-mark: var(--dt-prim-amber-500);
  --dt-admin-hi: var(--dt-prim-field-violet-hi);
  --dt-admin-ground: var(--dt-prim-field-violet-ground);
  --dt-admin-line: var(--dt-prim-field-violet-line);
  --dt-admin-fill: var(--dt-prim-field-violet-fill);
  --dt-admin-row: var(--dt-prim-field-violet-row);
  --dt-admin-ink: var(--dt-prim-field-violet-ink);
  /* Its faces: Inter for words, JetBrains Mono for names, as the design draws them. */
  --dt-font-ide: var(--dt-font-ui);
  --dt-font-ide-mono: var(--dt-font-mono);
  /* ─── Diagram surface (the Field's ER and System diagrams) ────────────────
   * One renderer draws both, so one vocabulary paints both: the dotted ground,
   * the dashed group boxes, the node cards, the lines and their labels, the
   * toolbar chips, the minimap and the zoom controls. Values are the approved
   * design's (#6500), through the Field's primitives. */
  --dt-diagram-ground: var(--dt-prim-field-990);
  --dt-diagram-dot: var(--dt-prim-field-870);
  --dt-diagram-group-border: var(--dt-prim-field-810);
  --dt-diagram-group-fill: rgba(255, 255, 255, 0.012);
  --dt-diagram-group-label: var(--dt-prim-field-300);
  --dt-diagram-node: var(--dt-prim-field-920);
  /* A box stands off the ground by its border, a step brighter than the old 810 it sank into. */
  --dt-diagram-node-border: var(--dt-prim-field-700);
  --dt-diagram-node-rule: var(--dt-prim-field-820);
  --dt-diagram-node-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  /* A line's stroke (lit when it touches the selected card), its derived dash, and the minimap's
   * box (React Flow scales its view from the box as numbers: index.ts `diagramMinimapPx`). */
  --dt-diagram-edge-width: 1.2;
  --dt-diagram-edge-width-hot: 1.8;
  --dt-diagram-edge-dash: 4 4;
  --dt-diagram-minimap-width: 150px;
  --dt-diagram-minimap-height: 96px;
  --dt-diagram-outside-border: var(--dt-prim-field-600);
  --dt-diagram-name: var(--dt-prim-field-100);
  --dt-diagram-row: var(--dt-prim-field-200);
  --dt-diagram-type: var(--dt-prim-field-450);
  /* A table's columns: its key, its foreign keys and the rest, each readable on the node and apart. */
  --dt-diagram-key: var(--dt-prim-field-150);
  --dt-diagram-fk: var(--dt-prim-field-300);
  --dt-diagram-warn: var(--dt-prim-pink-400);
  --dt-diagram-accent: var(--dt-prim-gold-400);
  /* A line is two steps brighter than the ground, so it never sinks into it. */
  --dt-diagram-edge: var(--dt-prim-field-450);
  --dt-diagram-panel: var(--dt-prim-field-950);
  --dt-diagram-panel-border: var(--dt-prim-field-820);
  --dt-diagram-chip-text: var(--dt-prim-field-200);
  --dt-diagram-chip-on-border: var(--dt-prim-field-gold-line);
  --dt-diagram-chip-on-text: var(--dt-prim-gold-hi);
  --dt-diagram-label: var(--dt-prim-field-300);
  --dt-diagram-control: var(--dt-prim-field-150);
  --dt-diagram-mini-node: var(--dt-prim-field-700);
  --dt-diagram-glyph-table: var(--dt-prim-field-300);
  --dt-diagram-glyph-part: var(--dt-prim-field-300);
  --dt-diagram-glyph-outside: var(--dt-prim-field-300);
  --dt-diagram-glyph-route: var(--dt-prim-field-300);

  /* ─── The app's own text steps, and the proof scale ────────────────────
   * `subdued` is the console's `muted` text (between secondary and muted, a
   * true grey); proof is ordinal, never a status hue, and proven is brightest. */
  --dt-text-subdued: var(--dt-prim-grey-400);
  --dt-proof-proven: var(--dt-prim-carbon-100);
  --dt-proof-verified: var(--dt-prim-carbon-250);
  --dt-proof-deferred: var(--dt-prim-carbon-450);

  /* ─── Terminal (ANSI) output ───────────────────────────────────────────
   * What `.terminal-ansi` paints anser's `ansi-<name>-fg/-bg` classes in. The
   * bright foregrounds share their hue's step; bright black is the lifted
   * gutter grey line numbers and carets are drawn in. */
  --dt-ansi-black: var(--dt-prim-ansi-black);
  --dt-ansi-bright-black: var(--dt-prim-ansi-bright-black);
  --dt-ansi-red: var(--dt-prim-ansi-red);
  --dt-ansi-green: var(--dt-prim-ansi-green);
  --dt-ansi-yellow: var(--dt-prim-ansi-yellow);
  --dt-ansi-blue: var(--dt-prim-ansi-blue);
  --dt-ansi-magenta: var(--dt-prim-ansi-magenta);
  --dt-ansi-cyan: var(--dt-prim-ansi-cyan);
  --dt-ansi-white: var(--dt-prim-ansi-white);
  --dt-ansi-black-bg: var(--dt-prim-ansi-black-bg);
  --dt-ansi-red-bg: var(--dt-prim-ansi-red-bg);
  --dt-ansi-green-bg: var(--dt-prim-ansi-green-bg);
  --dt-ansi-yellow-bg: var(--dt-prim-ansi-yellow-bg);
  --dt-ansi-blue-bg: var(--dt-prim-ansi-blue-bg);
  --dt-ansi-magenta-bg: var(--dt-prim-ansi-magenta-bg);
  --dt-ansi-cyan-bg: var(--dt-prim-ansi-cyan-bg);
  --dt-ansi-white-bg: var(--dt-prim-ansi-white-bg);
  --dt-ansi-dim-opacity: 0.75; /* anser's `dim` is .5, too dark stacked on the well */

  /* ─── The wall (console/wall) ──────────────────────────────────────────
   * One markup fills a 32" panel, an 85" panel and the console's dashboard
   * column, so its type is FLUID: clamp(floor, container width, ceiling). The
   * floor keeps it legible in a narrow pane; the ceiling never caps a real TV. */
  --dt-wall-text-micro: clamp(12px, 0.92cqw, 22px); /* a chart tick, a legend */
  --dt-wall-text-caption: clamp(12px, 1cqw, 24px);
  --dt-wall-text-label: clamp(12px, 1.05cqw, 26px); /* an uppercase band label */
  --dt-wall-text-meta: clamp(12px, 1.15cqw, 30px);
  --dt-wall-text-body: clamp(12px, 1.5cqw, 40px);
  --dt-wall-text-lead: clamp(12px, 1.75cqw, 44px);
  --dt-wall-text-mark: clamp(13px, 1.7cqw, 46px); /* the wordmark */
  --dt-wall-text-figure: clamp(30px, 6.1cqw, 160px); /* a headline number */
  --dt-wall-radius-sm: 0.1cqw;
  --dt-wall-radius-md: 0.15cqw;
  --dt-wall-radius-lg: 0.3cqw;
  --dt-wall-breathe-calm: 3.2s; /* the live dot */
  --dt-wall-breathe-quick: 2.6s; /* a row's mini dot */
  --dt-wall-row-hover: rgba(255, 255, 255, 0.03);
  /* On a TV (`.qb-wall--tv`): the room's own palette, see primitives. */
  --dt-wall-tv-bg: var(--dt-prim-wall-950);
  --dt-wall-tv-border: var(--dt-prim-wall-800);
  --dt-wall-tv-fg: var(--dt-prim-wall-50);
  --dt-wall-tv-fg-2: var(--dt-prim-wall-200);
  --dt-wall-tv-muted: var(--dt-prim-wall-300);
  --dt-wall-tv-rule: var(--dt-prim-wall-500);
  --dt-wall-tv-done: var(--dt-prim-wall-green);
  --dt-wall-tv-running: var(--dt-prim-wall-blue);
  --dt-wall-tv-wait: var(--dt-prim-wall-pink);
  --dt-wall-tv-fail: var(--dt-prim-wall-red);
  --dt-wall-tv-proven: var(--dt-prim-wall-100);
  --dt-wall-tv-verified: var(--dt-prim-wall-400);
  --dt-wall-tv-deferred: var(--dt-prim-wall-700);

  /* ─── The public site (landing, about, contact, terms) ─────────────────
   * Its headlines are FLUID: clamp(floor, viewport width, ceiling), with a
   * narrower step under 768px. Body copy uses the shared type scale. */
  --dt-display-hero: clamp(2.5rem, 6vw, 4.5rem);
  --dt-display-hero-narrow: clamp(2rem, 8vw, 3rem);
  --dt-display-page: clamp(2.5rem, 5vw, 3.5rem); /* a page's own h1 (about) */
  --dt-display-title: clamp(2rem, 4vw, 3rem); /* a section title, a call to action */
  --dt-display-title-narrow: clamp(1.5rem, 5vw, 2.5rem);
  --dt-display-cta: clamp(2rem, 4vw, 2.5rem);
  --dt-display-claim: clamp(1.75rem, 3vw, 2.5rem); /* a pane's one-line claim */
  --dt-display-claim-narrow: clamp(1.25rem, 4vw, 1.75rem);
  /* A bar over scrolling content, and a menu laid over the whole page. */
  --dt-bg-glass: rgba(0, 0, 0, 0.85);
  --dt-bg-glass-heavy: rgba(0, 0, 0, 0.95);
}

/* ============================================================================
 * DARK FLAT — Dark's palette, with nothing lifted.
 * ============================================================================
 *
 * Every colour is Dark's; only depth changes. A raised surface sits on the
 * panel's own ground (`elevated` = `secondary`), and headers, cards and the
 * question box cast no shadow, so one band is told from the next by its
 * hairline, which is the faint one. Menus, dialogs and popovers keep their
 * shadows: they float above the page rather than being part of it. Same
 * <html>-only rule as the light theme below. */
[data-theme='dark-flat'] {
  color-scheme: dark;

  --dt-bg-elevated: var(--dt-prim-carbon-900);
  --dt-border-header: var(--dt-border-subtle);

  --dt-shadow-xs: none;
  --dt-shadow-sm: none;
  --dt-shadow-md: none;
  --dt-shadow-card: none;
  --dt-shadow-card-hover: none;
  --dt-shadow-header: none;
  --dt-shadow-ask: 0 0 0 3px var(--dt-status-warning-bg);
}

/* ============================================================================
 * THE LIGHT THEME — the same names, repointed. Nothing in a component changes.
 * ============================================================================
 *
 * SET ON <html>, AND ONLY THERE. `<html data-theme="light">` — written by the
 * pre-paint script in index.html and by `useTheme` — is the same element as
 * `:root`, so every token above that is DERIVED from another
 * (`--dt-interactive-input-bg: var(--dt-bg-recess)`, the focus ring, the chart
 * accent) resolves against these values without being restated. Putting the
 * attribute on a nested element would not do that: a derived token is computed
 * where it is declared, which is the root.
 *
 * ONLY COLOURS ARE HERE. Radius, type, spacing and motion are the same in both
 * themes, so they are declared once, above.
 *
 * WHAT STAYS DARK: the diagram canvas (`--dt-diagram-*`). Its React Flow
 * surface is drawn with `colorMode="dark"` (DiagramSurface), and a light canvas
 * is a design of its own rather than a repointing.
 *
 * The light accent is gold ink, both for text on paper and for filled actions
 * with white labels. Launch gold itself is not legible on paper. */
[data-theme='light'] {
  color-scheme: light;

  /* ─── Backgrounds ─── recess is still BELOW the page: a well is greyer. */
  --dt-bg-recess: var(--dt-prim-paper-75);
  --dt-bg-primary: var(--dt-prim-paper-50);
  --dt-bg-secondary: var(--dt-prim-paper-0);
  --dt-bg-tertiary: var(--dt-prim-paper-100);
  /* WHITE, like the surface: on paper a raised band is told by its hairline, not by a second
     near-white that reads as a different white rather than as a level. */
  --dt-bg-elevated: var(--dt-prim-paper-0);
  --dt-bg-overlay: rgba(20, 23, 26, 0.4);
  --dt-bg-surface-overlay: var(--dt-prim-paper-0);

  /* ─── Text ─── */
  --dt-text-primary: var(--dt-prim-paper-900);
  --dt-text-secondary: var(--dt-prim-paper-800);
  --dt-text-tertiary: var(--dt-prim-paper-800);
  --dt-text-muted: var(--dt-prim-paper-600);
  --dt-text-placeholder: var(--dt-prim-paper-400);

  /* ─── Borders ─── */
  --dt-border-primary: var(--dt-prim-paper-350);
  --dt-border-secondary: var(--dt-prim-paper-300);
  --dt-border-muted: var(--dt-prim-paper-350);
  --dt-border-subtle: var(--dt-prim-paper-200);

  /* ─── Accent ─── */
  --dt-accent-primary: var(--dt-prim-gold-ink);
  --dt-accent-primary-fill: var(--dt-prim-gold-wash);
  --dt-accent-hover: var(--dt-prim-gold-ink-hi);
  --dt-accent-visited: var(--dt-prim-gold-ink-visited);
  --dt-accent-dim: var(--dt-prim-gold-ink-edge);
  --dt-accent-on-accent: var(--dt-prim-paper-0);

  /* ─── Status ─── text steps pass 4.5:1 on white; dots and edges keep 3:1. */
  --dt-status-success: var(--dt-prim-green-ink);
  --dt-status-warning: var(--dt-prim-pink-mark);
  --dt-status-warning-text: var(--dt-prim-pink-ink);
  --dt-status-error: var(--dt-prim-red-ink);
  --dt-status-info: var(--dt-prim-blue-ink);

  /* ─── Interactive ─── */
  --dt-interactive-bg: var(--dt-prim-paper-100);
  --dt-interactive-hover: var(--dt-prim-paper-150);
  --dt-interactive-active: var(--dt-prim-gold-pale);
  --dt-interactive-input-border: var(--dt-prim-paper-300);
  --dt-interactive-input-focus-border: var(--dt-accent-dim);

  /* ─── Shadows ─── a dark shadow on white is a smudge at the dark theme's alphas. */
  --dt-shadow-xs: 0 1px 2px rgba(20, 23, 26, 0.04);
  --dt-shadow-sm: 0 1px 3px rgba(20, 23, 26, 0.06);
  --dt-shadow-md: 0 2px 8px rgba(20, 23, 26, 0.08);
  --dt-shadow-lg: 0 4px 16px rgba(20, 23, 26, 0.1);
  --dt-shadow-xl: 0 8px 24px rgba(20, 23, 26, 0.12);
  --dt-shadow-2xl: 0 20px 40px rgba(20, 23, 26, 0.12);
  --dt-shadow-card: 0 1px 3px rgba(20, 23, 26, 0.06);
  --dt-shadow-card-hover: 0 4px 12px rgba(20, 23, 26, 0.08);
  /* A header on white is ruled off by its hairline alone: any shadow under it greys the band below. */
  --dt-shadow-header: none;
  --dt-shadow-menu: 0 8px 24px rgba(20, 23, 26, 0.12);
  --dt-shadow-dialog: 0 16px 48px rgba(20, 23, 26, 0.18);
  --dt-shadow-popover: 0 12px 32px rgba(20, 23, 26, 0.14);
  --dt-shadow-ask:
    0 0 0 3px color-mix(in srgb, var(--dt-status-warning-text) 10%, transparent),
    0 6px 18px rgba(20, 23, 26, 0.08);
  --dt-ring-accent: 0 0 0 3px color-mix(in srgb, var(--dt-accent-primary) 12%, transparent);
  --dt-glow-warning-sm: 0 0 0 3px color-mix(in srgb, var(--dt-status-warning-text) 16%, transparent);
  --dt-border-header: var(--dt-border-subtle);

  /* ─── Charts ─── */
  --dt-chart-grid: var(--dt-prim-paper-200);
  --dt-chart-tooltip-bg: var(--dt-prim-paper-0);
  --dt-chart-tooltip-border: var(--dt-prim-paper-300);
  --dt-chart-series-1: #343434;
  --dt-chart-series-2: #595959;
  --dt-chart-series-3: #707070;
  --dt-chart-series-4: #767676;
  --dt-chart-series-5: #454545;
  --dt-chart-series-6: #666666;

  /* ─── The IDE (workbench and the Field) ─── */
  --dt-ide-ground: var(--dt-prim-paper-0);
  --dt-ide-chrome: var(--dt-prim-paper-100);
  --dt-ide-side: var(--dt-prim-paper-50);
  --dt-ide-raised: var(--dt-prim-paper-0);
  --dt-ide-panel: var(--dt-prim-paper-25);
  --dt-ide-well: var(--dt-prim-paper-75);
  --dt-ide-line: var(--dt-prim-paper-200);
  --dt-ide-line-strong: var(--dt-prim-paper-300);
  --dt-ide-line-faint: var(--dt-prim-paper-125);
  --dt-ide-on: var(--dt-prim-paper-150);
  --dt-ide-lit: var(--dt-prim-gold-wash);
  --dt-ide-fg: var(--dt-prim-paper-900);
  --dt-ide-text: var(--dt-prim-paper-800);
  --dt-ide-code: var(--dt-prim-paper-700);
  --dt-ide-muted: var(--dt-prim-paper-600);
  --dt-ide-icon: var(--dt-prim-paper-550);
  --dt-ide-dim: var(--dt-prim-paper-600);
  /* AA on every light IDE ground (it was paper-400, 2.3–2.6:1). */
  --dt-ide-faint: var(--dt-prim-paper-550);
  --dt-ide-status: var(--dt-prim-gold-pale);
  --dt-ide-status-line: var(--dt-prim-field-gold-status-line-light);
  --dt-ide-status-text: var(--dt-prim-field-gold-status-text-light);
  --dt-ide-line-node: var(--dt-prim-paper-300);
  --dt-ide-accent-fill: var(--dt-prim-gold-pale);
  --dt-ide-accent-line: var(--dt-prim-field-gold-status-line-light);
  --dt-ide-peek: var(--dt-prim-gold-wash);
  --dt-ide-peek-line: var(--dt-prim-field-gold-status-line-light);
  --dt-ide-row-lit: var(--dt-prim-gold-wash);
  --dt-admin: var(--dt-prim-violet-ink);
  --dt-admin-warning: var(--dt-prim-amber-ink);
  --dt-admin-warning-text: var(--dt-prim-amber-ink);
  --dt-admin-warning-mark: var(--dt-admin-warning-text);
  --dt-admin-hi: var(--dt-prim-violet-ink-hi);
  --dt-admin-ground: var(--dt-prim-violet-wash);
  --dt-admin-line: var(--dt-prim-violet-edge);
  --dt-admin-fill: var(--dt-prim-violet-pale);
  --dt-admin-row: var(--dt-prim-violet-wash);
  --dt-admin-ink: var(--dt-prim-paper-0);
  --dt-bg-glass: rgba(255, 255, 255, 0.85);
  --dt-bg-glass-heavy: rgba(255, 255, 255, 0.95);
  /* ─── The app's own text steps, and the proof scale ─── */
  --dt-text-subdued: var(--dt-prim-paper-700);
  --dt-proof-proven: var(--dt-prim-paper-900);
  --dt-proof-verified: var(--dt-prim-paper-500);
  --dt-proof-deferred: var(--dt-prim-paper-400);
  /* ─── Terminal (ANSI) ─── darker steps of each hue, on a pale well. */
  --dt-ansi-black: var(--dt-prim-paper-700);
  --dt-ansi-bright-black: var(--dt-prim-paper-550);
  --dt-ansi-red: var(--dt-prim-ansi-red-ink);
  --dt-ansi-green: var(--dt-prim-ansi-green-ink);
  --dt-ansi-yellow: var(--dt-prim-ansi-yellow-ink);
  --dt-ansi-blue: var(--dt-prim-ansi-blue-ink);
  --dt-ansi-magenta: var(--dt-prim-purple-ink);
  --dt-ansi-cyan: var(--dt-prim-ansi-cyan-ink);
  --dt-ansi-white: var(--dt-prim-paper-900);
  --dt-ansi-black-bg: var(--dt-prim-ansi-well);
}
