.competition-entry {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--print-wash);
  border: 1px solid var(--hair);
  border-radius: 0.3rem;
}

.competition-entry h3 { margin: 0.15rem 0 0; font-family: var(--f-display); font-size: 1.2rem; }
.competition-entry p:last-child { margin: 0.35rem 0 0; color: var(--ink-2); line-height: 1.5; }
.eyebrow-inline, .amc-kicker {
  margin: 0;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.81rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--print);
}

.amc-exam-list { list-style: none; margin: 0; padding: 0; }
.amc-exam-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 1rem 2rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hair);
}
.amc-exam-list > li:first-child { border-top: 1px solid var(--hair); }
.amc-exam-list h3 { margin: 0.2rem 0 0; font-family: var(--f-display); font-size: 1.35rem; }
/* A paper description runs three or four lines and left one word alone on
   the last one at three of the five widths checked. Rewording chases the
   widow from one width to the next; `pretty` is the browser doing it at
   every width, which is what this property is for. Headings keep
   `balance`, where the shape of two or three lines is the point. */
.amc-exam-list p { max-width: 60ch; margin: 0.45rem 0 0; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.amc-exam-list .amc-status { font-family: var(--f-print); font-size: 0.87rem; color: var(--print); }

/* Its own selector, so the phone rule below (one column) still wins: folded
   into the main rule, its higher specificity kept two columns at 390. */
.page > .amc-layout { grid-column: 1 / -1; }

.amc-layout {
  grid-column: 1 / -1;
  display: grid;
  /* The question map is what this page's margin holds: the same track and
   * gap as the page's own margin column, so the paper lines up with every
   * other page's body column. */
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  column-gap: clamp(1rem, 2.5vw, 2rem);
  row-gap: 1.25rem;
  align-items: start;
}

.amc-question-map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
.amc-question-map form { margin: 0; }
.amc-number {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  color: var(--ink-3);
  background: var(--leaf);
  border: 1px solid var(--hair-hard);
  border-radius: 50%;
}
.amc-number.answered { color: var(--on-action); background: var(--action); border-color: var(--action); }
.amc-number.helped:not(.answered) { background: var(--print-wash); border-style: dashed; }
.amc-number.current { outline: 3px solid var(--print); outline-offset: 2px; }

.amc-paper {
  min-width: 0;
  padding: clamp(1.15rem, 4vw, 2.2rem);
  background: var(--leaf);
  border: 1px solid var(--hair-hard);
  border-radius: 0.3rem;
  box-shadow: var(--shadow);
}
.amc-problem-head { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--hair); font-family: var(--f-print); font-size: 0.83rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--print); }
.amc-stem { margin: 1.4rem 0; font-family: var(--f-display); font-size: clamp(1.2rem, 1rem + 0.7vw, 1.55rem); line-height: 1.55; text-wrap: pretty; }
.amc-answer fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
/* ⚠ Buttons that sit together share one width (global.md). "Check answer" was
   145px beside "I need a hint" at 115px, and `buttoncheck` FAILs a group whose
   widths differ by more than 2px. Equal grid columns sized to the widest
   label, not stretched across the panel, so a long label never decides how
   wide its own button is. The pager's children are `button_to` forms, so the
   button inside each one has to fill its column. */
.amc-actions, .amc-pager {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  justify-content: start;
  width: fit-content;
  max-width: 100%;
  gap: 0.75rem;
  align-items: center;
}
.amc-actions form, .amc-pager form { margin: 0; }
.amc-actions > *, .amc-pager > *, .amc-pager form > button { width: 100%; }

/* Below this the two labels no longer fit on one line together. */
@media (max-width: 26rem) {
  .amc-actions, .amc-pager { grid-auto-flow: row; grid-auto-columns: auto; width: 100%; }
}
.amc-pager { justify-content: space-between; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--hair); }
.amc-result, .amc-hint, .amc-walkthrough { margin: 1.25rem 0; padding: 1rem 1.1rem; border: 1px solid var(--hair); border-radius: 0.3rem; background: var(--print-wash); }
.amc-result.correct { border-color: color-mix(in srgb, var(--correct) 45%, var(--hair)); }
.amc-result.missed { border-color: color-mix(in srgb, var(--pencil) 45%, var(--hair)); }
.amc-result p, .amc-hint p { margin: 0; line-height: 1.55; }
.amc-result p + p { margin-top: 0.35rem; }
.amc-verdict { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; }
.amc-walkthrough h2 { margin: 0.2rem 0 0.7rem; font-family: var(--f-display); }
.amc-walkthrough ol { margin: 0; padding-left: 1.3rem; }
.amc-walkthrough li { padding-left: 0.3rem; line-height: 1.6; }
.amc-walkthrough li + li { margin-top: 0.45rem; }
.amc-takeaway { margin: 1rem 0 0; line-height: 1.55; }

@media (max-width: 56rem) {
  .amc-layout { grid-template-columns: minmax(0, 1fr); }
  .amc-question-map { grid-template-columns: repeat(10, 1fr); }
}
@media (max-width: 36rem) {
  .amc-exam-list > li { grid-template-columns: minmax(0, 1fr); }
  .amc-exam-list .check-link { width: 100%; box-sizing: border-box; }
  .amc-question-map { grid-template-columns: repeat(5, 1fr); }
  .amc-problem-head { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
}

/* A stem and a walkthrough step are short, different on every problem, and
   `pretty` still left "receive?" and "notebooks." alone at 390 (wrapcheck):
   balanced lines put two words or more on each. */
.amc-stem, .amc-walkthrough li { text-wrap: balance; }
.amc-takeaway, .amc-walkthrough p { text-wrap: pretty; }

/* NC Check-In items: a typed number, and select-all boxes. */
.amc-numeric { display: block; width: min(16rem, 100%); margin: 0.4rem 0 1.5rem; padding: 0.7rem 0.9rem; font: inherit; font-size: 1.2rem; background: var(--leaf); border: 1px solid var(--hair-hard); border-radius: 0.3rem; }
.options input[type="checkbox"] { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.2rem 0 0; accent-color: var(--print, currentColor); }
