.chapter-page{overflow-x:hidden}.chapter-page main{overflow:visible}.chapter-links .is-current{color:var(--accent);border-color:var(--accent);background:var(--bg-soft)}
.chapter-hero,.chapter-section,.chapter-pagination{width:min(var(--max),calc(100% - 2rem));margin-inline:auto}.chapter-hero{padding:clamp(2rem,5vw,4.5rem) 0 clamp(3rem,7vw,6rem)}.chapter-kicker{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center;margin-bottom:1.5rem;color:var(--muted);font-size:.78rem}.chapter-kicker a{color:var(--muted);text-decoration:none}.chapter-kicker a:hover{color:var(--accent)}.chapter-kicker strong{color:var(--accent)}
.chapter-hero-grid{display:grid;grid-template-columns:.86fr 1.14fr;align-items:center;gap:clamp(2rem,5vw,5rem)}.chapter-hero-grid>*{min-width:0}.chapter-hero h1{margin:0;font-size:clamp(3.1rem,6.6vw,6.8rem);line-height:.9;letter-spacing:-.055em}.chapter-hero h1 span{color:var(--accent)}.chapter-lede{max-width:720px;margin:1.4rem 0 0;color:var(--muted);font-size:clamp(1rem,1.3vw,1.16rem)}.assumption-row{display:flex;flex-wrap:wrap;gap:.45rem;margin-top:1.5rem}.assumption-row span{padding:.45rem .65rem;border:1px solid var(--line);border-radius:999px;color:var(--muted);background:var(--panel);font:700 .7rem ui-monospace,monospace}.chapter-concept{margin:0;padding:.65rem;border:1px solid var(--line);border-radius:22px;background:var(--panel);box-shadow:0 24px 60px var(--shadow)}.chapter-concept img{width:100%;border-radius:16px}
.chapter-section{padding:clamp(3.5rem,7vw,6.5rem) 0;border-top:1px solid var(--line)}.concept-grid,.insight-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin-top:2rem}.concept-card,.insight-grid article{padding:1.1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.concept-card h3,.insight-grid h3{margin:.45rem 0 .6rem}.concept-card p,.insight-grid p{margin:.55rem 0 0;color:var(--muted);font-size:.9rem}.formula{padding:.75rem .85rem;border:1px solid var(--line);border-radius:10px;background:var(--bg-soft);color:var(--accent);font:700 .86rem ui-monospace,monospace;overflow-wrap:anywhere}.bridge-panel{display:grid;grid-template-columns:.8fr 1.2fr;gap:1rem;margin-top:1rem;padding:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg-soft)}.bridge-panel h3{margin:.25rem 0}.bridge-panel>p{grid-column:1/-1;margin:0;color:var(--muted)}.bridge-equation{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center;justify-content:flex-end}.bridge-equation span{color:var(--muted);font-size:.72rem}.bridge-equation b{padding:.65rem .8rem;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--accent);font:700 .82rem ui-monospace,monospace}.bridge-equation i{color:var(--accent-2);font-style:normal;font-weight:800}
.lab-shell{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:1rem;margin-top:2rem}.lab-main,.control-panel{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.lab-main{min-width:0;overflow:hidden}.lab-toolbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.8rem 1rem;border-bottom:1px solid var(--line)}.lab-toolbar-title{display:grid;grid-template-columns:auto 1fr;column-gap:.55rem;align-items:center}.lab-toolbar-title .status-dot{grid-row:1/3}.lab-toolbar-title small{color:var(--muted);font-size:.68rem}.status-dot{width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 15%,transparent)}.lab-actions{display:flex;gap:.45rem}.lab-button{min-height:36px;padding:.45rem .7rem;border:1px solid var(--line);border-radius:9px;background:var(--bg-soft);color:var(--text);font:inherit;font-size:.76rem;font-weight:750;cursor:pointer}.lab-button:hover{border-color:var(--line-strong)}.lab-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.plot-grid{display:grid;gap:.7rem;padding:.75rem}.plot-card{min-width:0;border:1px solid var(--line);border-radius:14px;background:var(--nav-bg);overflow:hidden}.plot-card header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.6rem .75rem;border-bottom:1px solid var(--line)}.plot-card header strong{font-size:.78rem}.plot-card header span{color:var(--muted);font-size:.65rem}.plot-card svg{width:100%;height:auto;display:block}.plot-bg{fill:var(--nav-bg)}.grid-line{stroke:var(--line);stroke-width:1;opacity:.72}.axis-line{stroke:var(--line-strong);stroke-width:1.2}.axis-text{fill:var(--muted);font-family:ui-monospace,monospace;font-size:10px}.reference-path{fill:none;stroke:var(--line-strong);stroke-width:2;stroke-dasharray:8 7}.exact-path{fill:none;stroke:var(--text);stroke-width:4;stroke-linecap:round}.linear-path{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-dasharray:8 6;stroke-linecap:round}.exact-dot{fill:var(--accent-2);stroke:var(--nav-bg);stroke-width:3}.linear-dot{fill:var(--accent);stroke:var(--nav-bg);stroke-width:3}.error-path{fill:none;stroke:var(--accent-2);stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}.selection-line{stroke:var(--accent);stroke-width:1.5;stroke-dasharray:6 5}.selection-dot{fill:var(--accent);stroke:var(--nav-bg);stroke-width:3}
.lab-legend{display:flex;flex-wrap:wrap;gap:.75rem 1rem;padding:.2rem 1rem 1rem;color:var(--muted);font-size:.7rem}.lab-legend span{display:inline-flex;align-items:center;gap:.42rem}.legend-line{width:24px;height:0;border-top:3px solid var(--text)}.legend-line.reference{border-color:var(--line-strong);border-top-style:dashed}.legend-line.linear{border-color:var(--accent);border-top-style:dashed}.legend-dot{width:8px;height:8px;border-radius:50%;background:var(--accent-2)}
.control-panel{padding:1rem}.control-head h3{margin:-.25rem 0 1rem}.control{padding:.8rem 0;border-top:1px solid var(--line)}.control label{display:flex;justify-content:space-between;gap:.75rem;margin-bottom:.5rem;color:var(--muted);font-size:.75rem}.control output{color:var(--text);font-weight:750;font-variant-numeric:tabular-nums}.control input[type=range]{width:100%;accent-color:var(--accent)}.control-note{margin-top:.8rem;padding:.8rem;border:1px solid var(--line);border-radius:10px;background:var(--bg-soft)}.control-note strong{font-size:.76rem;color:var(--accent-2)}.control-note p{margin:.35rem 0 0;color:var(--muted);font-size:.72rem}
.metric-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:.65rem;margin-top:.7rem}.metric-grid article{min-width:0;padding:.8rem;border:1px solid var(--line);border-radius:12px;background:var(--panel)}.metric-grid span,.metric-grid small{display:block;color:var(--muted);font-size:.66rem}.metric-grid strong{display:block;margin:.3rem 0;font-size:clamp(1rem,1.5vw,1.25rem);font-variant-numeric:tabular-nums}.interpretation-panel{display:grid;grid-template-columns:.75fr 1.25fr;gap:1.5rem;align-items:end;margin-top:.7rem;padding:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg-soft)}.interpretation-panel h3{margin:-.2rem 0 0}.interpretation-panel>p{margin:0;color:var(--muted)}.module-equation{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center;justify-content:center;margin-top:1rem;padding:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.module-equation span{padding:.45rem .7rem;border-radius:999px;background:var(--bg-soft);color:var(--muted);font-size:.76rem}.module-equation b{color:var(--accent-2)}
.chapter-pagination{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:0 0 4rem}.chapter-pagination a{display:grid;padding:1rem;border:1px solid var(--line);border-radius:13px;background:var(--panel);text-decoration:none}.chapter-pagination a:last-child{text-align:right}.chapter-pagination span{color:var(--muted);font-size:.7rem}.chapter-pagination strong{margin-top:.25rem}.chapter-pagination a:hover{border-color:var(--accent)}
@media(max-width:1100px){.chapter-hero-grid{grid-template-columns:1fr}.chapter-concept{max-width:820px}.lab-shell{grid-template-columns:1fr}.control-panel{display:grid;grid-template-columns:repeat(2,1fr);gap:0 1rem}.control-head,.control-note{grid-column:1/-1}}
@media(max-width:760px){.chapter-hero h1{overflow-wrap:anywhere}.chapter-hero,.chapter-section,.chapter-pagination{width:min(100% - 1.2rem,var(--max))}.chapter-hero{padding-top:1.4rem}.chapter-hero h1{font-size:clamp(2.9rem,14vw,4.8rem)}.concept-grid,.insight-grid{grid-template-columns:1fr}.bridge-panel{grid-template-columns:1fr}.bridge-equation{justify-content:flex-start}.control-panel{display:block}.interpretation-panel{grid-template-columns:1fr;align-items:start}.chapter-pagination{grid-template-columns:1fr}.chapter-pagination a:last-child{text-align:left}.plot-card{overflow-x:auto}.plot-card svg{min-width:680px}}
@media(max-width:460px){.lab-actions{flex-direction:column}.lab-toolbar{align-items:flex-start}.lab-toolbar-title small{max-width:180px}}
