/* Shared readable curriculum path: domain → strand → numbered stage. */
.math-stage-tree{display:grid;gap:18px;margin:20px 0 40px}.stage-domain{border:1px solid #d6e2e7;border-radius:22px;background:#fff;overflow:hidden}.stage-domain>summary{display:flex;align-items:center;gap:14px;padding:20px 24px;cursor:pointer;list-style:none;background:color-mix(in srgb,var(--domain-color) 8%,white)}.stage-domain>summary::-webkit-details-marker{display:none}.stage-domain>summary strong{display:block;font-size:22px;color:var(--domain-color)}.stage-domain>summary small{display:block;color:#617481;margin-top:4px}.domain-symbol{font-size:30px}.domain-toggle{margin-left:auto;font-size:24px;transition:transform .2s}.stage-domain[open] .domain-toggle{transform:rotate(180deg)}.stage-domain-body{padding:8px 24px 24px}.stage-subgroup{margin-top:22px}.stage-subgroup h3{display:flex;align-items:center;gap:12px;color:#344d5c;font-size:18px;margin:0 0 14px}.stage-subgroup h3 small{font-size:12px;font-weight:500;color:#71828d}.stage-path{list-style:none;margin:0;padding:0;display:grid;gap:10px}.stage-path>.stage-card{display:grid!important;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:14px!important;padding:16px!important;border:1px solid #e1e8ee!important;border-radius:16px!important;background:#fff;box-shadow:0 3px 10px #28465805}.stage-index{display:grid;place-items:center;width:48px;height:48px;border-radius:15px;background:color-mix(in srgb,var(--domain-color) 12%,white);color:var(--domain-color);font:bold 22px Outfit,sans-serif}.stage-card-copy strong{font-size:16px;color:#2a4253;display:block;line-height:1.5}.stage-card-copy small{display:block;margin-top:4px;color:#7b8b96;font-size:12px}.stage-card-actions{display:flex;align-items:center;gap:7px}.stage-start{background:var(--domain-color)!important;border-color:transparent!important;color:white!important;padding:10px 14px!important;border-radius:10px!important;font-weight:700}.stage-review-link{border:0!important;background:none!important;color:#607988!important;font-size:12px;padding:8px!important}.stage-done .stage-index{background:#e3f4ea;color:#388061}.stage-done .stage-card-copy small{color:#378460}.stage-path button:focus-visible,.stage-domain summary:focus-visible{outline:3px solid #91bada;outline-offset:3px}
#math-learning-section{overflow:auto!important;align-items:stretch!important;justify-content:flex-start!important}#math-learning-content{width:min(1040px,calc(100% - 32px));margin:0 auto;padding-bottom:175px}.learning-intro{font-size:16px;color:#6b7f8c;margin:12px 0}.lesson-topline{display:flex;align-items:center;gap:12px;margin:22px 0 16px}.lesson-topline>button:last-child{margin-left:auto}.lesson-stage-number{font-size:14px;color:#627783}.chalkboard-classroom{position:relative;min-height:440px;padding-right:150px}.chalkboard{position:relative;min-height:400px;border:10px solid #ad8b65;border-bottom-width:18px;border-radius:15px;background:radial-gradient(ellipse at top left,#355a4f,#233f36 65%);color:#f1f3dc;box-shadow:0 10px 28px #1e382322,inset 0 0 35px #0002;padding:24px 30px 42px}.chalkboard header{border-bottom:1px solid #d2dfbf4d;padding-bottom:18px;margin-bottom:22px}.chalkboard h2{font-size:clamp(22px,3vw,30px);letter-spacing:-.6px;line-height:1.5;color:#fff5d5;margin:8px 0 0}.chalk-eyebrow{font-size:13px;color:#bfcfc1;letter-spacing:.04em}.chalk-concept{font-size:21px;line-height:1.95;word-break:keep-all;overflow-wrap:anywhere;margin:0}.chalk-goal{margin-top:24px;font-size:13px;color:#b7cfc0;line-height:1.7}.chalk-goal p{margin:5px 0}.worked-example{padding:0;list-style:none;display:grid;gap:18px;margin:0}.worked-example li{display:flex;align-items:flex-start;gap:14px;font-size:21px;line-height:1.8}.worked-example li>span{background:#ffffff18;border:1px solid #ffffff40;border-radius:50%;width:30px;height:30px;display:grid;place-items:center;flex-shrink:0;font-size:15px;margin-top:5px}.worked-example p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.chalk-reveal,.lesson-practice{border:1px solid #dae4c877;background:#fff0;color:#e7f0d8;border-radius:10px;padding:12px 18px;margin-top:22px;font-size:16px}.lesson-practice{background:#ebf3cf;color:#2a503c;font-weight:800;border:0}.chalk-note{font-size:15px;color:#ccdebe;line-height:1.6;margin-top:16px}.chalk-tray{position:absolute;bottom:-5px;left:20px;right:20px;height:12px;display:flex;align-items:center;gap:10px}.chalk-piece{width:44px;height:8px;border-radius:3px;background:#ecefe1;transform:rotate(-3deg)}.chalk-piece.pink{width:34px;background:#efc7bd;transform:rotate(3deg)}.chalk-eraser{margin-left:auto;width:65px;height:15px;background:#ba9975;border-bottom:7px solid #44483b;border-radius:3px}.lesson-teacher{position:absolute;right:-15px;bottom:16px;width:190px;pointer-events:none;display:flex;align-items:center;flex-direction:column}.lesson-teacher img{width:100%;height:auto;max-height:285px;object-fit:contain;filter:drop-shadow(0 9px 4px #203c3017)}.lesson-teacher>span{padding:8px 12px;background:white;border:1px solid #dae7ed;border-radius:14px;font-size:12px;color:#546c7b;box-shadow:0 3px 10px #29453709}.lesson-participation-question,.chalk-content>p{font-size:20px;line-height:1.8}.lesson-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:22px}.lesson-choices button{background:#ffffff0c;color:#eff1db;border:1px solid #bfd1b780;min-height:64px;padding:12px;border-radius:12px;font-size:18px;line-height:1.5}.lesson-choices button:hover{background:#fff2}.lesson-choices .answer-correct{border-color:#c6e89f;background:#a3d98933}.lesson-feedback{min-height:26px;font-size:15px;line-height:1.6;color:#d3efa6;margin-top:18px}.lesson-feedback.try-again{color:#f3d4ac}.lesson-navigation{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:20px 0}.lesson-stepper{display:flex;gap:16px;justify-content:center}.lesson-stepper>span{display:flex;align-items:center;gap:6px;color:#97a4ab;font-size:12px}.lesson-stepper b{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#e7edf0}.lesson-stepper .active{color:#2e7f62}.lesson-stepper .active b{background:#3f916f;color:white}.lesson-bottomline{display:flex;justify-content:space-between;gap:12px;color:#7c8c95;font-size:12px}.lesson-bottomline details{max-width:60%;text-align:right;line-height:1.8}.lesson-counters{display:flex;flex-wrap:wrap;gap:14px;margin:24px 0}.lesson-counter{width:54px;height:54px;border-radius:50%;border:2px solid #ebe6aa;color:#ebe6aa;background:none;font-size:25px}.lesson-counter.counted{background:#d8df9a;color:#274536}.lesson-coordinate-grid{display:grid;grid-template-columns:repeat(7,1fr);width:min(350px,100%);aspect-ratio:1;border:1px solid #adceb2;margin:18px auto}.lesson-coordinate-grid button{border:1px solid #afc4af33;color:#afc4af;background:none;min-width:0;position:relative;font-size:10px}.lesson-coordinate-grid .origin-point{color:#fff3b2;background:#ffffab16}.lesson-coordinate-grid .chosen-point{background:#9ed5ba88;color:#fff}.lesson-fraction-strip{display:flex;width:100%;height:70px;margin:24px 0}.lesson-fraction-strip button{flex:1;border:2px solid #dce6c5;color:#e8e4cb;background:none;font-size:24px}.lesson-fraction-strip button.colored{background:#d8dfa1;color:#274536}
/* The HUD is an invariant frame anchor, not a viewport/media anchor. */
body.rpg-hud-active .premium-card>#aiedue-rpg-hud.math-rpg-hud{position:absolute!important;left:12px!important;bottom:12px!important;right:auto!important;top:auto!important;transform:none!important;width:min(800px,calc(100% - 24px))!important;max-width:calc(100% - 24px)!important;z-index:70}
body.rpg-hud-active .premium-card>#aiedue-rpg-hud.math-rpg-hud.rpg-collapsed{width:146px!important}
body.rpg-hud-active .premium-card>#aiedue-rpg-hud.math-rpg-hud.rpg-collapsed .rpg-profile-banner{width:146px!important;min-width:146px!important;height:136px!important}
body.rpg-hud-active .premium-card>#aiedue-rpg-hud.math-rpg-hud .rpg-profile-portrait{width:126px!important;height:126px!important;left:10px!important;bottom:4px!important;top:auto!important;right:auto!important;transform:none!important}
/* Native dialogs live above the HUD. Paper selectors remain scoped to the practice root. */
/* Reserve the fixed orb's corner for all lesson controls, never move the orb. */
.lesson-navigation{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding-left:154px}.lesson-navigation>[data-lesson-prev]{grid-column:1;grid-row:1;justify-self:start}.lesson-navigation>[data-lesson-next]{grid-column:2;grid-row:1}.lesson-navigation>.lesson-stepper{grid-column:1/-1;grid-row:2;justify-content:flex-end}.lesson-bottomline{padding-left:154px;flex-wrap:wrap;gap:8px}

#math-practice-content .practice-modal{width:min(960px,calc(100vw - 32px));max-width:960px;height:min(860px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);margin:auto;padding:0;border:1px solid #d6e3e6;border-radius:22px;background:#f2f5f7;color:#2d4554;box-shadow:0 24px 90px #20384f55;overflow:hidden}
#math-practice-content .practice-modal::backdrop{background:#142a39a8;backdrop-filter:blur(3px)}.practice-modal-header{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:15px 22px;background:white;border-bottom:1px solid #dfe6ec}.practice-modal-header h2{font-size:18px;margin:0}.practice-modal-close{width:38px;height:38px;border:0;border-radius:50%;background:#edf2f5;color:#526977;font-size:25px}.practice-modal-scroll{height:calc(100% - 70px);overflow:auto;padding:0 20px 30px;overscroll-behavior:contain}.practice-modal .practice-actions{position:sticky;top:0;background:#f2f5f7ed;backdrop-filter:blur(6px);padding:10px 0;z-index:3;margin:0!important}.practice-modal .paper{margin:16px auto!important}.practice-home-intro{font-size:16px;color:#71828d;line-height:1.8;margin:18px 0}.practice-generator summary{font-weight:700;cursor:pointer}.practice-generator{margin-top:24px}.practice-generator .practice-controls{margin-top:20px!important}#math-practice-content #stage-cards{display:block!important}#math-practice-content .stage-browser{border:0;padding:0;background:none;margin:0}#math-practice-content .stage-answer-fields input{line-height:1.5}#math-practice-content .stage-paper .paper-instruction,#math-practice-content .stage-reward{display:none}
@media(max-width:700px){#math-learning-content{width:calc(100% - 24px)}.stage-domain>summary{padding:16px}.stage-domain-body{padding:0 12px 14px}.stage-path>.stage-card{grid-template-columns:42px minmax(0,1fr);gap:10px!important;padding:12px!important}.stage-index{width:40px;height:40px;font-size:19px;border-radius:12px}.stage-card-copy strong{font-size:14px}.stage-card-actions{grid-column:2;flex-wrap:wrap}.stage-subgroup h3{font-size:16px}.stage-domain>summary strong{font-size:19px}.chalkboard-classroom{padding-right:0;padding-bottom:70px}.chalkboard{padding:20px 17px 36px;border-width:7px;border-bottom-width:14px;min-height:365px}.chalk-concept{font-size:18px}.worked-example li{font-size:18px}.lesson-teacher{width:100px;bottom:-7px;right:0}.lesson-teacher img{max-height:135px}.lesson-teacher>span{font-size:10px;padding:5px 7px}.lesson-topline{gap:6px;flex-wrap:wrap}.lesson-topline .btn-outline{padding:8px 10px;font-size:12px}.lesson-stage-number{font-size:12px}.lesson-stepper{gap:8px}.lesson-stepper small{display:none}.lesson-navigation .btn-primary,.lesson-navigation .btn-outline{padding:10px 15px;font-size:14px}.lesson-choices button{font-size:15px}.lesson-bottomline{padding-right:100px;font-size:10px}.practice-modal-scroll{padding:0 10px 20px}.practice-modal-header{padding:12px 14px}#math-practice-content .practice-modal{width:calc(100vw - 14px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);border-radius:15px}#math-practice-section .math-practice-shell{min-height:0!important;height:auto!important;flex-shrink:0;max-height:none!important;margin-bottom:0!important;overflow:visible!important;padding-bottom:175px!important}}
@media print{#math-practice-content .practice-modal{position:static!important;height:auto!important;max-height:none!important;width:100%!important;border:0;overflow:visible!important}#math-practice-content .practice-modal-scroll{height:auto!important;overflow:visible!important;padding:0}.practice-modal-header{display:none!important}}
