/* 0.16: responsive containment without replacing Core navigation or quiz controls. */
body.kxe-adventure #ksp-shell,body.kxe-adventure #ksp-screen{min-width:0;max-width:100%;}
body.kxe-adventure #ksp-shell :is(.ks-hero-grid,.ks-access,.ksp-catalog,.ksp-tile,.ksp-stats,.ksp-stat,.ksp-card-grid,.ksp-catalog-grid,.ksp-reader,.ksp-quiz,.ksp-quiz-result,.ksp-hc,.kxe-quiz-board,.kxe-quiz-stake,.kxe-quiz-chamber,.kxe-quiz-abilities,.kxe-feedback-grid,.ksp-search,.ksp-form,.ksp-lesson-actions,.ksp-controls,.kxe-terminal-actions){min-width:0;max-width:100%;overflow-wrap:anywhere;box-sizing:border-box;}
body.kxe-adventure #ksp-shell :is(.ksp-controls,.ksp-search,.ksp-reading-heading,.ksp-quiz-top,.kxe-exchange-heading){flex-wrap:wrap;}
body.kxe-adventure #ksp-shell :is(.ksp-tile,.ks-access,.ksp-hc-feedback,.ksp-quiz-result) :is(input:not([type=hidden]):not([type=radio]):not([type=checkbox]),select,textarea){min-width:0;max-width:100%;box-sizing:border-box;}
body.kxe-adventure #ksp-shell :is(.ks-access,.ksp-register) :is(input:not([type=hidden]):not([type=radio]):not([type=checkbox]),select){width:100%;font-size:16px;}
body.kxe-adventure #ksp-shell .ks-access .kxe-password-help{margin:0;padding:11px 13px;border:1px solid #9875c8;border-radius:11px;background:#24194f;color:#efe6ff!important;font-size:13px;line-height:1.55;font-weight:400;}
.kxe-password-help strong{display:block;color:#ffe5a3;font-size:14px;margin-bottom:4px;}
body.kxe-adventure #ksp-shell .ks-access .kxe-login-privacy{font-size:13px;text-align:center;margin:14px 0 0;}.kxe-login-privacy a{color:#a9edff!important;text-decoration:underline;text-underline-offset:3px;}
body.kxe-adventure #ksp-shell .ksp-register a{overflow-wrap:anywhere;}
body.kxe-adventure #ksp-shell :is(.ksp-tile,.ksp-reader,.ksp-hc-feedback,.ksp-catalog-tile) img:not(.kxe-stat-art){max-width:100%;}
body.kxe-adventure #ksp-shell :is(.ksp-stat strong,.ksp-hc-stats b){overflow-wrap:anywhere;min-width:0;max-width:100%;}
body.kxe-adventure :is(.ksp-finish-dialog,.kxe-gem-confirm,.kxe-confirm-dialog){max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;}
body.kxe-adventure #ksp-shell .ksp-reader:not(:fullscreen) .ksp-reader-stage{min-height:0;}
body.kxe-adventure #ksp-shell .ksp-reader-stage>*{min-width:0;}
body.kxe-adventure #ksp-shell .ksp-reader-toolbar{gap:6px 10px;}
body.kxe-adventure #ksp-shell .ksp-reader .ksp-transcript{overflow-wrap:anywhere;}
/* Tablet widths: avoid squeezing the left sidebar into two very narrow content columns. */
@media(max-width:900px){body.kxe-adventure #ksp-shell.kxe-has-rail{grid-template-columns:minmax(0,1fr);}.kxe-adventure .kxe-rail{position:static;padding:10px;min-width:0;}.kxe-adventure .kxe-rail nav{display:flex;overflow-x:auto;max-width:100%;gap:6px;}.kxe-adventure .kxe-rail nav a{flex:0 0 auto;white-space:nowrap;}.kxe-adventure .kxe-rail :is(.kxe-rail-brand,.kxe-rail-caption,.kxe-rail-note){display:none;}}
@media(max-width:480px){body.kxe-adventure #ksp-shell .ks-hero-grid{padding:8px;gap:16px;}body.kxe-adventure #ksp-shell .ks-access{padding:18px;}body.kxe-adventure #ksp-shell .ksp-card-grid{grid-template-columns:minmax(0,1fr);}body.kxe-adventure #ksp-shell .ksp-search>label{flex:1 1 130px;min-width:0;}body.kxe-adventure #ksp-shell .ksp-reading-heading{align-items:flex-start;}body.kxe-adventure #ksp-shell .ksp-reading-heading h2{flex:1 1 100%;}body.kxe-adventure #ksp-shell .ksp-reader-stage{grid-template-columns:28px minmax(0,1fr) 28px;}body.kxe-adventure #ksp-shell .ksp-page-arrow{min-width:0;padding:0;}.kxe-adventure #ksp-shell .ksp-lesson-actions .ks-button{padding-inline:7px;}.kxe-adventure #ksp-shell .ksp-hc-stats small{overflow-wrap:anywhere;}.kxe-adventure #ksp-shell .ksp-hc-heading{flex-wrap:wrap;}.kxe-adventure #ksp-shell .kxe-feedback-grid{grid-template-columns:minmax(0,1fr);}.kxe-adventure #ksp-shell .ksp-register label:has(input[type=checkbox]){overflow-wrap:anywhere;}}
@media(max-width:360px){body.kxe-adventure #ksp-shell .kxe-island-grid{grid-template-columns:minmax(0,1fr);}body.kxe-adventure #ksp-shell .ksp-quiz-result .ksp-stats{grid-template-columns:repeat(2,minmax(0,1fr));}body.kxe-adventure #ksp-shell .kxe-terminal-actions>*{flex:1 1 100%;}body.kxe-adventure #ksp-shell .ksp-stat-carousel{grid-template-columns:26px minmax(0,1fr) 26px;gap:3px;}}
/* Short landscape windows and zoom must remain scrollable. */
@media(max-height:500px){body.kxe-adventure #ksp-shell .ks-hero-grid{min-height:0;}body.kxe-adventure #ksp-shell .ks-access{align-self:start;}body.kxe-adventure #ksp-shell .ksp-quiz.kxe-normal-fit{height:auto;overflow:visible;}body.kxe-adventure #ksp-shell .ksp-quiz.kxe-normal-fit .kxe-normal-questions{overflow:visible;flex:auto;}body.kxe-adventure #ksp-shell .kxe-feedback-grid{max-height:none;}}
/* 0.17: additive V0.9.3 authentication fields and native account actions. */
body.kxe-adventure #ksp-shell .ks-access .kxe-remember-label{display:flex;align-items:flex-start;gap:9px;line-height:1.45;color:#fff!important;cursor:pointer;}
body.kxe-adventure #ksp-shell .ks-access .kxe-remember-label input{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0;}
body.kxe-adventure #ksp-shell .ks-access :is(#ksp-remember-notice,.kxe-username-help){margin:0;color:#dcccf8!important;font-size:13px;line-height:1.45;}
body.kxe-adventure #ksp-shell .ks-access .ksp-register p[hidden]{display:none!important;}
body.kxe-adventure #ksp-shell .ks-access .ksp-register label:has(input[name=privacy_consent]){display:flex;align-items:flex-start;gap:9px;line-height:1.45;}
body.kxe-adventure #ksp-shell .ks-access .ksp-register input[name=privacy_consent]{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0;}
body.kxe-adventure #ksp-screen[data-ksp-screen=account] :is(.kxe-account-action,.kxe-account-privacy){margin-block:12px;}
body.kxe-adventure #ksp-screen[data-ksp-screen=account] .kxe-account-action .ksp-form{max-width:640px;}
body.kxe-adventure #ksp-screen[data-ksp-screen=account] .kxe-account-action .ks-button{min-height:44px;}
body.kxe-adventure #ksp-screen[data-ksp-screen=account] .kxe-account-delete{border-color:#e3949d;}
@media(max-width:480px){body.kxe-adventure #ksp-screen[data-ksp-screen=account] :is(.kxe-account-action,.kxe-account-privacy) .ks-button{width:100%;box-sizing:border-box;white-space:normal;}}
