:root { color-scheme:light; --page-bg:#f4f7fb; --surface-soft:#f4f7fb; }
html[data-theme="dark"] {
  color-scheme:dark;
  --page-bg:#10131d; --surface-soft:#202635; --card:#171c28;
  --ink:#edf1f7; --muted:#aab6c8; --line:#343e50;
  --brand:#2388ae; --brand-ink:#8bd3ee;
  --shadow:0 1px 2px #0002,0 12px 32px -12px #0004;
}
body { background:var(--page-bg); }
.theme-control { margin-top:auto; padding:.75rem 0 .4rem; position:sticky; bottom:0; background:var(--card); }
.sidenav .who { margin-top:0; }
#theme-toggle { display:flex; align-items:center; justify-content:space-between; gap:.5rem; width:100%; min-height:44px; padding:.5rem .7rem; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:var(--card); font:inherit; font-size:.8rem; cursor:pointer; }
#theme-toggle[hidden] { display:none; }
#theme-toggle:focus-visible { outline:3px solid var(--brand-ink); outline-offset:2px; }
.theme-track { display:flex; align-items:center; width:32px; height:20px; padding:3px; border-radius:20px; background:#697589; flex:none; }
.theme-track span { width:14px; height:14px; border-radius:50%; background:white; }
[aria-checked="true"] .theme-track { background:#2388ae; }
[aria-checked="true"] .theme-track span { transform:translateX(12px); }
body.nav-collapsed .theme-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
body.nav-collapsed #theme-toggle { padding:.3rem; justify-content:center; }
html[data-theme="dark"] :is(.language-switch,.sidenav a:hover,.nav-toggle:hover,.workspace-tab:hover,footer a.ver) { background:var(--surface-soft); border-color:var(--line); }
html[data-theme="dark"] .sidenav a.active { background:#203b4a; }
html[data-theme="dark"] :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { color:var(--ink); background:var(--surface-soft); border-color:var(--line); }
html[data-theme="dark"] :is(input,textarea)::placeholder { color:var(--muted); }
html[data-theme="dark"] :is(th,thead,pre,code,.workspace-tab,.hub-theme-icon,.hub-focus-item:hover,.hub-pressure-track) { background:var(--surface-soft); color:var(--ink); border-color:var(--line); }
html[data-theme="dark"] :is(.hub-overview-stat.critical strong,.field-status.is-error) { color:#ffaba6; }
html[data-theme="dark"] .hub-overview-stat.review strong { color:#edc578; }
html[data-theme="dark"] .hub-ring .base { stroke:var(--line); }
html[data-theme="dark"] :is(.check,.summary-box,.banner) { background:var(--surface-soft); color:var(--ink); border-color:var(--line); }
html[data-theme="dark"] .error { background:#42272f; color:#ffbbb4; border-color:#88525b; }
html[data-theme="dark"] .btn:hover { background:#17607a; color:white; }
html[data-theme="dark"] .mcp-page { --mcp-soft:#202b39; --mcp-soft-strong:#263f4d; --mcp-success:#a8e4c7; --mcp-line:var(--line); }
html[data-theme="dark"] .mcp-page :is(.mcp-workbench,.mcp-starters,.mcp-output,.mcp-env,.mcp-prompt,.mcp-example,.mcp-task-picker,.mcp-safety) { background:var(--card); border-color:var(--line); }
html[data-theme="dark"] .mcp-page :is(p,small,.mcp-actions span,.mcp-prompt span) { color:var(--muted); }
html[data-theme="dark"] .mcp-page .btn { background:#17607a; color:white; }
html[data-theme="dark"] .mcp-connection { background:#193a31; color:#b1ebd3; }
html[data-theme="dark"] .mcp-connection :is(p,span) { color:#b1ebd3; }
html[data-theme="dark"] .mcp-output span { color:var(--muted); }
html[data-theme="dark"] .mcp-env:has(input:checked) { background:var(--mcp-soft-strong); border-color:var(--brand-ink); }
html[data-theme="dark"] .mcp-readonly { background:#193a31; }
html[data-theme="dark"] :is(.report-flow,.report-flow-step) { background:var(--card); border-color:var(--line); }
html[data-theme="dark"] .report-flow-step:is(.active,:hover) { background:var(--surface-soft); }
@media print {
  .theme-control { display:none; }
}
