/* Continuous tabs and a recessed, tactile day/night rocker. */
html[data-theme] .topnav{align-items:flex-end;gap:3px;position:relative;z-index:2}
html[data-theme] .topnav button{height:46px;margin-bottom:-1px;padding:0 17px;border:1px solid transparent;border-bottom:0;border-radius:9px 9px 0 0;position:relative}
html[data-theme] .topnav button.active{background:var(--bg);border-color:var(--line);color:var(--ink);box-shadow:0 -1px 0 #ffffff40;font-weight:650}
html[data-theme] .topnav button.active:after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:3px;background:var(--bg)}
html[data-theme] .topnav button:hover:not(.active){background:var(--hover);color:var(--ink)}
html[data-theme] .top-right .theme-control{width:68px;min-height:40px;padding:4px;border:0;background:transparent;box-shadow:none}
.theme-track{width:60px;height:30px;display:flex;align-items:center;justify-content:space-around;position:relative;border:1px solid #b7c2ce;border-radius:16px;background:linear-gradient(#d1dae4,#e6edf4);box-shadow:inset 0 2px 4px #233b551c,0 1px 0 #fff}
.theme-track svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;position:relative;z-index:1;color:#708094}
.theme-thumb{position:absolute;left:2px;top:2px;width:24px;height:24px;border-radius:50%;background:linear-gradient(145deg,#fff,#e6edf4);border:1px solid #fff;box-shadow:0 2px 4px #142b4933;transition:transform .22s ease}
.theme-track .theme-sun{color:#203b56}
/* Obsidian instrument surfaces; same geometry and hierarchy as daylight. */
html[data-theme=dark]{color-scheme:dark;--ink:#edf2f4;--muted:#9ca9b1;--line:#293237;--surface:#141a1e;--bg:#0b1013;--panel:#10161a;--field:#0a1014;--hover:#1b252c;--accent:#ffa33e;--accent-bright:#ffae53;--shadow:inset 0 1px 0 #ffffff06,0 5px 16px #0003;--ok:#43d7a1;--bad:#ff756b;--warn:#ffbc62}
html[data-theme=dark] body{background:radial-gradient(ellipse at 50% 0,#182630,#05080b 80%)}
html[data-theme=dark] #viewport{box-shadow:0 35px 85px #0009,0 0 0 1px #344148,inset 0 1px 0 #66757e}
html[data-theme=dark] header.topbar{background:linear-gradient(#151d23,#10171c);border-color:var(--line)}
html[data-theme=dark] header.topbar .brand,html[data-theme=dark] .topnav button.active{color:#f2f4f6}
html[data-theme=dark] .topnav button{color:#9ba8b1}
html[data-theme=dark] .topnav button.active{background:var(--bg);border-color:var(--line);box-shadow:0 -1px 0 #ffffff08}
html[data-theme=dark] .station,html[data-theme=dark] .top-right .device-status{color:#a3afb7}
html[data-theme=dark] button{background:linear-gradient(#202a31,#172027);border-color:#35424b;color:#dce4e9;box-shadow:inset 0 1px 0 #ffffff09,0 2px 3px #0004}
html[data-theme=dark] button:hover:not(:disabled){background:#27353f;border-color:#52636e}
html[data-theme=dark] button.primary,html[data-theme=dark] .ng-actions button.ng-primary{background:linear-gradient(180deg,#ffb355,#f19428);border-color:#ffb95e;color:#17120b;box-shadow:inset 0 1px 0 #ffe1b8,0 3px 9px #0005;font-weight:650}
html[data-theme=dark] button.primary:hover:not(:disabled){background:linear-gradient(#ffc36f,#ffa239);border-color:#ffcf8f}
html[data-theme=dark] button.quiet{background:transparent;color:#aab7c0;border-color:transparent;box-shadow:none}
html[data-theme=dark] button.quiet:hover:not(:disabled){background:#1b252c}
html[data-theme=dark] button:focus-visible,html[data-theme=dark] input:focus-visible{outline-color:#ffc072}
html[data-theme=dark] .theme-track{border-color:#394751;background:linear-gradient(#05090c,#121c23);box-shadow:inset 0 2px 4px #0009,0 1px 0 #ffffff0c}
html[data-theme=dark] .theme-thumb{transform:translateX(30px);background:linear-gradient(145deg,#48545e,#202d36);border-color:#69757d;box-shadow:inset 0 1px 0 #ffffff35,0 2px 5px #0009}
html[data-theme=dark] .theme-track .theme-sun{color:#71818d}
html[data-theme=dark] .theme-track .theme-moon{color:#ffc16a;filter:drop-shadow(0 0 3px #ffa33e40)}
html[data-theme=dark] .card,html[data-theme=dark] .table-wrap,html[data-theme=dark] .empty,html[data-theme=dark] .gh-hero,html[data-theme=dark] .guided-task-card,html[data-theme=dark] .gi-summary,html[data-theme=dark] .gp-card,html[data-theme=dark] .prep-card,html[data-theme=dark] .gi-visual,html[data-theme=dark] .gi-reading{background:linear-gradient(135deg,#151d22,#10171b);border-color:var(--line);box-shadow:var(--shadow)}
html[data-theme=dark] .gh-copy,html[data-theme=dark] .guided-task-copy,html[data-theme=dark] .gi-summary-copy{background:transparent}
html[data-theme=dark] .gh-task-head strong,html[data-theme=dark] .guided-task-copy h1{color:#e4edf3}
html[data-theme=dark] .gh-task-head span{color:var(--muted)}
html[data-theme=dark] .gh-current,html[data-theme=dark] .guided-task-facts{border-color:var(--line)}
html[data-theme=dark] .gh-progress i{background:linear-gradient(90deg,#e7a252 var(--done),#2b353d var(--done))}
html[data-theme=dark] .gh-attention,html[data-theme=dark] .gi-summary-warning{background:#271e12;border-color:#6c4d27;color:#ffc174}
html[data-theme=dark] .gh-queue-row{background:#121a20;border-color:var(--line);color:var(--ink)}
html[data-theme=dark] .gh-queue-row:hover{background:#1b252c}
html[data-theme=dark] .gh-queue-part{border-color:#34424b;background:#aab6bf}
/* Photography is lit on a neutral inspection bed, never inverted or recoloured. */
html[data-theme=dark] .gh-part,html[data-theme=dark] .guided-task-art,html[data-theme=dark] .gi-summary-art,html[data-theme=dark] .gi-part{background:#a2acb4;border-color:var(--line)}
html[data-theme=dark] .real-part{filter:brightness(.72) contrast(1.08)}
html[data-theme=dark] .gi-part .real-part,html[data-theme=dark] .method-visual .real-part{filter:none}
html[data-theme=dark] .gi-part .real-part image,html[data-theme=dark] .method-visual .real-part image{filter:brightness(.72) contrast(1.08)}
html[data-theme=dark] .trace-under{stroke:#101920;stroke-width:8px}
html[data-theme=dark] .trace-color{stroke:#55c8ff;stroke-width:4px}
html[data-theme=dark] .trace-color circle{fill:#55c8ff}
html[data-theme=dark] .badge{background:#202b33;color:#b6c5ce;border-color:#354550}
html[data-theme=dark] .badge.ok{background:#112e25;color:#65dfb0;border-color:#24553f}
html[data-theme=dark] .badge.warn{background:#302415;color:#ffbd66;border-color:#634821}
html[data-theme=dark] .badge.bad{background:#361b1b;color:#ff8b80;border-color:#693732}
html[data-theme=dark] .badge.dark{background:#23313c;color:#d3e2ec;border-color:#3d5261}
html[data-theme=dark] .note,html[data-theme=dark] .guided-details{background:#151e25;color:#b1c0cb;border-color:#354752}
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#0a1014;color:#e0e9ef;border-color:#394852}
html[data-theme=dark] th{background:#182229;color:#a7b8c3}
html[data-theme=dark] td{border-color:#27333c;color:#dbe4ea}
html[data-theme=dark] td small{color:#92a3af}
html[data-theme=dark] tr:hover td{background:#1b2832}
html[data-theme=dark] .filters{border-color:var(--line)}
html[data-theme=dark] .filters button{background:transparent;color:#9cabb5}
html[data-theme=dark] .filters button.active{color:#ffc072;border-bottom-color:#ffa33e}
html[data-theme=dark] .gi-progress button{color:#a3b1ba;background:#162129}
html[data-theme=dark] .gi-progress button.current{background:#382919;border-bottom-color:#ffa33e;color:#ffc577}
html[data-theme=dark] .gi-progress button.complete{background:#133229;border-bottom-color:#3da57a;color:#79d3ae}
html[data-theme=dark] .gi-visual-top,html[data-theme=dark] .gi-method{background:transparent;border-color:var(--line)}
html[data-theme=dark] .gi-reading.is-ng{border-color:#8c4540}
html[data-theme=dark] .gi-big-value{color:#f2f6f9}
html[data-theme=dark] .gi-wait strong{color:#899ca9}
html[data-theme=dark] .gi-range{border-color:var(--line);color:#9fadb7}
html[data-theme=dark] .gi-footer{background:#10171c;border-color:var(--line)}
html[data-theme=dark] .judgment-card{--result:#34c891;--result-deep:#74edbd;--result-soft:#123a2d;--result-line:#286447;background:linear-gradient(110deg,#10261f,#143c2e);box-shadow:inset 0 1px 0 #75edbd12,0 4px 12px #0003}
html[data-theme=dark] .judgment-card.is-fail{--result:#fa6657;--result-deep:#ff9588;--result-soft:#4b211c;--result-line:#8c463c;background:linear-gradient(110deg,#2c1615,#4a211c)}
html[data-theme=dark] .judgment-copy>span{color:#c5d1d3}
html[data-theme=dark] .judgment-copy>strong{text-shadow:none}
html[data-theme=dark] .judgment-card:before{opacity:.15;box-shadow:inset 1px 0 0 #ffffff20}
html[data-theme=dark] .emblem-shape{stroke:#ffffff55}
html[data-theme=dark] .emblem-mark{stroke:#09261b}
html[data-theme=dark] .is-fail .emblem-mark{stroke:#3f100c}
html[data-theme=dark] .prep-num,html[data-theme=dark] .gp-number{background:#263640;color:#b7cbd7}
html[data-theme=dark] .demo-stage{background:#9faab2;border-color:#35434d}
html[data-theme=dark] .demo-step{background:#172128f5;border-color:#39464f;color:#e7eff4}
html[data-theme=dark] .demo-controls{border-color:var(--line)}
html[data-theme=dark] .demo-controls button{background:transparent;box-shadow:none}
html[data-theme=dark] .gp-card.is-ready{border-color:#29533f}
html[data-theme=dark] .gp-card.is-ready .gp-number{background:#123a29;color:#81dab0}
html[data-theme=dark] .gp-device-visual,html[data-theme=dark] .gp-part>div{background:#172630;border-color:#384955}
html[data-theme=dark] .modal,html[data-theme=dark] .ng-modal{background:#11191e;border-color:#3c4a54;box-shadow:0 20px 70px #000a;color:var(--ink)}
html[data-theme=dark] .modal-head,html[data-theme=dark] .modal-foot{background:#172128;border-color:#34424c}
html[data-theme=dark] .ng-modal .modal-head{background:#291d15}
html[data-theme=dark] .ng-result .value{color:#ffac71}
html[data-theme=dark] .login{background:#0b1013}
html[data-theme=dark] .login-side{background:radial-gradient(ellipse at 30% 20%,#253b49,#0b151d 70%);color:#e2edf4}
html[data-theme=dark] .login-side p{color:#a3b8c5}
html[data-theme=dark] .login-main{background:#10171c}
html[data-theme=dark] .userpick button{background:#1c2830;border-color:#374852}
html[data-theme=dark] .userpick button.active{background:#392a19;border-color:#c2873e;color:#ffc677;box-shadow:inset 0 -2px #ffb253}
html[data-theme=dark] .boot{background:radial-gradient(ellipse at center,#1b303e,#070e13);color:#dbeaf3}
html[data-theme=dark] .boot .bootline,html[data-theme=dark] .boot .micro{color:#92a9b9}
@media(prefers-reduced-motion:reduce){.theme-thumb{transition:none}}
html[data-theme=dark] .gi-reading.is-pending .gi-reading-head strong{color:#ffc072}
html[data-theme=dark] .gi-reading.is-ng .gi-reading-head strong{color:#ff9588}
html[data-theme=dark] .ng-next{background:#321e1d;border-color:#9a5148;color:#ffd0c7}
/* Preparation films use one instrument-grade transport control in both themes. */
.demo-controls{justify-content:flex-end;padding:2px 0;border-bottom:1px solid var(--line,#d9e1e8)}
.demo-control-group{height:30px;display:inline-flex;align-items:stretch;overflow:hidden;border:1px solid #bfcbd6;border-radius:6px;background:linear-gradient(180deg,#fff,#edf2f6);box-shadow:inset 0 1px 0 #fff,0 1px 3px #20354a15}
.demo-controls .demo-control-group button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:28px;padding:0 11px;border:0;border-radius:0;background:transparent;box-shadow:none;color:#344c63;font-family:inherit;font-size:11px;font-weight:600;line-height:1;white-space:nowrap}
.demo-controls .demo-control-group button+button{border-left:1px solid #cbd5de}
.demo-controls .demo-control-group button:hover:not(:disabled){background:#e5edf5;color:#173c66}
.demo-controls .demo-control-group button[aria-pressed=true]{background:#dce8f3;color:#174b79}
.demo-controls .demo-control-group .icon{width:15px;height:15px;flex:none;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.demo-controls .demo-control-group button:focus-visible{outline:2px solid var(--accent,#245bff);outline-offset:-2px;position:relative;z-index:1}
html[data-theme=dark] .demo-control-group{border-color:#45535c;background:linear-gradient(180deg,#26313a,#192228);box-shadow:inset 0 1px 0 #ffffff17,0 1px 4px #0008}
html[data-theme=dark] .demo-controls .demo-control-group button{background:transparent;color:#dce6ec;box-shadow:none}
html[data-theme=dark] .demo-controls .demo-control-group button+button{border-left-color:#43515b}
html[data-theme=dark] .demo-controls .demo-control-group button:hover:not(:disabled){background:#34434d;color:#fff}
html[data-theme=dark] .demo-controls .demo-control-group button[aria-pressed=true]{background:#35414a;color:#ffbd73}
