:root{--lecture-font:"Latin Modern Roman","Latin Modern Math",serif}
#viewer{width:min(1200px,97vw);max-height:98dvh;background:var(--paper)}
#viewer .viewer-head,#viewer .viewer-foot{background:var(--sheet);flex:none}
#viewer .viewer-head{padding:8px 17px}
#viewer .viewer-head h2{font:650 1.18rem/1.2 var(--serif)}
#viewer .viewer-foot{padding:8px 16px;flex-wrap:wrap}
#viewer #slide{padding:0;display:grid;justify-items:center;align-items:center;min-height:0;overflow:auto;background:#e4dfd5}
#viewer:fullscreen,:fullscreen #viewer{max-width:none;width:100vw;max-height:none;height:100dvh}
:fullscreen #viewer #slide{align-content:center}
#viewer select#count{appearance:auto;min-width:95px;width:min(190px,30vw);font:inherit;font-size:.88rem;text-align:left;border:1px solid var(--line);border-radius:5px;padding:6px 4px;background:var(--sheet);color:var(--ink)}
#pdf-download{border:1px solid var(--line);border-radius:5px;padding:7px 12px;background:var(--sheet);font-size:.88rem;color:var(--blue);font-weight:600}
#note-status{font-size:.76rem;color:var(--soft);flex:1;text-align:center}

/* Keep a fixed coordinate system for ink on desktop, touch screens and paper. */
.lecture-frame{
 --lecture-ink:#173652;--lecture-line:#ccd4d6;--lecture-red:#a8372a;
 box-sizing:border-box;width:1152px;height:648px;display:grid;
 grid-template-rows:minmax(0,1fr) 43px;background:#fdfbf6;color:#202b36;
 font-family:var(--lecture-font);position:relative;isolation:isolate;overflow:hidden;text-align:left;
}
.lecture-frame *{box-sizing:border-box}
#viewer .lecture-frame{zoom:var(--lecture-scale,1)}
.lecture-content{display:flex;flex-direction:column;min-height:0;min-width:0}
.lecture-heading{background:var(--lecture-ink);border-bottom:3px solid var(--lecture-red);color:#fff;padding:13px 43px 12px;display:flex;flex-direction:column;gap:3px}
.lecture-heading h3,#viewer .lecture-heading h3{font:700 36px/1.15 var(--lecture-font);letter-spacing:0;margin:0;color:inherit}
.lecture-unit{font:400 17px/1.2 var(--lecture-font);color:#dfebf0}
.lecture-material{
 --body-size:25px;min-height:0;min-width:0;flex:1;display:flex;flex-direction:column;
 justify-content:safe center;gap:.65em;margin:12px 43px 8px;
 font-size:var(--body-size);line-height:1.38;overflow-wrap:anywhere;
}
.lecture-material>*,.lecture-block>*{flex:none}
.lecture-material p{margin:0}
.lecture-block{background:#f0f4f4;border:1px solid var(--lecture-line);border-left:3px solid var(--lecture-ink);border-radius:5px;overflow:hidden}
.topic-bar{font:700 .83em/1.25 var(--lecture-font);color:var(--lecture-ink);padding:9px 14px 0;margin:0}
.lecture-block p{padding:7px 14px 10px}
.lecture-block p+p{padding-top:0}
.lecture-material>.diagram{align-self:center;width:43%;max-width:295px;border:1px solid var(--lecture-line);border-radius:5px;padding:4px;background:#fff}
.lecture-material .diagram figcaption{font:italic .7em/1.3 var(--lecture-font);color:var(--lecture-ink)}
.katex .latin_fallback{font-family:var(--lecture-font)}
.math-display{display:block;width:100%}
.math-display .katex-display{margin:.24em 0}
.math-display .katex-display>.katex{white-space:nowrap}
.math-display .katex-html,.math-inline .katex-html{display:inline-block}
.math-inline{display:inline-block;white-space:nowrap}
.lecture-footer{display:flex;gap:16px;align-items:center;font:400 15px/1.2 var(--lecture-font);color:var(--lecture-ink);margin:0 43px;border-top:1px solid var(--lecture-line)}
.lecture-footer span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lecture-footer span:nth-child(2){flex:1;text-align:center}
.lecture-footer span:last-child{min-width:20px;text-align:right;font-weight:bold}
.lecture-material.illustrated{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);align-items:center;align-content:safe center;gap:28px}
.lecture-explanation{display:flex;flex-direction:column;gap:.68em;min-width:0}
.math-figure{margin:0;min-width:0;background:#fff;border:1px solid var(--lecture-line);border-radius:5px;overflow:hidden}
.math-figure svg{display:block;width:100%;height:auto;padding:9px 7px;font:400 18px var(--lecture-font);stroke-linecap:round;stroke-linejoin:round}
.math-figure figcaption{border-top:1px solid var(--lecture-line);background:#f0f4f4;color:var(--lecture-ink);padding:9px 13px;font:italic 18px/1.35 var(--lecture-font)}

@media screen and (max-width:640px) and (orientation:portrait){
 #viewer[open]{width:100vw;max-width:100vw;max-height:99dvh;border-radius:7px}
 #viewer .viewer-foot{padding:7px;gap:4px}
 #viewer #note-status{order:5;flex-basis:100%}
 #viewer #pdf-download{font-size:.78rem;padding:5px}
}
@page{size:12in 6.75in;margin:0}
@media print{
 html,body{margin:0!important;padding:0!important;background:#fff!important}
 #print-pages .lecture-frame{break-inside:avoid;break-after:page;margin:0;zoom:1;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 #print-pages .lecture-frame:last-child{break-after:auto}
}
@media screen{#print-pages.measure-pages{display:block;position:fixed;left:-15000px;top:0;width:1152px;visibility:hidden}}
