
/* ENTRE LOS DOS — screen-fit layout, v1. Target: 1366×768 @ 100% zoom.
   Keep long lessons, assessments and tables scrollable. */
:root{--eld-screen-gap:clamp(6px,1.15vh,12px)}
html{min-width:0}body{min-width:0;overflow-x:hidden}
*,*::before,*::after{box-sizing:border-box}
@media screen and (min-width:700px) and (max-height:900px){
 body{font-size:clamp(13px,1.65vh,16px)}
 .wrap{padding-block:var(--eld-screen-gap)!important}
 header,.library-header{padding-block:6px!important;min-height:0!important}
 .card,.panel{margin-block:6px!important;padding:clamp(9px,1.6vh,15px)!important}
 h1{font-size:clamp(19px,3.2vh,27px)!important;margin-block:4px!important}
 h2{font-size:clamp(17px,2.7vh,22px)!important;margin-block:5px!important}
 h3,p{margin-block:5px}
 .brand-logo,.worksheet-logo{max-height:clamp(46px,9vh,76px)!important;object-fit:contain}
 .library-heading,.library-heading-text{gap:5px}
 button,.button{min-height:32px;padding:6px 10px}
 input,select{min-height:32px;padding:6px 9px}
 .subject-options{gap:10px}
 .subject-option{padding:12px!important;min-height:0!important}
 .library-tabs{gap:5px}
 .library-tab{padding:7px 10px!important}
 .eld-app-version,footer[aria-label="App version"]{padding:3px 8px!important;margin-top:2px!important;font-size:10px!important}
}
/* Sign-in is intentionally compact in ordinary laptop browser windows. */
@media screen and (min-width:700px) and (max-height:900px){
 body:has(.shell #loginForm){min-height:100dvh;display:flex;flex-direction:column}
 body:has(.shell #loginForm) .shell{width:min(96vw,860px);max-width:860px!important;
  margin:0 auto!important;padding:clamp(5px,1vh,12px) 12px!important;flex:1 0 auto}
 body:has(.shell #loginForm) .page-brand{text-align:center}
 body:has(.shell #loginForm) .page-brand img{width:auto!important;max-width:210px!important;
  max-height:clamp(52px,10vh,85px)!important;object-fit:contain}
 body:has(.shell #loginForm) .shell>p{margin:3px 0!important;text-align:center}
 body:has(.shell #loginForm) .panel{margin:5px 0!important;padding:10px 18px!important}
 body:has(.shell #loginForm) .panel h2{margin:2px 0 5px!important}
 body:has(.shell #loginForm) .panel .note{font-size:12px;line-height:1.3;margin:4px 0!important}
 body:has(.shell #loginForm) #loginForm{display:grid;grid-template-columns:1fr 1fr;
  column-gap:14px;align-items:end}
 body:has(.shell #loginForm) #loginForm.hidden{display:none!important}
 body:has(.shell #loginForm) #loginForm label{margin:5px 0!important}
 body:has(.shell #loginForm) #loginForm input{margin-top:3px;padding:7px 9px!important}
 body:has(.shell #loginForm) #loginForm button{grid-column:1/-1;justify-self:start;margin:6px 0!important}
 body:has(.shell #loginForm) #forms>div>button{margin:4px 6px 4px 0!important}
 body:has(.shell #loginForm) footer{flex:0 0 auto;margin-top:0!important;padding:3px!important}
}
/* Only the sign-in view is constrained to one screen; registration may scroll. */
@media screen and (min-width:850px) and (max-height:850px){
 body:has(.shell #loginForm) #registerForm:not(.hidden){display:grid;grid-template-columns:1fr 1fr;gap:3px 14px}
 body:has(.shell #loginForm) #registerForm:not(.hidden) label{margin:3px 0!important}
 body:has(.shell #loginForm) #registerForm:not(.hidden) button{grid-column:1/-1;justify-self:start}
}
/* The home selection and library pages should not waste height on decorative areas. */
@media screen and (min-width:700px) and (max-height:850px){
 body:has(#subjects) .wrap{min-height:calc(100dvh - 25px);display:flex;flex-direction:column}
 body:has(#subjects) #subjects:not(.hidden){flex:0 0 auto}
 body:has(#subjects) #mainHeader:not(.hidden){flex:0 0 auto}
 body:has(#subjects) .eld-legacy-copyright{margin-top:auto!important}
 body:has(#subjects) .subject-screen{padding:10px 16px!important}
 body:has(#subjects) .subject-screen p{margin:3px 0!important}
 body:has(#subjects) .subject-option{min-height:58px!important}
}
/* Teacher portal: fixed viewport shell; the work region scrolls, not the entire navigation. */
@media screen and (min-width:850px) and (max-height:900px){
 body:has(.teacher-shell){height:100dvh;overflow:hidden}
 .teacher-shell{height:100dvh!important;min-height:0!important;overflow:hidden!important}
 .teacher-sidebar{max-height:100dvh;overflow-y:auto;overscroll-behavior:contain}
 .teacher-main{min-height:0!important;max-height:100dvh;overflow-y:auto!important;overscroll-behavior:contain}
 .teacher-main .card{padding:10px 13px!important}
 .teacher-main h1,.teacher-main h2{margin:5px 0!important}
}
/* Activity toolbars remain compact; long question pages continue scrolling. */
@media screen and (max-height:850px){
 #eld-top-navigation{padding:3px 7px!important}
 .toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px!important;padding:4px!important}
 .toolbar button{margin:1px!important;padding:5px 8px!important}
 #practiceQuestions,#questions{min-width:0}
 .floating{max-height:calc(100dvh - 16px)}
}
/* Never hide important content at small widths, high zoom, or short screens. */
@media screen and (max-width:699px),screen and (max-height:550px){
 body:has(.teacher-shell){height:auto;overflow:auto}
 .teacher-shell{height:auto;min-height:100dvh}
 .teacher-main{max-height:none;overflow:visible}
 body:has(.shell #loginForm) #loginForm{display:block}
}
@media print{body:has(.teacher-shell){height:auto;overflow:visible}.teacher-shell,.teacher-main{height:auto;max-height:none;overflow:visible}}

/* Global scroll-end accessibility correction, Nov 2026.
   Do not clip the document to a 100dvh shell; reserve bottom clearance. */
html{height:auto!important;min-height:100%;overflow-x:hidden;overflow-y:auto;scroll-padding-bottom:40px}
body{height:auto;min-height:100dvh;overflow-x:hidden;overflow-y:visible;scroll-padding-bottom:48px}
body:not(:has(.teacher-shell))::after{content:"";display:block;clear:both;height:clamp(36px,7vh,76px);pointer-events:none}
main,.wrap,.shell{min-height:0;overflow:visible;scroll-padding-bottom:64px}
main::after{content:"";display:block;clear:both;height:clamp(28px,6vh,65px);pointer-events:none}
.scroll,[class*="scroll"],#hubRows,#contentList{scroll-padding-bottom:60px}
.scroll::after{content:"";display:block;height:20px;pointer-events:none}
@media screen and (min-width:850px) and (max-height:900px){
 body:has(.teacher-shell){height:100dvh!important;overflow:hidden!important}
 .teacher-shell{height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow:hidden!important}
 .teacher-main,.teacher-sidebar{height:100%!important;min-height:0!important;max-height:100dvh!important;overflow-y:auto!important;overscroll-behavior:contain}
 .teacher-main{padding-bottom:clamp(70px,12vh,120px)!important;scroll-padding-bottom:90px!important}
 .teacher-main::after{content:"";display:block;clear:both;height:70px;pointer-events:none}
 .teacher-sidebar{padding-bottom:60px!important}
}
@media screen and (max-width:849px),screen and (max-height:550px){
 body:has(.teacher-shell){height:auto!important;overflow-y:auto!important}
 .teacher-shell{height:auto!important;min-height:100dvh!important;max-height:none!important;overflow:visible!important}
 .teacher-main,.teacher-sidebar{height:auto!important;max-height:none!important;overflow:visible!important}
}
/* Word bank width follows the number and actual width of words, not fixed 720px. */
#bankPanel.eld-bank-has-words{
 width:max-content!important;
 min-width:0!important;
 max-width:min(92vw,760px)!important;
 height:max-content;
 max-height:calc(100dvh - 30px)!important;
 overflow:auto;
 padding:10px 12px!important;
}
#bankPanel .word-bank-grid{
 display:grid!important;
 grid-template-columns:repeat(var(--eld-bank-columns,1),max-content)!important;
 justify-content:start!important;
 gap:4px 18px!important;
 width:max-content;
 max-width:100%;
 margin:6px 0!important;
}
#bankPanel .word-bank-grid li{max-width:min(24vw,220px);min-width:0;overflow-wrap:break-word}
#bankPanel .panel-hint{margin:3px 0!important}
@media screen and (max-width:620px){
 #bankPanel.eld-bank-has-words{max-width:calc(100vw - 16px)!important}
 #bankPanel .word-bank-grid{grid-template-columns:repeat(min(2,var(--eld-bank-columns,1)),minmax(0,1fr))!important;width:100%}
 #bankPanel .word-bank-grid li{max-width:100%}
}
.floating{max-height:calc(100dvh - 16px)!important;overscroll-behavior:contain}
@media print{
 body,html,main,.wrap,.shell{height:auto!important;overflow:visible!important}
 body::after,main::after,.teacher-main::after{display:none!important}
 .teacher-shell,.teacher-main{height:auto!important;max-height:none!important;overflow:visible!important}
}
