/* V14.9 readability correction: preserve contrast by surface, both themes. */
@media screen {
html body :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.modal,.modal-body,.lti-partner-stat,.lti-qb-panel) {font-size:15px;line-height:1.55;}
html body :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.modal,.modal-body) :is(p,small,label,td,th,li,dd,dt,span) {font-size:max(14px,1em);line-height:1.5;}
html body :is(.page,.panel,.card,.modal) :is(h1,h2,h3,h4,strong,b) {font-weight:750;}
html body :is(.nav-item,.nav-label,.sidebar button,.sidebar a){font-size:13px!important;font-weight:700!important;line-height:1.4!important;}
html body :is(button,.btn,input,textarea,select){font-size:14px;font-weight:650;}
/* V14.8 mixed white/navy cards inherited the wrong foreground. Correct by actual surface. */
html[data-lti-theme="dark"] :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.modal,.modal-body,.lti-qb-panel,.lti-partner-stat,.lti-v135-owner-actions) {background-color:#1b2b40!important;color:#f5f8fc!important;border-color:#71849c!important;}
html[data-lti-theme="dark"] :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.modal,.modal-body,.lti-qb-panel,.lti-partner-stat,.lti-v135-owner-actions) :is(h1,h2,h3,h4,h5,h6,p,small,strong,b,label,legend,span,td,th,li,dd,dt,.muted,.subtitle,.description,.eyebrow) {color:#f2f6fd!important;opacity:1!important;}
/* Elements whose inline/preset styling leaves a white or very pale surface. */
html[data-lti-theme="dark"] :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.lti-qb-panel) :is(.stat-card,.metric-card,.info-card,.lti-partner-stat,.lti-v135-warning,.lti-v135-cards>div,.lti-v135-owner-stat,.lti-owner-stat,.lti-owner-card,.lti-v135-dashboard-card) {background:#263c55!important;color:#f5f8fc!important;border-color:#71849c!important;}
html[data-lti-theme="dark"] :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.lti-qb-panel) :is(.stat-card,.metric-card,.info-card,.lti-partner-stat,.lti-v135-warning,.lti-v135-cards>div,.lti-v135-owner-stat,.lti-owner-stat,.lti-owner-card,.lti-v135-dashboard-card) :is(*:not(button):not(.btn):not(input):not(select):not(textarea):not(a)) {color:#f5f8fc!important;opacity:1!important;}
/* Any explicitly pale alert or summary surface must carry a dark foreground. */
html[data-lti-theme="dark"] :is(.lti-document-notice-box,.lti-research-warning) {background:#263c55!important;color:#f5f8fc!important;}
html[data-lti-theme="dark"] :is(.lti-document-notice-box,.lti-research-warning) :is(p,small,span,strong,b) {color:#f5f8fc!important;}
/* Owner overview tiles: eliminate the nearly-black totals on navy. */
html[data-lti-theme="dark"] #page-owner-dashboard :is(.stat-card,.metric-card,.info-card,.card,.panel) :is(strong,b,h2,h3,p,span,small,div:not([class])) {color:#f5f8fc!important;opacity:1!important;}
/* Light theme uses genuinely dark type on light surfaces. */
html[data-lti-theme="light"] :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.modal,.modal-body,.lti-qb-panel) :is(p,small,strong,b,label,legend,span,td,th,li,dd,dt,.muted,.subtitle,.description,.eyebrow) {color:#172b40!important;opacity:1!important;}
html[data-lti-theme="light"] :is(.page,.panel,.card,.stat-card,.metric-card,.info-card,.modal,.modal-body,.lti-qb-panel) :is(h1,h2,h3,h4,h5,h6) {color:#10253b!important;opacity:1!important;}
/* Preserve text on controls in either theme. */
html[data-lti-theme="dark"] :is(button,.btn,[role="button"]):not(.secondary) {color:#fff!important;}
html[data-lti-theme="dark"] :is(button.secondary,.btn.secondary) {background:#e4effc!important;color:#132a40!important;}
html[data-lti-theme="dark"] :is(button.secondary,.btn.secondary) * {color:#132a40!important;}
html[data-lti-theme="dark"] :is(button,.btn) :is(span,strong,small) {color:inherit!important;}
html[data-lti-theme="light"] :is(button,.btn) :is(span,strong,small) {color:inherit!important;}
html[data-lti-theme="dark"] :is(input,textarea,select){background:#263c55!important;color:#fff!important;border-color:#a2b3c8!important;}
html[data-lti-theme="dark"] :is(input,textarea)::placeholder{color:#d0ddec!important;}
html[data-lti-theme="dark"] :is(table,.data-table) :is(th,td){background:#23364d!important;color:#f5f8fc!important;font-size:14px!important;}
html[data-lti-theme="light"] :is(table,.data-table) :is(th,td){color:#172b40!important;font-size:14px!important;}
}
