/* Teaching relationships, not a universal stack. Layout-only; no learning-state writes. */

/* A single lesson scroll surface. Header/footer never cover the teacher's controls. */
body:has(.p3-workspace){overflow:hidden}
body .p3-workspace{height:100dvh;min-height:0;padding-bottom:0!important;display:flex;flex-direction:column}
.p3-workspace>.p3-top,.p3-workspace>.p3-review-note,.p3-workspace>.p3-step-heading{flex:none}
.p3-workspace>.p3-top{position:relative;height:auto;min-height:76px;padding-top:10px;padding-bottom:10px}
.p3-top .p3-context>span{display:none}
.p3-workspace>.p3-content{flex:1;min-height:0;overflow:hidden;padding:12px 24px}
.p3-workspace .p3-content iframe{height:100%!important;min-height:0}
body .p3-workspace>.p3-footer{position:relative!important;inset:auto;flex:none;display:grid!important;grid-template-columns:110px minmax(0,1fr) minmax(220px,310px)!important;min-height:86px;padding:12px 24px}
body .p3-workspace .p3-footer>span{grid-column:1;grid-row:1}
body .p3-workspace .p3-footer .footer-status{display:block!important;grid-column:2;grid-row:1;text-align:left}
body .p3-workspace .p3-footer #real-next{grid-column:3;grid-row:1;min-width:0;width:100%;font-size:16px}
.p3-footer .learning-stage-strip{font-size:13px;gap:4px 12px}

html[data-p3-embedded]{height:100%;overflow-y:auto;scrollbar-gutter:stable}
html[data-p3-embedded] body,html[data-p3-embedded] #root{height:auto;min-height:100%;overflow:visible}
[data-p3-embedded] .pass3-app{padding:0 4px 24px;overflow:visible}
[data-p3-embedded] .screen-stage,[data-p3-embedded] .evidence-stage{height:auto!important;min-height:0!important;overflow:visible}

/* Natural block height is retained; only these pedagogically paired regions form grids. */
[data-p3-embedded] :is(.intro-screen,.story-anchor-screen,.know-maybe-screen,.support-proof-screen,.missing-evidence-screen,.retell-screen,.retell-practice-screen,.guided-reference-screen,.task-workspace,.book-practice-screen,.sound-main-grid){display:grid!important;grid-template-columns:minmax(0,1fr);align-items:start;gap:24px!important;height:auto!important;min-height:0!important;overflow:visible}
[data-p3-embedded] :is(.portrait-teacher-card,.story-anchor-teacher,.know-maybe-teacher-card,.support-teacher-check,.missing-teacher-guide,.retell-teacher-guide,.retell-teacher-model){width:100%;max-width:none;align-self:start;margin:0;height:auto!important;min-height:0!important}
[data-p3-embedded] :is(.portrait-teacher-card,.story-anchor-teacher){display:flex;flex-direction:column}
[data-p3-embedded] :is(.portrait-teacher-card,.story-anchor-teacher)>*{flex:none}
[data-p3-embedded] :is(.intro-screen,.story-anchor-screen,.know-maybe-screen,.support-proof-screen,.missing-evidence-screen,.retell-screen,.retell-practice-screen,.guided-reference-screen,.task-workspace,.book-practice-screen,.sound-main-grid)>*{min-width:0}
[data-p3-embedded] :is(.teacher-video-frame,.architecture-video-frame){height:clamp(220px,calc(100dvh - 220px),380px)!important;min-height:0!important;flex:none;position:relative}
[data-p3-embedded] :is(.teacher-video-frame,.architecture-video-frame) video{display:block;width:100%;height:100%;max-height:none;object-fit:contain}
[data-p3-embedded] :is(.media-controls,.architecture-video-controls){display:flex;min-width:0;gap:7px;flex-wrap:wrap;height:auto;min-height:44px;padding:5px}
[data-p3-embedded] :is(.media-controls,.architecture-video-controls) input[type=range]{min-width:50px;flex:1}
[data-p3-embedded] .media-controls .media-track{flex:1 1 100px;min-width:60px;width:auto}
[data-p3-embedded] .architecture-video-controls{background:#fff;color:#655198}
[data-p3-embedded] .architecture-video-controls .icon-control{color:#655198}
[data-p3-embedded] :is(.media-controls,.architecture-video-controls) time{font-size:13px!important;white-space:nowrap}
[data-p3-embedded] .teacher-identity{padding:8px 10px;height:auto;min-height:36px}
[data-p3-embedded] .teacher-identity :is(strong,span){font-size:14px!important}
[data-p3-embedded] .story-anchor-teacher :is(.story-teacher-note,.story-learning-goal){padding:8px;margin:4px 8px}
[data-p3-embedded] .story-anchor-teacher :is(.story-teacher-note,.story-learning-goal) :is(p,b,span){font-size:14px!important;line-height:1.4!important}
[data-p3-embedded] .story-anchor-teacher .architecture-video-frame{height:clamp(220px,calc(100dvh - 240px),360px)!important}
[data-p3-embedded] :is(.strategy-card,.story-anchor-card,.guided-reading-sheet,.guided-coach-card,.book-practice-card,.know-maybe-board,.support-proof-board,.missing-evidence-board){height:auto!important;min-height:0!important;overflow:visible;min-width:0}
[data-p3-embedded] .strategy-card{display:flex;flex-direction:column;padding:20px;gap:12px}
[data-p3-embedded] .strategy-motion{min-height:360px;height:auto;flex:none}
[data-p3-embedded] .story-anchor-card{padding:28px;gap:20px}
[data-p3-embedded] .story-anchor-card h1{margin-top:0}
[data-p3-embedded] .story-line{min-width:0;gap:8px;flex-wrap:wrap}
[data-p3-embedded] .story-line .story-node{flex:1;min-width:115px}
[data-p3-embedded] .story-line>svg{width:18px;flex:none}
[data-p3-embedded] :is(.guided-paragraph-list,.guided-coach-steps,.task-panel,.task-card,.book-page-card){height:auto;min-height:0;max-height:none;overflow:visible}
[data-p3-embedded] .infographic-motion-panel{height:620px;max-height:none;min-width:0}
[data-p3-embedded] .task-screen.data-screen{display:block!important;padding:0}
[data-p3-embedded] .data-screen>.teacher-anchor{position:static;width:auto;max-width:380px;margin:16px 0 0}
[data-p3-embedded] .book-page-card{max-width:none;padding:16px}
[data-p3-embedded] .book-page-card img{max-height:none;width:100%;height:auto;object-fit:contain}
[data-p3-embedded] .book-question-grid{grid-template-columns:minmax(0,1fr);gap:16px}
[data-p3-embedded] .book-question{min-height:90px}
[data-p3-embedded] .task-panel{display:flex;flex-direction:column;gap:18px}
[data-p3-embedded] .task-panel>.audio-guide{flex:none;height:auto;padding:14px}
[data-p3-embedded] .guided-coach-card{grid-template-rows:auto auto auto auto auto;gap:16px;padding:18px}
[data-p3-embedded] .audio-guide.has-teacher{height:auto;grid-template-rows:auto auto auto;grid-template-columns:40px minmax(0,1fr);gap:8px;padding:14px}
[data-p3-embedded] .audio-guide.has-teacher .audio-guide-helper{grid-column:1/-1;grid-row:3;border:0;padding:0}
[data-p3-embedded] .audio-guide.has-teacher .course-caption{grid-column:1/-1;grid-row:4}
[data-p3-embedded] .audio-guide .course-caption{margin:10px 0 0!important}
[data-p3-embedded] .guided-coach-card>.audio-guide{margin:0;padding:12px;border-radius:12px}
[data-p3-embedded] .audio-guide-title{flex-wrap:wrap;line-height:1.5}
[data-p3-embedded] .audio-guide-title span{margin-left:0}

/* Map navigation is a secondary rail; the current paragraph gets the main workspace. */
[data-p3-embedded] .story-map-v2-content{padding:18px}
[data-p3-embedded] .story-focus-workspace{display:grid!important;grid-template-columns:minmax(0,1fr);align-items:start;gap:20px}
[data-p3-embedded] .story-node-rail{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
[data-p3-embedded] .story-rail-node{min-height:90px!important;padding:12px!important}
[data-p3-embedded] .story-focus-panel{min-width:0}
[data-p3-embedded] .story-save-learning-row{display:grid!important;grid-template-columns:minmax(0,1fr);align-items:start}
[data-p3-embedded] .story-book-summary-check{min-width:0}

/* Supporting teacher information stays beside the active work, never a third equal task. */
[data-p3-embedded] .retell-screen>.retell-story-panel{grid-column:1/-1}
[data-p3-embedded] .retell-practice-side{display:grid;gap:20px;height:auto;min-height:0;overflow:visible}
[data-p3-embedded] :is(.retell-build-row,.retell-practice-row){display:block!important;min-height:0!important;margin:0 0 16px;padding:14px}
[data-p3-embedded] .retell-practice-row .retell-practice-summary{width:100%;min-width:0}
[data-p3-embedded] :is(.retell-build-intro,.retell-practice-intro){height:auto!important;min-height:0;display:block!important;padding:20px!important}
[data-p3-embedded] :is(.retell-build-intro,.retell-practice-intro)>aside{margin-top:14px;max-width:none}
[data-p3-embedded] :is(.retell-build-list,.retell-practice-list){padding:16px}
[data-p3-embedded] .retell-story-panel .retell-progress-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-height:none;height:auto;overflow:visible}
[data-p3-embedded] .retell-model-video video{height:auto;width:100%;max-height:380px}

/* Pattern work has one main column, with its reusable language beside it. */
[data-p3-embedded] .miy-screen{display:grid!important;grid-template-columns:minmax(0,1fr);gap:20px!important;padding:20px;overflow:visible!important}
[data-p3-embedded] .miy-screen>.paper-practice{grid-column:1/-1;margin:0;padding:20px}
[data-p3-embedded] .paper-practice h2{margin:0 0 8px}
[data-p3-embedded] .paper-practice :is(p,label){margin:8px 0}
[data-p3-embedded] .miy-screen>.miy-sentence-bank{display:block!important;order:2;padding:18px;min-width:0}
[data-p3-embedded] .miy-screen>.miy-workbook{min-width:0}
[data-p3-embedded] .miy-expression-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
[data-p3-embedded] .miy-mini-main{display:grid!important;grid-template-columns:minmax(0,1fr);gap:24px!important;align-items:start}
[data-p3-embedded] .miy-mini-main>.miy-idea-panel{grid-column:1/-1}
[data-p3-embedded] .miy-mini-main>.miy-writing-rail{min-width:0;height:auto}
[data-p3-embedded] .miy-mini-screen section>header{height:auto;min-height:0;grid-template-rows:auto;align-items:start;margin-bottom:14px}
[data-p3-embedded] .miy-writing-task>aside{height:auto;min-height:88px;padding:12px}
[data-p3-embedded] .miy-mini-footer{display:grid!important;grid-template-columns:minmax(0,1fr);gap:20px!important}
[data-p3-embedded] .miy-mini-footer>.miy-finish{grid-column:1/-1}

/* Demonstration and pronunciation practice remain visible together. */
[data-p3-embedded] .sound-board{display:block;height:auto!important}
[data-p3-embedded] .sound-main-grid{padding:20px}
[data-p3-embedded] .sound-main-grid>.sound-demo-card{display:block;height:auto!important;min-height:0!important;padding:14px}
[data-p3-embedded] .sound-demo-card>header{height:auto;min-height:0;padding:0 0 14px}
[data-p3-embedded] .sound-video-frame{height:clamp(180px,calc(100dvh - 340px),280px)!important;min-height:0}
[data-p3-embedded] .sound-demo-card .sound-video-frame video{width:100%;height:100%;object-fit:contain}
[data-p3-embedded] .sound-remember{height:auto;min-height:0;margin-top:10px}
[data-p3-embedded] .sound-remember :is(b,small,span){font-size:15px!important;line-height:1.4!important}
[data-p3-embedded] .sound-intro{height:auto;min-height:0;align-items:start;gap:18px;padding:18px}
[data-p3-embedded] .sound-intro>aside{height:auto;min-height:0;flex:none;width:290px}
[data-p3-embedded] .sound-intro>aside :is(small,b,p){font-size:14px!important;line-height:1.5!important}
[data-p3-embedded] .sound-demo-card>header h2{font-size:23px!important}
[data-p3-embedded] .sound-demo-card>header :is(p,span){font-size:16px!important}
[data-p3-embedded] .sound-record-loop{grid-template-columns:minmax(160px,.7fr) minmax(0,1.3fr)}
[data-p3-embedded] .sound-record-button{width:auto!important;min-width:0;padding:10px}
[data-p3-embedded] .sound-main-grid>.sound-practice-card{display:block;min-width:0;height:auto;min-height:0}
[data-p3-embedded] .sound-practice-list{height:auto;min-height:0;overflow:visible}
[data-p3-embedded] .sound-main-grid>.sound-tips-card{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:16px;align-items:start;height:auto;min-height:0}
[data-p3-embedded] .sound-tips-card>header{flex-basis:100%;height:auto}
[data-p3-embedded] .sound-tips-card>section,[data-p3-embedded] .sound-tips-card>.sound-self-practice{flex:1 1 200px;height:auto;min-height:0;margin:0}

@media(min-width:760px){
 [data-p3-embedded] :is(.intro-screen,.story-anchor-screen){grid-template-columns:minmax(240px,min(310px,28%)) minmax(0,1fr)}
 [data-p3-embedded] :is(.portrait-teacher-card,.story-anchor-teacher){position:sticky;top:8px}
}
@media(min-width:1000px){
 [data-p3-embedded] :is(.know-maybe-screen,.support-proof-screen,.missing-evidence-screen,.retell-screen){grid-template-columns:minmax(280px,330px) minmax(0,1fr)}
 [data-p3-embedded] :is(.know-maybe-teacher-card,.support-teacher-check,.missing-teacher-guide,.retell-teacher-guide){position:sticky;top:8px}
 [data-p3-embedded] .guided-reference-screen{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}
 [data-p3-embedded] .guided-reading-sheet{position:sticky;top:8px}
 [data-p3-embedded] .task-workspace{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}
 [data-p3-embedded] .infographic-motion-panel{position:sticky;top:8px;height:calc(100dvh - 24px)}
 [data-p3-embedded] .book-practice-screen{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 [data-p3-embedded] .story-focus-workspace{grid-template-columns:220px minmax(0,1fr)}
 [data-p3-embedded] .story-node-rail{grid-template-columns:minmax(0,1fr);position:sticky;top:8px}
 [data-p3-embedded] .story-save-learning-row{grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr)}
 [data-p3-embedded] .retell-practice-screen{grid-template-columns:minmax(0,1fr) 310px}
 [data-p3-embedded] .miy-screen{grid-template-columns:minmax(0,1fr) 280px}
 [data-p3-embedded] .miy-screen>.miy-sentence-bank{grid-column:2;grid-row:2;position:sticky;top:8px}
 [data-p3-embedded] .miy-screen>.miy-workbook{grid-column:1;grid-row:2}
 [data-p3-embedded] .miy-expression-list{grid-template-columns:minmax(0,1fr)}
 [data-p3-embedded] .miy-mini-main{grid-template-columns:minmax(0,1fr) 300px}
 [data-p3-embedded] .miy-mini-footer{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 [data-p3-embedded] .sound-main-grid{grid-template-columns:minmax(300px,.85fr) minmax(0,1.15fr)}
 [data-p3-embedded] .sound-demo-card{position:sticky;top:8px}
}
@media(max-width:799px){
 .p3-top .p3-context>span{display:none}
 .p3-workspace>.p3-content{padding:8px 12px}
 .p3-workspace>.p3-step-heading{padding-top:10px}
 [data-p3-embedded] :is(.portrait-teacher-card,.story-anchor-teacher){width:100%;max-width:500px;justify-self:center}
 [data-p3-embedded] :is(.teacher-video-frame,.architecture-video-frame){height:280px!important}
 [data-p3-embedded] :is(.know-maybe-bank,.know-maybe-zones,.support-claim-grid,.missing-options,.miy-expression-list,.retell-story-panel .retell-progress-list){grid-template-columns:minmax(0,1fr)}
 [data-p3-embedded] :is(.strategy-card,.story-anchor-card,.story-map-v2-content,.miy-screen,.sound-main-grid){padding:14px}
 [data-p3-embedded] .retell-final-lower{display:block}
 [data-p3-embedded] .readable-story-map{grid-template-columns:minmax(0,1fr)!important}
 [data-p3-embedded] .task-card h2{white-space:normal;overflow-wrap:break-word}
 [data-p3-embedded] .choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 [data-p3-embedded] .book-practice-card{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;min-width:0}
 [data-p3-embedded] .book-practice-card>*{min-width:0}
 [data-p3-embedded] .book-status{grid-template-columns:minmax(0,1fr)}
 [data-p3-embedded] .book-status>div{flex-wrap:wrap}
 [data-p3-embedded] .book-intro h2{font-size:23px!important}
 [data-p3-embedded] .story-line{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
 [data-p3-embedded] .story-line>svg{display:none}
 [data-p3-embedded] .story-line>.story-node{min-width:0}
 [data-p3-embedded] .story-anchor-actions{grid-template-columns:minmax(0,1fr);height:auto}
 [data-p3-embedded] .story-segment-audio{display:flex;flex-wrap:wrap;gap:10px;min-width:0;width:100%}
 [data-p3-embedded] .story-segment-audio input{min-width:50px;flex:1}
 [data-p3-embedded] :is(.story-focus-slots,.story-mini-bank-options,.support-option-grid){grid-template-columns:minmax(0,1fr)}
 [data-p3-embedded] :is(.story-mini-bank,.story-generate-row,.retell-full-recorder){grid-template-columns:minmax(0,1fr);height:auto}
 [data-p3-embedded] .story-node-rail{grid-template-columns:minmax(0,1fr)}
 [data-p3-embedded] .story-rail-node{grid-template-columns:32px minmax(0,1fr) 28px}
 [data-p3-embedded] .story-focus-panel>header{flex-wrap:wrap;height:auto}
 [data-p3-embedded] .story-focus-panel>header h2{overflow-wrap:break-word}
 [data-p3-embedded] .retell-final-empty{height:auto;min-height:72px}
 [data-p3-embedded] .support-proof-title{flex-wrap:wrap}
 [data-p3-embedded] .support-proof-title>div{min-width:0;max-width:100%}
 [data-p3-embedded] .retell-final-lower>*{min-width:0;max-width:100%}
 body .p3-workspace>.p3-footer.learn-footer{grid-template-columns:88px minmax(0,1fr)!important;grid-template-rows:auto auto!important;grid-template-areas:none!important;padding:8px 12px;gap:6px 10px!important}
 body .p3-workspace>.p3-footer.learn-footer>span{grid-area:auto!important;grid-column:1!important;grid-row:2!important}
 body .p3-workspace>.p3-footer.learn-footer .footer-status{grid-area:auto!important;grid-column:1/-1!important;grid-row:1!important;display:block!important;min-width:0}
 body .p3-workspace>.p3-footer.learn-footer #real-next{grid-area:auto!important;grid-column:2!important;grid-row:2!important;font-size:14px}
 .p3-footer .learning-stage-strip{flex-wrap:nowrap;overflow-x:auto;gap:12px;font-size:12px;scrollbar-width:thin}
 .p3-footer .learning-stage-strip li{flex:none;white-space:nowrap}
 .p3-footer .footer-status>small{display:none}
}
