/* Teacher shell is quiet; student scenery never changes the reading geometry. */
html[data-theme]{--theme-ink:#17334b;--theme-accent:#245b96;--theme-bg:#eaf5fc;--theme-frame:#d9ebf7;--theme-surface:#fff}
html[data-theme] body{background-color:var(--theme-bg)}
html[data-theme-audience=teacher] :is(.top,.teacher-heading,.lab-home>header,.weekly-page>header){border-bottom-color:var(--theme-frame);border-bottom-width:3px}
html[data-theme-audience=teacher] :is(.teacher-home,.weekly-page,.lab-home){background-color:color-mix(in srgb,var(--theme-bg) 55%,white)}
html[data-theme-audience=teacher] .teacher-heading{position:relative;padding-right:64px}
html[data-theme-audience=teacher] .teacher-heading:after{content:"";position:absolute;right:0;top:0;width:56px;height:56px;background:var(--theme-mascot) center/contain no-repeat;pointer-events:none}
.theme-selector{margin:12px 0 20px;border:1px solid var(--theme-frame);border-radius:12px;background:#fff;color:#17334b;max-width:650px;padding:12px 16px}
.theme-selector summary{cursor:pointer;font-weight:750;font-size:14px;min-height:24px}.theme-selector form{display:grid;gap:12px;padding-top:14px}.theme-selector label{display:grid;gap:5px;font-weight:650}.theme-selector select{max-width:100%;padding:10px;font:inherit;border:1px solid #8da7bc;border-radius:8px;background:#fff;color:#17334b}.theme-selector button{justify-self:start}.theme-selector p[role=status]:empty{display:none}
.theme-preview{background:var(--preview-bg);border:2px solid var(--preview-accent);border-radius:14px;display:flex;gap:16px;align-items:center;padding:12px;color:#17334b}.theme-preview svg{width:84px;height:84px;flex-shrink:0}.theme-preview p{margin:6px 0;font-size:14px}
.theme-selector :is(button,select,summary):focus-visible{outline:3px solid #195dc0;outline-offset:3px}
/* Fixed perimeter artwork: no layout space, no text layer, no pointer events. */
html[data-theme-audience=student] body{background:var(--theme-bg)!important;color:#17334b}
html[data-theme-audience=student] body:before{content:"";position:fixed;inset:0;background:var(--theme-scene) center bottom/100% auto no-repeat;opacity:.38;pointer-events:none;z-index:-1}
html[data-theme-audience=student] body:after{content:"";position:fixed;right:6px;bottom:6px;width:clamp(36px,5vw,76px);height:clamp(36px,5vw,76px);background:var(--theme-mascot) center/contain no-repeat;opacity:.5;pointer-events:none;z-index:0}
html[data-theme-audience=student] body{isolation:isolate}
html[data-theme-audience=student] :is(.activity-mission,.lab-stage,.bingo-stage,.rp-stage){background-color:color-mix(in srgb,var(--theme-bg) 65%,white);border-color:var(--theme-frame)}
html[data-theme-audience=student] :is(.activity-stimulus,.lab-card,.lab-built>div){background:#fff;color:#17334b;border-color:var(--theme-accent);box-shadow:0 0 0 3px var(--theme-frame)}
html[data-theme-audience=student] .lab-built>div{border-top-color:var(--theme-accent);border-radius:16px}
html[data-theme-audience=student] :is(.activity-path,.lab-progress){background-color:var(--theme-secondary);border-color:var(--theme-accent)}
html[data-theme=pixel][data-theme-audience=student] :is(.lab-card,.lab-built>div,.activity-path){border-radius:4px}
html[data-theme=zoo][data-theme-audience=student] .activity-path{background-image:repeating-linear-gradient(105deg,transparent 0 26px,#fff8 27px 29px)}
html[data-theme=sea][data-theme-audience=student] .activity-path{background-image:radial-gradient(circle at 15px 12px,#fff9 0 6px,transparent 7px);background-size:40px 25px}
html[data-theme=dino][data-theme-audience=student] .activity-path{background-image:radial-gradient(ellipse at 16px 12px,#fff9 0 5px,transparent 6px);background-size:32px 24px}
html[data-theme=space][data-theme-audience=student] .activity-path{background-image:radial-gradient(circle at 16px 12px,#fff 0 4px,transparent 5px);background-size:54px 26px}
html[data-theme=digital][data-theme-audience=student] .activity-path{background-image:repeating-linear-gradient(90deg,transparent 0 38px,#fff8 39px 43px)}
/* Long text and Fluency receive only a quiet outer tint; no mascot or movement. */
html[data-theme-density=minimal] body:after{display:none}html[data-theme-density=minimal] body:before{opacity:.08}
html[data-theme-density=minimal] :is(#text,#stimulus,.fluency-projection,.fluency-project){background:#fff;color:inherit}
html[data-theme-complete=true][data-theme-audience=student][data-theme-motion=normal] body:after{animation:theme-finish .5s ease-out 1}
@keyframes theme-finish{0%{transform:scale(.85);opacity:.3}65%{transform:scale(1.1);opacity:.7}100%{transform:scale(1);opacity:.5}}
html[data-theme-motion=off] :is(.activity-piece,.lab-card-track,.bingo-trail,.lab-ghost,.activity-progressed),html[data-theme-motion=reduced] :is(.activity-piece,.lab-card-track,.bingo-trail,.lab-ghost,.activity-progressed){animation:none!important;transition:none!important}
html[data-theme-motion=off] body:after,html[data-theme-motion=reduced] body:after{animation:none!important}
@media(max-width:700px),(max-height:620px){html[data-theme-audience=student] body:after{display:none}html[data-theme-audience=student] body:before{opacity:.15}.theme-preview svg{width:60px;height:60px}}
@media(prefers-reduced-motion:reduce){html[data-theme] body:after{animation:none!important}}
@media print{html[data-theme] body{background:#fff!important}html[data-theme] body:before,html[data-theme] body:after,.theme-selector{display:none!important}}
/* Thematic perimeter around native stages; functional lane colors remain native. */
html[data-theme-audience=student] :is(.lab-stage,.activity-mission,.bingo-stage,.rp-projection,.three-projection){background-color:var(--theme-bg);background-image:var(--theme-scene);background-position:center bottom;background-size:100% auto;background-repeat:no-repeat}
html[data-theme-audience=student] .three-projection{color:var(--theme-ink)}
html[data-theme-audience=student] :is(.rp-four article,.rp-writing,#stimulus,#text){background-color:#fff}
html[data-theme-density=minimal] :is(.lab-stage,.activity-mission,.bingo-stage,.rp-projection,.three-projection){background-image:none}
html[data-theme=classic] body:before,html[data-theme=classic] body:after{display:none}
html[data-theme-audience=student] .visual-projection{background-color:var(--theme-bg);background-image:var(--theme-scene);background-position:center bottom;background-size:100% auto;background-repeat:no-repeat}
html[data-theme-audience=student] .visual-options figure{background:#fff}
html[data-theme-motion=off] :is(.lab-stage,.visual-projection,.rp-projection,.three-projection,.bingo-stage) *,html[data-theme-motion=reduced] :is(.lab-stage,.visual-projection,.rp-projection,.three-projection,.bingo-stage) *{animation:none!important;transition:none!important}
html[data-theme-audience=student] .rp-projection>h1{color:var(--theme-ink)}
html[data-theme-motion=normal] .activity-piece.activity-progressed{filter:drop-shadow(0 0 5px var(--theme-secondary))}

/* One small mascot in unused header perimeter, never over the cards or their images. */
html[data-theme-audience=student] body:after{top:6px;bottom:auto;right:8px;width:30px;height:30px;z-index:2;opacity:.65}
html[data-theme-audience=student] body:has(#time):after{display:none}
