/* Equations keep the same glyph size: a fraction is taller, never smaller. */
/* The reader restores its own place after changing views. */
html {overflow-anchor:none;}
.reader .equation {overflow-x:auto; overflow-y:hidden; max-width:100%; padding:18px 16px; margin:22px 0; scrollbar-width:thin;}
.reader img.display-math,.answer-body .equation img,.formula-list .equation img {min-height:0!important; max-height:none!important; min-width:0!important; max-width:none!important; object-fit:contain; vertical-align:middle;}
.reader img.inline-math {min-height:0!important; max-height:none!important; min-width:0!important; max-width:none!important; vertical-align:middle;}
.reader .inline-question {font-weight:700; line-height:1.85; margin:24px 0;}
.reader .answer-body h3 {font-size:21px;line-height:1.5;margin:30px 0 14px;}
.reader p,.answer-body p {font-size:18px;line-height:1.9;}
.reader table {line-height:1.7;}
.reader .table-scroll {overflow-x:auto;max-width:100%;}
.reader figcaption {font-size:15px;line-height:1.75;text-align:left;color:#3c5b4d;padding-top:16px;}
.reader figcaption .diagram-hint {font-size:12px;margin-top:8px;}
.reader {min-width:0;overflow-wrap:break-word;}
.reader .question-statement p {font-weight:700;}
.continuous-chapter .chapter-topic {padding:34px 0 22px;border-top:1px solid #cfdbd4;scroll-margin-top:185px;}
.continuous-chapter .chapter-topic h2 {font-size:27px;line-height:1.35;margin:12px 0 25px;}
.continuous-chapter .chapter-topic h3 {font-size:20px;line-height:1.5;margin:28px 0 12px;}
.continuous-chapter .chapter-intro {font-size:17px;color:#52645c;}
.topic-jump {display:block;margin:28px 0 38px;font-weight:700;}
.topic-jump select {display:block;width:100%;max-width:100%;margin-top:10px;padding:12px;border:1px solid #a3b7ad;background:#fff;border-radius:6px;font:inherit;}
@media(max-width:670px){.reader p,.answer-body p{font-size:17px}.reader .answer-body h3{font-size:20px}.reader .equation{padding:16px 12px}}
.math-inline{display:inline-block;max-width:100%;overflow-x:auto;vertical-align:middle;scrollbar-width:thin}
.formula-topic{scroll-margin-top:var(--reading-offset);border-top:2px solid #c5d6ca;margin-top:50px;padding-top:35px}
.formula-topic>h2{font-size:28px;font-weight:700;margin-bottom:25px}
.formula-explanation{margin-top:30px}
.formula-list .formula-explanation h3{border:0;padding:0;margin:30px 0 14px;font-size:20px}
.formula-list .formula-topic p{font-size:18px}
.continuous-chapter .formula-nav{position:static}
:root{--nav-offset:135px;--reading-offset:230px}
.chapter-jump-bar{position:sticky;top:var(--nav-offset);z-index:12;display:flex;align-items:center;gap:16px;background:#fffefb;border:1px solid #d7e0d9;border-radius:8px;padding:10px 14px;margin:25px 0 32px;box-shadow:0 3px 9px #193c3108}
.chapter-jump-bar .topic-jump{flex:1;min-width:0;margin:0}
.chapter-jump-bar .topic-jump>span{display:block;font-size:11px;color:#52645c}
.chapter-jump-bar .topic-jump select{margin:4px 0 0;padding:6px 25px 6px 0;border:0;background:transparent;font-size:14px;border-radius:0}
.continuous-chapter .chapter-topic{scroll-margin-top:var(--reading-offset)}
.diagram-open{display:block;background:#fff;width:100%;padding:0;cursor:zoom-in}
.diagram-hint{display:block;color:#365b50;margin-top:5px;font-size:11px}
#diagram-dialog{width:min(1240px,96vw);max-height:94vh;padding:18px}
#diagram-dialog>p{margin:4px 40px 15px 0;font-size:15px}
.diagram-zoom{overflow:auto;max-height:78vh;background:white}
.diagram-zoom img{display:block;width:100%;min-width:720px;height:auto}
.zoom-instruction{display:none}
@media(max-width:670px){.zoom-instruction{display:block;margin-bottom:12px;color:#52645c}}
.simple-home .start-card>.text-link{display:block;margin:19px auto 0}
@media(max-width:670px){:root{--nav-offset:110px;--reading-offset:208px}.chapter-jump-bar{padding:8px 10px;gap:9px;margin-left:-8px;margin-right:-8px}.chapter-jump-bar .topic-jump select{font-size:13px}.continuous-chapter{padding-left:20px;padding-right:20px}.reader figure{margin-left:0;margin-right:0;padding:9px}.diagram-hint{font-size:11px}.simple-nav button{font-size:12px}.simple-nav{gap:12px}.reader .chapter-topic h2{font-size:25px}#diagram-dialog{padding:13px}.question-statement p{font-size:17px}}

/* Give the lesson more room, with predictable offsets below both fixed rows. */
:root{--nav-offset:111px;--reading-offset:197px}
.topbar{height:64px}
aside{top:64px}
.simple-nav button{padding:12px 6px;line-height:20px;min-height:47px}
.chapter-jump-bar{padding:8px 12px}
.reader h1,.reader h2,.reader h3{text-wrap:pretty}
.chapter-topic:focus,.formula-topic:focus{outline:none}
.reader th,.reader td{font-variant-numeric:tabular-nums}
.topic-next{margin:30px 0 8px;border-top:1px solid #dce4de;padding-top:18px}
.topic-next a{display:block;color:#214c3f;text-decoration:none;padding:9px 0;line-height:1.6}
.topic-next a>span{display:block;font-size:12px;color:#536e60}
.topic-next strong{display:block;font-size:16px;font-weight:650}
.topic-next a:hover strong{text-decoration:underline;text-underline-offset:4px}
.reader p.worked-step{padding:14px 18px;border-left:3px solid #9eb9a8;background:#f6f8f4;margin:18px 0;line-height:1.9}
.diagram-toolbar{display:flex;gap:8px;margin:8px 0 12px}
.diagram-toolbar button{padding:10px 16px;border:1px solid #aec4b7;border-radius:6px;background:#f7f9f4;color:#234d3d;min-height:42px}
.diagram-toolbar button[aria-pressed="true"]{background:#214c3e;color:#fff;border-color:#214c3e}
.diagram-toolbar button:hover{border-color:#214c3e}
#diagram-dialog{width:min(1240px,96vw);max-height:94dvh;overflow:auto;overscroll-behavior:contain}
#diagram-dialog .diagram-zoom{display:flex;align-items:flex-start;justify-content:center;max-height:calc(94dvh - 170px);overflow:auto;overscroll-behavior:contain}
#diagram-dialog .diagram-zoom img{display:block;flex:none;width:auto;height:auto;min-width:0;max-width:100%;max-height:calc(94dvh - 170px);object-fit:contain;margin:auto}
#diagram-dialog .zoom-instruction{display:none}
#diagram-dialog.read-labels .diagram-zoom{display:block;max-height:calc(94dvh - 206px)}
#diagram-dialog.read-labels .diagram-zoom img{width:max(100%,1080px);min-width:1080px;max-width:none;max-height:none;height:auto;margin:0}
#diagram-dialog.read-labels .zoom-instruction{display:block;margin:0 0 10px;color:#52645c;line-height:1.6}
button,a,select{touch-action:manipulation}
button:focus-visible,a:focus-visible,select:focus-visible,.diagram-zoom:focus-visible{outline:3px solid #477c68;outline-offset:3px}
@media(max-width:670px){
  :root{--nav-offset:101px;--reading-offset:190px}
  .topbar{height:56px}
  .topbar .brandmark{width:37px;height:39px;font-size:27px}
  aside{top:56px}
  .simple-nav button{padding:10px 2px;min-height:45px}
  .chapter-jump-bar{padding:7px 10px}
  .reader p.worked-step{padding:12px 14px}
  #diagram-dialog .diagram-zoom,#diagram-dialog .diagram-zoom img{max-height:calc(94dvh - 238px)}
  #diagram-dialog.read-labels .diagram-zoom{max-height:calc(94dvh - 292px)}
  #diagram-dialog.read-labels .diagram-zoom img{max-height:none}
}
