/* Named ownership layer: shared important layout rules outrank unlayered legacy themes, regardless of selector specificity or load order. Native activity styles outside these selectors remain native. */

@layer bykids-classroom-layout {

/* One layout owner. Native lesson engines retain all media and controls. */

html[data-bk-layout="unified-v1"] body .bk-simple-classroom{width:min(1120px,100%)!important;margin-inline:auto!important;padding:20px 28px!important;box-sizing:border-box!important}

html[data-bk-layout="unified-v1"] body .bk-simple-grid{grid-template-columns:minmax(0,46fr) minmax(0,54fr)!important;gap:36px!important;align-items:center!important;min-height:450px!important}

html[data-bk-layout="unified-v1"] body .bk-simple-art{width:100%!important;height:450px!important;min-width:0!important}

html[data-bk-layout="unified-v1"] body .bk-simple-image{max-width:100%!important;width:auto!important;max-height:450px!important;height:auto!important;object-fit:contain!important}

html[data-bk-layout="unified-v1"] body .bk-simple-copy{padding-top:0!important;min-width:0!important}

html[data-bk-layout="unified-v1"] body .bk-simple-tools{margin-top:64px!important;gap:10px!important;flex-wrap:wrap!important}

html[data-bk-layout="unified-v1"] body .bk-simple-copy:has(.bk-simple-hint:not([hidden])) .bk-simple-tools{margin-top:20px!important}

html[data-bk-layout="unified-v1"] body :is(.bk-simple-art>button,.bkw-enlarge,.mw-enlarge,.mw-zoom){top:12px!important;right:12px!important;bottom:auto!important;left:auto!important;width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;border-radius:10px!important;font-size:22px!important}

html[data-bk-layout="unified-v1"] body #music-words-lab{max-width:760px!important;width:100%!important;margin-inline:auto!important;padding:20px 24px!important;box-sizing:border-box!important}

html[data-bk-layout="unified-v1"] body #music-words-lab .mw-stage{max-width:680px!important;margin-inline:auto!important;gap:30px!important}

html[data-bk-layout="unified-v1"] body #music-words-lab .mw-controls{max-width:680px!important;margin-inline:auto!important;border-top:0!important;justify-content:center!important;flex-wrap:wrap!important}

html[data-bk-layout="unified-v1"] body #music-words-lab :is(.mw-word,.mw-word-text){font-size:clamp(36px,5vw,64px)!important}

html[data-bk-layout="unified-v1"] body #music-words-lab h2{text-align:center!important}

html:root[data-bk-layout="unified-v1"] body #music-words-lab#music-words-lab{width:min(760px,100%)!important;max-width:760px!important;margin-inline:auto!important}

html:root[data-bk-layout="unified-v1"] body #music-words-lab#music-words-lab .mw-content{width:100%!important;max-width:680px!important;margin-inline:auto!important;gap:30px!important}

html:root[data-bk-layout="unified-v1"] body #music-words-lab#music-words-lab :is(h1,.mw-head){text-align:center!important}

html:root[data-bk-layout="unified-v1"] body #music-words-lab#music-words-lab .mw-intro{display:none!important}

html[data-bk-layout="unified-v1"] body :is(.bk-ready-media,#bk-interlude-page>.jr-penguin-art,.bk-penguin-center>.bykids-goodbye-visual){max-width:min(560px,90vw)!important;object-fit:contain!important;margin-inline:auto!important}

@media(max-width:700px){

html[data-bk-layout="unified-v1"] body .bk-simple-classroom{padding:16px!important}

html[data-bk-layout="unified-v1"] body .bk-simple-grid{grid-template-columns:minmax(0,1fr)!important;gap:24px!important}

html[data-bk-layout="unified-v1"] body .bk-simple-art{height:320px!important}

html[data-bk-layout="unified-v1"] body .bk-simple-image{max-height:320px!important}

html[data-bk-layout="unified-v1"] body .bk-simple-tools{margin-top:28px!important}

}



/* Anchor zoom to the image rather than the full grid column. */

html[data-bk-layout="unified-v1"] body .bk-simple-art:has(>.bk-simple-image){width:fit-content!important;height:auto!important;max-width:100%!important;justify-self:center!important;align-self:center!important;padding:0!important;margin:0!important;position:relative!important}

html[data-bk-layout="unified-v1"] body .bk-simple-art>.bk-simple-image{display:block!important;margin:0!important}



@media(min-width:900px){html[data-bk-layout="unified-v1"] body.is-fw-annotation-panel-open :is(#stage,#app){padding-right:180px!important;box-sizing:border-box!important}}



@media(min-width:701px){html[data-bk-layout="unified-v1"] body .bk-simple-grid{min-height:min(450px,max(300px,calc(100dvh - 400px)))!important}}



/* White mascot stages, including the faint off-white edge of existing media. */

html:root[data-bk-layout="unified-v1"] body :is(.bykids-daily-greeting,.bykids-daily-card,.bk-greeting-image-frame,.bk-ready-page,#bk-common-ready,.bk-penguin-center,#bk-interlude-page,.r-wrap-goodbye){background:#fff!important;border:0!important;box-shadow:none!important}

html:root[data-bk-layout="unified-v1"] body :is(.bykids-daily-card img,.bykids-daily-card video,.bykids-goodbye-visual,#bk-interlude-page img,#bk-interlude-page video,.bk-ready-media img,.bk-ready-media video){background:#fff!important;filter:contrast(1.06)!important}



html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom.bk-speaking-standard .bk-simple-art>.bk-simple-image{height:420px!important;max-height:420px!important;width:auto!important;max-width:100%!important;object-fit:contain!important;aspect-ratio:auto!important}

@media(max-width:700px){html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom.bk-speaking-standard .bk-simple-art>.bk-simple-image{height:270px!important;max-height:270px!important}}



html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom>.bk-simple-title{display:none!important}



html:root[data-bk-layout="unified-v1"] body .cm-stage{background:#fff!important;border:0!important;box-shadow:none!important}

html:root[data-bk-layout="unified-v1"] body .cm-stage>.cm-penguin{background:#fff!important;filter:contrast(1.10)!important}



/* Shared numbered scene tabs: one compact size across book engines. */

html:root[data-bk-layout="unified-v1"] body .bk-simple-tabs:not(.bk-reference-sequence){display:flex!important;flex-wrap:wrap!important;gap:6px!important;justify-content:flex-start!important}

html:root[data-bk-layout="unified-v1"] body .bk-simple-tabs:not(.bk-reference-sequence)>button{flex:0 1 122px!important;width:122px!important;min-width:0!important;max-width:122px!important;box-sizing:border-box!important;min-height:38px!important;height:38px!important;padding:8px 12px!important;text-align:center!important;font-size:13px!important;line-height:20px!important;font-weight:600!important;text-transform:none!important}



/* Keep a vocabulary word intact; fit its font to the available copy column. */

html:root[data-bk-layout="unified-v1"] body #music-words-lab#music-words-lab .mw-head{display:block!important;text-align:center!important}

html:root[data-bk-layout="unified-v1"] body #music-words-lab#music-words-lab .mw-copy{min-width:0!important;width:100%!important}

html:root[data-bk-layout="unified-v1"] body #music-words-lab#music-words-lab .mw-word{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;font-size:var(--bk-word-size,48px)!important;max-width:100%!important;line-height:1.2!important}

html:root[data-bk-layout="unified-v1"] body #music-words-lab .bk-picture-zoom-button{position:absolute!important;top:12px!important;right:12px!important;left:auto!important;bottom:auto!important;width:44px!important;height:44px!important;font-size:22px!important}



/* Centre lesson content in its existing viewport, not against the page top. */

html:root[data-bk-layout="unified-v1"] body :is(#stage,#app,.lesson-stage,.lesson-stage-content,.kc-body):has(>.bk-simple-classroom){justify-content:safe center!important;overflow-anchor:none!important}

html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom{margin-block:auto!important;flex-shrink:0!important;overflow-anchor:none!important}

html:root[data-bk-layout="unified-v1"] body .bk-simple-grid{transition:none!important}



/* Scene navigation and lesson content form one centred group in every engine. */

html:root[data-bk-layout="unified-v1"] body :is(#stage,#app,.lesson-stage,.lesson-stage-content,.kc-body):has(>.bk-simple-classroom>.bk-simple-tabs:not(.bk-reference-sequence)){display:flex!important;flex-direction:column!important;justify-content:safe center!important;padding-top:12px!important;padding-bottom:12px!important}

html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom:has(>.bk-simple-tabs:not(.bk-reference-sequence)){display:flex!important;flex-direction:column!important;flex:0 0 auto!important;align-self:center!important;margin-block:auto!important;height:auto!important;max-height:none!important;padding-top:0!important;gap:16px!important}

html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom>.bk-simple-tabs:not(.bk-reference-sequence){flex:0 0 auto!important;margin:0!important;position:static!important;justify-content:center!important}

html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom:has(>.bk-simple-tabs:not(.bk-reference-sequence))>.bk-simple-grid{flex:0 0 auto!important;align-content:center!important;width:100%!important}



/* Transitions occupy the existing lesson viewport, never a second fixed viewport. */

html:root[data-bk-layout="unified-v1"] body :is(#stage,#app,.lesson-stage,.lesson-stage-content,.kc-body):has(>#bk-interlude-page){display:flex!important;flex-direction:column!important;justify-content:center!important;min-height:0!important;overflow:auto!important}

html:root[data-bk-layout="unified-v1"] body #bk-interlude-page{position:relative!important;inset:auto!important;transform:none!important;flex:1 1 0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;margin:0!important;padding:0!important;box-sizing:border-box!important;gap:12px!important}

html:root[data-bk-layout="unified-v1"] body #bk-interlude-page>:is(img,video){display:block;width:min(560px,90vw)!important;max-width:100%!important;height:min(480px,calc(100dvh - 260px))!important;max-height:100%!important;min-height:0!important;flex:0 1 auto!important;object-fit:contain!important;margin:0 auto!important}



/* Kids answer-choice plugin no longer owns viewport fitting. */

html:root[data-bk-layout="unified-v1"] body .lesson-stage:has(>.lesson-stage-content>.bk-simple-classroom){display:flex!important;flex-direction:column!important;flex:1 1 auto!important;padding:8px 0 0!important;min-height:0!important;overflow:auto!important}

html:root[data-bk-layout="unified-v1"] body .lesson-stage-content:has(>.bk-simple-classroom){display:flex!important;flex-direction:column!important;flex:1 0 auto!important;width:100%!important;max-width:1120px!important;margin-inline:auto!important;padding:0!important;zoom:1!important}

html:root[data-bk-layout="unified-v1"] body .bk-simple-classroom .bk-kids-story-choices{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;width:100%!important}


/* Kinder lesson stages share one bounded, vertically centred content area. */
html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .kc-body {width:100%!important;max-width:1120px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:safe center!important;min-height:0!important;padding:12px 24px!important;box-sizing:border-box!important}
html[data-bk-layout="unified-v1"] body.kinder-r1-shell .kc-body>.bk-simple-classroom {height:auto!important;max-height:none!important;min-height:0!important;width:100%!important;margin-block:auto!important;overflow:visible!important;flex:0 0 auto!important}
html[data-bk-layout="unified-v1"] body.kinder-r1-shell .bk-simple-classroom>.bk-simple-grid {min-height:0!important;align-items:center!important}
html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .single-music {width:min(820px,100%)!important;max-width:820px!important;height:auto!important;max-height:none!important;overflow:visible!important;padding:8px 16px!important;margin:auto!important}
html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .music-heading {text-align:center!important}
html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .single-music .music-focus {height:clamp(220px,32dvh,320px)!important;gap:28px!important;padding:12px 0!important}
html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .song-controls {flex-wrap:wrap!important;justify-content:center!important}
@media(max-width:700px){
 html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .kc-body {padding:12px!important;justify-content:flex-start!important;overflow:auto!important}
 html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .single-music .music-focus {height:240px!important;gap:14px!important}
 html[data-bk-layout="unified-v1"] body.kinder-r1-shell #app .song-controls input[type=range] {flex:1 1 50%!important}
}


/* One horizontal contract for native stages and the embedded Free Talk renderer. */
html[data-bk-layout="unified-v1"]{--bk-lesson-width:1120px;--bk-lesson-inset:28px;--bk-lesson-gap:36px;--bk-lesson-columns:minmax(0,46fr) minmax(0,54fr)}
html[data-bk-layout="unified-v1"] body #app{box-sizing:border-box!important;width:calc(100% - 80px)!important;max-width:1440px!important;margin-inline:auto!important;padding-inline:0!important}
html[data-bk-layout="unified-v1"] body :is(.lesson-stage,.lesson-stage-content,.weekly-inline){box-sizing:border-box!important;width:100%!important;max-width:var(--bk-lesson-width)!important;margin-inline:auto!important;padding-inline:0!important}
html[data-bk-layout="unified-v1"] body :is(.bk-simple-classroom,#bk-book-wheel){box-sizing:border-box!important;width:min(var(--bk-lesson-width),100%)!important;max-width:var(--bk-lesson-width)!important;margin-inline:auto!important;padding-inline:var(--bk-lesson-inset)!important}
html[data-bk-layout="unified-v1"] body :is(.bk-simple-grid,.bkw-selected .bkw-result){box-sizing:border-box!important;width:100%!important;grid-template-columns:var(--bk-lesson-columns)!important;column-gap:var(--bk-lesson-gap)!important;padding-inline:0!important;margin-inline:0!important}
html[data-bk-layout="unified-v1"] body .bkw-selected .bkw-picture{min-width:0!important;max-width:100%!important}
html[data-bk-layout="unified-v1"] body .bkw-selected .bkw-poster{max-width:100%!important}
@media(max-width:700px){
 html[data-bk-layout="unified-v1"]{--bk-lesson-inset:16px;--bk-lesson-gap:24px;--bk-lesson-columns:minmax(0,1fr)}
 html[data-bk-layout="unified-v1"] body #app{width:calc(100% - 28px)!important}
}
}

@layer bykids-classroom-layout {
html[data-bk-layout="unified-v1"] body .bkw-picture>.bkw-enlarge{top:auto!important;bottom:12px!important;right:12px!important;left:auto!important}
}
