/* Page-scoped light/dark parity for Number Library and Number Speaking.
   Pronunciation tokens are owned by the dedicated pronunciation-theme.css. */
:root:not([data-pf-theme="dark"]) #page-counting,
:root:not([data-pf-theme="dark"]) #page-numbers {
 --pf104-canvas:#f8fafc;--pf104-card:#fff;--pf104-raised:#f1f5fb;
 --pf104-border:#d6e2ef;--pf104-text:#16263f;--pf104-muted:#475d78;
 --pf104-accent:#2563eb;
 color:var(--pf104-text)!important;color-scheme:light;
}
:root[data-pf-theme="dark"] #page-counting,
:root[data-pf-theme="dark"] #page-numbers {
 --pf104-canvas:#0c0f20;--pf104-card:#1c213d;--pf104-raised:#252b48;
 --pf104-border:#2a2f4c;--pf104-text:#f3f5ff;--pf104-muted:#b4bfd6;
 --pf104-accent:#60a5fa;
 color:var(--pf104-text)!important;color-scheme:dark;
}
/* Dark card/heading copy. Do not tint controls representing correct/incorrect answers. */
:root[data-pf-theme="dark"] #page-counting :is(.pf-counting-head,.pf-counting-index,.pf-counting-workspace,.pf-counting-item,.pf-counting-ranges button:not(.is-active)) {
 background:var(--pf104-card)!important;border-color:var(--pf104-border)!important;color:var(--pf104-text)!important;
}
:root[data-pf-theme="dark"] #page-counting :is(.pf-counting-head h1,.pf-counting-section-head h2,.pf-counting-list-head h2,.pf-counting-select span,.pf-counting-ranges button strong) {color:var(--pf104-text)!important}
:root[data-pf-theme="dark"] #page-counting :is(.pf-counting-head p,.pf-counting-section-head>span,.pf-counting-ranges button>span,.pf-counting-ranges button>small,.pf-counting-source,.pf-counting-list-head p,.pf-counting-status,.pf-counting-lookup) {color:var(--pf104-muted)!important}
:root[data-pf-theme="dark"] #page-counting .pf-counting-item.is-selected,
:root[data-pf-theme="dark"] #page-counting .pf-counting-ranges button.is-active {background:#2a3356!important;border-color:#608ef5!important}
:root[data-pf-theme="dark"] #page-counting .pf-counting-select {color:var(--pf104-text)!important}
:root[data-pf-theme="dark"] #page-counting .pf-counting-select strong {color:#93c5fd!important}
:root[data-pf-theme="dark"] #page-counting :is(.pf-counting-voice,.pf-counting-more) {background:var(--pf104-raised)!important;border-color:var(--pf104-border)!important;color:#dbeafe!important}
:root[data-pf-theme="dark"] #page-counting .pf-counting-lookup input {background:var(--pf104-raised)!important;border-color:var(--pf104-border)!important;color:var(--pf104-text)!important}
/* Hero on Counting is intentionally a dark number billboard in both themes; it gets stable readable content. */
#page-counting .pf-counting-feature {background:#172b49!important;color:#fff!important}
#page-counting .pf-counting-feature :is(h2,strong) {color:#fff!important}
#page-counting .pf-counting-feature :is(p,small) {color:#c4d2e9!important}
#page-counting .pf-counting-feature-play {background:#fff!important;color:#172b49!important}
/* Number speaking: large panels previously inherited mixed hard-coded colors. */
:root[data-pf-theme="dark"] #page-numbers :is(.numbers-catalog,.numbers-exercise,.numbers-audio,.numbers-stage,.numbers-hint,.numbers-feedback,.numbers-speak-result,.numbers-stats>div,.numbers-writing-input,.numbers-lesson-item:not(.is-active),.numbers-mode button:not(.is-selected)) {
 background:var(--pf104-card)!important;border-color:var(--pf104-border)!important;color:var(--pf104-text)!important;
}
:root[data-pf-theme="dark"] #page-numbers :is(.numbers-heading-row h2,.numbers-stage h3,.numbers-catalog h2,.numbers-audio strong,.numbers-stats strong,.numbers-lesson-item strong,.numbers-feedback strong) {color:var(--pf104-text)!important}
:root[data-pf-theme="dark"] #page-numbers :is(.numbers-description,.numbers-catalog p,.numbers-audio p,.numbers-stage p,.numbers-stats small,.numbers-lesson-item small,.numbers-format-help,.numbers-library-status) {color:var(--pf104-muted)!important}
:root[data-pf-theme="dark"] #page-numbers :is(select,textarea,input:not([type="checkbox"]):not([type="radio"])) {background:var(--pf104-raised)!important;border-color:var(--pf104-border)!important;color:var(--pf104-text)!important}
:root:not([data-pf-theme="dark"]) #page-numbers :is(.numbers-catalog,.numbers-exercise,.numbers-audio,.numbers-stage,.numbers-hint,.numbers-stats>div,.numbers-writing-input) {
 background:var(--pf104-card)!important;border-color:var(--pf104-border)!important;color:var(--pf104-text)!important;
}
:root:not([data-pf-theme="dark"]) #page-numbers :is(.numbers-heading-row h2,.numbers-stage h3,.numbers-catalog h2,.numbers-stats strong) {color:var(--pf104-text)!important}
:root:not([data-pf-theme="dark"]) #page-numbers :is(.numbers-stage p,.numbers-audio p,.numbers-catalog p,.numbers-stats small) {color:var(--pf104-muted)!important}
/* Preserve button states and large action accent; only apply theme to neutral surfaces. */
@media(max-width:760px){#page-counting .pf-counting-layout{grid-template-columns:1fr!important}#page-counting .pf-counting-index{position:static!important}}
