/*
  Design tokens for every page: colors, surfaces, radii, spacing and type sizes.
  Light is the default theme; shared-ui.js puts body.dark on the page for the dark theme.
  Loaded right before shared-ui.css. Page stylesheets may add page-only tokens of their own.
*/

:root {
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --special: #d6b45f;
  --special-soft: rgba(214, 180, 95, 0.14);
  --special-border: rgba(214, 180, 95, 0.38);
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 28px;
  --control-height: 40px;
  --nav-height: 58px;
  --bottom-nav-height: 58px;
  --calendar-day-size: 38px;
}

:root,
body.light {
  color-scheme: light;
  --glass-panel: var(--surface);
  --glass-panel-strong: var(--surface);
  --glass-panel-soft: var(--surface-2);
  --glass-highlight: rgba(255, 255, 255, 0);
  --accent-contrast: #ffffff;
  --success: #287a4f;
  --success-soft: rgba(40, 122, 79, 0.11);
  --danger: #be3f36;
  --danger-soft: rgba(200, 72, 63, 0.1);
  --warning: #926013;
  --warning-soft: rgba(185, 121, 24, 0.13);
  --pin: #926013;
  --pin-soft: rgba(185, 121, 24, 0.12);
  --work: #4d6a3f;
  --study: #7b658f;
  --exercise: #287a4f;
  --rest: #9a5f74;
  --travel: #996f32;
  --other: #74716a;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-float: 0 10px 34px rgba(29, 29, 27, 0.14), 0 2px 8px rgba(29, 29, 27, 0.08);
  --focus-ring: 0 0 0 3px rgba(36, 36, 33, 0.12);
  --font-body: "Noto Sans Thai", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #faf9f5;
  --surface: #fffefa;
  --surface-2: #f1efe8;
  --surface-3: #e5e1d7;
  --surface-raised: #fffefa;
  --glass-control: #fffefa;
  --glass-control-hover: #f1efe8;
  --border: rgba(24, 23, 20, 0.17);
  --border-hover: rgba(24, 23, 20, 0.28);
  --glass-border: var(--border);
  --text: #11110f;
  --muted: #4f4b43;
  --faint: #6f6a60;
  --accent: #1f1e1b;
  --accent-strong: #0f0f0d;
  --accent-soft: rgba(31, 30, 27, 0.08);
  --accent-border: rgba(31, 30, 27, 0.28);
  --text-xs: 0.86rem;
  --text-sm: 0.96rem;
  --text-md: 1rem;
  --text-lg: 1.18rem;
  --text-xl: 1.42rem;
  --text-2xl: 1.74rem;
  --calendar-day-font: 0.96rem;
  --shadow-card: 0 1px 2px rgba(24, 23, 20, 0.06), 0 12px 30px rgba(24, 23, 20, 0.07);
}

/* Touch targets on phones are at least 44px. */
@media (max-width: 640px) {
  :root {
    --control-height: 44px;
    --calendar-day-size: 44px;
  }
}

body.dark {
  color-scheme: dark;
  --glass-panel: var(--surface);
  --glass-panel-strong: var(--surface-raised);
  --glass-panel-soft: var(--surface-2);
  --glass-highlight: rgba(255, 255, 255, 0);
  --accent-contrast: #11110f;
  --success: #62b783;
  --success-soft: rgba(98, 183, 131, 0.14);
  --danger: #e26b61;
  --danger-soft: rgba(226, 107, 97, 0.13);
  --warning: #d69a3a;
  --warning-soft: rgba(214, 154, 58, 0.14);
  --pin: #d69a3a;
  --pin-soft: rgba(214, 154, 58, 0.13);
  --work: #8ca87e;
  --study: #aa91bf;
  --exercise: #62b783;
  --rest: #c78aa0;
  --travel: #d0a15f;
  --other: #a8a196;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.18), 0 12px 32px rgba(0, 0, 0, 0.2);
  --shadow-float: 0 16px 44px rgba(0, 0, 0, 0.38), 0 4px 12px rgba(0, 0, 0, 0.24);
  --focus-ring: 0 0 0 3px rgba(244, 241, 233, 0.16);
  --bg: #11100e;
  --surface: #1f1d19;
  --surface-2: #2a2823;
  --surface-3: #353128;
  --surface-raised: #23211d;
  --glass-control: #2a2823;
  --glass-control-hover: #353128;
  --border: rgba(252, 248, 238, 0.18);
  --border-hover: rgba(252, 248, 238, 0.3);
  --glass-border: var(--border);
  --text: #fffaf0;
  --muted: #d6cfc1;
  --faint: #b2aa9b;
  --accent: #fffaf0;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 250, 240, 0.11);
  --accent-border: rgba(255, 250, 240, 0.32);
}
