:root{font-family:'Segoe UI','Malgun Gothic',sans-serif;color:#243b48;background:#eef3f6;font-size:14px;--accent:#7754ac;--accent-soft:#f1eafb;--line:#dce5ec}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid var(--line);border-radius:10px;background:#fff;color:#294756;min-height:36px;padding:7px 12px;font-weight:650}button:hover{background:#edf4f8;border-color:#a7becd}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #248bc0;outline-offset:3px}a{color:#43677d;text-underline-offset:3px}[hidden]{display:none!important}.topbar{height:70px;padding:10px 24px;display:flex;gap:13px;align-items:center;background:#fff;border-bottom:1px solid var(--line)}.brand{text-decoration:none}.brand-mark{display:grid;place-items:center;width:39px;height:39px;border-radius:11px;background:#335e65;color:#fff;font-size:31px}.title h1{font-size:19px;margin:0}.title p{font-size:11px;color:#68808c;margin:3px 0 0}.history-button{margin-left:10px;font-size:12px;background:#f3f7f8}.topbar nav{display:flex;gap:15px;margin-left:auto;font-size:12px}.topbar nav a{text-decoration:none}main{padding:16px 24px 10px;max-width:1680px;margin:auto}.lesson-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px;min-height:50px}.lesson-bar strong{display:block;font-size:17px;margin-bottom:5px}.lesson-bar #next-guide{font-size:12px;color:#607a88}.prime-steps{display:flex;gap:7px}.prime-steps button{width:43px;height:43px;padding:0;position:relative;font-size:17px}.prime-steps .extended-step{border-style:dashed}.prime-steps .done{background:#fff3cf;color:#71591b;border-color:#e3c979}.prime-steps .active{background:var(--accent);border-color:var(--accent);color:#fff}.prime-steps .next{box-shadow:0 0 0 2px #46748655;border-color:#467486}.exploration{display:grid;grid-template-columns:minmax(0,1fr) 305px;gap:16px;align-items:start}.board-card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:14px 18px 10px;min-width:0}.board-heading{display:flex;align-items:center;gap:13px;margin-bottom:10px}.board-heading h2{font-size:16px;margin:0}.board-heading #remaining{font-size:12px;color:#697e8a}.board-heading button{margin-left:auto;font-size:12px;padding:5px 9px;min-height:31px}.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:10px;color:#687a87;margin-bottom:13px}.legend span{display:flex;gap:5px;align-items:center}.key{display:inline-block;width:11px;height:11px;border:1px solid #c5d2da;border-radius:3px}.key.retained{background:#fff}.key.prior{background:#eef1f4}.key.latest{background:var(--accent-soft);border-color:var(--accent)}.key.prime{background:#fff0b8;border-color:#ddc675}.number-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));grid-auto-rows:minmax(26px,1fr);gap:6px;height:clamp(360px,calc(100dvh - 250px),700px)}.number{display:flex;align-items:center;justify-content:center;position:relative;min-width:0;min-height:0;font-size:clamp(15px,1.6vw,23px);padding:0;border-radius:7px;border:1px solid #d7e1e8;background:#fff;font-variant-numeric:tabular-nums;transition:background .16s,border-color .16s,color .16s}.number.removed{background:#f6f8fa;border-color:#f0f3f5;color:#b8c2cc;text-decoration:line-through;text-decoration-color:#ccd4db}.number.prime-number{color:#745616;background:#fff3c6;border-color:#e2ca86;font-weight:750}.number.recent{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);text-decoration:line-through;text-decoration-thickness:2px}.number.focused{color:#fff;background:var(--accent);border-color:var(--accent);box-shadow:0 0 0 3px #ccb6ea;z-index:1;transform:scale(1.07)}.number.just-removed{animation:filter-out .5s ease-out}.number.inspected{outline:2px solid #487c92;outline-offset:1px}.number.one{color:#9baab4;background:#f4f6f8;border-style:dashed}.number-grid.expanded{grid-template-columns:repeat(20,minmax(0,1fr));gap:4px;height:clamp(405px,calc(100dvh - 277px),735px)}.number-grid.expanded .number{font-size:clamp(10px,1vw,15px);border-radius:4px}.board-hint{font-size:11px;color:#708591;margin:10px 0 0;line-height:1.6}.expansion-note{font-size:11px;background:#eef6f8;color:#3a6977;border-radius:8px;padding:7px 10px;margin:0 0 9px;line-height:1.5}.teaching-panel{display:flex;flex-direction:column;gap:11px}.focus-card,.playback,.trail-card{border:1px solid var(--line);border-radius:15px;padding:16px;background:#fff}.focus-card{background:var(--accent-soft);border-color:#dfd5ed}.eyebrow{font-size:11px;color:var(--accent);font-weight:700}.focus-card h2{font-size:18px;margin:8px 0 12px;line-height:1.4}.equation{font-size:29px;font-weight:750;letter-spacing:-.8px;font-variant-numeric:tabular-nums;color:var(--accent);min-height:42px}.focus-card p{font-size:12px;line-height:1.8;color:#555c71;margin:10px 0}.progress-line{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#655f75}progress{width:100%;height:5px;accent-color:var(--accent)}h3{font-size:13px;margin:0 0 11px}.section-heading{display:flex;justify-content:space-between}.section-heading output{font-size:12px;color:var(--accent);font-weight:700}.speed-label{display:flex;justify-content:space-between;font-size:11px;color:#6c7f8b}input[type=range]{width:100%;accent-color:var(--accent);height:22px;margin:4px 0}#tempo-note{font-size:11px;line-height:1.6;color:#6c7f8b;margin:4px 0 12px}.play-buttons{display:flex;gap:7px}.play-buttons button{flex:1;font-size:12px}.quiet{background:#f8fafb;color:#637c89}.wide{width:100%;margin-top:7px;font-size:12px}.trail-card h3{display:flex;justify-content:space-between}.trail-card h3 span{color:var(--accent)}.trail{display:flex;flex-wrap:wrap;gap:5px;max-height:82px;overflow:auto}.trail button{min-height:26px;font-size:12px;padding:2px 7px;color:var(--accent);background:var(--accent-soft);border-color:#e1d5f0}.empty-trail{font-size:12px;color:#93a0a8}#inspect{border-top:1px solid #e8eef2;padding-top:10px;margin:10px 0 0;font-size:12px;color:#57707e;line-height:1.7}.bottom-actions{display:flex;gap:8px}.bottom-actions button{flex:1;font-size:12px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}dialog{border:1px solid var(--line);border-radius:20px;padding:0;width:min(650px,92vw);max-height:88dvh;overflow:auto;color:#294552;box-shadow:0 20px 80px #13374b40}dialog::backdrop{background:#233d5166}.dialog-heading{position:sticky;top:0;z-index:5;background:#fff;padding:17px 22px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:15px;justify-content:space-between}.dialog-heading h2{font-size:18px;margin:0}.dialog-heading button{white-space:nowrap;flex-shrink:0}.dialog-body{padding:24px;line-height:1.9}.history-kicker{font-size:12px;color:#7754ac;font-weight:700}.history-lead{font-size:25px;line-height:1.55}.dialog-body h3{font-size:16px;margin-top:25px}.history-example{display:flex;gap:6px;justify-content:center;background:#f5f7fa;padding:18px 10px;border-radius:12px;flex-wrap:wrap}.history-example b,.history-example s{width:35px;height:35px;display:grid;place-items:center;border-radius:7px;background:#fff1b9}.history-example s{color:#bcc6cf;background:#edf1f5}.history-source{font-size:11px;color:#70838d}.history-source a{display:inline-block}@keyframes filter-out{0%{transform:scale(1.07);box-shadow:0 0 0 3px #ccb6ea}100%{transform:scale(1);box-shadow:none}}
@media(min-width:1000px) and (max-height:780px){main{padding-top:10px}.lesson-bar{margin-bottom:9px}.focus-card,.playback,.trail-card{padding:12px}.teaching-panel{gap:8px}.focus-card h2{margin:6px 0;font-size:16px}.equation{font-size:26px;min-height:35px}.focus-card p{margin:6px 0}.trail{max-height:55px}.trail-card #inspect{font-size:11px;margin-top:7px;padding-top:7px}.playback #tempo-note{margin-bottom:7px}.play-buttons button,.wide{min-height:30px;padding:5px 8px}}
@media(max-width:1000px){main{padding:12px}.topbar{padding:10px 14px}.exploration{grid-template-columns:minmax(0,1fr) 260px;gap:11px}.prime-steps button{width:36px;height:38px}.board-card{padding:12px}.number-grid{gap:4px}.number-grid.expanded{gap:3px}.legend{gap:7px}.equation{font-size:25px}.focus-card,.playback,.trail-card{padding:12px}}
@media(max-width:760px){.topbar{height:auto;min-height:65px;padding:9px 12px;gap:8px;flex-wrap:wrap}.brand-mark{width:32px;height:32px}.title h1{font-size:17px}.history-button{font-size:10px;margin-left:auto;padding:6px}.topbar nav{width:100%;justify-content:flex-end;font-size:10px;gap:13px;margin-top:-2px}.lesson-bar{align-items:flex-start;flex-direction:column;gap:11px}.lesson-bar strong{font-size:15px}.prime-steps{width:100%;justify-content:space-between;gap:5px}.prime-steps button{width:40px}.exploration{display:flex;flex-direction:column}.board-card{width:100%}.teaching-panel{width:100%;display:grid;grid-template-columns:1fr 1fr}.focus-card{grid-column:1/-1}.bottom-actions{grid-column:1/-1}.number-grid{height:clamp(330px,55dvh,580px)}.number-grid.expanded{grid-template-columns:repeat(10,minmax(0,1fr));height:auto;grid-auto-rows:28px}.number-grid.expanded .number{font-size:12px}.board-heading h2{font-size:14px}.board-heading #remaining{font-size:10px}.board-heading button span{display:none}.board-heading button{font-size:20px;padding:2px 7px}.legend{font-size:9px}.board-hint{font-size:10px}.dialog-heading{padding:13px}.dialog-heading h2{font-size:15px}.history-lead{font-size:22px}.number-grid .number{font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.number.focused{transform:none}}
