/* ============================================================
   PRACTICE — MONEY IN types (js/practice-types-money.js)
   worked / sortmatch / grid. The shared chrome (.pr-card, .pr-opt,
   .pr-input, .pr-zone, .pr-chip …) is in practice.css; only what
   these three types add is here, prefixed by type so nothing collides.
   Mobile first: everything below is one column until it can afford
   more, and the 2x2 grid is the only thing that ever sits side by side.
   ============================================================ */

/* ---- worked: case panel + numbered steps ---- */
.pr-worked-part { margin: 0 0 10px; }

.pr-worked-case { background: #f8fafc; padding: 14px 16px; margin-bottom: 14px; }
.pr-worked-case-t { margin: 0 0 4px; font-family: "Montserrat", sans-serif; font-size: 15px; }
.pr-worked-case-table { margin: 4px 0 0; }
.pr-worked-case-table td { padding: 6px 6px 6px 0; }
.pr-worked-case-table td:first-child { color: var(--muted); width: 42%; }
.pr-worked-case-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.pr-worked-case-facts { margin: 6px 0 0; padding-left: 18px; font-size: 14.5px; }
.pr-worked-case-facts li { margin: 2px 0; }

.pr-worked-steps { display: grid; gap: 12px; }
.pr-worked-step.is-answered.is-right { border-color: #a7f3d0; }
.pr-worked-step.is-answered.is-wrong { border-color: #fecaca; }

.pr-worked-ans { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pr-worked-ans .pr-input { flex: 1 1 120px; max-width: 180px; font-variant-numeric: tabular-nums; }
.pr-worked-unit { font-weight: 700; color: var(--ink-2); font-size: 16px; }
.pr-worked-suffix { font-size: 14px; color: var(--muted); }
.pr-worked-step .pr-check { display: block; margin: 0 0 8px; }
.pr-worked-step .pr-why { margin-bottom: 12px; }

/* ---- sortmatch: chips into zones ---- */
.pr-sortmatch-help { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.pr-sortmatch-tray { margin-bottom: 12px; min-height: 44px; }
.pr-sortmatch-tray .pr-chip {
  flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; max-width: 100%;
}
.pr-sortmatch-t { font-weight: 600; }
.pr-sortmatch-d { font-size: 12.5px; color: var(--muted); }
.pr-sortmatch-fb { margin-bottom: 12px; }
.pr-sortmatch .pr-next { margin-bottom: 4px; }

/* The zone's whole heading is the button, so it is reachable by Tab
   and reads its purpose ("Put X under Y") to a screen reader. */
.pr-sortmatch-zone-btn {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: none; border: 0; padding: 0 0 8px; cursor: pointer; border-radius: 8px;
}
.pr-sortmatch-zone-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.pr-sortmatch-zone-d { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.pr-zone.is-armed .pr-sortmatch-zone-btn .pr-zone-t { color: var(--primary); }
.pr-sortmatch-placed .pr-chip { cursor: default; font-size: 13.5px; }
.pr-sortmatch-placed .pr-chip-n { font-size: 12px; }

/* ---- grid: sortmatch as a 2x2 with axes ---- */
.pr-grid-wrap { margin: 12px 0; }
.pr-grid-axis-y {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}
.pr-grid { display: grid; gap: 8px; align-items: stretch; }
.pr-grid-corner {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); align-self: end; max-width: 90px;
}
.pr-grid-col {
  font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 14px;
  text-align: center; align-self: end; padding-bottom: 4px;
}
.pr-grid-row {
  font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 14px;
  max-width: 90px; align-self: center;
}
.pr-grid .pr-zone { min-height: 110px; padding: 10px; }
.pr-grid .pr-zone-t { font-size: 13px; }

@media (max-width: 480px) {
  .pr-grid { gap: 6px; }
  .pr-grid-corner, .pr-grid-row { max-width: 64px; font-size: 12.5px; }
  .pr-grid .pr-zone { padding: 8px 6px; min-height: 96px; }
  .pr-grid .pr-zone-t { font-size: 12px; }
  .pr-sortmatch-placed .pr-chip { font-size: 12.5px; padding: 6px 8px; }
  .pr-worked-case-table td:first-child { width: 48%; }
}
