/* Exam-only surfaces: restrained geometry, readable questions, explicit states. */
.exams-page { --exam-color: #ead06b; width: 100%; max-width: 1220px; padding-top: 42px; }
.exams-page [hidden] { display: none !important; }
.exam-tone-yellow { --exam-color: #f3d163; --exam-dark: #725900; }
.exam-tone-red { --exam-color: #ff8b7e; --exam-dark: #ab3028; }
.exam-tone-purple { --exam-color: #c2a1ff; --exam-dark: #7140af; }
.exam-page-header { max-width: 730px; margin-bottom: 30px; }
.exam-kicker { font-size: .8125rem; font-weight: 720; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.exam-page-header > p:last-child, .exam-session-description { margin-top: 16px; color: var(--muted); font-size: 1.0625rem; line-height: 1.65; }
.exam-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.exam-card { background: #151720; color: #f0f1f6; border: 1px solid #343743; border-top: 3px solid var(--exam-color); border-radius: 10px; overflow: hidden; min-width: 0; }
.exam-card-art { position: relative; background: #11131b; padding-top: 25px; border-bottom: 1px solid #2c2e3a; color: var(--exam-color); }
.exam-card-number { display: block; margin: 0 24px; font: 650 .75rem/1.4 var(--sans); letter-spacing: .11em; }
.exam-glyph { display: block; width: 100%; height: auto; max-height: 190px; margin: 3px auto 0; }
.exam-threat { display: flex; gap: 5px; position: absolute; right: 22px; top: 27px; }
.exam-threat span { width: 14px; height: 4px; background: #36333d; transform: skewX(-25deg); }
.exam-threat .is-lit { background: var(--exam-color); }
.exam-card-body { padding: 26px 24px 24px; }
.exam-card h2 { color: var(--exam-color); font-size: 1.75rem; font-weight: 740; }
.exam-description { font-size: 1rem; line-height: 1.65; color: #d3d4df; margin-top: 12px; }
.exam-count { color: #b6b9c8; font-size: .875rem; margin-top: 18px; }
.exam-card-stats { padding: 19px 0; margin-top: 21px; border-top: 1px solid #3b3e4b; min-height: 90px; }
.exam-card-stats p:not(.exam-no-history) { display: grid; grid-template-columns: 1fr auto auto; gap: 15px; align-items: baseline; font-size: .875rem; font-variant-numeric: tabular-nums; }
.exam-card-stats p + p { margin-top: 7px; }
.exam-card-stats p > span:first-child { color: #babdcb; }
.exam-card-stats strong { color: #f2f2f6; font-size: 1rem; }
.exam-no-history { color: #b6b9c8; font-size: .875rem; line-height: 1.65; }
.exam-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; padding: 12px 19px; min-height: 46px; background: #192d3a; color: #fff; font: 650 .9375rem/1.5 var(--sans); text-decoration: none; cursor: pointer; text-align: center; }
.exam-button:hover { background: #304959; }
.exam-button-secondary { background: #fff; color: var(--ink); border-color: #bac6cc; }
.exam-button-secondary:hover { background: #edf2f4; }
.exam-card-body > .exam-button { width: 100%; color: #17141f; background: var(--exam-color); font-weight: 740; }
.exam-card-body > .exam-button:hover { filter: brightness(1.09); }
.exams-page :focus-visible { outline: 3px solid #0878b5; outline-offset: 4px; }
.exam-card :focus-visible { outline-color: #fff; }
.exam-active-note { font-size: .875rem; color: var(--exam-color); line-height: 1.6; margin-bottom: 15px; }
.exam-history { margin-top: 17px; font-size: .875rem; border-top: 1px solid #3b3e4b; padding-top: 12px; }
.exam-history summary { cursor: pointer; color: #d6d8e1; padding: 5px 0; }
.exam-history ul { list-style: none; padding: 0; margin: 12px 0 0; }
.exam-history li + li { margin-top: 8px; }
.exam-history .exam-button { width: 100%; background: #222531; color: #e5e6ef; border-color: #444957; font-size: .875rem; padding: 9px; min-height: 44px; }
.exam-history .exam-button:hover { background: #303542; }
.exam-guidance { margin-top: 25px; color: var(--muted); font-size: .9375rem; }
.exam-storage { padding-top: 16px; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.exam-reading { max-width: 840px; }
.exam-session-header { margin-bottom: 25px; }
.exam-session-header > .exam-button { margin-bottom: 30px; padding: 7px 0; min-height: 40px; border-color: transparent; background: transparent; font-weight: 600; }
.exam-session-header > .exam-button:hover { text-decoration: underline; }
.exam-session-identity { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 22px; align-items: start; }
.exam-session-identity > .exam-glyph { color: var(--exam-dark); margin-top: 23px; }
.exam-session-header .exam-kicker { color: var(--exam-dark); }
.exam-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; position: sticky; top: 84px; z-index: 4; background: #fff; border-top: 2px solid var(--exam-dark); border-bottom: 1px solid var(--line); padding: 15px 1px; font-size: .9375rem; }
.exam-answer-count { color: var(--ink); font-weight: 650; }
.exam-time { color: var(--muted); display: inline-flex; align-items: baseline; gap: 8px; }
.exam-clock { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; min-width: 5ch; }
.exam-session-note { margin: 17px 0 30px; color: var(--muted); font-size: .875rem; line-height: 1.65; }
.exam-question { padding: 0 0 34px; margin: 0 0 35px; min-width: 0; border: 0; border-bottom: 1px solid var(--line); scroll-margin-top: 162px; }
.exam-question legend { float: left; display: block; width: 100%; padding: 0; margin: 0 0 20px; }
.exam-question legend + * { clear: both; }
.exam-question-number { display: block; font: 720 .75rem/1.5 var(--sans); letter-spacing: .09em; color: var(--muted); margin-bottom: 12px; }
.exam-prompt { display: block; font: 1.2rem/1.7 var(--serif); letter-spacing: 0; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.exam-options { display: grid; gap: 11px; }
.exam-option { display: grid; grid-template-columns: 20px 21px minmax(0, 1fr); align-items: start; gap: 12px; padding: 16px 18px; border: 1px solid #c9d3d8; border-radius: 7px; font-size: 1rem; line-height: 1.65; cursor: pointer; background: #fff; }
.exam-option:hover { border-color: #758b98; background: #f7f9fa; }
.exam-option:has(input:checked) { border-color: #267884; background: #edf7f7; box-shadow: inset 3px 0 #267884; }
.exam-option:focus-within { outline: 3px solid #0878b5; outline-offset: 3px; }
.exam-option input { appearance: auto; width: 18px; height: 18px; padding: 0; margin: 4px 0 0; accent-color: #176b77; cursor: pointer; }
.exam-option-letter { font-size: .875rem; font-weight: 750; color: var(--muted); padding-top: 2px; }
.exam-option-text { white-space: pre-line; overflow-wrap: anywhere; }
.exam-unanswered .exam-question-number { color: #a33e12; }
.exam-unanswered .exam-options { border-left: 3px solid #b86531; padding-left: 12px; }
.exam-submit-area { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; padding: 5px 0 15px; }
.exam-submit-area p { color: var(--muted); font-size: .9375rem; }
.exam-confirm { margin: 20px 0; padding: 26px; background: #fff8e5; border: 1px solid #d2b56a; border-radius: 8px; }
.exam-confirm h2 { font-size: 1.25rem; }
.exam-confirm p { margin: 12px 0 20px; font-size: 1rem; }
.exam-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.exam-result-summary { display: flex; align-items: center; gap: 45px; padding: 27px 30px; margin-bottom: 24px; background: #151720; border-left: 4px solid var(--exam-color); border-radius: 7px; color: #f1f2f6; }
.exam-result-score { display: grid; gap: 2px; }
.exam-result-score strong { font-size: clamp(2.8rem, 6vw, 4rem); line-height: 1.2; font-weight: 720; letter-spacing: -.04em; color: var(--exam-color); }
.exam-result-score span { font-size: 1rem; color: #c8cbd6; }
.exam-result-summary dl { margin: 0; display: grid; gap: 9px; flex: 1; }
.exam-result-summary dl > div { display: flex; justify-content: space-between; gap: 24px; }
.exam-result-summary dt { color: #c8cbd6; font-size: .9375rem; }
.exam-result-summary dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.exam-review-title { font-size: 1.45rem; margin: 42px 0 28px; }
.exam-correction .exam-prompt { font-weight: 400; }
.exam-answer-status { display: inline-block; font-size: .875rem; font-weight: 650; color: #904218; background: #fff1e6; padding: 5px 10px; border-radius: 4px; margin-top: 18px; }
.exam-correction-correct .exam-answer-status { color: #185e48; background: #e9f5ee; }
.exam-explanations { margin-top: 20px; }
.exam-explanations > summary { font-size: .9375rem; font-weight: 650; color: var(--ink); cursor: pointer; padding: 10px 0; }
.exam-explanation { padding: 20px; background: #f5f7f8; border-left: 3px solid #a1acb4; margin-top: 13px; border-radius: 0 5px 5px 0; }
.exam-explanation-correct { background: #edf7f1; border-color: #287451; }
.exam-explanation-label { color: #435964; font-size: .8125rem; font-weight: 750; margin-bottom: 9px; }
.exam-explanation-correct .exam-explanation-label { color: #185e48; }
.exam-explanation-option { color: var(--ink); font-size: 1rem; font-weight: 600; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.exam-explanation-reason { border-top: 1px solid #d5dee1; padding-top: 13px; margin-top: 13px; font: 1.0625rem/1.75 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }
.exam-bottom-actions { padding: 0 0 10px; }
.exam-empty { margin-top: 20px; color: var(--muted); }
@media (max-width: 960px) {
  .exam-grid { gap: 16px; }
  .exam-card-body { padding: 23px 18px; }
  .exam-card-number { margin-left: 18px; }
  .exam-card h2 { font-size: 1.5rem; }
}
@media (max-width: 760px) {
  .exams-page { padding: 30px 20px 60px; }
  .exam-grid { grid-template-columns: 1fr; gap: 25px; max-width: 490px; margin-inline: auto; }
  .exam-card-art { padding-top: 22px; }
  .exam-glyph { max-height: 174px; }
  .exam-card-body { padding: 24px; }
  .exam-card h2 { font-size: 1.75rem; }
  .exam-card-stats { min-height: 0; }
  .exam-option { padding: 14px 13px; gap: 9px; }
  .exam-result-summary { gap: 25px; padding: 24px 20px; }
  .exam-result-summary dl > div { gap: 15px; }
}
@media (max-width: 680px) {
  .exam-session-identity { grid-template-columns: minmax(0, 1fr) 68px; gap: 12px; }
  .exam-session-identity > .exam-glyph { margin-top: 28px; }
  .exam-toolbar { top: 74px; padding: 13px 0; }
  .exam-prompt { font-size: 1.125rem; }
  .exam-confirm { padding: 21px 18px; }
  .exam-question { scroll-margin-top: 154px; }
}
@media (max-width: 390px) {
  .exam-result-summary { align-items: start; flex-direction: column; gap: 20px; }
  .exam-result-summary dl { width: 100%; }
  .exam-actions .exam-button { width: 100%; }
  .exam-toolbar { font-size: .875rem; gap: 6px 10px; }
  .exam-option { grid-template-columns: 18px 16px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .exams-page *, .exams-page *::before, .exams-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .exam-card, .exam-result-summary { border: 2px solid CanvasText; }
  .exam-option:has(input:checked) { outline: 2px solid Highlight; }
}

/* Keep the cards aligned and sticky controls clear of the actual header. */
.exam-grid { align-items: stretch; }
.exam-card { display: flex; flex-direction: column; }
.exam-card-body { display: flex; flex-direction: column; flex: 1; }
.exam-count { margin-bottom: 20px; }
.exam-card-stats { margin-top: auto; }
.exam-toolbar { top: var(--header-height, 84px); }
.exam-question { scroll-margin-top: calc(var(--header-height, 84px) + 80px); }
.exam-session-identity { min-width: 0; }
@media (max-width: 400px) {
  .exams-page { padding-inline: 16px; }
  .exam-card-body { padding: 20px; }
  .exam-option { padding: 12px; gap: 8px; }
}

/* Immediate selection, with a short visual settling rather than delayed input. */
.exam-option { transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.exam-button { transition: background-color 160ms ease, border-color 160ms ease, filter 160ms ease, box-shadow 160ms ease, transform 120ms ease; }
.exam-button:active { transform: scale(.985); }
.exam-card { transition: border-color 200ms ease, box-shadow 200ms ease; }
.exam-card:focus-within { border-color: var(--exam-color); box-shadow: 0 0 0 1px var(--exam-color); }
@media (hover: hover) { .exam-card:hover { border-color: var(--exam-color); box-shadow: 0 5px 18px #15172018; } }
