/* tokens-ext.css — SEAL14 extension of the SEAL10 tokens (tokens.css v2.2.0-proposed, kept byte-identical beside this file).
   Rule: the palette, the #851935 signal, the warm neutrals, the semantic-state roles, the focus law and the z layers are
   INHERITED unchanged. This file adds the craft-layer tokens the component system needs (surface/elevation scale, control
   scale, density, icon sizes, per-component motion) and re-derives a few geometry values with a measured reason. Every
   raw colour value in the packet lives in the two token files; craft.css consumes var() only (proven by the token gate). */
:root{
  /* ── surface & elevation scale (C-09): five levels, differentiated by tone + hairline + restrained shadow, never by
        one white card for every level (supplement §3.3) ── */
  --surface-0: var(--bg);                          /* ground */
  --surface-1: var(--surface);                     /* card / panel */
  --surface-2x: var(--surface-2);                  /* inset / secondary panel (SEAL10 --surface-2) */
  --surface-3: var(--surface);                     /* raised (T3) — same paint, stronger shadow */
  --surface-4: var(--surface);                     /* overlay (dialog / palette / drawer) */
  --line-soft: var(--line);                        /* hairline inside cards */
  --line-mid: var(--line-2);                       /* hairline between sections / control borders */
  --line-strong: var(--input-line);                /* input boundary (≥3:1 on white — WCAG 1.4.11) */
  --elev-1: 0 0 0 1px var(--line);                 /* T1 inset panels: hairline only */
  --elev-2: 0 0 0 1px var(--line), 0 1px 2px rgba(28,20,23,.04), 0 2px 8px rgba(28,20,23,.04);   /* T2 card */
  --elev-3: 0 0 0 1px var(--line-2), 0 2px 4px rgba(28,20,23,.05), 0 12px 32px rgba(28,20,23,.08); /* T3 raised */
  --elev-4: 0 0 0 1px rgba(28,20,23,.06), 0 8px 16px rgba(28,20,23,.10), 0 24px 64px rgba(28,20,23,.18); /* T4 overlay */
  --elev-btn-hover: 0 1px 1px rgba(28,20,23,.05), 0 0 0 1px var(--input-line);                       /* ghost hover: the boundary strengthens */
  --elev-btn-pressed: inset 0 2px 4px rgba(0,0,0,.28);                                            /* primary/danger pressed: inset shade */
  --elev-btn: 0 1px 1px rgba(28,20,23,.05), 0 0 0 1px var(--line-2);                               /* ghost button material */
  --elev-btn-primary: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 2px rgba(58,13,28,.30);         /* primary: top light + brand umbra */
  --wash-hover: var(--ink-wash-04);
  --wash-active: var(--ink-wash-09);
  --wash-selected: var(--brand-wash-07);
  --side-wash-hover: var(--on-dark-wash-07);
  --side-wash-active: rgba(255,255,255,.16);   /* pressed: a clear step above the .07 hover wash */
  --side-line-soft: rgba(255,255,255,.06);
  --brand-rail: var(--brand-rose-on-dark);         /* 2px "you are here" rail on dark surfaces */

  /* ── control scale (C-03, C-06): visual heights under pointer:fine; 44px under pointer:coarse (GOV-EX-1 extended) ── */
  --ctl-sm: 28px;
  --ctl-md: 32px;
  --ctl-lg: 36px;
  --ctl-xl: 40px;
  --ctl-touch: 44px;
  --ctl-portal: 48px;
  --r-ctl: 8px;                                    /* buttons, inputs, chips (rectangular) */
  --r-card: 12px;                                  /* cards, panels (== --r-2) */
  --r-tile: 6px;                                   /* avatars, badges, small tiles */
  --r-pill: 999px;

  /* ── density (C-05, supplement §2): rows and gaps for an all-day instrument ── */
  --row-h: 40px;                                   /* table row, pointer:fine */
  --row-h-touch: 44px;
  --rail-row: 32px;                                /* rail row visual height, pointer:fine (SEAL10 GOV-EX-1: 31 min) */
  --rail-w: clamp(240px, 15rem, 320px);             /* 240 at the default text size; grows with text zoom so labels keep reading (320 cap) */
  --rail-w-collapsed: 64px;
  --topbar-h-craft: 56px;                          /* measured benchmarks 40–56; SEAL10 62 was the candidate's measurement */
  --page-x: 32px;
  --page-y: 24px;
  --page-max: 1180px;
  --card-pad: 20px;
  --card-pad-sm: 16px;

  /* ── typography roles (C-03/C-05/C-06): sizes inherit the SEAL10 scale; these are the roles components consume ── */
  --t-label: var(--t-sm);                          /* 13px UI labels, weight 500–600 */
  --t-meta: var(--t-xs);                           /* 12px meta / help */
  --t-caps: var(--t-2xs);                          /* 11px caps wayfinders */
  --t-title: 0.9375rem;                            /* 15px card titles (between h3 16 and body 14) */
  --t-table: var(--t-sm);
  --t-th: var(--t-xs);
  --track-caps: .08em;
  --track-tight: -.012em;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --lh-ui: 1.3;

  /* ── iconography (C-08): one family, one stroke; four sizes ── */
  --ic-2xs: 12px;                                  /* owner / provenance lines */
  --ic-xs: 14px;                                   /* inside chips, crumbs */
  --ic-sm: 16px;                                   /* buttons, table actions, inputs */
  --ic-md: 18px;                                   /* rail rows, topbar */
  --ic-lg: 20px;                                   /* empty-state tiles */
  --q-chip-col: 132px;                             /* attention-queue chip column (fits 'Last heard 07:31') */
  --ic-stroke: 2;                                  /* svg stroke-width in a 24 viewBox (1.17–1.67 px visual) */
  --icon-on-fill: var(--on-dark-ink);

  /* ── motion per component (C-13): transform/opacity, 90–240 ms, reduced motion = instant swap ── */
  --m-hover: 120ms;
  --m-press: 90ms;
  --m-state: 160ms;
  --m-dialog: 180ms;
  --m-drawer: 220ms;
  --m-toast: 180ms;
  --m-skeleton: 1200ms;
  --m-draw: 600ms;
  --ease-craft: cubic-bezier(.2,.8,.2,1);

  /* ── charts (C-10) ── */
  --chart-line-w: 2px;
  --chart-fill: rgba(133,25,53,.10);
  --chart-grid-w: 1px;
  --chart-label: var(--ink-3);

  /* ── portal (C-12) ── */
  --portal-max: 430px;
  --portal-pad: 18px;
  --portal-r: 12px;                                /* portal cards and plan cards share the console card radius; controls 10 */
  /* ── alpha additions consumed by craft.css (all derived from ink #1c1417, brand umbra #3a0d1c, red #d23a52, white) ── */
  --ink-wash-03: rgba(28,20,23,.03);
  --red-wash-14: rgba(210,58,82,.14);
  --brand-umbra-25: rgba(58,13,28,.25);
  --brand-umbra-30: rgba(58,13,28,.30);
  --on-dark-wash-06: rgba(255,255,255,.06);
  --on-dark-wash-10: rgba(255,255,255,.10);
  --on-dark-wash-12: rgba(255,255,255,.12);
  --on-dark-wash-14: rgba(255,255,255,.14);
  --on-brand-ink-72: rgba(255,255,255,.72);
  --on-brand-ink-78: rgba(255,255,255,.78);
  --on-brand-ink-80: rgba(255,255,255,.80);
  --on-brand-ink-86: rgba(255,255,255,.86);
  --hero-mesh-line: rgba(255,255,255,.18);
  --hero-mesh-dot: rgba(255,255,255,.42);
  --act-col-w: 48px;            /* CORR1 D1/D5: action column = control (32) + 8 either side; the cell no longer clips its control */
  --act-col-w-touch: 52px;      /* CORR1 D1/D5: 44 px touch control + 4 either side (table auto-layout settles this column at 52) */
  --act-col-pad-touch: 4px;     /* CORR1 D1/D5: at coarse pointers the padding gives way so the 44 px target still fits its cell */
  --act-col-pad: 8px;           /* CORR1 D1/D5: symmetric action-cell padding (was 10 left / 6 right) */
  --gap-inline-ctl: 7px;        /* CORR1 D2: ONE gap for leading icon -> label and spinner -> label, console and portal */
}
