/* Soma Studio — semantic tokens.
   Dark is the default; light is html[data-theme="light"].
   Components must not contain hex values outside this file. */

:root,
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f1417;
  --titlebar: #0d1114;
  --side: #0f1417;
  --panel: #12181b;
  --panel-2: #1c2023;
  --elevated: #262b2e;
  --input: #0b1013;

  --line: #2a3237;
  --line-2: #41484d;

  --ink: #dfe3e7;
  --ink-2: #c0c7cd;
  --muted: #98a3aa;
  --faint: #6d787f;

  --accent: #8fcff3;
  --accent-2: #a7dcfa;
  --accent-solid: #8fcff3;
  --accent-solid-hover: #a7dcfa;
  --on-accent: #0b1418;
  --accent-soft: rgba(143, 207, 243, 0.12);
  --accent-line: #2f5568;
  --selection: rgba(143, 207, 243, 0.26);

  --green: #7ee28c;
  --green-soft: rgba(126, 226, 140, 0.13);
  --amber: #e4b95d;
  --amber-soft: rgba(228, 185, 93, 0.14);
  --red: #ff9d96;
  --red-soft: rgba(255, 157, 150, 0.13);
  --purple: #c4a7f7;
  --purple-soft: rgba(196, 167, 247, 0.13);

  --scroll-thumb: #333c42;
  --scroll-thumb-hover: #41484d;
  --kbd-bg: #191f23;
  --code-bg: #191f23;
  --pre-bg: #0b1013;
  --track: #1c2226;
  --bubble-user: rgba(143, 207, 243, 0.16);

  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --shadow-dock: -18px 0 60px rgba(0, 0, 0, 0.45);
  --shadow-menu: 0 28px 90px rgba(0, 0, 0, 0.65);

  --chart-1: #8fcff3;
  --chart-2: #7ee28c;
  --chart-3: #e4b95d;
  --chart-4: #c4a7f7;
  --chart-5: #ff9d96;
  --chart-6: #6fb4d6;
  --chart-7: #9ad8a8;
  --chart-8: #8f9aa1;

  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 12px;
  --titlebar-h: 38px;
  --chrome-h: 30px;
  --breadcrumb-h: 29px;
  --statusbar-h: 24px;
  --resizer-w: 7px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  /* Document-specific families; the exporter overwrites these. */
  --soma-serif: serif;
  --soma-sans: sans-serif;
  --soma-mono: monospace;
  --soma-math: serif;

  /* Paper is the one pure-white surface: it must match print. */
  --paper: #ffffff;
  --paper-edge: #d9dee3;
  --canvas: var(--bg);
  --page-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(0, 0, 0, 0.3);
  --overlay-line: rgba(143, 207, 243, 0.5);
  --overlay-strong: #8fcff3;
  --trim-zone: rgba(228, 185, 93, 0.18);
  --trim-line: rgba(228, 185, 93, 0.8);
  --flag-overfull: #ff9d96;
  --flag-emergency: #e4b95d;
  --margin-guide: rgba(143, 207, 243, 0.22);
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f6fafe;
  --titlebar: #d6dadf;
  --side: #f6fafe;
  --panel: #ffffff;
  --panel-2: #eef2f6;
  --elevated: #e5e9ed;
  --input: #ffffff;

  --line: #d5dce2;
  --line-2: #c0c7cd;

  --ink: #171c1f;
  --ink-2: #2c3438;
  --muted: #55616a;
  --faint: #7c878f;

  --accent: #1b6585;
  --accent-2: #17546f;
  --accent-solid: #1b6585;
  --accent-solid-hover: #154f6a;
  --on-accent: #f6fafe;
  --accent-soft: rgba(27, 101, 133, 0.1);
  --accent-line: #a9c6d4;
  --selection: rgba(27, 101, 133, 0.18);

  --green: #1c7a3c;
  --green-soft: rgba(28, 122, 60, 0.1);
  --amber: #8a5a06;
  --amber-soft: rgba(138, 90, 6, 0.11);
  --red: #b3261e;
  --red-soft: rgba(179, 38, 30, 0.09);
  --purple: #6d3fb8;
  --purple-soft: rgba(109, 63, 184, 0.1);

  --scroll-thumb: #c3ccd3;
  --scroll-thumb-hover: #aeb9c1;
  --kbd-bg: #eef2f6;
  --code-bg: #eef2f6;
  --pre-bg: #f4f7f9;
  --track: #e7ecf0;
  --bubble-user: rgba(27, 101, 133, 0.09);

  --shadow: 0 20px 50px rgba(23, 28, 31, 0.14);
  --shadow-dock: -18px 0 50px rgba(23, 28, 31, 0.1);
  --shadow-menu: 0 28px 80px rgba(23, 28, 31, 0.22);

  --chart-1: #1b6585;
  --chart-2: #1c7a3c;
  --chart-3: #8a5a06;
  --chart-4: #6d3fb8;
  --chart-5: #b3261e;
  --chart-6: #0e7490;
  --chart-7: #4d7c0f;
  --chart-8: #64748b;

  --paper: #ffffff;
  --paper-edge: #cfd6dc;
  --canvas: #e9eef3;
  --page-shadow: 0 16px 38px rgba(23, 28, 31, 0.16), 0 1px 0 rgba(23, 28, 31, 0.08);
  --overlay-line: rgba(27, 101, 133, 0.45);
  --overlay-strong: #1b6585;
  --trim-zone: rgba(138, 90, 6, 0.14);
  --trim-line: rgba(138, 90, 6, 0.75);
  --flag-overfull: #b3261e;
  --flag-emergency: #8a5a06;
  --margin-guide: rgba(27, 101, 133, 0.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--selection); }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
::-webkit-scrollbar-track { background: transparent; }

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--muted);
  background: var(--kbd-bg);
}
code, .mono { font-family: var(--mono); }
code {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}
pre {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--pre-bg);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: var(--radius);
  overflow: auto;
  color: var(--ink-2);
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tabular { font-variant-numeric: tabular-nums; }
