/* The shell's palette in both themes; a file of its own, so the chat's dev kit
   (web-src/chat/kit) wears the very tokens the shell does. */
:root {
  /* Every colour on the page is one of these, and the light block below sets every
     one again — a colour written anywhere else is the one that never turns. The
     dark set is the shell's own. `color-scheme` is for the browser's own controls
     and scrollbars; the board's frame cannot see it, and is told (board.js). */
  color-scheme: dark;
  --ground: #000;
  --bar: #111;
  --bar-hover: #1c1c22;
  --drawer-surface: #101014;
  --menu: #16161c;
  --surface-raised: #17171d;
  --soft-accent: #1d1d2b;
  --line: #333;
  --line-soft: #26262e;
  --line-faint: #1b1b21;
  --grip: #3a3a44;
  --dots: #3c3c46;
  --ink: #ddd;
  --muted: #8a8a96;
  --meta: #7a7a86;
  --disabled: #666;
  --disabled-faint: #444;
  --accent: #6d6dff;
  --accent-text: #b9b9ff;
  --critical: #ffb4b4;
  --soft-critical: #3b1111;
  --soft-critical-hover: #4d1717;
  --critical-ground: #1a1114;
  --backdrop: rgba(0, 0, 0, 0.55);
  /* The board frame's ground in either theme: an agent's page that sets no
     background is transparent, and expects paper under it. */
  --paper: #fff;
  /* The terminal's palette, read into xterm by appearance.js. Dark is xterm's own
     default — Tango — so nothing moves for the theme that used to be the only one. */
  --term-background: #000000;
  --term-foreground: #ffffff;
  --term-cursor: #ffffff;
  --term-cursor-accent: #000000;
  --term-selection: rgba(255, 255, 255, 0.3);
  --term-black: #2e3436;
  --term-red: #cc0000;
  --term-green: #4e9a06;
  --term-yellow: #c4a000;
  --term-blue: #3465a4;
  --term-magenta: #75507b;
  --term-cyan: #06989a;
  --term-white: #d3d7cf;
  --term-bright-black: #555753;
  --term-bright-red: #ef2929;
  --term-bright-green: #8ae234;
  --term-bright-yellow: #fce94f;
  --term-bright-blue: #729fcf;
  --term-bright-magenta: #ad7fa8;
  --term-bright-cyan: #34e2e2;
  --term-bright-white: #eeeeec;
}
/* The board kit's light palette (hai-visual-board, foundation.md), so a light
   board sits in a light shell of the same temperature. The terminal's eight
   normal colours are chosen to read on this ground; the bright ones stay lighter
   than their normals, as a palette has them, and "white" stays a light grey — a
   TUI that paints white text expects a dark ground, as it does in every light
   scheme. */
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #f4f4f7;
  --bar: #ffffff;
  --bar-hover: #eeeef3;
  --drawer-surface: #ffffff;
  --menu: #ffffff;
  --surface-raised: #eeeef3;
  --soft-accent: #e9e9ff;
  --line: #d7d7df;
  --line-soft: #e4e4ea;
  --line-faint: #ededf1;
  --grip: #c2c2cb;
  --dots: #c6c6cf;
  --ink: #17171d;
  --muted: #62626f;
  --meta: #74747f;
  --disabled: #a6a6b0;
  --disabled-faint: #c4c4cc;
  --accent: #5252d6;
  --accent-text: #4444b9;
  --critical: #a23d47;
  --soft-critical: #fbe8ea;
  --soft-critical-hover: #f6d8dc;
  --critical-ground: #fdf3f4;
  --backdrop: rgba(23, 23, 29, 0.35);
  --paper: #fff;
  --term-background: #f4f4f7;
  --term-foreground: #17171d;
  --term-cursor: #17171d;
  --term-cursor-accent: #f4f4f7;
  --term-selection: rgba(82, 82, 214, 0.25);
  --term-black: #17171d;
  --term-red: #b3261e;
  --term-green: #1f7a3e;
  --term-yellow: #8a5a13;
  --term-blue: #1d4ed8;
  --term-magenta: #8b2fa3;
  --term-cyan: #0f7383;
  --term-white: #9a9aa4;
  --term-bright-black: #8a8a96;
  --term-bright-red: #d32f2f;
  --term-bright-green: #2e8b57;
  --term-bright-yellow: #b26a00;
  --term-bright-blue: #2f6fe0;
  --term-bright-magenta: #a347ba;
  --term-bright-cyan: #1a8fa3;
  --term-bright-white: #ffffff;
}

/* The v2 (flat) palette (design/flat.css) — the single source for the v2 chat: the shell
   links this file before ui-v2.css, and the chat bundle (web-src/chat/src/main.tsx) imports
   it, so the shell chrome and the in-bundle .chat read the same values. Set on
   body.chat-mode (a reader inside the chat) or on any page the shell wears as v2 — the
   baked pin — except a terminal-mode page, which keeps the terminal colours whatever
   the flag: these names (--ink, --accent, …) are the shell's own tokens too. */
html[data-ui="v2"] body.chat-mode,
html[data-ui="v2"] body:not(.terminal-mode) {
  --ground-v2: #0e0e12;
  --fill: #17171d;
  --fill-2: #1e1e26;
  --fill-3: #292933;
  /* The sidebar's own palette: the same tone with a violet shift, so it parts from the
     feed without a single line. */
  --side-ground: #14141e;
  --side-fill: #1b1b28;
  --side-fill-2: #232333;
  --side-fill-3: #2d2d40;
  /* The sidebar's width: the shell pads the page by it, and the chat's full-screen sheets
     (the dock's, the page's) start right of it — the full screen is the chat's area. */
  --side-w: 264px;
  --ink: #e6e6ec;
  --muted: #8b8b97;
  --meta: #63636f;
  --accent: #7d7dff;
  --grad: linear-gradient(135deg, #6d6dff 0%, #9a6bff 55%, #c86dd7 100%);
  --grad-soft: linear-gradient(135deg, #23233d 0%, #2b2344 100%);
  --ok: #7bc98b;
  --critical: #f26d6d;
  --warn: #e0b46a;
  --r-card: 16px;
  --r-chip: 999px;
  --r-composer: 26px;
  --r-btn: 12px;
  --font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* The reference's page carries it (flat.css body): without it macOS renders subpixel
     and v2's text — the sidebar above all — reads heavier than the frozen screen.
     The chat bundle sets its own; terminal mode never reaches this rule. */
  -webkit-font-smoothing: antialiased;
}
html[data-ui="v2"][data-theme="light"] body.chat-mode,
html[data-ui="v2"][data-theme="light"] body:not(.terminal-mode) {
  --ground-v2: #ffffff;
  --fill: #f3f3f7;
  --fill-2: #eaeaf0;
  --fill-3: #dcdce4;
  --side-ground: #f4f4fa;
  --side-fill: #ececf4;
  --side-fill-2: #e2e2ee;
  --side-fill-3: #d5d5e6;
  --ink: #17171d;
  --muted: #5f5f6b;
  --meta: #94949e;
  --accent: #5252d6;
  --grad: linear-gradient(135deg, #5252d6 0%, #8a52e0 55%, #b452c8 100%);
  --grad-soft: linear-gradient(135deg, #eceaff 0%, #f3e9ff 100%);
  --ok: #1f7a3e;
  --critical: #a0211a;
  --warn: #8a5a13;
  --r-card: 16px;
  --r-chip: 999px;
  --r-composer: 26px;
  --r-btn: 12px;
}
