:root{--student-math-blue:#2e68eb;--student-math-mint:#1fb7ad;--student-math-ink:#182132;--student-math-line:#d9e5f2;--student-math-muted:#657187}.student-math-page{margin:0;min-height:100vh;background:linear-gradient(145deg,#eff7ff,#fff8e9);color:var(--student-math-ink);font-family:Pretendard,"Noto Sans KR",sans-serif}.student-math-shell{max-width:1160px;margin:0 auto;padding:20px 18px 50px}.student-math-header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:22px;padding:18px 22px;border:1px solid var(--student-math-line);border-radius:24px 24px 0 0;background:rgba(255,255,255,.88)}.student-math-header a{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border:1px solid var(--student-math-line);border-radius:13px;color:var(--student-math-ink);text-decoration:none;font-weight:800}.student-math-header span,.student-math-history header span{color:var(--student-math-blue);font-size:12px;font-weight:900;letter-spacing:.14em}.student-math-header h1,.student-math-header p{margin:0}.student-math-header h1{font-size:22px}.student-math-header p{margin-top:3px;color:var(--student-math-muted);font-size:13px}.student-math-header>strong{padding:11px 15px;border-radius:999px;background:#edf4ff;color:#2856ad}.student-math-notice{margin:0;padding:11px 22px;background:#e8f2ff;color:#315b94;font-weight:700}.student-math-notice[data-tone=good]{background:#def8ef;color:#17765b}.student-math-notice[data-tone=bad]{background:#ffe8ed;color:#a83850}.student-math-start{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(290px,.75fr);gap:28px;padding:64px 88px 70px;border:1px solid var(--student-math-line);border-top:0;border-radius:0 0 28px 28px;background:rgba(255,255,255,.93);box-shadow:0 18px 40px rgba(35,65,96,.13)}.student-math-kicker{display:inline-block;margin-bottom:14px;padding:7px 11px;border-radius:999px;background:#e4f3ff;color:#2464b2;font-size:12px;font-weight:900}.student-math-hero h2{margin:0;font-size:43px;line-height:1.08;letter-spacing:-.04em}.student-math-hero>p{margin:18px 0;color:#5f6a7c;font-weight:750}.student-math-domains{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.student-math-domains article{min-height:86px;padding:15px;border:1px solid var(--student-math-line);border-radius:16px;background:#fff;display:flex;flex-direction:column;gap:8px}.student-math-domains span{color:var(--student-math-muted);font-size:12px;line-height:1.45}.student-math-analysis{margin-top:16px;padding:18px;border:1px solid #cce5ee;border-radius:17px;background:linear-gradient(135deg,#f3fbff,#eefff9)}.student-math-analysis span{color:#2b6b98;font-size:12px;font-weight:900}.student-math-analysis h3{margin:8px 0 5px;font-size:20px}.student-math-analysis p{margin:0;color:var(--student-math-muted)}#studentMathStart{width:100%;min-height:58px;margin-top:16px;border:0;border-radius:16px;background:linear-gradient(90deg,var(--student-math-blue),var(--student-math-mint));color:#fff;font-size:18px;font-weight:900}#studentMathStart:disabled{opacity:.72}.student-math-mark{display:grid;place-items:center}.student-math-mark>div{width:100%;box-sizing:border-box;padding:58px 28px;border:1px solid #cfe1ee;border-radius:28px;background:linear-gradient(150deg,#e9fbf8,#fff4d9);text-align:center}.student-math-mark span{font-size:68px;color:#2866e9;font-weight:950}.student-math-mark h3{margin:10px 0;font-size:25px}.student-math-mark p{margin:0;line-height:1.55}.student-math-history{margin-top:18px;padding:22px;border:1px solid var(--student-math-line);border-radius:24px;background:rgba(255,255,255,.9)}.student-math-history header{display:flex;justify-content:space-between;align-items:center}.student-math-history h2{margin:4px 0 0}.student-math-history>div{display:grid;gap:10px;margin-top:16px}.student-math-record{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:16px;padding:16px;border:1px solid var(--student-math-line);border-radius:15px}.student-math-record strong{font-size:18px}.student-math-record span{color:var(--student-math-muted)}.student-math-score{color:var(--student-math-blue)!important;font-size:23px;font-weight:900}.student-math-empty{margin:0;padding:28px;text-align:center;color:var(--student-math-muted)}@media(max-width:900px){.student-math-start{padding:42px 34px;grid-template-columns:1fr}.student-math-mark{display:none}.student-math-header{grid-template-columns:auto 1fr}.student-math-header>strong{grid-column:2}.student-math-hero h2{font-size:38px}}

.student-math-workspace{border:1px solid var(--student-math-line);border-top:0;border-radius:0 0 28px 28px;background:#f7fbff;box-shadow:0 18px 40px rgba(35,65,96,.13)}
.student-math-start[hidden],.student-math-workspace[hidden]{display:none!important}
.student-math-progress{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:20px;padding:18px 24px;background:#17243b;color:#fff}
.student-math-progress div:first-child{display:flex;flex-direction:column;gap:3px}.student-math-progress span{font-size:12px;font-weight:900;color:#79d9d1}.student-math-progress-track{height:10px;border-radius:999px;background:#33415a;overflow:hidden}.student-math-progress-track i{display:block;width:0;height:100%;background:linear-gradient(90deg,#4f86ff,#54d3bd)}
.student-math-progress button,.student-math-tools button{min-height:44px;border:1px solid #56657d;border-radius:12px;background:#22314a;color:#fff;font-weight:850;padding:0 16px}
.student-math-solve-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(250px,.65fr);gap:20px;padding:24px}
.student-math-question,.student-math-tools{border:1px solid var(--student-math-line);border-radius:20px;background:#fff;padding:24px}.student-math-question-meta{display:flex;justify-content:space-between;gap:12px}.student-math-question-meta span{padding:6px 10px;border-radius:999px;background:#e7f0ff;color:#285fc4;font-weight:900}.student-math-question-meta em{font-style:normal;color:var(--student-math-muted);font-weight:750}.student-math-question h2{margin:28px 0 10px;font-size:27px;line-height:1.45}.student-math-question>p{color:var(--student-math-muted)}
#studentMathQuestionVisual{margin:18px 0}.student-math-visual-table{width:100%;border-collapse:collapse}.student-math-visual-table td{border:1px solid var(--student-math-line);padding:8px;text-align:center}.student-math-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.student-math-choice{min-height:54px;border:1px solid #cbd8e8;border-radius:14px;background:#f9fbff;color:var(--student-math-ink);font-weight:850;text-align:left;padding:10px 14px}.student-math-choice.is-selected{border-color:var(--student-math-blue);background:#eaf1ff;color:#1d54bd}.student-math-answer-input{width:100%;box-sizing:border-box;min-height:56px;border:2px solid #cbd8e8;border-radius:14px;background:#fff;color:#172033;caret-color:#2563eb;color-scheme:light;-webkit-appearance:none;appearance:none;-webkit-text-fill-color:#172033;padding:0 16px;font:inherit;font-size:20px}
.student-math-canvas{display:block;width:100%;height:auto;--student-math-canvas-height:300px;border:1px solid var(--student-math-line);border-radius:14px;background:#fff}.student-math-draw-inputs{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:9px}.student-math-draw-inputs label{display:grid;gap:5px;color:var(--student-math-muted);font-size:12px;font-weight:800}.student-math-draw-inputs input{width:100%;box-sizing:border-box;min-height:48px;border:1px solid #cbd8e8;border-radius:11px;padding:0 9px;font:inherit}.student-math-draw-inputs input:disabled{background:#eef2f6;color:#6d7887}
#studentMathAnswerForm{display:grid;gap:14px}#studentMathCheck{min-height:54px;border:0;border-radius:14px;background:linear-gradient(90deg,var(--student-math-blue),var(--student-math-mint));color:#fff;font-weight:900;font-size:17px}.student-math-tools>span{font-weight:900;color:#3a5e90}.student-math-live-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}.student-math-live-stats article{padding:15px;border-radius:14px;background:#eff5ff;text-align:center}.student-math-live-stats b{display:block;font-size:28px;color:var(--student-math-blue)}.student-math-tools section{min-height:120px;padding:16px;border-radius:15px;background:#f0f5fa}.student-math-tools section[data-tone=good]{background:#e1f8ef;color:#176e57}.student-math-tools section[data-tone=bad]{background:#fff0e8;color:#9b4a29}.student-math-tools section p{line-height:1.55}.student-math-tools>button{width:100%;margin-top:14px;background:#17243b}.student-math-result{padding:28px;border-radius:18px;background:linear-gradient(135deg,#edf5ff,#eafff6);text-align:center}.student-math-result b{display:block;font-size:54px;color:var(--student-math-blue)}.student-math-reward{margin:16px 0 0;padding:12px 14px;border-radius:12px;background:#dff7ea;color:#176e57;font-weight:900}
@media(max-width:900px){.student-math-solve-grid{grid-template-columns:1fr}.student-math-progress{grid-template-columns:auto 1fr}.student-math-progress button{grid-column:1/-1}.student-math-choice-grid{grid-template-columns:1fr}}
.student-math-mark{align-content:start;gap:12px}.student-math-profile{width:100%;box-sizing:border-box;padding:17px;border:1px solid #cfe1ee;border-radius:18px;background:#fff}.student-math-profile small{color:var(--student-math-blue);font-size:11px;font-weight:900;letter-spacing:.1em}.student-math-profile h3{margin:7px 0 4px;font-size:19px}.student-math-profile p{margin:0;color:var(--student-math-muted);font-size:13px}.student-math-profile>div{display:grid;gap:6px;margin-top:10px}.student-math-due-item{display:flex;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:10px;background:#eff7ff;font-size:12px}.student-math-due-item b{color:#245dbb}.student-math-profile .student-math-due-item span{color:var(--student-math-muted);font-size:12px;font-weight:700}@media(max-width:900px){.student-math-mark{display:grid}.student-math-mark>div{display:none}}
.student-math-profile>button{width:100%;min-height:44px;margin-top:12px;border:1px solid #8bb5ef;border-radius:12px;background:#eaf3ff;color:#245dbb;font:inherit;font-weight:900}.student-math-profile>button:hover{background:#dcecff}.student-math-profile>button:focus-visible{outline:3px solid rgba(46,104,235,.28);outline-offset:2px}.student-math-profile>button:disabled{opacity:.66}
.student-math-result-button{min-height:44px;border:1px solid #8bb5ef;border-radius:11px;background:#eaf3ff;padding:0 13px;color:#245dbb;font:inherit;font-weight:900}
.student-math-assignments{margin-top:20px;padding:18px;border:1px solid #cbdff0;border-radius:18px;background:#f8fbff}.student-math-assignments>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.student-math-assignments>header span{color:var(--student-math-blue);font-size:11px;font-weight:900;letter-spacing:.1em}.student-math-assignments h3{margin:5px 0 0;font-size:20px}.student-math-assignments>header>strong{padding:7px 10px;border-radius:999px;background:#e2edff;color:#245dbb;font-size:12px}.student-math-assignments>div{display:grid;gap:9px;margin-top:13px}.student-math-assignment{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:13px;border:1px solid var(--student-math-line);border-radius:14px;background:#fff}.student-math-assignment span{display:inline-block;padding:4px 7px;border-radius:999px;background:#e5f6f3;color:#157267;font-size:10px;font-weight:900}.student-math-assignment h4{margin:6px 0 3px;font-size:16px}.student-math-assignment p{margin:0;color:var(--student-math-muted);font-size:12px}.student-math-assignment button{min-height:44px;border:1px solid #8bb5ef;border-radius:12px;background:#eaf3ff;color:#245dbb;padding:0 14px;font:inherit;font-weight:900}@media(max-width:900px){.student-math-assignment{grid-template-columns:1fr}.student-math-assignment button{width:100%}}

.student-math-question h2[aria-label]{display:flex;align-items:center;flex-wrap:wrap;gap:.08em;min-height:58px;font-size:34px;font-weight:950}
.student-math-frac{display:inline-grid;grid-template-rows:1fr 2px 1fr;align-items:center;min-width:1.5em;margin:0 .08em;vertical-align:middle;font-size:.72em;line-height:1;text-align:center;white-space:nowrap;break-inside:avoid}
.student-math-frac>[data-fraction-slot="numerator"]{padding:0 .15em .1em}.student-math-frac-bar{width:100%;height:2px;border-radius:2px;background:currentColor}.student-math-frac>[data-fraction-slot="denominator"]{padding:.1em .15em 0}.student-math-mixed-fraction{display:inline-flex;align-items:center;white-space:nowrap;break-inside:avoid}.student-math-mixed-whole{display:inline-block;margin-right:.03em;white-space:nowrap}
[data-math-fraction="vertical"]{grid-template-areas:"numerator" "fraction-bar" "denominator";white-space:nowrap;break-inside:avoid}[data-math-fraction="vertical"]>[data-fraction-slot="numerator"]{grid-area:numerator}[data-math-fraction="vertical"]>[data-fraction-bar]{grid-area:fraction-bar}[data-math-fraction="vertical"]>[data-fraction-slot="denominator"]{grid-area:denominator}
.student-math-fraction-input{display:grid;gap:13px;justify-items:center;padding:16px 18px;border:2px solid #dbeafe;border-radius:20px;background:#fff;box-shadow:0 8px 18px rgba(29,55,91,.07)}
.student-math-fraction-answer-row{display:flex;width:100%;align-items:center;justify-content:center;gap:16px}.student-math-whole-input-wrap{display:grid;width:112px;flex:0 0 112px;gap:6px;color:#334155;font-size:13px;font-weight:900;text-align:center}.student-math-fraction-box{display:grid;width:82px;flex:0 0 82px;grid-template-rows:48px 2px 48px;align-items:center;justify-items:center;white-space:nowrap;break-inside:avoid}.student-math-fraction-line{width:100%;height:2px;border-radius:999px;background:#172033}.student-math-fraction-slot{width:100%;min-height:48px;padding:0 8px;border:2px solid #7aa7e8;border-radius:10px;background:#fff;color:#172033;caret-color:#2563eb;text-align:center;font-weight:950}.student-math-fraction-slot::placeholder{color:#7890ad}.student-math-fraction-slot:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}.student-math-fraction-input p{margin:0;color:var(--student-math-muted);font-size:13px;font-weight:800;text-align:center}

.student-math-floating-keypad,.student-math-floating-scratchpad{position:fixed;z-index:90;color:#172033;touch-action:none}.student-math-floating-keypad[hidden],.student-math-floating-scratchpad[hidden]{display:none!important}
.student-math-floating-keypad{width:292px}.student-math-floating-keypad.is-collapsed,.student-math-floating-scratchpad.is-collapsed{width:62px}.student-math-floating-scratchpad{z-index:88;width:min(var(--student-math-scratchpad-width,360px),calc(100vw - 20px))}
.student-math-tool-fab{width:62px;height:62px;border:0;border-radius:22px;display:grid;place-items:center;color:#fff;font:inherit;font-size:27px;box-shadow:0 16px 34px rgba(37,99,235,.28);cursor:grab;touch-action:none}.student-math-tool-fab:focus-visible{outline:4px solid rgba(37,99,235,.24);outline-offset:3px}.student-math-keypad-fab{background:linear-gradient(135deg,#2e68eb,#1fb7ad)}.student-math-scratchpad-fab{background:linear-gradient(135deg,#f59e0b,#1fb7ad)}
.student-math-keypad-panel,.student-math-scratchpad-panel{margin-top:8px;border:2px solid #bfdbfe;border-radius:22px;background:rgba(255,255,255,.97);padding:12px;box-shadow:0 20px 42px rgba(15,23,42,.22);backdrop-filter:blur(12px)}
.student-math-keypad-panel>header,.student-math-scratchpad-panel>header{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#1e3a8a;font-size:14px;font-weight:950;cursor:grab;touch-action:none}.student-math-keypad-panel>header button,.student-math-scratchpad-panel>header button{width:44px;height:44px;border:0;border-radius:999px;background:#eaf3ff;color:#1d4ed8;font:inherit;cursor:pointer}
#studentMathKeypadDisplay{min-height:48px;margin:8px 0 10px;border-radius:14px;display:grid;place-items:center;background:#f8fbff;color:#172033;font-size:23px;font-weight:950}
.student-math-keypad-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.student-math-keypad-grid button{min-height:50px;border:0;border-radius:14px;background:#eaf3ff;color:#172033;font:inherit;font-size:21px;font-weight:950;cursor:pointer;box-shadow:inset 0 -2px 0 rgba(37,99,235,.12);touch-action:manipulation}.student-math-keypad-grid button:hover,.student-math-keypad-grid button:focus-visible{background:#dbeafe;outline:3px solid rgba(37,99,235,.18)}.student-math-keypad-grid .is-action{background:#fff7ed;color:#9a3412}.student-math-keypad-grid .is-primary{background:linear-gradient(135deg,#2e68eb,#1fb7ad);color:#fff}.student-math-keypad-grid .is-wide{grid-column:span 3;min-height:46px;font-size:16px}
.student-math-scratchpad-panel{position:relative;border-color:#fed7aa}.student-math-scratchpad-panel>header{color:#7c2d12}.student-math-scratchpad-panel>header button{background:#fff7ed;color:#9a3412}.student-math-scratchpad-toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0}.student-math-scratchpad-toolbar button{min-height:44px;border:1px solid #fed7aa;border-radius:12px;background:#fff7ed;color:#7c2d12;font:inherit;font-size:13px;font-weight:950;cursor:pointer}.student-math-scratchpad-toolbar button:hover,.student-math-scratchpad-toolbar button:focus-visible,.student-math-scratchpad-toolbar button.is-active{border-color:#14b8a6;background:#ecfdf5;color:#0f766e;outline:3px solid rgba(20,184,166,.16)}
#studentMathScratchpadCanvas{display:block;width:100%;height:min(var(--student-math-scratchpad-height,270px),max(120px,calc(100dvh - var(--student-math-scratchpad-chrome,145px))));border:1px solid #f2d7b7;border-radius:16px;background-color:#fffdf7;background-image:linear-gradient(rgba(20,184,166,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(20,184,166,.08) 1px,transparent 1px);background-size:24px 24px;cursor:crosshair;touch-action:none}.student-math-scratchpad-resize{position:absolute;right:8px;bottom:8px;width:44px;height:44px;border:1px solid #fed7aa;border-radius:12px;background:rgba(255,247,237,.94);cursor:nwse-resize}.student-math-scratchpad-resize::before{content:"";position:absolute;inset:12px;background:linear-gradient(135deg,transparent 0 42%,#c2410c 43% 50%,transparent 51%),linear-gradient(135deg,transparent 0 62%,#c2410c 63% 70%,transparent 71%);opacity:.78}
@media(max-width:900px){.student-math-floating-scratchpad{--student-math-scratchpad-chrome:195px}.student-math-question h2[aria-label]{font-size:30px}.student-math-scratchpad-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Latest v2 student diagnostic presentation, bound to the v3 session authority. */
:root{--math-bg:#f7fbff;--math-bg-warm:#fff7e8;--math-ink:#1f2937;--math-muted:#64748b;--math-primary:#2563eb;--math-primary-2:#14b8a6;--math-line:#dbe8f6;--math-card:rgba(255,255,255,.82);--math-shadow:0 18px 38px rgba(36,68,112,.14)}
body.math-daily-page{overflow:hidden;background:linear-gradient(135deg,var(--math-bg),var(--math-bg-warm));color:var(--math-ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Pretendard,"Noto Sans KR",sans-serif}
.math-daily-app{max-width:none;min-height:100vh;height:100vh;margin:0;padding:18px;display:flex;flex-direction:column;gap:14px}
.math-topbar{min-height:78px;display:grid;grid-template-columns:minmax(300px,390px) minmax(240px,1fr) auto;align-items:center;gap:18px;padding:14px 18px;border:1px solid rgba(219,232,246,.95);border-radius:24px;background:var(--math-card);box-shadow:var(--math-shadow);backdrop-filter:blur(14px)}
.math-topbar .math-brand{display:flex;min-height:52px;align-items:center;gap:13px;border:0;border-radius:0;background:transparent;padding:0;color:var(--math-ink);text-decoration:none}
.math-brand .math-logo{display:grid;width:52px;height:52px;flex:0 0 52px;place-items:center;border-radius:18px;background:linear-gradient(135deg,var(--math-primary-2),var(--math-primary));color:#fff;font-size:26px;font-weight:900}
.math-brand>span:last-child{display:grid;gap:4px}.math-brand b{font-size:22px;line-height:1.08}.math-brand small{color:var(--math-muted);font-size:12px;font-weight:700}
.math-progress-info{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px;color:#526174;font-size:13px;font-weight:800}.math-progress-bar{height:14px;overflow:hidden;border-radius:999px;background:#e9f2fb}.math-progress-bar i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--math-primary-2),var(--math-primary));transition:width .25s ease}
.math-topbar>strong{min-width:150px;padding:0;background:transparent;color:#334155;text-align:right;font-size:14px;font-weight:900}
.student-math-notice{position:fixed;left:50%;bottom:22px;z-index:80;max-width:min(640px,calc(100vw - 40px));margin:0;transform:translateX(-50%);border-radius:999px;background:#172033;padding:11px 18px;color:#fff;box-shadow:0 12px 32px rgba(15,23,42,.22);font-size:13px;font-weight:800;opacity:0;pointer-events:none;transition:opacity .18s ease}.student-math-notice[data-tone=bad]{background:#9f1239;opacity:1}
.student-math-start.math-overlay,.student-math-result-overlay.math-overlay{position:fixed;inset:18px;z-index:30;display:grid;grid-template-columns:1fr;place-items:start center;overflow:auto;overscroll-behavior:contain;border:1px solid rgba(219,232,246,.95);border-radius:30px;background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(248,252,255,.94));box-shadow:0 25px 70px rgba(32,53,86,.18);backdrop-filter:blur(16px);padding:26px}
.student-math-start[hidden],.student-math-result-overlay[hidden]{display:none!important}.math-start-grid,.math-result-grid{width:min(980px,100%);display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:28px;align-items:center;margin:auto 0}
.math-hero h2{margin:0 0 12px;font-size:44px;line-height:1.08;font-weight:900;letter-spacing:-.035em}.math-hero>p{margin:0;color:#5c6878;font-size:17px;font-weight:800;line-height:1.55}
.math-hero>.student-math-kicker{display:none}
.student-math-contract-copy{display:none}
.math-hero-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:22px}.math-hero-cards article{min-height:118px;display:block;border:1px solid #e5edf7;border-radius:20px;background:#fff;padding:15px}.math-hero-cards b{display:block;margin:8px 0 5px;font-size:16px}.math-hero-cards span{color:var(--math-muted);font-size:13px;font-weight:800;line-height:1.35}
.math-analysis-card{display:grid;gap:8px;margin-top:16px;border:1px solid #dbeafe;border-radius:20px;background:linear-gradient(135deg,#fff,#eefbf8);padding:16px}.math-analysis-card small{justify-self:start;border-radius:999px;background:#e0f2fe;padding:6px 10px;color:#075985;font-size:12px;font-weight:950;text-transform:none;letter-spacing:0}.math-analysis-card h3{margin:0;color:#172033;font-size:22px;font-weight:950}.math-analysis-card p{margin:0;color:#526174;font-size:14px;font-weight:800}.math-analysis-card>div{display:flex;flex-wrap:wrap;gap:8px;margin:0}.math-analysis-card .student-math-due-item{min-height:30px;display:inline-flex;align-items:center;gap:8px;border:1px solid #bfdbfe;border-radius:999px;background:#eff6ff;padding:0 10px}.math-analysis-card .student-math-due-item b,.math-analysis-card .student-math-due-item span{font-size:12px}
.math-analysis-card>button{justify-self:start;width:auto;min-height:44px;margin:0;border:0;border-radius:16px;background:linear-gradient(135deg,#f97316,#f59e0b);padding:0 16px;color:#fff;font-size:14px;font-weight:950}
.math-completion-card{display:grid;gap:5px;margin-top:12px;border:1px solid #bbf7d0;border-radius:20px;background:linear-gradient(135deg,#ecfdf5,#f8fbff);padding:16px}.math-completion-card span{justify-self:start;border-radius:999px;background:#dcfce7;padding:6px 10px;color:#047857;font-size:12px;font-weight:950}.math-completion-card h3{margin:0;color:#172033;font-size:20px}.math-completion-card p{margin:0;color:#526174;font-size:14px;font-weight:800}
.math-start-btn,.math-retry-btn,.math-home-link{min-height:58px;border:0;border-radius:20px;background:linear-gradient(135deg,var(--math-primary),var(--math-primary-2));padding:0 24px;color:#fff;font-size:18px;font-weight:900;text-decoration:none}.math-start-btn{width:100%;margin-top:14px}.math-start-btn:disabled{opacity:.55}
.math-mascot{display:grid;place-items:center;min-height:340px}.math-mascot>div{width:100%;min-height:340px;display:grid;place-content:center;border:1px solid #deecf7;border-radius:30px;background:linear-gradient(180deg,#e8fbf7,#fff5df);padding:28px;text-align:center}.math-mascot span{font-size:84px;color:var(--math-primary);font-weight:900}.math-mascot h3{margin:8px 0;font-size:25px}.math-mascot p{margin:0;line-height:1.55}
.student-math-more{margin-top:12px;border:1px solid #dbe8f6;border-radius:16px;background:#fff}.student-math-more>summary{min-height:44px;display:flex;align-items:center;padding:0 15px;color:#334155;font-size:13px;font-weight:900;cursor:pointer}.student-math-more .student-math-assignments{margin:0;border:0;border-top:1px solid #e6eef8;border-radius:0;background:#f8fbff}.student-math-history{display:none}
.student-math-workspace{flex:1;min-height:0;overflow:auto;border:0;border-radius:0;background:transparent;box-shadow:none}.student-math-progress{min-height:58px;border-radius:18px 18px 0 0}.student-math-progress .student-math-progress-track{display:none}.student-math-solve-grid{min-height:calc(100% - 58px);grid-template-columns:minmax(0,1fr) 330px;gap:14px;padding:14px}.student-math-question,.student-math-tools{border:1px solid rgba(219,232,246,.95);border-radius:24px;background:rgba(255,255,255,.9);box-shadow:var(--math-shadow)}.student-math-question h2{font-size:28px;text-align:center}.student-math-question-meta span,.student-math-question-meta em{min-height:34px;display:inline-flex;align-items:center;border-radius:999px;padding:0 13px}.student-math-tools{padding:16px}.student-math-tools>span{font-size:18px}.student-math-tools section{min-height:120px;border:1px solid #e6eef8;border-radius:18px;background:#fff}.student-math-tools>button{border-radius:16px;background:#172033}
.math-result-grid{grid-template-columns:minmax(0,1fr) 360px}.math-result-copy>span{color:#2563eb;font-size:12px;font-weight:950;letter-spacing:.14em}.math-result-copy h2{margin:10px 0 8px;font-size:44px}.math-result-copy>p{color:#5c6878;font-size:17px;font-weight:800}.math-result-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:22px 0}.math-result-summary article{border:1px solid #e5edf7;border-radius:18px;background:#fff;padding:18px}.math-result-summary b{display:block;color:#2563eb;font-size:38px}.math-result-summary span{color:#64748b;font-size:12px;font-weight:850}.math-retry-btn{margin-right:8px}.math-home-link{display:inline-flex;align-items:center;justify-content:center;background:#172033}.math-result-list{height:340px;overflow:auto;border:1px solid #e6eef8;border-radius:20px;background:#fff;padding:18px}.math-result-list h3{margin-top:0}
@media(max-width:900px){.math-start-grid,.math-result-grid{grid-template-columns:minmax(0,1fr) 290px;gap:20px}.math-hero h2{font-size:38px}.math-mascot>div{min-height:300px}.math-mascot span{font-size:70px}.student-math-solve-grid{grid-template-columns:minmax(0,1fr) 270px}.math-topbar{grid-template-columns:minmax(260px,1fr) minmax(220px,1fr) auto}.math-brand small{display:none}}
@media(max-width:760px){.math-start-grid,.math-result-grid,.student-math-solve-grid{grid-template-columns:1fr}.math-mascot{display:none}.math-hero-cards{grid-template-columns:1fr}.student-math-start.math-overlay,.student-math-result-overlay.math-overlay{inset:10px;padding:18px}.math-topbar{grid-template-columns:1fr}.math-topbar .math-progress,.math-topbar>strong{display:none}}

/* V2 question workspace parity. Keep v3 session authority behind the latest v2 presentation. */
.math-topbar {
  grid-template-columns: minmax(260px, 360px) minmax(240px, 1fr) auto;
}

.math-brand b {
  font-size: 24px;
}

.student-math-progress[hidden] {
  display: none !important;
}

.student-math-workspace {
  height: 0;
  min-height: 0;
  overflow: hidden;
}

.student-math-solve-grid {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  padding: 0;
}

.student-math-question {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.student-math-tools {
  min-height: 0;
  overflow: auto;
}

.student-math-question-meta {
  min-height: 44px;
  align-items: center;
}
.student-math-question-meta > div { display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;min-width:0; }
.student-math-question-meta [data-math-question-report] { display:inline-flex;align-items:center;gap:6px;border:1px solid #c7d7eb;border-radius:11px;background:#fff;color:#475569;padding:0 12px;font:inherit;font-size:12px;font-weight:850;cursor:pointer;white-space:nowrap; }
.student-math-question-meta [data-math-question-report]:hover,.student-math-question-meta [data-math-question-report]:focus-visible { border-color:#ef4444;color:#b91c1c;outline:none;box-shadow:0 0 0 3px rgba(239,68,68,.14); }
@media (max-width: 480px) {
  .student-math-question-meta { align-items:flex-start; }
  .student-math-question-meta > div { flex-wrap:wrap; }
  .student-math-question-meta [data-math-question-report] { padding:0 10px; }
}

.student-math-problem {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  border: 1px solid #e6eff9;
  border-radius: 26px;
  background: rgba(255, 255, 255, .9);
  padding: 20px;
}

.student-math-question .student-math-problem h2,
.student-math-question .student-math-problem h2[aria-label] {
  min-height: 0;
  justify-content: center;
  margin: 0;
  color: #152238;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}

.student-math-problem > p {
  margin: -6px 0 0;
  color: var(--math-muted);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.student-math-question-workspace {
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 2px 4px 4px;
}

#studentMathQuestionVisual,
#studentMathAnswerForm,
.student-math-choice-grid,
.student-math-draw-inputs {
  width: min(620px, 100%);
}

#studentMathQuestionVisual {
  margin: 0;
}

#studentMathAnswerForm,
#studentMathAnswerControls {
  display: grid;
  place-items: center;
  gap: 14px;
}

.student-math-canvas,
.student-math-visual-table {
  width: min(620px, 100%);
  margin-inline: auto;
}

.student-math-context-table-wrap { max-width:100%;margin:12px auto 18px;overflow-x:auto; }
.student-math-context-table { width:min(520px,100%);margin:auto;border-collapse:separate;border-spacing:0;border:1px solid #cbd8e8;border-radius:14px;overflow:hidden;background:#fff;color:#172033; }
.student-math-context-table caption { padding:10px 12px;background:#eaf2ff;color:#174ea6;font-weight:900; }
.student-math-context-table th,.student-math-context-table td { min-width:64px;border-right:1px solid #dbe5f0;border-bottom:1px solid #dbe5f0;padding:10px;text-align:center;white-space:nowrap; }
.student-math-context-table th { background:#f2f7fd;font-weight:900; }
.student-math-context-table tr:last-child>* { border-bottom:0; }
.student-math-context-table tr>*:last-child { border-right:0; }

.student-math-fraction-input,
.student-math-answer-input {
  width: 100%;
}

#studentMathFeedback {
  min-height: 64px;
  display: block;
  border: 1px solid #e4edf8;
  border-radius: 18px;
  background: #f8fbff;
  padding: 12px 14px;
}

#studentMathFeedback strong {
  font-size: 16px;
}

#studentMathFeedback p {
  margin: 3px 0 0;
  color: #5d697a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

#studentMathFeedback[data-tone="good"] {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #176e57;
}

#studentMathFeedback[data-tone="bad"] {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9b4a29;
}

.student-math-tools {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.student-math-tools-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.student-math-tools-title span {
  color: #1f2937;
  font-size: 18px;
  font-weight: 900;
}

.student-math-tools-title small {
  color: var(--math-muted);
  font-weight: 900;
}

.student-math-live-stats {
  margin: 0;
  gap: 8px;
}

.student-math-live-stats article {
  border: 1px solid #e6eef8;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.student-math-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.student-math-actions button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
}

#studentMathCheck {
  min-height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--math-primary), var(--math-primary-2));
  font-size: 18px;
}

#studentMathNext {
  background: #172033;
  color: #fff;
  font-size: 18px;
}

.student-math-wrong-modal[hidden] {
  display: none !important;
}

.student-math-wrong-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(15, 23, 42, .48);
  padding: 20px;
}

.student-math-wrong-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(219, 232, 246, .95);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, .28);
  padding: 28px;
}

.student-math-wrong-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #eef3f9;
  color: #172033;
  font-size: 22px;
}

.student-math-wrong-modal-kicker {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff4db;
  color: #915b00;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.student-math-wrong-modal-card h2 {
  margin: 14px 44px 14px 0;
  color: #172033;
  font-size: 30px;
  line-height: 1.18;
}

.student-math-wrong-modal-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #e6eef8;
  border-radius: 18px;
  background: #f8fbff;
  color: #263246;
  padding: 18px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.65;
}

.student-math-wrong-modal-body .math-grid-drawing {
  width: min(100%, 320px, max(160px, calc(100dvh - 365px)));
}

.student-math-wrong-modal-next {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: #172033;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
}

.student-math-work-board {
  display: grid;
  gap: 12px;
  border: 1px solid #c7d8eb;
  border-radius: 20px;
  background: #f8fbff;
  padding: 18px;
}

.student-math-work-board > h3,
.student-math-final-answer-title {
  margin: 0;
  color: #172033;
  font-size: 19px;
}

.student-math-work-board > p {
  margin: -4px 0 2px;
  color: #526177;
  font-size: 14px;
  line-height: 1.5;
}

.student-math-work-step {
  min-width: 0;
  border: 1px solid #dbe7f4;
  border-radius: 15px;
  background: #fff;
  padding: 12px;
}

.student-math-work-step[data-tone="good"] { border-color: #34a853; background: #f2fbf5; }
.student-math-work-step[data-tone="bad"] { border-color: #dc5a5a; background: #fff7f7; }
.student-math-work-step legend { padding: 0 6px; color: #263246; font-size: 15px; font-weight: 900; }
.student-math-step-input { width: min(180px, 100%); min-height: 48px; border: 2px solid #b9c9db; border-radius: 12px; padding: 0 14px; font: inherit; font-size: 20px; }
.student-math-step-fraction { display: inline-grid; grid-template-rows: 48px 3px 48px; width: 76px; gap: 4px; align-items: center; }
.student-math-step-fraction input { width: 76px; min-height: 48px; box-sizing: border-box; border: 2px solid #b9c9db; border-radius: 10px; font: inherit; font-size: 20px; font-weight: 900; text-align: center; }
.student-math-step-fraction .student-math-fraction-line { width: 100%; height: 3px; background: #263246; }
.student-math-step-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.student-math-step-choices button { min-width: 52px; min-height: 46px; border: 1px solid #b9c9db; border-radius: 12px; background: #fff; color: #263246; font: inherit; font-weight: 900; }
.student-math-step-choices button.is-selected { border-color: #2563eb; background: #eaf2ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
.student-math-strip-paint { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 5px; }
.student-math-strip-paint button { min-width: 44px; min-height: 44px; border: 2px solid #94a3b8; border-radius: 8px; background: #fff; color: #526177; font: inherit; font-size: 12px; font-weight: 900; }
.student-math-strip-paint button.is-painted { border-color: #2563eb; background: #bfdbfe; color: #174ea6; }
.student-math-strip-count { display: block; margin-top: 8px; color: #174ea6; font-weight: 900; }
.student-math-number-line-control { position: relative; min-height: 52px; margin: 6px 22px; border-top: 4px solid #334155; touch-action: none; cursor: crosshair; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--number-line-ticks) - 1px), #64748b calc(100% / var(--number-line-ticks) - 1px), #64748b calc(100% / var(--number-line-ticks))); }
.student-math-number-line-control::before, .student-math-number-line-control::after { position: absolute; top: 8px; color: #526177; font-size: 13px; font-weight: 900; }
.student-math-number-line-control::before { left: -4px; content: "0"; }
.student-math-number-line-control::after { right: -4px; content: "끝"; }
.student-math-number-line-marker { position: absolute; top: -24px; width: 44px; height: 44px; transform: translateX(-50%); border: 4px solid #fff; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 3px #174ea6; pointer-events: none; }
.student-math-number-line-control:focus-visible { outline: 3px solid #f59e0b; outline-offset: 8px; }
.student-math-number-line-value { display: block; border-radius: 10px; background: #eaf2ff; color: #174ea6; padding: 9px 12px; font-size: 18px; font-weight: 900; text-align: center; }
.student-math-number-line-alternative { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; color: #526177; font-size: 13px; }
.student-math-number-line-alternative input { width: 62px; min-height: 44px; box-sizing: border-box; border: 1px solid #b9c9db; border-radius: 10px; background:#fff;color:#172033;caret-color:#2563eb;color-scheme:light;-webkit-appearance:none;appearance:none;-webkit-text-fill-color:#172033;font: inherit; font-size: 18px; text-align: center; }
.student-math-final-answer-title { margin-top: 18px; }
.student-math-step-feedback { display: grid; gap: 6px; margin: 10px 0 0; padding-left: 22px; }
.student-math-step-feedback li { line-height: 1.45; }
.student-math-step-feedback li[data-tone="good"] { color: #147a36; }
.student-math-step-feedback li[data-tone="bad"] { color: #a72f2f; }
.student-math-tools-title button { min-height: 36px; border: 1px solid #bfd1e5; border-radius: 10px; background: #fff; color: #174ea6; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 900; }
.student-math-work-tutorial-layer { position: fixed; inset: 0; z-index: 150; background: rgba(9, 17, 31, .62); }
.student-math-work-tutorial-spotlight { position: fixed; border: 3px solid #fbbf24; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(9, 17, 31, .38); pointer-events: none; }
.student-math-work-tutorial-panel { position: fixed; border-radius: 18px; background: #fff; color: #172033; box-shadow: 0 20px 60px rgba(9, 17, 31, .3); padding: 18px; }
.student-math-work-tutorial-panel h2 { margin: 0 0 8px; font-size: 21px; }
.student-math-work-tutorial-panel p { margin: 0; color: #526177; line-height: 1.55; }
.student-math-work-tutorial-panel > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.student-math-work-tutorial-panel button { min-height: 44px; border: 0; border-radius: 11px; padding: 0 16px; font: inherit; font-weight: 900; }
.student-math-work-tutorial-panel button:last-child { background: #2563eb; color: #fff; }
.student-math-response-surface { display: grid; gap: 18px; border: 2px solid #dbeafe; border-radius: 20px; background: #fff; padding: 18px; box-shadow: 0 8px 18px rgba(29,55,91,.07); }
.student-math-response-equation { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; color: #172033; font-size: clamp(17px,4.35vw,24px); font-weight: 900; line-height: 1.35; }
.student-math-response-equation>span { display:inline-flex;align-items:center;white-space:nowrap; }
.student-math-response-equation>[data-math-fraction="vertical"] { display:inline-grid; }
.student-math-response-equation .student-math-frac { grid-template-rows:24px 2px 24px;font-size:18px;line-height:1; }
.student-math-response-integer { width: 52px; min-height: 44px; box-sizing: border-box; border: 2px solid #7aa7e8; border-radius: 10px; background:#fff;color:#172033;caret-color:#2563eb;color-scheme:light;-webkit-appearance:none;appearance:none;-webkit-text-fill-color:#172033;font: inherit; font-size: 19px; text-align: center; }
.student-math-response-integer::placeholder,.student-math-response-fraction input::placeholder{color:#7890ad;font-size:14px}.student-math-response-integer:focus-visible,.student-math-response-fraction input:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
.student-math-response-fraction { display: inline-grid; width: 58px; grid-template-rows: 44px 2px 44px; align-items: center; justify-items: stretch; vertical-align: middle; white-space:nowrap;break-inside:avoid;flex:none; }
.student-math-response-fraction input { min-width: 0; width: 100%; min-height: 44px; box-sizing: border-box; border: 2px solid #7aa7e8; border-radius: 9px; background:#fff;color:#172033;caret-color:#2563eb;color-scheme:light;-webkit-appearance:none;appearance:none;-webkit-text-fill-color:#172033;font: inherit; font-size: 18px; text-align: center; }
.student-math-response-fraction-fixed{display:flex;min-height:44px;align-items:center;justify-content:center;font-size:18px}.student-math-response-fraction-line { height: 2px; border-radius: 2px; background: #172033; }
.student-math-response-number-line { display: grid; gap: 10px; padding: 8px 4px; }
.student-math-response-number-line-title { color: #263246; font-size: 17px; text-align: center; }
.student-math-response-number-line-track { position:relative;min-height:82px;margin:14px 28px 0;touch-action:none;cursor:crosshair; }
.student-math-response-number-line-track::before{position:absolute;top:27px;right:0;left:0;height:4px;border-radius:999px;background:#334155;content:""}.student-math-response-number-line-tick{position:absolute;top:20px;width:2px;height:20px;transform:translateX(-50%);border-radius:2px;background:#64748b;pointer-events:none}.student-math-response-number-line-tick.is-major{top:16px;width:3px;height:28px;background:#334155}.student-math-response-number-line-tick-label{position:absolute;top:35px;left:50%;transform:translateX(-50%);color:#334155;font-size:12px;font-weight:900;white-space:nowrap}
.student-math-response-number-line-track:focus-visible { outline: 3px solid #f59e0b; outline-offset: 9px; }
.student-math-response-number-line-marker { position:absolute;z-index:2;top:14px;width:28px;height:28px;transform:translateX(-50%);box-sizing:border-box;border:4px solid #fff;border-radius:50%;background:#2563eb;box-shadow:0 0 0 3px #174ea6;pointer-events:none; }
.student-math-response-number-line-value,.student-math-response-strip-value,.student-math-response-geometry-value { display: block; border-radius: 10px; background: #eaf2ff; color: #174ea6; padding: 9px 12px; font-size: 17px; font-weight: 900; text-align: center; }
.student-math-response-number-line-assist { border-top: 1px solid #dbe5f0; padding-top: 8px; color: #526177; }.student-math-response-number-line-assist summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 850; }.student-math-response-number-line-assist>div { display: flex; align-items: center; justify-content: center; gap: 7px; }
.student-math-response-number-line-assist input { width: 70px; min-height: 48px; box-sizing: border-box; border: 1px solid #b9c9db; border-radius: 10px; background:#fff;color:#172033;caret-color:#2563eb;color-scheme:light;-webkit-appearance:none;appearance:none;-webkit-text-fill-color:#172033;font: inherit; font-size: 19px; text-align: center; }
.student-math-response-number-line-assist-fraction{width:70px;grid-template-rows:48px 2px 48px}.student-math-response-number-line-assist-fraction input{min-width:0;width:100%}
@media(max-width:480px){.student-math-response-number-line-track{margin-inline:22px}.student-math-response-number-line-tick-label.is-mobile-secondary{display:none}}
.student-math-response-long-division{display:grid;gap:10px;width:min(100%,520px);margin:auto;padding:14px;border-radius:16px;background:#f8fbff}.student-math-response-long-division-quotient{display:grid;grid-template-columns:repeat(var(--math-long-division-columns),minmax(44px,58px));justify-content:center;align-items:end;gap:6px;padding-left:64px}.student-math-response-long-division-quotient .student-math-response-integer{width:100%;min-width:44px;box-sizing:border-box}.student-math-response-long-division-decimal{font-size:28px;font-weight:950;text-align:center}.student-math-response-long-division-dividend{display:flex;justify-content:center;align-items:center;gap:12px;font-size:24px;font-weight:900}.student-math-response-long-division-divisor{min-width:42px;text-align:right}.student-math-response-long-division-digits{display:inline-flex;align-items:center;border-top:3px solid #334155;border-left:3px solid #334155;border-radius:16px 0 0;padding:9px 12px 4px;letter-spacing:.18em}.student-math-response-long-division-digits .is-decimal{margin-inline:-.12em .02em}.student-math-response-long-division-stage{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;border-top:1px solid #dbeafe;padding-top:9px;font-weight:800}.student-math-response-long-division-stage .student-math-response-integer{width:64px}.student-math-feedback-visual{margin-top:12px;border-radius:16px;background:#fff;padding:8px}
@media(max-width:480px){.student-math-response-long-division-quotient{gap:4px;padding-left:36px}}
.student-math-response-strip { display: grid; gap: 10px; }.student-math-response-strip>strong { color: #263246; font-size: 15px; text-align: center; }
.student-math-response-strip-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(44px,1fr)); gap: 4px; border: 3px solid #334155; border-radius: 12px; overflow: hidden; padding: 3px; background: #f8fbff; }
.student-math-response-strip-grid button { min-width: 44px; min-height: 52px; border: 1px solid #64748b; border-radius: 5px; background: #fff; font: inherit; }.student-math-response-strip-grid button.is-painted { background: #93c5fd; box-shadow: inset 0 0 0 2px #2563eb; }
.student-math-response-geometry { display:grid; gap:12px; text-align:center; }.student-math-response-geometry-instruction{color:#263246;font-size:16px}.student-math-response-geometry-stage{position:relative;isolation:isolate;width:min(100%,640px);margin:auto}.student-math-response-geometry-picture{pointer-events:none}.student-math-response-geometry-picture canvas{display:block;width:100%!important}.student-math-response-geometry-hotspot{position:absolute;z-index:2;min-width:44px;min-height:44px;border:2px dashed rgba(37,99,235,.7);border-radius:12px;background:rgba(255,255,255,.08);cursor:pointer;touch-action:manipulation}.student-math-response-geometry-hotspot:hover,.student-math-response-geometry-hotspot:focus-visible{outline:3px solid #f59e0b;outline-offset:2px;background:rgba(254,240,138,.24)}.student-math-response-geometry-hotspot.is-selected{border-style:solid;border-color:#174ea6;background:rgba(147,197,253,.34);box-shadow:0 0 0 4px rgba(37,99,235,.2)}
.student-math-semantic-geometry{display:block;width:min(100%,640px);height:auto;max-width:100%;margin:auto;overflow:visible;touch-action:manipulation}.student-math-semantic-title{fill:#24344d;font:900 18px Pretendard,sans-serif}.student-math-semantic-label{fill:#24344d;font:800 16px Pretendard,sans-serif;paint-order:stroke;stroke:#f8fbff;stroke-width:5px;stroke-linejoin:round}.student-math-semantic-label.is-choice,.student-math-semantic-label.is-face{font-size:19px;font-weight:950}.student-math-response-geometry-svg{width:min(100%,640px)}.student-math-response-geometry-target{cursor:pointer;touch-action:manipulation}.student-math-response-geometry-target:hover,.student-math-response-geometry-target:focus-visible{fill:rgba(254,240,138,.28);filter:drop-shadow(0 0 3px #f59e0b);outline:none}.student-math-response-geometry-target.is-selected{fill:rgba(147,197,253,.42);filter:drop-shadow(0 0 3px #2563eb)}
.student-math-response-geometry-target[data-hotspot-indicator="line"]{fill:transparent!important;filter:none!important;outline:none;touch-action:none}.student-math-response-geometry-indicator{opacity:0}.student-math-response-geometry-target[data-hotspot-indicator="line"]:hover+.student-math-response-geometry-indicator,.student-math-response-geometry-target[data-hotspot-indicator="line"]:focus-visible+.student-math-response-geometry-indicator,.student-math-response-geometry-indicator.is-preview{opacity:1;stroke:#f59e0b}.student-math-response-geometry-target[data-hotspot-indicator="line"].is-selected+.student-math-response-geometry-indicator{opacity:1;stroke:#2563eb}.student-math-response-geometry-preview rect{fill:#174ea6;stroke:#fff;stroke-width:2;vector-effect:non-scaling-stroke}.student-math-response-geometry-preview text{fill:#fff;font:900 17px Pretendard,sans-serif}
.math-spatial-scene{touch-action:pan-y;user-select:none;-webkit-user-select:none;cursor:grab}.math-spatial-scene:active{cursor:grabbing}.math-spatial-scene:focus-visible{outline:3px solid #f59e0b;outline-offset:3px}.math-spatial-surface{stroke:none;pointer-events:all}.math-spatial-edge{pointer-events:none}.math-spatial-edge[data-edge-visibility="hidden"]{opacity:.82}.math-spatial-live{fill:#526177;font:750 12px Pretendard,sans-serif;pointer-events:none}.math-spatial-dimension path{stroke:#475569;stroke-width:2}.math-spatial-dimension[data-spatial-annotation-kind="perpendicular-distance"] path{stroke:#d97706}.math-spatial-dimension text{fill:#24344d;font:850 14px Pretendard,sans-serif;paint-order:stroke;stroke:#fff;stroke-width:5px;stroke-linejoin:round}.math-spatial-controls{display:none}.math-spatial-control{cursor:pointer;outline:none}.math-spatial-control rect{fill:#fff;stroke:#7aa7e8;stroke-width:2;vector-effect:non-scaling-stroke}.math-spatial-control text{fill:#174ea6;font:950 22px Pretendard,sans-serif;pointer-events:none}.math-spatial-control:hover rect,.math-spatial-control:focus-visible rect{fill:#fff7d6;stroke:#f59e0b;stroke-width:4}.math-spatial-target[aria-disabled="true"]{opacity:0;pointer-events:none}.math-spatial-scene.is-reduced-motion *{transition:none!important;animation:none!important}

@media (max-width: 1080px) {
  .student-math-solve-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .math-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .math-topbar > strong {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .math-spatial-controls { display: block; }
  .math-spatial-title { font-size: 24px; }
  .math-spatial-live { font-size: 18px; }
  .math-spatial-dimension text { font-size: 24px; }
  .math-spatial-control text { font-size: 26px; }
  .student-math-solve-grid {
    height: auto;
    min-height: 100%;
    grid-template-columns: 1fr;
  }

  .student-math-wrong-modal {
    padding: 14px;
  }

  .student-math-wrong-modal-card {
    max-height: calc(100dvh - 28px);
    border-radius: 22px;
    padding: 22px;
  }

  .student-math-wrong-modal-card h2 {
    font-size: 25px;
  }

  .student-math-work-board { padding: 13px; }
  .student-math-work-step { padding: 11px; }
  .student-math-step-fraction { width: 84px; }
  .student-math-step-fraction input { width: 84px; min-height: 52px; }
}

.student-math-response-geometry-target.math-spatial-target:focus { outline: none; }
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id="paper"],
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id^="paper-trail-"] {
  transform-box: fill-box;
  transform-origin: left center;
}
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-solid="sphere"] [data-surface-id="paper"],
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-solid="sphere"] [data-surface-id^="paper-trail-"] { transform-origin: right center; }
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id^="paper-trail-"] {
  opacity: 0;
  stroke-width: 3.2px;
}
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id="paper-trail-1"] { fill:#67e8f9;stroke:#0891b2; }
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id="paper-trail-2"] { fill:#60a5fa;stroke:#1d4ed8; }
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id="paper-trail-3"] { fill:#818cf8;stroke:#4338ca; }
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id^="result-"],
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-edge-id^="result-"] {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"][data-reveal-playing="true"] [data-surface-id="paper"] {
  animation: math-axis-source-turn 1.8s cubic-bezier(.34,.01,.24,1) both;
}
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"][data-reveal-playing="true"] [data-surface-id^="paper-trail-"] {
  animation: math-axis-rotation-trail 1.62s cubic-bezier(.34,.01,.24,1) both;
}
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"][data-reveal-playing="true"] [data-surface-id="paper-trail-2"] { animation-delay: 90ms; }
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"][data-reveal-playing="true"] [data-surface-id="paper-trail-3"] { animation-delay: 180ms; }
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"][data-reveal-playing="true"] [data-surface-id^="result-"],
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"][data-reveal-playing="true"] [data-edge-id^="result-"] {
  animation: math-axis-solid-form 1.8s cubic-bezier(.2,.7,.2,1) both;
}
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-solid="cylinder"][data-reveal-playing="true"] [data-edge-id^="result-"],
.student-math-feedback-visual .student-math-semantic-geometry[data-reveal-solid="cone"][data-reveal-playing="true"] [data-edge-id^="result-"] {
  animation: math-axis-solid-outline .28s ease-out 1.82s both;
}
@keyframes math-axis-source-turn {
  0%,8% { opacity:1;transform:scaleX(1); }
  36% { opacity:.88;transform:scaleX(.06); }
  58% { opacity:.5;transform:scaleX(-.7); }
  76% { opacity:.82;transform:scaleX(.08); }
  100% { opacity:0;transform:scaleX(.001); }
}
@keyframes math-axis-rotation-trail {
  0%,10% { opacity:0;transform:scaleX(1); }
  26% { opacity:.68;transform:scaleX(.72); }
  43% { opacity:.58;transform:scaleX(.22); }
  61% { opacity:.68;transform:scaleX(-.62); }
  80% { opacity:.52;transform:scaleX(-.16); }
  100% { opacity:0;transform:scaleX(.001); }
}
@keyframes math-axis-solid-form {
  0%,24% { opacity:0;transform:scaleX(.04); }
  58% { opacity:.55;transform:scaleX(.5); }
  88%,100% { opacity:1;transform:scaleX(1); }
}
@keyframes math-axis-solid-outline {
  from { opacity:0; }
  to { opacity:1; }
}
@media (prefers-reduced-motion: reduce) {
  .student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id],
  .student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-edge-id] { animation:none!important;opacity:1;transform:none; }
  .student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id="paper"],
  .student-math-feedback-visual .student-math-semantic-geometry[data-reveal-animation="axial-solid"] [data-surface-id^="paper-trail-"] { opacity:0; }
}

#studentMathFullscreen{min-height:44px;padding:8px 14px;border:1px solid #bed4f4;border-radius:12px;background:#fff;color:#245bb3;font:inherit;font-weight:800;cursor:pointer}
html.student-math-fullscreen{height:100%;overflow:hidden}
.student-math-fullscreen body{position:fixed;inset:0;overflow:auto;overscroll-behavior:contain}
.student-math-fullscreen .student-math-shell{max-width:none;min-height:100dvh;box-sizing:border-box;padding:8px}

/* Compact solving surface, separate from the start and result views. */
body[data-math-surface="workspace"] .student-math-shell {
  height: 100dvh; min-height: 0; gap: 0; padding: 0;
}
body[data-math-surface="workspace"] { color-scheme: light; }
body[data-math-surface="workspace"] .math-topbar { display: none; }
.student-math-workspace {
  display: flex; flex-direction: column; min-width: 0; height: auto; overflow: hidden;
  background: #faf8f1; padding-top: env(safe-area-inset-top);
}
.student-math-solve-bar {
  position: relative; z-index: 2; min-height: 58px; flex: none;
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px;
  padding: 0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));
  background: #fffefd; border-bottom: 1px solid #e5e2d6;
}
.student-math-solve-bar > strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: clamp(15px, 2.4vw, 20px); }
.student-math-solve-bar .student-math-compact-progress { display: block; }
.student-math-solve-bar .math-progress-info { margin: 0; color: #294362; font-size: 14px; white-space: nowrap; }
#studentMathPhase { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.student-math-solve-bar .math-progress-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0; }
.student-math-solve-menu { display: flex; justify-content: flex-end; align-items: center; min-width: 0; }
#studentMathFullscreen, #studentMathMore summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 8px; background: transparent; border: 0; color: #254770;
  font: inherit; font-size: 14px; font-weight: 800; white-space: nowrap; cursor: pointer;
}
#studentMathFullscreen { background: #edf4fd; }
#studentMathMore summary { font-size: 20px; }
#studentMathMore summary::-webkit-details-marker { display: none; }
.student-math-more-panel {
  position: absolute; inset: calc(100% + 3px) max(12px, env(safe-area-inset-right)) auto auto; width: min(240px,calc(100vw - 24px));
  padding: 10px; border: 1px solid #c9d9ed; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #213e632b;
}
.student-math-more-panel .student-math-live-stats { margin: 6px 0; }
.student-math-more-panel button { display: block; width: 100%; min-height: 44px; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 0 8px; font: inherit; cursor: pointer; }
.student-math-more-panel button:hover { background: #edf4fc; }
.student-math-workspace .student-math-solve-grid {
  display: flex; flex-direction: column; flex: 1; height: auto; min-height: 0;
  overflow: auto; overscroll-behavior: contain; padding: 12px max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));
}
.student-math-workspace .student-math-question {
  flex: 1; min-height: min-content; padding: 0; border: 0; border-radius: 18px; box-shadow: none; background: transparent;
}
.student-math-workspace .student-math-problem {
  display: flex; flex-direction: column; gap: 4px; overflow: visible; min-height: min-content; padding: 9px 18px 13px;
  border: 0; border-radius: 0; background: transparent;
}
.student-math-workspace .student-math-problem h2[aria-label], .student-math-workspace .student-math-problem h2 {
  font-size: clamp(22px,3.2vw,30px); line-height: 1.24; overflow-wrap: anywhere;
}
.student-math-workspace .student-math-problem > p { margin: 0; }
.student-math-workspace .student-math-question-workspace {
  display: grid; grid-template-rows: auto auto; place-items: center stretch;
  flex: 1; overflow: visible; gap: 8px; padding: 4px 0 0; align-content: start;
}
.student-math-workspace #studentMathQuestionVisual { width: 100%; max-width: 100%; justify-self: center; min-width: 0; }
.student-math-workspace #studentMathQuestionVisual:empty { display: none; }
.student-math-workspace #studentMathQuestionVisual .math-grid-drawing-stage { max-width: min(420px,100%); }
.student-math-workspace #studentMathQuestionVisual:has(> .math-grid-drawing) { display: block; height: auto; container-type: normal; }
.student-math-workspace[data-grid-read="true"] #studentMathQuestionVisual > .math-grid-drawing {
  width: min(100%,680px,max(180px,calc(100dvh - 312px))); height: auto; max-width: 100%;
}
.student-math-workspace[data-grid-read="true"] #studentMathQuestionVisual .math-grid-drawing-stage { width: 100%; max-width: 100%; height: auto; }
.student-math-answer-region { display: grid; width: min(100%, 980px); gap: 8px; justify-self: center; min-width: 0; }
.student-math-workspace[data-direct-numeric="true"] .student-math-answer-region { align-self: end; }
.student-math-workspace #studentMathAnswerForm, .student-math-workspace #studentMathAnswerControls { width: 100%; gap: 6px; min-width: 0; }
.student-math-workspace .student-math-choice-grid { width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.student-math-workspace .student-math-choice {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px; text-align: left;
  padding: 5px 11px; min-height: 48px; min-width: 0; font-size: clamp(15px,2vw,17px); border-radius: 11px; overflow-wrap: anywhere;
}
.student-math-workspace .student-math-choice::before { content: ""; flex: 0 0 16px; height: 16px; border: 2px solid #8299b5; border-radius: 50%; box-sizing: border-box; }
.student-math-workspace .student-math-choice.is-selected::before { border: 5px solid #2465d5; }
.student-math-choice[data-result="wrong"] { background: #fdf0f1; border-color: #e9b8bf; color: #852e42; }
.student-math-choice[data-result="correct"] { background: #e6f8f0; border-color: #9bd8bd; color: #115940; }
.student-math-choice small { margin-left: auto; font-size: 11px; }
.student-math-answer-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.student-math-answer-tools:has(> :not([hidden])) { padding: 0 0 2px; }
.student-math-answer-tools button, .student-math-workspace .student-math-actions button {
  min-height: 44px; border: 1px solid #b6cbe5; border-radius: 10px; background: #f8fbff; color: #193f70; padding: 5px 10px; font: inherit; font-weight: 800;
}
.student-math-answer-tools button[aria-expanded="true"] { background: #dfedff; }
.student-math-workspace #studentMathFeedback[data-tone=""], .student-math-answer-tools:not(:has(> :not([hidden]))) { display: none; }
#studentMathHint {
  width: min(390px,calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 16px; border: 1px solid #edd5a0; border-radius: 14px;
  background: #fffaf0; color: #3c3528; box-shadow: 0 12px 32px #23395b32;
}
#studentMathHint[open] { display: grid; gap: 9px; }
#studentMathHint::backdrop { background: #24365738; }
#studentMathHint strong { color: #754908; }
#studentMathHint p { margin: 0; font: inherit; overflow-wrap: anywhere; }
#studentMathHint button { min-height: 44px; border: 1px solid #edd5a0; border-radius: 9px; background: #fffefd; color: #423521; font: inherit; cursor: pointer; }
.student-math-workspace .student-math-actions {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); flex: none; gap: 8px; margin: 0;
  padding: 0 0 max(10px,env(safe-area-inset-bottom));
}
.student-math-workspace #studentMathCheck, .student-math-workspace #studentMathNext { min-height: 48px; color: #fff; background: #235ad5; border-color: #235ad5; box-shadow: 0 3px 0 #15449e; }
.student-math-workspace #studentMathCheck:disabled { opacity: .55; }
.student-math-floating-keypad { width: min(292px, 56vw); min-width: 172px; filter: drop-shadow(0 14px 24px #14213d38); }
.student-math-keypad-panel { margin-top: 0; padding: 8px; box-shadow: none; }
.student-math-floating-keypad.is-anchored {
  position: relative; z-index: 1; justify-self: center; align-self: center;
  max-width: 100%; overflow: visible; touch-action: pan-y;
}
#studentMathKeypadDisplay { min-height: 36px; margin-block: 4px 7px; }
.student-math-keypad-grid { gap: 5px; }
.student-math-keypad-grid button { min-height: 44px; }
.student-math-floating-keypad, .student-math-floating-scratchpad { max-height: calc(100dvh - 20px); max-width: calc(100vw - 20px); overflow: auto; }
@media (min-width: 400px) and (max-width: 600px), (min-width: 1024px) and (orientation: landscape) {
  .student-math-keypad-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .student-math-keypad-grid [data-keypad-value="/"] { grid-area: 1 / 4; }
  .student-math-keypad-grid [data-keypad-value=" "] { grid-area: 2 / 4; font-size: 14px; }
  .student-math-keypad-grid [data-keypad-action="backspace"] { grid-area: 3 / 4; }
  .student-math-keypad-grid [data-keypad-action="clear"] { grid-area: 4 / 4; font-size: 14px; }
  .student-math-keypad-grid [data-keypad-value="0"] { grid-area: 4 / 1 / span 1 / span 2; }
  .student-math-keypad-grid [data-keypad-action="confirm"] { grid-column: 1 / -1; }
}
@media (min-width: 900px) and (orientation: landscape) {
  .student-math-workspace .student-math-solve-grid { padding-top: 16px; }
  .student-math-workspace .student-math-question { width: min(100%,1040px); margin-inline: auto; }
  .student-math-workspace .student-math-problem h2,
  .student-math-workspace .student-math-problem h2[aria-label],
  .student-math-workspace .student-math-problem > p { text-align: left; justify-content: flex-start; }
  .student-math-workspace[data-landscape-split="true"] .student-math-question-workspace:has(> #studentMathQuestionVisual:not(:empty)) {
    grid-template-columns: minmax(0,1.27fr) minmax(0,1fr); grid-template-rows: auto;
    align-items: stretch; align-content: start; gap: 20px; padding-top: 10px;
  }
  .student-math-workspace[data-landscape-split="true"] .student-math-question-workspace:has(> #studentMathQuestionVisual:not(:empty)) .student-math-answer-region {
    display: flex; flex-direction: column; align-self: stretch; padding: 8px 0;
  }
  .student-math-workspace[data-direct-numeric="true"] .student-math-problem:not(:has(#studentMathQuestionVisual:not(:empty))) {
    display: grid; grid-template-columns: minmax(0,1.27fr) minmax(0,1fr); grid-template-rows: auto 1fr;
    align-content: start; column-gap: 20px;
  }
  .student-math-workspace[data-direct-numeric="true"] .student-math-problem:not(:has(#studentMathQuestionVisual:not(:empty))) .student-math-question-workspace {
    grid-column: 2; grid-row: 1 / 3;
  }
  .student-math-workspace[data-landscape-split="true"] .student-math-actions { margin-top: auto; }
  .student-math-workspace[data-grid-read="true"] #studentMathQuestionVisual > .math-grid-drawing {
    width: min(100%,450px,max(180px,calc(100dvh - 230px)));
  }
}

@media (max-width: 600px) {
  .student-math-solve-bar { padding-inline: 8px; }
  .student-math-solve-bar { grid-template-columns: minmax(0,1fr) auto auto; }
  #studentMathFullscreen i { display: none; }
  .student-math-workspace .student-math-solve-grid { padding-inline: 8px; }
  .student-math-workspace .student-math-problem { padding-inline: 9px; }
  .student-math-workspace[data-grid-read="true"] #studentMathQuestionVisual > .math-grid-drawing { width: min(100%,440px,max(180px,calc(100dvh - 336px))); }
}

.drawing-half-turn { pointer-events: none; }
.drawing-half-turn polyline { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.drawing-half-turn-source polyline, .drawing-half-turn-moving polyline { stroke: #2465e2; }
.drawing-half-turn-source circle, .drawing-half-turn-moving circle { fill: #2465e2; }
.drawing-half-turn-moving .drawing-given { stroke: #2465e2; opacity: .32; }
.drawing-half-turn-matched polyline { stroke: #008478; }
.drawing-half-turn-matched circle { fill: #008478; }
.drawing-half-turn-arrow { fill: none; stroke: #245fca; stroke-width: 3; stroke-linecap: round; }
.drawing-half-turn-label { fill: #164b9e; font-size: 19px; font-weight: 800; }

.student-math-workspace [hidden] { display: none !important; }
.student-math-input-with-unit { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; }
.student-math-input-with-unit input { width: min(120px,60vw); }
.student-math-workspace[data-direct-numeric="true"] .student-math-answer-input { text-align: center; }

@media (max-width: 399px) {
  .student-math-keypad-panel { padding: 7px; }
  #studentMathKeypadDisplay { min-height: 32px; margin-block: 3px 5px; font-size: 20px; }
  .student-math-keypad-grid { gap: 3px; }
  .student-math-keypad-grid [data-keypad-action="clear"] { grid-column: auto; font-size: 14px; }
}

@media (max-width: 390px) {
  .student-math-workspace[data-grid-read="true"] #studentMathQuestionVisual > .math-grid-drawing { max-width: 254px; }
  .student-math-workspace .student-math-choice { padding-inline: 6px; gap: 5px; }
  .student-math-choice small { font-size: 10px; white-space: nowrap; }
}

/* The notebook home and result share the same light surface as the problem. */
body.math-daily-page { color-scheme: light; background: #faf8f1; }
body.math-daily-page:not([data-math-surface="workspace"]) { overflow: auto; }
body:not([data-math-surface="workspace"]) .student-math-shell {
  width: min(100%,1080px); height: auto; min-height: 0; margin-inline: auto; padding: clamp(8px,2vw,20px);
}
.student-math-page .math-topbar {
  min-height: 52px; grid-template-columns: minmax(0,1fr) auto; gap: 8px;
  padding: 8px 14px; background: #fffefd; border-radius: 14px;
}
.student-math-page .math-topbar > strong { min-width: 0; grid-column: auto; }
.student-math-page .math-brand b { font-size: 17px; }
.student-math-page .math-brand .math-logo {
  width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; background: #e9efff; color: #235ad5; font-size: 21px;
}
.student-math-start.math-overlay, .student-math-result-overlay.math-overlay {
  position: static; inset: auto; z-index: auto; min-width: 0; place-items: start center;
  padding: clamp(8px,2vw,20px); border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none;
}
.student-math-start .math-start-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin: 0; }
.student-math-start .math-hero {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: center; gap: 18px;
  background: #eef3ff; border: 1px solid #d6e1fc; border-radius: 18px; padding: clamp(12px,2vw,22px);
}
.student-math-notebook-intro { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; }
.student-math-notebook-intro .student-math-kicker { color: #1748b6; font-size: 12px; font-weight: 800; }
.student-math-notebook-intro h2 { margin: 4px 0; color: #193c84; font-size: clamp(23px,4vw,34px); line-height: 1.22; word-break: keep-all; }
.student-math-notebook-intro p { margin: 0; color: #365174; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.student-math-notebook {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; width: clamp(48px,9vw,76px); aspect-ratio: 1;
  padding: 10px; border: 1px solid #ccd9fb; border-radius: 12px; background: #fff; box-shadow: 4px 5px 0 #d6e1fa; transform: rotate(8deg);
}
.student-math-notebook i { border-radius: 3px; background: #5e82e9; }
.student-math-notebook i:nth-child(2) { background: #ffd66b; border-radius: 50%; }
.student-math-notebook i:nth-child(3) { background: #72c6ab; }
.student-math-notebook i:nth-child(4) { background: #ea947c; clip-path: polygon(0 100%,100% 0,100% 100%); }
.student-math-notebook-progress { display: grid; gap: 6px; min-width: 0; }
.student-math-notebook-progress .math-completion-card { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; background: none; }
.student-math-notebook-progress .math-completion-card > span { display: none; }
.student-math-notebook-progress .math-completion-card h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.student-math-notebook-progress .math-completion-card p { margin: 0; font-size: 12px; }
.student-math-notebook-track { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; font-size: 12px; color: #1748b6; }
.student-math-notebook-track progress { width: 100%; height: 10px; accent-color: #235ad5; }
#studentMathStart, .student-math-result-overlay .math-retry-btn {
  margin: 0; min-height: 44px; padding: 7px 12px; border-radius: 10px; background: #235ad5;
  font-size: 15px; box-shadow: 0 3px 0 #15449e;
}
.student-math-home-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 10px; }
.student-math-home-cards .math-analysis-card, .student-math-home-cards .student-math-more {
  width: 100%; min-width: 0; margin: 0; border-color: #e5e2d6; background: #fffefd;
}
.student-math-start .student-math-history { display: block; margin: 0; min-width: 0; padding: 12px; border-radius: 14px; }
.student-math-result-overlay .math-result-grid {
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 14px; align-items: start; margin: 0;
}
.student-math-result-overlay .math-result-copy, .student-math-result-overlay .math-result-list {
  min-width: 0; padding: 14px; border-radius: 16px; text-align: left;
}
.student-math-result-overlay .math-result-copy { background: #eef3ff; border: 1px solid #d6e1fc; }
.student-math-result-overlay .math-result-copy h2 { font-size: clamp(22px,4vw,32px); }
.student-math-result-overlay .math-result-list { background: #f2faf4; border: 1px solid #d2e9dc; }
.student-math-result-overlay .math-result-list > button { width: 100%; margin-top: 8px; }
.student-math-result-overlay .math-home-link {
  min-height: 44px; padding: 6px 10px; border: 1px solid #d6e1fc; border-radius: 10px;
  background: #fffefd; color: #193c84; font-size: 13px; cursor: pointer;
}
.student-math-result-overlay .math-result-copy > .math-home-link { margin: 8px 6px 0 0; }
.student-math-result-overlay[hidden], .student-math-result-overlay [hidden] { display: none !important; }
@media (max-width: 650px) {
  .student-math-start .math-hero, .student-math-home-cards, .student-math-result-overlay .math-result-grid { grid-template-columns: minmax(0,1fr); }
}

html[data-math-teacher-review] .student-math-notice {
  position: static; transform: none; max-width: 100%; border-radius: 9px; padding: 8px 12px; font-size: 13px;
}

.student-math-question-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 14px;
}
.student-math-question-heading h2 { flex: 1; min-width: 0; }
.student-math-question-report {
  flex: none;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: .83rem;
  font-weight: 650;
  cursor: pointer;
}
.student-math-question-report[hidden] { display: none; }
.student-math-wrong-modal-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px;
}
.student-math-wrong-modal-actions .student-math-wrong-modal-next { flex: 1 1 140px; }
.student-math-wrong-modal-body > p { margin: 0; }
.student-math-wrong-modal-body .student-math-step-feedback { margin-block: 8px; }
.math-half-turn-layout { display: grid; gap: 8px 16px; align-items: center; }
.math-half-turn-layout p { margin: 0; }
.math-half-turn-controls {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end;
  font-size: 14px;
}
.math-half-turn-controls label { grid-column: 1 / -1; display: grid; gap: 4px; }
.math-half-turn-controls label:has(input) { grid-template-columns: 1fr auto; }
.math-half-turn-controls input { grid-column: 1 / -1; width: 100%; margin: 0; min-height: 36px; accent-color: #2465e2; }
.math-half-turn-controls button, .math-half-turn-controls select {
  min-height: 44px; border: 1px solid #b6cbe5; border-radius: 9px; background: #fff;
  color: #193f70; font: inherit; padding: 4px 8px;
}
@media (min-width: 580px) {
  .math-half-turn-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .math-half-turn-layout p { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .student-math-wrong-modal-card { padding: 14px; }
  .student-math-wrong-modal-body { padding: 12px; }
}
