/* Contrast safety layer. No global body text-color assignment. */
:root{
  --contrast-ink:#142832;
  --contrast-muted:#4f626b;
  --contrast-paper:#fff;
  --contrast-dark:#0d2934;
  --contrast-gold:#c49a4c;
}
html,body{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
input,textarea,select{background:#fff!important;color:#142832!important;caret-color:#142832!important;border-color:#7d9098!important}
input::placeholder,textarea::placeholder{color:#52666f!important;opacity:1!important}
select option{background:#fff!important;color:#142832!important}
button:disabled,.btn:disabled,.teacherBtn:disabled,[aria-disabled="true"]{background:#d9dfdf!important;color:#354850!important;border-color:#8d9ca2!important;opacity:1!important}
th,thead th{background:#0d2934!important;color:#fff!important}
td{color:#142832}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:3px solid #d5a84f!important;outline-offset:3px!important}
[data-contrast-fixed="light"]{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.98),0 0 8px rgba(0,0,0,.7)!important}
[data-contrast-fixed="dark"]{color:#102832!important;text-shadow:none!important}
[data-contrast-image="true"]{color:#fff!important;background:rgba(5,22,30,.72)!important;box-decoration-break:clone;-webkit-box-decoration-break:clone;padding:.08em .24em;text-shadow:0 1px 2px #000!important}

/* Homepage dark surfaces */
body:has(#examinations) .topbar,body:has(#examinations) .brandName,body:has(#examinations) .nav a,body:has(#examinations) .hero,body:has(#examinations) .hero h1,body:has(#examinations) .hero h1 em,body:has(#examinations) .metaItem strong,body:has(#examinations) .sectionHeading h2,body:has(#examinations) .examCard h3,body:has(#examinations) .examCard .cardLink,body:has(#examinations) footer{color:#f8fbfc!important}
body:has(#examinations) .brandName small,body:has(#examinations) .heroLead,body:has(#examinations) .metaItem span,body:has(#examinations) .sectionHeading p,body:has(#examinations) .examCard p{color:#d8e4e8!important}
body:has(#examinations) .sectionHeading .number,body:has(#examinations) .eyebrow,body:has(#examinations) .photoCaption span{color:#efd9a5!important}
body:has(#examinations) .examIndex{color:#c8d6da!important}
body:has(#examinations) .examCard{isolation:isolate}
body:has(#examinations) .examCard::after{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;background:linear-gradient(180deg,rgba(3,15,22,.16) 0%,rgba(3,15,22,.48) 50%,rgba(3,15,22,.78) 100%)}
body:has(#examinations) .examCard>*{position:relative;z-index:2}
body:has(#examinations) .authorPanel,body:has(#examinations) .authorPanel h2,body:has(#examinations) .authorPanel h3,body:has(#examinations) .authorPanel p,body:has(#examinations) .authorPanel a{color:#142832!important;text-shadow:none!important}

/* Login, About, exam and report light surfaces */
.loginCard,.loginCard h1,.loginCard h2,.loginCard h3,.loginCard p,.loginCard label,.heroCopy,.heroCopy h1,.heroCopy h2,.heroCopy h3,.heroCopy p,.section,.section h2,.section h3,.section p,.infoCard,.infoCard h3,.infoCard p,.panel,.card,.skillCard,.qbox,.questionPane,.passagePane,.passage,.examCard,.centerbox,.reportItem,.teacherSection,.teacherInfo,.teacherStat,.teacherTableWrap,.teacherDetailBody,.teacherWork,.teacherObjectiveTable{color:#142832}
.brandPanel,.brandPanel h1,.brandPanel h2,.brandPanel h3,.brandPanel p,.topbar,.topbar h1,.topbar h2,.topbar h3,.topbar a,.photoCaption,.photoCaption strong{color:#fff}
.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,.card h1,.card h2,.card h3,.card h4,.card h5,.qbox h1,.qbox h2,.qbox h3,.qbox h4,.questionPane h1,.questionPane h2,.questionPane h3,.passagePane h1,.passagePane h2,.passagePane h3{color:#102d38}
.notice:not(.teacherHero):not(.teacherDetailHead),.sectionMeta,.small,.helpText,.helperText,.dashboardIntro{color:#455b65}
.timerbox,.webcamBox,.teacherHero,.teacherDetailHead,.integrityPanel.alert,.integrityPanel.flagged,.examTop,.dark,.darkPanel,[class*="darkPanel"],[class*="dark-panel"]{color:#fff}
.timerbox *,.webcamBox *,.teacherHero *,.teacherDetailHead *,.integrityPanel.alert *,.integrityPanel.flagged *,.examTop *,.dark *,.darkPanel *,[class*="darkPanel"] *,[class*="dark-panel"] *{color:inherit}
.qItem.current,.qItem.current *,.statusPill.alert,.statusPill.alert *{color:#fff!important}
.qItem.done,.qItem.done *{color:#15583d!important}
button:not(.secondary):not(.danger):not(:disabled),.btn:not(.secondary):not(.danger):not(:disabled),.teacherBtn:not(.secondary):not(.danger):not(:disabled){color:#fff}
.primaryBtn,.primaryBtn *{color:#142832!important}
button.secondary,.btn.secondary{background:#fff;color:#0f4f5b}
button.danger,.btn.danger,.teacherBtn.danger{color:#711f1f}
.warnBox,.warning,.alert-warning,.teacherWorkWarning{background:#fff2c8!important;color:#513900!important;border-color:#a87914!important}
.goodBox,.success,.alert-success{background:#e2f3e9!important;color:#103e2c!important;border-color:#3c7c61!important}
.error,.alert-error,.dangerBox{background:#f7e2e2!important;color:#671c1c!important;border-color:#a44848!important}
#teacherManagementPanel,.teacherDetailCard{color:#142832}
.teacherTable td,.teacherTable small,.teacherObjectiveTable td{color:#203842!important}
.teacherMonitoringItem,.teacherObjectiveSummary>div,.teacherStat,.teacherInfo{background:#f7f3ea;color:#142832}
.teacherMonitoringItem strong,.teacherObjectiveSummary strong,.teacherStat strong,.teacherInfo strong{color:#102d38!important}
.teacherMonitoringItem span,.teacherObjectiveSummary span,.teacherStat span,.teacherInfo span{color:#4d626b!important}
.teacherAnswerStatus.correct{background:#e2f2e9!important;color:#174b36!important}
.teacherAnswerStatus.incorrect{background:#f8e4e4!important;color:#731f1f!important}
.teacherAnswerStatus.unanswered{background:#fff2cc!important;color:#5f4400!important}
.cardLink.disabled,button:disabled *,[aria-disabled="true"] *{color:#43555d!important;text-shadow:none!important}
@media(forced-colors:active){*{forced-color-adjust:auto}}
@media print{[data-contrast-image="true"]{background:transparent!important;color:#000!important;text-shadow:none!important}}


/* Teacher controls use context-specific contrast, not one secondary-button color. */
#teacherDetail .teacherSection .teacherBtn.secondary,
#teacherDetail .teacherSection .teacherBtn.secondary *{
  color:#102a34 !important;
}
#teacherDetail .teacherDetailHead .teacherBtn.secondary,
#teacherDetail .teacherDetailHead .teacherBtn.secondary *{
  color:#ffffff !important;
}
