/* Screen frame and unscaled controls. Load after stage-design.css. */
#frame-safe-insets{position:fixed;inset:0;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
@media screen{
 html[data-layout="stage"]{width:100%;height:100%;overflow:hidden;overflow:clip}
 body[data-layout="stage"]{width:100%;height:100dvh;min-height:0;overflow:hidden;overflow:clip;background:#02060c}
 body[data-layout="stage"] #presentation-canvas{position:fixed;left:var(--frame-left,0px);top:var(--frame-top,0px);width:1600px;height:900px;min-width:1600px;max-width:none;min-height:900px;max-height:none;margin:0;padding:0;overflow:hidden;isolation:isolate;container-type:size;container-name:presentation;transform:scale(var(--frame-scale,1));transform-origin:0 0;background:#050e1b}
 body[data-layout="stage"] #presentation-canvas #slide-stage{height:calc(900px - var(--header) - var(--footer));max-height:none;min-height:0}
 body[data-layout="stage"] #presentation-canvas .slide{overflow:hidden}
 body[data-layout="stage"] #presentation-canvas .credits{overflow-y:auto;overscroll-behavior:contain}
 body[data-layout="read"] #presentation-canvas{display:block;width:100%;height:auto;min-height:0;transform:none;container-type:normal;overflow:visible}
 body[data-layout="read"]{overflow:auto;min-height:100dvh}
 body[data-layout="read"] #slide-stage{height:calc(100dvh - var(--header) - var(--footer));min-height:420px;overflow:auto}
 body[data-layout="read"] .slide{overflow-y:auto}
 body[data-layout="read"] .intro-stage{overflow-y:auto!important}
 /* These siblings live outside the scaled slide, so notes and modals remain readable. */
 body[data-layout] #presenter-panel{position:fixed;left:auto;right:0;top:0;bottom:0;width:min(600px,100vw);height:100dvh;max-height:100dvh;padding:28px;overflow:auto;overscroll-behavior:contain;transform:none;padding-top:max(28px,env(safe-area-inset-top));padding-bottom:max(28px,env(safe-area-inset-bottom));z-index:150}
 body[data-layout] #presenter-panel #note-script{font-size:22px!important;line-height:1.55}
 body[data-layout] #presenter-panel #note-vi{font-size:18px!important;line-height:1.55}
 body[data-layout] #presenter-panel #note-keywords{font-size:25px;line-height:1.3}
 body[data-layout] #presenter-panel #note-handoff{font-size:18px;line-height:1.4}
 body[data-layout] dialog{position:fixed;max-height:calc(100dvh - 32px);max-width:calc(100vw - 32px);overflow-y:auto;overscroll-behavior:contain;transform:none}
 #display-settings{width:min(650px,calc(100vw - 32px));padding:30px;background:#0b1d2f;color:#eef4f3;border:1px solid #88b6c74d;border-radius:7px}
 #display-settings h2{font-size:clamp(32px,5vw,48px);line-height:1.05;letter-spacing:-.04em}
 #display-settings p{font-size:19px;line-height:1.5;color:#bfd0dc}
 #display-settings [data-layout]{font-size:19px;line-height:1.3;min-height:48px;padding:12px 16px;background:#163044;border:1px solid #83b4c64d;border-radius:4px;color:#eef4f3}
 #display-settings [data-layout][aria-pressed="true"]{background:#d7fa8b;color:#13222a;border-color:#d7fa8b}
 #display-settings label{display:flex;align-items:center;gap:12px;font-size:19px;line-height:1.4;margin:24px 0}
 #display-settings input[type="checkbox"]{width:24px;height:24px;accent-color:#d7fa8b}
 #display-settings #frame-status{font-size:16px;line-height:1.5;color:#9dd3df;margin-top:20px}
 #display-settings .display-options{display:flex;flex-wrap:wrap;gap:10px;margin:25px 0}
 #display-settings .close-btn{min-width:44px;min-height:44px}
}
@media print{
 #presentation-canvas{position:static!important;transform:none!important;width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;overflow:visible!important;container-type:normal!important}
 #frame-safe-insets,#display-settings{display:none!important}
}
