/* Keep dark surfaces and foregrounds paired; do not reuse text color for headers. */
html[data-theme="dark"]{color-scheme:dark;--bg:#15221f;--card:#20332e;--ink:#ecf4ec;--soft:#304b41;--muted:#bfd0c6;--accent:#9bd5bc;--cream:#15221f;--line:#527366}
html[data-theme="dark"] body{background:var(--bg)!important;color:var(--ink)!important}
html[data-theme="dark"] main{background:transparent!important;color:var(--ink)!important}
html[data-theme="dark"] header{background:#173e3b!important;color:#fff!important}
html[data-theme="dark"] header :is(h1,p,.eyebrow,a){color:#f3faf6!important}
html[data-theme="dark"] header h1 span{color:#e9bd76!important}
html[data-theme="dark"] :is(.card,.lesson,.panel,details,.top,.example,.bottom,.bar,.status,select,input,textarea){background:var(--card)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#b2c7bd;opacity:1}
html[data-theme="dark"] :is(.word,.lesson h2,.lesson h3){color:#a8dec5!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.meaning,.example-th,.phrase strong,#flashFace){color:var(--ink)!important}
html[data-theme="dark"] :is(.pron,.note,.count,.meta,.id,.number,.sub,.source,.example-label,.example-vi,footer,small,#count){color:var(--muted)!important;border-color:var(--line)!important}
html[data-theme="dark"] .pill{color:#e4c58e}
html[data-theme="dark"] a{color:var(--accent)!important}
html[data-theme="dark"] :is(.nav a,.toc a,.guide-toc a,.back,.qq-tools a,.qq-srs-link,.learn nav a){background:var(--soft)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] a[style*=background]{background:var(--soft)!important;color:var(--ink)!important}
html[data-theme="dark"] .tabs a{background:#304b41!important;color:#ecf4ec!important}
html[data-theme="dark"] .tabs a[aria-current]{background:var(--card)!important;color:#b7ebd2!important;box-shadow:inset 0 -3px #9bd5bc}
html[data-theme="dark"] :is(button,.learn a.btn){background:#337764;color:#fff}
html[data-theme="dark"] .learn a.btn{color:#fff!important}
html[data-theme="dark"] :is(.quiet,.sound,.qq-tools button){background:var(--soft)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .sound.playing{background:#337764!important;color:#fff!important}
html[data-theme="dark"] :is(.listen,.qq-recorder,.feedback,.answer,.learn .stats div,#audioStatus,#learnStatus,#status){background:var(--soft)!important;color:var(--ink)!important}
html[data-theme="dark"] #status{color:var(--ink)!important}
html[data-theme="dark"] .flash-card{background:var(--card)!important;color:var(--ink)!important;border-color:#80ad98!important}
html[data-theme="dark"] .flash-card[aria-pressed="true"]{background:#49412b!important;border-color:#d3b775!important}
html[data-theme="dark"] .usage{background:#403b2b;color:#fff0cb}
html[data-theme="dark"] .symbol{background:#304b41}
html[data-theme="dark"] :is(.qq-ex,.phrase,.progress-row,td,th){border-color:var(--line)!important}
html[data-theme="dark"] :is(.learn .choices button,.learn .match button){background:var(--soft);color:var(--ink);opacity:1}
html[data-theme="dark"] .learn .choices button.correct{background:#234c37;color:#d9ffe6;border-color:#85d9a4;opacity:1}
html[data-theme="dark"] .learn .choices button.wrong{background:#5d2d30;color:#ffe5e3;border-color:#efa3a1;opacity:1}
html[data-theme="dark"] .learn .match button.matched{background:#234c37;color:#d9ffe6;opacity:1;box-shadow:inset 0 0 0 2px #85d9a4}
html[data-theme="dark"] :is(button,a,input,select,textarea):focus-visible{outline-color:#edc474}
/* Illustrations retain their original colors and are never inverted. */

