#hsMathStudio{--math-bg:#f7f9f5;--math-card:#fff;--math-text:#21382a;--math-muted:#536454;--math-line:#d8e2d3;--math-soft:#edf4e7;--math-accent:#2c644d;background:var(--math-bg);color:var(--math-text);min-height:100dvh;font:400 16px/1.65 system-ui,-apple-system,"Segoe UI",sans-serif;padding-bottom:3rem}
html[data-theme=dark] #hsMathStudio{--math-bg:#141614;--math-card:#20251f;--math-text:#ecf1e8;--math-muted:#b7c5b1;--math-line:#42503e;--math-soft:#2d3829;--math-accent:#d5edb9}
body.hs-math-open{overflow:auto!important}body.hs-math-open>:not(#hsMathStudio){display:none!important}#hsMathStudio[hidden]{display:none!important}#hsMathStudio *{box-sizing:border-box}#hsMathStudio [hidden]{display:none!important}
.math-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem max(1rem,calc((100vw - 1150px)/2));border-bottom:1px solid var(--math-line);background:var(--math-bg)}.math-header>div{display:flex;align-items:center;gap:.6rem}.math-header strong{white-space:nowrap}.math-back{border:0;background:transparent;color:var(--math-text);min-height:44px;cursor:pointer;font:inherit}.math-beta{font-size:.75rem;padding:.1rem .5rem;border:1px solid var(--math-line);border-radius:20px}.math-content{max-width:850px;margin:auto;padding:1.6rem 1.1rem!important}.math-intro h1{font-size:clamp(1.8rem,4vw,2.6rem);letter-spacing:-.035em;margin:.1rem 0 .4rem;line-height:1.3}.math-intro p{color:var(--math-muted);margin:.4rem 0}.math-eyebrow{font-size:.85rem;color:var(--math-muted);letter-spacing:.03em}.math-controls{display:flex;gap:1rem;margin-top:1.5rem}.math-controls>div{flex:1;min-width:0}#hsMathStudio label{display:block;font-weight:600;margin:.8rem 0 .3rem}#hsMathStudio select,#hsMathStudio input,#hsMathStudio textarea{width:100%;font:inherit;line-height:1.5;border:1px solid var(--math-line);border-radius:12px;padding:.7rem .9rem;background:var(--math-card);color:var(--math-text);min-height:48px}#hsMathStudio textarea{resize:vertical}#hsMathStudio small{display:block;color:var(--math-muted);font-size:.85rem}#hsMathStudio :focus-visible{outline:3px solid var(--math-accent);outline-offset:3px}#hsMathStudio button:disabled{opacity:.55;cursor:wait}.math-save{font-size:.82rem;color:var(--math-muted)}.math-card{border:1px solid var(--math-line);border-radius:24px;background:var(--math-card);padding:clamp(1.1rem,4vw,2rem);margin:1.2rem 0}.math-card h2{font-size:clamp(1.25rem,3vw,1.6rem);line-height:1.7;margin:.5rem 0 1rem;overflow-wrap:anywhere}.math-actions{display:flex;gap:.7rem;align-items:center;flex-wrap:wrap;margin:1rem 0}.math-button{font:inherit;font-weight:600;display:inline-flex;align-items:center;justify-content:center;min-height:46px;border:1px solid var(--math-line);border-radius:30px;background:var(--math-card);color:var(--math-text);padding:.6rem 1rem;cursor:pointer;text-decoration:none;margin:.2rem 0}.math-primary{background:var(--math-accent);color:var(--math-bg);border-color:var(--math-accent)}html[data-theme=light] .math-primary{color:white}.math-feedback,.math-hint,.math-bridge{background:var(--math-soft);border-radius:12px;padding:.8rem 1rem;margin:1rem 0;overflow-wrap:anywhere}.math-feedback p{margin:.1rem 0}.math-error{border:1px solid #b57a62;padding:.8rem 1rem;border-radius:12px}.math-model{max-width:430px;margin:1rem auto}.math-model svg{display:block;width:100%;max-height:170px}.math-model .filled{fill:var(--math-accent);stroke:var(--math-accent)}.math-model .empty{fill:var(--math-soft);stroke:var(--math-muted);stroke-width:1}.math-model text{fill:var(--math-text);font:16px system-ui}.math-model figcaption{font-size:.8rem;color:var(--math-muted);text-align:center}.math-parent,.math-path{border-top:1px solid var(--math-line);padding:1rem 0}.math-parent summary,.math-path summary,.math-card summary{min-height:44px;cursor:pointer;padding:.5rem 0;font-weight:600}.math-report p,.math-path p{color:var(--math-muted)}.math-evidence{border:1px solid var(--math-line);padding:1rem;border-radius:16px;margin:.8rem 0}.math-evidence h3{margin:0}.math-evidence p{margin:.2rem 0}.math-dialog{max-width:520px;width:calc(100% - 2rem);padding:1.4rem;border:1px solid var(--math-line);border-radius:20px;background:var(--math-card);color:var(--math-text)}.math-dialog::backdrop{background:#0008}.math-dialog .math-button{margin-right:.5rem}.math-entry{display:flex;flex-direction:column;align-items:flex-start;text-align:start;padding:1.1rem 1.3rem;border-radius:18px;border:1px solid #c9d8bc;background:#eff6e7;color:#253f2b;cursor:pointer;font:inherit;line-height:1.5;min-height:72px;width:100%;margin-bottom:1rem}.math-entry span{font-size:.88rem;margin-top:.3rem}.math-entry:hover{filter:brightness(.98)}html[data-theme=dark] .math-entry{background:#293724;border-color:#42543b;color:#ecf4e4}.ph-workspace-starters .math-entry{grid-column:1/-1;margin:0}.math-solution-choice{position:relative}.math-solution-choice summary{font-size:.85rem;font-weight:400}.math-solution-choice[open]{flex-basis:100%}
@media(max-width:600px){.math-header{padding:.6rem .8rem;gap:.4rem}.math-header strong{font-size:.88rem}.math-back{font-size:.85rem}.math-header .math-beta{display:none}.math-content{padding:1.2rem .8rem!important}.math-controls{flex-direction:column;gap:0}.math-card{border-radius:18px}.math-actions .math-button{flex:1}.math-entry{padding:1rem}.math-card h2{font-size:1.2rem}}
/* The public shell has its own high-specificity visibility rules. */
html:root body.homeschool-app.hs-math-open{display:block!important;min-width:0}
html:root body.homeschool-app.hs-math-open #hsPublicHome,html:root body.homeschool-app.hs-math-open #main,html:root body.homeschool-app.hs-math-open #hsStartup{display:none!important}
html:root body.homeschool-app.hs-math-open #hsMathStudio{display:block!important;position:relative;inset:auto;width:100%;margin:0}
#hsMathStudio .math-model svg{width:100%!important;height:170px!important;max-height:none}
#hsMathStudio .math-card{scroll-margin-top:16px}#hsMathStudio #mathQuestion:focus{outline:none}#hsMathStudio .math-loading{background:var(--math-soft);border-radius:12px;padding:.8rem 1rem}

#hsMathStudio .math-next-note{font-size:.85rem;color:var(--math-muted);margin:.6rem 0}
.math-reasoning{padding:1rem 1.2rem;border:1px solid var(--math-line);border-radius:16px;margin:1rem 0;background:var(--math-soft);overflow-wrap:anywhere}.math-reasoning h3{font-size:1.1rem;margin:0 0 .7rem}.math-reasoning p{margin:.6rem 0}.math-reasoning-question{font-weight:600}.math-reasoning summary{font-size:.8rem;font-weight:400!important}.math-reasoning h3:focus{outline:none}
#hsMathStudio .math-auto-reflection{display:flex;gap:.7rem;align-items:flex-start;font-size:.9rem;font-weight:400}#hsMathStudio .math-auto-reflection input{width:22px;min-width:22px;height:22px;min-height:22px;margin-top:.2rem}.math-ai-reflection{white-space:pre-line}.math-auto-toggle{font-size:.8rem}

/* Clearline's own exploration tools; the question and answer remain primary. */
.math-workshop{margin:1rem 0;border:1px solid var(--math-line);border-radius:16px;padding:.8rem 1rem;background:var(--math-soft);min-width:0}
.math-workshop summary{cursor:pointer;font-weight:600}.math-workshop p{font-size:.92rem;line-height:1.65}.math-workshop-canvas{margin:1rem 0;min-width:0}.math-workshop-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:12px}.math-workshop label{min-width:0}.math-workshop label>span{display:block}.math-workshop input,.math-workshop select{max-width:100%;width:100%;min-height:44px}.math-workshop button{min-height:44px;min-width:44px;padding:.6rem .8rem;border:1px solid var(--math-line);border-radius:12px;color:var(--math-text);background:var(--math-bg);cursor:pointer;max-width:100%;white-space:normal}.math-workshop>button{display:block;margin:.6rem 0}.math-workshop button:focus-visible,.math-workshop summary:focus-visible{outline:3px solid var(--math-accent);outline-offset:3px}.math-workshop button[aria-pressed=true]{background:var(--math-accent);color:var(--math-accent-ink,#fff)}.math-workshop-result{font-weight:600}.math-dot-groups{display:flex;flex-wrap:wrap;gap:12px;margin-top:16px}.math-dot-group{display:grid;grid-template-columns:repeat(5,8px);gap:5px;border:1px solid var(--math-line);border-radius:10px;padding:10px}.math-dot-group i{width:8px;height:8px;border-radius:50%;background:var(--math-accent)}.math-fraction-builder{display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:8px;margin-top:12px}.math-workshop svg{display:block;width:100%;height:auto;max-height:90px}.math-workshop svg .filled{fill:var(--math-accent);stroke:var(--math-text)}.math-workshop svg .empty{fill:var(--math-bg);stroke:var(--math-text)}.math-given-table{border-collapse:collapse;width:100%;table-layout:fixed;margin:1rem 0;font-size:clamp(.8rem,2.5vw,.95rem)}.math-given-table th,.math-given-table td{border:1px solid var(--math-line);padding:.5rem .3rem;text-align:center;overflow-wrap:anywhere}.math-given-table caption{font-size:.85rem;text-align:start;margin-bottom:.6rem}.math-given-note{color:var(--math-muted);font-size:.9rem}

html[data-theme=dark] #hsMathStudio{--math-accent-ink:#18351f}.math-workshop [aria-invalid=true]{outline:2px solid #b3543e}
#hsMathStudio .math-card h2{line-height:1.8;letter-spacing:normal;font-weight:600}
@media(max-width:480px){#hsMathStudio .math-actions{display:grid;grid-template-columns:1fr 1fr}#hsMathStudio .math-actions>.math-primary{grid-column:1/-1}#hsMathStudio .math-actions .math-button{width:100%;padding:.65rem .7rem}#hsMathStudio .math-solution-choice[open]{grid-column:1/-1}}
#hsMathStudio .math-controls{flex-wrap:wrap}#hsMathStudio .math-controls>div{min-width:min(100%,180px)}
.math-bar-graph{margin:20px 0;padding:16px;border:1px solid var(--math-line);border-radius:14px}.math-bar-graph figcaption{font-size:.85rem;color:var(--math-muted)}.math-bar-row{display:grid;grid-template-columns:1fr auto;gap:6px;margin:14px 0}.math-bar-track{grid-column:1/-1;height:18px;border-inline-start:2px solid var(--math-text);background:var(--math-soft)}.math-bar-track i{display:block;height:100%;background:var(--math-accent)}
