/* Higher-math lab (/math-lab) */
.math-figure svg{display:block;width:100%;height:auto;background:#fbfdfb;border:1px solid var(--line);border-radius:12px}
.math-figure .grid{stroke:#e2ebe3;stroke-width:1}
.math-figure .axis{stroke:#55695a;stroke-width:1.6}
.math-figure .tick{font-size:11px;fill:#5d7062}
.math-figure .axis-label{font-size:14px;font-style:italic;fill:#33463a}
.math-figure .curve{fill:none;stroke:#2f7d4a;stroke-width:3;stroke-linejoin:round}
.math-figure .curve.two{stroke:#7a5bb0;stroke-dasharray:8 5}
.math-figure .tangent{stroke:#d07a1f;stroke-width:2;stroke-dasharray:6 5}
.math-figure .root{fill:#c0392b;stroke:white;stroke-width:2}
.math-figure .meet{fill:#2d6fb3;stroke:white;stroke-width:2}
.math-figure .point{fill:#d07a1f;stroke:white;stroke-width:2}
.math-figure .unit{fill:none;stroke:#2f7d4a;stroke-width:2}
.math-figure .radius{stroke:#33463a;stroke-width:3}
.math-figure .arc{fill:none;stroke:#d07a1f;stroke-width:2}
.math-figure .guide-sin{stroke:#c0392b;stroke-width:2;stroke-dasharray:5 4}
.math-figure .guide-cos{stroke:#2d6fb3;stroke-width:2;stroke-dasharray:5 4}
.math-figure figcaption{margin-top:10px;line-height:1.8;color:#41653c}
.math-sliders{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:14px;margin:6px 0}
.math-sliders label{display:grid;gap:6px;font-weight:600}.math-sliders input{width:100%;accent-color:#2f7d4a}
.math-error{color:#a02f2f;min-height:1.6em;margin:4px 0}.math-error:empty{min-height:0}
.wide-field{grid-column:1/-1}
.tool-inputs input[type=text]{font-family:ui-monospace,Consolas,monospace;font-size:16px}
.tool-tabs button[aria-selected=true]{background:#2f7d4a;border-color:#2f7d4a;color:white}
.mode-picks{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}.mode-picks button[aria-pressed=true]{background:#e3f1e6;border-color:#2f7d4a}
.matrix-grids{display:flex;flex-wrap:wrap;gap:28px;margin:12px 0}
.matrix-input{display:grid;grid-template-columns:repeat(var(--n,2),64px);gap:6px;padding:8px 12px;border-left:3px solid #33463a;border-right:3px solid #33463a;border-radius:6px}
.matrix-input input{width:64px;padding:8px;text-align:center;border:1px solid #b9cabb;border-radius:6px;font:inherit}
.math-result{margin:14px 0;font-size:18px;line-height:1.9;overflow-x:auto}
.matrix-out{display:inline-table;border-left:2px solid #33463a;border-right:2px solid #33463a;border-radius:4px;margin:4px 8px;vertical-align:middle;border-collapse:separate;border-spacing:10px 2px}
.matrix-out td{text-align:center;min-width:2.5em}
#matrixSteps li,#quadSteps li{margin:8px 0;line-height:1.9;overflow-x:auto}
.math-two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:20px;align-items:start}
@media(max-width:750px){.math-two{grid-template-columns:minmax(0,1fr)}.matrix-input{grid-template-columns:repeat(var(--n,2),52px)}.matrix-input input{width:52px}}
