/* 0.8.6 — explicit foreground/background pairs for the portal.
 * Loaded last; deliberately scoped to the Kridemy UI, not WP admin or comic artwork.
 * Keep invisible full-card hit targets untouched. */
body.kxe-adventure .ksp-layout .kxe-rail nav.ksp-learn-nav a,
body.kxe-adventure #ksp-drawer .ksp-learn-nav a,
body.kxe-adventure .ksp-layout .ksp-learn-nav a {
  background: #30205f !important; color: #f5efff !important; border-color: #8064ba !important;
}
body.kxe-adventure .ksp-layout .kxe-rail nav.ksp-learn-nav a:hover,
body.kxe-adventure #ksp-drawer .ksp-learn-nav a:hover,
body.kxe-adventure .ksp-layout .ksp-learn-nav a:hover {
  background: #493080 !important; color: #fff8ff !important; border-color: #b99aef !important;
}
body.kxe-adventure .ksp-layout .kxe-rail nav.ksp-learn-nav a[aria-current],
body.kxe-adventure #ksp-drawer .ksp-learn-nav a[aria-current],
body.kxe-adventure .ksp-layout .ksp-learn-nav a[aria-current] {
  background: #59389a !important; color: #fff2b9 !important; border-color: #b79aef !important;
}
body.kxe-adventure .kxe-rail nav a > span:not(.kxe-nav-icon) {color:inherit !important;}
body.kxe-adventure .kxe-rail nav a .kxe-nav-icon {color:#ffd061 !important;}
/* Visible primary and secondary actions, including login and fullscreen dialogs. */
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ks-button:not(.kxe-stretched-link):not(.kxe-power-trigger) {
  background: #ffc34b linear-gradient(#ffe591,#ffc34b) !important; color: #30204f !important; border-color:#ffe9a0 !important;
}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ks-button:not(.kxe-stretched-link):not(.kxe-power-trigger):not(:disabled):hover {
  background:#ffe69b !important; color:#30204f !important;
}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ks-button--outline:not(.kxe-stretched-link):not(.kxe-power-trigger) {
  background:#38216f !important; color:#fff8ff !important; border-color:#a78adf !important;
}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ks-button--outline:not(.kxe-stretched-link):not(.kxe-power-trigger):not(:disabled):hover {
  background:#51358f !important; color:#fff8ff !important;
}
/* Preserve semantic cash-out and destructive actions. */
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ksp-hc form:has(input[value=hc_finish]) .ks-button:not(.kxe-stretched-link):not(.kxe-power-trigger) {
  background:#a4eed8 !important; color:#163b36 !important; border-color:#d0ffed !important;
}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ksp-danger .ks-button:not(.kxe-stretched-link):not(.kxe-power-trigger),
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ksp-danger .ks-button:not(.kxe-stretched-link):not(.kxe-power-trigger):not(:disabled):hover {background:#653a4a !important;color:#fff0f0 !important;border-color:#e3949d !important;}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,#ks-header,#ks-footer) .ksp-hc form:has(input[value=hc_finish]) .ks-button:not(.kxe-stretched-link):not(.kxe-power-trigger):not(:disabled):hover {background:#c4f7e7 !important;color:#163b36 !important;}
/* Unclassed visible controls and utility buttons. */
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) button:not(.ks-button):not(.kxe-power-trigger):not(.kxe-stretched-link):not([hidden]):not(.kxe-confirm-go):not(.kxe-confirm-cancel),
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) :is(input[type=submit],input[type=button],input[type=reset]) {
  background:#38216f !important;color:#fff8ff !important;border-color:#a78adf !important;
}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) button:not(.ks-button):not(.kxe-power-trigger):not(.kxe-stretched-link):not([hidden]):not(.kxe-confirm-go):not(.kxe-confirm-cancel):not(:disabled):hover {
  background:#51358f !important;color:#fff8ff !important;
}
body.kxe-adventure .kxe-confirm-dialog .kxe-confirm-cancel {background:#392566 !important;color:#fff8ff !important;}
body.kxe-adventure .kxe-confirm-dialog .kxe-confirm-go {background:#ffd061 !important;color:#30204f !important;}
/* Form controls: pair both colors, including native select options and autofill. */
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) :is(input:not([type=hidden]):not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=reset]):not([type=file]):not([type=range]):not([type=color]),select,textarea) {
  background:#20164b !important;color:#fff8ff !important;border-color:#a78adf !important;color-scheme:dark;
}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) :is(input,textarea)::placeholder {color:#cbbde9 !important;opacity:1;}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) select option {background:#20164b;color:#fff8ff;}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) input:-webkit-autofill {-webkit-text-fill-color:#fff8ff;box-shadow:0 0 0 1000px #20164b inset;}
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access) :is(input[type=checkbox],input[type=radio]) {accent-color:#ffd061;color-scheme:dark;}
/* Answer cards and textual reading surfaces; no changes to image pixels. */
body.kxe-adventure .ksp-layout :is(.ksp-option,.ksp-hc-options label) {background:#382768 !important;color:#fff8ff !important;border-color:#9879d2 !important;}
body.kxe-adventure .ksp-layout :is(.ksp-option,.ksp-hc-options label):hover {background:#4c347f !important;color:#fff8ff !important;}
body.kxe-adventure .ksp-layout :is(.ksp-option,.ksp-hc-options label):has(input:checked) {background:#583b85 !important;color:#fff4cc !important;border-color:#ffd061 !important;}
body.kxe-adventure .ksp-layout :is(.ksp-transcript,.ksp-finish-dialog,.ksp-catalog .ksp-search,.ksp-after-quiz) {background:#2a1a60 !important;color:#fff8ff !important;}
body.kxe-adventure .ksp-layout .ksp-transcript summary {color:#b1f2ff !important;}
/* Readable keyboard focus without altering the hidden/inert state. */
body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,.kxe-confirm-dialog,#ks-header) :is(a,button,input,select,textarea,summary):focus-visible {outline:3px solid #76e8ff;outline-offset:3px;}
@media(forced-colors:active){
 body.kxe-adventure :is(.ksp-layout,#ksp-drawer,.ks-access,.kxe-confirm-dialog,#ks-header) :is(a,button,input,select,textarea,summary):focus-visible {outline-color:Highlight;}
}
