:root {
  color-scheme: dark;

  /* Colors */
  --bg: #0d1117;
  --bg-rgb: 13, 17, 23;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --border-strong: #484f58;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --on-accent: #0b1220;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;

  /* Focus, scrim, elevation */
  --focus-ring: rgba(88, 166, 255, 0.32);
  --scrim: rgba(1, 4, 9, 0.55);
  --scrim-solid: rgba(1, 4, 9, 0.75);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);

  /* Chart colors */
  --tc-input: #60a5fa;
  --tc-cache-read: #4ade80;
  --tc-cache-write: #fb923c;
  --tc-output: #a78bfa;
  --chart-grid: rgba(255, 255, 255, 0.06);
  --chart-bar-border: rgba(255, 255, 255, 0.18);
  --chart-font-size: 11px;
  --model-color-fallback: #94a3b8;

  /* Always-dark tooltip material */
  --tooltip-bg: rgba(18, 18, 20, 0.88);
  --tooltip-bg-solid: #121214;
  --tooltip-text: #f0f0f0;
  --tooltip-border: rgba(255, 255, 255, 0.18);
  --tooltip-divider: rgba(255, 255, 255, 0.16);

  /* Semantic tints */
  --unpriced-bg: color-mix(in srgb, var(--orange) 15%, transparent);
  --unpriced-border: color-mix(in srgb, var(--orange) 30%, transparent);

  /* Spacing (4px base, scales with the user's text size) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;
  --space-9: 3.5rem;
  --space-10: 4rem;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --text-xs:   0.6875rem;
  --text-sm:   0.75rem;
  --text-base: 0.8125rem;
  --text-md:   0.875rem;
  --text-lg:   1rem;
  --text-xl:   1.3125rem;
  --text-icon: 1.125rem;

  /* Tracking */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0em;
  --tracking-wide:    0.06em;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;

  /* Motion */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 260ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:  cubic-bezier(0.64, 0, 0.78, 0);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --bg-rgb: 255, 255, 255;
    --surface: #f6f8fa;
    --surface2: #eaeef2;
    --border: #d0d7de;
    --border-strong: #afb8c1;
    --text: #1f2328;
    --muted: #656d76;
    --accent: #0969da;
    --accent-hover: #0860ca;
    --on-accent: #ffffff;
    --green: #1a7f37;
    --orange: #9a6700;
    --red: #cf222e;
    --focus-ring: rgba(9, 105, 218, 0.28);
    --scrim: rgba(15, 23, 42, 0.35);
    --scrim-solid: rgba(15, 23, 42, 0.5);
    --shadow-sm: 0 1px 2px rgba(31, 35, 40, 0.12);
    --shadow-md: 0 6px 20px rgba(31, 35, 40, 0.16);
    --shadow-lg: 0 24px 64px rgba(31, 35, 40, 0.22);
    --tc-input: #3b82f6;
    --tc-cache-read: #16a34a;
    --tc-cache-write: #ea580c;
    --tc-output: #7c3aed;
    --chart-grid: rgba(0, 0, 0, 0.06);
    --chart-bar-border: rgba(0, 0, 0, 0.18);
    --model-color-fallback: #64748b;
  }
}
