/* Andromeda design tokens (2026-11). Light is the default; dark overrides
   under [data-theme="dark"] (set from localStorage before first paint by the
   layout head script). Every colour the UI uses comes from here — views and
   main.css never hardcode a hex. The legacy names at the bottom (--surface2,
   --radius, --alert-*-text) stay as aliases so older inline styles keep
   resolving. NOTHING here reaches ad HTML: ads render from their own documents
   (iframe + Puppeteer) and never link this file. */
:root {
  /* surfaces */
  --bg:         #f6f6f8;
  --surface:    #ffffff;
  --surface-2:  #f3f3f6;
  --surface-3:  #e9e9ee;
  /* text */
  --text:         #18181b;
  --text-2:       #3f3f46;
  --text-muted:   #71717a;
  --text-inverse: #ffffff;
  /* borders */
  --border:        #e4e4e8;
  --border-strong: #cfcfd6;
  --focus-ring:    rgba(91, 91, 214, 0.35);
  /* one accent */
  --accent:      #5b5bd6;
  --accent-h:    #4a4ac4;
  --accent-soft: #ebecfb;
  --accent-text: #4040b4;
  /* status */
  --success:      #178a52;
  --success-soft: #e4f5ec;
  --warning:      #b06f12;
  --warning-soft: #fcf1dd;
  --danger:       #cf3038;
  --danger-soft:  #fce9ea;
  /* radii */
  --r-sm: 4px;
  --r:    6px;
  --r-lg: 10px;
  /* spacing */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px;
  /* type (html is 14px) */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, Consolas, monospace;
  --fs-xs: 0.8rem;   /* 11.2px */
  --fs-sm: 0.86rem;  /* 12px */
  --fs:    1rem;     /* 14px */
  --fs-md: 1.07rem;  /* 15px */
  --fs-lg: 1.3rem;   /* 18px */
  --fs-xl: 1.75rem;  /* 24.5px */
  --lh:    1.5;
  /* elevation */
  --shadow-sm: 0 1px 2px rgba(16, 17, 24, 0.06);
  --shadow-md: 0 12px 32px rgba(16, 17, 24, 0.18);
  /* Chart.js series (insights.js reads these at paint time) — checked for
     contrast against the light card surface */
  --chart-1: #2a78d6; --chart-2: #1baf7a; --chart-3: #eda100; --chart-4: #008300;
  --chart-5: #4a3aa7; --chart-6: #e34948; --chart-7: #e87ba4; --chart-8: #eb6834;

  /* legacy aliases (pre-2026-11 names used by inline styles) */
  --surface2: var(--surface-2);
  --radius:   var(--r);
  --alert-error-text:   var(--danger);
  --alert-warning-text: var(--warning);
  --alert-success-text: var(--success);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg:         #121317;
  --surface:    #1a1b20;
  --surface-2:  #23242a;
  --surface-3:  #2c2d34;
  --text:         #f4f4f5;
  --text-2:       #c9c9d0;
  --text-muted:   #8c8c96;
  --text-inverse: #ffffff;
  --border:        #2e2f36;
  --border-strong: #3f404a;
  --focus-ring:    rgba(117, 119, 224, 0.45);
  --accent:      #7577e0;
  --accent-h:    #8b8cf0;
  --accent-soft: #26284a;
  --accent-text: #b4b5f6;
  --success:      #3ccf8a;
  --success-soft: #153527;
  --warning:      #e6a93c;
  --warning-soft: #3a2b11;
  --danger:       #f06b6b;
  --danger-soft:  #3c1d1f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.55);
  /* checked against the dark card surface */
  --chart-1: #3987e5; --chart-2: #199e70; --chart-3: #c98500; --chart-4: #008300;
  --chart-5: #9085e9; --chart-6: #e66767; --chart-7: #d55181; --chart-8: #d95926;
  color-scheme: dark;
}
