/* Scoped dark laboratory skin. No assets, fonts, filters or full-screen blur. */
:root{color-scheme:dark;--paper:#070612;--panel:#0d0d1e;--ink:#e1e3f4;--muted:#989bb8;--line:#28283e;--teal:#76d8ee;--amber:#ffad60;--navy:#9c9bff;--bad:#ff9c98;--good:#8de0c6;--shadow:0 12px 40px #0008;font-family:Arial,Helvetica,sans-serif}
html[data-lab-theme=light]{color-scheme:light;--paper:#e8eaf0;--panel:#f4f5fa;--ink:#232c49;--muted:#5a627e;--line:#d0d4e2;--teal:#217b93;--amber:#a86424;--navy:#5954a4;--bad:#ab4141;--good:#24725d}
body{background:var(--paper);color:var(--ink)}
@media(max-width:600px){.masthead .wordmark{min-width:126px;padding-right:6px;gap:6px}.masthead .wordmark .brand-copy{display:flex;flex-direction:column;flex-shrink:0}.masthead .wordmark .brand-copy strong{font-size:11px;letter-spacing:1px}.masthead .wordmark .brand-copy>span{font-size:7px;letter-spacing:1.5px}.masthead .header-actions #reset-defaults{font-size:9px;padding:6px}}
.masthead{background:var(--panel);border-color:var(--line);height:72px;padding:0 24px;gap:20px}
.wordmark{color:var(--ink);min-width:164px;padding-right:22px}.brand-logo{color:#a8a4ff;width:24px}.wordmark .brand-copy strong{font-size:15px}.wordmark .brand-copy>span{font-size:8px;letter-spacing:4.7px}
.project-name h1{color:var(--ink);font-size:17px}.eyebrow{color:var(--muted);font-size:9px;letter-spacing:1.5px}.project-name .eyebrow{color:#afaaff;font-size:8px}
.header-actions{gap:4px}.header-actions button{font-size:10px;white-space:nowrap}.header-actions #reset-defaults{border:1px solid #514878;color:#ddd0ff;background:#211935;padding:7px 11px}.header-actions #reset-defaults:hover{background:#35264f}
.layout{height:calc(100dvh - 72px);grid-template-columns:304px minmax(0,1fr)}.controls{background:var(--panel);border-color:var(--line)}
button{color:var(--ink);border-color:var(--line)}button:hover{background:#24203c;border-color:#565080}.primary{background:#7464c5;border-color:#8271d2;color:#fff}.primary:hover{background:#8b76df;color:#fff}.quiet:hover{background:#201d35}
input,select,textarea{color-scheme:dark}.search-wrap input,.parameter-row input[type=number],.parameter-row input[type=text],.parameter-row input[type=color],.parameter-row select,.detail-body select,.dialog-content textarea{background:#131225;color:var(--ink);border-color:#343149}
.parameter-row:has(input:focus),.parameter-slider:focus-within{background:#18192c}.parameter-row.pending input,.parameter-row.pending select{background:#302139;border-color:var(--amber)}
.parameter-slider-range-tools button:hover{background:#26203b;color:var(--ink);border-color:#53466d}.parameter-slider .parameter-slider-value{color:#e2dfff}.parameter-slider-label{color:#c7cade}.parameter-unit{color:#7d82a3}.parameter-slider-bound{color:#8b91b1}.parameter-slider-track::-webkit-slider-thumb{border-color:#17152b;box-shadow:0 0 0 1px #73cde5}.parameter-slider-track::-moz-range-thumb{border-color:#17152b}
.parameter-row:has(#parameter-model-objectiveMode) select{background:#181b2e;border-color:#445573}.control-tabs{border-color:var(--line)}.control-tabs button.active{color:#cec5ff;border-bottom-color:#ac92ff}.control-content{scrollbar-color:#3d365b var(--panel)}
.control-heading{padding:15px 18px 11px}.clock-line{padding-bottom:13px}.control-message{background:#111d2b;color:#b1cbdf;border-color:var(--line)}.control-message.error{background:#2c1728;color:#ffa9b5}
.light-show-card{background:linear-gradient(120deg,#17132b,#10182a);border:1px solid #3b3158;border-radius:8px;margin:8px 0 12px;padding:11px 12px}.light-show-head{display:flex;justify-content:space-between;align-items:center;font-size:10px;letter-spacing:1.1px;color:#d6c9ff}.light-show-head small{font-size:8px;color:#96c2d5;letter-spacing:1px}.light-spectrum{height:2px;background:linear-gradient(90deg,#35ddff,#586bff,#a34dff,#ff52ba);margin:9px 0 10px}.light-shapes{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.light-shapes button{font-size:9px;min-height:27px;padding:4px 3px;background:#15162a;border-color:#3e3655}.light-shapes button:hover,.light-shapes button[aria-pressed=true]{background:#302345;border-color:#9980d0;color:#f2daff}.light-quick-row{display:flex;justify-content:space-between;align-items:center;gap:9px;margin-top:10px;font-size:10px;color:#b7b9d1}.light-quick-row select{font-size:10px;background:#111222;border:1px solid #403754;border-radius:4px;color:#d1cee8;padding:4px 8px}.light-show-card p{font-size:8px;line-height:1.6;margin:8px 0 0;color:#8f94b1}
.wind-proof-card{background:#101624;border-color:#304052;box-shadow:none}.wind-proof-head strong{color:#c0d7e7}.wind-proof-badge{color:#96b3c9}.wind-proof-card output{color:#b8e3ed}.wind-proof-status{border-color:#293f50;color:#bbcadb}.wind-proof-meta{color:#889fb2}.wind-proof-warning{color:#9a9aaa}
.viewport{background:#05030b}.scene-top .eyebrow{color:#9c95cc}.scenario-caption{color:#c9c6e1;font-size:11px}.scene-buttons button{background:#141222;border-color:#3c354e;color:#dcd6ed;backdrop-filter:none;font-size:10px}.scene-buttons button:hover{background:#2e2543}.scene-buttons .active,.scene-buttons button[aria-pressed=true]{background:#352a4f;border-color:#8f73c0;color:#f4e7ff}.scene-legend{color:#9694b4;font-size:8px;gap:13px}.swatch.rigid{background:#93b2ff;box-shadow:0 0 6px #9a66ff}.swatch.reference{border-color:#b395ff}.swatch.target{background:#ffa653}.swatch.anchor{background:#99acd3}.swatch.recovery{background:#ffd183}.scene-bottom{color:#a6a1c2;font-size:8px}.selection-badge{background:#121126e8;border-color:#39304f;color:#d5cbe4;font-size:9px}.consensus-banner{background:#102526e8;border-color:#416c6b;box-shadow:0 8px 30px #0005}.consensus-banner span{color:#b0d6d3}
.metric-strip{background:#0b0b19;border-color:var(--line)}.metric{border-color:var(--line);padding:12px 20px}.metric strong{color:#cec9f2;font-size:23px}.metric-label{color:#8d91b0;letter-spacing:1.1px}.metric small{color:#a0a2bb;font-size:8px;line-height:1.55}.metric strong.bad{color:var(--bad)}
.analysis-deck{background:var(--panel);height:23%;min-height:185px}.plot-legend .teal{color:#74d7ef}.plot-legend .amber{color:#ce8cff}.plot-legend .navy{color:#ffa770}.audit-card{border-color:var(--line)}.audit-row span:last-child{color:#c8c9db}.audit-row .ok{color:#8de0c6!important}.audit-row .bad{color:#ffa29c!important}.audit-footer{font-size:8px;color:#9f9fb7;line-height:1.5}.scene-error{background:#291b2d;color:#f4c8d2}
dialog{background:var(--panel);border-color:var(--line);color:var(--ink)}dialog::backdrop{background:#03020bcc;backdrop-filter:none}.dialog-head{background:var(--panel);border-color:var(--line)}.equation,.restoration-result{background:#15172b;border-color:#718fbd}.restoration-toolbar select{color:var(--ink);background:#17162b}.event-log time{color:#81cbe6}.editor-tabs .active{background:#66559d;color:#fff}
/* Show view is a layout-only mode. Simulation and diagnostics continue. */
body.show-view .layout{grid-template-columns:minmax(0,1fr)}body.show-view .controls,body.show-view .metric-strip,body.show-view .analysis-deck{display:none}body.show-view .scene-legend{top:67px}body.show-view .workspace{height:100%}body.show-view .viewport{height:100%}body.show-view .selection-badge{top:108px}
html[data-lab-theme=light] .controls,html[data-lab-theme=light] .analysis-deck,html[data-lab-theme=light] .masthead{background:var(--panel)}html[data-lab-theme=light] input,html[data-lab-theme=light] select,html[data-lab-theme=light] textarea{color-scheme:light}html[data-lab-theme=light] .metric-strip{background:#e5e7f0}html[data-lab-theme=light] .metric strong,html[data-lab-theme=light] .parameter-slider-value,html[data-lab-theme=light] .parameter-slider-label{color:var(--ink)}html[data-lab-theme=light] .search-wrap input,html[data-lab-theme=light] .parameter-row select,html[data-lab-theme=light] .dialog-content textarea{background:#eef0f7;color:var(--ink)}
@media(min-width:1650px){.layout{grid-template-columns:320px minmax(0,1fr)}}
@media(max-width:1200px){.masthead{padding:0 15px;gap:14px}.wordmark{min-width:145px;padding-right:12px}.project-name h1{font-size:14px}.header-actions button{padding:5px 7px;font-size:9px}.layout{grid-template-columns:270px minmax(0,1fr)}.metric{padding:10px 13px}}
@media(max-width:850px){.project-name{display:none}.wordmark{flex:1}.layout{grid-template-columns:242px minmax(0,1fr)}.scene-top{left:14px;right:10px}.scene-top>div:first-child{max-width:48%}.scene-buttons{flex-wrap:wrap;max-width:185px;justify-content:flex-end}.scene-legend{left:14px;top:85px;gap:8px;flex-wrap:wrap;max-width:85%}.analysis-deck{grid-template-columns:minmax(0,1fr)}.audit-card{display:none}.selection-badge{top:127px}.metric-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.metric strong{font-size:18px}.metric{padding:8px 12px}.metric:nth-child(n+3){display:none}}
@media(max-width:600px){.masthead{height:60px}.layout{height:calc(100dvh - 60px);grid-template-columns:200px minmax(0,1fr)}.brand-copy{display:none}.wordmark{min-width:30px;flex:0;border:0}.header-actions{margin-left:auto}.header-actions #save-experiment,.header-actions #load-experiment{display:none}.scene-top>div:first-child{display:none}.scene-buttons{max-width:none}.scene-top{justify-content:flex-end}.scene-legend{top:69px}.selection-badge{display:none!important}.scene-bottom span:first-child{display:none}.light-shapes{grid-template-columns:repeat(2,1fr)}.light-show-head small{display:none}}
@media(prefers-reduced-motion:reduce){button{transition:none}}

/* Mobile header containment: keep Reset fully above the viewport. */
@media(max-width:600px){.masthead{flex-wrap:nowrap;min-height:60px;height:60px;padding:8px 14px;gap:10px}.header-actions{width:auto;border-top:0;padding-top:0;gap:5px}.wordmark{padding:0;gap:6px}.header-actions #reset-defaults{font-size:10px;padding:7px 10px}}

/* Full-stage refinement: presentation only. Signals never controls transport. */
#show-signals{display:none}body.show-view #show-signals{display:block}body.show-view .masthead{display:none}body.show-view .layout{height:100dvh}body.show-view .scene-legend{display:none}body.show-view.show-signals .scene-legend{display:flex}
@media(max-width:600px){body.show-view .layout{height:100dvh}body.show-view .scene-buttons{max-width:100%;gap:4px}body.show-view .scene-buttons button{font-size:9px;padding:5px}body.show-view .scene-bottom{left:12px;right:12px}}

#mobile-controls{display:none}@media(max-width:600px){#mobile-controls{display:block}.layout{grid-template-columns:minmax(0,1fr)}.controls{display:none;position:absolute;top:60px;bottom:0;left:0;width:min(330px,92vw);z-index:10;box-shadow:12px 0 35px #0009}body.controls-open:not(.show-view) .controls{display:flex}.header-actions #mobile-controls{font-size:9px;padding:5px}.scene-legend{max-width:95%}}

/* Engineering citations, one modal per paper, and high-contrast theorem-boundary warnings. */
.sources-dialog p.source-boundary{display:block!important;background:#17263b!important;color:#e9f0fa!important;border-left:3px solid #f2be7c!important;padding:13px 15px!important;border-radius:4px!important;line-height:1.65!important}
.sources-dialog p.source-boundary strong{color:#ffe0ac!important}
.sources-dialog p.source-boundary em{color:#e9f0fa!important}
.sources-dialog .ieee-sources>li{display:flex;gap:12px;padding:11px 0;margin:0;border-bottom:1px solid #333a5466}
.sources-dialog .ieee-sources>li>span{flex:0 0 31px;color:#8bdff4}
.sources-dialog .paper-citation-text{flex:1;min-width:0;font-size:12px;line-height:1.55}
.sources-dialog button.paper-audit-open{margin:4px 9px;padding:4px 8px;min-height:28px;color:#d4f1ff;background:#172d46;border:1px solid #5793b7;font-size:11px}
.sources-dialog button.paper-audit-open:hover{color:#fff;background:#264866}
.paper-coverage{display:block;margin-top:3px;color:#a4bfd2;font-size:10px}.paper-coverage.missing{color:#ffb5af}.paper-coverage.partial{color:#f1d28d}.paper-coverage.covered{color:#a1e1d2}
.paper-audit-dialog .dialog-head h2{font-size:16px;line-height:1.35}
.paper-audit-dialog .dialog-content{color:#e0e9f8;font-size:12px;line-height:1.65}
.paper-audit-dialog .dialog-content p{margin:5px 0 14px}
.paper-audit-dialog .dialog-content h3{font-size:12px;color:#b7dff2;margin:16px 0 5px}
.paper-audit-dialog .paper-audit-status{color:#bee7da;font-weight:700}
.paper-audit-dialog .paper-latex-panel{overflow-x:auto;background:#121d31;border:1px solid #3b526d;border-radius:5px;padding:14px 12px;margin:14px 0}
.paper-audit-dialog .paper-latex{display:block;color:#edf5ff;font:12px/1.7 Consolas,ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.paper-audit-dialog .katex{font-size:1.15em}
.paper-audit-dialog .paper-audit-code{font:11px/1.6 Consolas,ui-monospace,monospace;color:#a4e4f4}
.sources-dialog .paper-external-references{font-size:11px;color:#b6c9dd;line-height:1.6;margin:14px 0}
@media(max-width:640px){.sources-dialog .ieee-sources>li{gap:5px}.paper-audit-dialog .dialog-content{font-size:11px}}
/* Keep every mobile header action available, below the complete brand lockup. */
@media(max-width:600px){.masthead{flex-wrap:wrap;align-content:center;min-height:96px;height:96px;gap:6px;padding:6px 12px}.masthead .header-actions{width:100%;margin-left:0;justify-content:flex-end;flex-wrap:wrap;gap:4px}.masthead .header-actions button{font-size:8px;padding:4px 5px}.masthead .header-actions #mobile-controls{font-size:8px;padding:4px 5px}.layout{height:calc(100dvh - 96px)}.controls{top:96px}body.show-view .layout{height:100dvh}}
