/* Timed mock exam (/learn/exam/). Question, option, flag and review styles
   come from learn.css (the stage check); this adds the page layout. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.exam-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.exam-hero { background: var(--night); color: var(--on-night); padding: 18px var(--gutter) 18px; border-bottom: 1px solid var(--night-line); }
.ref-crumbs { font-size: 14.5px; color: var(--on-night-muted); margin-bottom: 10px; }
.ref-crumbs a { color: var(--on-night); }
.exam-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.exam-hero .eyebrow { color: var(--trace); margin-bottom: 4px; }
.exam-hero h1 { font-size: clamp(26px, 3.4vw, 40px); }
/* The clock stays in view, bottom right, for the whole exam. */
.exam-clock { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 8; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--night); border: 1px solid var(--night-line); box-shadow: 0 14px 34px rgba(6, 16, 31, 0.35); }
.exam-clock-label { font: 700 12px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-night-muted); }
.exam-timer { min-width: 92px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--night-line); background: var(--night-2); color: var(--trace); font: 700 22px var(--mono); text-align: center; font-variant-numeric: tabular-nums; }
.exam-clock.is-low .exam-timer { color: #ffb4ab; border-color: #7a2b26; }

.exam-body { padding: 28px var(--gutter) 112px; min-height: 60vh; }
.exam-intro { max-width: 760px; display: grid; gap: 18px; }
.exam-intro .lede { font-size: 19px; color: var(--ink); max-width: none; margin-top: 0; }
.exam-rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.exam-rules li { padding: 14px 16px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); }
.exam-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.exam-facts > div { padding: 14px 16px; border-radius: var(--r-md); background: var(--paper-2); }
.exam-facts dt { font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.exam-facts dd { margin: 4px 0 0; font: 700 26px/1.1 var(--serif); }
.exam-note { color: var(--muted); font-size: 15px; }
.exam-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.exam-actions .btn { border: 0; cursor: pointer; font-family: var(--sans); }
/* Hold the start buttons' space until the script fills them in. */
@media (scripting: enabled) { .exam-intro:not(.is-ready) { min-height: 520px; } }

.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.exam-question { display: grid; gap: 14px; min-width: 0; scroll-margin-top: 90px; }
.exam-twelve-wrap { overflow-x: auto; border-radius: var(--r-sm); border: 1px solid #f0d6d6; }
.exam-twelve { display: block; width: 100%; min-width: 620px; }
.exam-twelve-hint { margin: -6px 0 0; color: var(--muted); font-size: 13.5px; }
@media (min-width: 680px) { .exam-twelve-hint { display: none; } }
.exam-finish-row { display: flex; justify-content: flex-end; }
.exam-finish { min-height: 44px; border: 1.5px solid var(--line) !important; cursor: pointer; font-family: var(--sans); font-size: 15px; }

.exam-nav { position: sticky; top: 92px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 14px 14px; }
.exam-nav summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 44px; padding-top: 10px; cursor: pointer; font-weight: 700; }
.exam-nav summary small { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.exam-nav-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.exam-nav-list button { position: relative; width: 100%; aspect-ratio: 1; min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); font: 700 13.5px var(--mono); cursor: pointer; }
.exam-nav-list button:hover { border-color: var(--blue); }
.exam-nav-list .is-answered button { background: var(--night); border-color: var(--night); color: var(--on-night); }
.exam-nav-list .is-now button { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 79, 179, 0.2); }
.exam-nav-list .is-answered.is-now button { background: var(--blue); border-color: var(--blue); }
.exam-nav-list .is-flagged button::after { content: ""; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; border: 2px solid #fff; }
.exam-nav-key { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.exam-nav-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.k-answered::before { background: var(--night); }
.k-flagged::before { background: #f59e0b; border-radius: 50% !important; }

.exam-review { max-width: 760px; display: grid; gap: 14px; }
.exam-review h2, .exam-results h2 { font-size: 30px; }

.exam-results { max-width: 860px; display: grid; gap: 20px; }
.exam-score { gap: 22px; }
.exam-score-num { flex: none; display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; border: 10px solid #d4574e; background: #fff; text-align: center; }
.exam-score.is-pass .exam-score-num { border-color: #0f9d8a; }
.exam-score-num strong { font: 700 28px/1 var(--serif); outline: none; }
.exam-score-num span { display: block; margin-top: -26px; color: var(--muted); font: 700 14px var(--mono); }
.exam-breakdown { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; font-size: 15px; }
.exam-breakdown caption { text-align: left; font: 600 22px var(--serif); padding-bottom: 8px; }
.exam-breakdown th, .exam-breakdown td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.exam-breakdown thead th { background: var(--paper-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.exam-breakdown tbody th { font-weight: 600; }
.exam-breakdown tbody th a { color: var(--ink); text-decoration: none; }
.exam-breakdown tbody th a:hover { color: var(--blue); text-decoration: underline; }
.exam-breakdown td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; width: 80px; }
.exam-breakdown td:last-child { width: 36%; }
.exam-bar-track { display: block; height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.exam-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--line); }
.exam-breakdown .is-good i { background: #0f9d8a; }
.exam-breakdown .is-fair i { background: #d99a2b; }
.exam-breakdown .is-low i { background: #d4574e; }
.exam-results .qz-actions .btn { border: 0; }
.exam-results-title { margin-top: 10px; }
.exam-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-filter button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 650 14.5px var(--sans); cursor: pointer; }
.exam-filter button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--on-night); }

@media (max-width: 999px) {
  .exam-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-nav { position: static; order: -1; }
}
@media (max-width: 640px) {
  .exam-hero { padding: 14px 16px; }
  .exam-hero .ref-crumbs { margin-bottom: 6px; }
  .exam-timer { font-size: 18px; min-width: 76px; }
  .exam-clock-label { font-size: 11px; }
  .exam-body { padding: 18px 16px 96px; }
  .exam-facts { grid-template-columns: minmax(0, 1fr); }
  .exam-facts > div { display: flex; justify-content: space-between; align-items: baseline; }
  .exam-facts dd { font-size: 22px; }
  .exam-breakdown td:last-child, .exam-breakdown thead th:last-child { display: none; }
  .exam-score { flex-direction: column; align-items: flex-start; }
  .exam-finish-row { justify-content: stretch; }
  .exam-finish { flex: 1; }
}
.exam-twelve-box { display: grid; gap: 8px; min-width: 0; }
