:root {
  /* Neutrals - slightly cool, very subtle */
  --bg: #FAFAFA;
  --bg-rail: #F6F6F7;
  --surface: #FFFFFF;
  --surface-2: #F4F4F5;
  --surface-3: #EDEDF0;

  /* Borders */
  --border: #E7E7EA;
  --border-strong: #D6D6DB;
  --border-faint: #F0F0F2;

  /* Ink */
  --ink: #0B0B0F;
  --ink-2: #2A2A33;
  --muted: #6B6B76;
  --subtle: #9A9AA4;
  --faint: #C2C2C9;

  /* Accent - muted indigo, used sparingly */
  --accent: #4F46E5;
  --accent-soft: #EEF0FF;
  --accent-ink: #3730A3;

  /* Status - restrained */
  --ok: #14794A;
  --ok-bg: #E8F4ED;
  --warn: #9A5B00;
  --warn-bg: #FBF1DD;
  --err: #B23232;
  --err-bg: #FBEAEA;
  --info: #1F4D8C;
  --info-bg: #E8EEF8;

  /* Provider tints (very subtle) */
  --openai: #14794A;
  --openai-bg: #E8F4ED;
  --anthropic: #8A5A1A;
  --anthropic-bg: #FAF1E2;
  --google: #1F4D8C;
  --google-bg: #E8EEF8;
  --mistral: #6B3FA0;
  --mistral-bg: #F1EAF9;

  /* Type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Shadows - very flat */
  --shadow-1: 0 1px 0 rgba(11,11,15,.03);
  --shadow-2: 0 1px 2px rgba(11,11,15,.04), 0 0 0 1px rgba(11,11,15,.04);
  --shadow-pop: 0 12px 32px -8px rgba(11,11,15,.12), 0 2px 6px rgba(11,11,15,.06);

  /* Radii - restrained, not bubbly */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-pill: 999px;

  --code-bg: #0b0b0f;
  --code-fg: #e7e7ea;
  --selection-bg: rgba(79, 70, 229, 0.18);
}

[data-theme="dark"] {
  --bg: #0b0b0f;
  --bg-rail: #0e0e13;
  --surface: #14141a;
  --surface-2: #1b1b22;
  --surface-3: #22222b;

  --border: #25252d;
  --border-strong: #33333d;
  --border-faint: #1c1c23;

  --ink: #f2f2f4;
  --ink-2: #d5d5da;
  --muted: #8b8b95;
  --subtle: #6a6a74;
  --faint: #44444c;

  --accent: #818cf8;
  --accent-soft: #1b1b3b;
  --accent-ink: #c7ccff;

  --ok: #4ade80;
  --ok-bg: #0e2418;
  --warn: #f6c453;
  --warn-bg: #2a1f09;
  --err: #f47171;
  --err-bg: #2a1212;
  --info: #6ba8f5;
  --info-bg: #0f1b2e;

  --openai: #4ade80;
  --openai-bg: #0e2418;
  --anthropic: #d9a05b;
  --anthropic-bg: #2a1e0a;
  --google: #6ba8f5;
  --google-bg: #0f1b2e;
  --mistral: #a78bfa;
  --mistral-bg: #1c1432;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);

  --code-bg: var(--bg);
  --code-fg: var(--ink-2);
  --selection-bg: rgba(129, 140, 248, 0.22);

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "cv01", "cv03";
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; }
::selection { background: var(--selection-bg); }

/* Scrollbars (subtle) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }
*::-webkit-scrollbar-track { background: transparent; }

/* Common */
.mono { font-family: var(--font-mono); font-feature-settings: "calt" 0; }
.tabular { font-variant-numeric: tabular-nums; }

/* Focus */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: 4px;
}

/* Generic layout */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
