/* HiSET®-style computer-based test driver — white, minimalist */

:root {
  --ink: #1a1a1a;
  --muted: #5c6570;
  --line: #d4d8dd;
  --line-dark: #b9bec5;
  --accent: #005a9c;
  --accent-dark: #004a80;
  --soft: #f6f8fa;
  --soft-blue: #eef4fa;
  --mark: #b06a00;
  --ok: #1d7a3e;
  --bad: #b3261e;
  --header-h: 54px;
  --footer-h: 58px;
  font-size: 16px;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win over element display rules below. */
[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: var(--ink);
  background: #fff;
}

h1, h2, h3 { margin: 0 0 0.5em; font-weight: 600; }

i { font-family: Georgia, "Times New Roman", serif; }

sup, sub { font-size: 0.72em; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* ---------- Math helpers ---------- */
.frac {
  display: inline-flex;
  flex-direction: column;
  text-align: center;
  vertical-align: -0.55em;
  margin: 0 0.15em;
  line-height: 1.15;
}
.frac > span { padding: 0 0.2em; }
.frac > span + span { border-top: 1px solid currentColor; }

.sqrt {
  border-top: 1px solid currentColor;
  margin-left: 0.05em;
  padding: 0 0.12em;
}

.data-list {
  font-family: "Courier New", Courier, monospace;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 0.15em 0.45em;
  white-space: normal;
}

/* ---------- Top bar ---------- */
.top-bar {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.top-bar__left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand {
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
}
.brand:hover { color: var(--accent-dark); }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.test-name {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.timer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.92rem;
}

.timer__label { color: var(--muted); }

.timer__value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.timer.timer--hidden .timer__value { color: var(--muted); font-weight: 400; }
.timer.timer--low .timer__value { color: var(--bad); }

/* ---------- Buttons & links ---------- */
.btn {
  font: inherit;
  font-size: 0.88rem;
  padding: 7px 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  cursor: pointer;
}
.btn:hover { background: var(--soft); }
.btn:active { background: #eceff2; }
.btn:disabled { color: #a2a8ae; border-color: var(--line); cursor: default; background: #fff; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-dark); }
.btn--primary:active { background: var(--accent-dark); }

.btn--large { padding: 10px 26px; font-size: 0.95rem; }

.btn--quiet {
  border-color: transparent;
  color: var(--accent);
}
.btn--quiet:hover { background: var(--soft-blue); }

.link-btn {
  font: inherit;
  font-size: 0.8rem;
  padding: 0;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Screens ---------- */
.screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Directions */
.screen--directions {
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 40px 20px 60px;
}

.directions-card { width: min(760px, 100%); }

.directions-card h1 {
  font-size: 1.55rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 18px;
}

.directions-card h2 { font-size: 1.15rem; margin-bottom: 12px; }

.directions-meta { margin: 4px 0; font-size: 1rem; }

.directions-body {
  margin: 18px 0 28px;
  font-size: 0.95rem;
  line-height: 1.65;
}
.directions-body p { margin: 0 0 12px; }

/* Test: two panes */
.screen--test {
  display: grid;
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
}

.pane { min-height: 0; display: flex; flex-direction: column; }

.pane--question {
  border-right: 1px solid var(--line);
  background: #fff;
}

.question-scroll, .reference-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 26px 32px 32px;
}

.question-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.question-number { font-size: 1.05rem; font-weight: 700; }

.question-tag { font-size: 0.78rem; color: var(--muted); }

.question-prompt {
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 22px;
}
.question-prompt p { margin: 0 0 10px; }

/* Answer options */
.options {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  background: #fff;
}
.option:hover { background: var(--soft); }

.option input {
  margin: 3px 0 0;
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.option--selected {
  background: var(--soft-blue);
  border-color: var(--accent);
}

.option__letter {
  font-weight: 700;
  flex: 0 0 1.3em;
}

.option__text { flex: 1 1 auto; line-height: 1.55; }

.option__img {
  display: block;
  max-width: 230px;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}

/* Reference pane */
.pane--reference { background: var(--soft); }

.pane-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.ref-card, .exhibit {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.ref-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.exhibit__caption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.exhibit figure { margin: 0; }

.exhibit__table-wrap { max-width: 100%; overflow-x: auto; }

.exhibit img {
  display: block;
  max-width: 100%;
  height: auto;
}

.exhibit table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}
.exhibit th, .exhibit td {
  border: 1px solid var(--line-dark);
  padding: 6px 10px;
  text-align: center;
}
.exhibit th { background: var(--soft); font-weight: 700; }
.exhibit td:first-child, .exhibit th:first-child {
  text-align: left;
  font-weight: 700;
  background: var(--soft);
}

/* Formula sheet */
.formula-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
}

.formula-sheet__title {
  font-size: 0.95rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.formula-section {
  padding: 8px 10px;
  margin: 0 -10px 6px;
  border-left: 3px solid transparent;
  border-radius: 2px;
}

.formula-section--focus {
  background: var(--soft-blue);
  border-left-color: var(--accent);
}

.formula-section h4 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.formula-item {
  display: flex;
  gap: 8px;
  font-size: 0.87rem;
  line-height: 1.6;
}
.formula-item__label {
  flex: 0 0 8.2em;
  color: var(--muted);
}
.formula-item__formula { flex: 1 1 auto; }

/* ---------- Bottom bar ---------- */
.bottom-bar {
  height: var(--footer-h);
  flex: 0 0 var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.mark-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}
.mark-check input { accent-color: var(--mark); width: 15px; height: 15px; }

.nav-group, .action-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress {
  font-size: 0.88rem;
  color: var(--muted);
  min-width: 9.5em;
  text-align: center;
}

/* ---------- Review screen ---------- */
.screen--review {
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 40px 20px 60px;
}

.review-card { width: min(820px, 100%); }

.review-card h1 {
  font-size: 1.45rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 14px;
}

.review-note { color: var(--muted); font-size: 0.95rem; }

.review-legend {
  display: flex;
  gap: 22px;
  margin: 18px 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.legend-item { display: flex; align-items: center; gap: 8px; }

.dot { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line-dark); }
.dot--answered { background: var(--accent); border-color: var(--accent); }
.dot--marked { background: var(--mark); border-color: var(--mark); }
.dot--blank { background: #fff; }

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.review-cell {
  font: inherit;
  font-size: 0.95rem;
  height: 52px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
.review-cell:hover { background: var(--soft); }
.review-cell--answered { background: var(--accent); border-color: var(--accent); color: #fff; }
.review-cell--answered:hover { background: var(--accent-dark); }
.review-cell--marked { border: 2px solid var(--mark); }
.review-cell--marked::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mark);
}

.review-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}

/* ---------- Results screen ---------- */
.screen--results {
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 36px 20px 80px;
}

.results-card { width: min(880px, 100%); }

.results-card h1 {
  font-size: 1.45rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 18px;
}

.score-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.score-box {
  flex: 1 1 150px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px 18px;
  background: var(--soft);
}

.score-box__value {
  font-size: 1.7rem;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.score-box__label {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.readiness-panel {
  margin: 0 0 22px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 3px;
  background: var(--soft-blue);
  line-height: 1.55;
}
.readiness-panel h2 { margin: 0 0 8px; font-size: 1.15rem; }
.readiness-panel p { margin: 0 0 10px; }
.readiness-panel p:last-of-type { margin-bottom: 12px; }
.readiness-panel__band { font-size: 1.5rem; font-weight: 700; }
.readiness-panel__bands { font-size: 0.92rem; }
.readiness-panel__caveat { color: var(--muted); font-size: 0.9rem; }
.readiness-panel a { color: var(--accent); text-decoration: underline; }
.readiness-panel--not-yet { border-left-color: var(--bad); }
.readiness-panel--somewhat { border-left-color: var(--mark); }
.readiness-panel--prepared, .readiness-panel--well-prepared { border-left-color: var(--ok); }

.source-note {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--mark);
  background: var(--soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.category-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  font-size: 0.92rem;
}
.category-table th, .category-table td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
.category-table th { background: var(--soft); }

.result-item {
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}

.result-item__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font: inherit;
  text-align: left;
  padding: 13px 16px;
  background: #fff;
  border: 0;
  cursor: pointer;
}
.result-item__head:hover { background: var(--soft); }

.result-badge {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  color: #fff;
}
.result-badge--ok { background: var(--ok); }
.result-badge--bad { background: var(--bad); }

.result-item__title { flex: 1 1 auto; font-size: 0.95rem; }
.result-item__meta { flex: 0 0 auto; font-size: 0.8rem; color: var(--muted); }

.result-item__body {
  display: none;
  padding: 4px 16px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.6;
}
.result-item--open .result-item__body { display: block; }

.answer-line { margin: 8px 0; }
.answer-line strong { font-weight: 700; }
.answer--correct { color: var(--ok); }
.answer--wrong { color: var(--bad); }

.rationale {
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  margin-top: 12px;
}

.results-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin: 26px 0 10px;
}

/* ---------- Calculator popup ---------- */
.calc-popup {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  right: 16px;
  width: 252px;
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 12px;
  z-index: 40;
}

.calc-popup__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.calc-display {
  width: 100%;
  font: inherit;
  font-size: 1.15rem;
  text-align: right;
  padding: 8px 10px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-key {
  font: inherit;
  font-size: 0.92rem;
  padding: 9px 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}
.calc-key:hover { background: var(--soft); }
.calc-key--op { background: var(--soft-blue); }
.calc-key--eq { background: var(--accent); border-color: var(--accent); color: #fff; }
.calc-key--eq:hover { background: var(--accent-dark); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 4px;
  max-width: 460px;
  width: 100%;
  padding: 24px 26px;
}

.modal h2 { font-size: 1.2rem; }
.modal p { font-size: 0.95rem; line-height: 1.55; color: var(--ink); }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .screen--test {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 60fr) minmax(0, 40fr);
  }
  .pane--question { border-right: 0; border-bottom: 1px solid var(--line); }
  .question-scroll, .reference-scroll { padding: 18px 16px 22px; }
  .top-bar { padding: 0 12px; }
  .test-name { display: none; }
}

/* ---------- Test library ---------- */
.screen--library {
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 42px 20px 60px;
}

.library-shell { width: min(1040px, 100%); }

.library-intro { margin-bottom: 26px; }
.library-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.library-intro h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}
.library-intro > p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.practice-card {
  display: flex;
  flex-direction: column;
  min-height: 218px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(24, 37, 50, 0.04);
}
.practice-card__eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.practice-card h2 { margin: 0 0 8px; font-size: 1.12rem; }
.practice-card__summary { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.practice-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; }
.practice-card__actions a,
.resource-link,
.direction-resources a,
.paper-pane__resources a,
.source-answer-key a {
  color: var(--accent);
  font-size: 0.84rem;
  text-decoration: underline;
}

.library-resources {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.library-resources h2 { margin-bottom: 12px; font-size: 1.05rem; }
.resource-links { display: flex; flex-wrap: wrap; gap: 10px 20px; }

.directions-selected {
  margin: -4px 0 16px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}
.direction-resources { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 24px; }
.direction-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Score report ---------- */
.answer-key-table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: 0.9rem; }
.answer-key-table th, .answer-key-table td { padding: 9px 10px; border: 1px solid var(--line); text-align: left; }
.answer-key-table th { background: var(--soft); }
.source-answer-key { margin: 0 0 22px; }

@media (max-width: 900px) {
  .practice-card { min-height: 190px; }
}

@media (max-width: 520px) {
  .screen--library, .screen--directions { padding-left: 14px; padding-right: 14px; }
}


.pool-question-image {
  display: block;
  width: min(100%, 760px);
  height: auto;
  margin: 0 auto 6px;
}


.score-info {
  margin-top: 26px;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  line-height: 1.55;
}
.score-info h2 { margin: 0 0 10px; font-size: 1.05rem; }
.score-info p { margin: 0 0 10px; color: var(--muted); }
.score-info a { color: var(--accent); font-size: 0.84rem; text-decoration: underline; }
