/* Color roles shared by every topic and activity. */
:root{--surface:#fff;--surface-soft:#edf4ed;--surface-hover:#e0ecdc;--text:#173136;--text-secondary:#52666a;--action:#173136;--on-action:#fff}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 12px;font:inherit;font-size:14px;font-weight:550;white-space:nowrap;border:1px solid var(--line);border-radius:5px;color:var(--ink);background:var(--surface);cursor:pointer}.theme-toggle svg{width:18px;height:18px;flex-shrink:0}.theme-toggle:hover{background:var(--surface-hover)}
html[data-theme=dark]{color-scheme:dark;--ink:#e4eee8;--text:#e4eee8;--muted:#b4c8bd;--text-secondary:#b4c8bd;--paper:#111c1b;--surface:#1b2b28;--surface-soft:#21362e;--surface-hover:#2c4638;--line:#486357;--action:#c1f18a;--on-action:#122318;--success:#b8ecaa;--success-bg:#233d29;--error:#ffb9a9;--error-bg:#402722;--focus:#c1f18a;--focus-light:#c1f18a}
html[data-theme=dark] body{background:var(--paper);color:var(--ink)}
html[data-theme=dark] .brand-symbol{filter:brightness(0) invert(1)}
html[data-theme=dark] :is(.scope-hero-copy>p:not(.scope-hero-note),.scope-hero-note,.hero-photo figcaption,.production-scene>p,.home-section-heading>p,.topic-route>p,.hero-note,.eyebrow,.back,.lesson-number,.card-meta,.lesson-sidebar a span,.gear-option small,.chain-item-top p,.flow-direction,.lab-scope,#challenge-help,.teacher-plan>summary>span,.source-note,.demo-caption,.verified-date,.resource-note,#resource-count,.resource-category-label,.resource-price>span){color:var(--muted)}
html[data-theme=dark] :is(.search,.course,.document,.quiz label,.gear-option,.chain-item,.chain-feedback,.demo-result,.sound-menu,.lighting-feedback,.address-map span,.show-order>li,.theme-toggle,.skip){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.intro-strip,.document-tools,.tip,.practice,.teach-note,.signal-lab,.mini-lab,.teacher-intro,.local-notice,.course-complete,.lighting-demo,.temperature-demo,.address-lab,.face-preview,.topic-spotlight,.venue-demo,.run-show-lab,.run-summary,.concert-checklist label,.resource-start,.resource-details){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.primary,.filter.active,.lab-button){background:var(--action);color:var(--on-action);border-color:var(--action)}
html[data-theme=dark] :is(.primary:hover,.lab-button:hover){background:#d5f7ae;color:var(--on-action)}
html[data-theme=dark] :is(.lab-button.secondary,.chain-controls button){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.lab-button.secondary:hover,.chain-controls button:hover,.gear-option:hover,.course:hover,.filter:hover:not(.active),.lesson-sidebar a:hover,.topic-route:hover){background:var(--surface-hover);color:var(--ink);border-color:#86ae91}
html[data-theme=dark] :is(.lesson-sidebar a[aria-current],.tab[aria-selected=true],.header nav .sound-menu a:hover,.header nav a[aria-current=page],.quiz label:has(input:checked),.resource-entry:target){background:var(--surface-hover);color:var(--ink);border-color:#86ae91}
html[data-theme=dark] :is(.header nav a:hover,.text-link:hover,.hero h1 em,.cable-diagram){color:#c1f18a}
html[data-theme=dark] :is(input,select,textarea){color:var(--ink);caret-color:var(--green);accent-color:var(--green)}
html[data-theme=dark] :is(.teacher-search input,.signal-lab select,.address-controls input,.address-controls select,.run-show-top input,.act-inputs input,.act-inputs select,.show-add select,.resource-tools input[type=search],.resource-tools select){background-color:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.signal-lab select,.address-controls select,.act-inputs select,.show-add select,.resource-tools select){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23e4eee8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E")}
html[data-theme=dark] input::placeholder{color:var(--muted);opacity:1}
html[data-theme=dark] .search input{background:transparent;color:var(--ink)}
html[data-theme=dark] .quick-add{background:var(--surface-soft);border-color:var(--line)}
html[data-theme=dark] #chain-empty{background:var(--surface);border-color:var(--line)}
html[data-theme=dark] .reference-table thead th{background:#2c4638}
html[data-theme=dark] .reference-table tbody th{background:var(--surface-soft)}
html[data-theme=dark] :is(.reference-table th,.reference-table td,.doc-top,.teacher-plan,.topic-routes,.topic-route,.lab-explainer){border-color:var(--line)}
html[data-theme=dark] :is(.chain-feedback.success,.quiz-feedback.correct){color:var(--success)}
html[data-theme=dark] .chain-feedback.success{background:var(--success-bg);border-color:#86ae91}
html[data-theme=dark] :is(.chain-error,.show-order>li.setup-short,.address-error){background:var(--error-bg);color:var(--error);border-color:var(--error)}
html[data-theme=dark] .address-map .slot-a{background:#2e482b;border-color:#91b779}
html[data-theme=dark] .address-map .slot-b{background:#253f49;border-color:#85b7c7}
html[data-theme=dark] .address-map .slot-overlap{background:var(--error-bg);color:var(--error);border-color:var(--error)}
/* Preserve the intended colors of stage, Kelvin and sound-console illustrations. */
html[data-theme=dark] :is(.home-practice,.console-art,.dmx-path,.venue-map){color:#edf3e8}
html[data-theme=dark] .service{background:#173136;color:#edf3e8}
html[data-theme=dark] .console-art{box-shadow:0 14px 28px #0004}
html[data-theme=dark] ::selection{background:#c1f18a;color:#122318}
@media(max-width:760px){.header nav{flex-wrap:wrap}.theme-toggle{font-size:14px;min-height:44px}}
@media print{.theme-toggle{display:none}html[data-theme=dark]{--ink:#173136;--muted:#52666a;--paper:#fff;--line:#b7cbbc;--surface:#fff;--surface-soft:#fff;--error:#8b352c;--error-bg:#fff;--success:#285637;--success-bg:#fff}html[data-theme=dark] .brand-symbol{filter:none}html[data-theme=dark] body{background:#fff;color:#173136}html[data-theme=dark] :is(.document,.reference-table th,.reference-table td,.local-notice,.teacher-intro,.course-complete,.practice,.teach-note){background:#fff;color:#173136}}
@media print{html[data-theme=dark] :is(.home-practice,.service,.dmx-path){background:#fff;color:#173136}html[data-theme=dark] :is(.home-practice p,.home-practice-links p,.service-links p,.service-links b,.service-links a>span,.service>div>p:last-child){color:#173136}}
