/* Presentation chrome follows CSS viewport height, with readable zoom floors. */
:root{--viewport-height:100vh;--header-height:max(3rem,5vh);--footer-height:max(1.75rem,3vh);--header-font:max(.875rem,1.6vh);--footer-font:max(.875rem,1.4vh);--chrome-gap:max(.375rem,1vh);--bar-padding:max(.2rem,.3vh)}
@supports(height:100dvh){:root{--viewport-height:100dvh;--header-height:max(3rem,5dvh);--footer-height:max(1.75rem,3dvh);--header-font:max(.875rem,1.6dvh);--footer-font:max(.875rem,1.4dvh);--chrome-gap:max(.375rem,1dvh);--bar-padding:max(.2rem,.3dvh)}}
html,body{margin:0;height:100%;font-family:Arial,sans-serif;color:#172b3a}*:not(.reveal .slides, .reveal .slides *){box-sizing:border-box}a{color:#175d85}button,input,select{font:inherit}button,select{padding:8px 12px}button{cursor:pointer;border:1px solid #8d9ea9;border-radius:5px;background:#f8fafb;color:#172b3a}button:hover{background:#e7f0f5}button:disabled{cursor:default;opacity:.6}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #277ba8;outline-offset:3px}[hidden]{display:none!important}#bar{height:var(--header-height);display:flex;flex-wrap:nowrap;align-items:center;gap:var(--chrome-gap);padding:var(--bar-padding) var(--chrome-gap);background:#f3f5f6;font-size:var(--header-font);white-space:nowrap;position:relative;z-index:45}#connection{margin-left:auto;font-size:inherit}#course-menu{position:fixed;top:calc(var(--header-height) + .1rem);left:var(--chrome-gap);z-index:80;background:white;border:1px solid #a7b5bf;border-radius:8px;box-shadow:0 4px 24px #0003;padding:1em;width:min(24em,calc(100vw - 2 * var(--chrome-gap)));max-height:calc(var(--viewport-height) - var(--header-height) - var(--footer-height) - .25rem);overflow:auto;font-size:var(--header-font)}#course-menu a,#course-menu button,#course-menu label,#release-status{display:block;margin:8px 0}#course-menu a{padding:7px 0}#slide-picker{display:block;width:100%;margin-top:8px}#release-status{color:#536570}#login{max-width:640px;margin:8vh auto;padding:25px}#login h1{font-size:30px;margin-bottom:20px}#login p{line-height:1.6}#login label{display:block;margin:20px 0}#login input{display:block;width:100%;margin-top:8px;padding:12px}#room{height:calc(var(--viewport-height) - var(--header-height))}.reveal{height:calc(100% - var(--footer-height))}#slide-number{display:block;text-align:center;font:inherit;background:#f3f5f6;color:#3c5363}#message{position:fixed;bottom:calc(var(--footer-height) + .25rem);left:var(--chrome-gap);z-index:100;background:#fff0ca;border:1px solid #b88a32;border-radius:5px;max-width:calc(100% - 2 * var(--chrome-gap));margin:0;padding:.6em;font-size:var(--header-font);line-height:1.4}#message:empty{display:none}#quiz-panel,#submission-panel{position:fixed;inset:calc(var(--header-height) + var(--chrome-gap)) 5vw auto;max-width:70em;max-height:calc(var(--viewport-height) - var(--header-height) - var(--footer-height) - 2 * var(--chrome-gap));overflow:auto;margin:auto;z-index:60;background:white;border:1px solid #8b9da9;box-shadow:0 10px 80px #0006;border-radius:12px;padding:26px;font-size:20px;line-height:1.45}#quiz-panel h2,#submission-panel h2{font-size:clamp(21px,2.5vw,34px);margin:4px 80px 12px 0;line-height:1.25}#quiz-hide,#submission-hide{float:right;font-size:16px}#quiz-round{font-size:15px;color:#536570;margin:5px 0 15px}#quiz-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0;font-size:17px}#choices{border:0;padding:0;margin:16px 0}#choices label{display:flex;align-items:baseline;gap:12px;margin:10px 0;padding:12px;border:1px solid #ccd6dd;border-radius:8px;text-align:left;font-size:20px}#choices label:has(:checked){background:#e5f1f8;border-color:#277ba8}#choices input{flex:none;width:20px;height:20px;accent-color:#175d85}#selection-help,#quiz-status{margin:12px 0}#respondent-total{font-weight:bold;margin:12px 0;font-size:23px}#qr-view{text-align:center;padding:5px}#qr-code svg{display:block;width:min(33vh,380px);height:auto;max-width:100%;margin:0 auto;background:white;shape-rendering:crispEdges}#quiz-link{display:block;overflow-wrap:anywhere;font-size:clamp(17px,2vw,25px);margin:10px 0}#qr-view p{font-size:18px}#results{margin:22px 0} .result-row{display:grid;grid-template-columns:minmax(150px,2fr) minmax(100px,3fr) max-content;gap:16px;align-items:center;margin:14px 0}.bar-track{height:30px;background:#e8eef2;border-radius:3px;overflow:hidden}.bar-fill{height:100%;background:#277ba8}.result-count{font-variant-numeric:tabular-nums;font-weight:bold}.activity-controls{display:flex;flex-direction:column;gap:14px;font:22px/1.3 Arial,sans-serif;justify-content:center;height:100%}.activity-controls button{font-size:22px}.reveal .workspace-actions{display:flex;justify-content:center;gap:18px;margin:24px 0;font:22px/1.3 Arial,sans-serif}.reveal .workspace-actions a{font-size:22px;padding:8px 12px;border:1px solid #8d9ea9;border-radius:5px}.reveal aside.notes{display:none}.reveal .waiting{font-size:28px;color:#777}#submission-list{padding-left:25px}#submission-list li{margin:16px 0;font-size:17px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}body.focused #room,body.focused #quiz-hide,body.focused #lecturer-controls,body.focused #quiz-view{display:none!important}body.focused #quiz-panel{position:relative;inset:auto;max-width:760px;max-height:none;margin:20px auto;box-shadow:none;border:0;border-radius:0}body.focused #quiz-panel h2{margin-right:0}body.focused #quiz-actions{display:none!important}@media(max-width:700px){#quiz-panel,#submission-panel{inset:calc(var(--header-height) + .25rem) .5rem auto;max-height:calc(var(--viewport-height) - var(--header-height) - var(--footer-height) - .5rem);padding:18px;font-size:17px}#quiz-panel h2{margin-right:0;padding-top:42px}body.focused #quiz-panel h2{padding-top:0}#quiz-hide{position:absolute;right:15px;top:10px}#choices label{font-size:18px}#quiz-actions{font-size:15px;gap:7px}.result-row{grid-template-columns:minmax(110px,2fr) minmax(50px,1fr) max-content;gap:8px;font-size:16px}#qr-code svg{width:min(55vw,360px)}body.focused #quiz-panel{margin:0 auto}#login{margin:3vh auto}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}

#qr-enlarge{font-size:15px;margin-bottom:8px}#qr-enlarged{width:100vw;height:100dvh;max-width:none;max-height:none;inset:0;margin:0;border:0;padding:18px;text-align:center;background:white;color:#172b3a}#qr-enlarged::backdrop{background:#0008}#qr-shrink{position:absolute;right:18px;top:16px;z-index:1}#large-code svg{display:block;width:min(calc(100dvh - 130px),85vw);height:auto;max-height:calc(100dvh - 130px);margin:45px auto 0;shape-rendering:crispEdges}#large-link{display:block;font-size:clamp(15px,2vw,24px);overflow-wrap:anywhere;margin:12px auto;max-width:95%}
.reveal .activity-controls button,.reveal .workspace-actions button{font:22px/1.3 Arial,sans-serif;padding:8px 12px;border:1px solid #8d9ea9;height:auto;width:auto;align-self:center}.reveal .workspace-actions{align-items:center;margin:12px 0 0}

#submission-list{list-style:none;padding:0}
#submission-list li{border-top:1px solid #cbd7de;padding:12px 0}
#submission-list li p{margin:4px 0}
#submission-list .submission-detail{font:13px/1.5 ui-monospace,monospace;overflow-wrap:anywhere;color:#4a606e}
.submission-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px}
.submission-actions a{font-size:15px}
#submission-list .selected-snapshot{border-left:4px solid #277ba8;padding-left:12px;background:#f1f7fb}
#submission-status{font-size:16px;color:#4a606e}
.reveal .slides section.viewing-snapshot{height:100%;padding:0!important;top:0!important}

.reveal .snapshot-viewer{position:absolute;inset:0;display:flex;flex-direction:column;gap:10px;background:white;text-align:left;color:#172b3a;font:17px/1.35 Arial,sans-serif;z-index:10;padding:12px;border:1px solid #acbec9;border-radius:6px;overflow:hidden}
.reveal .snapshot-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex:none}
.reveal .snapshot-toolbar button,.reveal .snapshot-toolbar a{font:17px/1.3 Arial,sans-serif;padding:7px 10px}
.reveal .snapshot-toolbar a{font-size:15px;text-decoration:underline}
.reveal .snapshot-metadata{font:14px/1.4 ui-monospace,monospace;overflow-wrap:anywhere;margin:0;flex:none}
.reveal .snapshot-status{font:14px/1.3 Arial,sans-serif;margin:0;color:#526875;flex:none}
.reveal .snapshot-frame{flex:1;width:100%;min-height:150px;max-width:100%;max-height:none;margin:0;border:1px solid #cbd7de;background:white}

/* Preserve the original L09 slide container geometry under the app shell. */
.reveal section[data-lesson="L09"]{box-sizing:content-box}

/* Each prepared section owns its layout; navigation need not relayout siblings. */
.reveal .slides>section{contain:layout style}
/* Reveal marks noncurrent sections hidden even in overview. Limit the override
   to its slide boxes; login, notes, panels and private elements stay hidden. */
.reveal.overview .slides>section[hidden]{display:block!important}
.reveal.overview .slides>section .fragment{opacity:1;visibility:visible}
body.speaker-frame #bar,body.speaker-frame #slide-number{display:none}
body.speaker-frame #room,body.speaker-frame .reveal{height:100%}
body.speaker-frame .activity-controls,body.speaker-frame .workspace-actions{pointer-events:none}
#course-title{min-width:0;overflow:hidden;text-overflow:ellipsis}
#sharing-status{font-size:inherit}

/* Keep a short primary menu and one page for each set of ordinary tools. */
#course-menu select{display:block;width:100%;min-width:0;margin-top:6px}
#course-menu button{font:inherit;width:100%;min-height:2.625em;text-align:left}
#course-menu h2{font-size:1.2em;margin:.75em 0}
#course-menu p{font-size:1em;line-height:1.4;margin:.75em 0 .25em;color:#536570}
#course-menu footer{border-top:1px solid #ccd6dd;margin-top:18px;padding-top:8px}
#course-menu footer button{border:0;background:none;text-decoration:underline}
#maintenance-panel{max-width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid #8b9da9;border-radius:10px;padding:24px;font:18px/1.5 Arial,sans-serif;color:#172b3a}
#maintenance-panel::backdrop{background:#0006}
#maintenance-panel button{max-width:100%;white-space:normal}
#reset-scope label{display:block;margin:12px 0}
#reset-confirmation{display:block;width:100%;box-sizing:border-box;margin-top:6px}
#reset-confirm{color:#841c1c;border-color:#b76565}

#message-close{margin-left:12px}
#course-footer{height:var(--footer-height);display:grid;grid-template-columns:minmax(0,1fr) auto minmax(max-content,1fr);align-items:center;gap:var(--chrome-gap);padding:0 var(--chrome-gap);background:#f3f5f6;font:var(--footer-font)/1.25 Arial,sans-serif;color:#3c5363;white-space:nowrap}
#course-author{min-width:0;overflow:hidden;text-overflow:ellipsis}
#slide-number{flex:none;font:inherit;text-align:right;height:auto}
body.speaker-frame #course-footer{display:none}
@media(max-width:1000px){#course-author{display:none}#course-footer{grid-template-columns:minmax(0,1fr) auto}}
@media(max-width:700px){#course-date{display:none}}

#course-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}#sharing-status,#menu-toggle,#connection{flex-shrink:0}

#course-logo{height:calc((var(--header-height) - 2 * var(--bar-padding)) * .84);width:auto;max-width:22vw;object-fit:contain;flex:none}
#bar #connection{margin-left:0}
#course-footer #slide-number{font:inherit}
.reveal .ex-container:has(.snapshot-viewer),.reveal [data-astro-viewer]{position:relative;height:480px;width:100%;display:block;min-height:0}


/* Compact classroom widgets retain their intrinsic slide geometry. */
.reveal .slides section.compact-quiz{height:auto}
.reveal .compact-quiz .activity-controls{position:static;height:auto;margin:.5em 0 0;display:flex;flex-direction:row;gap:16px;align-items:center}
.reveal .compact-quiz .grid-container{position:static}
#quiz-display.with-results{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:24px;align-items:center}
#quiz-display #results{margin:0}#qr-code svg{width:280px;max-width:100%;height:auto}
#quiz-display.with-results #qr-code svg{width:240px}#qr-enlarge{display:block;border:0;background:white;padding:0;margin:0 auto;max-width:100%}
#qr-view p{margin:4px 0;font-size:15px}#quiz-actions{margin:12px 0 0}#quiz-round{margin:4px 0 12px}
#submission-list li{display:flex;align-items:center;gap:12px;margin:0;padding:10px 0}
#submission-list .submission-actions{margin:0 0 0 auto;flex-wrap:nowrap;gap:8px}.submission-actions button{white-space:nowrap}
.submission-badge{font-size:13px;color:#175d85}.reveal .workspace-actions{margin:4px 0}
.reveal .slides section.viewing-snapshot{display:flex!important;flex-direction:column;height:100%;box-sizing:border-box}
.reveal .slides section.viewing-snapshot>:not([data-astro-viewer]):not(h1):not(h2):not(h3){display:none!important}
.reveal .slides section.viewing-snapshot>h3{opacity:1;pointer-events:auto;flex:none;margin:0 0 8px}
.reveal .slides section.viewing-snapshot>[data-astro-viewer]{flex:1;height:auto;min-height:0;opacity:1;pointer-events:auto}
.reveal .snapshot-viewer{padding:0;border:0;gap:5px}.reveal .snapshot-owner{margin-right:auto;font-weight:bold}
.reveal .snapshot-toolbar{flex-wrap:nowrap}.reveal .snapshot-toolbar button{white-space:nowrap}.reveal .snapshot-frame{min-height:0;max-height:none}
@media(max-width:700px){#quiz-display.with-results{display:flex;flex-direction:column;gap:10px}#quiz-display.with-results #qr-code svg{width:200px}#submission-list li{gap:6px;flex-wrap:wrap}#submission-list .submission-actions{gap:4px}#submission-list button{padding:7px;font-size:14px}}

/* A notebook is a reading surface: temporarily use the full room without
   Reveal's slide scaling, then restore the unchanged slide geometry on Back. */
body.notebook-open .reveal .slides{width:100%!important;height:100%!important;left:0!important;top:0!important;transform:none!important;zoom:1!important}
body.notebook-open .reveal .slides>section.viewing-snapshot{width:100%!important;height:100%!important;transform:none!important;padding:12px 18px!important;margin:0;max-width:none}
body.notebook-open .reveal .slides>section.viewing-snapshot>h3{font-size:24px;line-height:1.2;opacity:1}
body.notebook-open .reveal .snapshot-toolbar{font-size:16px;gap:8px}
@media(max-width:700px){body.notebook-open .reveal .slides>section.viewing-snapshot{padding:8px!important}body.notebook-open .reveal .slides>section.viewing-snapshot>h3{font-size:19px}body.notebook-open .reveal .snapshot-toolbar{flex-wrap:wrap;gap:4px}body.notebook-open .reveal .snapshot-toolbar button{font-size:13px;padding:6px}body.notebook-open .reveal .snapshot-owner{width:100%;font-size:15px}}

body.notebook-open .reveal > .controls { display:none; }

#bar button{font:inherit;line-height:1.25;padding:.35em .65em;max-height:100%}
#course-menu button,#course-menu select{padding:.5em .75em}
#course-menu a,#course-menu button,#course-menu label,#release-status{margin:.5em 0}
#course-menu footer{margin-top:1em;padding-top:.5em}
#course-menu select{white-space:nowrap;text-overflow:ellipsis}
#course-menu input{max-width:100%}
#course-status{display:flex;align-items:center;gap:.5em;min-width:0}
#course-status #connection{margin-left:0}
#room[data-presentation-layout="content-v2"] .reveal{--r-header-h:0px;--r-footer-h:0px}
body.notebook-open .reveal .snapshot-toolbar,body.notebook-open .reveal .snapshot-toolbar button,body.notebook-open .reveal .snapshot-toolbar a{font-size:var(--header-font)}
body.speaker-frame #room,body.speaker-frame .reveal{height:var(--viewport-height)}

/* Whole-course fullscreen retains the embedded slide canvas and both bars. */
html:fullscreen,html:fullscreen > body{width:100%;height:100%;overflow:hidden}
#panel-backdrop{position:fixed;left:0;right:0;top:var(--header-height);bottom:var(--footer-height);z-index:50;background:#172b3a22}
#qr-enlarged{top:var(--header-height);bottom:var(--footer-height);height:auto;max-height:calc(var(--viewport-height) - var(--header-height) - var(--footer-height));overflow:auto}
#large-code svg{width:min(calc(var(--viewport-height) - var(--header-height) - var(--footer-height) - 130px),85vw);max-height:calc(var(--viewport-height) - var(--header-height) - var(--footer-height) - 130px)}

/* Read-only exact-round choices beside the main lecturer QR. */
#quiz-display.with-options{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:24px;align-items:center}
#qr-options{list-style:none;margin:0;padding:0;min-width:0;overflow-wrap:anywhere}
#qr-options li{margin:12px 0}
@media(max-width:700px){#quiz-display.with-options{display:flex;flex-direction:column;align-items:stretch;gap:10px}#quiz-display.with-options #qr-view{align-self:center;max-width:100%}}
