/* ------------------------------------------------------------------
   Design tokens — the single source of truth for color, type, spacing.
   Light palette lives on bare :root; dark redefines ONLY the tokens.
   ------------------------------------------------------------------ */
:root {
  color-scheme: light;

  /* Grounds & ink (cool, slightly blue-biased neutrals) */
  --paper: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --ink: #141a24;
  --ink-2: #3a4351;
  --muted: #5f6975;
  --line: #d8dce3;
  --line-strong: #b8bec8;

  /* One accent: signal blue. Green/red are reserved for P&L semantics. */
  --accent: #2f55d4;
  --accent-ink: #ffffff;
  --accent-soft: #e4eaff;
  --gain: #1f8a5b;
  --gain-soft: #dff3e8;
  --loss: #c2412f;
  --loss-soft: #fbe5e1;
  --note: #b7791f;
  --note-soft: #fbefd6;

  /* Chart series (accent first, then muted analogues) */
  --s1: #2f55d4;
  --s2: #8a5cf6;
  --s3: #0e8f9c;
  --s4: #d9822b;
  --grid: #e6e9ee;

  /* Type */
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-0: 0.8125rem;
  --fs-1: 0.9375rem;
  --fs-2: 1.0625rem;
  --fs-3: 1.25rem;
  --fs-4: 1.5625rem;
  --fs-5: 2rem;
  --fs-6: 2.75rem;
  --fs-7: 3.5rem;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(20, 26, 36, 0.06), 0 8px 24px -12px rgba(20, 26, 36, 0.18);
  --sidebar-w: 272px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f1419;
    --surface: #161c24;
    --surface-2: #1d242e;
    --ink: #e6eaf0;
    --ink-2: #c3cad4;
    --muted: #94a0ae;
    --line: #29323d;
    --line-strong: #3a4552;
    --accent: #86a2ff;
    --accent-ink: #0f1419;
    --accent-soft: #1e2a4d;
    --gain: #3fbf83;
    --gain-soft: #12301f;
    --loss: #f0705d;
    --loss-soft: #3a1a15;
    --note: #e0a53a;
    --note-soft: #33280f;
    --s1: #86a2ff;
    --s2: #b39bff;
    --s3: #4fc3cf;
    --s4: #f0a04b;
    --grid: #1f2731;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1419;
  --surface: #161c24;
  --surface-2: #1d242e;
  --ink: #e6eaf0;
  --ink-2: #c3cad4;
  --muted: #94a0ae;
  --line: #29323d;
  --line-strong: #3a4552;
  --accent: #86a2ff;
  --accent-ink: #0f1419;
  --accent-soft: #1e2a4d;
  --gain: #3fbf83;
  --gain-soft: #12301f;
  --loss: #f0705d;
  --loss-soft: #3a1a15;
  --note: #e0a53a;
  --note-soft: #33280f;
  --s1: #86a2ff;
  --s2: #b39bff;
  --s3: #4fc3cf;
  --s4: #f0a04b;
  --grid: #1f2731;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
