/* Theme-aware component exceptions and appearance controls. No chapter colour rules. */
html[data-theme] body{background:var(--theme-bg);color:var(--theme-ink)}
html[data-theme] .site-header{background:color-mix(in srgb,var(--theme-bg) 95%,transparent)}
html[data-theme] .brand-word{color:var(--theme-ink)}
html[data-theme] .brand-word-em,html[data-theme] .footer-brand>span{color:var(--theme-accent)}
html[data-theme] .hero{background:var(--theme-hero);border-color:var(--theme-hero)}
html[data-theme] .hero::before{background:linear-gradient(115deg,var(--theme-hero),color-mix(in srgb,var(--theme-hero) 85%,black))}
html[data-theme] .hero .hero-title-first,html[data-theme] .hero .hero-tagline{color:var(--theme-hero-ink)}
html[data-theme] .hero .hero-title .hero-title-second,html[data-theme] .hero .hero-mini strong{color:var(--theme-gold)}
html[data-theme] .hero .hero-title .hero-title-check{color:var(--theme-gold)!important}
html[data-theme] .hero .hero-description,html[data-theme] .hero .eyebrow{color:var(--theme-hero-muted)}
html[data-theme] .choice-board{background:var(--theme-surface);border-color:var(--theme-border)}
html[data-theme] .choice-board-title{color:var(--theme-ink)}
html[data-theme] .choice-board-title span{color:var(--theme-accent)}
html[data-theme] .choice-board-option{background:var(--theme-surface);color:var(--theme-muted)}
html[data-theme] .choice-board-option.is-picked{background:var(--theme-soft);color:var(--theme-ink);border-color:var(--theme-accent)}
html[data-theme] .choice-board-option b{background:var(--theme-quiet);color:var(--theme-ink)}
html[data-theme] .choice-board-option.is-picked b{background:var(--theme-accent);color:var(--theme-on-accent)}
html[data-theme] .choice-picked-icon{color:var(--theme-accent)}
html[data-theme] .btn-primary,html[data-theme] .exam-question-map button.is-answered,html[data-theme] .exam-answer-button.is-selected .answer-letter{color:var(--theme-on-accent);background:var(--theme-accent);border-color:var(--theme-accent)}
html[data-theme] .btn-primary:hover{background:var(--theme-accent-hover);border-color:var(--theme-accent-hover)}
html[data-theme] .hero-actions .btn-primary{background:var(--theme-gold);border-color:var(--theme-gold);color:var(--theme-gold-ink)}
html[data-theme] .hero-actions .btn-light{color:var(--theme-hero-ink);background:transparent}
html[data-theme] .exam-answer-button.is-selected{background:var(--theme-soft);border-color:var(--theme-accent);box-shadow:inset 0 0 0 1px var(--theme-accent)}
html[data-theme] :is(input,textarea,select)::placeholder{color:var(--theme-muted);opacity:1}
html[data-theme] :focus-visible{outline-color:var(--theme-accent)}
html[data-theme] .negative-word{background:var(--state-warning-bg);color:var(--state-warning)}
html[data-theme] .teacher-module{--module-ink:var(--state-warning);--module-edge:var(--state-warning-border);--module-base:var(--state-warning-bg)}
html[data-theme] .teacher-module--results{--module-ink:var(--theme-accent);--module-edge:var(--theme-control);--module-base:var(--theme-soft)}
html[data-theme] :is(.teacher-module-icon,.teacher-module-toggle){background:var(--theme-surface)}
html[data-theme] .teacher-module-heading small{opacity:1}
html[data-theme] .exam-image-preview{background:var(--theme-quiet)}
html[data-theme] .exam-image-preview canvas{background:var(--print-paper)}
html[data-theme] dialog[class]::backdrop{background:rgb(8 18 16 / .65)}
html[data-theme] .hero::after{content:none;display:none}
.theme-settings{min-width:0;padding:0 0 22px;margin:24px 0 0;border:0;border-bottom:1px solid var(--theme-border)}
.theme-settings legend{font-weight:800;font-size:15px;color:var(--theme-ink);padding:0;margin-bottom:12px}
.theme-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.theme-option{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:89px;min-width:0;padding:12px 4px;border:1px solid var(--theme-control);border-radius:10px;color:var(--theme-ink);background:var(--theme-surface);cursor:pointer;font-size:12px;font-weight:750}
.theme-option input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.theme-option:has(input:checked){background:var(--theme-soft);border:2px solid var(--theme-accent);padding:11px 3px}
.theme-option:has(input:checked)::after{content:'✓';position:absolute;top:3px;right:5px;color:var(--theme-accent);font-size:12px;font-weight:900}
.theme-option:has(input:focus-visible){outline:3px solid var(--theme-accent);outline-offset:3px}
.theme-option:hover{background:var(--theme-hover)}
.theme-swatch{display:grid;place-items:center;width:27px;height:27px;border-radius:50%;border:2px solid #ffffff;box-shadow:0 0 0 1px #718177;color:#ffffff;font-size:20px;line-height:1}
.theme-swatch--green{background:#205f49}
.theme-swatch--blue{background:#255e9c}
.theme-swatch--orange{background:#985021}
.theme-swatch--purple{background:#734a96}
.theme-swatch--night{background:#172126}
.theme-status{margin-top:12px;color:var(--theme-muted);font-size:12px;line-height:1.6}
@media(max-width:375px){
.theme-options{gap:5px}
.theme-option{font-size:11px;min-height:84px}
}
@media print{
html[data-theme] body{background:var(--print-paper);color:var(--print-ink)}
html[data-theme] .exam-image-preview{background:var(--print-paper)}
}
