/*
 * The full practice test.
 * - .xs-*  the practice page around a screen copy (strip, dialogs, drawers, calculator): our own look.
 * - .psi-*, .pv-*, .tq-*  copies of the PSI, Pearson VUE and TCEQ test screen LAYOUTS (colours approximate, no
 *   logos). Desktop-shaped like the real screens; below 720px the bars wrap, the rail moves above the card and the
 *   bottom bars stay pinned, with every control still labelled as on the real test, text at 16px and tap targets
 *   at least 48px tall.
 * - .xr-*  the result and answer review pages (site layout, DESIGN.md).
 * Everything is scoped by these prefixes because module stylesheets load on every page.
 */

/* ---------- The practice page ---------- */
.xs-body { background: #fff; color: #111827; font-size: 1.125rem; line-height: 1.45; }
.xs-body form { margin: 0; }
.xs-body p { margin: 0 0 0.75rem; }
.xs-body main { flex: 1 0 auto; }
/* Focus: a dark ring with a white halo inside and out, so it shows on white and on every vendor bar colour. */
.xs-body :focus-visible { outline: 3px solid #111827; outline-offset: 2px; box-shadow: 0 0 0 7px #fff; }
/* A window takes the focus itself when it opens (exam.js) so a screen reader starts there; it needs no ring. */
.xs-body .xs-overlay [tabindex="-1"]:focus-visible { outline: none; box-shadow: 0 12px 32px rgb(0 0 0 / 28%); }
.xs-icon { width: 1.15rem; height: 1.15rem; fill: currentColor; flex: none; }

.xs-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; flex-wrap: wrap;
  padding: 0.3rem 1rem; background: #f6f7f9; border-bottom: 1px solid #e5e7eb; font-size: 0.95rem;
  color: #374151;
}
.xs-strip-text { margin: 0 !important; }
.xs-strip-brand { font-weight: 800; color: var(--brand, #0e6b4a); margin-right: 0.35rem; }
.xs-strip-exit { display: inline-flex; align-items: center; min-height: 40px; color: var(--brand, #0e6b4a); font-weight: 700; }
.xs-strip-note { font-weight: 400; color: #4b5563; }

.xs { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; }

/* Panels opened over the screen (server-rendered, so they work without JavaScript). */
.xs-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgb(15 23 42 / 45%); overflow-y: auto;
}
.xs-overlay-light { background: rgb(15 23 42 / 18%); }
.xs-dialog {
  width: 100%; max-width: 34rem; max-height: calc(100vh - 2rem); overflow-y: auto; background: #fff; color: #111827;
  border-radius: 6px; padding: 1.25rem; box-shadow: 0 12px 32px rgb(0 0 0 / 28%);
}
.xs-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.xs-dialog-head h2, .xs-drawer-head h2 { font-size: 1.25rem; margin: 0; }
.xs-dialog-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; }
.xs-close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  font-size: 1.75rem; line-height: 1; color: #374151; text-decoration: none; background: none; border: 0; cursor: pointer;
}
.xs-overlay-drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.xs-drawer {
  width: min(24rem, 92vw); max-height: 100vh; overflow-y: auto; background: #fff; color: #111827;
  box-shadow: -8px 0 24px rgb(0 0 0 / 25%);
}
.xs-drawer-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.4rem 0.4rem 1rem; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.xs-tabs { display: flex; flex-wrap: wrap; gap: 0 0.25rem; padding: 0 0.6rem; border-bottom: 1px solid #e5e7eb; }
.xs-tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem; color: #1f2937; text-decoration: none;
  border-bottom: 3px solid transparent;
}
.xs-tabs a[aria-current] { border-bottom-color: currentColor; font-weight: 700; }
.xs-empty { color: #4b5563; padding: 1rem; margin: 0; }
.xs-warn { background: #fff4dc; color: #8a5a00; padding: 0.55rem 0.8rem; border-radius: 4px; }
.xs-alert { background: #fdecea; color: #b42318; border-left: 4px solid #b42318; padding: 0.6rem 0.8rem; }
.xs-strong { font-weight: 700; }
.xs-hint { color: #4b5563; font-size: 1rem; margin: 0.25rem 0 0.5rem; }
.xs-note { background: #f6f7f9; border-left: 4px solid #94a3b8; color: #374151; padding: 0.6rem 0.8rem; }
.xs-legal { color: #4b5563; font-size: 0.95rem; margin-top: 1.5rem; }
.xs-keys { width: 100%; border-collapse: collapse; margin-bottom: 0.75rem; }
.xs-keys td { padding: 0.55rem 0.4rem; border-bottom: 1px solid #e5e7eb; }
.xs-keys kbd { background: #1f2937; color: #fff; border-radius: 3px; padding: 0.1rem 0.4rem; font-size: 0.95rem; }

/* Start step (all screens) */
.xs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 0.6rem; margin: 1rem 0; }
.xs-facts > div { border: 1px solid #d5d9e0; border-radius: 6px; padding: 0.6rem 0.8rem; background: #fff; }
.xs-facts dt { color: #4b5563; font-size: 0.95rem; }
.xs-facts dd { margin: 0; font-weight: 700; font-size: 1.2rem; }
.xs-fact-note { display: block; font-weight: 400; font-size: 0.95rem; color: #4b5563; }
.xs-langs { border: 1px solid #d5d9e0; border-radius: 6px; padding: 0.6rem 1rem 0.8rem; margin: 1rem 0; }
.xs-langs legend { font-weight: 700; padding: 0 0.3rem; }
.xs-lang { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.6rem; min-height: 48px; cursor: pointer; }
.xs-lang input { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: #2b67b0; }
.xs-lang-note { flex-basis: 100%; padding-left: 1.9rem; color: #4b5563; font-size: 1rem; }
.xs-tutorial { margin: 1.25rem 0; }
.xs-tutorial h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.xs-tutorial ul { padding-left: 1.2rem; margin: 0; }
.xs-tutorial li { margin: 0.35rem 0; }

/* Calculator window (all screens) */
.xs-window {
  width: min(21rem, 100%); background: #f3f4f6; color: #111827; border: 1px solid #9aa4b2; border-radius: 6px;
  overflow: hidden; box-shadow: 0 12px 32px rgb(0 0 0 / 28%);
}
.xs-window-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 0.2rem 0 0.9rem; background: #dfe3e8; }
.xs-window-title { font-size: 1rem; margin: 0; }
.xs-window-close { width: 44px; height: 44px; font-size: 1.6rem; background: none; border: 0; cursor: pointer; color: #1f2937; }
.xcalc-display {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-height: 4.6rem;
  margin: 0.5rem; padding: 0.4rem 0.75rem; background: #fff; border: 1px solid #c3c9d2; border-radius: 4px;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right;
}
.xcalc-expr { min-height: 1.4em; color: #4b5563; font-size: 1rem; }
.xcalc-value { min-height: 1.3em; font-size: 1.6rem; font-weight: 700; }
.xcalc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; padding: 0 0.5rem 0.5rem; }
.xcalc-key {
  min-height: 48px; font: inherit; font-size: 1.2rem; color: #111827; background: #fff; border: 1px solid #b8bfca;
  border-radius: 4px; cursor: pointer;
}
.xcalc-fn { background: #e5e7eb; }
.xcalc-op, .xcalc-eq { background: #1d4f91; border-color: #1d4f91; color: #fff; }
.xcalc-note { margin: 0 !important; padding: 0 0.75rem 0.6rem; font-size: 0.95rem; color: #4b5563; }

/* ---------- PSI copy ---------- */
.psi { --psi-navy: #20324f; --psi-rail: #e6eaef; --psi-blue: #2b67b0; --psi-teal: #0f5068; --psi-red: #b3261e; background: #eef1f4; color: #1f2937; }
.psi-frame { flex: 1 0 auto; display: flex; flex-direction: column; }
.psi-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem;
  min-height: 3rem; padding: 0.2rem 0.75rem; background: var(--psi-navy); color: #fff;
}
.psi-bar-title { margin: 0 !important; font-weight: 700; font-size: 1rem; }
.psi-bar-menus { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.15rem; flex: 1 1 auto; }
.psi-bar-item {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0 0.6rem; border: 0; border-radius: 4px;
  background: none; color: #fff; font: inherit; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; cursor: pointer; list-style: none;
}
.psi-bar-item::-webkit-details-marker { display: none; }
.psi-bar-item:hover, .psi-menu[open] > .psi-bar-item { background: rgb(255 255 255 / 14%); }
.psi-menu { position: relative; }
.psi-menu > summary::after { content: "▾"; font-size: 0.85em; }
.psi-menu-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 16rem; padding: 0.3rem 0;
  background: #fff; color: #1f2937; border-radius: 4px; box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
}
.psi-menu-option {
  display: block; width: 100%; min-height: 44px; padding: 0.55rem 1rem 0.55rem 2rem; border: 0; background: none;
  color: inherit; font: inherit; font-size: 1rem; text-align: left; cursor: pointer; position: relative;
}
.psi-menu-option:hover { background: #eef2f7; }
.psi-menu-option[aria-pressed="true"]::before { content: "✓"; position: absolute; left: 0.7rem; font-weight: 700; }
.psi-bar-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.3rem 0.9rem; }
.psi-answered, .psi-time {
  margin: 0 !important; color: #c9d3e0; font-size: 0.95rem; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
}
.psi-answered strong, .psi-time-value { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.psi-time.is-hidden { visibility: hidden; }
.psi-eye { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: #fff; cursor: pointer; }
.psi-eye[aria-pressed="true"] { opacity: 0.6; }
.psi-end {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; padding: 0 0.75rem; border: 2px solid #ef6b62;
  border-radius: 4px; background: transparent; color: #fff; font: inherit; font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; cursor: pointer;
}
.psi-end-square { width: 0.7rem; height: 0.7rem; border-radius: 2px; background: currentColor; }
.psi-body { flex: 1 0 auto; display: flex; gap: 0.5rem; padding: 0.5rem; }
.psi-card { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #d9dee5; }
.xs-body .psi-card { flex-shrink: 1; } /* beats ".xs-body main" so a long question wraps instead of widening the page */
.psi-card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 0.75rem;
  padding: 0.15rem 0.5rem 0.15rem 1rem; border-bottom: 1px solid #e5e7eb; color: #5b6472; font-size: 1rem;
}
.psi-page, .psi-minutes { margin: 0 !important; }
.psi-minutes [data-clock] { font-weight: 700; color: #1f2937; }
.psi-flag {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0 0.6rem; border: 0; background: none;
  color: #5b6472; font: inherit; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; cursor: pointer;
}
.psi-flag.is-on { color: #c62828; }
.psi-card .flashes { margin: 0.75rem 1rem 0; }
.psi-question { flex: 1 0 auto; min-width: 0; margin: 0; padding: 0 1rem 1.5rem; border: 0; }
.psi-stem { display: block; width: 100%; padding: 1.1rem 0 0; margin-bottom: 1rem; font-size: 1.125rem; font-weight: 400; }
.psi-choice {
  display: flex; align-items: flex-start; gap: 0.75rem; min-height: 48px; padding: 0.55rem 0.4rem; border-radius: 4px; cursor: pointer;
}
.psi-choice:hover { background: #f4f6f9; }
.psi-choice input { flex: none; width: 1.3rem; height: 1.3rem; margin: 0.15rem 0 0; accent-color: var(--psi-blue); }
.psi-sbs .psi-stem-sbs, .psi-choice-sbs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.25rem 1.25rem; }
.psi-choice-sbs { flex: 1; }
.psi-sbs .psi-col + .psi-col { border-left: 2px solid #dbe3ee; padding-left: 1rem; color: #374151; }
.psi-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.4rem; padding: 0.5rem 0.75rem; background: #fff; border-top: 1px solid #e5e7eb;
}
.psi-actions-group { display: flex; align-items: center; gap: 0.4rem; }
.psi-btn {
  min-height: 44px; padding: 0 1rem; border: 0; border-radius: 3px; color: #fff; font: inherit; font-size: 0.95rem;
  font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.psi-btn-answer { background: var(--psi-blue); }
.psi-btn-answer.is-ready { box-shadow: 0 0 0 3px #9cc2ef; }
.psi-btn-answer:disabled { opacity: 0.45; cursor: not-allowed; }
.psi-btn-mark { background: var(--psi-teal); }
.psi-btn-mark.is-on { box-shadow: 0 0 0 3px #f4a3a3; }
.psi-btn-plain { background: #fff; color: #1f2937; border: 1px solid #9ca3af; }
.psi-btn-end { background: var(--psi-red); }
.psi-begin { min-height: 56px; padding: 0 2rem; font-size: 1.05rem; border-radius: 6px; }
.psi-clear, .psi-nav {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0 0.6rem; border: 0; background: none;
  font: inherit; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; cursor: pointer;
}
.psi-clear { color: var(--psi-red); }
.psi-nav { color: #4b5563; }
.psi-nav:disabled { opacity: 0.4; cursor: default; }
.psi-rail { flex: none; width: 7.5rem; display: flex; flex-direction: column; gap: 0.25rem; padding-top: 0.5rem; background: var(--psi-rail); }
.psi-rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem; min-height: 60px; padding: 0.55rem 0.25rem;
  border: 0; background: none; color: #374151; font: inherit; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; cursor: pointer;
}
.psi-rail-item:hover { background: #d7dde5; }
.psi-rail-item .xs-icon { width: 1.4rem; height: 1.4rem; }
.psi-index { list-style: none; margin: 0; padding: 0; }
.psi-index-row {
  display: grid; grid-template-columns: 1fr auto 1.4rem; align-items: center; gap: 0.6rem; width: 100%; min-height: 48px;
  padding: 0.5rem 1rem; border: 0; border-bottom: 1px solid #eef0f3; background: none; color: #1f2937; font: inherit;
  text-align: left; cursor: pointer;
}
.psi-index-row:hover { background: #f4f6f9; }
.psi-index-row.is-current { background: #eaf1fb; }
.psi-index-state { color: #4b5563; font-size: 1rem; } /* 4.5:1 or more on the current row's blue too */
.psi-index-state.is-answered { color: #13722f; }
.psi-index-flag { fill: #c62828; }
.psi-start { flex: 1 0 auto; padding: 1.25rem 1.25rem 2rem; }
.psi-start > * { max-width: 46rem; }
.psi-start-title { font-size: 1.5rem; }

/* Contrast menu */
.psi-contrast-high .psi-card { border-color: #000; }
.psi-contrast-high .psi-stem, .psi-contrast-high .psi-choice-text { color: #000; font-weight: 600; }
.psi-contrast-high .psi-card-head { color: #000; border-color: #000; }
.psi-contrast-inverted .psi-card, .psi-contrast-inverted .psi-actions { background: #000; color: #fff; border-color: #fff; }
.psi-contrast-inverted .psi-card-head, .psi-contrast-inverted .psi-minutes [data-clock] { color: #fff; }
.psi-contrast-inverted .psi-choice:hover { background: #222; }
.psi-contrast-inverted .psi-nav, .psi-contrast-inverted .psi-flag { color: #ffe066; }
.psi-contrast-inverted .psi-clear { color: #ff8a80; }
.psi-contrast-inverted .psi-sbs .psi-col + .psi-col { color: #e5e7eb; }
.psi-contrast-low .psi-card, .psi-contrast-low .psi-actions { background: #eceff2; color: #4a5462; }

/* ---------- Pearson VUE copy ---------- */
.pv { --pv-blue: #0d64a3; --pv-tool: #3870b8; background: #fff; color: #111; font-family: Arial, Helvetica, var(--font-sans, sans-serif); }
.pv-frame { flex: 1 0 auto; display: flex; flex-direction: column; }
.pv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.3rem 0.9rem;
  background: var(--pv-blue); color: #fff;
}
.pv-title { margin: 0 !important; font-size: 1.1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-status { display: flex; flex-direction: column; align-items: flex-end; flex: none; font-size: 1rem; }
.pv-time { display: inline-flex; align-items: center; gap: 0.2rem; }
.pv-clock {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 0;
  border: 0; background: none; color: #fff; font: inherit; cursor: pointer;
}
.pv-clock-text { margin: 0 !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-clock-text.is-hidden { display: none; }
.pv-progress { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 !important; white-space: nowrap; }
.pv-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; min-height: 2.75rem; padding: 0 0.4rem; background: var(--pv-tool); }
.pv-tool {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.7rem; border: 0; background: none;
  color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer;
}
.pv-tool:hover { background: rgb(255 255 255 / 15%); }
.pv-flag { margin-left: auto; }
.pv-flag .xs-icon, .pv-grid-flag .xs-icon { fill: none; stroke: currentColor; stroke-width: 1.6; }
.pv-flag.is-on .xs-icon { fill: #fff; }
.pv-main { flex: 1 0 auto; width: 100%; max-width: 62rem; padding: 1.25rem 1rem 2rem; }
.pv-main .flashes { margin-bottom: 1rem; }
.pv-question { margin: 0; padding: 0; border: 0; min-width: 0; }
.pv-stem { display: block; width: 100%; padding: 0; margin-bottom: 1rem; font-size: 1.125rem; font-weight: 400; }
.pv-choice {
  display: grid; grid-template-columns: auto 2rem 1fr; align-items: start; gap: 0.5rem; min-height: 48px;
  padding: 0.45rem 0.3rem; border-radius: 3px; cursor: pointer;
}
.pv-choice:hover { background: #eef4fb; }
.pv-choice input { width: 1.2rem; height: 1.2rem; margin: 0.2rem 0 0; accent-color: var(--pv-blue); }
.pv-letter { font-weight: 400; }
.pv-foot {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between;
  background: var(--pv-blue);
}
.pv-foot-group { display: flex; flex-wrap: wrap; }
.pv-foot-btn {
  min-height: 48px; padding: 0 1rem; border: 0; border-left: 1px solid rgb(255 255 255 / 55%); background: var(--pv-blue);
  color: #fff; font: inherit; font-size: 1.05rem; cursor: pointer;
}
.pv-foot-group:first-child .pv-foot-btn:first-child { border-left: 0; border-right: 1px solid rgb(255 255 255 / 55%); }
.pv-foot-btn:hover { background: #0a568c; }
.pv-foot-btn:disabled { opacity: 0.5; cursor: default; }
.pv-heading, .pv-review-title { font-size: 1.25rem; }
.pv-review-title { text-align: center; }
.pv-band { margin: 0 0 0.25rem; background: #e9f0f9; border: 1px solid #b9cce6; }
.pv-band > summary, .pv-band-count {
  display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0.75rem; background: var(--pv-tool); color: #fff;
  font-weight: 700; cursor: pointer;
}
.pv-band-count { margin: 0 0 0.25rem !important; flex-wrap: wrap; cursor: default; }
.pv-band > summary::before { content: "⊞"; margin-right: 0.4rem; }
.pv-band[open] > summary::before { content: "⊟"; }
.pv-band > summary { justify-content: flex-start; list-style: none; }
.pv-band > summary::-webkit-details-marker { display: none; }
.pv-instructions { padding: 0.6rem 0.9rem; font-size: 1rem; }
.pv-instructions ul { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.pv-grid { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 0; padding: 0; border: 1px solid #cfd8e3; }
.pv-grid-cell { display: flex; align-items: center; gap: 0.25rem; padding: 0 0.5rem 0 0; border-bottom: 1px solid #e3e8ef; border-right: 1px solid #e3e8ef; }
.pv-grid-flag {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border: 0;
  background: none; color: #0b4f86; cursor: pointer;
}
.pv-grid-flag.is-on .xs-icon { fill: #0b4f86; }
.pv-grid-q { min-height: 44px; padding: 0; border: 0; background: none; color: #0b4f86; font: inherit; text-decoration: underline; text-align: left; cursor: pointer; }
.pv-incomplete { margin-left: auto; color: #c62828; font-size: 1rem; }
.pv-end-text { max-width: 40rem; }
.pv-dialog { padding-top: 0; }
.pv-dialog-bar { margin: 0 -1.25rem 1rem; padding: 0.6rem 1.25rem; background: var(--pv-blue); color: #fff; }
.pv-dialog-bar h2 { font-size: 1.15rem; margin: 0; }
.pv-dialog-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 6rem; padding: 0 1.2rem;
  border: 1px solid #7f9cc0; border-radius: 3px; background: #e9eef5; color: #111; font: inherit; text-decoration: none; cursor: pointer;
}

/* ---------- TCEQ copy ---------- */
.tq { --tq-steel: #aebccf; --tq-border: #5876a8; background: #fff; color: #000; font-family: Arial, Helvetica, var(--font-sans, sans-serif); }
.tq-frame { flex: 1 0 auto; display: flex; flex-direction: column; }
.tq-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem;
  background: var(--tq-steel); border-bottom: 2px solid var(--tq-border);
}
.tq-head-title { margin: 0 !important; text-align: center; font-size: 1.05rem; color: #1f2b3d; }
.tq-head-side { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tq-head-right { justify-content: flex-end; }
.tq-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 0.9rem;
  border: 1px solid #8796ad; border-radius: 3px; background: linear-gradient(#fbfcfd, #dde3ea); color: #111;
  font: inherit; font-size: 1rem; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.15; text-align: center;
}
.tq-btn:hover { background: linear-gradient(#ffffff, #cfd8e3); color: #111; }
.tq-btn:disabled { opacity: 0.5; cursor: default; }
.tq-btn.is-on { background: #fff3c4; border-color: #a07c00; }
.tq-btn-strong { border-color: #3c5a8a; }
.tq-btn-small { min-height: 40px; font-size: 0.95rem; font-weight: 600; padding: 0 0.7rem; }
.tq-btn-big { min-height: 52px; padding: 0 2.25rem; font-size: 1.1rem; }
.tq-clock { display: inline-flex; align-items: stretch; min-height: 44px; border: 1px solid #6b7c93; background: #fff; color: #000; }
.tq-clock-time {
  display: inline-flex; align-items: center; margin: 0 !important; padding: 0 0.3rem 0 0.6rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tq-clock-time.is-hidden { display: none; }
.tq-clock-button {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 0 0.5rem; border: 0;
  background: none; color: #000; font: inherit; font-weight: 700; cursor: pointer;
}
.tq-clock-label { font-size: 0.95rem; }
.tq-sub { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; padding: 0.45rem 0.75rem 0; }
.tq-main { flex: 1 0 auto; width: 100%; max-width: 58rem; margin: 0 auto; padding: 0.75rem 1rem 2rem; }
.tq-main .flashes { margin-bottom: 1rem; }
.tq-exam-title { margin: 0.4rem 0 0.25rem; font-size: 1.05rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: 0.02em; }
.tq-section { margin: 0 0 1.25rem !important; font-size: 1rem; font-weight: 700; text-align: center; text-transform: uppercase; }
.tq-question { max-width: 46rem; margin: 0 auto; padding: 0; border: 0; min-width: 0; }
.tq-stem { display: flex; gap: 1rem; width: 100%; padding: 0; margin-bottom: 1rem; font-size: 1.125rem; font-weight: 400; }
.tq-num { flex: none; }
.tq-choice {
  display: grid; grid-template-columns: auto 1.8rem 1fr; align-items: start; gap: 0.4rem; min-height: 48px;
  padding: 0.4rem 0.3rem 0.4rem 2.2rem; cursor: pointer;
}
.tq-choice:hover { background: #f3f6fa; }
.tq-choice input { width: 1.2rem; height: 1.2rem; margin: 0.2rem 0 0; accent-color: #2b5797; }
.tq-required { margin: 0 0 0.5rem 2.2rem !important; font-weight: 700; }
.tq-window-body .tq-required { margin-left: 0 !important; }
.xr-required { margin: 0 0 0.5rem !important; font-weight: 700; }
.tq-flag-note { max-width: 46rem; margin: 1rem auto 0 !important; padding-left: 2.2rem; color: #7a5a00; font-weight: 700; }
.tq-foot {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 0.75rem; background: var(--tq-steel); border-top: 2px solid var(--tq-border);
}
.tq-start { max-width: 52rem; font-size: 1.05rem; }
.tq-start .tq-exam-title { margin: 1rem 0 1.25rem; }
.tq-items { list-style: none; padding: 0; margin: 0 0 1rem; }
.tq-ours { margin: 1.25rem 0; padding: 0.75rem 1rem; background: #f6f7f9; border-left: 4px solid #94a3b8; font-family: var(--font-sans, sans-serif); font-size: 1rem; }
.tq-ours p:last-child { margin-bottom: 0; }
.tq-start-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; margin: 1.5rem 0 !important; }
.tq-start-row p { margin: 0 !important; }
.tq-review-title { font-size: 1.15rem; text-align: center; }
.tq-tabs { margin-bottom: 0.5rem; padding: 0; }
.tq-review { list-style: none; margin: 0; padding: 0; border: 1px solid #c4cfdd; }
.tq-review-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; width: 100%; min-height: 48px;
  padding: 0.55rem 0.9rem; border: 0; border-bottom: 1px solid #e3e8ef; background: none; color: #0b3f8a; font: inherit;
  text-align: left; cursor: pointer;
}
.tq-review-row:hover { background: #f3f6fa; }
.tq-review-num { text-decoration: underline; }
.tq-review-state { color: #374151; }
.tq-review-count { margin-top: 0.75rem !important; color: #374151; }
.tq-dialog { font-family: var(--font-sans, sans-serif); }
.tq-dialog p { font-size: 1rem; }
/* "Pregunta en español": a separate window, read only, zoomable */
.tq-window {
  display: flex; flex-direction: column; width: min(42rem, 100%); max-height: calc(100vh - 2rem); background: #ececec;
  border: 1px solid #6f7f99; box-shadow: 0 12px 32px rgb(0 0 0 / 30%);
}
.tq-window-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0 0 0 0.6rem;
  background: linear-gradient(#e6edf7, #c9d6ea); border-bottom: 1px solid #8ea2c4;
}
.tq-window-bar h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.tq-window-x {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: #111;
  font-size: 1.5rem; text-decoration: none;
}
.tq-window-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.35rem; padding: 0.4rem; }
.tq-zoom-status { font-size: 0.95rem; }
.tq-window-body {
  margin: 0 0.5rem; padding: 1rem; overflow: auto; background: #fff; border: 1px solid #6f8fc4;
  font-family: "Times New Roman", Times, Georgia, serif; font-size: 1.15rem;
}
.tq-es-stem { margin-bottom: 0.75rem !important; }
.tq-es-choices { list-style: none; margin: 0; padding: 0; }
.tq-es-choices li { margin: 0.3rem 0; }
.tq-zoom-50 { font-size: 0.6rem; } .tq-zoom-75 { font-size: 0.86rem; } .tq-zoom-100 { font-size: 1.15rem; }
.tq-zoom-125 { font-size: 1.44rem; } .tq-zoom-150 { font-size: 1.72rem; } .tq-zoom-200 { font-size: 2.3rem; }
.tq-window-note { margin: 0 !important; padding: 0.55rem 0.75rem; font-size: 1rem; font-family: var(--font-sans, sans-serif); }

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .xs-strip { flex-wrap: nowrap; padding: 0 0.75rem; font-size: 1rem; }
  .xs-strip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .xs-strip-brand { display: none; }
  .xs-strip-exit { flex: none; min-height: 48px; }
  .xs-strip-note { display: none; }
  .xs-overlay { padding: 0.5rem 0 0; align-items: flex-end; }
  .xs-overlay-drawer { padding: 0; align-items: stretch; }
  .xs-dialog { border-radius: 10px 10px 0 0; max-height: 92vh; }
  .xs-window { width: 100%; }
  .xs-close, .xs-window-close, .tq-window-x { width: 48px; height: 48px; }
  .xs-tabs a { min-height: 48px; }
  .xs-legal, .xs-facts dt, .xs-fact-note, .xs-keys kbd, .xcalc-note { font-size: 1rem; }

  /* PSI top bar: the menus and End Test on the first line (End Test takes its own line when the words are long,
     as in Spanish), then Answered, the time and the eye. */
  .psi-bar { gap: 0 0.25rem; padding: 0 0.5rem; }
  .psi-bar-menus { order: 1; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-start; gap: 0; }
  .psi-bar-status { display: contents; }
  .psi-end { order: 2; margin-left: auto; }
  .psi-frame .psi-bar::after { content: ""; order: 3; flex-basis: 100%; }
  .psi-answered { order: 4; }
  .psi-time { order: 5; margin-left: auto; }
  .psi-eye { order: 6; width: 48px; height: 48px; }
  .psi-bar-item, .psi-end, .psi-answered, .psi-time { font-size: 1rem; letter-spacing: 0.01em; }
  .psi-bar-item { min-height: 48px; padding: 0 0.4rem; }
  .psi-bar-item .xs-icon { display: none; }
  .psi-end { min-height: 48px; white-space: nowrap; padding: 0 0.6rem; }
  .psi-menu-option { min-height: 48px; }
  /* A menu opens under its own button, as wide as the bar, so it never runs off the screen. */
  .psi-bar { position: relative; }
  .psi-menu { position: static; }
  .psi-menu-list { top: auto; left: 0.5rem; right: 0.5rem; min-width: 0; }
  .psi-bar-shortcuts { display: none; } /* shortcuts need a keyboard */
  .psi-time-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .psi-body { flex-direction: column; padding: 0; gap: 0; }
  .psi-card { border: 0; }
  .psi-rail { order: -1; width: auto; flex-direction: row; justify-content: flex-end; padding: 0; background: var(--psi-rail); }
  .psi-rail-item { flex-direction: row; min-height: 48px; padding: 0 0.75rem; font-size: 1rem; }
  .psi-rail-item .xs-icon { width: 1.15rem; height: 1.15rem; }
  .psi-card-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "page flag" "minutes minutes"; padding-left: 0.75rem; }
  .psi-page { grid-area: page; }
  .psi-flag { grid-area: flag; min-height: 48px; font-size: 1rem; }
  .psi-minutes { grid-area: minutes; padding-bottom: 0.3rem; }
  .psi-actions-group { flex-wrap: wrap; }
  .psi-actions-group + .psi-actions-group { margin-left: auto; }
  .psi-question { padding: 0 0.75rem 1.25rem; }
  .psi-actions { padding: 0.4rem 0.5rem; }
  .psi-btn { min-height: 48px; padding: 0 0.75rem; font-size: 1rem; }
  .psi-clear, .psi-nav { min-height: 48px; padding: 0 0.45rem; font-size: 1rem; }
  .psi-sbs .psi-stem-sbs, .psi-choice-sbs { grid-template-columns: 1fr; }
  .psi-sbs .psi-col + .psi-col { border-left: 0; padding-left: 0; border-top: 1px dashed #c9d3e0; padding-top: 0.25rem; }
  .psi-start { padding: 1rem 0.9rem 1.5rem; }
  .psi-begin { width: 100%; }

  .pv-head { padding: 0.25rem 0.6rem; }
  .pv-title { font-size: 1rem; }
  .pv-status { font-size: 1rem; }
  .pv-clock { min-width: 48px; min-height: 48px; }
  .pv-toolbar { min-height: 48px; }
  .pv-tool { min-height: 48px; padding: 0 0.5rem; font-size: 1rem; }
  .pv-grid-flag { width: 48px; height: 48px; }
  .pv-grid-q, .pv-dialog-btn { min-height: 48px; }
  .pv-main { padding: 1rem 0.75rem 1.5rem; }
  .pv-grid { grid-template-columns: 1fr 1fr; }
  .pv-foot { display: grid; grid-template-columns: 1fr 1fr; }
  .pv-foot-group { display: contents; }
  .pv-foot-btn, .pv-foot-group:first-child .pv-foot-btn:first-child {
    padding: 0 0.5rem; font-size: 1rem; border: 0; border-top: 1px solid rgb(255 255 255 / 45%);
    border-left: 1px solid rgb(255 255 255 / 45%);
  }
  .pv-foot-btn[value="review_screen"], .pv-foot-btn[value="end_exam"] { grid-column: 1 / -1; }

  .tq-head { grid-template-columns: auto 1fr auto; padding: 0.3rem 0.5rem; }
  .tq-head-title { font-size: 1rem; line-height: 1.2; }
  .tq-btn { min-height: 48px; padding: 0 0.65rem; }
  .tq-btn-small { min-height: 48px; font-size: 1rem; }
  .tq-clock { min-height: 48px; }
  .tq-clock-button { min-width: 48px; min-height: 48px; }
  .tq-clock-label, .tq-zoom-status { font-size: 1rem; }
  .tq-main { padding: 0.5rem 0.75rem 1.5rem; }
  .tq-choice { padding-left: 0.3rem; }
  .tq-flag-note { padding-left: 0.3rem; }
  .tq-foot { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0.4rem 0.5rem; }
  .tq-foot-q { grid-template-areas: "prev skip next" "flag flag review"; }
  .tq-foot-q [value="prev"] { grid-area: prev; }
  .tq-foot-q [value="skip"] { grid-area: skip; }
  .tq-foot-q [value="next"] { grid-area: next; }
  .tq-foot-q [value="flag"] { grid-area: flag; }
  .tq-foot-q [value="review_screen"] { grid-area: review; }
  .tq-foot-list { grid-template-columns: 1fr 2fr; }
  .tq-foot .tq-btn { padding: 0 0.3rem; }
  .tq-start-row .tq-btn-big { width: 100%; }
}
@media (max-width: 420px) {
  .pv-grid { grid-template-columns: 1fr; }
  .tq-head-title { display: none; }
  .tq-head { grid-template-columns: 1fr auto; }
}
@media (min-width: 721px) {
  .tq-foot { justify-content: space-between; }
}
/* Phones (journey round 4, Keisha on an iPhone: "the bottom buttons cut off part of the last answer until I
 * scrolled"): the question ends with room as tall as the pinned bottom bar, which keeps clear of the home indicator
 * (safe area, with viewport-fit=cover in the layout), and scrolling to an answer stops above the bar. The bar wraps
 * to two rows below 720px. */
.xs-body { --xs-bar: 4rem; }
@media (max-width: 720px) { .xs-body { --xs-bar: 7.5rem; } }
html:has(> body.xs-body) { scroll-padding-bottom: calc(var(--xs-bar) + env(safe-area-inset-bottom, 0px)); }
.psi-question, .pv-main, .tq-main { padding-bottom: calc(var(--xs-bar) + env(safe-area-inset-bottom, 0px)); }
.psi-actions, .tq-foot { padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)); }
.pv-foot { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---------- Result and answer review (site layout, on the learn lane's .pc-* building blocks) ---------- */
.xr > * + * { margin-top: 1rem; }
.xr-mark-word { align-self: center; font-size: 16px; font-weight: 700; color: var(--pc-muted, #4b5563); }
.xr-mark-word.is-over { color: var(--pc-ready, #13722f); }
.xr-note { background: var(--pc-page, #f6f7f9); border-left: 4px solid #94a3b8; padding: 0.6rem 0.8rem; font-size: 16px !important; }
.xr-again { margin: 1rem 0 0; text-align: center; }
.xr-again a { display: inline-flex; align-items: center; min-height: 48px; }
.xr-tabs { display: flex; flex-wrap: wrap; gap: 0 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--pc-border, #e5e7eb); }
.xr-tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 0.5rem; color: var(--pc-ink, #111827) !important; text-decoration: none; border-bottom: 3px solid transparent; }
.xr-tabs a[aria-current] { border-bottom-color: var(--pc-brand, #0e6b4a); font-weight: 700; }
.xr-questions { list-style: none; margin: 0; padding: 0; }
.xr-q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; margin: 0 0 0.5rem; }
.xr-q-num { font-weight: 700; }
.xr-mark { border-radius: 999px; padding: 0 0.6rem; font-size: 16px; font-weight: 700; }
.xr-mark-right { color: var(--pc-ready, #13722f); background: var(--pc-ready-bg, #e8f5ec); }
.xr-mark-wrong { color: var(--pc-wrong, #b42318); background: var(--pc-wrong-bg, #fdecea); }
.xr-mark-none { color: var(--pc-notyet, #475569); background: var(--pc-notyet-bg, #eef1f5); }
.xr-stem { font-size: 20px !important; font-weight: 700; line-height: 1.35; margin: 0 0 0.75rem; }
.xr-stem-second { color: #374151; border-left: 3px solid #dbe3ee; padding-left: 0.6rem; }
.xr-choice-second { display: block; color: var(--pc-muted, #4b5563); }
.xr .pc-choices-done { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }

/* The promise in plain words on the start screen (passes/_ui.html promise_plain). */
.pp-promise-plain { background: #f6f7f9; border-left: 4px solid #94a3b8; color: #374151; padding: 0.6rem 0.8rem; margin: 0 0 0.75rem; }
.pp-promise-plain-title { margin: 0 0 0.4rem; }
.pp-plain-list { list-style: none; padding: 0; margin: 0; }
.pp-plain-list li + li { margin-top: 0.4rem; }
.xs-fine summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
