.exam-page {
  --exam-ink: #14382e;
  --exam-muted: #4f6259;
  --exam-line: #cfd9ce;
  --exam-paper: #faf8f1;
  --exam-green: #19483a;
  max-width: 1150px;
  padding-bottom: 4.5rem;
  color: var(--exam-ink);
}
.exam-heading {
  margin: 1.8rem 0 2rem;
  padding: clamp(1.45rem, 5vw, 3.75rem);
  background: var(--exam-green);
  color: #fffdf2;
  border-bottom: 4px solid #bd9d57;
}
.exam-heading .eyebrow { color: #f3dca1; }
.exam-heading h1 { max-width: 17ch; font-size: clamp(2.05rem, 5vw, 4rem); line-height: 1.12; margin: .55rem 0 1rem; }
.exam-heading p:last-child { max-width: 62ch; font-size: 1.04rem; color: #f2f2e5; }

.exam-page h2 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; margin: 0 0 .6rem; }
.exam-page h3 { font-size: 1.18rem; line-height: 1.45; margin: 0 0 .35rem; }
.exam-page p { line-height: 1.65; }
.exam-muted { color: var(--exam-muted); font-size: .9rem; }
.exam-error, .exam-storage { color: #8a2d18; }
.exam-kicker { margin: 0 0 .45rem; font-size: .88rem; font-weight: 700; color: var(--exam-muted); }
.exam-home-tools, .exam-card, .exam-mode, .exam-topic, .exam-result-row, .exam-palette {
  border: 1px solid var(--exam-line);
  background: #fffdf8;
  border-radius: 10px;
  min-width: 0;
}
.exam-home-tools, .exam-card, .exam-mode, .exam-result-row, .exam-palette { padding: clamp(1rem, 3vw, 1.65rem); }
.exam-home-tools { display: flex; gap: .65rem 1rem; align-items: center; flex-wrap: wrap; background: var(--exam-paper); }
.exam-home-tools h2 { flex-basis: 100%; }
.exam-home-tools label, .exam-prepare label { font-weight: 700; }
.exam-page select, .exam-page input:not([type="radio"]) {
  font: inherit;
  padding: .55rem .8rem;
  min-height: 46px;
  border: 1px solid #8ea094;
  color: var(--exam-ink);
  background: #fff;
  border-radius: 5px;
  max-width: 100%;
}
.exam-prepare input { display: block; width: min(100%, 510px); margin: .4rem 0; }
.exam-modes, .exam-topics, .exam-summary { display: grid; gap: 1rem; }
.exam-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1.1rem 0; }
.exam-mode { display: flex; flex-direction: column; align-items: flex-start; }
.exam-mode p { flex: 1; }
.exam-mode-primary { background: #edf3e9; border-color: #aabfa9; }
.exam-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: 1rem 0; }
.exam-button, .exam-topic, .exam-number {
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  color: var(--exam-ink);
  font-weight: 700;
  min-height: 44px;
}
.exam-button {
  border-radius: 5px;
  padding: .65rem 1rem;
  border: 1px solid var(--exam-green);
  text-align: left;
}
.exam-primary { background: var(--exam-green); color: #fff; }
.exam-primary:hover { background: #10382c; }
.exam-secondary { background: #fffdf7; }
.exam-secondary:hover { background: #eaf0e6; }
.exam-button:disabled { cursor: default; opacity: .52; }
.exam-page :where(button, a, summary, input, select, [tabindex]):focus-visible,
.exam-option:focus-within { outline: 3px solid #aa7620; outline-offset: 3px; }
.exam-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.exam-topic { padding: 1.05rem; text-align: left; display: grid; gap: .35rem; }
.exam-topic:hover { background: #edf3e9; }
.exam-topic span { color: var(--exam-muted); font-size: .86rem; }
.exam-questions { border: 0; padding: 0; margin: 0 0 1rem; min-inline-size: 0; }
.exam-questions legend { padding: 0; margin-bottom: 1rem; font-weight: 720; line-height: 1.5; font-size: clamp(1.04rem, 2vw, 1.3rem); }
.exam-option {
  display: grid;
  grid-template-columns: 1rem 1.75rem minmax(0, 1fr);
  align-items: baseline;
  gap: .45rem;
  cursor: pointer;
  padding: .7rem .85rem;
  min-height: 46px;
  border: 1px solid var(--exam-line);
  border-radius: 6px;
  margin: 0 0 .5rem;
  background: #fff;
  overflow-wrap: anywhere;
}
.exam-option:has(input:checked), .exam-option.exam-answer-correct { background: #eaf2e8; border-color: #67907b; }
.exam-option input { accent-color: var(--exam-green); margin: 0; }
.exam-letter { font-weight: 800; }
.exam-feedback { border-left: 4px solid #628570; padding: 1rem; margin: 1rem 0; background: #edf3e9; }
.exam-study { container-type: inline-size; }
.exam-study .exam-study-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: 0 0 .75rem;
}
.exam-study-context strong {
  color: var(--exam-ink);
  background: #eaf0e6;
  border-radius: 5px;
  padding: .22rem .65rem;
  white-space: nowrap;
}
.exam-study .exam-study-card {
  padding: clamp(1rem, 3.2vw, 2rem);
  border-top: 4px solid #bd9d57;
  box-shadow: 0 .6rem 1.6rem rgba(20, 56, 46, .07);
}
.exam-study .exam-questions { margin-bottom: .8rem; }
.exam-study .exam-option-grid { display: grid; gap: .6rem; }
.exam-study .exam-option { margin: 0; min-height: 3.35rem; align-items: center; }
.exam-study-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin-block: .9rem;
}
.exam-study-steps .exam-button { text-align: center; }
.exam-study-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  border-top: 1px solid var(--exam-line);
  padding-top: .8rem;
}
.exam-study-review .exam-actions, .exam-study-review .exam-muted { margin: 0; }
.exam-study :where(legend, h3)[tabindex] { scroll-margin-top: 8rem; }
@container (min-width: 42rem) {
  .exam-study .exam-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 30rem) {
  .exam-study-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-study-steps .exam-primary { grid-column: 1 / -1; }
}
.exam-presenter {
  background: var(--exam-green); color: #fffdf2; padding: 1rem; margin-top: 1rem; border-radius: 6px;
  display: flex; align-items: center; gap: .9rem;
}
.exam-presenter img { width: 74px; height: 74px; flex: 0 0 74px; object-fit: cover; object-position: top; border-radius: 50%; }
.exam-presenter p { margin: 0; color: #e0e9df; font-size: .88rem; }
.exam-session { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 0 0 .8rem; }
.exam-session p, .exam-session h2 { margin: 0; overflow-wrap: anywhere; }
.exam-time { text-align: right; }
.exam-time span { display: block; color: var(--exam-muted); font-size: .82rem; white-space: nowrap; }
.exam-time strong { display: block; font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.exam-palette summary, .exam-result-row summary { cursor: pointer; font-weight: 700; padding: .36rem 0; }
.exam-palette summary span { font-weight: 400; color: var(--exam-muted); margin-left: .38rem; }
.exam-palette nav { margin: .7rem 0 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .33rem; max-width: 35rem; }
.exam-number { background: #fff; border: 1px solid #8a9b8c; border-radius: 5px; padding: .25rem; }
.exam-number.answered { background: #d3ead7; }
.exam-number.marked { border: 2px solid #a16905; }
.exam-number[aria-current="step"] { box-shadow: inset 0 0 0 2px #254f40; }
.exam-number span { color: #785100; padding-left: .08rem; }
.exam-summary { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; background: #edf3e9; }
.exam-summary ul { padding: 0; margin: 0; list-style: none; }
.exam-summary li { display: flex; gap: 1rem; justify-content: space-between; border-bottom: 1px solid var(--exam-line); padding: .45rem 0; }
.exam-score { font-size: 3rem; font-weight: 750; line-height: 1.25 !important; margin: .55rem 0 0; }
.exam-score span { font-size: 1.1rem; color: var(--exam-muted); padding-left: .3rem; }
.exam-review-list { display: grid; gap: .75rem; margin: .7rem 0 2rem; }
.exam-result-row { border-left-width: 4px; }
.exam-result-row h3 span { color: var(--exam-muted); font-size: .82rem; margin-left: .3rem; }
.exam-wrong { border-left-color: #9e402c; background: #fcf1eb; }
.exam-wrong h3 span { color: #872c19; }
.exam-blank { border-left-color: #aa7a1c; background: #f9f4e6; }
.exam-correct { border-left-color: #478069; }
.exam-result-options { padding-left: 1.45rem; }
.exam-result-options li { padding-bottom: .35rem; }
.exam-result-options .correct { font-weight: 750; color: #19483a; }
.exam-sources { border-top: 1px solid var(--exam-line); margin-top: 2rem; padding-top: 1.2rem; }
.exam-sources a { text-decoration: underline; text-underline-offset: .18em; }
.exam-page [hidden] { display: none; }

@media (max-width: 700px) {
  .exam-modes, .exam-summary { grid-template-columns: 1fr; }
  .exam-palette nav { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .exam-topics { grid-template-columns: 1fr; }
  .exam-palette nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .exam-home-tools h2, .exam-home-tools select { width: 100%; }
}
