/* Chapter tests (js/core/mastery-course.js): one question per page, no verdict until
   submit, then results and a one-question-per-page answer review. Tokens only. */
.physics-test-page { height: auto; min-height: calc(100vh - 122px); overflow: visible; }
.physics-test-page:has(.mt-test), .physics-test-page:has(.mt-results) { align-content: start; }

.mt-test, .physics-test-page .mt-test { width: min(1060px, 100%); max-width: none; display: flex; flex-direction: column; gap: var(--space-2); }
.mt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.mt-top .text-button { padding: var(--space-1) 0; }
.mt-count { margin: 0; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.mt-count span { color: var(--ink); }
.mt-count strong { color: var(--ink); }

.mt-dots { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.mt-dot { min-width: 36px; height: 36px; padding: 0 var(--space-1); display: grid; place-items: center; border: 2px solid var(--line); border-radius: var(--radius-round); background: var(--paper); color: var(--muted); font: inherit; font-size: var(--text-small); font-weight: 700; cursor: pointer; }
.mt-dot.is-done { border-color: var(--blue); color: var(--blue-dark); background: var(--cream); }
.mt-dot.is-current { border-color: var(--blue-strong); background: var(--blue-strong); color: var(--paper); }
.mt-dot.is-right { border-color: var(--state-correct-color); color: var(--green-text); }
.mt-dot.is-wrong { border-color: var(--state-incorrect-color); color: var(--coral-text); }
.mt-dot.is-right.is-current { background: var(--state-correct-color); color: var(--paper); }
.mt-dot.is-wrong.is-current { background: var(--state-incorrect-color); color: var(--paper); }
.mt-dot:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }

.mt-card { display: grid; gap: var(--space-4); padding: var(--space-4) var(--space-5); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elevation-soft); }
.mt-card.has-visual { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.mt-card .mt-visual { min-width: 0; }
.mt-body { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.mt-prompt { margin: 0; font-family: var(--font-reading); font-size: 21px; line-height: 1.4; font-weight: 700; max-width: none; text-align: left; }
.mt-prompt:focus { outline: none; }
.mt-prompt-review { font-size: 18px; }
.mt-body .question-context { margin: 0; text-align: left; }

.mt-test .mastery-answer-grid { margin-top: 0; }
.mt-test .mastery-answer-grid.is-long { grid-template-columns: 1fr; }
.mt-test .mastery-answer { min-height: 52px; font-size: 18px; }
.mt-test .mastery-answer > .mt-choice-text { width: auto; height: auto; min-width: 0; display: block; background: none; border: 0; border-radius: 0; color: inherit; font-weight: 400; text-transform: none; }
.mt-test .mastery-answer:hover { transform: none; }
.mt-test .mastery-answer.is-selected { border-color: var(--blue-strong); background: var(--cream); box-shadow: var(--elevation-soft); }
.mt-test .mastery-answer.is-selected > span:first-child { background: var(--blue-strong); border-color: var(--blue-strong); color: var(--paper); }
.mt-test .mastery-answer:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.mt-test .mp-hint { margin: 0; }
.mt-notice { min-height: 0; margin: 0; color: var(--coral-text); font-weight: 700; font-size: var(--text-small); }
.mt-notice:empty { display: none; }

.mt-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); border: 2px solid var(--coral-strong); border-radius: var(--radius-md); background: var(--paper); }
.mt-confirm p { margin: 0; }
.mt-confirm-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.mt-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.mt-nav .button { min-width: 130px; min-height: var(--target-min); }
.mt-answered { margin: 0; color: var(--muted); font-size: var(--text-small); text-align: center; }
.mt-ready { margin: 0; text-align: right; }

.chapter-lesson-icon .section-icon { width: 64px; height: 64px; max-width: 100%; max-height: 100%; }

/* Results: wide enough that up to ten missed skills and every action fit one screen at 1280×720. */
.mt-results, .physics-test-page .mt-results { width: min(940px, 100%); max-width: none; padding: var(--space-4) var(--space-5); }
.mt-results .section-kicker { margin-bottom: var(--space-1); }
.mt-results h2 { margin-bottom: var(--space-2); font-size: clamp(28px, 3.4vw, 38px); }
.mt-results h2:focus { outline: none; }
.mt-results .result-score { width: auto; min-width: 220px; margin: 0 auto var(--space-2); padding: var(--space-2) var(--space-5); justify-items: center; }
.mt-results .result-score strong { font-size: 32px; }
.mt-results .result-score span { font-size: var(--text-small); }
.mt-results > p.mt-lead { margin: 0 auto var(--space-3); max-width: 640px; color: var(--muted); }
.mt-missed { margin: 0 auto var(--space-3); max-width: 860px; }
.mt-missed p { margin: 0 0 var(--space-2); font-weight: 700; }
.mt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1) var(--space-2); margin: 0; padding: 0; list-style: none; }
.mt-chips li { padding: 2px var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); font-size: var(--text-small); }
.mt-actions { flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.mt-actions .button { padding-inline: var(--space-4); }

/* Review */
.mt-verdict { display: grid; gap: var(--space-2); margin: 0; }
.mt-verdict div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.mt-verdict dt { color: var(--muted); font-weight: 700; font-size: var(--text-small); }
.mt-verdict dd { margin: 0; font-size: 18px; font-weight: 700; }
.mt-verdict.is-right dd b { color: var(--green-text); }
.mt-verdict.is-wrong div:first-child dd { color: var(--coral-text); }
.mt-verdict.is-wrong div:first-child dd em { color: var(--muted); }
.mt-why-yours { margin: 0; padding: var(--space-2) var(--space-3); border-left: 4px solid var(--coral-strong); background: var(--cream); border-radius: var(--radius-sm); }
.mt-explain { margin: 0; line-height: 1.45; }
.mt-skill { margin: 0; color: var(--muted); font-size: var(--text-small); }

@media (max-width: 760px) {
  .mt-card { padding: var(--space-3); }
  .mt-card.has-visual { grid-template-columns: 1fr; }
  .mt-prompt { font-size: 19px; }
  .mt-test .mastery-answer-grid { grid-template-columns: 1fr; }
  .mt-test .mastery-answer { min-height: 48px; }
  .mt-nav .button { min-width: 0; }
  .mt-answered { display: none; }
  .mt-verdict div { grid-template-columns: 1fr; gap: 0; }
  .mt-results { padding: var(--space-4) var(--space-3); }
  .mt-results .result-actions { flex-direction: column; align-items: stretch; }
}
