:root {
  color-scheme: light dark;

  --font-display: "Geist", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", ui-monospace, monospace;

  --text-base: 1rem;
  --text-11: 0.6875rem;
  --text-12: 0.75rem;
  --text-13: 0.8125rem;
  --text-14: 0.875rem;
  --text-15: 0.9375rem;
  --text-16: var(--text-base);
  --text-18: 1.125rem;
  --text-20: 1.25rem;
  --text-24: 1.5rem;
  --text-32: 2rem;
  --text-48: 3rem;
  --text-64: 4rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --radius-control: 0.25rem;
  --radius-card: 0.5rem;
  --radius-round: 999px;
  --line: 1px;
  --target: 2.75rem;
  --leading: 1.9;
  --flow: 1.25em;
  --measure: 90ch;
  --rail: 17rem;
  --content: 47.5rem;

  --duration-fast: 120ms;
  --duration-base: 180ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --leading-ui: 1.45;

  /* Shared component-role aliases extracted from the source system. */
  --card: var(--surface);
  --card-fg: var(--fg);
  --popover: var(--surface);
  --popover-fg: var(--fg);
  --input: var(--border-strong);
  --ring: var(--focus);
  --sidebar: var(--surface);
  --sidebar-fg: var(--fg);
  --destructive: var(--danger);
  --accent-soft: color-mix(in oklch, var(--accent) 14%, var(--surface));
}

:root,
[data-theme="light"] {
  --bg: oklch(0.972 0.0025 345.21);
  --surface: oklch(100% 0 0);
  --surface-raised: oklch(96.7% 0.007 250);
  --fg: oklch(24% 0.018 245);
  --muted: oklch(48% 0.018 245);
  --border: oklch(89% 0.012 245);
  --border-strong: oklch(73% 0.018 245);
  --accent: oklch(55% 0.145 145);
  --accent-strong: oklch(45% 0.13 145);
  --on-accent: oklch(99% 0.004 145);
  --link: oklch(48% 0.13 230);
  --success: oklch(48% 0.13 145);
  --warning: oklch(63% 0.14 80);
  --danger: oklch(55% 0.18 28);
  --focus: oklch(52% 0.15 240);
  --shadow-dialog: 0 20px 70px oklch(20% 0.02 250 / 0.18);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(15.5% 0.028 145);
  --surface: oklch(18.8% 0.032 145);
  --surface-raised: oklch(22.5% 0.038 145);
  --fg: oklch(92% 0.025 145);
  --muted: oklch(69% 0.035 145);
  --border: oklch(28% 0.038 145);
  --border-strong: oklch(43% 0.042 145);
  --accent: oklch(82% 0.18 125);
  --accent-strong: oklch(75% 0.17 125);
  --on-accent: oklch(24% 0.07 125);
  --link: oklch(76% 0.09 70);
  --success: oklch(74% 0.13 145);
  --warning: oklch(78% 0.14 80);
  --danger: oklch(70% 0.17 28);
  --focus: oklch(86% 0.15 125);
  --shadow-dialog: 0 24px 80px oklch(2% 0.02 145 / 0.65);
}

[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: oklch(15.5% 0.028 145);
    --surface: oklch(18.8% 0.032 145);
    --surface-raised: oklch(22.5% 0.038 145);
    --fg: oklch(92% 0.025 145);
    --muted: oklch(69% 0.035 145);
    --border: oklch(28% 0.038 145);
    --border-strong: oklch(43% 0.042 145);
    --accent: oklch(82% 0.18 125);
    --accent-strong: oklch(75% 0.17 125);
    --on-accent: oklch(24% 0.07 125);
    --link: oklch(76% 0.09 70);
    --success: oklch(74% 0.13 145);
    --warning: oklch(78% 0.14 80);
    --danger: oklch(70% 0.17 28);
    --focus: oklch(86% 0.15 125);
    --shadow-dialog: 0 24px 80px oklch(2% 0.02 145 / 0.65);
  }
}
