/* V81 theme-contrast guardrails. Scoped, keep success/error states and feature gradients. */
:root{--pf81-text:#17283e;--pf81-sub:#475569;--pf81-paper:#ffffff;--pf81-field:#f8fafc;--pf81-line:#cbd5e1;--pf81-link:#1d4ed8}
:root[data-pf-theme="dark"]{--pf81-text:#f1f5f9;--pf81-sub:#cbd5e1;--pf81-paper:#1e293b;--pf81-field:#101b2c;--pf81-line:#475569;--pf81-link:#93c5fd}
/* Content and cards built with static legacy white-on-white and dark-on-dark colors. */
:root[data-pf-theme="dark"] :is(#page-cms,#page-profile,#page-shadowing,#page-dictation,#page-grammar,#page-alphabet,#page-listening,#page-chunking,#page-numbers,#page-counting) :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select):not(.is-success):not(.is-error){color:var(--pf81-text)!important;caret-color:var(--pf81-text)!important}
:root:not([data-pf-theme="dark"]) :is(#page-cms,#page-profile,#page-shadowing,#page-dictation,#page-grammar,#page-alphabet,#page-listening,#page-chunking,#page-numbers,#page-counting) :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select):not(.is-success):not(.is-error){color:#17283e!important;caret-color:#17283e!important}
:root[data-pf-theme="dark"] :is(#page-cms,#page-profile,#page-shadowing,#page-dictation,#page-grammar,#page-alphabet,#page-listening,#page-chunking,#page-numbers,#page-counting) :is(input,textarea)::placeholder{color:#b3c3d9!important;opacity:1}
:root:not([data-pf-theme="dark"]) :is(#page-cms,#page-profile,#page-shadowing,#page-dictation,#page-grammar,#page-alphabet,#page-listening,#page-chunking,#page-numbers,#page-counting) :is(input,textarea)::placeholder{color:#64748b!important;opacity:1}
/* Known mismatches: light inline text forced onto dark panels; light-profile button in dark mode. */
:root[data-pf-theme="dark"] #page-profile .pf-profile-identity .pf-outline{color:#e2e8f0!important;background:#25344a!important;border-color:#586b84!important}
:root[data-pf-theme="dark"] #page-chunking #chunk-workspace:not(.hidden) .pf-ls-sessionbar{color:#e2e8f0!important;background:#1e293b!important;border-color:#475569!important}
:root[data-pf-theme="dark"] #page-pronunciation #expected-text{color:#f1f5f9!important;background:#26364e!important;border-color:#526785!important}
:root[data-pf-theme="dark"] #page-pronunciation #expected-text::placeholder{color:#b5c5df!important}
:root:not([data-pf-theme="dark"]) #page-pronunciation #expected-text{color:#17283e!important;background:#f8fafc!important}
/* CMS diagnostics have explicit readable surfaces in both modes. */
#page-cms .pfc-publication-diagnostics{margin:14px 0;padding:16px;border:1px solid var(--pf81-line);border-radius:16px;background:var(--pf81-paper);color:var(--pf81-text)}
#page-cms .pfc-publication-diagnostics[hidden]{display:none!important}
#page-cms .pfc-diagnostic-row{display:grid;gap:4px;padding:10px 0;border-bottom:1px solid var(--pf81-line)}
#page-cms .pfc-diagnostic-row small{color:var(--pf81-sub);line-height:1.5}
#page-cms .pfc-video-tools button{min-height:40px}
/* Static contrast-audit findings: labels, status text and active controls. */
#page-grammar .pf-grammar-primary{background:#087356!important;color:#fff!important}
#page-grammar .pf-grammar-card-number{color:#08664f!important}
#page-grammar .pf-grammar-subtopic-number{color:#086b55!important}
#page-shadowing .pf62-open-add span{color:#075e50!important}
#page-listening .contrast-lesson-item .lesson-order{color:#075c91!important}
#page-listening .contrast-lesson-item.is-active .lesson-order{background:#075c91!important;color:#fff!important}
#page-chunking .pf95-heard-phone.low{color:#4b5563!important}
#page-lessons .pf-directory-search kbd{color:#475569!important}
#page-lessons .pf-academic-favorite:hover{color:#1742a2!important}
#page-vocabulary .pf-d4-results-icon{color:#065b63!important}
#page-chunking .pf-chunk-subtab.active{background:#056f51!important;color:#fff!important}
#page-chunking .pf-chunk-btn.pf-primary{background:#075f48!important;color:#fff!important}
:root[data-pf-theme="dark"] #page-chunking .pf95-heard-phone.low{color:#cbd5e1!important}
:root[data-pf-theme="dark"] #page-listening .contrast-lesson-item .lesson-order{color:#93c5fd!important}
:root[data-pf-theme="dark"] #page-lessons .pf-directory-search kbd{color:#cbd5e1!important}
:root[data-pf-theme="dark"] #page-vocabulary .pf-d4-results-icon{color:#67e8f9!important}
:root[data-pf-theme="dark"] #page-grammar .pf-grammar-primary{background:#087356!important;color:#fff!important}
:root[data-pf-theme="dark"] #page-grammar :is(.pf-grammar-card-number,.pf-grammar-subtopic-number){color:#a7f3d0!important}
