#screen-math-test { padding-bottom: 40px; }
.mt-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; margin: 4px 0 8px; }
.mt-count { font-size:calc(13px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); }
.mt-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 16px; }
.mt-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .25s ease; }
.mt-prompt { margin: 0 0 12px; font-size:calc(14px * var(--fs, 1)); line-height: 1.45; color: var(--text-muted); }
.mt-eq { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 10px; margin-bottom: 14px; text-align: center; overflow-x: auto; color: var(--text); }
.mt-eq .katex-display { margin: 0; }
.mt-eq .katex { font-size: 1.45em; }
.mt-opts { display: flex; flex-direction: column; gap: 10px; }
.mt-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 14px; padding: 12px 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mt-opt:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.mt-opt:disabled { cursor: default; opacity: 1; }
.mt-num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size:calc(14px * var(--fs, 1)); font-weight: 700; background: var(--surface-2); color: var(--text); }
.mt-optf { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size:calc(14px * var(--fs, 1)); }
.mt-optf .katex { font-size: 1.12em; }
.mt-or { font-size:calc(14px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); }
.mt-opt.right { border-color: var(--primary); background: rgba(61, 220, 151, 0.14); }
.mt-opt.right .mt-num { background: var(--primary); color: #0b3d27; }
.mt-opt.wrong { border-color: var(--coral); background: rgba(255, 92, 92, 0.12); }
.mt-opt.wrong .mt-num { background: var(--coral); color: #fff; }
.mt-fb { min-height: 24px; margin: 14px 0 6px; font-size:calc(15px * var(--fs, 1)); font-weight: 700; }
.mt-fb.ok { color: var(--primary-ink); }
.mt-fb.bad { color: var(--coral-ink); }
.mt-next { width: 100%; margin-top: 6px; }
.mt-result { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 14px; margin: 6px 0 18px; }
.mt-score { margin: 0 0 6px; font-size:calc(34px * var(--fs, 1)); font-weight: 700; color: var(--primary-ink); }
.mt-h2 { margin: 6px 4px 10px; font-size:calc(16px * var(--fs, 1)); font-weight: 700; text-transform: none; letter-spacing: 0; }
.mt-miss { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; overflow-x: auto; }
.mt-miss-eq { font-size: 1.1em; margin-bottom: 6px; }
.mt-miss-ans { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size:calc(13px * var(--fs, 1)); }
.mt-miss-l { font-weight: 700; color: var(--primary-ink); }
.mt-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.mt-actions .primary-btn, .mt-actions .secondary-btn { width: 100%; }
.bio-row-tags i.mt-best { background: transparent; color: var(--text-muted); padding-left: 0; }
#math-note { margin: 12px 4px 0; }
.trc-scene { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 4px; margin: 4px -4px 10px; }
.trc-svg { display: block; width: 100%; height: auto; font-family: 'Montserrat', sans-serif; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.trc-svg text { fill: var(--text); font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.trc-svg .trc-bar { stroke: var(--text); stroke-width: 1.1; }
.trc-circle { fill: none; stroke: var(--text); stroke-width: 2; }
.trc-axis { stroke: var(--text); stroke-width: 1.5; }
.trc-arrowhead { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.trc-svg .trc-axname { font-size: 12px; font-weight: 700; }
.trc-grid { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.trc-dot { fill: var(--text); }
.trc-el, .trc-frame { transition: opacity .25s ease; }
.trc-svg.trc-focus .trc-el { opacity: .14; }
.trc-svg.trc-focus .trc-frame { opacity: .38; }
.trc-svg.trc-focus .trc-el.trc-on { opacity: 1; }
.trc-svg .trc-on text { fill: var(--primary-ink); font-weight: 700; }
.trc-svg .trc-on .trc-bar { stroke: var(--primary-ink); }
.trc-dot.trc-on { fill: var(--primary-ink); }
.trc-hl-line { stroke: var(--primary-ink); stroke-width: 2.5; stroke-linecap: round; }
.trc-hl-miss { stroke-dasharray: 6 5; }
.trc-hl-proj { stroke: var(--primary-ink); stroke-width: 2; stroke-dasharray: 4 3; }
.trc-hl-arc { fill: none; stroke: var(--primary-ink); stroke-width: 4; stroke-linecap: round; opacity: .55; }
.trc-hl-dot { fill: var(--primary-ink); stroke: var(--surface); stroke-width: 2; }
.trc-svg .trc-hl-txt { fill: var(--primary-ink); font-size: 11px; font-weight: 700; }
.trc-svg .trc-hl-small { font-size: 11px; }
.trc-bar-row { display: flex; justify-content: flex-end; margin: -2px 0 8px; }
.trc-reset { min-height: 44px; padding: 8px 14px; font-size:calc(13px * var(--fs, 1)); }
.trc-out { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 14px; margin-bottom: 14px; min-height: 64px; overflow-x: auto; }
.trc-out .katex-display { margin: 4px 0; }
.trc-out .katex { font-size: 1.12em; }
.trc-tex { color: var(--text); }
.trc-tex-l { display: inline-block; margin-right: 8px; font-size:calc(13px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); }
.trc-note { margin: 6px 0 2px; font-size:calc(14px * var(--fs, 1)); line-height: 1.45; color: var(--text); }
.trc-note.hint { color: var(--text-muted); font-size:calc(13px * var(--fs, 1)); }
.trc-ask { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; }
.trc-ask-l { display: block; font-size:calc(13px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); margin: 0 2px 8px; }
.trc-ask-row { display: flex; gap: 8px; }
#trc-input { flex: 1 1 auto; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--border); background: var(--bg); color: var(--text); font: 600 15px 'JetBrains Mono', 'Montserrat', monospace; }
#trc-input:focus { outline: none; border-color: var(--primary); }
.trc-go { flex: 0 0 auto; width: auto; min-height: 44px; padding: 8px 14px; font-size:calc(15px * var(--fs, 1)); }
.trc-keys { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.trc-keys button { min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 15px 'Montserrat', sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.trc-keys button:active { transform: translateY(1px); }
.trc-err { min-height: 0; margin: 8px 2px 0; font-size:calc(13px * var(--fs, 1)); line-height: 1.4; color: var(--coral-ink); }
.trc-err:empty { display: none; }
.trc-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.trc-examples .hint { margin: 0 4px 0 2px; font-size:calc(13px * var(--fs, 1)); }
.trc-examples button { min-height: 36px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 13px 'Montserrat', sans-serif; cursor: pointer; position: relative; }
.trc-examples button::after { content: ''; position: absolute; inset: -4px 0; }
.trc-kb-space { height: 0; }
.trc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .trc-el, .trc-frame { transition: none; } }
.mp-prop-list { display: flex; flex-direction: column; gap: 10px; }
.mp-prop-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-bottom: 4px solid var(--surface-2); border-radius: 18px; padding: 12px 14px; min-height: 64px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mp-prop-card:active { transform: translateY(2px); border-bottom-width: 2px; }
.mp-prop-num { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size:calc(14px * var(--fs, 1)); background: var(--surface-2); color: var(--text); }
.mp-prop-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mp-prop-t { font-size:calc(15px * var(--fs, 1)); font-weight: 700; line-height: 1.25; }
.mp-prop-f { font-size:calc(14px * var(--fs, 1)); color: var(--text-muted); overflow-x: auto; overflow-y: hidden; }
.mp-prop-s { font-size:calc(13px * var(--fs, 1)); color: var(--text-muted); }
.mp-prop-arrow { flex: 0 0 auto; color: var(--text-muted); font-size:calc(18px * var(--fs, 1)); }
.mp-rule { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--subject-dark, #A65F00); border-radius: 16px; padding: 10px 14px; margin: 4px 0 12px; overflow-x: auto; }
.mp-rule-f .katex-display { margin: 6px 0; }
.mp-rule-f .katex { font-size: 1.18em; }
.mp-rule-note { margin: 4px 0 2px; font-size:calc(13px * var(--fs, 1)); line-height: 1.4; color: var(--text-muted); }
.mp-ctl { position: sticky; top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); z-index: 3; display: flex; align-items: center; gap: 8px; padding: 8px 0; background: var(--bg); }
.mp-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 700 18px 'Montserrat', sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mp-btn.mp-play { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); border-color: transparent; color: #0d2b1e; font-size:calc(18px * var(--fs, 1)); }
.mp-count { display: block; margin: 0 2px 8px; font-size:calc(13px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); }
.mp-tape { display: flex; flex-direction: column; gap: 12px; }
.mp-chain { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 14px; overflow-x: auto; }
.mp-chain.mp-on { display: block; }
.mp-chain-t { font-size:calc(13px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); margin: 0 0 4px; }
.mp-line { display: none; }
.mp-line.mp-on { display: block; }
.mp-line-f .katex-display { margin: 4px 0; text-align: left; }
.mp-line-f .katex-display > .katex { text-align: left; }
.mp-line-f .katex { font-size: 1.12em; }
.mp-line-note { margin: -2px 0 6px; font-size:calc(13px * var(--fs, 1)); line-height: 1.4; color: var(--text-muted); }
.mp-hl { color: var(--primary-ink); background: rgba(61, 220, 151, 0.16); border-radius: 4px; padding: 0 1px; }
.mp-line:not(.mp-cur) .mp-hl, .mp-sol .mp-hl { color: inherit; background: none; }
.mp-in { animation: mp-in .45s ease both; }
@keyframes mp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mp-end { display: none; flex-direction: column; gap: 10px; margin-top: 14px; }
.mp-end.mp-on { display: flex; }
.mp-go { width: 100%; }
.mp-sec-chip { font-size:calc(12px * var(--fs, 1)); font-weight: 700; line-height: 1.3; color: var(--text-muted); background: var(--surface-2); border-radius: 12px; padding: 3px 10px; max-width: 100%; text-align: right; }
.mp-ans { display: flex; align-items: baseline; gap: 10px; min-height: 52px; box-sizing: border-box; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); margin-bottom: 10px; }
.mp-ans-l { font-size:calc(14px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); }
.mp-ans-v { font: 700 22px 'JetBrains Mono', 'Montserrat', monospace; color: var(--text); letter-spacing: .5px; }
.mp-ans-v.mp-ph { color: var(--text-muted); font-weight: 600; }
.mp-ans.mp-ok { border-color: var(--primary); }
.mp-ans.mp-bad { border-color: var(--coral); }
.mp-pad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mp-key { min-height: 48px; border-radius: 12px; border: 1px solid var(--border); border-bottom-width: 3px; background: var(--surface-2); color: var(--text); font: 700 20px 'JetBrains Mono', 'Montserrat', monospace; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mp-key:active { transform: translateY(2px); border-bottom-width: 1px; }
.mp-key-wide { grid-column: span 2; }
.mp-fb-ans .katex { font-size: 1.1em; }
.mp-sol { margin-top: 12px; }
.mp-sol .mp-chain-t { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .mp-in { animation: none; } }
.mp-pad[hidden] { display: none; }
.mp-fig { display: block; width: 100%; max-width: 300px; height: auto; margin: 2px auto 8px; font-family: 'Montserrat', sans-serif; }
.mp-fig-circ { fill: none; stroke: var(--text); stroke-width: 1.6; }
.mp-fig-axis { stroke: var(--text-muted); stroke-width: 1.2; }
.mp-fig-sector { fill: var(--primary-ink); opacity: .16; }
.mp-fig text { fill: var(--text); font-weight: 600; }
.mp-fig .mp-fig-ax { font-size:calc(10px * var(--fs, 1)); fill: var(--text-muted); }
.mp-fig .mp-fig-sg { font-size:calc(17px * var(--fs, 1)); font-weight: 700; fill: var(--text-muted); }
.mp-fig .mp-fig-sg.on { fill: var(--primary-ink); font-size:calc(21px * var(--fs, 1)); }
.mp-fig .mp-fig-name { font-size:calc(13px * var(--fs, 1)); font-weight: 700; }
.mp-fig .mp-fig-x { font-size:calc(12px * var(--fs, 1)); font-style: italic; fill: var(--primary-ink); }
.mp-fig .mp-fig-lab { font-size:calc(12px * var(--fs, 1)); font-weight: 700; fill: var(--primary-ink); }
.mp-fig-arc { fill: none; stroke: var(--primary-ink); stroke-width: 2.5; stroke-linecap: round; }
.mp-fig-ray { stroke: var(--primary-ink); stroke-width: 2.5; stroke-linecap: round; }
.mp-fig-pt { fill: var(--primary-ink); stroke: var(--surface); stroke-width: 2; }
.mp-fig-pt0 { fill: var(--text); }
.mp-say { margin: 2px 0 6px; }
.mp-say-t { font-size:calc(14px * var(--fs, 1)); line-height: 1.5; color: var(--text); padding: 6px 0 6px 10px; border-left: 3px solid var(--primary-ink); }
.mq-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mq-tiles.mq-c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mq-tile { min-height: 56px; padding: 6px 2px; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; overflow: hidden; }
.mq-tile .katex { font-size: 1.1em; }
.mq-tile:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.mq-tile:disabled { cursor: default; opacity: 1; }
.mq-wide { grid-column: 1 / -1; font-size:calc(15px * var(--fs, 1)); font-weight: 700; }
.mq-tile.right, .mq-slot.right { border-color: var(--primary); background: rgba(61, 220, 151, 0.14); }
.mq-tile.wrong, .mq-slot.wrong { border-color: var(--coral); background: rgba(255, 92, 92, 0.12); }
.mq-eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.mq-left .katex { font-size: 1.35em; }
.mq-slot { min-width: 56px; min-height: 52px; padding: 4px 10px; box-sizing: border-box; font: 700 20px 'Montserrat', sans-serif; color: var(--text-muted); background: var(--bg); border: 2px dashed var(--border); border-radius: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.mq-slot.mq-filled { color: var(--text); background: var(--surface-2); border-style: solid; }
.mq-slot .katex { font-size: 1.3em; }
.mq-slot:disabled { cursor: default; opacity: 1; }
.mq-hint { margin: -4px 4px 12px; font-size:calc(13px * var(--fs, 1)); line-height: 1.4; color: var(--text-muted); text-align: center; }
.mq-pieces { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mq-piece { min-width: 64px; min-height: 56px; padding: 4px 14px; box-sizing: border-box; font: 700 22px 'Montserrat', sans-serif; color: var(--text); background: var(--surface); border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; transition: opacity .15s ease; }
.mq-piece .katex { font-size: 1.3em; }
.mq-piece:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.mq-piece.mq-used { opacity: .4; border-style: dashed; }
.mq-piece:disabled { cursor: default; }
#screen-math-quiz { padding-bottom: 40px; }
#screen-math { --bio-g-dark: #A65F00; --bio-g-main: #FFE0A3; --bio-g-bg: #FFF1D6; }
#screen-math-graphs { padding-bottom: 40px; }
.mg-plot { display: block; width: 100%; max-width: 420px; height: auto; margin: 6px auto 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; font-family: 'Montserrat', sans-serif; touch-action: manipulation; }
.mg-plot text { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.mg-grid { stroke: var(--border); stroke-width: 1; }
.mg-axis, .mg-arrow { stroke: var(--text); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mg-plot .mg-tick { font-size:calc(8.5px * var(--fs, 1)); font-weight: 600; fill: var(--text-muted); }
.mg-plot .mg-axname { font-size:calc(11px * var(--fs, 1)); font-style: italic; font-weight: 700; fill: var(--text); }
.mg-tickline { stroke: var(--text-muted); stroke-width: 1.2; }
.mg-curve { fill: none; stroke: var(--primary-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mg-curve.task { stroke: var(--text); stroke-width: 2.4; }
.mg-ghost { fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-dasharray: 6 5; opacity: .85; }
.mg-asym { stroke: var(--primary-ink); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: .85; }
.mg-asym.mid { opacity: .5; }
.mg-seg { stroke: var(--primary-ink); stroke-width: 2; stroke-dasharray: 4 3; }
.mg-pt { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
.mg-mark { fill: var(--primary-ink); stroke: var(--surface); stroke-width: 2; }
.mg-plot .mg-marklab { font-size:calc(10px * var(--fs, 1)); font-weight: 700; fill: var(--primary-ink); }
.mg-formula { text-align: center; min-height: 52px; padding: 6px 4px 0; overflow-x: auto; overflow-y: hidden; }
.mg-formula .katex-display { margin: 4px 0; }
.mg-formula .katex { font-size: 1.3em; }
.mg-val { text-align: center; font: 700 18px 'JetBrains Mono', 'Montserrat', monospace; color: var(--text); min-height: 28px; margin: 4px 0; }
.mg-effect { margin: 4px 0 10px; padding: 10px 14px; min-height: 5.2em; box-sizing: border-box; font-size:calc(14px * var(--fs, 1)); line-height: 1.5; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary-ink); border-radius: 14px; }
.mg-ctl .mg-range { flex: 1 1 auto; }
.mg-range { min-width: 0; width: 100%; height: 44px; accent-color: var(--primary); }
.mg-slider { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.mg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.mg-chip { min-width: 56px; min-height: 48px; padding: 4px 14px; border-radius: 14px; border: 2px solid var(--border); border-bottom-width: 4px; background: var(--surface); color: var(--text); font: 700 18px 'JetBrains Mono', 'Montserrat', monospace; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mg-chip.mg-on { border-color: var(--primary); background: rgba(61, 220, 151, 0.14); }
.mg-scene.mg-on { border-color: var(--primary); }
.mg-scenes-t { margin: 10px 2px 6px; }
.mg-ask { font-size:calc(16px * var(--fs, 1)); font-weight: 700; margin: 4px 2px 8px; color: var(--text); }
.mg-reset { width: 100%; margin-top: 6px; }
.mg-note { margin: 8px 4px 0; font-size:calc(13px * var(--fs, 1)); }
.mg-slider .mp-btn, .mg-ctl .mp-btn { flex: 0 0 auto; }
.mg-slider .mp-btn { width: 44px; }
#screen-math { --bio-g-dark: #A65F00; --bio-g-main: #FFE0A3; --bio-g-bg: #FFF1D6; }
.mt-tiles { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 6px 0 12px; }
@media (min-width: 560px) { .mt-tiles { grid-template-columns: 1fr 1fr; } }
.mt-tiles .bio-group-tile { min-height: 124px; padding: 18px 20px; gap: 10px; border-radius: 24px; }
.mt-cards { display: flex; flex-direction: column; gap: 12px; }
.mt-cards .bio-anim-row { margin: 0; background: var(--surface); border: 1px solid var(--border); border-bottom: 4px solid var(--surface-2); border-radius: 18px; padding: 12px 14px; min-height: 64px; box-sizing: border-box; }
.mt-cards .bio-anim-row:active { transform: translateY(2px); border-bottom-width: 2px; }
@media (min-width: 700px) { .mt-cards { display: grid; grid-template-columns: 1fr 1fr; } }
.mp-btn { display: grid; place-items: center; padding: 0; }
.mp-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mp-btn svg .fill { fill: currentColor; stroke: none; }
.mp-btn.mp-play svg { width: 24px; height: 24px; }
.mp-sol:not(:empty) { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 14px; overflow-x: auto; }
.mg-ansrow { display: flex; align-items: stretch; gap: 8px; margin-bottom: 10px; }
.mg-ansrow .mp-ans { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.mg-ansrow .mt-next { flex: 0 0 auto; width: auto; margin: 0; padding: 0 16px; min-height: 52px; }
.mg-ansrow ~ .mp-pad { margin-bottom: 0; }
#screen-math-test #mt-title { font-size:calc(20px * var(--fs, 1)); line-height: 1.2; }
.mg-plot.mg-plot-task { max-width: 236px; }
.mp-ctl { justify-content: center; }
.mg-ctl.mp-ctl { justify-content: flex-start; }
#screen-math h1, #screen-math .back-btn { text-transform: lowercase; }
@media (hover: hover) and (pointer: fine) and (min-width: 1280px) {
  .mt-tiles { gap: calc(12px * var(--fs)); }
  .mt-tiles .bio-group-tile { min-height: calc(124px * var(--fs)); padding: calc(18px * var(--fs)) calc(20px * var(--fs)); gap: calc(10px * var(--fs)); border-radius: calc(24px * var(--fs)); }
  .mt-cards { gap: calc(12px * var(--fs)); }
  .mt-cards .bio-anim-row { padding: calc(12px * var(--fs)) calc(14px * var(--fs)); min-height: calc(64px * var(--fs)); border-radius: calc(18px * var(--fs)); }
  .mp-btn { width: calc(44px * var(--fs)); height: calc(44px * var(--fs)); border-radius: calc(12px * var(--fs)); }
  .mp-btn svg { width: calc(20px * var(--fs)); height: calc(20px * var(--fs)); }
  .mp-btn.mp-play { width: calc(56px * var(--fs)); height: calc(56px * var(--fs)); }
  .mp-btn.mp-play svg { width: calc(24px * var(--fs)); height: calc(24px * var(--fs)); }
  .mg-slider .mp-btn { width: calc(44px * var(--fs)); }
}
.mt-cards [data-t="anim"]   { --tc: #2E6DA6; }
.mt-cards [data-t="theory"] { --tc: #6A4FD9; }
.mt-cards [data-t="sim"]    { --tc: #17807B; }
.mt-cards [data-t="test"]   { --tc: #A65F00; }
.mt-cards [data-t="train"]  { --tc: #B33A72; }
.mt-cards .bio-row-ico { background: var(--tc, var(--bio-g-dark)); }
.mt-grp { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 12px 4px -4px; font-size:calc(15px * var(--fs, 1)); font-weight: 700; color: var(--text); }
.mt-grp:first-child { margin-top: 2px; }
.mt-grp b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tc); color: #fff; }
.mt-grp b .ic { width: 16px; height: 16px; }
.mt-grp em { margin-left: auto; font-style: normal; font-size:calc(12px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) and (min-width: 1280px) {
  .mt-grp { gap: calc(10px * var(--fs)); margin: calc(12px * var(--fs)) calc(4px * var(--fs)) calc(-4px * var(--fs)); }
  .mt-grp:first-child { margin-top: calc(2px * var(--fs)); }
  .mt-grp b { width: calc(28px * var(--fs)); height: calc(28px * var(--fs)); }
  .mt-grp b .ic { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); }
}
.mv-fig { display: block; width: 100%; max-width: 380px; height: auto; margin: 6px auto 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; font-family: 'Montserrat', sans-serif; }
.mv-fig text { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.mv-grid { stroke: var(--border); stroke-width: 1; }
.mv-axis { stroke: var(--text); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mv-fig .mv-tick { font-size:calc(9px * var(--fs, 1)); font-weight: 600; fill: var(--text-muted); }
.mv-vec { stroke-width: 2.8; stroke-linecap: round; }
.mv-vec.mv-a, .mv-start.mv-a, .mv-lab.mv-a { stroke: var(--text); }
.mv-vec.mv-b, .mv-start.mv-b, .mv-lab.mv-b { stroke: var(--primary-ink); }
.mv-head.mv-a { fill: var(--text); stroke: var(--text); }
.mv-head.mv-b { fill: var(--primary-ink); stroke: var(--primary-ink); }
.mv-head { stroke-width: 1; stroke-linejoin: round; }
.mv-start.mv-a { fill: var(--text); } .mv-start.mv-b { fill: var(--primary-ink); }
.mv-start { stroke-width: 1; }
.mv-lab { fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.mv-fig .mv-name { font-size:calc(13px * var(--fs, 1)); font-style: italic; font-weight: 700; }
.mv-fig .mv-name.mv-a { fill: var(--text); } .mv-fig .mv-name.mv-b { fill: var(--primary-ink); }
.mv-proj { stroke: var(--text-muted); stroke-width: 1.6; stroke-dasharray: 4 3; }
.mv-fig .mv-num { font-size:calc(11px * var(--fs, 1)); font-weight: 700; fill: var(--text); }
.mv-fig .mv-end { font-size:calc(9.5px * var(--fs, 1)); font-weight: 600; fill: var(--text-muted); }
.mt-miss-p { margin: 0 0 6px; font-size:calc(13px * var(--fs, 1)); line-height: 1.4; color: var(--text-muted); }
#screen-math-sect { padding-bottom: 40px; }
.sx-cond { margin: 0 0 10px; font-size:calc(15px * var(--fs, 1)); line-height: 1.45; color: var(--text); }
.sx-stage { position: relative; margin: 4px 0 6px; touch-action: none; overscroll-behavior: contain; }
.sx-svg { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; font-family: 'Montserrat', sans-serif; }
.sx-svg:active { cursor: grabbing; }
.sx-reset { position: absolute; top: 8px; right: max(8px, calc(50% - 222px)); width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sx-reset .ic { width: 22px; height: 22px; }
.sx-edge { stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.sx-hid { stroke-dasharray: 6 5; }
.sx-edge.sx-hid { stroke-width: 1.4; opacity: .75; }
.sx-sec { stroke: var(--coral); stroke-width: 3.4; stroke-linecap: round; }
.sx-sec.sx-hid { stroke-width: 2.4; stroke-dasharray: 7 5; }
.sx-aux { stroke: var(--text-muted); stroke-width: 1.4; }
.sx-ext { stroke: var(--text); stroke-width: 1.4; }
.sx-int { stroke: var(--primary-ink); stroke-width: 1.8; }
.sx-svg line.sx-now { stroke: var(--primary-ink); stroke-width: 3.6; }
.sx-svg line.sx-now.sx-aux, .sx-svg line.sx-now.sx-ext { stroke-width: 2.2; }
.sx-face { fill: var(--primary); opacity: .14; }
.sx-fill { fill: var(--coral); fill-opacity: .24; }
.sx-pt { stroke: var(--surface); stroke-width: 1.6; }
.sx-pt.sx-given { fill: var(--text); }
.sx-pt.sx-built { fill: var(--coral); }
.sx-pt.sx-trace { fill: var(--surface); stroke: var(--text); stroke-width: 1.8; }
.sx-pt.sx-foot { fill: var(--text-muted); }
.sx-lab.sx-foot { fill: var(--text-muted); }
.sx-pt.sx-now { fill: var(--primary-ink); }
.sx-pt.sx-trace.sx-now { fill: var(--surface); stroke: var(--primary-ink); }
.sx-lab { font-size:calc(15px * var(--fs, 1)); font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3.5px; stroke-linejoin: round; }
.sx-lab.sx-vlab { font-weight: 600; fill: var(--text-muted); }
.sx-lab.sx-built { fill: var(--coral-ink); }
.sx-lab.sx-trace { fill: var(--text-muted); }
.sx-lab.sx-now { fill: var(--primary-ink); }
.sx-sub { font-size:calc(10px * var(--fs, 1)); }
.sx-hint { margin: 2px 4px 8px; text-align: center; font-size:calc(13px * var(--fs, 1)); }
.sx-ctl { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 8px 0; background: var(--bg); }
.sx-count { flex: 1 1 auto; text-align: center; font-size:calc(13px * var(--fs, 1)); font-weight: 700; color: var(--text-muted); }
.sx-next { flex: 0 0 auto; width: auto; min-width: 150px; min-height: 48px; padding: 10px 18px; }
.sx-step { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary-ink); border-radius: 16px; padding: 12px 14px; margin: 4px 0 12px; min-height: 92px; box-sizing: border-box; }
.sx-step.sx-done { border-left-color: var(--coral); }
.sx-step-t { margin: 0 0 6px; font-size:calc(15px * var(--fs, 1)); line-height: 1.55; color: var(--text); }
.sx-step-t .katex { font-size: 1.05em; }
.sx-why { margin: 0; font-size:calc(13px * var(--fs, 1)); line-height: 1.45; color: var(--text-muted); }
.sx-steps { margin: 0 0 8px; padding-left: 26px; font-size:calc(13px * var(--fs, 1)); line-height: 1.5; color: var(--text-muted); }
.sx-steps li { margin: 3px 0; }
.sx-steps li.sx-cur { color: var(--text); font-weight: 600; }
@media (hover: hover) and (pointer: fine) and (min-width: 1280px) {
  .sx-svg { max-width: calc(520px * var(--fs)); }
  .sx-reset { width: calc(44px * var(--fs)); height: calc(44px * var(--fs)); right: max(8px, calc(50% - 252px * var(--fs))); }
  .sx-next { min-width: calc(150px * var(--fs)); min-height: calc(48px * var(--fs)); }
  .sx-step { padding: calc(12px * var(--fs)) calc(14px * var(--fs)); }
}
