/* Design tokens — the only place raw design values live. See AGENT.md.
   Breakpoints (cannot be variables in media queries): 600px, 900px. */
:root {
  color-scheme: light;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Color */
  --color-primary: #1e4fd8;
  --color-primary-hover: #1a43b8;
  --color-primary-subtle: #eaf0fd;
  --color-on-primary: #ffffff;
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-surface-muted: #f0f2f5;
  --color-border: #e3e6eb;
  --color-border-strong: #c9ced6;
  --color-text: #14181f;
  --color-text-muted: #5b6472;
  --color-text-disabled: #9aa2af;
  --color-success: #16794c;
  --color-success-subtle: #e6f4ec;
  --color-warning: #a15c07;
  --color-warning-subtle: #fdf1df;
  --color-error: #b3261e;
  --color-error-subtle: #fbe9e7;
  --color-info: #1e4fd8;
  --color-info-subtle: #eaf0fd;
  --color-overlay: rgba(16, 24, 40, 0.45);

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Typography */
  --text-display: 32px;
  --text-h1: 24px;
  --text-h2: 20px;
  --text-h3: 16px;
  --text-body: 16px;
  --text-label: 14px;
  --text-helper: 13px;
  --text-caption: 12px;
  --text-button: 15px;
  --text-nav: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);

  /* Sizing */
  --control-height: 44px;
  --control-height-sm: 36px;
  --icon-stroke: 2;
  --tabbar-height: 60px;
  --sidenav-width: 220px;
  --content-max-width: 720px;
  --sheet-max-width: 560px;

  /* Layers */
  --z-header: 10;
  --z-tabbar: 20;
  --z-modal: 40;
  --z-toast: 50;

  --transition: 150ms ease;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-primary: #6c8ef5;
  --color-primary-hover: #8aa5f8;
  --color-primary-subtle: #1b2540;
  --color-on-primary: #0f1217;
  --color-bg: #0f1217;
  --color-surface: #171b22;
  --color-surface-muted: #1f242d;
  --color-border: #2a303b;
  --color-border-strong: #3a4250;
  --color-text: #e8ebf0;
  --color-text-muted: #98a1b0;
  --color-text-disabled: #5f6877;
  --color-success: #4cc38a;
  --color-success-subtle: #14291f;
  --color-warning: #e0a04a;
  --color-warning-subtle: #2e2312;
  --color-error: #f2877f;
  --color-error-subtle: #331816;
  --color-info: #6c8ef5;
  --color-info-subtle: #1b2540;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --color-primary: #6c8ef5;
    --color-primary-hover: #8aa5f8;
    --color-primary-subtle: #1b2540;
    --color-on-primary: #0f1217;
    --color-bg: #0f1217;
    --color-surface: #171b22;
    --color-surface-muted: #1f242d;
    --color-border: #2a303b;
    --color-border-strong: #3a4250;
    --color-text: #e8ebf0;
    --color-text-muted: #98a1b0;
    --color-text-disabled: #5f6877;
    --color-success: #4cc38a;
    --color-success-subtle: #14291f;
    --color-warning: #e0a04a;
    --color-warning-subtle: #2e2312;
    --color-error: #f2877f;
    --color-error-subtle: #331816;
    --color-info: #6c8ef5;
    --color-info-subtle: #1b2540;
    --color-overlay: rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}
