:root {
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --surface-3: #e5eaf1;
  --surface-elevated: #ffffff;
  --surface-subtle: #f8fafc;
  --text: #101828;
  --text-strong: #0f172a;
  --muted: #667085;
  --text-subtle: #475467;
  --line: #d9e1ec;
  --border: var(--line);

  --primary: #172033;
  --primary-hover: #27344f;
  --primary-2: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #ea580c;
  --accent-soft: #fff7ed;
  --success: #166534;
  --success-soft: #f0fdf4;
  --warning: #92400e;
  --warning-soft: #fffbeb;
  --danger: #991b1b;
  --danger-soft: #fef2f2;
  --info: #075985;
  --info-soft: #f0f9ff;
  --focus: #2563eb;

  --shadow-xs: 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-sm: 0 1px 3px rgb(15 23 42 / 0.08), 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-md: 0 12px 28px rgb(15 23 42 / 0.10);
  --shadow-lg: 0 24px 60px rgb(15 23 42 / 0.16);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --control-sm: 36px;
  --control-md: 44px;
  --control-lg: 50px;
  --max-content: 1240px;
  --sidebar-width: 260px;

  --motion-fast: 120ms;
  --motion-normal: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(.2,.8,.2,1);
}

/* Theme selector (core/theme.js): light/dark/system, applied as
   <html data-theme="light|dark"> -- "system" is resolved to one of these
   two before it ever reaches CSS, so no prefers-color-scheme query belongs
   here. Every token below overrides its :root definition above 1:1; nothing
   introduces a new token name, so every existing rule that already
   references var(--x) re-themes for free. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0f17;
  --surface: #131a27;
  --surface-2: #1a2333;
  --surface-3: #232e42;
  --surface-elevated: #1a2333;
  --surface-subtle: #0f1520;
  --text: #e7ebf3;
  --text-strong: #f8fafc;
  --muted: #93a0b4;
  --text-subtle: #aab6c8;
  --line: #2a3550;
  --border: var(--line);

  --primary: #4c6ef5;
  --primary-hover: #6d89ff;
  --primary-2: #60a5fa;
  --primary-soft: #16233f;
  --accent: #fb923c;
  --accent-soft: #3a2412;
  --success: #4ade80;
  --success-soft: #113321;
  --warning: #fbbf24;
  --warning-soft: #3a2c0c;
  --danger: #f87171;
  --danger-soft: #3a1414;
  --info: #38bdf8;
  --info-soft: #0d2a3a;
  --focus: #6d9bff;

  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.45), 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 12px 28px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 24px 60px rgb(0 0 0 / 0.6);
}
