/* Batch 13: global responsive navigation and accessible two-theme palette. */
:root{--ui-surface:#fff;--ui-surface-2:#f1f4fb;--ui-text:#17243c;--ui-muted:#53647f;--ui-border:#d8e0ee;--ui-link:#2359c5;--ui-input:#fff}
html[data-theme="dark"]{--ui-surface:#18243a;--ui-surface-2:#101b2e;--ui-text:#f0f4ff;--ui-muted:#bbc8df;--ui-border:#41516c;--ui-link:#9fc3ff;--ui-input:#111e33}
html,body{max-width:100%;overflow-x:clip}body{color:var(--ui-text)!important}main,.shell,.admin-main{min-width:0}img,video,canvas,iframe{max-width:100%}table{max-width:100%}main :is(.table-wrap,.admin-table){max-width:100%;overflow-x:auto}
.sidebar{display:flex!important;flex-direction:column!important;gap:7px!important}.sidebar .brand{flex:0 0 auto;margin-bottom:20px!important}.sidebar>small{display:block!important;flex:0 0 auto;color:#c0cee5!important;margin:0 0 6px!important}.sidebar>a.nav{display:flex!important;flex:0 0 auto;align-items:center;min-height:45px;width:100%;padding:11px 13px!important;line-height:1.4;white-space:normal;overflow-wrap:anywhere;color:#e3ecff!important;font-size:14px}.sidebar>a.nav.active{color:#fff!important}.sidebar .sidebottom{flex:0 0 auto;margin-top:auto;min-width:0;padding-top:18px}.sidebar .sidebottom b{color:#fff!important}.sidebar .sidebottom .btn{min-height:44px}
html[data-theme="dark"] :is(.card,.course,.authcard,.draft,.admin-table,.admin-heading,.top,.admin-top,.question,.option){background-color:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme="dark"] :is(.card,.course,.authcard,.draft,.admin-table,.admin-heading,.question,.option) :is(h1,h2,h3,h4,h5,h6,strong,b,label,span){color:inherit}
html[data-theme="dark"] :is(.card,.course,.authcard,.draft,.admin-table,.admin-heading,.question,.option) :is(p,small,.muted){color:var(--ui-muted)!important}
html[data-theme="dark"] :is(.card,.course,.authcard,.draft,.admin-table,.admin-heading,.question,.option) a:not(.btn){color:var(--ui-link)}
html[data-theme="dark"] :is(input,textarea,select){background:var(--ui-input)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--ui-muted)!important;opacity:1}html[data-theme="dark"] select option{background:var(--ui-input);color:var(--ui-text)}
html[data-theme="dark"] :is(.stats span,.course p,.course b){color:var(--ui-muted)!important}html[data-theme="dark"] .course b{color:var(--ui-link)!important}
html[data-theme="dark"] :is(.bottomnav,.admin-mobile-nav){background:var(--ui-surface)!important;border-color:var(--ui-border)!important}html[data-theme="dark"] .bottomnav a{color:var(--ui-link)!important}html[data-theme="dark"] .bottomnav small{color:var(--ui-muted)!important}
html[data-theme="dark"] :is(.pill,.timer){background:var(--ui-surface-2)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)}
html[data-theme="dark"] :is(.alert){color:#ffced0!important;background:#4c1e2c!important}
html[data-theme="dark"] :is(.hero,.hero *){color:#fff!important}
:focus-visible{outline:3px solid #69b9ff!important;outline-offset:2px}
@media(max-width:900px){.sidebar{width:min(86vw,330px)!important;padding:20px 15px 25px!important;overflow-y:auto!important;overscroll-behavior:contain;display:flex!important;flex-direction:column!important;gap:6px!important}.sidebar .brand{margin-bottom:18px!important}.sidebar>a.nav{width:100%!important;min-height:46px!important}.nav-open{overflow:hidden}.nav-open .nav-scrim{display:block!important}.shell main{width:100%;min-width:0}.top{min-width:0}.top .pill{white-space:nowrap}.bottomnav{gap:4px}.bottomnav a{min-width:0;flex:1}.bottomnav small{white-space:nowrap}}
@media(max-width:480px){.top{gap:7px!important}.top .mobilebrand{min-width:0;overflow:hidden;text-overflow:ellipsis}.top .pill{padding:8px!important;font-size:11px}.top .theme-switch,.top .mobile-menu{min-width:38px}.stats,.cards,.adminforms{grid-template-columns:minmax(0,1fr)!important}.shell main{padding:16px 13px 100px!important}.card,.course{min-width:0}.hero{min-width:0}.sidebar{width:min(88vw,330px)!important}}
