/* Shared visual tokens. Scientific figures retain their own colors. */
html:root {
  --good: #8c6847;
  --warn: #a06e2c;
  --danger: #a8443d;
  --chrome: #f0ede7;
  --chrome-hi: #f4f1ec;
  --sidebar: #f3f0e9;
  --surface: #fcfaf5;
  --surface-2: #f8f5ef;
  --surface-3: #f0ebe2;
  --elevated: #fdfbf7;
  --elevated-2: #f6f2eb;
  --text: #3b332c;
  --text-2: #574b40;
  --text-3: #786957;
  --text-4: #786957;
  --border: rgba(92, 68, 44, .12);
  --border-strong: rgba(92, 68, 44, .24);
  --border-hairline: rgba(92, 68, 44, .08);
  --hover: rgba(126, 87, 47, .06);
  --active: rgba(126, 87, 47, .11);
  --accent: #956b46;
  --accent-soft: rgba(149, 107, 70, .11);
  --send-bg: #795b41;
  --send-fg: #fff7ec;
  --tab-active: #faf7f1;
  --code-bg: #f4efe7;
  --scrollbar: rgba(107, 81, 55, .27);
}
html:root:is([data-theme="dark"], [data-service-theme="dark"]) {
  --chrome: #27231f;
  --chrome-hi: #302a24;
  --sidebar: #2d2822;
  --surface: #332d26;
  --surface-2: #302a24;
  --surface-3: #41372d;
  --elevated: #463b30;
  --elevated-2: #3c332a;
  --text: #ede2d2;
  --text-2: #d1c2ad;
  --text-3: #baa68e;
  --text-4: #baa68e;
  --border: rgba(236, 210, 174, .12);
  --border-strong: rgba(236, 210, 174, .24);
  --border-hairline: rgba(236, 210, 174, .08);
  --hover: rgba(235, 204, 165, .06);
  --active: rgba(235, 204, 165, .12);
  --accent: #d3ae81;
  --accent-soft: rgba(211, 174, 129, .13);
  --send-bg: #dbc0a0;
  --send-fg: #382b20;
  --tab-active: #3c332a;
  --code-bg: #2e2822;
  --scrollbar: rgba(232, 207, 175, .25);
  --good: #d3ae81;
  --warn: #e1b06a;
  --danger: #f2aaa1;
}

html:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Variable Text", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-menu: 0 8px 28px rgba(40, 30, 20, .16);
  --surface-elevated: var(--elevated);
  --surface-elevated-2: var(--elevated-2);
  --ink: var(--text);
  --muted: var(--text-3);
  --line: var(--border);
  --paper: var(--surface);
  --canvas: var(--chrome);
  --history-surface: var(--sidebar);
  --research-well: var(--surface-2);
  --research-control: var(--border-strong);
  --research-primary: var(--send-bg);
  --research-on-primary: var(--send-fg);
  --research-wash: var(--accent-soft);
  --research-info: #395f79;
  --research-warning: var(--warn);
  --research-warning-bg: color-mix(in srgb, var(--warn) 12%, var(--surface));
  --research-error: var(--danger);
  --research-error-bg: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --research-ease: cubic-bezier(.22,1,.36,1);
  --soft-shadow: none;
  --soft-ring: none;
  --wash: var(--research-wash);
  --field-surface: var(--surface);
  --field-border: var(--border-strong);
  --focus-ring: color-mix(in srgb, var(--accent) 24%, transparent);
  --panel-shadow: var(--shadow-menu);
  --overlay-backdrop: color-mix(in srgb, var(--text) 40%, transparent);
  --success: var(--good);
  --warning: var(--warn);
  --error: var(--danger);
  --status-green: var(--good);
  --status-yellow: var(--warn);
  --status-red: var(--danger);
  --status-gray: var(--text-3);
  color-scheme: light;
  font-family: var(--font-ui);
}
html:root:is([data-theme="dark"], [data-service-theme="dark"]) {
  --research-info: #aec7de;
  --shadow-menu: 0 8px 28px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
html:root body { font-family: var(--font-ui); }
