:root {
  --bg: #0d0d10;
  --surface: #131317;
  --surface2: #1a1a20;
  --surface3: #222229;
  --surface4: #2a2a33;
  --border: #2a2a35;
  --border2: #38383f;
  --text: #e2e2e8;
  --text2: #a0a0b0;
  --muted: #60607a;
  --accent: #c850f9;
  --accent-dim: rgba(200,80,249,.15);
  --accent-hover: #d966ff;
  --blue: #4da6ff;
  --blue-dim: rgba(77,166,255,.12);
  --green: #3dde8a;
  --green-dim: rgba(61,222,138,.12);
  --red: #f55;
  --red-dim: rgba(255,85,85,.12);
  --yellow: #ffc844;
  --yellow-dim: rgba(255,200,68,.1);
  --orange: #ff8c42;
  --tool-bg: #111118;
  --thinking-color: #a0a0ff;
  --radius: 6px;
  --radius-lg: 10px;
  --font-mono: 'Cascadia Code','JetBrains Mono','Fira Code','Consolas',monospace;
  --font-sans: -apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  --sidebar-w: 280px;

  /* ── Design Token Scales ── */
  --fs-xs: .65rem;
  --fs-sm: .7rem;
  --fs-base: .75rem;
  --fs-md: .8rem;
  --fs-lg: .85rem;
  --fs-xl: .92rem;
  --fs-2xl: 1rem;
  --fs-3xl: 1.15rem;
  --fs-4xl: 1.35rem;
  --fs-5xl: 1.6rem;

  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 14px;
  --space-8: 16px;
  --space-9: 20px;
  --space-10: 24px;
  --space-11: 32px;
  --space-12: 48px;

  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 100px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.25),0 2px 4px rgba(0,0,0,.15);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.2);
  --shadow-xl: 0 12px 48px rgba(0,0,0,.55),0 2px 8px rgba(0,0,0,.3);

  --z-dropdown: 100;
  --z-modal: 200;
  --z-overlay: 300;
  --z-toast: 400;
  --z-tooltip: 500;

  --dur-fast: .1s;
  --dur-normal: .15s;
  --dur-slow: .25s;
  --dur-slug: .35s;
}

/* ── Light Theme ── */
@media (prefers-color-scheme: light) {
  :root:not(.force-dark) {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --surface2: #f0f0f3;
    --surface3: #e5e5ea;
    --surface4: #d2d2d8;
    --border: #d5d5dc;
    --border2: #c0c0c8;
    --text: #1a1a20;
    --text2: #555568;
    --muted: #8888a0;
    --tool-bg: #f8f8fc;
    --thinking-color: #6c6cff;
    --accent: #a340d0;
    --accent-dim: rgba(163,64,208,.1);
    --accent-hover: #b855e0;
    --blue: #2288e0;
    --blue-dim: rgba(34,136,224,.1);
    --green: #20a858;
    --green-dim: rgba(32,168,88,.1);
    --red: #e04040;
    --red-dim: rgba(224,64,64,.1);
    --yellow: #d4a020;
    --yellow-dim: rgba(212,160,32,.1);
  }
}

html.light {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface2: #f0f0f3;
  --surface3: #e5e5ea;
  --surface4: #d2d2d8;
  --border: #d5d5dc;
  --border2: #c0c0c8;
  --text: #1a1a20;
  --text2: #555568;
  --muted: #8888a0;
  --tool-bg: #f8f8fc;
  --thinking-color: #6c6cff;
  --accent: #a340d0;
  --accent-dim: rgba(163,64,208,.1);
  --accent-hover: #b855e0;
  --blue: #2288e0;
  --blue-dim: rgba(34,136,224,.1);
  --green: #20a858;
  --green-dim: rgba(32,168,88,.1);
  --red: #e04040;
  --red-dim: rgba(224,64,64,.1);
  --yellow: #d4a020;
  --yellow-dim: rgba(212,160,32,.1);
}
