html[data-theme="dark"] {
 color-scheme: dark;
 --bg:#121417;
 --paper:#1b1e23;
 --panel:#22262d;
 --ink:#f3f1ed;
 --muted:#b9b7ba;
 --line:#3f424a;
 --blue:#ffb184;
 --light:#3f2a24;
 --green:#93d6b0;
 --red:#ffa4a4;
 --amber:#ffa574;
 --on-accent:#fff;
 --dark-accent:#a6411c;
 --dark-soft:#29242a;
 scrollbar-color:#70625a var(--bg);
}
html[data-theme="dark"] body {background:var(--bg);color:var(--ink)}
[data-theme="dark"] :is(header,.nav) {background:var(--paper);border-color:var(--line)}
[data-theme="dark"] body :is(.primary,a.primary,.article .primary) {background:var(--dark-accent);border-color:var(--dark-accent);color:#fff}
[data-theme="dark"] body :is(.primary:not(:disabled):hover,a.primary:hover) {background:#963915;color:#fff}
[data-theme="dark"] :is(.secondary,.ghost,.seg button,.mini,.toolbar button,.pdf-open,.stat,.letter,.bar,.track,.circle,.seg) {
 background:var(--panel);
 color:var(--ink);
 border-color:var(--line);
}
[data-theme="dark"] .bar i,[data-theme="dark"] .track>div{background:#ee905f}
[data-theme="dark"] :is(.seg button.active,.tabs .active,.filters .on,.modes button.on,.palette button.on,.choice.active,.choice.selected,.terminal.sel,.grid .done) {
 background:#442a22;color:var(--blue);border-color:#a46a4e;
}
[data-theme="dark"] :is(.explain,.status,.feedback,.notice:not(.keyboard-help),.hint,.storage-note) {background:var(--panel);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(.choice.correct,.choice.correct .letter) {background:#243a31;color:#bde7d1;border-color:#58846e}
[data-theme="dark"] :is(.choice.wrong,.choice.wrong .letter,.feedback.bad,.notice.err) {background:#45282b;color:#ffd0cd;border-color:#a9676b}
[data-theme="dark"] .study-actions.past-first .study-action {background:#282125;border-color:#64473e}
[data-theme="dark"] .study-actions.past-first .study-action:hover {background:#34272a;border-color:#a16e53}
[data-theme="dark"] .dock-layout .home-review :is(.stat,.review-tiles .tile) {border-color:var(--line)}
[data-theme="dark"] .dock-layout .home-review .stat {background:var(--panel)}
[data-theme="dark"] .dock-layout .home-review .review-tiles .tile svg {color:var(--blue)}
[data-theme="dark"] .archive :is(.filter-options,.answer-detail) {background:var(--panel);border-color:var(--line)}
[data-theme="dark"] .archive :is([data-filter][aria-pressed=true],.skill-page .solution summary) {background:#432c27;color:#ffd0b5;border-color:#8c5e4d}
[data-theme="dark"] .archive a.exam-row:hover {background:var(--panel)}
[data-theme="dark"] .archive .reference-button {border-color:#a46b55}
[data-theme="dark"] .skill-draw {--dc-accent:#fbb184;--dc-border:var(--line);--dc-ink:var(--ink);background:var(--paper)}
[data-theme="dark"] .skill-draw :is(button,select) {background:var(--panel)}
[data-theme="dark"] .skill-draw button[aria-pressed=true] {background:#442a22;color:#ffd0b5}
[data-theme="dark"] .skill-draw .draw-grade-btn {background:var(--dark-accent);color:#fff;border-color:var(--dark-accent)}
[data-theme="dark"] :is(.draw-palette button span,.draw-view small,.draw-status,.draw-readout,.draw-grade p) {color:var(--muted)}
[data-theme="dark"] .draw-grade {background:#35262b;border-color:#875052;color:#ffe1de}
[data-theme="dark"] .draw-grade.passed {background:#21382e;border-color:#49765b;color:#ddf6e6}
/* Keep printed documents and drawing surfaces unmodified, on white paper. */
[data-theme="dark"] :is(.draw-scroll,.question-pictures,.question-dialog-body,.pdf,.official-pdf,.single-wrap,.reference .single-wrap,.figure,.editor .canvas) {color-scheme:light}
[data-theme="dark"] :is(.draw-scroll,.question-pictures){border-color:#a7a09a}
[data-theme="dark"] .wiring :is(.wire-board,.wire-reference,.task-row,.dock,.device-card,.w-feedback,.board-extra) {background:var(--paper);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .wiring :is(.terminal,.term,.board-modes button) {background:var(--panel);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .wiring :is(.notice,.direct-status,.source-foot) {color:var(--muted)}
[data-theme="dark"] .wiring .circuit {color-scheme:light;background:#fff}
[data-theme="dark"] :is(a,button,summary,select):focus-visible {outline-color:var(--amber)}

header.liquid-header .glass-control.settings-gear {
 width:44px; min-width:44px; min-height:44px;
 justify-content:center;
 padding:0;
}
header.liquid-header .settings-gear svg {width:20px;height:20px}
[data-theme="dark"] header.liquid-header[data-glass-header] {background:transparent}
[data-theme="dark"] header.liquid-header .glass-control {
 background:#292c32;
 color:var(--ink);
 box-shadow:0 2px 5px #0007,0 8px 19px #0005;
}
[data-theme="dark"] header.liquid-header .topbar-emblem,
[data-theme="dark"] header.liquid-header .settings-gear:hover {color:var(--blue)}
[data-theme="dark"] .dock-layout nav.liquid-dock {background:transparent}
[data-theme="dark"] .dock-layout .liquid-dock .navin {background:#292d34;box-shadow:0 3px 11px #0007,0 8px 25px #0005}
[data-theme="dark"] .dock-layout .liquid-dock .navin button,
[data-theme="dark"] .dock-layout .liquid-dock .navin button:not(:disabled):hover {color:#dbd9d8}
[data-theme="dark"] .dock-layout .liquid-dock .navin button.active,
[data-theme="dark"] .dock-layout .liquid-dock .navin button.active:hover {color:#ffd2b7;background:#82482d55}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
 [data-theme="dark"] header.liquid-header .glass-control {
  --dark-lens:.76;
  background:linear-gradient(155deg,#ffffff17,transparent 57%,#ffffff0a),rgba(39,42,49,var(--dark-lens));
  box-shadow:inset 0 1px 1px #ffffff29,inset 0 -1px 1px #ffffff14,0 7px 21px #0008;
 }
 [data-theme="dark"] header.liquid-header[data-scrolled] .glass-control {
  --dark-lens:.66;
  background:linear-gradient(155deg,#ffffff18,transparent 57%,#ffffff0b),rgba(39,42,49,var(--dark-lens));
  box-shadow:inset 0 1px 1px #ffffff2e,inset 0 -1px 1px #ffffff18,0 8px 24px #0009;
 }
 [data-theme="dark"] .dock-layout .liquid-dock .navin {
  background:linear-gradient(158deg,#ffffff14,transparent 57%,#ffffff0a),rgba(41,45,52,.80);
  box-shadow:inset 0 1px 1px #ffffff2a,inset 0 -1px 1px #ffffff12,0 8px 25px #0009;
 }
}
@media(prefers-reduced-transparency:reduce),(forced-colors:active) {
 [data-theme="dark"] header.liquid-header :is(.glass-control,.glass-control:hover),
 [data-theme="dark"] header.liquid-header[data-scrolled] .glass-control,
 [data-theme="dark"] .dock-layout .liquid-dock .navin {
  background:Canvas;
  color:CanvasText;
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
 }
}

.site-settings main {max-width:680px;padding:16px 16px 52px}
.site-settings h1 {margin:9px 0 17px;font-size:25px;line-height:1.3}
.site-settings .settings-back{display:inline-flex;min-height:44px;align-items:center;text-decoration:none;color:var(--blue);font-size:13px}
.settings-panel{margin:0;border:1px solid var(--line);border-radius:16px;padding:14px 14px 12px;background:var(--paper);min-width:0}
.settings-panel legend{padding:0 4px;font-weight:750}
.theme-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.theme-choice{position:relative;display:grid;gap:7px;min-width:0;min-height:95px;border:1px solid var(--line);border-radius:12px;padding:9px;cursor:pointer;background:var(--panel)}
.theme-choice:has(input:checked){outline:2px solid var(--blue);outline-offset:-2px}
.theme-choice:has(input:focus-visible){outline:2px solid var(--amber);outline-offset:2px}
.theme-choice input{position:absolute;right:9px;bottom:9px;margin:0;accent-color:var(--blue)}
.theme-choice strong{font-size:14px;line-height:1.2}
.theme-preview{position:relative;display:block;height:41px;border:1px solid #d7d3ce;border-radius:7px;background:#eeeae6;overflow:hidden}
.theme-preview::before,.theme-preview::after{content:"";position:absolute;border-radius:999px;background:#fff}
.theme-preview::before{width:34%;height:7px;top:7px;left:8px}
.theme-preview::after{inset:20px 8px 7px}
.theme-preview.dark{border-color:#53555c;background:#15181a}
.theme-preview.dark::before,.theme-preview.dark::after{background:#383c42}
.settings-note,.settings-status{margin:10px 0 0;color:var(--muted);font-size:12px}
.settings-status{min-height:1.5em;margin-top:2px}
[data-theme="dark"] .dock-layout .liquid-dock .navin .dock-indicator {
 background:linear-gradient(145deg,#f58c5b26,#b9503a38);
 box-shadow:inset 0 0 0 1px #f08f674c;
}
[data-theme="dark"] .dock-layout .liquid-dock .navin .nav-tab {color:#dbd9d8}
[data-theme="dark"] .dock-layout .liquid-dock .navin .nav-tab.active {color:#ffd2b7}
