/* One viewport per reading screen. Long material continues through the pager. */
html:has(.ls-ready),body:has(.ls-ready){height:100%;overflow:hidden!important}
body:has(.ls-ready)>nav,body:has(.ls-ready)>footer{display:none!important}
body:has(.ls-ready)>main{height:100dvh;min-height:0;max-width:none;padding:6px 10px;display:flex;flex-direction:column;overflow:hidden;flex:1}
.ls-ready.dh-shell,.ls-ready.viewer{height:100%;min-height:0!important;max-height:100dvh;display:flex!important;flex:1!important;flex-direction:column!important;gap:6px;overflow:hidden}
.ls-ready>header,.ls-ready>.dh-header,.ls-ready>.dh-controls,.ls-ready>.dh-actions,.ls-ready>footer,.ls-ready>.dh-solution-views{flex:none!important;margin:0}
.ls-ready .dh-controls{font-size:.85rem}
.ls-ready .dh-controls>form{padding:0!important}
.ls-ready .dh-controls small,.ls-ready #clock-label{display:none}
.ls-ready #homework-clock{margin:0;font-size:.75rem;gap:4px 8px}
.ls-ready #homework-clock button{padding:3px 8px;min-height:28px}
.ls-ready .btn,.ls-ready .button{min-height:32px;padding:5px 10px}
.ls-ready .dh-choices span{min-width:40px;min-height:40px}
.ls-ready .dh-header{font-size:.8rem;gap:4px 10px}
.ls-ready .dh-header .dh-title{min-width:0}
.ls-stage{display:flex;flex-direction:column;flex:1!important;min-height:0!important;min-width:0;gap:4px}
.ls-viewport{position:relative;flex:1;min-height:0;min-width:0;overflow:hidden;background:#fff;border-radius:8px;color:#172033}
.ls-track{position:relative;display:flow-root;width:100%;will-change:transform}
.ls-track .dh-media,.ls-track .page{display:block!important;height:auto!important;min-height:0!important;padding:0;overflow:visible;flex:none!important}
.ls-track .dh-media>figure{display:block;min-height:0;margin:0;padding:4px;overflow:visible}
.ls-track .dh-media[data-solution-display=solution]>figure:first-child,.ls-track .dh-media[data-solution-display=problem]>figure:last-child{display:none}
.ls-track .dh-media picture{display:block;width:100%}
.ls-track img,.ls-track picture img{display:block;width:100%!important;height:auto!important;max-height:none!important;min-height:0;object-fit:contain;flex:none!important}
.ls-track figcaption{padding:3px 8px;font-size:.8rem;font-weight:600;background:#e7eef7;color:#172033}
.ls-track .explanation-content{max-height:none;height:auto;overflow:visible;padding:12px;color:var(--text);background:var(--navy2)}
.ls-track .explanation-options label{break-inside:avoid}
.ls-pager{display:flex;align-items:center;justify-content:center;gap:10px;flex:none;font-size:.8rem;min-height:32px}
.ls-pager button{background:var(--navy2,#22334d);border:1px solid var(--gold,#d4ae55);border-radius:6px;color:inherit;font:inherit;padding:5px 10px;min-height:32px;cursor:pointer}
.ls-pager button:disabled{opacity:.4;cursor:default}
.ls-pager button:focus-visible,.ls-ready summary:focus-visible{outline:3px solid #d4ae55;outline-offset:2px}
.ls-menu,.ls-feedback{position:relative;flex:none!important;font-size:.8rem;border:1px solid #607087;border-radius:6px}
.ls-menu>summary,.ls-feedback>summary{padding:6px 10px;cursor:pointer;min-height:32px}
.ls-menu>.ls-popup,.ls-feedback>.ls-popup{display:none}
.ls-menu[open]>.ls-popup,.ls-feedback[open]>.ls-popup{display:block;position:absolute;z-index:30;top:100%;left:0;right:0;max-height:65dvh;overflow:auto;background:var(--navy2,#22334d);padding:8px;border:1px solid #607087;border-radius:6px}
.ls-feedback{background:#fef3c7;color:#172033}
.ls-feedback.ls-correct{background:#dcfce7}
.ls-feedback .ls-key{border:2px solid currentColor;border-radius:3px;padding:1px 5px;margin-left:5px;font-weight:bold}
.ls-feedback .ls-popup{color:#172033;background:#fef3c7!important}
.ls-feedback.ls-correct .ls-popup{background:#dcfce7!important}
.ls-ready .hw-navigation{margin:0;border:0}
.ls-ready>.dh-notice{font-size:.75rem;margin:0}
@media(min-width:1100px){.ls-track .dh-media[data-solution-display=both]{display:grid!important;grid-template-columns:1fr 1fr;align-items:start;gap:8px}}
@media(max-height:500px){
 body:has(.ls-ready)>main{padding:3px 6px}
 .ls-ready{gap:3px!important}
 .ls-ready .dh-header{font-size:.72rem}
 .ls-ready .dh-header .dh-title,.ls-ready>.dh-notice{display:none}
 .ls-ready .dh-controls{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
 .ls-ready .dh-controls>form,.ls-ready .dh-actions{gap:6px}
 .ls-ready .dh-controls fieldset legend{display:none}
 .ls-ready .dh-choices span{min-height:32px;min-width:36px}
 .ls-ready .dh-pager,.ls-ready .ls-pager{min-height:28px}
 .ls-ready .dh-solution-views{gap:4px}
}

.ls-ready .dh-solution-views button[aria-pressed=true]{background:var(--gold,#d4ae55);color:#101d30}
.ls-ready .dh-solution-views button[aria-pressed=false]{background:transparent;color:var(--gold2,#f0ce73)}
/* Videos use the available rectangle without pushing their controls below it. */
body:has(.ls-video-lesson){height:100dvh;overflow:hidden}
body:has(.ls-video-lesson)>nav,body:has(.ls-video-lesson)>footer{display:none}
body:has(.ls-video-lesson)>main{height:100dvh;min-height:0;max-width:none;padding:8px;display:flex}
.ls-video-lesson{display:flex;flex-direction:column;flex:1;min-height:0;gap:8px;margin:0;padding:8px}
.ls-video-lesson header{display:flex;align-items:center;gap:12px;flex-wrap:wrap;flex:none}
.ls-video-lesson h1{font-size:1.1rem;margin:0}
.ls-video-lesson video{display:block;width:100%;height:100%;min-height:0;flex:1;object-fit:contain;background:#000}
.ls-video-lesson details{flex:none;font-size:.85rem}
.ls-video-lesson details[open]{max-height:25dvh;overflow:auto}

.ls-pager[hidden]{display:none}

/* Persistent guidance: macOS may hide scrollbars even on long reading panels. */
.ls-scroll-hint{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;flex:none;padding:5px 8px;background:#e7eef7;color:#172033;border-radius:6px;font-size:.8rem;line-height:1.35}
.ls-scroll-hint[hidden]{display:none}
.ls-scroll-hint span{flex:1 1 230px}
.ls-scroll-hint button{font:inherit;padding:4px 8px;border:1px solid #65758b;border-radius:5px;background:#fff;color:#172033;cursor:pointer;min-height:32px}
.ls-scroll-hint button:disabled{opacity:.45;cursor:default}
.ls-scroll-hint button:focus-visible{outline:3px solid #b38300;outline-offset:2px}

/* Document and staff-preview content use the same intact scrolling panel. */
.ls-ready[data-document-scroll] .ls-track .page picture{display:block;width:100%}
.ls-ready[data-document-scroll] .preview-text{height:auto;max-height:none;overflow:visible;box-sizing:border-box}
