/* ============================================================
   GAIBE Learning — Interactive diagram engine
   One visual language for every lesson's manipulative. Two modes:
   .dgm.explore  — hands-on (drag / click) to work it out (shown on a wrong answer)
   .dgm.confirm  — a simple, correct picture to justify the thinking (on a right answer)
   Tokens come from demo.css.
   ============================================================ */

.dgm {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-soft); padding: 15px 16px 14px; width: 100%;
}
.dgm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dgm-title { font-family: var(--font-display); font-weight: 600; font-size: 1.0rem; display: flex; align-items: center; gap: 8px; }
.dgm-hint { text-align: center; font-size: 0.82rem; color: var(--ink-faint); margin-top: 10px; }
.dgm-readout { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
.dgm-readout b { color: var(--blue); font-size: 0.9rem; }
.dgm.confirm { background: rgba(34,160,107,.05); border-color: rgba(34,160,107,.3); }
.dgm.solved { border-color: rgba(34,160,107,.5); }
.dgm-done { text-align: center; color: var(--green); font-weight: 700; font-size: 0.9rem; margin-top: 10px; opacity: 0; transition: opacity .3s ease; }
.dgm-done.show { opacity: 1; }
.dgm-reset { font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.dgm-reset:hover { border-color: var(--ink-soft); }

/* stacked fraction: numerator over a horizontal bar over denominator */
.frac { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: middle; line-height: 1; margin: 0 2px; font-family: var(--font-display); font-weight: 600; }
.frac .fn { padding: 0 3px 1px; border-bottom: 1.6px solid currentColor; }
.frac .fd { padding: 1px 3px 0; }
/* endpoint "(1)" note under a 4/4-style whole on a 0–1 number line */
.nl-whole { display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); line-height: 1.1; margin-top: 1px; }

/* generic draggable token */
.tok { user-select: none; touch-action: none; cursor: grab; }
.tok:active { cursor: grabbing; }
.tok.dragging { z-index: 2000; }
.pop { animation: dgm-pop .38s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes dgm-pop { 0% { transform: scale(.3); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ---------- fraction bar ---------- */
.fbar-wrap { display: flex; flex-direction: column; gap: 12px; }
.fbar-row { display: flex; flex-direction: column; gap: 5px; }
.fbar-lbl { font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-soft); display: flex; justify-content: space-between; }
.fbar-lbl b { color: var(--blue); font-family: var(--font-display); font-size: 0.95rem; }
.fbar { display: flex; height: 56px; border: 2px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--paper); }
.fpart { flex: 1; border-right: 2px solid var(--line-strong); cursor: pointer; transition: background .2s ease, transform .1s ease; position: relative; }
.fpart:last-child { border-right: none; }
.fpart:hover { background: rgba(45,91,255,.08); }
.fpart.on { background: var(--grad); }
.fbar.locked .fpart { cursor: default; }
.fbar.locked .fpart:hover { background: none; }
.fbar.locked .fpart.on { background: var(--grad); }
.fbar.alt .fpart.on { background: linear-gradient(94deg, #37B27E, #1A7A50); }

/* ---------- stepShare: area model — partition a set, then simplify ---------- */
.am-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.am-narr { font-family: var(--font-display); font-size: 1.02rem; color: var(--ink); line-height: 1.4; text-align: center; min-height: 1.4em; }
.am-narr b { color: var(--blue); }
.am-narr em { font-style: normal; font-weight: 700; color: var(--violet-ink); }
.am-stack { width: 100%; max-width: 420px; }
.am-caption { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; text-align: center; }
.am-bar { display: flex; border: 2px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--paper); }
.am-cell { flex: 1; height: 46px; display: grid; place-items: center; border-right: 1px solid var(--line); font-size: 16px; transition: background .25s ease, box-shadow .2s ease, opacity .25s ease; position: relative; }
.am-cell:last-child { border-right: none; }
.am-cell.tap { cursor: pointer; }
.am-cell.tap:hover { background: rgba(45,91,255,.08); }
.am-cell.filled { background: linear-gradient(160deg, #EBC873, #DDAE55); }
.am-cell.div { border-right: 3px solid var(--ink); }
.am-cell.dim { opacity: .3; }
.am-cell.pick { box-shadow: inset 0 0 0 3px var(--blue); z-index: 1; }
.am-cousins { display: flex; margin-top: 3px; }
.am-cousins .amc { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 0.52rem; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.am-bar.quarters .am-cell { height: 34px; }
.am-eq { display: inline-flex; align-items: center; gap: 14px; font-family: var(--font-display); }
.am-eq .eqarrow { color: var(--blue); font-size: 1.5rem; font-weight: 700; }
.am-note { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.45; max-width: 34em; text-align: center; }
.am-note b { color: var(--ink); }
.am-actions { text-align: center; margin-top: 4px; }
.am-actions .stepdots { display: inline-flex; gap: 5px; margin-left: 10px; vertical-align: middle; }
.am-actions .stepdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.am-actions .stepdots i.on { background: var(--blue); }

/* ---------- grid / array / area ---------- */
.grid-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: 100%; }
.grid-ctrls { display: flex; gap: 16px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper .sl { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 1.1rem; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.stepper button:hover { border-color: var(--blue); color: var(--blue); }
.stepper .val { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; min-width: 22px; text-align: center; }
.arr { display: grid; gap: 4px; padding: 8px; background: var(--paper-deep); border-radius: 12px; border: 1px solid var(--line); max-width: 100%; overflow: auto; }
.arr .cell { width: var(--cs, 26px); height: var(--cs, 26px); border-radius: 50%; background: var(--grad); box-shadow: 0 2px 5px -2px rgba(45,91,255,.5); }
.arr.square .cell { border-radius: 5px; background: rgba(45,91,255,.18); border: 1px solid rgba(45,91,255,.5); }
.arr .cell.pop { animation: dgm-pop .3s cubic-bezier(0.34,1.56,0.64,1); }

/* area model (2-digit × 2-digit partial products) */
.am2-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.am2-svg { width: 100%; max-width: 280px; height: auto; }
.am2-a { fill: rgba(45,91,255,.22); }
.am2-b { fill: rgba(45,91,255,.13); }
.am2-c { fill: rgba(45,91,255,.07); }
.am2-border { fill: none; stroke: var(--blue); stroke-width: 2; }
.am2-split { stroke: var(--blue); stroke-width: 1.4; stroke-dasharray: 4 3; }
.am2-lbl { fill: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 12px; }
.am2-pp { fill: var(--blue); font-family: var(--font-mono); font-weight: 600; font-size: 11px; }

/* ---------- groups (drag counters into containers) ---------- */
.groups-wrap { display: flex; flex-direction: column; gap: 12px; }
.gboxes { display: grid; gap: 10px; }
.gbox { min-height: 74px; border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--paper); padding: 20px 6px 6px; position: relative; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; justify-content: center; transition: border-color .2s, background .2s; }
.gbox.armed { border-color: var(--blue); border-style: solid; background: rgba(45,91,255,.05); }
.gbox.full { border-color: var(--green); background: rgba(34,160,107,.06); }
.gbox .glabel { position: absolute; top: 5px; left: 9px; font-family: var(--font-mono); font-size: 0.54rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.gtray { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 10px; border-radius: 12px; background: var(--paper-deep); border: 1px solid var(--line); min-height: 46px; }
.gtray-empty { color: var(--ink-faint); font-size: 0.8rem; align-self: center; }
.counter { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: transparent; border: none; padding: 0; line-height: 1; }
.counter:hover { transform: scale(1.15) rotate(-6deg); }
.counter.placed:hover { transform: none; }

/* ---------- number line ---------- */
.nl-wrap { padding: 8px 6px 16px; }
.nl { position: relative; height: 84px; margin: 0 10px; }
.nl-axis { position: absolute; left: 0; right: 0; top: 46px; height: 3px; background: var(--line-strong); border-radius: 2px; }
.nl-tick { position: absolute; top: 40px; width: 2px; height: 15px; background: var(--line-strong); transform: translateX(-1px); }
.nl-tick.major { height: 22px; top: 36px; background: var(--ink-soft); }
.nl-tlabel { position: absolute; top: 62px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.6rem; color: var(--ink-soft); white-space: nowrap; }
.nl-mid { position: absolute; top: 30px; height: 34px; width: 2px; background: repeating-linear-gradient(var(--amber) 0 4px, transparent 4px 8px); transform: translateX(-1px); }
.nl-midlbl { position: absolute; top: 6px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.56rem; color: var(--amber-ink); }
.nl-marker { position: absolute; top: 30px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: var(--grad); border: 3px solid var(--card); box-shadow: 0 4px 10px -3px rgba(45,91,255,.6); cursor: grab; touch-action: none; z-index: 3; transition: box-shadow .2s; }
.nl-marker:active { cursor: grabbing; }
.nl-marker.locked { cursor: default; }
.nl-marker .mlbl { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; color: var(--blue); white-space: nowrap; }
.nl-jump { position: absolute; top: 46px; height: 22px; border-top: 2px solid var(--violet); border-radius: 40px 40px 0 0 / 22px; border-left: 0; border-right: 0; }
.nl-jump::after { content: attr(data-l); position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.56rem; color: var(--violet-ink); }

/* ---------- place value ---------- */
.pv-wrap { display: flex; flex-direction: column; gap: 10px; }
.pv-cols { display: flex; gap: 6px; }
.pv-col { flex: 1; display: flex; flex-direction: column; }
.pv-colh { font-family: var(--font-mono); font-size: 0.5rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-faint); text-align: center; margin-bottom: 4px; min-height: 22px; }
.pv-drop { min-height: 90px; border: 2px dashed var(--line-strong); border-radius: 10px; background: var(--paper); padding: 6px; display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; justify-content: center; transition: border-color .2s, background .2s; }
.pv-drop.armed { border-color: var(--blue); background: rgba(45,91,255,.05); }
.pv-disk { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.44rem; font-weight: 600; color: #fff; border: none; padding: 0; }
.pv-disk.d10000 { background: #6A45E0; } .pv-disk.d1000 { background: #2D5BFF; } .pv-disk.d100 { background: #1A7A50; } .pv-disk.d10 { background: #B26A00; } .pv-disk.d1 { background: #E5484D; }
.pv-count { text-align: center; font-family: var(--font-mono); font-size: 0.58rem; color: var(--ink-soft); margin-top: 3px; }
.pv-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 10px; border-radius: 12px; background: var(--paper-deep); border: 1px solid var(--line); }
.pv-bank .pv-disk { width: 30px; height: 30px; font-size: 0.54rem; cursor: grab; touch-action: none; }
.pv-expanded { text-align: center; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.pv-expanded .num { font-style: italic; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 600; }

/* place-value compare */
.pv-cmp { display: flex; flex-direction: column; gap: 10px; }
.pv-cmp-row { display: flex; align-items: center; gap: 12px; }
.pv-cmp-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: .04em; }
.pv-cmp-num .hi { background: var(--amber-soft); border-radius: 5px; padding: 0 3px; color: var(--amber-ink); }
.pv-cmp-btns { display: flex; gap: 8px; justify-content: center; }
.pv-cmp-btns button { width: 46px; height: 44px; font-family: var(--font-display); font-size: 1.4rem; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; color: var(--ink); }
.pv-cmp-btns button:hover { border-color: var(--blue); }
.pv-cmp-btns button.right { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.pv-cmp-btns button.wrong { border-color: var(--red); background: rgba(229,72,77,.08); color: var(--red); }

/* ---------- bar graph ---------- */
.bg-wrap { display: flex; flex-direction: column; gap: 8px; }
.bg-plot { display: flex; align-items: flex-end; gap: 14px; height: 150px; padding: 6px 6px 0; border-left: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); position: relative; }
.bg-gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.bg-gl span { position: absolute; left: -22px; top: -8px; font-family: var(--font-mono); font-size: 0.54rem; color: var(--ink-faint); }
.bg-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; z-index: 1; }
.bg-bar { width: 100%; max-width: 46px; border-radius: 6px 6px 0 0; background: var(--grad); cursor: pointer; transition: filter .15s; position: relative; }
.bg-bar:hover { filter: brightness(1.08); }
.bg-bar .bv { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; color: var(--blue); opacity: 0; transition: opacity .2s; }
.bg-bar.reveal .bv { opacity: 1; }
.bg-cat { font-size: 0.72rem; color: var(--ink-soft); text-align: center; margin-top: 2px; }

/* ---------- shape sort / categorize ---------- */
.sort-wrap { display: flex; flex-direction: column; gap: 12px; }
.sort-tray { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 10px; border-radius: 12px; background: var(--paper-deep); border: 1px solid var(--line); min-height: 50px; }
.sort-bins { display: grid; gap: 10px; }
.sort-bin { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 26px 8px 8px; position: relative; min-height: 66px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; justify-content: center; transition: border-color .2s, background .2s; }
.sort-bin.armed { border-color: var(--blue); background: rgba(45,91,255,.05); }
.sort-bin .binlbl { position: absolute; top: 5px; left: 10px; font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 600; }
.card-tok { font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; box-shadow: var(--shadow-soft); cursor: grab; touch-action: none; }
.card-tok.shape { font-size: 1.5rem; padding: 6px 10px; }
.card-tok.wrong { border-color: var(--red); animation: shake .3s; }
.card-tok.right { border-color: var(--green); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

/* ---------- perimeter ---------- */
.peri-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.peri-svg { max-width: 260px; width: 100%; }
.peri-side { stroke: var(--line-strong); stroke-width: 4; cursor: pointer; transition: stroke .2s; }
.peri-side:hover { stroke: var(--blue); }
.peri-side.counted { stroke: var(--green); }
.peri-side.missing { stroke-dasharray: 6 5; stroke: var(--amber); }
.peri-lbl { font-family: var(--font-mono); font-size: 11px; fill: var(--ink); }
.peri-sum { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
.peri-sum b { color: var(--blue); font-family: var(--font-display); font-size: 1rem; }

/* ---------- money ---------- */
.money-wrap { display: flex; flex-direction: column; gap: 10px; }
.coin { border: none; border-radius: 999px; cursor: grab; touch-action: none; font-family: var(--font-mono); font-weight: 700; color: #3a2f00; display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.coin.penny { width: 30px; height: 30px; background: #d98c5f; font-size: 0.5rem; }
.coin.nickel { width: 36px; height: 36px; background: #cfc9be; font-size: 0.5rem; }
.coin.dime { width: 27px; height: 27px; background: #cfc9be; font-size: 0.46rem; }
.coin.quarter { width: 40px; height: 40px; background: #cfc9be; font-size: 0.5rem; }
.bill { width: 58px; height: 30px; border-radius: 5px; background: #4c8c6a; color: #eafff2; border: 1px solid #2f6a4c; cursor: grab; touch-action: none; font-family: var(--font-mono); font-weight: 700; font-size: 0.6rem; display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.money-tray { min-height: 62px; border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--paper); padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; transition: border-color .2s, background .2s; }
.money-tray.armed { border-color: var(--blue); background: rgba(45,91,255,.05); }
.money-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 10px; border-radius: 12px; background: var(--paper-deep); border: 1px solid var(--line); align-items: center; }

/* ---------- table (number pairs) ---------- */
.ptable { border-collapse: collapse; margin: 0 auto; }
.ptable th, .ptable td { border: 1px solid var(--line-strong); padding: 8px 16px; text-align: center; font-family: var(--font-mono); font-size: 0.85rem; }
.ptable th { background: var(--paper-deep); font-size: 0.62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.ptable td.fill { background: rgba(45,91,255,.05); padding: 0; }
.ptable td.fill input { width: 64px; border: none; background: transparent; text-align: center; font-family: var(--font-mono); font-size: 0.9rem; padding: 8px 4px; color: var(--blue); font-weight: 600; }
.ptable td.fill input:focus { outline: none; background: rgba(45,91,255,.1); }
.ptable td.ok { background: var(--green-soft); color: var(--green); }

@media (prefers-reduced-motion: reduce) { .pop, .arr .cell.pop, .card-tok.wrong { animation: none !important; } }

/* ---------- stimulus mode: a read-only "given" figure shown up front ---------- */
.dgm.stimulus { background: rgba(45,91,255,.045); border-color: rgba(45,91,255,.28); }
.dgm.stimulus .dgm-title { color: var(--blue); }

/* ---------- dot plot (read-only) ---------- */
.dp-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dp-svg { width: 100%; max-width: 360px; height: auto; }
.dp-axis { stroke: var(--line-strong); stroke-width: 2; }
.dp-tick { stroke: var(--line-strong); stroke-width: 1.5; }
.dp-lbl { fill: var(--ink-soft); font-family: var(--font-mono); font-size: 11px; }
.dp-dot { fill: var(--blue); stroke: var(--card); stroke-width: 1.5; }
.dp-unit { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------- scatterplot (read-only) ---------- */
.sc-svg { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; }
.sc-grid { stroke: var(--line); stroke-width: 1; }
.sc-axis { stroke: var(--line-strong); stroke-width: 2; }
.sc-lbl { fill: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; }
.sc-axlbl { fill: var(--ink-soft); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; }
.sc-pt { fill: var(--violet-ink); stroke: var(--card); stroke-width: 1.5; }

/* ---------- coordinate plane (read-only) ---------- */
.cp-svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.cp-grid { stroke: var(--line); stroke-width: 1; }
.cp-axis { stroke: var(--line-strong); stroke-width: 2.5; }
.cp-lbl { fill: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; }
.cp-path { stroke: var(--violet-ink); stroke-width: 2.5; stroke-dasharray: 5 4; stroke-linecap: round; opacity: .8; }
.cp-pt { fill: var(--blue); stroke: var(--card); stroke-width: 2; }
.cp-ptlbl { fill: var(--blue); font-family: var(--font-display); font-weight: 600; font-size: 12px; }

/* ---------- prism (volume, read-only) ---------- */
.pr-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pr-svg { width: 100%; max-width: 300px; height: auto; }
.pr-cf { stroke: var(--blue); stroke-width: 1; stroke-linejoin: round; }
.pr-cf-front { fill: rgba(45,91,255,.15); }
.pr-cf-side { fill: rgba(45,91,255,.24); }
.pr-cf-top { fill: rgba(45,91,255,.07); }
.pr-cf-bot { fill: rgba(45,91,255,.05); }
/* faces pop in, layer by layer, so the box assembles (first render only) */
.pr-cf.pr-anim { animation: pr-build .4s cubic-bezier(0.22,1,0.36,1) backwards; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes pr-build { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pr-cf.pr-anim { animation: none; } }
.pr-holder { display: flex; justify-content: center; touch-action: none; }
.pr-rot { cursor: grab; }
.pr-rot:active { cursor: grabbing; }
.pr-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.pr-btn { font-family: var(--font-body); font-weight: 600; font-size: 0.74rem; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; box-shadow: var(--shadow-soft); transition: border-color .18s ease, color .18s ease; }
.pr-btn:hover { border-color: var(--blue); color: var(--blue); }
.pr-drag { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: .05em; color: var(--ink-faint); }
.pr-layerlbl { fill: var(--violet-ink); font-family: var(--font-mono); font-weight: 600; font-size: 9px; }
.pr-lbl { fill: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 9.5px; }

/* ---------- shape (2D figures / solids / lines, read-only) ---------- */
.sh-wrap { display: flex; justify-content: center; }
.sh-svg { width: 100%; max-width: 190px; height: auto; }
.sh-poly { fill: rgba(45,91,255,.10); stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; }
.sh-line { stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; }
.sh-rt { fill: none; stroke: var(--violet-ink); stroke-width: 1.5; }
.sh-rt-mark { fill: none; stroke: var(--violet-ink); stroke-width: 1.5; }
.sh-lbl { fill: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 8px; }
.sh-ang { fill: var(--violet-ink); font-family: var(--font-mono); font-weight: 600; font-size: 8px; }
.sh-tick { fill: var(--violet-ink); }
.sh-sym { stroke: var(--violet-ink); stroke-width: 1.4; stroke-dasharray: 4 3; }
.sh-solid { fill: rgba(45,91,255,.08); stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; }
.sh-face { fill: rgba(45,91,255,.16); }
.sh-face2 { fill: rgba(45,91,255,.06); }
.sh-face3 { fill: rgba(45,91,255,.22); }
.sh-dashed { fill: none; stroke-dasharray: 4 3; }

/* ---------- angle (read-only, optional protractor) ---------- */
.ang-wrap { display: flex; justify-content: center; }
.ang-svg { width: 100%; max-width: 240px; height: auto; }
.ang-prot { fill: rgba(45,91,255,.05); stroke: var(--line-strong); stroke-width: 1.2; }
.ang-ptick { stroke: var(--line-strong); stroke-width: 1; }
.ang-pnum { fill: var(--ink-faint); font-family: var(--font-mono); font-size: 8px; }
.ang-ray { stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; }
.ang-arc { fill: none; stroke: var(--violet-ink); stroke-width: 2; }
.ang-lbl { fill: var(--violet-ink); font-family: var(--font-display); font-weight: 700; font-size: 12px; }
.ang-vertex { fill: var(--blue); }

/* interactive plotting (scatter + coordinate plane) */
.sc-tap, .cp-tap { cursor: crosshair; touch-action: manipulation; }
.sc-guess, .cp-guess { fill: #F59E2D; stroke: var(--card); stroke-width: 2; }
.sc-guess.ok, .cp-guess.ok { fill: var(--green); }
