/* Design tokens. Dark values are declared twice: once for the OS setting, once for the manual override. */
:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #1c1c1c;
  --text-muted: #5b5b57;
  --border: #d9d5c9;
  --accent: #1f3a5f;
  --accent-contrast: #ffffff;
  --accent-soft: #e3eaf4;
  --focus: #2f6fdd;
  --danger: #b3261e;
  --ok: #1e7a3c;
  --warn: #9a5b00;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --reader-font-size: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2.5rem;
  --header-h: 56px;
  --nav-h: 64px;
  --rail-w: 88px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14181f; --surface: #1b212b; --surface-2: #232b37;
    --text: #e8e6e1; --text-muted: #a7a8a3; --border: #2f3846;
    --accent: #8db4ff; --accent-contrast: #0e1522; --accent-soft: #22324d;
    --focus: #8db4ff; --danger: #ff8a80; --ok: #6fd28f; --warn: #ffb74d;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14181f; --surface: #1b212b; --surface-2: #232b37;
  --text: #e8e6e1; --text-muted: #a7a8a3; --border: #2f3846;
  --accent: #8db4ff; --accent-contrast: #0e1522; --accent-soft: #22324d;
  --focus: #8db4ff; --danger: #ff8a80; --ok: #6fd28f; --warn: #ffb74d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
}
