:root { color-scheme:light; }
.theme-toggle {
  display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;
  width:34px;height:34px;padding:0;border:1px solid var(--line);border-radius:5px;
  background:transparent;color:var(--accent);font-size:17px;
}
.theme-toggle:hover { background:var(--line); }
.theme-picker {
  width:143px;min-width:0;height:34px;border:1px solid var(--line);border-radius:5px;
  padding:0 7px;background:var(--paper);color:inherit;font:inherit;font-size:11px;cursor:pointer;
}
.theme-picker:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
html[data-theme=dark] {
  color-scheme:dark;color:var(--ink);background:var(--paper);
  --paper:#171c19;--muted:#a5afa0;--line:#374139;--accent:#b0c79d;
  --surface:#202721;--raised:#29332b;--ink:#e0e5dc;--sub:#a5afa0;
  --sidebar:#1d241f;--selected:#2b3b2d;--button-ink:#1a2618;
  --error-bg:#392923;--error-ink:#f1bca5;--error-line:#775448;
  --pg-paper:var(--paper);--pg-ink:var(--ink);--pg-sub:var(--sub);
  --pg-line:var(--line);--pg-green:var(--accent);
}
/* Upstream palette sources and licenses: docs/themes/README.md. */
html[data-palette=dracula] {
  --paper:#282a36;--sidebar:#21222c;--surface:#343746;--raised:#44475a;
  --ink:#f8f8f2;--sub:#bfc2d5;--muted:var(--sub);--line:#44475a;
  --accent:#bd93f9;--selected:#44475a;--button-ink:#282a36;
  --error-bg:#442d37;--error-ink:#ffb86c;--error-line:#ff5555;
}
html[data-palette=nord] {
  --paper:#2e3440;--sidebar:#292e39;--surface:#3b4252;--raised:#434c5e;
  --ink:#eceff4;--sub:#d8dee9;--muted:var(--sub);--line:#4c566a;
  --accent:#88c0d0;--selected:#434c5e;--button-ink:#2e3440;
  --error-bg:#43343e;--error-ink:#ebcb8b;--error-line:#bf616a;
}
html[data-palette=mocha] {
  --paper:#1e1e2e;--sidebar:#181825;--surface:#313244;--raised:#45475a;
  --ink:#cdd6f4;--sub:#bac2de;--muted:var(--sub);--line:#585b70;
  --accent:#cba6f7;--selected:#45475a;--button-ink:#1e1e2e;
  --error-bg:#45303d;--error-ink:#f38ba8;--error-line:#eba0ac;
}
html[data-palette=tokyo] {
  --paper:#1a1b26;--sidebar:#16161e;--surface:#24283b;--raised:#292e42;
  --ink:#c0caf5;--sub:#a9b1d6;--muted:var(--sub);--line:#414868;
  --accent:#7aa2f7;--selected:#292e42;--button-ink:#1a1b26;
  --error-bg:#3d293c;--error-ink:#f7768e;--error-line:#bb9af7;
}
html[data-theme=dark] :is(.sidebar) { background:var(--sidebar); }
html[data-theme=dark] :is(.composer,.details,dialog,.usage-metric,.pg-scenario,.pg-workbench,.pg-result) {
  background:var(--surface);color:var(--ink);border-color:var(--line);
  box-shadow:0 8px 28px #00000018;
}
html[data-theme=dark] :is(.topbar,.search-field,.avatar,.message.user .avatar,.usage-model-row,.usage-trigger,
  .markdown th,.markdown td,.markdown pre,.reply-status,.pg-header,.pg-back,.pg-filters button,.pg-card-tag,
  .pg-lab-live,.pg-tool-row,.pg-result-output,.pg-result-meta,.pg-result-output pre,.pg-result-output td,.pg-result-output th) {
  border-color:var(--line);
}
html[data-theme=dark] :is(input,textarea,select,.composer textarea,#promptInput,.usage-filters select,.usage-filters button) {
  color:var(--ink);border-color:var(--line);
}
html[data-theme=dark] :is(.search-field,dialog input,dialog textarea,.usage-filters select,.usage-filters button,#promptInput) { background:var(--paper); }
html[data-theme=dark] :is(.welcome h1,.breadcrumbs b,.suggestion,.system-title,.usage-section-title,
  .markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5,.markdown h6,#noteContent,
  .pg-scenario strong,.pg-field-heading label,.pg-result-output,.pg-selection strong) { color:var(--ink); }
html[data-theme=dark] :is(.workspace-label,.workspace-label:first-of-type,.new-link,.note-row,.task-row,.note-row .ti,
  .vault-location,.vault-location small,.connection,.breadcrumbs,.engine-toggle,.eyebrow,.welcome p,.suggestion-number,
  .suggestion small,.suggestion .ti,.message.user .bubble,.action-summary,.composer-footer,.disclaimer,
  .system-label,.system-card p,.privacy p,.metric,.toolrow,.voice-toggle,.speech-controls [role=status],
  .usage-trigger,.usage-kicker,.usage-metric span,.usage-explain,.usage-footer,.usage-bar-date,
  .usage-model-stats,.usage-empty,.usage-heading .icon-button,.reply-status,
  .pg-current,.pg-provider-status,.pg-eyebrow,.pg-mini-label,.pg-intro p,.pg-intro-stats span,.pg-subtle,
  .pg-filters button,.pg-scenario-desc,.pg-card-count,.pg-card-tag,.pg-lab-live,.pg-selection-num,
  .pg-field-heading span,.pg-preview-head,.pg-preview-free,.pg-route-row>span:last-child,
  .pg-tool-row span,.pg-tool-row strong,.pg-preview-caveat,.pg-change-permission label,
  .pg-change-permission p,.pg-run-hint,.pg-result-state,.pg-placeholder,.pg-placeholder strong,
  .pg-placeholder>.ti,.pg-result-meta span,.pg-result-meta strong,.pg-footnote,.pg-confirm p) { color:var(--sub); }
html[data-theme=dark] :is(.side-link,.avatar,.speech-controls button,.pg-back,.pg-card-icon,.pg-selection-icon,
  .pg-preview,.pg-confirm-icon,.pg-card-tag.pg-write-tag,.markdown code,.markdown pre,.markdown th,.pg-result-output pre) {
  background:var(--raised);color:var(--ink);border-color:var(--line);
}
html[data-theme=dark] :is(.side-link.active,.pg-scenario[aria-pressed=true],.pg-route-badge) {
  background:var(--selected);color:var(--ink);border-color:var(--accent);
}
html[data-theme=dark] :is(.note-row:hover,.icon-button:hover,.suggestion:hover,.playground-nav:hover,.speech-controls button:hover,
  .usage-trigger:hover,.pg-back:hover,.pg-filters button:hover,.new-link:hover) { background:var(--raised);color:var(--ink); }
html[data-theme=dark] :is(.send,.primary,.pg-run,.pg-filters button.is-active,.pg-confirm-buttons button:last-child) {
  background:var(--accent);color:var(--button-ink);border-color:var(--accent);
}
html[data-theme=dark] :is(.send:hover,.primary:hover,.pg-run:hover) { background:color-mix(in srgb,var(--accent),white 15%); }
html[data-theme=dark] :is(.stop-send,.pg-stop) { background:var(--raised);color:var(--ink); }
html[data-theme=dark] :is(.markdown a,.pg-footnote a,.pg-logo .ti,.pg-back,#closeNote,.brand-period) { color:var(--accent); }
html[data-theme=dark] .markdown blockquote { color:var(--sub);border-color:var(--accent); }
html[data-theme=dark] .markdown pre code { background:none; }
html[data-theme=dark] :is(input,textarea)::placeholder { color:var(--sub); }
html[data-theme=dark] :is(.composer:focus-within,.pg-scenario:hover) { border-color:var(--accent); }
html[data-theme=dark] #closeNote { background:var(--raised); }
html[data-theme=dark] .playground-nav { background:transparent;border-color:transparent;color:var(--sub); }
html[data-theme=dark] .task-row.done span { color:var(--sub); }
html[data-theme=dark] #errorBox { background:var(--error-bg);border-color:var(--error-line);color:var(--error-ink); }
html[data-theme=dark] :is(.nav-indicator,.welcome-rule,.pg-eyebrow-line,.usage-bar-fill,.message-content.is-streaming::after) { background:var(--accent); }
html[data-theme=dark] :is(.pg-intro h1 span,.pg-logo strong span,.pg-result-state[data-state=complete]) { color:var(--accent); }
html[data-theme=dark] dialog::backdrop { background:#050905a8; }
html[data-theme=dark] .reply-status[data-state=processing]::before { border-color:var(--line);border-top-color:var(--accent); }
/* Business Lab uses the current theme instead of forcing the light palette. */
html[data-theme=dark] :is(.biz-tabs,.biz-workflow,.biz-workbench,.biz-evaluation-row,
  .biz-catalog-footer,.biz-reference,.biz-mode>span,.biz-disclosure,.biz-eval-overview,
  .biz-secondary-button,.biz-progress,#bizCaseSelect,#bizTextInput) {
  background:var(--surface);border-color:var(--line);color:var(--ink);
}
html[data-theme=dark] :is(.biz-tab.is-active,.biz-workflow[aria-pressed=true],
  .biz-mode:has(input:checked)>span) {
  background:var(--selected);border-color:var(--accent);color:var(--ink);
}
html[data-theme=dark] :is(.biz-workflow:hover,.biz-secondary-button:hover) {
  background:var(--raised);
}
html[data-theme=dark] :is(.biz-workflow-icon,.biz-eval-overview,.biz-verdict) {
  background:var(--raised);border-color:var(--line);
}
html[data-theme=dark] :is(.biz-hero h1,.biz-workbench-head h2,.biz-results-heading h2,
  .biz-workflow-text strong,.biz-active-workflow strong,.biz-eval-row-head strong,
  .biz-field-row label,.biz-mode strong,.biz-reference>strong,.biz-score strong,
  .biz-eval-grid strong,.biz-score-detail strong) { color:var(--ink); }
html[data-theme=dark] :is(.biz-tab,.biz-workflow-text small,.biz-hero p,.biz-disclosure,
  .biz-hero-stats span,.biz-synthetic-label,.biz-small-info,.biz-reference p,
  .biz-field-row label,.biz-engine-help,.biz-catalog-footer,.biz-eval-grid span,
  .biz-result-status,.biz-eval-reason,.biz-eval-disclaimer,.biz-safety-note,
  .biz-score span,.biz-score-detail span,.biz-eval-warning) { color:var(--sub); }
html[data-theme=dark] :is(.biz-verdict.is-correct,.biz-verdict.is-incorrect,
  .biz-verdict.is-unscored,.biz-eval-warning) { background:var(--raised);border-color:var(--line); }
html[data-theme=dark] .biz-reference>div { color:var(--sub); }
html[data-theme=dark] .biz-tab-new { background:var(--accent);color:var(--button-ink); }
html[data-theme=dark] .biz-export { color:var(--accent); }
html[data-theme=dark] .biz-data-status {color:var(--sub);background:var(--raised);border-color:var(--line)}
@media(max-width:650px) {
  .theme-picker { width:100px;font-size:10px; }
  .topbar-actions .model-chip { max-width:55px; }
}
