.math-intro{background:linear-gradient(118deg,#6425cb,#ab1c80);border-radius:24px;color:white;padding:24px clamp(18px,5vw,36px);margin-bottom:16px}
.math-intro h1{margin:0;font-size:clamp(2rem,8vw,3.3rem);letter-spacing:-.055em;line-height:1.1}
.math-intro p{margin:8px 0 0;font-weight:750}
.math-setup,.math-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}
.math-setup,.math-practice,.math-recap{padding:clamp(14px,3vw,24px)}
.math-practice{scroll-margin-block-start:12px}
.math-settings,.math-start{grid-column:1/-1}
.math-settings{border-top:2px solid var(--line);padding-top:14px;font-weight:800}
.math-setup input[type=number]{display:block;margin-top:6px}
.math-segments{display:flex;gap:5px}
.math-segments label{position:relative;display:grid;place-items:center;flex:1;min-height:46px;padding:5px;background:#ede2ff;border:2px solid transparent;border-radius:11px;text-align:center;cursor:pointer}
.math-segments input{position:absolute;width:1px;height:1px;min-height:0;opacity:0}
.math-segments label:has(:checked){background:var(--purple);color:white}
.math-segments label:has(:focus-visible){outline:3px solid #ad2175;outline-offset:3px}
.examples .secondary{font-size:1.25rem}
.examples{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:16px 0}
.math-progress{display:flex;justify-content:space-between;gap:8px;color:var(--dark)}
#progress-bar{display:block;width:100%;height:12px;margin:8px 0 14px;accent-color:#7140ce}
.number-card{border-radius:19px;padding:12px 8px 16px;text-align:center;color:white;background:#6328c2}
.number-card.blue{background:#1557bd}.number-card.pink{background:#b71368}.number-card.green{background:#08754e}
.number-card h2{color:white;margin:0 0 10px;font-size:clamp(2rem,8vw,3.35rem)}
.math-board{display:flex;justify-content:center;gap:4px;align-items:end}
.math-column,.math-sign{display:grid;grid-template-rows:1.4rem 3.25rem 2.75rem 2.75rem 3.5rem;gap:4px;align-items:center}
.math-column{width:clamp(52px,17%,95px)}
.place-label{font-size:clamp(.64rem,2.65vw,.95rem);font-weight:800}
.math-column.active .place-label{color:#fff4a5;text-decoration:underline;text-underline-offset:4px}
.math-digit,.math-sign{font-size:clamp(2rem,7vw,2.6rem);font-weight:900}
.answer-line{border-top:2px solid #ffffffbd;padding-top:4px;align-self:stretch;display:grid;place-items:center}
.math-slot{border:1px solid #ffffffb0;background:#ffffff25;color:white;border-radius:9px;width:100%;height:50px;font-weight:900;font-size:2rem}
.math-slot:disabled{opacity:1}
.math-slot.current{border:2px dashed #fff1a0;background:#28125665}
.math-slot.revealed{background:#fff1a0;color:#362046}
.math-slot:focus-visible,.number-tile:focus-visible{outline-color:#ffe576}
.number-tiles{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:6px;max-width:570px;margin-inline:auto}
.number-tile,.tile-ghost{min-height:53px;background:#572abb;border:0;border-radius:10px;color:white;font-size:1.85rem;font-weight:900}
.number-tile{touch-action:none;user-select:none}
.number-tile:nth-child(4n+2){background:#1557bd}.number-tile:nth-child(4n+3){background:#b71368}.number-tile:nth-child(4n){background:#08754e}
.number-tile[aria-pressed=true],.hint-target{outline:3px solid #ffcb3c;outline-offset:2px}
.tile-ghost{position:fixed;z-index:5;pointer-events:none;display:grid;place-items:center;width:52px;height:53px;left:0;top:0}
#instruction,#math-feedback,#say-text,.picture-clues{text-align:center}
#instruction,#math-feedback{font-weight:800}
#math-feedback{min-height:1.5em;margin:12px 0 0;color:#4b2585}
#say-text{margin:6px 0;color:var(--muted)}
.picture-clues{margin-top:12px}
.block-row{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;margin-top:7px;font-weight:800}
.block-group{--block-color:#7133cc;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:3px;max-width:min(100%,270px);padding:5px;border-radius:8px;background:#f1e9ff}
.block-group.second{--block-color:#b71368;background:#fae8f2}
.block-group.carried{--block-color:#08754e;background:#e1f6ed}
.block-group.trading{--block-color:#1557bd;background:#e5efff;border:1px solid #91b3e9}
.base-block{display:inline-block;flex:none;background-color:var(--block-color);border-radius:2px}
.block-0{width:13px;height:13px}
.block-1,.block-2,.block-3{background-image:linear-gradient(to bottom,transparent calc(100% - 1px),#fff9 0);background-size:100% 10%}
.block-1{width:10px;height:60px}
.block-2,.block-3{width:45px;height:45px;background-image:linear-gradient(to bottom,transparent calc(100% - 1px),#fff9 0),linear-gradient(to right,transparent calc(100% - 1px),#fff9 0);background-size:10% 10%}
.block-3{margin:0 5px 5px 0;box-shadow:2px 2px 0 #7792cb,5px 5px 0 #3f5990}
.block-symbol{color:var(--dark);font-size:1.15rem}
.block-trade-label{margin-left:6px}
.math-recap{margin-top:16px}
.math-cheer{animation:cheer .32s ease-out}
@keyframes cheer{50%{transform:scale(1.018)}}
@media(max-width:530px){.math-setup,.math-settings{grid-template-columns:1fr}.number-tiles{grid-template-columns:repeat(5,1fr)}}
@media(prefers-reduced-motion:reduce){.math-cheer{animation:none}}
@media print{.number-picnic header,.number-picnic main>:not(.math-recap),#print{display:none!important}.math-recap{box-shadow:none;border:0}}

.math-slot.incorrect{background:#9c1743;border-color:#ffd2dc}
.number-tile.crossed-out{text-decoration:line-through 3px;opacity:.65}

.borrow-marks{display:flex;align-items:center;justify-content:center;gap:3px;min-width:0}
.borrow-marks .math-slot{min-width:0;padding:0;font-size:clamp(1rem,4vw,1.75rem)}
.struck-digit{text-decoration:line-through 3px;text-decoration-color:#ffd47e;opacity:.72}
.math-slot.struck-digit:disabled{opacity:.72}
.takeaway-blocks{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:5px;margin-top:7px}
.takeaway-block{display:grid;place-items:center;position:relative;min-width:35px;min-height:42px;padding:4px;border:1px solid #d8c8f3;border-radius:6px;background:#f6eeff;--block-color:#7133cc}
.takeaway-block:disabled{opacity:1}
.takeaway-block[aria-pressed=true] .base-block{opacity:.33}
.takeaway-block[aria-pressed=true]::after{content:"";position:absolute;width:90%;height:3px;background:#970a45;transform:rotate(-32deg);border-radius:2px}
.takeaway-status{margin:4px 0 0}
.trade-candidate{outline:2px dashed #a84200;outline-offset:2px}
.trade-button{min-height:44px;padding:6px 10px;border:1px solid #cbb1f3;border-radius:8px;background:#f3ebff;color:var(--dark);font-weight:800}
.traded-block{opacity:.45;transform:translateY(-4px);outline-style:dotted}
.received-blocks{animation:receive-blocks .45s ease-out}
@keyframes receive-blocks{from{opacity:.35;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}

.math-mode-buttons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:16px}
.math-mode{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-height:63px;padding:5px 4px;border:2px solid var(--line);border-radius:13px;background:white;color:var(--dark);font-weight:800;font-size:.93rem}
.math-mode span{font-size:1.4rem;line-height:1}
.math-mode:hover{background:#f2eaff}
.math-mode[aria-pressed=true]{background:var(--purple);border-color:var(--purple);color:white}
#mode-status{margin:0 0 14px;padding:10px 12px;border-radius:11px;background:#ede2ff;color:var(--dark);font-weight:750}
@media(max-width:590px){.math-mode-buttons{grid-template-columns:repeat(3,minmax(0,1fr))}}
.math-slot.regroup-next{border:2px dotted #ffffffa6;background:#ffffff19}

#multiply-parts{display:flex;justify-content:center;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:0}
#multiply-parts li{padding:7px 9px;border:1px solid #ffffff80;border-radius:8px;font-weight:850}
#multiply-parts .active-product{outline:2px solid #ffed89;background:#3210786b}
#multiply-step,#multiply-feedback,#multiply-speech{text-align:center;font-weight:750}
.multiply-sets{display:grid;gap:5px;justify-items:stretch;width:fit-content;max-width:100%;margin:8px auto}
.multiply-set{display:flex;justify-content:center;align-items:center;gap:4px;flex-wrap:wrap;min-height:24px;padding:4px 7px;border-radius:7px;background:#efe5ff}
.multiply-set:nth-child(even){background:#dff2ff}
.multiply-dot{display:grid;place-items:center;min-width:12px;min-height:12px;border-radius:8px;background:#6328c2;color:#fff;font-size:.82rem;font-weight:900}
.multiply-dot:not(:empty){min-width:28px;min-height:22px;padding:1px 4px}
.multiply-set:nth-child(even) .multiply-dot{background:#1557bd}
.product-chip{display:inline-block;margin:3px;padding:5px 8px;border-radius:6px;background:#e8dcff;font-weight:900}
.multiply-answer-form{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:14px}
.multiply-answer-form label{font-weight:800}
.multiply-answer-form input{width:7rem;text-align:center;font-size:1.45rem;font-weight:900}
.multiply-set{width:100%;border:2px solid transparent}
.multiply-set[aria-pressed=true]{border-color:#08754e;background:#defaee}
#multiply-breakdown{margin:0 0 10px;font-weight:800}

#visual-step,#visual-feedback,#visual-speech,#visual-board{text-align:center;font-weight:750}
.division-bracket{display:grid;grid-template-columns:auto auto;width:max-content;max-width:100%;margin:8px auto;align-items:end;color:var(--dark);font-weight:900;font-size:clamp(1.7rem,7vw,2.5rem)}
.division-divisor{padding:0 .35em .17em 0}
.division-line{display:flex;justify-content:flex-end;padding:0 .2em 0 .3em}
.dividend-line{border-top:3px solid currentColor;border-left:3px solid currentColor;border-top-left-radius:12px}
.division-cell{display:grid;place-items:center;width:1.15em;min-height:1.2em}
.active-division{background:#ede2ff;border:2px dashed #6939c7;border-radius:7px}
.division-work{margin:8px auto;width:fit-content;text-align:left;padding-left:1.5rem}
.division-work li{padding:.2rem 0}
.bring-down{color:#452390}
.division-pieces,.division-groups{display:flex;justify-content:center;gap:4px;flex-wrap:wrap;max-width:460px;margin:8px auto}
.division-piece{width:13px;height:13px;border-radius:50%;background:#6332c5}
.fraction-strip{display:flex;max-width:480px;margin:12px auto;border:2px solid #5c30af;border-radius:8px;overflow:hidden}
.fraction-segment{flex:1 1 0;min-width:0;min-height:48px;border:0;border-right:1px solid #5c30af;background:#f4ebff;padding:0}
.fraction-segment:last-child{border-right:0}
.fraction-shaded{background:#7041ce}
.fraction-line-note{margin:10px 0;color:var(--dark)}
.fraction-number-line{position:relative;margin:20px max(17px,calc((100% - 500px)/2)) 35px;height:58px}
.fraction-intervals{display:flex;position:absolute;top:25px;left:0;right:0;border-top:3px solid #452390}
.fraction-interval{flex:1;min-width:0;height:22px;position:relative;color:#075d53;font-size:.83rem;font-weight:850}
.fraction-interval.counted-interval{border-top:5px solid #0b806e;margin-top:-4px;padding-top:3px}
.fraction-point{position:absolute;top:6px;transform:translateX(-50%);width:clamp(22px,5vw,38px);height:42px;padding:0;border:0;background:transparent;color:var(--dark);font-weight:900}
.fraction-point::before{content:"";position:absolute;left:50%;top:12px;transform:translateX(-50%);height:17px;width:3px;border-radius:2px;background:#452390}
.fraction-point[aria-pressed=true]::before{width:13px;height:13px;top:14px;border-radius:50%;background:#0b806e;box-shadow:0 0 0 2px white}
.fraction-point:disabled{opacity:1}
.fraction-tick-label{position:absolute;top:34px;left:50%;transform:translateX(-50%);white-space:nowrap}

.number-pad{display:flex;justify-content:center;gap:5px;flex-wrap:wrap;flex-basis:100%}
.number-pad .number-pad-key{padding:5px;min-width:44px;min-height:44px;font-weight:900;font-size:1.2rem}
.written-division{align-items:start;column-gap:.48em}
.written-division .division-divisor{margin-top:1.42em;padding:0}
.written-division .division-line{padding:0}
.written-division .division-cell{width:1.48em;min-height:1.42em;position:relative;justify-self:stretch}
.written-division .dividend-line{border:0;position:relative}
.written-division .dividend-line::before{content:"";position:absolute;inset:0 0 0 -.13em;border-top:3px solid currentColor;border-left:3px solid currentColor;border-top-left-radius:.3em;pointer-events:none}
.division-work-row{display:grid;justify-content:end;min-height:1.42em}
.work-width-2{grid-template-columns:repeat(2,1.48em)}
.work-width-3{grid-template-columns:repeat(3,1.48em)}
.written-division .division-work-row .division-cell{width:auto;justify-items:end;padding-right:.27em}
.written-division .division-product{border-bottom:2px solid currentColor}
.division-product::before{content:"−";position:absolute;left:-.65em;color:var(--dark)}
.written-division #visual-answer{width:100%;min-height:1.25em;height:100%;padding:0;border:0;background:transparent;color:var(--dark);font:inherit;text-align:center}
.written-division .active-division{padding:0!important;outline:none}
.bring-source{background:#fff0bd;color:#4f3000}
.bring-target::before{content:"↓";position:absolute;right:-.65em;color:#067c68;pointer-events:none}

.method-setting{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px 8px}
.method-setting select{grid-column:1/-1;width:100%}
.method-help{width:2.25rem;height:2.25rem;border:2px solid #6728c1;border-radius:50%;background:#f4eaff;color:#542098;font-weight:900;font-size:1.15rem;cursor:pointer}
.method-video-dialog{width:min(94vw,720px);max-height:90vh;border:0;border-radius:18px;padding:16px;color:#281949}
.method-video-dialog::backdrop{background:#241239ba}
.method-video-header{display:flex;gap:12px;align-items:center;justify-content:space-between}
.method-video-header h2{margin:0}
.method-video-dialog video{display:block;width:100%;margin:12px 0;background:#21123d;border-radius:8px}
.strategy-board{display:grid;gap:9px;margin:12px 0}
.strategy-choices{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.strategy-tile{touch-action:none;user-select:none;min-width:64px}
.strategy-tile[aria-pressed=true]{outline:3px solid #6b28cb}
.strategy-target{min-height:46px;padding:6px 10px;border:2px dashed #7846c2;border-radius:10px;background:#f7efff;color:#31185e;font:inherit;font-weight:750;overflow-wrap:anywhere}
.strategy-target:disabled{opacity:1;border-style:solid;background:#eee6ff}
.strategy-ghost{position:fixed;z-index:1000;transform:translate(-50%,-50%);pointer-events:none;opacity:.9}
.strategy-ten-frame{width:min(100%,330px);justify-self:center}
.strategy-frame{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;width:min(100%,260px);margin:7px auto 2px}
.strategy-frame-cell{aspect-ratio:1;border:1px solid #b191dc;border-radius:5px;display:grid;place-items:center;background:white}
.strategy-frame-cell.next{outline:2px solid #7846c2;outline-offset:-2px;background:#f4eaff}
.strategy-dot{display:block;width:22px;height:22px;border-radius:50%;background:#6b2aca}
.strategy-dot.moved{background:#087b60}
.strategy-dot-pile{display:grid;grid-template-columns:repeat(5,44px);justify-content:center;gap:3px;width:100%}
.strategy-dot-button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:8px;background:transparent;touch-action:none;user-select:none;cursor:grab}
.strategy-dot-button[aria-pressed=true]{background:#e1f6ec;outline:2px solid #087b60;outline-offset:-2px}
.strategy-dot-button:disabled{opacity:1;cursor:default}
.strategy-ten-sum{margin:0;text-align:center;font-size:1.5rem;font-weight:850}
.strategy-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:8px}
.strategy-group-count{display:block;color:#5b2bb1;letter-spacing:2px}
.strategy-pile{text-align:center;margin:2px 0}
.strategy-line{display:grid;padding:0 12px 22px;margin-bottom:7px}
.strategy-segment{position:relative;min-width:0;border-bottom:3px solid #5934ac}
.strategy-segment .strategy-target{width:100%;padding:4px;font-size:.82rem}
.strategy-tick{position:absolute;top:100%;left:0;transform:translateX(-50%);font-weight:800}
.strategy-tick.end{left:100%}
.strategy-strip{display:grid;height:31px;width:100%;min-width:85px;background:white;border:1px solid #7047b0;border-radius:5px;overflow:hidden}
.strategy-strip span+span{border-left:1px solid #7047b0}
.strategy-strip .filled{background:#a470ec}
.strategy-target:has(.strategy-strip){padding-inline:0}
.strategy-target:has(.strategy-strip) .strategy-strip,.strategy-tile .strategy-strip{margin-top:5px}

#table-study-card {
  min-height: 8rem;
  display: grid;
  align-items: center;
}
#table-study-equation {
  margin: 0;
  font-size: clamp(2rem, 9vw, 5.25rem);
}
#table-study-prompt {
  text-align: center;
  font-weight: 700;
}
#table-study-recall[aria-pressed=true] {
  color: white;
  background: #5224bb;
}

.strategy-place-grid{display:grid;grid-template-columns:auto repeat(var(--places),minmax(0,1fr));gap:5px;align-items:center;width:min(100%,480px);margin-inline:auto}
.strategy-place-heading{padding:7px 2px;background:#efe5ff;border-radius:8px;font-size:clamp(.75rem,3.4vw,1rem)}
.strategy-addend{padding-inline:3px;text-align:right;font-size:clamp(.85rem,3.5vw,1.1rem)}
.strategy-place-cell{min-width:0;padding-inline:2px;font-size:clamp(.82rem,3.5vw,1.2rem)}
.strategy-place-cell:enabled{background:#fff2af;border-color:#725000}
.strategy-part{font-size:1.2rem}

.multiply-area-grid{display:grid;gap:3px;width:min(100%,430px);margin:8px auto 0}
.multiply-area-corner,.multiply-area-label{display:grid;place-items:center;padding:3px 5px;font-weight:900}
.multiply-area-cell{display:grid;place-items:center;min-height:56px;padding:6px 2px;border:2px solid #8e66c5;background:#eee4ff;text-align:center}
.multiply-area-cell:nth-child(even){background:#e1efff}
.multiply-area-cell.current{border-color:#725000;outline:2px solid #725000;outline-offset:-4px;background-color:#fff2af}
.multiply-area-product{padding:3px 5px;border-radius:5px;background:#fff;color:#31185e;font-weight:850;font-size:clamp(.82rem,3.6vw,1.15rem)}
.multiply-area-cell.unit-squares{aspect-ratio:var(--columns)/var(--rows);width:100%;min-height:0;background-image:linear-gradient(to right,#8e66c56b 1px,transparent 1px),linear-gradient(to bottom,#8e66c56b 1px,transparent 1px);background-size:calc(100% / var(--columns)) calc(100% / var(--rows))}
.multiply-area-sum{text-align:center;margin:8px 0 0;font-weight:850}
