/* Design tokens — WCAG AA verified light-first visual system, dark derived.
   Brand cyan/blue/navy accents from assets/zenith-logo.svg. */

:root {
  color-scheme: light;
  --font-ui: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Noto Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ui-size: 12px;
  --code-size: 12.5px;

  --t-11: 11px;
  --t-12: 12px;
  --t-13: 13px;
  --t-15: 15px;
  --t-20: 20px;
  --t-32: 32px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --radius-sm: 5px;
  --radius: 7px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --bar-h: 38px;
  --status-h: 24px;
  --tool: 28px;
  --tool-small: 26px;
  --panel-left: 214px;
  --panel-right: 228px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 140ms;

  /* Light (primary) — all pairs >= 4.5:1 WCAG AA */
  --bg: #f3f6fa;
  --surface: #ffffff;
  --raised: #ffffff;
  --surface-2: #f2f5f9;
  --surface-hover: #eef2f7;
  --surface-active: #e3e9f1;
  --border: #e2e8f0;
  --border-subtle: #e9eef4;
  --border-strong: #c5d0de;
  --text: #0b1a2e;
  --text-muted: #46556a;
  --text-faint: #5d6a7c;
  --accent: #0870a6;
  --accent-hover: #065d8c;
  --accent-soft: rgb(8 112 166 / 0.09);
  --accent-line: rgb(8 112 166 / 0.45);
  --accent-text: #ffffff;
  --focus: #0870a6;
  --danger: #c22f2f;
  --danger-soft: rgb(194 47 47 / 0.08);
  --warning: #965b00;
  --warning-soft: rgb(150 91 0 / 0.14);
  --info: #0870a6;
  --info-soft: rgb(8 112 166 / 0.09);
  --ok: #0f7a48;
  --ok-soft: rgb(15 122 72 / 0.1);
  --tpl-ink: #6b42c6;
  --tpl-soft: rgb(107 66 198 / 0.1);

  --shadow-1: 0 1px 2px rgb(11 26 46 / 0.08);
  --shadow-pop: 0 12px 32px rgb(11 26 46 / 0.14), 0 2px 6px rgb(11 26 46 / 0.08), 0 0 0 1px rgb(11 26 46 / 0.06);

  --canvas-bg: #e9edf2;
  --canvas-dot: #d7dde6;
  --page-shadow: 0 0 0 1px rgb(11 26 46 / 0.06), 0 14px 40px rgb(11 26 46 / 0.14);
  --page-edge: transparent;
  --sel: #0870a6;
  --sel-handle: #ffffff;
  --hover: #0870a6;
  --guide: #d6249f;
  --marquee-fill: rgb(8 112 166 / 0.12);
  --grip-off: #5d6a7c;
  --grip-blocked: #c22f2f;
  --hint-bg: #0b1a2e;
  --hint-text: #f3f6fa;

  --code-bg: #ffffff;
  --code-active-line: #f3f6fa;
  --code-selection: #cde2f5;
  --code-match: #f6edc6;
  --code-bracket: #e2e8f0;
  --code-node: #e1eff8;
  --syn-comment: #5d6a7c;
  --syn-node: #7a2fb8;
  --syn-prop: #1f5fa8;
  --syn-string: #237035;
  --syn-token: #965b00;
  --syn-unit: #855200;
  --syn-number: #b0381f;
  --syn-atom: #a12a6b;
  --syn-punct: #46556a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0e15;
    --surface: #10151e;
    --raised: #161c27;
    --surface-2: #0c1119;
    --surface-hover: #1a2130;
    --surface-active: #212a3a;
    --border: #1c2330;
    --border-subtle: #171d28;
    --border-strong: #354156;
    --text: #e8edf4;
    --text-muted: #a2adbf;
    --text-faint: #8a97ac;
    --accent: #2cbfe3;
    --accent-hover: #48ccf0;
    --accent-soft: rgb(44 191 227 / 0.12);
    --accent-line: rgb(44 191 227 / 0.45);
    --accent-text: #03182c;
    --focus: #2cbfe3;
    --danger: #ff6b6b;
    --danger-soft: rgb(255 107 107 / 0.12);
    --warning: #f0b955;
    --warning-soft: rgb(240 185 85 / 0.14);
    --info: #2cbfe3;
    --info-soft: rgb(44 191 227 / 0.12);
    --ok: #4ccf8f;
    --ok-soft: rgb(76 207 143 / 0.12);
    --tpl-ink: #b79cff;
    --tpl-soft: rgb(183 156 255 / 0.14);
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(255 255 255 / 0.05);
    --canvas-bg: #080b11;
    --canvas-dot: #151b26;
    --page-shadow: 0 0 0 1px rgb(255 255 255 / 0.05), 0 18px 50px rgb(0 0 0 / 0.55);
    --page-edge: #1c2330;
    --sel: #2cbfe3;
    --sel-handle: #0a0e15;
    --hover: #2cbfe3;
    --guide: #ff5cc8;
    --marquee-fill: rgb(44 191 227 / 0.14);
    --grip-off: #8a97ac;
    --grip-blocked: #ff6b6b;
    --hint-bg: #e8edf4;
    --hint-text: #0a0e15;
    --code-bg: #10151e;
    --code-active-line: #161c27;
    --code-selection: #203b52;
    --code-match: #3f3820;
    --code-bracket: #212a3a;
    --code-node: #162e42;
    --syn-comment: #8a97ac;
    --syn-node: #c792ea;
    --syn-prop: #82aaff;
    --syn-string: #c3e88d;
    --syn-token: #ffcb6b;
    --syn-unit: #e0c070;
    --syn-number: #f78c6c;
    --syn-atom: #ef8fc4;
    --syn-punct: #a2adbf;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e15;
  --surface: #10151e;
  --raised: #161c27;
  --surface-2: #0c1119;
  --surface-hover: #1a2130;
  --surface-active: #212a3a;
  --border: #1c2330;
  --border-subtle: #171d28;
  --border-strong: #354156;
  --text: #e8edf4;
  --text-muted: #a2adbf;
  --text-faint: #8a97ac;
  --accent: #2cbfe3;
  --accent-hover: #48ccf0;
  --accent-soft: rgb(44 191 227 / 0.12);
  --accent-line: rgb(44 191 227 / 0.45);
  --accent-text: #03182c;
  --focus: #2cbfe3;
  --danger: #ff6b6b;
  --danger-soft: rgb(255 107 107 / 0.12);
  --warning: #f0b955;
  --warning-soft: rgb(240 185 85 / 0.14);
  --info: #2cbfe3;
  --info-soft: rgb(44 191 227 / 0.12);
  --ok: #4ccf8f;
  --ok-soft: rgb(76 207 143 / 0.12);
  --tpl-ink: #b79cff;
  --tpl-soft: rgb(183 156 255 / 0.14);

  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(255 255 255 / 0.05);

  --canvas-bg: #080b11;
  --canvas-dot: #151b26;
  --page-shadow: 0 0 0 1px rgb(255 255 255 / 0.05), 0 18px 50px rgb(0 0 0 / 0.55);
  --page-edge: #1c2330;
  --sel: #2cbfe3;
  --sel-handle: #0a0e15;
  --hover: #2cbfe3;
  --guide: #ff5cc8;
  --marquee-fill: rgb(44 191 227 / 0.14);
  --grip-off: #8a97ac;
  --grip-blocked: #ff6b6b;
  --hint-bg: #e8edf4;
  --hint-text: #0a0e15;

  --code-bg: #10151e;
  --code-active-line: #161c27;
  --code-selection: #203b52;
  --code-match: #3f3820;
  --code-bracket: #212a3a;
  --code-node: #162e42;
  --syn-comment: #8a97ac;
  --syn-node: #c792ea;
  --syn-prop: #82aaff;
  --syn-string: #c3e88d;
  --syn-token: #ffcb6b;
  --syn-unit: #e0c070;
  --syn-number: #f78c6c;
  --syn-atom: #ef8fc4;
  --syn-punct: #a2adbf;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur: 0ms;
  }
}

@media (max-width: 1240px) {
  :root {
    --panel-left: 196px;
    --panel-right: 214px;
  }
}

@media (max-width: 720px) {
  :root {
    --bar-h: 52px;
    --ui-size: 13px;
    --code-size: 12.5px;
    --tool: 40px;
    --tool-small: 36px;
  }
}
