/* A complete lesson shares one controller and one scrolling focus surface. */
.lesson-overview,.lesson-theory,.lesson-study{border:1px solid var(--line,#35475b);border-radius:16px;background:var(--panel,#142036);padding:clamp(18px,3vw,34px);margin:24px 0;color:var(--text,var(--ink));scroll-margin-top:16px}
.lesson-overview{max-width:1040px;margin-left:auto;margin-right:auto}.lesson-copy{max-width:960px;margin:auto}.lesson-topic h2,.lesson-study>h2,.lesson-theory>h2{font-size:24px!important;line-height:1.25;margin:0 0 16px!important}.lesson-topic h3{font-size:19px;margin:24px 0 10px}.lesson-topic p{font-size:17px;line-height:1.8;margin:10px 0}.lesson-equation{overflow-x:auto;overflow-y:hidden;padding:8px 3px;font-size:1.05rem}.lesson-equation .katex-display{margin:.7em 0;text-align:left}.lesson-equation .katex-display>.katex{text-align:left;white-space:nowrap}.lesson-model-note{border-left:3px solid var(--accent);padding-left:12px;color:var(--muted)}
.lesson-choice{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:24px}.lesson-choice select{font:inherit;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--text)}#lesson-open{margin:20px 0 0;min-height:48px;font-size:17px;padding:12px 24px}
body .ew-workspace .ew-view{overflow:visible;max-height:none;overscroll-behavior:auto}body .ew-workspace .ew-panel{overscroll-behavior:auto}body .ew-workspace .ew-side{overflow:hidden}
.ew-workspace .ew-toolbar{flex-wrap:wrap;position:relative}.ew-workspace .ew-toolbar>strong{margin-right:auto}.ew-workspace #ew-tab-guide{font-size:14px}
body .ew-workspace .ew-layout{min-height:0}.ew-focused{overflow-y:auto;overflow-x:hidden;overscroll-behavior:auto;padding:16px!important}.ew-focused .ew-toolbar{position:sticky;top:-16px;z-index:5;background:var(--bg,#0d1729);padding:10px 0;margin-top:-6px}.ew-focused .ew-view,.ew-focused .ew-side{top:58px}.ew-focused .ew-panel{max-height:calc(100svh - 135px)}
body .ew-workspace #ew-guide{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;padding:0;max-height:none;overflow:visible;border:0;margin:20px 0}
#ew-guide>details,#ew-guide>.ew-note{grid-column:1/-1}.ew-workspace #ew-guide article{min-width:0;margin:0}.ew-workspace #ew-guide p{font-size:16px}.ew-workspace #ew-guide textarea{min-height:130px;font-size:16px}.lesson-study>textarea{display:block;width:100%;min-height:120px;resize:vertical;margin:10px 0;padding:12px;border:1px solid var(--line);border-radius:9px;font:inherit;background:var(--bg);color:var(--text)}
.lesson-legacy,.lesson-model-details{margin-top:24px;border-top:1px solid var(--line);padding-top:16px}.lesson-legacy>summary,.lesson-model-details>summary{cursor:pointer;font-size:16px;font-weight:650}.lesson-model-details>*{max-width:100%}.lesson-theory .wave-theory{border:0;padding:0;margin-top:24px}.lesson-theory .reference-section{margin-top:24px}.lesson-theory .nl-equation:not(:has(svg)){display:none}
.ew-workspace canvas.fluid-interactive{cursor:default;touch-action:pan-y}.ew-workspace canvas.fluid-interactive[data-dragging=true]{cursor:grabbing}.ew-workspace canvas.fluid-interactive[data-handle-hover=true]{cursor:grab}
@media(max-width:850px){body .ew-workspace .ew-view{position:sticky;top:0;z-index:2}body .ew-focused .ew-view{top:68px}.ew-focused .ew-toolbar{top:-16px}.ew-focused .ew-panel,.ew-panel{max-height:38svh}body .ew-workspace #ew-guide{grid-template-columns:1fr}.lesson-topic p{font-size:16px}.lesson-equation{font-size:.95rem}.lesson-overview,.lesson-theory,.lesson-study{padding:18px 14px}.ew-focused .ew-layout{gap:10px}.ew-toolbar strong{display:none}.ew-toolbar button{font-size:13px!important}.lesson-study{scroll-margin-top:90px}}
@media(prefers-reduced-motion:reduce){.ew-workspace *{scroll-behavior:auto!important}}
@media(max-width:850px){
 .ew-workspace .ew-toolbar{display:flex;flex-wrap:nowrap;gap:6px}.ew-workspace .ew-toolbar>button{flex:1;min-width:0;min-height:40px;padding:6px 8px!important;font-size:12px!important;line-height:1.3}
 body .ew-focused .ew-view{top:58px}body .ew-workspace .fluid-modebar{display:flex;flex-wrap:nowrap;max-height:none;overflow-x:auto;overflow-y:hidden;padding:5px}.fluid-modebar>button{flex:0 0 auto;white-space:nowrap}.fluid-modebar>label{flex:0 0 170px}
 body .ew-workspace .fluid-actions{display:flex;flex-wrap:wrap;align-items:center;gap:4px}body .ew-workspace .fluid-actions>p{display:none}body .ew-workspace .fluid-actions>div{display:flex;align-items:center;justify-content:space-between;flex:1;gap:5px}body .ew-workspace .fluid-actions output{font-size:12px;white-space:nowrap}
}
