/* design/backchannel/tokens.css
 *
 * Machine-readable form of DESIGN.md in the OpenDesign token contract
 * (--bg / --surface / --fg / --muted / --border / --accent / --success / --warn / --danger, …).
 * Agents paste the `:root` block into the first <style> of every prototype and reference
 * tokens via var(--name) from then on.
 *
 * The app itself reads the same values from frontend/src/app/globals.css, where colors are
 * stored as bare OKLCH components for Tailwind alpha modifiers. Keep the two files in sync;
 * globals.css is the source of truth for the app, this file is the source of truth for
 * prototypes. Names beyond the OpenDesign contract are Backchannel extensions and are
 * documented in DESIGN.md.
 * Live capture pulses keep opacity >= .95; a .55 minimum fails sidebar contrast.
 * The full-width summary editor uses the shared 2px focus ink at a -4px inset, with 2px edge clearance.
 * Its editing indicator applies on :focus for every input modality. Recording transport gaps/padding
 * are 6px and its Pause/Stop tooltip standoffs 8px, keeping the global outline clear of other paint.
 */
:root {
  /* ─── Surface ─────────────────────────────────────────────────── */
  --bg: oklch(1 0 0);                       /* canvas: transcript and review are documents */
  --surface: oklch(1 0 0);                  /* cards, popovers, dialogs (app: --elevated) */
  --surface-warm: oklch(0.976 0.004 190);   /* rails, toolbars (app: --panel) */
  --surface-sunken: oklch(0.968 0.005 190); /* extension: input wells, code, inset readouts */

  /* ─── Foreground ramp ─────────────────────────────────────────── */
  --fg: oklch(0.215 0.013 190);
  --fg-2: var(--fg);
  --muted: oklch(0.46 0.014 190);
  --meta: oklch(0.54 0.012 190);

  /* ─── Border ──────────────────────────────────────────────────── */
  --border: oklch(0.912 0.006 190);
  --border-soft: var(--border);
  --border-strong: oklch(0.855 0.008 190); /* extension: input outlines */
  --border-code: oklch(0.63 0.01 190);     /* extension: the edge of code, 3:1 on --bg and --surface-sunken */

  /* #231: hue 190 retained with the approved paired-channel mark A. */
  /* ─── Accent = brand ──────────────────────────────────────────── */
  --accent: oklch(0.365 0.082 190);
  --accent-on: oklch(1 0 0);
  --accent-hover: oklch(0.315 0.078 190);
  --accent-active: var(--accent-hover);
  --accent-soft: oklch(0.955 0.022 190);   /* extension: selection / active-row tint */
  --accent-soft-on: oklch(0.33 0.075 190);

  /* ─── Signals ─────────────────────────────────────────────────── */
  --success: var(--accent);                 /* the brand is the success color */
  --warn: oklch(0.72 0.15 72);
  --warn-on: oklch(0.47 0.11 72);
  --warn-soft: oklch(0.966 0.03 72);
  --danger: oklch(0.545 0.205 25);
  --danger-on: oklch(0.47 0.19 25);
  --danger-soft: oklch(0.962 0.022 25);
  --info: oklch(0.52 0.115 262);            /* extension: local-model and device readouts */
  --info-soft: oklch(0.962 0.018 262);

  /* ─── Typography ──────────────────────────────────────────────── */
  /* --meta also draws standalone Copy's exposed edge. Its actions keep a 6px focus gutter.
     The meeting action bar is a docked 44px strip under the context field (#390), not floating. */
  --font-display: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;  /* titles; no serif register (ADR 0041) */
  --font-body: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;  /* set with font-variant-ligatures: none */
  --text-2xs: 0.6875rem;  /* 11 · mono readouts */
  --text-xs: 0.75rem;     /* 12 · captions */
  --text-sm: 0.8125rem;   /* 13 · dense labels, buttons */
  --text-base: 0.875rem;  /* 14 · UI body, overlay hint */
  --text-md: 0.9375rem;   /* 15 · transcript */
  --text-lg: 1.0625rem;   /* 17 · summary body */
  --text-xl: 1.25rem;     /* 20 · panel title */
  --text-2xl: 1.5625rem;  /* 25 · page title */
  --text-3xl: 1.9375rem;  /* 31 · meeting title */
  --text-4xl: var(--text-3xl);
  --leading-body: 1.5;
  --leading-tight: 1.2;
  --tracking-display: -0.01em;
  --measure: 68ch;

  /* ─── Shape ───────────────────────────────────────────────────── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 999px;

  /* ─── Elevation (border-first) ────────────────────────────────── */
  --elev-flat: none;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 1px 2px oklch(0.2 0.01 190 / 0.06), 0 4px 12px oklch(0.2 0.01 190 / 0.08);
  --elev-float: 0 2px 4px oklch(0.2 0.01 190 / 0.06), 0 12px 32px oklch(0.2 0.01 190 / 0.12);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px oklch(0.5 0.1 190);

  /* ─── Motion ──────────────────────────────────────────────────── */
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* ─── Scrollbar (#422) ────────────────────────────────────────── */
  /* One thumb for every scroll container; see DESIGN.md § Component rules. The gutter takes layout
     space and is never an overlay. */
  --scrollbar-gutter: 12px;
  --scrollbar-thumb-w: 4px;
  --scrollbar-thumb-w-active: 6px;
  --scrollbar-thumb-gap: 4px;
  --scrollbar-track-inset: 8px;
  --scrollbar-thumb-idle: color-mix(in oklch, var(--fg) 10%, transparent);
  --scrollbar-thumb-active: color-mix(in oklch, var(--fg) 24%, transparent);
  --scroll-edge-fade: 24px;

  /* ─── Spacing ─────────────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-20: 80px;

  /* ─── Layout ──────────────────────────────────────────────────── */
  --container-max: 1100px;                  /* desktop app: the two-pane breakpoint */
  --container-gutter-desktop: 24px;
  --container-gutter-tablet: 16px;
  --container-gutter-phone: 12px;
  --section-y-desktop: 32px;
  --section-y-tablet: 24px;
  --section-y-phone: 16px;
  --rail-w: 19rem;
  --rail-w-collapsed: 3.5rem;
  --overlay-w: 420px;                       /* extension: overlay default width (360–480) */
}

/* Dark theme: independent values, not a filter. The overlay uses this block by default. */
.dark,
[data-theme="dark"] {
  /* Re-declared so a .dark wrapper below :root re-resolves them against the dark --fg. */
  --scrollbar-thumb-idle: color-mix(in oklch, var(--fg) 10%, transparent);
  --scrollbar-thumb-active: color-mix(in oklch, var(--fg) 24%, transparent);
  --bg: oklch(0.155 0.004 190);
  --surface: oklch(0.225 0.006 190);
  --surface-warm: oklch(0.185 0.005 190);
  --surface-sunken: oklch(0.125 0.004 190);
  --fg: oklch(0.945 0.006 190);
  --muted: oklch(0.72 0.011 190);
  --meta: oklch(0.625 0.01 190);
  --border: oklch(0.285 0.007 190);
  --border-strong: oklch(0.37 0.009 190);
  --border-code: oklch(0.49 0.009 190);
  --accent: oklch(0.8 0.115 190);
  --accent-on: oklch(0.16 0.03 190);        /* bright aqua takes dark ink */
  --accent-hover: oklch(0.855 0.12 190);
  --accent-soft: oklch(0.255 0.032 190);
  --accent-soft-on: oklch(0.845 0.1 190);
  --warn: oklch(0.78 0.145 72);
  --warn-on: oklch(0.82 0.13 72);
  --warn-soft: oklch(0.245 0.045 72);
  --danger: oklch(0.55 0.21 25);
  --danger-on: oklch(0.72 0.16 25);
  --danger-soft: oklch(0.245 0.055 25);
  --info: oklch(0.66 0.13 262);
  --info-soft: oklch(0.245 0.045 262);
  --elev-raised: 0 1px 2px oklch(0 0 0 / 0.4), 0 4px 12px oklch(0 0 0 / 0.36);
  --elev-float: 0 2px 4px oklch(0 0 0 / 0.4), 0 12px 32px oklch(0 0 0 / 0.48);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px oklch(0.8 0.115 190);
}
