:root {
  --brand: #8b5e34;
  --brand-strong: #6f4a28;
  --brand-soft: #f5ede2;
  --green: #2f8a4a;
  --green-soft: #e7f4ec;
  --red: #c4423a;
  --red-soft: #fbeceb;
  --purple: #6a4ba8;
  --purple-soft: #efe9fb;
  --text: #1f2330;
  --text-muted: #6a6f7d;
  --border: #e3e3e3;
  --border-strong: #d0cfcd;
  --card-bg: #ffffff;
  --page-bg: #fafafa;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 1px 2px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

/* Make the HTML `hidden` attribute always win over later display rules
   (e.g. display: flex on .exam-strategy, .time-summary, .splash-meta).
   Without this, JS-toggled visibility leaves blank "ghost" banners. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family:
    "Inter",
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text);
}

.title-accent {
  color: var(--brand);
}

.subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0;
}

.page-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0 28px;
}

.screen {
  display: block;
}

.screen[hidden] {
  display: none !important;
}

.screen-status {
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
}

.screen-error {
  color: var(--red);
  font-weight: 600;
}

/* -------------------- Mode bar -------------------- */

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: #f1eee8;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
}

.mode-tab {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.mode-tab:hover {
  color: var(--brand);
}

.mode-tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.mode-tab .mode-count {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: #fff;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.825rem;
  border: 1px solid var(--border);
}

.mode-tab.active .mode-count {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand-strong);
}

.mode-blurb {
  color: var(--text-muted);
  margin: 0 0 22px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* -------------------- Landing / filters -------------------- */

.filter-row {
  margin-bottom: 18px;
}

.filter-label {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.pill {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pill.active:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

.pill-count {
  opacity: 0.8;
  margin-left: 4px;
}

.selection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.selection-text {
  font-size: 1rem;
  color: var(--text);
}

.selection-text strong {
  font-size: 1.0625rem;
}

.selection-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.question-count-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.question-count-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(139, 94, 52, 0.15);
}

.question-count-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.question-count-field input {
  appearance: textfield;
  -moz-appearance: textfield;
  width: 56px;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  padding: 4px 0;
  text-align: center;
}

.question-count-field input:focus {
  outline: none;
}

.question-count-field input::-webkit-outer-spin-button,
.question-count-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.question-count-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .selection-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .question-count-field {
    justify-content: space-between;
  }
}

/* -------------------- Buttons -------------------- */

.btn {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: var(--brand-strong);
}

.btn-primary:not(:disabled):active {
  transform: translateY(1px);
}

/* -------------------- Quiz -------------------- */

.quiz-meta {
  margin-bottom: 20px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.progress-label strong {
  color: var(--text);
  font-weight: 700;
}

.quiz-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.correct-counter {
  color: var(--text-muted);
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease;
}

.timer .timer-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.timer .timer-sep {
  opacity: 0.5;
  margin: 0 2px;
}

.timer[data-state="on-pace"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.timer[data-state="ahead"] {
  background: var(--green-soft);
  color: var(--green);
}

.timer[data-state="behind"] {
  background: #fff3e6;
  color: #a35a1a;
  border-color: #f1cda1;
}

.timer[data-state="over"] {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f3cdc9;
}

.progress-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}

.progress-bar .segment {
  height: 6px;
  background: #ececec;
  border-radius: 3px;
}

.progress-bar .segment.correct {
  background: var(--green);
}
.progress-bar .segment.incorrect {
  background: var(--red);
}
.progress-bar .segment.current {
  background: var(--brand);
}

.question-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-card);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip-domain {
  background: var(--purple-soft);
  color: var(--purple);
}

.chip-subdomain {
  background: #f1eee8;
  color: var(--brand-strong);
}

.chip-scenario {
  background: #e9f1fb;
  color: #2d5a96;
}

.chip-severity {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.chip-severity.severity-CRITICAL {
  background: var(--red-soft);
  color: var(--red);
}

.chip-severity.severity-HIGH {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.chip-severity.severity-MEDIUM {
  background: #ececec;
  color: var(--text-muted);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 22px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card-bg);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition:
    border-color 120ms ease,
    background-color 120ms ease,
    box-shadow 120ms ease;
}

.option:hover:not(:disabled) {
  border-color: var(--brand);
}

.option:disabled {
  cursor: default;
}

.option .letter {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--text-muted);
  width: 1.5em;
}

.option .text {
  flex: 1 1 auto;
}

.option .icon {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 1.05rem;
  margin-left: 8px;
}

.option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.option.correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.option.correct .icon::before {
  content: "✓";
  color: var(--green);
}

.option.incorrect {
  border-color: var(--red);
  background: var(--red-soft);
}

.option.incorrect .icon::before {
  content: "✕";
  color: var(--red);
}

.exam-strategy {
  margin-top: 18px;
  background: #f5f1ea;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exam-strategy-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-strong);
  font-weight: 700;
}

.exam-strategy-text {
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-style: italic;
}

.explanation {
  margin-top: 22px;
  background: #fcf8f2;
  border: 1px solid #efe3cf;
  border-radius: 12px;
  padding: 18px 20px;
}

.anti-pattern-callout {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid #f3cdc9;
}

.anti-pattern-callout::before {
  content: "Anti-pattern: ";
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  margin-right: 4px;
  font-weight: 700;
}

.gap-callout {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid #e2cfa8;
}

.gap-callout::before {
  content: "Gap targeted: ";
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  margin-right: 4px;
  font-weight: 700;
}

.explanation h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-strong);
  letter-spacing: 0.02em;
  text-transform: none;
}

.explanation p {
  margin: 0;
  color: var(--text);
  font-size: 0.9875rem;
  line-height: 1.55;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

/* -------------------- Results -------------------- */

.results-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.score-ring {
  --size: 160px;
  --color: var(--green);
  width: var(--size);
  height: var(--size);
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--card-bg) 60%, transparent 61%),
    conic-gradient(var(--color) var(--p, 0%), #e8e8e8 0);
  position: relative;
}

.score-percent {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color, var(--green));
}

.results-headline {
  font-size: 1.75rem;
  margin: 8px 0 4px;
}

.results-subline {
  color: var(--text-muted);
  margin: 0 0 18px;
}

.time-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
  padding: 14px 18px;
  background: #faf6ef;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.time-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 96px;
}

.time-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.time-stat strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.time-verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time-verdict[data-state="on-pace"],
.time-verdict[data-state="ahead"] {
  background: var(--green-soft);
  color: var(--green);
}

.time-verdict[data-state="behind"] {
  background: #fff3e6;
  color: #a35a1a;
}

.time-verdict[data-state="over"] {
  background: var(--red-soft);
  color: var(--red);
}

@media (max-width: 640px) {
  .time-summary {
    gap: 12px;
  }
  .time-stat {
    min-width: 80px;
  }
}

.domain-perf-title {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-size: 1rem;
  margin: 8px 0 12px;
}

.domain-perf-icon {
  flex: 0 0 auto;
  fill: var(--brand);
}

.domain-perf {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.domain-perf li {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 70px 1fr;
  align-items: center;
  gap: 12px;
}

.domain-perf .name {
  font-weight: 500;
}

.domain-perf .score {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.domain-perf .bar {
  height: 10px;
  background: #ececec;
  border-radius: 999px;
  overflow: hidden;
}

.domain-perf .bar > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

.domain-perf li.full .bar > span {
  background: var(--green);
}

.domain-perf li.partial .bar > span {
  background: var(--brand);
}

.results-advice {
  color: var(--text-muted);
  margin: 0 0 20px;
}

@media (max-width: 640px) {
  .container {
    padding: 32px 16px 64px;
  }
  .selection-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .quiz-actions {
    justify-content: stretch;
  }
  .quiz-actions .btn {
    width: 100%;
  }
  .domain-perf li {
    grid-template-columns: 1fr 70px;
  }
  .domain-perf .bar {
    grid-column: 1 / -1;
  }
}

/* ============================================================
   Lane switcher (top-level Drill vs Simulator selector)
   ============================================================ */

.lane-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 32px;
}

.lane-tab {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.lane-tab:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.lane-tab.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-card);
}

.lane-tab-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.lane-tab.active .lane-tab-title {
  color: var(--brand-strong);
}

.lane-tab-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .lane-switcher {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   "Only my mistakes" toggle (Past Exam Bank mode)
   ============================================================ */

.filter-toggle-row {
  margin: 8px 0 24px;
}

.filter-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  transition: border-color 120ms ease, background 120ms ease;
}

.filter-toggle:hover {
  border-color: var(--border-strong);
}

.filter-toggle input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.filter-toggle:has(input[type="checkbox"]:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.filter-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
}

.filter-toggle-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   Simulator landing
   ============================================================ */

.simulator-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.simulator-eyebrow {
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.simulator-headline {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text);
}

.simulator-blurb {
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

.simulator-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 24px;
  padding: 18px;
  background: var(--page-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.sim-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.sim-option-label {
  font-weight: 600;
  color: var(--text);
}

.sim-option select {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  max-width: 320px;
}

.sim-option-toggle {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.sim-option-toggle input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.sim-option-sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
  margin-top: 2px;
}

.simulator-cta {
  margin: 0 0 28px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

/* Session-only last-attempt summary */
.simulator-last-attempt {
  margin: 0 0 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.sim-last-attempt-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}

.sim-last-attempt-card {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sim-last-attempt-score,
.sim-last-attempt-stat {
  display: flex;
  flex-direction: column;
}

.sim-last-attempt-score strong,
.sim-last-attempt-stat strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.sim-last-attempt-score span,
.sim-last-attempt-stat span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sim-last-attempt-verdict {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.sim-last-attempt-verdict[data-state="passed"] {
  background: var(--green-soft);
  color: var(--green);
}

.sim-last-attempt-verdict[data-state="failed"] {
  background: var(--red-soft);
  color: var(--red);
}

.sim-last-attempt-verdict[data-state="pending"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.simulator-reference {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.simulator-reference summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-weight: 500;
}

.simulator-reference p {
  margin: 12px 0 0;
}

/* ============================================================
   Simulator splash (between scenarios)
   ============================================================ */

.splash-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 36px;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.splash-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 16px;
}

.splash-headline {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text);
}

.splash-blurb {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 24px;
  line-height: 1.6;
}

.splash-meta {
  display: flex;
  gap: 32px;
  margin: 0 0 28px;
  padding: 16px 20px;
  background: var(--page-bg);
  border-radius: 10px;
  flex-wrap: wrap;
}

.splash-meta span {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.splash-meta strong {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   Simulator report (final scored screen)
   ============================================================ */

.report-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.report-eyebrow {
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.report-headline-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.report-score-block {
  display: flex;
  flex-direction: column;
}

.report-score-big {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.report-score-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.report-verdict {
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
}

.report-verdict[data-state="passed"] {
  background: var(--green-soft);
  color: var(--green);
}

.report-verdict[data-state="failed"] {
  background: var(--red-soft);
  color: var(--red);
}

.report-headline-line {
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 8px;
}

.report-correct-line {
  color: var(--text-muted);
  margin: 0 0 28px;
}

.report-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.report-scenarios {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 32px;
  font-size: 0.95rem;
}

.report-scenarios th,
.report-scenarios td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.report-scenarios th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.report-scenarios td.result-pass {
  color: var(--green);
  font-weight: 600;
}

.report-scenarios td.result-warn {
  color: var(--brand-strong);
  font-weight: 600;
}

.report-scenarios td.result-fail {
  color: var(--red);
  font-weight: 600;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 32px;
}

.report-actions .btn {
  flex: 0 1 auto;
}

/* Question-by-question review (expandable) */
.report-review {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 24px;
}

.report-review-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  overflow: hidden;
}

.report-review-group > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-review-group > summary::-webkit-details-marker {
  display: none;
}

.report-review-group > summary::after {
  content: "▾";
  color: var(--text-muted);
  transition: transform 120ms ease;
}

.report-review-group[open] > summary::after {
  transform: rotate(180deg);
}

.report-review-item {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.report-review-item::-webkit-details-marker {
  display: none;
}

.report-review-item-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green);
}

.report-review-item.incorrect .report-review-item-mark {
  background: var(--red-soft);
  color: var(--red);
}

.report-review-item-text {
  font-size: 0.92rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-review-item-letters {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.report-review-item-detail {
  padding: 12px 16px 16px 50px;
  background: var(--page-bg);
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text);
}

.report-review-item-detail p {
  margin: 6px 0;
}

.report-review-item-detail .topic {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.report-quiz-actions {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-strong);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--brand-soft);
}

/* ============================================================
   Past Exam topic chip + previous-attempt nudge during quiz
   ============================================================ */

.chip-topic {
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid color-mix(in srgb, var(--purple) 25%, transparent);
}

.previous-attempt-line {
  display: block;
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.previous-attempt-line strong {
  color: var(--text);
}


/* ============================================================
   Compact chrome during active quiz / splash
   Hides the page header, lane switcher and divider so the
   question text and Next button stay above the fold.
   ============================================================ */

body.in-quiz .page-header,
body.in-quiz .page-divider,
body.in-quiz .lane-switcher {
  display: none;
}

body.in-quiz .container {
  padding-top: 20px;
}

/* Pin the progress + timer to the top so they stay visible
   while the user scrolls long question text or explanations. */
body.in-quiz .quiz-meta {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--page-bg);
  padding: 12px 0 10px;
  margin: -20px -4px 12px;
  padding-left: 4px;
  padding-right: 4px;
  border-bottom: 1px solid var(--border);
}

/* Tighter question card on compact screens */
body.in-quiz .question-card {
  padding: 20px 24px;
}

body.in-quiz .quiz-actions {
  margin-top: 20px;
}


/* ============================================================
   Simulator landing: coverage badge + synthetic mock builder
   ============================================================ */

.simulator-coverage {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--page-bg);
}

.simulator-coverage-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.simulator-coverage-legend {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  align-items: center;
}

.cov-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: -1px;
}

.cov-dot.cov-verbatim { background: var(--green); }
.cov-dot.cov-synthetic { background: var(--brand); }

.simulator-coverage-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 720px) {
  .simulator-coverage-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.coverage-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  text-align: center;
}

.coverage-cell.verbatim {
  border-color: color-mix(in srgb, var(--green) 35%, transparent);
  background: color-mix(in srgb, var(--green-soft) 60%, var(--card-bg));
}

.coverage-cell.synthetic {
  border-color: color-mix(in srgb, var(--brand) 35%, transparent);
  background: color-mix(in srgb, var(--brand-soft) 60%, var(--card-bg));
}

.coverage-cell-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.coverage-cell-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.coverage-cell-source {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 2px;
}

.coverage-cell.verbatim .coverage-cell-source { color: var(--green); }
.coverage-cell.synthetic .coverage-cell-source { color: var(--brand-strong); }

.simulator-coverage-note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.simulator-coverage-note a {
  color: var(--brand-strong);
  text-decoration: underline;
}

.simulator-cta-sub {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Synthetic mock builder */
.simulator-synthetic {
  margin: 0 0 24px;
  padding: 20px 22px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
}

.simulator-synthetic-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.simulator-synthetic-blurb {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.synthetic-scenarios {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}

@media (max-width: 720px) {
  .synthetic-scenarios {
    grid-template-columns: 1fr;
  }
}

.synthetic-scenario {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.synthetic-scenario:hover {
  border-color: var(--border-strong);
}

.synthetic-scenario input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.synthetic-scenario:has(input[type="checkbox"]:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.synthetic-scenario-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.synthetic-scenario-num {
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}

.synthetic-scenario-source {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.synthetic-scenario:has(input[type="checkbox"]:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.synthetic-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.synthetic-counter {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.synthetic-counter strong {
  color: var(--text);
}


/* ============================================================
   Auth bar (shows current user + sign-out when authenticated)
   ============================================================ */

.auth-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-bar-text strong {
  color: var(--text);
  font-weight: 600;
}

.auth-signout-btn {
  background: transparent;
  border: none;
  color: var(--brand-strong);
  cursor: pointer;
  font: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 120ms ease;
}

.auth-signout-btn:hover {
  background: var(--brand-soft);
}

/* Hide auth bar during the quiz so the quiz chrome stays minimal */
body.in-quiz .auth-bar {
  display: none;
}

/* ============================================================
   Login screen
   ============================================================ */

/* When the user is on the login screen, center the page header so the
   title visually aligns with the centered login card below it. */
body.on-login .page-header {
  text-align: center;
}
body.on-login .page-header .subtitle {
  margin-left: auto;
  margin-right: auto;
}
body.on-login .page-divider {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.login-card {
  max-width: 420px;
  margin: 24px auto 0;
  padding: 36px 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.login-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.login-blurb {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.login-field input {
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.login-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  background: var(--red-soft);
  border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
  border-radius: 8px;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 500;
}

.login-submit {
  margin-top: 4px;
  width: 100%;
}

