@media screen {
body.screen-teaching {overflow:hidden;}
#lesson .screen-fit.focused-teaching {position:fixed;inset:10px;z-index:1000;max-width:none!important;margin:0!important;padding:16px!important;border:1px solid #aaa294;border-radius:14px;box-shadow:0 8px 26px #372e201f;display:grid!important;grid-template-columns:210px minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 52px;gap:12px 18px;overflow:hidden;}
#lesson .screen-fit.focused-teaching>.teaching-view-controls {grid-column:1 / -1;grid-row:1;margin:0;gap:10px;align-items:center;}
#lesson .screen-fit.focused-teaching>.teaching-view-controls button {font-size:.9rem;min-height:38px;padding:8px 12px;}
#lesson .screen-fit.focused-teaching>.tooltime-shortcuts {grid-column:1;grid-row:2 / 4;position:static;margin:0;gap:6px;padding:10px;align-self:stretch;justify-content:flex-start;}
#lesson .screen-fit.focused-teaching>.tooltime-shortcuts a {padding:9px 11px;min-height:38px;font-size:.9rem;line-height:1.25;flex:0 0 auto;}
#lesson .screen-fit.focused-teaching>[data-activity] {grid-column:2;grid-row:2;margin:0!important;padding:18px 22px!important;min-width:0;min-height:0;overflow:hidden;}
#lesson .screen-fit.focused-teaching>.activity-navigation {grid-column:2;grid-row:3;margin:0;padding:0;border:0;}
#lesson .screen-fit .activity-navigation button {min-height:42px;padding:10px 18px;}
#lesson .screen-fit .activity-progress {font-size:.9rem;margin:0;}
#lesson .screen-fit .screen-page-viewport {height:100%;width:100%;overflow:hidden;}
#lesson .screen-fit .screen-page-track {column-gap:32px;column-fill:auto;width:100%;}
#lesson .screen-fit .screen-page-track p,#lesson .screen-fit .screen-page-track li {font-size:clamp(1.05rem,1.55vw,1.45rem);line-height:1.45;margin-bottom:.65em;max-width:none;}
#lesson .screen-fit .screen-page-track h1,#lesson .screen-fit .screen-page-track h2,#lesson .screen-fit .screen-page-track h3 {font-size:1.25rem;line-height:1.3;margin:0 0 14px;padding-bottom:8px;break-after:avoid;}
#lesson .screen-fit .screen-page-track h4 {font-size:1.1rem;margin:12px 0 8px;break-after:avoid;}
#lesson .screen-fit .screen-page-track figure,#lesson .screen-fit .screen-page-track video,#lesson .screen-fit .screen-page-track iframe,#lesson .screen-fit .screen-page-track .video-preview,#lesson .screen-fit .screen-page-track .week-one-visual {break-inside:avoid;margin:12px 0;max-height:calc(var(--screen-height) - 60px);}
#lesson .screen-fit .screen-page-track img,#lesson .screen-fit .screen-page-track video {max-height:calc(var(--screen-height) - 70px);width:100%;object-fit:contain;}
#lesson .screen-fit .screen-page-track iframe {width:100%;min-height:0;height:min(340px,calc(var(--screen-height) - 100px));}
#lesson .screen-fit .screen-page-track .discussion-questions li {padding:12px;}
#lesson .screen-fit .screen-page-track .tooltime-lesson-heading {margin-bottom:14px;}
#lesson .screen-fit .screen-page-track .lesson-start {padding:10px;}
#lesson .screen-fit .screen-page-track .logging-controls,#lesson .screen-fit .screen-page-track .completion-panel {break-inside:avoid;margin:12px 0;}
.screen-activity-picker {display:none;font:inherit;max-width:50%;min-width:0;padding:8px;border:1px solid #aaa294;border-radius:8px;background:white;color:#28313b;}
@media(max-width:700px),(max-height:540px){
#lesson .screen-fit.focused-teaching {inset:4px;padding:10px!important;grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 48px;gap:8px;}
#lesson .screen-fit.focused-teaching>.tooltime-shortcuts {display:none;}
#lesson .screen-fit.focused-teaching>[data-activity],#lesson .screen-fit.focused-teaching>.activity-navigation {grid-column:1;}
#lesson .screen-fit.focused-teaching>.teaching-view-controls {justify-content:space-between;gap:6px;}
#lesson .screen-fit.focused-teaching>[data-activity] {padding:12px!important;}
.screen-activity-picker {display:block;}
#lesson .screen-fit.focused-teaching>.teaching-view-controls button {font-size:.8rem;padding:8px;}
}
}
@media print{.screen-activity-picker{display:none!important}.screen-page-track{height:auto!important;column-width:auto!important;transform:none!important}.screen-page-viewport{overflow:visible!important;height:auto!important}}
/* Leave the live completion controls in their original DOM and fit them below Wrap-Up. */
@media screen {
body.screen-teaching.tooltime-wrap-up #lesson .screen-fit {grid-template-rows:44px minmax(0,1fr) 52px 140px;}
body.screen-teaching.tooltime-wrap-up .logging-heading {display:none!important;}
body.screen-teaching.tooltime-wrap-up .logging-controls {position:fixed;z-index:1001;left:250px;bottom:40px;width:180px;margin:0;padding:8px;background:#fff;border:1px solid #b7c2ce;border-radius:10px;}
body.screen-teaching.tooltime-wrap-up .completion-panel {position:fixed;z-index:1001;left:445px;right:30px;bottom:24px;margin:0;padding:8px 14px;background:#fff;border:1px solid #b7c2ce;border-radius:10px;}
body.screen-teaching.tooltime-wrap-up .completion-panel p,body.screen-teaching.tooltime-wrap-up .completion-panel h3 {font-size:1rem;margin:4px 0;}
@media(max-width:700px),(max-height:540px){
body.screen-teaching.tooltime-wrap-up .logging-controls {left:18px;width:160px;bottom:28px;}
body.screen-teaching.tooltime-wrap-up .completion-panel {left:190px;right:18px;bottom:18px;}
}
}
@media screen {
body.screen-teaching .weekly-visual-dialog {max-height:94dvh;overflow:hidden;}
body.screen-teaching .enlarged-weekly-visual img {max-height:calc(94dvh - 100px);object-fit:contain;}
body.screen-teaching .enlarged-weekly-visual .week-one-visual-picture {max-height:calc(94dvh - 230px);}
}

/* Compact reading and complete visuals within the available teaching screen. */
@media screen {
#lesson .screen-fit.focused-teaching {padding:12px!important;grid-template-columns:190px minmax(0,1fr);grid-template-rows:38px minmax(0,1fr) 44px;gap:8px 12px;}
#lesson .screen-fit.focused-teaching > [data-activity] {padding:12px 16px!important;}
#lesson .screen-fit.focused-teaching > .tooltime-shortcuts {gap:4px;padding:8px;overflow:auto;}
#lesson .screen-fit.focused-teaching > .tooltime-shortcuts a {padding:7px 9px;min-height:32px;font-size:.85rem;}
#lesson .screen-fit .screen-page-track {--lesson-density:1;}
#lesson .screen-fit .screen-page-track p,
#lesson .screen-fit .screen-page-track li {font-size:max(16px,calc(clamp(16px,1.25vw,20px) * var(--lesson-density)));line-height:1.3;margin-top:0;margin-bottom:.35em;}
#lesson .screen-fit .screen-page-track :is(h1,h2,h3,h4) {font-size:1.1rem;line-height:1.2;margin:0 0 8px!important;padding:0 0 6px!important;}
#lesson .screen-fit .screen-page-track :is(.tooltime-part,.practice-part,.practice-game,.iverson-message,.lesson-script,.script) {margin-top:8px;padding-top:0;}
#lesson .screen-fit .screen-page-track :is(ul,ol) {margin-top:6px;margin-bottom:8px;}
#lesson .screen-fit .screen-page-track :is(.tooltime-lesson-heading,.lesson-start) {margin-bottom:8px;}
#lesson .screen-fit .screen-page-track :is(.week-two-visual,.week-three-visual) {margin:8px 0;break-inside:avoid;}
#lesson .screen-fit .screen-page-track :is(.week-two-visual,.week-three-visual) img {width:auto;max-width:100%;height:auto;max-height:min(230px,calc(var(--screen-height) * .42));margin:auto;object-fit:contain;}
#lesson .screen-fit .screen-page-track .week-one-visual {gap:6px;margin:8px 0;max-height:none;}
#lesson .screen-fit .screen-page-track .week-one-visual-picture {aspect-ratio:1;width:min(120px,calc(var(--screen-height) * .24));max-width:100%;height:min(120px,calc(var(--screen-height) * .24));margin:auto;background-size:200% 200%;}
#lesson .screen-fit .screen-page-track .week-one-visual-label {font-size:.9rem;padding:4px;}
#lesson .screen-fit .screen-page-track .week-one-visual-card p {font-size:.875rem;line-height:1.2;padding:6px;margin:0;}
#lesson .screen-fit .screen-page-track .enlarge-visual {font-size:.85rem;min-height:30px;padding:5px 10px;margin:4px 0 8px;}
#lesson .screen-fit .screen-page-track .discussion-questions li {padding:8px;margin-bottom:8px;}
#lesson .screen-fit .screen-page-track .lesson-resources {gap:6px;margin:8px 0;}
#lesson .screen-fit .screen-page-track .lesson-resources a {font-size:.95rem;padding:6px 10px;}
#lesson .screen-fit .screen-page-track img {height:auto;}
@media(max-width:700px),(max-height:540px){
#lesson .screen-fit.focused-teaching {grid-template-columns:minmax(0,1fr);grid-template-rows:38px minmax(0,1fr) 42px;padding:8px!important;gap:6px;}
#lesson .screen-fit.focused-teaching > [data-activity] {padding:10px!important;}
}
}

/* Keep the approved Week 3 script compact and distinguish teacher actions. */
#lesson .teacher-direction {font-style:italic;color:#465365;}
#lesson .teacher-speech {white-space:pre-wrap;}

/* Readable teaching text: long scripts get more pages instead of smaller type. */
@media screen {
#lesson .screen-fit .screen-page-track p,
#lesson .screen-fit .screen-page-track li {font-size:clamp(20px,1.8vw,28px);line-height:1.4;margin-bottom:.45em;}
#lesson .screen-fit .screen-page-track :is(h1,h2,h3,h4) {font-size:clamp(22px,2vw,30px);line-height:1.25;}
#lesson .screen-fit.focused-teaching {grid-template-rows:72px minmax(0,1fr) 52px;}
#lesson .screen-fit.focused-teaching > .teaching-view-controls {flex-wrap:wrap;align-content:start;gap:4px 10px;}
#lesson .teaching-lesson-context {flex:0 0 100%;font-size:1rem;font-weight:700;margin:0;text-align:left;line-height:1.35;}
#lesson .screen-fit .activity-navigation button {font-size:1rem;max-width:40%;white-space:normal;}
#lesson .screen-fit .activity-progress {text-align:center;}
body.screen-teaching.tooltime-wrap-up #lesson .screen-fit {grid-template-rows:72px minmax(0,1fr) 52px 140px;}
@media(max-width:700px),(max-height:540px){
#lesson .screen-fit.focused-teaching {grid-template-rows:86px minmax(0,1fr) 60px;}
#lesson .teaching-lesson-context {font-size:.875rem;}
#lesson .screen-fit .activity-navigation button {font-size:.875rem;padding:6px 10px;}
body.screen-teaching.tooltime-wrap-up #lesson .screen-fit {grid-template-rows:86px minmax(0,1fr) 60px 140px;}
}
}
@media print {.teaching-lesson-context {display:none;}}

/* Bound every teaching card to its grid row so long content paginates. */
@media screen {
#lesson .screen-fit.focused-teaching > [data-activity] {height:100%;max-height:100%;align-self:stretch;box-sizing:border-box;}
}

/* One teaching panel; open the activity list only when needed. */
@media screen {
#lesson .screen-fit.focused-teaching {grid-template-columns:minmax(0,1fr);}
#lesson .screen-fit.focused-teaching > [data-activity],
#lesson .screen-fit.focused-teaching > .activity-navigation {grid-column:1;}
#lesson .screen-fit.focused-teaching > .tooltime-shortcuts {display:none;}
#lesson .screen-fit.focused-teaching.activity-menu-open > .tooltime-shortcuts {display:flex;position:absolute;z-index:10;top:92px;left:12px;width:min(320px,calc(100% - 24px));max-height:calc(100% - 160px);overflow:auto;box-sizing:border-box;box-shadow:0 8px 24px #0004;border:1px solid #737b82;border-radius:10px;background:#293036;}
#lesson .screen-fit .screen-activity-picker {display:none!important;}
#lesson .screen-fit .activity-navigation button {min-width:100px;}
body.screen-teaching.tooltime-wrap-up .logging-controls {left:30px;}
body.screen-teaching.tooltime-wrap-up .completion-panel {left:225px;}
@media(max-width:700px),(max-height:540px){
#lesson .screen-fit.focused-teaching.activity-menu-open > .tooltime-shortcuts {top:106px;}
body.screen-teaching.tooltime-wrap-up .logging-controls {left:18px;}
body.screen-teaching.tooltime-wrap-up .completion-panel {left:190px;}
}
}

/* Keep complete visuals readable when a screen is too narrow for column pages. */
@media screen {
#lesson .screen-fit .screen-page-viewport.continuous-reading {overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;}
#lesson .screen-fit .continuous-reading .screen-page-track {height:auto!important;columns:auto!important;transform:none!important;padding-bottom:16px;}
#lesson .screen-fit .screen-page-track .week-one-visual-card {break-inside:avoid;}
#lesson .screen-fit .continuous-reading .week-one-visual {max-height:none;break-inside:auto;}
#lesson .screen-fit .continuous-reading .week-one-visual-card {align-self:start;}
#lesson .screen-fit .continuous-reading :is(figure,.week-two-visual,.week-three-visual) {max-height:none;}
#lesson .screen-fit .continuous-reading img {max-width:100%;}
}
