/* Night mode colors the interface while keeping instructional models on a light canvas. */
html[data-theme="dark"] {
 color-scheme: dark;
 --cream: #101a27;
 --ink: #f2f6f6;
 --muted: #b5c7ce;
 --green: #94e0ce;
 --line: #395164;
 --orange: #ffb18a;
 --night-panel: #192839;
 --night-raised: #23364a;
}
[data-theme="dark"] :is(#app > header,.journey,.world-card,.lesson-row,.teaching-card,.question-card,.hint-panel,.result-stats > div,.report-table,.film-card,.domain-card,.explorer-entry form,.explorer-card,.island-worlds button,dialog#modal:not(.rescue-modal)) {
 background:var(--night-panel);
 border-color:var(--line);
}
[data-theme="dark"] :is(.feature-card,.small-card,.check-card,.try-card,.lesson-mission,.pill,.lesson-num,.buddy-bubble,.choice,.choice > span,.secondary,.round-icon,nav button.active) {
 background:var(--night-raised);
 color:var(--ink);
 border-color:var(--line);
}
[data-theme="dark"] :is(.eyebrow,.brand small,.feature-card p,.small-card small,.island-heading p,.hint-panel small,.film-card > p,footer,#hint-text) {
 color:var(--muted);
}
[data-theme="dark"] :is(.text-button,.domain-card strong,.mini-label,nav button.active) {color:var(--green)}
[data-theme="dark"] :is(.primary,.primary:hover) {background:#91dec9;color:#102b32;box-shadow:0 4px 0 #457c73}
[data-theme="dark"] :is(.primary,.secondary,.choice,button,a,input,select):focus-visible {outline-color:#ffc38a}
[data-theme="dark"] .choice:hover:not(:disabled) {background:#304a5d;border-color:#94e0ce}
[data-theme="dark"] :is(.choice.right,.feedback.success) {background:#183e35;border-color:#71c6a0;color:#e4fff2}
[data-theme="dark"] :is(.choice.wrong,.feedback.support) {background:#4b302b;border-color:#e4a484;color:#fff0e1}
[data-theme="dark"] :is(.journey-track,.mini-track,.session-track) {background:#344b5e}
[data-theme="dark"] :is(input,select) {background:#142232;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .avatar-choices label:has(input:checked) {background:#24483e;border-color:#7fceba;box-shadow:0 0 0 2px #7fceba}
[data-theme="dark"] :is(.buddy-actions button,.buddy-actions button:nth-child(n)) {background:#284052;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(.worked-example,#visual-model:not([hidden]),.tool-board) {
 background:#f3f6ed;
 color:#183e43;
 --ink:#183e43;
 --muted:#496261;
 --green:#106a62;
}
[data-theme="dark"] #visual-model:not([hidden]) {border-radius:14px;padding:12px;margin-block:12px}
[data-theme="dark"] :is(.island-tools button,.island-instruction) {color:#183e43}
[data-theme="dark"] .island-worlds button span {background:#304a5d;color:#d7f3ef}
[data-theme="dark"] .explorer-entry #explorer-error {color:#ffc0ae}
.appearance-switch {min-height:44px;margin-block:10px}
