/* V15.4 cross-role contrast correction. Loaded after all legacy theme rules.
   Keep original dark panels dark; give intentionally light surfaces dark ink. */
html[data-lti-theme="dark"] body :is(.page,.panel,.card,.modal,.modal-body) :is([style*="background:#fff"],[style*="background: #fff"],[style*="background:#f"],[style*="background: #f"],[style*="background-color:#fff"],[style*="background-color: #fff"],[style*="background-color:#f"],[style*="background-color: #f"]) {color:#142d44!important}
html[data-lti-theme="dark"] body :is(.page,.panel,.card,.modal,.modal-body) :is([style*="background:#fff"],[style*="background: #fff"],[style*="background:#f"],[style*="background: #f"],[style*="background-color:#fff"],[style*="background-color: #fff"],[style*="background-color:#f"],[style*="background-color: #f"]) :is(h1,h2,h3,h4,h5,h6,p,small,strong,b,span,label,li,div:not([class]),.muted,.subtitle,.description){color:#142d44!important;opacity:1!important}
/* Status pills and tabs: explicit high-contrast palettes instead of white-on-pale. */
html[data-lti-theme="dark"] body :is(.status,.status-badge,.status-pill,.badge,.pill,[class*="status-badge"],[class*="status-pill"],[class$="-status"],[class^="status-"]):not(input):not(select):not(textarea){color:#122b43!important;background-color:#dceaf4!important;border-color:#8baac1!important;opacity:1!important;text-shadow:none!important}
html[data-lti-theme="dark"] body :is(.status,.status-badge,.status-pill,.badge,.pill,[class*="status-badge"],[class*="status-pill"],[class$="-status"],[class^="status-"]):not(input):not(select):not(textarea) :is(span,strong,small,b){color:inherit!important;opacity:1!important}
html[data-lti-theme="dark"] body :is(.lti-workflow-tab,.tab-button,.tab-btn,[role="tab"]):not(.active):not([aria-selected="true"]){background:#e8f1f8!important;color:#17354d!important;border-color:#9eb7cb!important}
html[data-lti-theme="dark"] body :is(.lti-workflow-tab,.tab-button,.tab-btn,[role="tab"]):not(.active):not([aria-selected="true"]) *{color:#17354d!important}
/* Light neutral buttons retain dark labels; primary/dark buttons retain their white labels. */
html[data-lti-theme="dark"] body :is(button,.btn)[style*="background:#fff"],html[data-lti-theme="dark"] body :is(button,.btn)[style*="background: #fff"],html[data-lti-theme="dark"] body :is(button,.btn)[style*="background:#f"],html[data-lti-theme="dark"] body :is(button,.btn)[style*="background: #f"]{color:#12324c!important}
html[data-lti-theme="dark"] body :is(button,.btn)[style*="background:#fff"] *,html[data-lti-theme="dark"] body :is(button,.btn)[style*="background:#f"] *{color:inherit!important}
/* Readable calendar and report light-background event blocks. */
html[data-lti-theme="dark"] body :is([class*="calendar"],[class*="history"],[class*="release"],[class*="research"],[class*="manual"],[class*="state-law"]) :is([style*="background:#fff"],[style*="background: #fff"],[style*="background:#f"],[style*="background: #f"]){color:#17334a!important}
html[data-lti-theme="dark"] body :is([class*="calendar"],[class*="history"],[class*="release"],[class*="research"],[class*="manual"],[class*="state-law"]) :is([style*="background:#fff"],[style*="background: #fff"],[style*="background:#f"],[style*="background: #f"]) :is(h1,h2,h3,h4,p,span,small,strong,b,li){color:#17334a!important;opacity:1!important}
/* Make focus targets clearly visible in both themes. */
html[data-lti-theme="dark"] body :is(button,a,[role="button"],[role="tab"]):focus-visible{outline:3px solid #64b5f6!important;outline-offset:2px}
