/* Math practice: topic hub, quiz, honors and the picture kit. Tokens only (scripts/check-visual-tokens.mjs). */
.mp-shell { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.mp-screen { display: flex; flex-direction: column; gap: var(--space-3); max-width: 1120px; margin: 0 auto; }
.mp-kicker { margin: 0; color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); text-transform: uppercase; letter-spacing: .06em; }
.mp-head h1, .mp-summary h1, .mp-list-head h1 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; margin: 0; max-width: none; }
.mp-prompt, .mp-screen h1 { max-width: none; }
.mp-head p { margin: var(--space-1) 0 0; color: var(--muted); }
.mp-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elevation-soft); padding: var(--space-4) var(--space-5); }
.mp-card h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 var(--space-2); }
.mp-note { color: var(--muted); font-size: var(--text-small); margin: var(--space-2) 0 0; }
.mp-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); align-items: center; }
.mp-button { min-height: var(--target-min); border: 2px solid var(--transparent); border-radius: var(--radius-md); padding: var(--space-2) var(--space-5); font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; background: var(--transparent); color: var(--ink); }
.mp-button:disabled { opacity: .5; cursor: default; }
.mp-button:focus-visible, .mp-choice:focus-visible, .mp-strike:focus-visible, .mp-input:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.mp-primary { background: var(--blue-strong); color: var(--paper); }
.mp-secondary { background: var(--paper); border-color: var(--line); }
.mp-link { color: var(--blue-dark); padding-left: 0; padding-right: 0; text-decoration: underline; }
.mp-honors-btn { background: var(--ink); color: var(--paper); }
.mp-crumbs { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-small); color: var(--muted); flex-wrap: wrap; }
.mp-crumbs .mp-button { min-height: 32px; font-size: var(--text-small); }

/* Hub */
.mp-hub-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); align-items: stretch; }
.mp-select { display: flex; flex-direction: column; gap: var(--space-1); font-weight: 700; font-size: var(--text-small); }
.mp-select select { width: 100%; max-width: 100%; min-height: var(--target-min); border: 1px solid var(--muted); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-3); font: inherit; font-size: 16px; background: var(--paper); color: var(--ink); }
.mp-big { margin: 0; font-size: 18px; }
.mp-big strong { font-family: var(--font-display); font-size: 36px; line-height: 1; color: var(--coral-text); }
.mp-honors-card { border-top: 6px solid var(--ink); }
.mp-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.mp-sections-title { margin: 0; font-family: var(--font-display); font-size: 18px; }
.mp-section { display: flex; flex-direction: column; gap: var(--space-1); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
.mp-section h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.mp-section p { margin: 0; color: var(--muted); font-size: var(--text-small); }
.mp-section .mp-button { min-height: var(--target-min); padding: var(--space-1) var(--space-2); font-size: 15px; align-self: stretch; margin-top: auto; }
.mp-dots { display: flex; gap: var(--space-1); list-style: none; margin: var(--space-1) 0; padding: 0; }
.mp-dots li { width: 12px; height: 12px; border-radius: var(--radius-round); background: var(--line); }
.mp-dots li.is-right { background: var(--green-strong); }
.mp-dots li.is-pile { background: var(--coral-strong); }
.mp-progress-line { margin: 0; color: var(--muted); font-size: var(--text-small); }
.mp-progress-line strong { color: var(--ink); }

/* Question */
.mp-session-top { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-small); color: var(--muted); font-weight: 700; }
.mp-stage { color: var(--blue-dark); text-transform: uppercase; letter-spacing: .05em; }
.mp-screen progress { width: 100%; height: 10px; accent-color: var(--blue-strong); }
.mp-question { display: grid; gap: var(--space-3); }
.mp-question.has-visual { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.mp-q-visual { display: grid; place-items: center; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3); min-width: 0; }
.mp-q-visual svg.mv { width: 100%; max-height: min(40vh, 320px); }
.mp-q-visual svg.mv-square, .mp-q-visual svg.mv-tall { max-width: 300px; }
.mp-q-body { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.mp-skill { margin: 0; color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); }
.mp-prompt { margin: 0; font-size: 21px; line-height: 1.45; font-weight: 700; font-family: var(--font-reading); }
.mp-prompt:focus { outline: none; }
.mp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.mp-choice-wrap { position: relative; display: flex; }
.mp-choice { flex: 1; display: flex; align-items: center; gap: var(--space-3); min-height: 58px; text-align: left; border: 2px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-7) var(--space-2) var(--space-3); background: var(--paper); color: var(--ink); font: inherit; font-size: 19px; cursor: pointer; }
@media (hover: hover) { :where(:root:not([data-hover-rest])) .mp-choice:hover:not(:disabled) { border-color: var(--blue); } }
.mp-choice:disabled { cursor: default; }
.mp-letter { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-round); background: var(--cream); font-weight: 700; font-size: 15px; }
.mp-choice.is-correct { border-color: var(--state-correct-color); background: var(--cream); }
.mp-choice.is-correct .mp-letter { background: var(--state-correct-color); color: var(--paper); }
.mp-choice.is-wrong { border-color: var(--state-incorrect-color); }
.mp-choice.is-wrong .mp-letter { background: var(--state-incorrect-color); color: var(--paper); }
.mp-choice.is-dim { opacity: .55; }
.mp-choice.is-struck .mp-choice-text { text-decoration: line-through; opacity: .45; }
.mp-strike { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: var(--radius-round); border: 1px solid var(--line); background: var(--paper); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.mp-strike[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.mp-input-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.mp-input { min-height: 52px; width: min(260px, 100%); border: 2px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font: inherit; font-size: 22px; color: var(--ink); background: var(--paper); }
.mp-input.is-correct { border-color: var(--state-correct-color); }
.mp-input.is-wrong { border-color: var(--state-incorrect-color); }
.mp-unit { font-weight: 700; font-size: 19px; }
.mp-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.mp-toolbar .scratchpad-launch { min-height: var(--target-min); }
.mp-hint { color: var(--muted); font-size: var(--text-small); margin: 0; }

/* Feedback and steps */
.mp-verdict { margin: 0; font-weight: 700; font-size: 19px; }
.mp-verdict.is-correct { color: var(--green-text); }
.mp-verdict.is-wrong { color: var(--coral-text); }
.mp-pile-note { margin: 0; font-size: var(--text-small); color: var(--muted); }
.mp-feedback { display: flex; flex-direction: column; gap: var(--space-2); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.mp-steps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-4); align-items: center; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.mp-steps.no-visual { grid-template-columns: 1fr; }
.mp-step-count { margin: 0; color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); text-transform: uppercase; letter-spacing: .05em; }
.mp-step-say { margin: var(--space-1) 0 0; font-size: 18px; line-height: 1.5; }
.mp-step-visual { display: grid; place-items: center; min-width: 0; }
.mp-step-visual svg.mv { width: 100%; max-height: min(34vh, 280px); }
.mp-step-visual svg.mv-square, .mp-step-visual svg.mv-tall { max-width: 260px; }
.mp-step-nav { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.mp-step-nav .mp-button { min-height: 40px; padding: var(--space-1) var(--space-4); font-size: 16px; }
.mp-step-dots { display: flex; gap: var(--space-2); list-style: none; margin: 0 0 0 auto; padding: 0; }
.mp-step-dots li { width: 10px; height: 10px; border-radius: var(--radius-round); background: var(--line); }
.mp-step-dots li.is-on { background: var(--blue-strong); }
.mp-recap { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: baseline; margin: 0; font-size: 16px; }
.mp-recap .mp-recap-q { color: var(--muted); }

/* Honors */
.mp-honors-head { display: flex; gap: var(--space-3); align-items: center; }
.mp-honors-badge { background: var(--ink); color: var(--paper); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); font-size: var(--text-caption); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mp-intro { margin: 0; font-size: 19px; line-height: 1.5; }
.mp-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.mp-parts li { display: flex; gap: var(--space-2); align-items: baseline; font-size: 16px; }
.mp-parts li.is-right::before { content: "✓"; color: var(--green-text); font-weight: 700; }
.mp-parts li.is-wrong::before { content: "↻"; color: var(--coral-text); font-weight: 700; }
.mp-parts li.is-now::before { content: "•"; color: var(--blue-dark); font-weight: 700; }
.mp-part-label { font-weight: 700; }

/* Summary and lists */
.mp-summary { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.mp-score { margin: 0; font-size: 20px; }
.mp-score strong { font-family: var(--font-display); font-size: 52px; color: var(--blue-dark); }
.mp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.mp-chips li { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-3); font-size: 15px; }
.mp-pile-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-2); }
.mp-pile-list li { display: flex; justify-content: space-between; gap: var(--space-2); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.mp-streak { color: var(--coral-text); letter-spacing: 2px; }
.mp-learn-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mp-learn-tabs button { min-height: 38px; padding: 0 var(--space-3); border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.mp-learn-tabs button[aria-selected="true"] { background: var(--blue-strong); border-color: var(--blue-strong); color: var(--paper); }

/* Math typography */
.mp-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.1; margin: 0 var(--space-1); font-size: .92em; }
.mp-frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 var(--space-1); }
.mp-frac > span:last-child { padding: 0 var(--space-1); }
.mp-sqrt > span { border-top: 2px solid currentColor; padding: 0 var(--space-1); }
.mp-prompt sup, .mp-choice sup, .mv-work sup, .mv-cards sup { font-size: .7em; }

/* ---------------------------------------------------------------- picture kit */
svg.mv { display: block; font-family: var(--font-reading); overflow: visible; }
.mv-figure { margin: 0; display: grid; gap: var(--space-2); justify-items: center; width: 100%; }
.mv-figure figcaption { font-size: var(--text-small); color: var(--muted); text-align: center; }
.mv text { fill: var(--ink); font-size: 17px; }
.mv .mv-tick-label { font-size: 15px; fill: var(--muted); }
.mv .mv-strong { font-weight: 700; font-size: 18px; }
.mv .mv-note { font-size: 14px; fill: var(--muted); }
@media (max-width: 520px) { .mv .mv-note { font-size: 17px; } }
.mv .mv-row-label { font-weight: 700; font-size: 17px; }
.mv .mv-part-label { font-size: 13px; fill: var(--muted); }
.mv .mv-on-shade { fill: var(--ink); font-weight: 700; }
.mv .mv-text-blue { fill: var(--blue-dark); }
.mv .mv-text-coral { fill: var(--coral-strong); }
.mv .mv-text-gold { fill: var(--ink); }
.mv .mv-text-green { fill: var(--green-strong); }
.mv .mv-text-plum { fill: var(--ink); }
.mv-stroke, .mv-stroke-coral, .mv-axis, .mv-tick, .mv-thin, .mv-dashed, .mv-grid, .mv-median, .mv-bracket, .mv-beam, .mv-line, .mv-pointer, .mv-angle-arc, .mv-jump, .mv-block-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mv-stroke { stroke: var(--blue-dark); stroke-width: 4; }
.mv-stroke-coral { stroke: var(--coral-strong); stroke-width: 4; }
.mv-axis { stroke: var(--ink); stroke-width: 2.5; }
.mv-axis-head { fill: var(--ink); }
.mv-tick { stroke: var(--ink); stroke-width: 2; }
.mv-thin { stroke: var(--ink); stroke-width: 1.8; }
.mv-dashed { stroke: var(--coral-strong); stroke-width: 2.5; stroke-dasharray: 7 6; }
.mv-grid { stroke: var(--line); stroke-width: 1.5; }
.mv-median { stroke: var(--coral-strong); stroke-width: 4; }
.mv-bracket { stroke: var(--coral-strong); stroke-width: 2.5; }
.mv-beam { stroke: var(--ink); stroke-width: 6; }
.mv-line { stroke: var(--blue-dark); stroke-width: 3.5; }
.mv-pointer { stroke: var(--ink); stroke-width: 5; }
.mv-angle-arc { stroke: var(--yellow); stroke-width: 5; }
.mv-block-line { stroke: var(--blue-dark); stroke-width: .8; opacity: .55; }
.mv-shape { fill: var(--paper); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.mv-part, .mv-cell { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.mv-cell { stroke: var(--line); stroke-width: 1.5; }
.mv-fill { fill: var(--cream); }
.mv-shade-blue { fill: var(--blue); }
.mv-shade-coral { fill: var(--coral); }
.mv-shade-gold { fill: var(--yellow); }
.mv-shade-green { fill: var(--green); }
.mv-shade-plum { fill: var(--halogen); }
.mv-shade-soft-blue { fill: var(--noble); }
.mv-shade-soft-coral { fill: var(--alkali); }
.mv-shade-soft-gold { fill: var(--alkaline); }
.mv-shade-soft-green { fill: var(--post-transition); }
.mv-shade-soft-plum { fill: var(--halogen); }
.mv-part.mv-shade-blue, .mv-cell.mv-shade-blue { fill: var(--noble); }
.mv-part.mv-shade-coral { fill: var(--alkali); }
.mv-part.mv-shade-gold { fill: var(--alkaline); }
.mv-part.mv-shade-green { fill: var(--post-transition); }
.mv-bar { stroke: var(--ink); stroke-width: 1.5; }
.mv-bar.mv-shade-blue { fill: var(--blue); }
.mv-hist { stroke: var(--paper); stroke-width: 2; }
.mv-dot { stroke: var(--paper); stroke-width: 2.5; }
.mv-dot-blue { fill: var(--blue-dark); }
.mv-dot-coral { fill: var(--coral-strong); }
.mv-dot-gold { fill: var(--yellow); }
.mv-dot-green { fill: var(--green-strong); }
.mv-dot-plum { fill: var(--halogen); }
.mv-dot-ink { fill: var(--ink); }
.mv-dot-open { fill: var(--paper); stroke: var(--coral-strong); stroke-width: 3; }
.mv-span-blue { fill: var(--noble); }
.mv-span-coral { fill: var(--alkali); }
.mv-span-gold { fill: var(--alkaline); }
.mv-span-green { fill: var(--post-transition); }
.mv-jump { stroke-width: 3.5; }
.mv-jump-blue { stroke: var(--blue-dark); } .mv-jump-head-blue { fill: var(--blue-dark); }
.mv-jump-coral { stroke: var(--coral-strong); } .mv-jump-head-coral { fill: var(--coral-strong); }
.mv-jump-gold { stroke: var(--yellow); } .mv-jump-head-gold { fill: var(--yellow); }
.mv-jump-green { stroke: var(--green-strong); } .mv-jump-head-green { fill: var(--green-strong); }
.mv-jump-plum { stroke: var(--ink); } .mv-jump-head-plum { fill: var(--ink); }
.mv .mv-jump-label { font-weight: 700; font-size: 16px; }
.mv .mv-mark-label { font-weight: 700; font-size: 16px; }
.mv-highlight { fill: var(--alkaline); opacity: .45; }
.mv-group { fill: var(--alkaline); opacity: .6; }
.mv-block { fill: var(--noble); stroke: var(--blue-dark); stroke-width: 1.5; }
.mv-block-side { fill: var(--blue); }
.mv-block-ten { fill: var(--alkaline); stroke: var(--ink); }
.mv-block-one { fill: var(--alkali); stroke: var(--coral-strong); }
.mv-pan { fill: var(--line); stroke: var(--ink); stroke-width: 2; }
.mv-stand { fill: var(--muted); }
.mv-weight { fill: var(--alkaline); stroke: var(--ink); stroke-width: 1.5; }
.mv-weight-x { fill: var(--blue-strong); stroke: var(--ink); stroke-width: 1.5; }
.mv .mv-weight-text { font-weight: 700; font-size: 16px; }
.mv .mv-weight-text-x { font-weight: 700; font-size: 16px; fill: var(--paper); }
.mv-node { fill: var(--paper); stroke: var(--blue-dark); stroke-width: 2; }
.mv .mv-node-text { font-size: 13px; font-weight: 700; }
.mv-table { border-collapse: collapse; font-size: 17px; background: var(--paper); }
.mv-table th, .mv-table td { border: 1px solid var(--line); padding: var(--space-2) var(--space-3); text-align: center; }
.mv-table th { background: var(--cream); }
.mv-table .is-hi { background: var(--alkaline); font-weight: 700; }
.mv-cards { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.mv-cards > div { display: flex; flex-direction: column; gap: var(--space-1); min-width: 120px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); text-align: center; }
.mv-cards > div.is-hi { border: 2px solid var(--coral-strong); }
.mv-cards > div > span { font-size: 13px; color: var(--muted); font-weight: 700; }
.mv-cards > div > strong { font-size: 20px; }
.mv-work { display: flex; flex-direction: column; gap: var(--space-2); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); min-width: min(360px, 100%); }
.mv-work > div { display: flex; justify-content: space-between; gap: var(--space-4); align-items: baseline; }
.mv-work-math { font-size: 20px; font-variant-numeric: tabular-nums; }
.mv-work-note { font-size: 14px; color: var(--muted); text-align: right; }
.mv-work > div.is-result .mv-work-math { font-weight: 700; color: var(--blue-dark); }
.mv-column { display: inline-grid; grid-template-columns: repeat(var(--cols), 0.72em); justify-content: end; font-size: 30px; font-variant-numeric: tabular-nums; font-family: var(--font-reading); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-5); line-height: 1.25; }
.mv-column > span { text-align: center; }
.mv-column .mv-carry { font-size: 16px; color: var(--coral-strong); align-self: end; }
.mv-column .mv-column-line { border-bottom: 3px solid var(--ink); }
.mv-column .mv-column-sign { color: var(--blue-dark); }
.mv-column .mv-column-result { font-weight: 700; color: var(--blue-dark); }
.mv-pv { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); }
.mv-pv > div { display: flex; flex-direction: column; align-items: center; border-right: 1px solid var(--line); min-width: 62px; }
.mv-pv > div:last-child { border-right: 0; }
.mv-pv span { font-size: 11px; font-weight: 700; color: var(--muted); padding: var(--space-1); text-align: center; background: var(--cream); width: 100%; min-height: 32px; display: grid; place-items: center; }
.mv-pv strong { font-size: 30px; padding: var(--space-1) var(--space-2); }
.mv-pv .is-hi { background: var(--alkaline); }
.mv-pv .is-hi span { background: var(--yellow); color: var(--ink); }
.mv-pv .mv-pv-point { min-width: 18px; }

@media (max-width: 860px) {
  .mp-hub-grid { grid-template-columns: minmax(0, 1fr); }
  .mp-question.has-visual, .mp-steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .mp-choices { grid-template-columns: 1fr; }
  .mp-card { padding: var(--space-3) var(--space-4); }
  .mp-prompt { font-size: 19px; }
  .mp-choice { min-height: 52px; font-size: 18px; }
}
@media (max-height: 800px) and (min-width: 861px) {
  .mp-card { padding: var(--space-3) var(--space-4); }
  .mp-q-visual svg.mv { max-height: min(36vh, 260px); }
  .mp-step-visual svg.mv { max-height: min(30vh, 230px); }
  .mp-prompt { font-size: 19px; }
  .mp-choice { min-height: 50px; }
}
.mp-q-visual.mp-honors-side { display: flex; flex-direction: column; gap: var(--space-3); place-items: stretch; align-items: stretch; }

.mp-hub-grid .mp-card { padding: var(--space-3) var(--space-4); }
.mp-hub-grid .mp-actions { margin-top: var(--space-2); }
.mp-section-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: auto; }
.mp-section-row .mp-button { align-self: auto; margin-top: 0; }
svg.mv-compact { max-width: 280px; }
svg.mv-square { max-width: 300px; }
/* The coordinate graph (coach/visuals.js graph) inside practice screens. */
.mp-q-visual svg.g, .mp-step-visual svg.g, .mv-figure svg.g { width: 100%; max-width: 360px; height: auto; max-height: min(40vh, 330px); }
.mp-step-visual svg.g { max-height: min(34vh, 280px); }

/* Compact session chrome: crumbs and the question count share one row. */
.mp-topbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.mp-topbar .mp-session-top { margin: 0; }
.mp-step-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-left: var(--space-3); }
.mp-step-actions .mp-button { min-height: var(--target-min); font-size: 17px; padding: var(--space-2) var(--space-4); }
.mp-step-nav .mp-step-dots { margin-left: auto; }
.mp-verdict .mp-pile-note { display: inline; font-weight: 400; }
/* The one-line reason this particular wrong answer is wrong (whys / slips). */
.mp-verdict-block { display: grid; gap: var(--space-1); }
.mp-why-wrong { margin: 0; padding: 2px var(--space-3); border-left: 4px solid var(--coral-strong); background: var(--cream); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 17px; line-height: 1.4; color: var(--ink); }
.mp-caption { font-weight: 400; color: var(--muted); }
.mp-parts { flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.mp-honors-side .mp-step-visual svg.mv, .mp-honors-side .mp-step-visual svg.g { max-height: min(30vh, 220px); }
.mp-honors-side .mp-intro { font-size: 18px; }
@media (max-height: 800px) and (min-width: 861px) {
  .mp-step-visual svg.g { max-height: min(34vh, 250px); }
  .mp-q-visual svg.g { max-height: min(40vh, 290px); }
  .mp-honors-side .mp-step-visual svg.mv, .mp-honors-side .mp-step-visual svg.g { max-height: min(26vh, 180px); }
}
.mv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); width: 100%; align-items: start; }
.mp-step-visual .mv-table th, .mp-step-visual .mv-table td, .mp-q-visual .mv-table th, .mp-q-visual .mv-table td { padding: var(--space-1) var(--space-3); font-size: 16px; }
.mp-step-visual, .mp-q-visual { max-width: 100%; }
.mp-step-visual:has(> .mv-table), .mp-q-visual:has(> .mv-table) { overflow-x: auto; justify-items: start; }
@media (max-width: 560px) {
  .mp-step-visual .mv-table th, .mp-step-visual .mv-table td, .mp-q-visual .mv-table th, .mp-q-visual .mv-table td { padding: var(--space-1) var(--space-2); font-size: 14px; }
  .mp-steps { padding: var(--space-3); }
}

/* Physics picture kit (js/subjects/physics/practice/visuals.js) */
.mv-vec { fill: none; stroke-linecap: round; }
.mv-vec-w2 { stroke-width: 2; } .mv-vec-w3 { stroke-width: 3; } .mv-vec-w4 { stroke-width: 4; }
.mv-vec-dashed { stroke-dasharray: 6 5; }
.mv-vec-blue { stroke: var(--blue-dark); } .mv-head-blue { fill: var(--blue-dark); }
.mv-vec-coral { stroke: var(--coral-strong); } .mv-head-coral { fill: var(--coral-strong); }
.mv-vec-green { stroke: var(--green-strong); } .mv-head-green { fill: var(--green-strong); }
.mv-vec-gold { stroke: var(--yellow); } .mv-head-gold { fill: var(--yellow); }
.mv-vec-plum { stroke: var(--ink); } .mv-head-plum { fill: var(--ink); }
.mv-vec-ink { stroke: var(--ink); } .mv-head-ink { fill: var(--ink); }
.mv-ground { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.mv-path { fill: none; stroke: var(--blue-dark); stroke-width: 3.5; stroke-linecap: round; }
.mv-spring { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.mv-dashed-shape { stroke-dasharray: 8 6; fill: none; }
.mv-dashed-soft { stroke: var(--line); stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
.mv-water { fill: var(--noble); opacity: .7; }
.mv-tank { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.mv-thin-fill { stroke: none; opacity: .5; }
.mv-wire { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.mv-wire-thick { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.mv-resistor { fill: none; stroke: var(--coral-strong); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.mv-charge-pos { fill: var(--alkali); stroke: var(--coral-strong); stroke-width: 3; }
.mv-charge-neg { fill: var(--noble); stroke: var(--blue-dark); stroke-width: 3; }
.mv .mv-charge-text { font-size: 24px; font-weight: 700; }
.mv-plate-pos { fill: var(--coral-strong); }
.mv-plate-neg { fill: var(--blue-dark); }
.mv-field-ring { fill: none; stroke: var(--noble); stroke-width: 2; }
.mv-lens { fill: var(--noble); opacity: .6; stroke: var(--blue-dark); stroke-width: 2; }
.mv-mirror { fill: none; stroke: var(--blue-dark); stroke-width: 5; stroke-linecap: round; }
.mv-ray { stroke: var(--coral-strong); stroke-width: 2.5; stroke-linecap: round; }
.mv-ray-virtual { stroke: var(--coral-strong); stroke-width: 2; stroke-dasharray: 5 5; opacity: .8; }
.mv-level { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }

.mp-extras { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.mp-extras p { margin: 0; display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-small); }
.mp-extras .mp-button { min-height: 40px; font-size: 15px; padding: var(--space-1) var(--space-3); }
.mv-area { opacity: .8; }

/* Two pictures in one visual sit side by side instead of stacking. */
.mp-step-visual:has(> svg + svg), .mp-q-visual:has(> svg + svg), .mp-step-visual:has(> figure + figure), .mp-q-visual:has(> figure + figure) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.mp-hub-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-4); }
.mp-choices-long { grid-template-columns: 1fr; }
.mp-choices-long .mp-choice { min-height: 48px; font-size: 17px; }
@media (max-height: 800px) and (min-width: 861px) {
  .mp-honors-side .mp-intro { font-size: 17px; }
  .mp-choices-long .mp-choice { min-height: 44px; font-size: 16px; padding-top: var(--space-1); padding-bottom: var(--space-1); }
}

/* English picture kit (js/subjects/english/practice/visuals.js) */
.ev-passage, .ev-sentence, .ev-compare, .ev-clauses, .ev-flow, .ev-tabletop, .ev-equation, .ev-notes, .ev-elim, .ev-signals, .ev-wordparts { margin: 0; width: 100%; display: grid; gap: var(--space-2); font-family: var(--font-reading); color: var(--ink); text-align: left; }
.ev-title { font-family: var(--font-display); font-size: 15px; color: var(--muted); letter-spacing: .02em; }
.ev-note { margin: 0; font-size: var(--text-small); color: var(--muted); }
.ev-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.ev-text { display: grid; gap: var(--space-2); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.ev-text p { margin: 0; font-size: 16px; line-height: 1.5; }
.ev-compact .ev-text { padding: var(--space-2) var(--space-3); }
.ev-compact .ev-text p { font-size: 15px; line-height: 1.45; }
.ev-mark { border-radius: 4px; padding: 0 2px; color: var(--ink); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ev-k { background: var(--alkaline); }
.ev-e { background: var(--post-transition); }
.ev-c { background: var(--noble); }
.ev-t { background: var(--transparent); font-weight: 700; text-decoration: underline; text-decoration-color: var(--coral-strong); text-decoration-thickness: 3px; text-underline-offset: 3px; padding: 0; }
.ev-x { background: var(--transparent); color: var(--coral-strong); text-decoration: line-through; text-decoration-thickness: 2px; }
.ev-f { background: var(--post-transition); font-weight: 700; }
.ev-legend { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: 13px; }
.ev-legend .ev-mark { padding: 1px var(--space-2); }
.ev-legend .ev-x { text-decoration: line-through; }
.ev-blank { display: inline-block; width: 5.5em; height: 1.05em; vertical-align: -0.15em; border-bottom: 3px solid var(--ink); margin: 0 2px; }
.ev-sentence p { margin: 0; font-size: 19px; line-height: 1.55; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.ev-compare .ev-row { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--coral-strong); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.ev-compare .ev-row-right { border-left-color: var(--green-strong); }
.ev-compare .ev-row p { margin: 0; font-size: 17px; line-height: 1.5; }
.ev-compare .ev-row-wrong .ev-tag { color: var(--coral-strong); }
.ev-compare .ev-row-right .ev-tag { color: var(--green-strong); }
.ev-blocks { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; }
.ev-block { display: grid; gap: 2px; justify-items: center; border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); border: 2px solid var(--line); background: var(--paper); }
.ev-block-text { font-size: 17px; line-height: 1.35; text-align: center; }
.ev-block-cap { font-size: 12px; color: var(--muted); font-weight: 700; }
.ev-block.ev-ind { border-color: var(--green-strong); background: var(--cream); }
.ev-block.ev-dep { border: 2px dashed var(--blue-dark); background: var(--cream); }
.ev-block.ev-phrase { border: 2px dotted var(--muted); }
.ev-block.ev-mark { border-color: var(--coral-strong); padding: var(--space-2); }
.ev-block.ev-mark .ev-block-text { font-size: 26px; font-weight: 700; color: var(--coral-strong); line-height: 1; }
.ev-block.ev-join { border-color: var(--yellow); background: var(--cream); }
.ev-flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: stretch; }
.ev-flow .ev-step { position: relative; flex: 1 1 120px; display: grid; gap: 2px; align-content: start; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.ev-flow .ev-step + .ev-step::before { content: "→"; position: absolute; left: calc(-1 * var(--space-5)); width: var(--space-5); top: 50%; transform: translateY(-50%); text-align: center; font-weight: 700; color: var(--muted); }
.ev-flow .ev-step strong { font-size: 15px; }
.ev-flow .ev-step span { font-size: 14px; line-height: 1.4; }
.ev-flow .ev-step.is-hi { border-color: var(--coral-strong); background: var(--cream); }
.ev-flow .ev-step.is-dim { opacity: .55; }
.ev-flow.ev-vertical ol { flex-direction: column; flex-wrap: nowrap; gap: var(--space-4); }
.ev-flow.ev-vertical .ev-step { flex: none; }
.ev-flow.ev-vertical .ev-step + .ev-step::before { content: "↓"; left: 50%; top: calc(-1 * var(--space-4)); width: auto; height: var(--space-4); transform: translateX(-50%); line-height: 1; }
.ev-tabletop .ev-top { background: var(--cream); border: 3px solid var(--ink); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.ev-tabletop .ev-top p, .ev-tabletop .ev-leg p { margin: 0; line-height: 1.4; }
.ev-tabletop .ev-top p { font-size: 17px; font-weight: 700; }
.ev-legs { display: grid; grid-template-columns: repeat(var(--legs), minmax(0, 1fr)); gap: var(--space-2); padding: 0 var(--space-3); }
.ev-leg { background: var(--paper); border: 2px solid var(--line); border-top: 6px solid var(--ink); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: var(--space-2); }
.ev-leg p { font-size: 14px; }
.ev-eq-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ev-op { font-size: 26px; font-weight: 700; color: var(--muted); }
.ev-chip { flex: 1 1 110px; border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); border: 2px solid var(--line); background: var(--paper); }
.ev-chip p { margin: 0; font-size: 15px; line-height: 1.4; }
.ev-chip-c { border-color: var(--blue-dark); }
.ev-chip-e { border-color: var(--green-strong); }
.ev-chip-k, .ev-chip-result { border-color: var(--coral-strong); background: var(--cream); }
.ev-means { color: var(--muted); font-size: 13px !important; }
.ev-wordparts .ev-chip p strong { font-size: 19px; }
.ev-two { width: 100%; display: grid; gap: var(--space-1); }
.ev-relation { margin: 0; text-align: center; font-weight: 700; font-size: 15px; color: var(--coral-strong); }
.ev-notes ul, .ev-elim ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.ev-notes { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.ev-notes li { display: flex; gap: var(--space-2); font-size: 15px; line-height: 1.4; padding-left: var(--space-2); border-left: 3px solid var(--line); }
.ev-notes li.is-pick { border-left-color: var(--green-strong); background: var(--cream); }
.ev-notes li.is-dim { opacity: .55; }
.ev-goal { margin: 0; font-size: 15px; border-top: 2px dashed var(--line); padding-top: var(--space-2); }
.ev-check { font-weight: 700; min-width: 1em; }
.ev-elim li { display: flex; gap: var(--space-2); align-items: start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-3); }
.ev-elim li span:last-child { display: grid; gap: 1px; }
.ev-elim strong { font-size: 15px; font-weight: 700; line-height: 1.35; }
.ev-elim em { font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.35; }
.ev-elim .is-ok { border-color: var(--green-strong); }
.ev-elim .is-ok .ev-check { color: var(--green-strong); }
.ev-elim .is-no .ev-check { color: var(--coral-strong); }
.ev-elim .is-no strong { font-weight: 400; }
.ev-sig-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--space-2); }
.ev-sig { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2); }
.ev-sig strong { font-size: 14px; }
.ev-sig ul { list-style: none; margin: var(--space-1) 0 0; padding: 0; font-size: 14px; line-height: 1.5; }
.ev-sig.is-hi { border-color: var(--coral-strong); background: var(--cream); }
.ev-sig li.is-hi { font-weight: 700; color: var(--coral-strong); }
.ev-scale-bar { fill: var(--line); }
.ev-scale-pin { fill: var(--coral-strong); }
.mp-q-visual:has(> .ev-passage, > .ev-two, > .ev-sentence, > .ev-notes, > .ev-compare, > .ev-clauses) { place-items: stretch; align-content: start; }
.mp-step-visual:has(> .ev-passage, > .ev-two, > .ev-elim, > .ev-flow, > .ev-notes, > .ev-tabletop) { place-items: stretch; }
@media (max-width: 560px) {
  .ev-sig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-legs { grid-template-columns: 1fr; padding: 0; }
  .ev-sentence p { font-size: 17px; }
  .ev-flow .ev-step + .ev-step::before { content: none; }
}
/* Sentence-length choices: once answered right, only the right one stays (the steps
   still walk through every choice), and on short desktop screens rows stay compact. */
.mp-choices-long:has(.is-correct) .mp-choice-wrap:has(> .is-dim) { display: none; }
@media (max-height: 800px) and (min-width: 861px) {
  .mp-choices-long { gap: var(--space-2); }
  .mp-choices-long .mp-choice { min-height: 40px; line-height: 1.35; padding-top: 6px; padding-bottom: 6px; }
  .mp-honors-side .ev-text p { font-size: 15px; line-height: 1.45; }
  .mp-honors-side .ev-text { padding: var(--space-2) var(--space-3); }
}
/* A reading box that the screen had to shorten scrolls inside itself (see fitReading). */
[data-scroll-allowed="reading"] { overflow: auto; overscroll-behavior: contain; }
[data-scroll-allowed="reading"]:focus-visible { outline: 3px solid var(--blue-strong); outline-offset: 2px; }
@media (max-height: 800px) and (min-width: 861px) {
  .mp-q-body:has(.mp-choices-long) { gap: var(--space-2); }
  .mp-q-body:has(.mp-choices-long) .mp-prompt { font-size: 19px; line-height: 1.4; }
  .mp-q-body:has(.mp-choices-long) .mp-feedback { padding-top: var(--space-2); }
  .mp-q-body:has(.mp-choices-long) .mp-feedback .mp-verdict { font-size: 17px; }
}
@media (max-height: 760px) and (min-width: 861px) {
  .mp-choices-long { gap: 6px; }
  .mp-choices-long .mp-choice { min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
  .mp-card.mp-question { padding-top: var(--space-3); padding-bottom: var(--space-3); }
}

/* Physics picture lessons (js/subjects/physics/lessons/lesson-app.js) */
.pl-lesson { display: grid; gap: var(--space-3); }
.pl-head { display: flex; align-items: center; gap: var(--space-3); }
.pl-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); font-size: 26px; }
.pl-head > div { flex: 1 1 auto; min-width: 0; }
.pl-kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--blue-dark); text-transform: uppercase; }
.pl-head h2 { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 1.15; }
.pl-skip { flex: 0 0 auto; min-height: var(--target-min); padding: 0 var(--space-3); border: 0; background: var(--transparent); color: var(--blue-dark); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.pl-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-4); align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elevation-soft); padding: var(--space-4) var(--space-5); min-height: 360px; }
.pl-words { display: grid; gap: var(--space-2); align-content: center; }
.pl-words p { margin: 0; font-size: 18px; line-height: 1.5; }
.pl-count { font-size: 13px !important; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.pl-words h3 { margin: 0; font-family: var(--font-display); font-size: 24px; line-height: 1.2; }
.pl-words h3:focus { outline: none; }
.pl-formula { background: var(--cream); border: 1px solid var(--line); border-left: 5px solid var(--blue-dark); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-weight: 700; font-size: 17px !important; }
.pl-tip { background: var(--cream); border-left: 5px solid var(--coral-strong); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: 16px !important; }
.pl-picture { display: grid; place-items: center; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3); min-width: 0; }
.pl-picture svg.mv { width: 100%; max-height: 330px; }
.pl-picture .mv-table { font-size: 16px; }
.pl-nav { display: flex; align-items: center; gap: var(--space-3); }
.pl-btn { min-height: var(--target-min); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 2px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.pl-btn:disabled { opacity: .45; cursor: default; }
.pl-btn:focus-visible, .pl-skip:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.pl-primary { background: var(--blue-strong); border-color: var(--blue-strong); color: var(--paper); box-shadow: var(--elevation-button-soft); }
.pl-dots { flex: 1 1 auto; display: flex; justify-content: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pl-dots li { width: 10px; height: 10px; border-radius: var(--radius-round); background: var(--line); }
.pl-dots li.is-example { background: var(--alkaline); }
.pl-dots li.is-on { background: var(--blue-dark); transform: scale(1.3); }
.pl-end { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
@media (max-height: 760px) and (min-width: 861px) {
  .pl-card { min-height: 0; padding: var(--space-3) var(--space-4); }
  .pl-words p { font-size: 17px; }
  .pl-picture svg.mv { max-height: 300px; }
  .pl-head h2 { font-size: 22px; }
  .pl-icon { width: 40px; height: 40px; font-size: 22px; }
}
@media (max-width: 860px) {
  .pl-card { grid-template-columns: 1fr; padding: var(--space-3); }
  .pl-head h2 { font-size: 21px; }
  .pl-skip { display: none; }
  .pl-nav { flex-wrap: wrap; }
  .pl-end { width: 100%; justify-content: stretch; }
  .pl-end .pl-btn { flex: 1 1 auto; }
}

/* K-3 topics (topic.young): larger prompt and choice type, targets of at least 56px. */
.mp-young .mp-prompt { font-size: 25px; line-height: 1.4; }
.mp-young .mp-choice { min-height: 64px; font-size: 23px; }
.mp-young .mp-letter { width: 34px; height: 34px; font-size: 17px; }
.mp-young .mp-input { min-height: 60px; font-size: 26px; }
.mp-young .mp-button, .mp-young .mp-toolbar .scratchpad-launch { min-height: 56px; font-size: 19px; }
.mp-young .mp-step-nav .mp-button, .mp-young .mp-step-actions .mp-button { min-height: 56px; }
.mp-young .mp-crumbs .mp-button { min-height: var(--target-min); font-size: var(--text-small); }
.mp-young .mp-strike { width: 44px; height: 44px; font-size: 17px; }
.mp-young .mp-choice { padding-right: calc(var(--space-7) + var(--space-2)); }
.mp-young .mp-step-say { font-size: 20px; }
.mp-young .mp-verdict { font-size: 21px; }
.mp-young .mp-why-wrong { font-size: 19px; }
@media (max-height: 800px) and (min-width: 861px) {
  .mp-young .mp-prompt { font-size: 23px; }
  .mp-young .mp-choice { min-height: 58px; font-size: 21px; }
  .mp-young .mp-step-say { font-size: 19px; }
}
@media (max-width: 560px) {
  .mp-young .mp-prompt { font-size: 22px; }
  .mp-young .mp-choice { min-height: 58px; font-size: 21px; }
}

/* Pro buttons for a free learner: the library's 🔒 Pro chip, as a button to the plans. */
.mp-pro { display: inline-flex; align-items: center; gap: var(--space-2); background: var(--paper); border-color: var(--yellow); color: var(--ink); }
.mp-pro:hover { background: var(--cream); }
.mp-pro-chip { border-radius: var(--radius-sm); background: var(--yellow); padding: 0 var(--space-2); font-size: var(--text-small); font-weight: 700; color: var(--ink); white-space: nowrap; }
.mp-section .mp-pro-compact { padding: var(--space-1) var(--space-2); }
.mp-pro-cta { background: var(--yellow); border-color: var(--yellow); }
.mp-pro-cta:hover { background: var(--yellow); border-color: var(--ink); }
/* Short desktop screens: a long table in a teaching step keeps its rows compact, so the
   verdict, the misconception line and the step controls still fit beside it. */
@media (max-height: 800px) and (min-width: 861px) {
  .mp-step-visual .mv-table th, .mp-step-visual .mv-table td { padding-top: 2px; padding-bottom: 2px; font-size: 15px; }
  .mp-why-wrong { font-size: 16px; line-height: 1.35; }
}

/* Quiz setup on the hub: how many questions, and an optional real-test timer (quiz-setup.js). */
.mp-setup { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-2); }
.mp-select-inline { flex-direction: row; align-items: center; gap: var(--space-2); }
.mp-select-inline select { width: auto; padding-right: var(--space-2); }
.mp-select-inline.mp-scope select { flex: 1; min-width: 0; }
/* "Practice" and "Questions" start the two rows; one label width lines their menus up. */
.mp-scope .mp-select-label, .mp-setup > :first-child .mp-select-label { min-width: 5.4em; }
.mp-hub-grid .mp-setup + .mp-actions { margin-top: var(--space-3); }
.mp-timer-note { color: var(--ink); }
/* The countdown in a timed quiz's top bar. It stops (and says so) while feedback is on screen. */
.mp-clock { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--cream); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-clock-time { font-size: 16px; }
.mp-clock-state { font-weight: 400; color: var(--muted); }
.mp-clock.is-low { border-color: var(--coral-strong); color: var(--coral-text); }
.mp-time-line { margin: 0; font-weight: 700; color: var(--ink); }
.mp-time-line.is-up { color: var(--coral-text); }

/* Read to me (read-aloud.js): young topics read questions and steps aloud. */
.mp-step-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.mp-play-btn { white-space: nowrap; }
.mp-read { white-space: nowrap; }
.mp-read[aria-pressed="true"] { border-color: var(--blue-strong); }

/* Picture answers: a choice built with pic(art, label) shows a big picture over its word. */
.mp-choices-pics .mp-choice { flex-direction: column; justify-content: center; gap: var(--space-1); min-height: 132px; text-align: center; padding: var(--space-2) var(--space-7) var(--space-2) var(--space-3); }
.mp-choices-pics .mp-letter { position: absolute; top: var(--space-2); left: var(--space-2); }
.mp-choices-pics .mp-choice-text { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.mp-pic { display: block; font-size: 52px; line-height: 1.1; }
.mp-pic svg, .mp-pic img { display: block; width: 76px; height: 76px; }
.mp-pic-label { font-weight: 600; }
/* In a verdict ("The answer is …") or an honors part list, a picture answer sits inline with its word. */
.mp-verdict .mp-pic, .mp-parts .mp-pic, .mp-recap .mp-pic { display: inline-block; font-size: 1.25em; line-height: 1; vertical-align: -0.2em; margin: 0 .12em; }
.mp-verdict .mp-pic svg, .mp-verdict .mp-pic img, .mp-parts .mp-pic svg, .mp-parts .mp-pic img, .mp-recap .mp-pic svg, .mp-recap .mp-pic img { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: middle; }
@media (max-width: 480px) {
  .mp-choices-pics .mp-choice { min-height: 112px; }
  .mp-pic { font-size: 42px; }
  .mp-pic svg, .mp-pic img { width: 60px; height: 60px; }
}

/* Review the basics (basics.js): foundation pages opened from teaching, one idea per page. */
.mp-help-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; margin-top: var(--space-3); }
.mp-help-row .mp-button { min-height: 40px; font-size: 16px; padding: var(--space-1) var(--space-4); }
.mp-help-row .mp-basics-icon { width: 22px; height: 22px; vertical-align: middle; }
.mp-help-row .mp-link { padding-left: 0; padding-right: 0; }
.mp-young .mp-help-row .mp-button, .mp-young .mp-basics-head .mp-select select { min-height: 56px; }
.mp-basics { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.mp-basics-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.mp-basics-head .mp-select-inline { flex-direction: row; align-items: center; min-width: 0; max-width: 100%; }
.mp-basics-head .mp-select select { min-height: 40px; width: auto; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.mp-basics-title { margin: var(--space-1) 0 0; font-size: 22px; line-height: 1.35; font-weight: 700; font-family: var(--font-reading); }
.mp-basics-title:focus { outline: none; }
.mp-basics-say p { margin: var(--space-2) 0 0; font-size: 18px; line-height: 1.5; }
.mp-basics-say .mp-basics-formula { font-weight: 700; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-3); }
.mp-basics-say .mp-basics-tip { color: var(--muted); font-size: 16px; }
.mp-basics .mp-choices, .mp-basics .mp-input-row { margin-top: var(--space-3); }
.mp-basics-feedback { margin-top: var(--space-2); }
.mp-basics-feedback p { margin: var(--space-1) 0 0; }
.mp-basics .mp-step-nav .mp-step-actions { margin-left: var(--space-3); }
@media (max-height: 800px) and (min-width: 861px) {
  .mp-basics-say p { font-size: 17px; margin-top: var(--space-1); }
  .mp-basics .mp-step-visual svg.mv-compact { max-height: min(30vh, 200px); }
}
@media (max-width: 560px) {
  .mp-basics-title { font-size: 19px; }
  .mp-basics .mp-step-nav .mp-step-actions { margin-left: 0; width: 100%; }
  .mp-basics .mp-step-nav .mp-step-actions .mp-button { flex: 1 1 auto; }
}

/* Shared handwriting pad, used by practice in every subject. */
.scratchpad-launch { min-height: var(--target-min); }
.scratchpad-dialog { width: min(1100px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: var(--space-5); color: var(--ink); background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-lg); overscroll-behavior: contain; }
.scratchpad-dialog::backdrop { background: var(--ink); opacity: .65; }
.scratchpad-head { display: flex; align-items: start; gap: var(--space-3); justify-content: space-between; position: sticky; top: 0; z-index: 1; background: var(--cream); }
.scratchpad-head h2 { margin: 0; font-size: var(--text-heading); }
.scratchpad-head p, .scratchpad-help, .scratchpad-status { margin: var(--space-2) 0; font-size: var(--text-caption); color: var(--muted); }
.scratchpad-head .button { flex-shrink: 0; }
.scratchpad-question { padding: var(--space-3); margin: var(--space-3) 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); overflow-wrap: anywhere; }
.scratchpad-question svg { width: min(100%, 240px); }
.scratchpad-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.scratchpad-toolbar .button, .scratchpad-head .button { min-height: var(--target-min); padding: var(--space-2) var(--space-3); font-size: var(--text-caption); }
.scratchpad-toolbar [aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.scratchpad-touch { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); font-size: var(--text-caption); }
.scratchpad-touch input { width: var(--space-4); height: var(--space-4); margin: 0; accent-color: var(--blue-strong); }
.scratchpad-paper { display: block; width: min(100%, calc(42dvh * 1.53846154)); height: auto; margin-inline: auto; aspect-ratio: 1000 / 650; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.scratchpad-paper path { fill: none; stroke: var(--blue-strong); stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; }
.scratchpad-dialog:has(.scratchpad-typed[open]) .scratchpad-paper { display: none; }
.scratchpad-notes { display: grid; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--text-caption); font-weight: 700; }
.scratchpad-notes textarea { width: 100%; min-width: 0; min-height: 6rem; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: var(--paper); font: inherit; font-size: var(--text-body); resize: vertical; }
@media (max-width: 600px) { .scratchpad-dialog { padding: var(--space-3); } }

/* Hub section pages (a topic with more sections than one row holds), Resume, and the whole question. */
/* Keep the same text and targets on short laptops; remove spare space between regions. */
@media (max-height: 800px) and (min-width: 861px) {
  .mp-screen { gap: var(--space-2); }
  .mp-question { gap: var(--space-2); }
  .mp-steps { padding-top: var(--space-2); padding-bottom: var(--space-2); }
}
.mp-section-pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.mp-section-pager .mp-button { min-height: var(--target-min); }
.mp-section-page { margin: 0; color: var(--muted); font-size: var(--text-small); }
.mp-dots, .mp-section-row { flex-wrap: wrap; }
.mp-head .mp-resume { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: var(--space-1); }
.mp-head .mp-resume p { margin: 0; color: var(--ink); font-weight: 700; }
.mp-head .mp-resume .mp-button { min-height: var(--target-min); }
.mp-whole-parts { margin: var(--space-2) 0 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
.mp-whole-answer { margin: var(--space-2) 0 0; font-weight: 700; }
.mp-recap .mp-recap-btn { display: inline; padding: 0; border: 0; background: none; font: inherit; text-align: left; color: var(--muted); cursor: pointer; }
.mp-recap .mp-recap-more { color: var(--blue-dark); font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.mp-recap .mp-recap-btn:hover .mp-recap-more, .mp-recap .mp-recap-btn:focus-visible .mp-recap-more { text-decoration-thickness: 2px; }
.mp-recap .mp-recap-btn:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; border-radius: var(--radius-sm); }
.mv-cards-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.mv-cards-compare > div { min-width: 0; text-align: left; }
.mv-cards-compare > div > strong { font-size: 16px; line-height: 1.35; font-weight: 600; }
@media (max-width: 700px) { .mv-cards-compare { grid-template-columns: 1fr; } }

/* Young picture rows (emojiRow): HTML, so names keep body size and the row wraps on a phone (USE-001). */
.mv-emoji-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3) var(--space-5); margin: 0; padding: var(--space-2) 0; }
.mv-emoji-item { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); min-width: 96px; max-width: 160px; text-align: center; }
.mv-emoji { font-size: 48px; line-height: 1.1; }
.mv-emoji-name { font-weight: 700; font-size: 18px; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
@media (max-height: 800px) and (min-width: 861px) { .mv-emoji { font-size: 40px; } }
@media (max-width: 560px) { .mv-emoji-row { gap: var(--space-2) var(--space-3); } .mv-emoji-item { min-width: 84px; } .mv-emoji { font-size: 40px; } .mv-emoji-name { font-size: 17px; } }

/* Practice-only answer modes (answer-modes.js; shared contract section 7). */
.mp-mode { display: flex; flex-direction: column; gap: var(--space-2); }
.mp-mode-actions { display: flex; gap: var(--space-2); }
.mp-mode-key { color: var(--muted); font-size: var(--text-small); }
.mp-blanks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-2) var(--space-4); }
.mp-blank { display: flex; flex-direction: column; gap: var(--space-1); }
.mp-blank label { font-weight: 700; font-size: 17px; }
.mp-blank-field { display: flex; gap: var(--space-2); align-items: center; }
.mp-blank .mp-input { width: min(180px, 100%); min-height: 48px; font-size: 20px; }
.mp-blank.is-correct .mp-input { border-color: var(--state-correct-color); }
.mp-blank.is-wrong .mp-input { border-color: var(--state-incorrect-color); }
.mp-mode .mp-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.mp-mode .mp-order-item { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; border: 2px solid var(--line); border-radius: var(--radius-md); padding: var(--space-1) var(--space-2); background: var(--paper); font-size: 18px; }
.mp-mode .mp-order-item.is-correct { border-color: var(--state-correct-color); }
.mp-mode .mp-order-item.is-wrong { border-color: var(--state-incorrect-color); }
.mp-mode .mp-order-pos { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-round); background: var(--cream); font-weight: 700; font-size: 15px; }
.mp-mode .mp-order-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mp-mode .mp-order-moves { display: flex; gap: var(--space-1); }
.mp-mode .mp-order-move { width: var(--target-min); height: var(--target-min); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.mp-mode .mp-order-move:disabled { opacity: .4; cursor: default; }
.mp-multi { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2); }
.mp-multi-legend { padding: 0; margin: 0 0 var(--space-1); font-weight: 700; font-size: var(--text-small); color: var(--blue-dark); }
.mp-multi-choice { display: flex; align-items: center; gap: var(--space-2); min-height: 52px; border: 2px solid var(--line); border-radius: var(--radius-md); padding: var(--space-1) var(--space-3); background: var(--paper); font-size: 18px; cursor: pointer; }
.mp-multi-choice input { width: 22px; height: 22px; flex: 0 0 auto; margin: 0; }
.mp-multi-choice:has(input:checked) { border-color: var(--blue); }
.mp-multi-choice.is-correct { border-color: var(--state-correct-color); }
.mp-multi-choice.is-wrong, .mp-multi-choice.is-missed { border-color: var(--state-incorrect-color); }
.mp-multi-choice.is-dim { opacity: .55; }
.mp-mode-tag { margin-left: auto; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.mp-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-2) var(--space-4); }
.mp-slot { display: flex; flex-direction: column; gap: var(--space-1); }
.mp-slot label { font-weight: 700; font-size: 17px; }
.mp-slot select { min-height: var(--target-min); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-3); font: inherit; font-size: 17px; background: var(--paper); color: var(--ink); }
.mp-slot.is-correct select { border-color: var(--state-correct-color); }
.mp-slot.is-wrong select { border-color: var(--state-incorrect-color); }
@media (max-height: 800px) and (min-width: 861px) {
  .mp-mode .mp-order-item, .mp-multi-choice { min-height: 44px; font-size: 17px; }
  .mp-mode .mp-order-move { width: 40px; height: 40px; }
}
.mp-young .mp-mode .mp-order-item, .mp-young .mp-multi-choice { font-size: 21px; min-height: 56px; }
.mp-young .mp-mode .mp-order-move { width: 52px; height: 52px; }
.mp-whole .mp-step-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }

/* ---------------------------------------------------------------- moving pictures (step-motion.js) */
@keyframes mv-draw-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mv-pop-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes mv-fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Rows settle down into place, so a rising row never pushes past the bottom of its box. */
@keyframes mv-rise-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.is-building .mv-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mv-draw-in .55s ease-out var(--mv-delay, 0ms) forwards; }
.is-building .mv-pop { transform-box: fill-box; transform-origin: center; animation: mv-pop-in .35s ease-out var(--mv-delay, 0ms) both; }
.is-building .mv-fade { animation: mv-fade-in .35s ease-out var(--mv-delay, 0ms) both; }
.is-building .mv-rise { animation: mv-rise-in .35s ease-out var(--mv-delay, 0ms) both; }
@media (prefers-reduced-motion: reduce) {
  .is-building .mv-draw, .is-building .mv-pop, .is-building .mv-fade, .is-building .mv-rise { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- playable pictures and the step player */
.mp-play { display: grid; gap: var(--space-1); width: 100%; max-width: 420px; justify-self: center; }
.mp-play label { display: flex; justify-content: space-between; gap: var(--space-2); font-weight: 700; }
.mp-play output { color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.mp-play input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--blue-dark); }
.mp-play-note { margin: 0; font-size: 15px; color: var(--ink-soft, inherit); min-height: 1.3em; }
.mp-step-head .mp-play-btn { margin-inline-start: auto; }
.mp-step-head .mp-play-btn + .mp-read { margin-inline-start: var(--space-1); }
.mp-step-visual-wrap { display: grid; gap: var(--space-2); align-content: center; min-width: 0; }
.mp-step-visual-wrap .mp-step-visual svg.mv, .mp-step-visual-wrap .mp-step-visual svg.g { max-height: min(25vh, 200px); }
.mp-play { gap: 2px; }
.mp-play input[type="range"] { min-height: 28px; margin: 0; }

/* Answer types (answer-types.js): expressions, ordering, points on a grid. */
.mp-expr-input { width: min(320px, 100%); font-family: inherit; }
.mp-task.mp-order { display: grid; gap: var(--space-2); }
.mp-task .mp-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.mp-task .mp-order-item { display: flex; align-items: center; gap: var(--space-2); min-height: 52px; padding: var(--space-1) var(--space-2); border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); }
.mp-task .mp-order-item.is-correct { border-color: var(--state-correct-color); background: var(--cream); }
.mp-task .mp-order-item.is-wrong { border-color: var(--state-incorrect-color); }
.mp-task .mp-order-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--line); }
.mp-task .mp-order-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mp-task .mp-order-moves { display: flex; gap: 4px; flex: none; }
.mp-task .mp-order-move { min-width: 44px; min-height: 44px; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); font: inherit; font-size: 20px; cursor: pointer; }
.mp-task .mp-order-move:disabled { opacity: .35; cursor: default; }
@media (hover: hover) { :where(:root:not([data-hover-rest])) .mp-task .mp-order-move:not(:disabled):hover { border-color: var(--blue); } }
.mp-task .mp-order-end { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-soft, inherit); }
.mp-task .mp-order-check { display: flex; gap: var(--space-2); }
.mp-point { display: grid; gap: var(--space-2); justify-items: start; }
.mp-point-pad { width: min(340px, 100%); height: auto; max-height: 46vh; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); touch-action: manipulation; }
.mp-point-pad[data-mp] { cursor: crosshair; }
.mp-point-pad:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.mp-point-read { margin: 0; }
.mp-point-pad { font-family: var(--font-reading); }
.mp-expr-label { font-size: 22px; font-weight: 600; }

/* Play and Read to me sit in the step head without making it taller than the step count,
   so the dense Math and English teaching pages still fit short laptops (1280×720). */
.mp-step-head .mp-play-btn, .mp-step-head .mp-read { min-height: 32px; padding-block: 0; margin-block: -8px; }
/* On short laptops the step head keeps one row: Play and Read to me show just their icons (their names stay in aria-label). */
@media (max-height: 800px) and (min-width: 861px) {
  .mp-step-head .mp-play-label, .mp-step-head .mp-read-label { display: none; }
}
/* Answer types on short laptops: tighter rows and a smaller grid so the question, the task and Check fit (1280×720, 1366×768). */
@media (max-height: 800px) and (min-width: 861px) {
  .mp-task.mp-order, .mp-task .mp-order-list { gap: var(--space-1); }
  .mp-task .mp-order-item { min-height: 40px; padding-block: 2px; font-size: 17px; }
  .mp-task .mp-order-move { min-width: 40px; min-height: 40px; font-size: 18px; }
  .mp-task .mp-order-end { font-size: 13px; }
  .mp-task .mp-hint { margin: 0; }
  .mp-point-pad { max-height: 32vh; }
}

/* Poems in reading passages keep their line breaks. */
.ev-poem .ev-text p { white-space: pre-line; }

/* Keep the current section's purpose and evidence visible beside its action. */
.mp-current-section { display: flex; align-items: stretch; gap: var(--space-3); }
.mp-current-section .mp-sections { flex: 1; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.mp-current-section .mp-section { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-3); }
.mp-section-copy { display: grid; gap: var(--space-1); min-width: 0; }
.mp-current-section .mp-section-row { flex: 0 0 auto; margin: 0; }
.mp-current-section .mp-section-pager { justify-content: center; max-width: 230px; align-content: center; }
.mp-current-section .mp-section-page { order: -1; flex-basis: 100%; text-align: center; }
.mp-section-progress { font-weight: 700; }
@media (max-width: 700px) {
  .mp-current-section { flex-direction: column; }
  .mp-current-section .mp-section { flex-direction: column; align-items: stretch; }
  .mp-current-section .mp-section-pager { max-width: none; }
  .mp-current-section .mp-section-page { order: 0; flex-basis: auto; }
}
