/* Original v2 tokens; native system typography, unused custom font downloads omitted. */
/* ============================================================
   ADITOR DESIGN SYSTEM — tokens (v2 · Oct 2026)
   The product language of Portal, Hub and Dispatcher:
   Apple-native, light + dark (follows the system), calm grey,
   orange once per screen.
   ============================================================ */

/* ---- BRAND FONTS (self-hosted) ----
   Display / serif: Awesome Serif (Regular, Tall, Bold)
   Body / UI:       SF Pro Text (Regular, SemiBold, Bold, Heavy + italics)
   Mono:            no upload — using JetBrains Mono via CDN as the
                    nearest match for the briefed Geist Mono character.
*/
/* ---- LIGHT (default) ----
   Values come from the live apps (Oct 2026):
   portal web/src/appearance.css · hub hub-overview.css · dispatcher cockpit.css */
:root {
  color-scheme: light dark;

  /* surfaces — near-neutral grey, hue 270, almost no chroma */
  --bg:           oklch(0.974 0.003 270);   /* page canvas */
  --bg-sunken:    oklch(0.95  0.004 270);   /* sidebar, wells */
  --surface:      oklch(1     0     0);     /* panels, cards */
  --surface-2:    oklch(0.96  0.003 270);   /* fields, segmented track, hover */
  --line:         oklch(0.89  0.004 270);   /* 1px hairlines */
  --line-strong:  oklch(0.80  0.005 270);

  /* text */
  --label:        oklch(0.22 0.008 270);
  --label-2:      oklch(0.43 0.008 270);
  --label-3:      oklch(0.52 0.006 270);
  --label-inv:    oklch(0.99 0 0);

  /* orange — ONE filled action per screen; text-orange for links */
  --accent:       oklch(0.705 0.20 40);     /* action fill */
  --accent-hi:    oklch(0.77  0.16 45);
  --accent-lo:    oklch(0.68  0.18 40);
  --on-accent:    oklch(0.18  0.025 40);    /* dark text on orange */
  --accent-text:  oklch(0.53  0.17 38);     /* links, "Show all" */
  --accent-soft:  oklch(0.705 0.20 40 / 0.12);

  /* selection — ink, not orange (dispatcher pills, active nav) */
  --selected:     oklch(0.24 0.012 280);
  --on-selected:  oklch(0.99 0 0);

  /* semantic: tint + text pairs; never colour alone */
  --success: oklch(0.45 0.12 145); --success-soft: oklch(0.94 0.035 150);
  --warn:    oklch(0.47 0.10 75);  --warn-soft:    oklch(0.95 0.05 80);
  --danger:  oklch(0.49 0.18 27);  --danger-soft:  oklch(0.95 0.025 28);
  --info:    oklch(0.48 0.12 250); --info-soft:    oklch(0.95 0.025 250);

  /* elevation — hairline first, shadow barely */
  --shadow-1: 0 1px 2px oklch(0.2 0 0 / .05);
  --shadow-panel: 0 1px 2px oklch(0.2 0 0 / .04), 0 6px 18px oklch(0.2 0.01 270 / .06);
  --shadow-2: 0 4px 16px oklch(0.1 0 0 / .06);
  --shadow-3: 0 16px 48px oklch(0.1 0 0 / .12);
  --shadow-press: inset 0 1px 0 oklch(1 0 0 / .38), inset 0 -1px 0 oklch(0.3 0.08 40 / .15), 0 3px 7px -2px oklch(0.45 0.14 40 / .3);
  --scrim: oklch(0.2 0.02 280 / .45);
  --reward: linear-gradient(145deg, oklch(0.88 0.135 80), oklch(0.79 0.17 60) 55%, oklch(0.72 0.18 44));
  --on-reward: oklch(0.25 0.035 45);
}

/* ---- DARK — follows the OS, or forced with data-theme ---- */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: oklch(0.19 0.004 270); --bg-sunken: oklch(0.165 0.004 270);
  --surface: oklch(0.235 0.005 270); --surface-2: oklch(0.28 0.005 270);
  --line: oklch(0.32 0.005 270); --line-strong: oklch(0.40 0.005 270);
  --label: oklch(0.97 0.004 270); --label-2: oklch(0.79 0.006 270); --label-3: oklch(0.70 0.006 270);
  --label-inv: oklch(0.18 0 0);
  --accent-text: oklch(0.77 0.15 40);
  --selected: oklch(0.95 0.004 270); --on-selected: oklch(0.2 0.01 270);
  --success: oklch(0.76 0.12 145); --success-soft: oklch(0.76 0.12 145 / .14);
  --warn:    oklch(0.80 0.10 75);  --warn-soft:    oklch(0.80 0.10 75 / .14);
  --danger:  oklch(0.76 0.14 27);  --danger-soft:  oklch(0.76 0.14 27 / .14);
  --info:    oklch(0.77 0.10 250); --info-soft:    oklch(0.77 0.10 250 / .14);
  --shadow-1: 0 1px 2px oklch(0 0 0 / .3);
  --shadow-panel: inset 0 1px 0 oklch(1 0 0 / .05), 0 8px 24px oklch(0 0 0 / .28);
  --shadow-2: 0 4px 16px oklch(0 0 0 / .3);
  --shadow-3: 0 24px 80px oklch(0 0 0 / .45), inset 0 1px 0 oklch(1 0 0 / .08);
  --scrim: oklch(0 0 0 / .6);
} }
:root[data-theme="dark"] {
  --bg: oklch(0.19 0.004 270); --bg-sunken: oklch(0.165 0.004 270);
  --surface: oklch(0.235 0.005 270); --surface-2: oklch(0.28 0.005 270);
  --line: oklch(0.32 0.005 270); --line-strong: oklch(0.40 0.005 270);
  --label: oklch(0.97 0.004 270); --label-2: oklch(0.79 0.006 270); --label-3: oklch(0.70 0.006 270);
  --label-inv: oklch(0.18 0 0);
  --accent-text: oklch(0.77 0.15 40);
  --selected: oklch(0.95 0.004 270); --on-selected: oklch(0.2 0.01 270);
  --success: oklch(0.76 0.12 145); --success-soft: oklch(0.76 0.12 145 / .14);
  --warn:    oklch(0.80 0.10 75);  --warn-soft:    oklch(0.80 0.10 75 / .14);
  --danger:  oklch(0.76 0.14 27);  --danger-soft:  oklch(0.76 0.14 27 / .14);
  --info:    oklch(0.77 0.10 250); --info-soft:    oklch(0.77 0.10 250 / .14);
  --shadow-1: 0 1px 2px oklch(0 0 0 / .3);
  --shadow-panel: inset 0 1px 0 oklch(1 0 0 / .05), 0 8px 24px oklch(0 0 0 / .28);
  --shadow-2: 0 4px 16px oklch(0 0 0 / .3);
  --shadow-3: 0 24px 80px oklch(0 0 0 / .45), inset 0 1px 0 oklch(1 0 0 / .08);
  --scrim: oklch(0 0 0 / .6);
}

:root {
  /* type — system font everywhere (Inter allowed for dense ops tools) */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --font-dense: "Inter", var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", monospace;
  --font-serif: "Awesome Serif", "Instrument Serif", Times, serif; /* marketing only — never in product UI */

  /* iOS ramp, in rem so it scales with the browser text size */
  --t-hero: 3rem;        /* big figures (€510.00) · 600 · -0.05em */
  --t-large: 2.125rem;   /* 34/41 page title · 650 · -0.035em */
  --t-title: 1.375rem;   /* 22/28 panel title · 600 · -0.03em */
  --t-headline: 1.0625rem; /* 17/22 section head · 600 · -0.015em */
  --t-body: 1rem;        /* 16/24 */
  --t-callout: .9375rem; /* 15/20 */
  --t-sub: .875rem;      /* 14/20 secondary, buttons, nav */
  --t-foot: .8125rem;    /* 13/18 labels, meta */
  --t-caption: .75rem;   /* 12/16 */
  --track-tight: -0.035em; --track-title: -0.03em; --track-head: -0.015em;

  /* spacing — 4/8 grid */
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:20px; --s-6:24px;
  --s-8:32px; --s-10:40px; --s-12:48px; --s-16:64px;

  /* radii — very round, nested radius = outer − padding */
  --r-xs:6px; --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:20px; --r-2xl:28px; --r-pill:999px;

  /* controls */
  --tap: 44px; --control-h: 44px; --control-h-lg: 56px;
  --focus-ring: 2px solid var(--accent); --focus-offset: 3px;

  /* motion — one curve family across all apps */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);          /* enter, press, everything UI */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* moving on screen: collapse, reorder */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);   /* sheets */
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);    /* success check ONLY */
  --dur-micro: 120ms; --dur-press: 140ms; --dur-fast: 180ms; --dur-base: 240ms; --dur-sheet: 280ms; --dur-exit: 160ms;

  /* ---- legacy aliases (old token names keep working) ---- */
  --bg-canvas: var(--bg); --surface-sunken: var(--bg-sunken); --surface-raised: var(--surface); --surface-elevated: var(--surface-2);
  --ink-1: var(--label); --ink-2: var(--label-2); --ink-3: var(--label-3); --ink-4: var(--line);
  --brand: var(--accent); --brand-deep: var(--accent-lo); --brand-10: var(--accent-soft); --brand-30: var(--accent-soft);
  --glass-fill: var(--surface-2); --glass-border: var(--line); --glass-highlight: transparent;
  --error: var(--danger); --error-soft: var(--danger-soft); --steel: var(--info);
  --shadow-sm: var(--shadow-1); --shadow-md: var(--shadow-2); --shadow-lg: var(--shadow-3); --shadow-xl: var(--shadow-3);
  --shadow-inner-top: none; --dur-slow: 400ms;
  --t-h1: var(--t-large); --t-h2: var(--t-title); --t-h4: var(--t-headline); --t-body-sm: var(--t-sub); --t-meta: var(--t-foot); --t-micro: var(--t-caption);
  --track-mono: 0.08em;
}

/* ---- base: the details Alan kept correcting, fixed once for every tool ---- */
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }            /* never sideways scroll */
body { background: var(--bg); color: var(--label); font-family: var(--font-sans); font-size: var(--t-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
* { -webkit-tap-highlight-color: transparent; }                        /* no grey/blue flash on tap */
a, button, input, select, textarea, label, [role="button"] { touch-action: manipulation; } /* no double-tap zoom delay */
:focus:not(:focus-visible) { outline: none; }                          /* no box around links/buttons after a click */
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); } /* keyboard still sees focus */
input:focus, textarea:focus, select:focus { outline: none; }           /* fields show focus with their own border, never a nested ring */
textarea { resize: none; }                                             /* no browser resize handle */
::selection { background: var(--accent-soft); color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a.link, .link { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
h1, h2, h3, .t-hero, .t-large, .t-title, .t-headline { text-wrap: balance; }  /* no orphan words in titles */
p, li { text-wrap: pretty; }
img, video { border-radius: inherit; }
.toast:not(.show) { pointer-events: none; }                            /* an invisible toast never blocks clicks */

/* semantic type */
.t-hero     { font-size: var(--t-hero); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.t-large    { font-size: var(--t-large); font-weight: 650; letter-spacing: var(--track-tight); line-height: 1.2; }
.t-title    { font-size: var(--t-title); font-weight: 600; letter-spacing: var(--track-title); line-height: 1.27; }
.t-headline { font-size: var(--t-headline); font-weight: 600; letter-spacing: var(--track-head); line-height: 1.3; }
.t-body     { font-size: var(--t-body); line-height: 1.5; color: var(--label); }
.t-sub      { font-size: var(--t-sub); line-height: 1.43; color: var(--label-2); }
.t-foot     { font-size: var(--t-foot); line-height: 1.38; color: var(--label-2); }
.t-caption  { font-size: var(--t-caption); line-height: 1.33; color: var(--label-3); }
.t-eyebrow  { font-size: var(--t-foot); font-weight: 500; color: var(--label-3); letter-spacing: .02em; } /* "01 / Card" */
.t-num      { font-variant-numeric: tabular-nums; }

/* Reduce Motion: no movement. Opacity/colour may still fade so changes stay readable. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}