/* cx-ui design tokens: colours, fonts, shadows. Light by default; dark follows the system unless the page sets
   data-theme="light" | "dark" on <html> (cx-ui/theme.js does). Override any variable in your own CSS after this file
   (e.g. --accent, --brand-*), for both themes. */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --sidebar: #edf1f6;
  --hover: #e4eaf1;
  --active: #d8e1eb;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ec;
  --accent: #0e7490;
  --accent-text: #ffffff;
  --brand-from: #10b981;
  --brand-mid: #0e7490;
  --brand-to: #1e3a8a;
  --brand-gradient: linear-gradient(135deg, var(--brand-from), var(--brand-mid) 55%, var(--brand-to));
  --user-bubble: #e6eef6;
  --code-bg: #f1f5f9;
  --inline-code: #e2e8f0;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);

  --hl-keyword: #a23c1e; --hl-string: #2f6f3e; --hl-number: #a15c00; --hl-comment: #8a877e;
  --hl-title: #3b5ba9; --hl-type: #7a3e9d; --hl-attr: #8a5a00; --hl-meta: #5b6470;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  color-scheme: light;
}

/* Dark: the same values twice, once for "follow the system", once for the explicit override. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a; --surface: #161d26; --sidebar: #0b1015; --hover: #1b2430; --active: #233041;
    --text: #e6edf5; --muted: #94a3b8; --border: #253242; --accent: #2dd4bf; --accent-text: #04201c;
    --brand-from: #34d399; --brand-mid: #0e9fb8; --brand-to: #2547b8;
    --user-bubble: #1c2836; --code-bg: #0b1015; --inline-code: #1f2a37; --danger: #fda4af;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --hl-keyword: #e08a6a; --hl-string: #9ccc8a; --hl-number: #e3b26b; --hl-comment: #8c8a83;
    --hl-title: #8fb0f0; --hl-type: #c9a0e6; --hl-attr: #e0bf7a; --hl-meta: #a7b0bc;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f141a; --surface: #161d26; --sidebar: #0b1015; --hover: #1b2430; --active: #233041;
    --text: #e6edf5; --muted: #94a3b8; --border: #253242; --accent: #2dd4bf; --accent-text: #04201c;
    --brand-from: #34d399; --brand-mid: #0e9fb8; --brand-to: #2547b8;
    --user-bubble: #1c2836; --code-bg: #0b1015; --inline-code: #1f2a37; --danger: #fda4af;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --hl-keyword: #e08a6a; --hl-string: #9ccc8a; --hl-number: #e3b26b; --hl-comment: #8c8a83;
  --hl-title: #8fb0f0; --hl-type: #c9a0e6; --hl-attr: #e0bf7a; --hl-meta: #a7b0bc;
  color-scheme: dark;
}
