/* TBA Exams - Premium UI */
:root {
  --tba-emerald: #0f5e4a;
  --tba-emerald-deep: #0a3f31;
  --tba-emerald-soft: #e6f1ec;
  --tba-cream: #fbf6e9;
  --tba-ivory: #fffdf7;
  --tba-amber: #b8862f;
  --tba-amber-bright: #e6b85c;
  --tba-ink: #1a2622;
  --tba-mute: #5a6b66;
  --tba-line: #e3dfd1;
  --tba-correct: #1f8a5c;
  --tba-correct-soft: #e6f6ed;
  --tba-wrong: #b3392b;
  --tba-wrong-soft: #fbe9e6;
  --tba-radius: 14px;
  --tba-shadow: 0 8px 28px rgba(10,63,49,.08);
  --tba-font-serif: 'Playfair Display', 'DM Serif Display', Georgia, serif;
  --tba-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.tba-exam *, .tba-exam *::before, .tba-exam *::after { box-sizing: border-box; }

.tba-exam {
  background: var(--tba-ivory);
  color: var(--tba-ink);
  font-family: var(--tba-font-sans);
  border: 1px solid var(--tba-line);
  border-radius: var(--tba-radius);
  box-shadow: var(--tba-shadow);
  padding: clamp(20px, 4vw, 40px);
  max-width: 880px;
  margin: 32px auto;
  line-height: 1.55;
}

.tba-exam__header { border-bottom: 1px solid var(--tba-line); padding-bottom: 18px; margin-bottom: 24px; }
.tba-exam__category { color: var(--tba-amber); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: 12px; margin: 0 0 8px; }
.tba-exam__title { font-family: var(--tba-font-serif); font-weight: 700; font-size: clamp(26px, 4vw, 36px); margin: 0 0 8px; color: var(--tba-emerald-deep); line-height: 1.15; }
.tba-exam__subtitle { color: var(--tba-mute); margin: 0 0 16px; font-size: 16px; }

.tba-exam__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.tba-pill { background: var(--tba-emerald-soft); color: var(--tba-emerald-deep); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.tba-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tba-mute); margin-left: auto; cursor: pointer; }
.tba-toggle input { accent-color: var(--tba-emerald); width: 16px; height: 16px; }

.tba-progress { background: var(--tba-line); height: 6px; border-radius: 999px; overflow: hidden; }
.tba-progress__bar { background: linear-gradient(90deg, var(--tba-emerald), var(--tba-amber)); height: 100%; width: 0%; transition: width .35s ease; }
.tba-progress__label { color: var(--tba-mute); font-size: 13px; margin: 8px 0 0; display: flex; gap: 8px; }
.tba-progress__label .tba-timer { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Stage / question card */
.tba-question { animation: tbaIn .35s ease; }
@keyframes tbaIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tba-question__num { color: var(--tba-mute); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 6px; }
.tba-question__stem { font-family: var(--tba-font-serif); font-size: clamp(20px, 2.6vw, 26px); color: var(--tba-emerald-deep); margin: 0 0 22px; line-height: 1.35; }

.tba-choices { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.tba-choice { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 2px solid var(--tba-line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .18s, background .18s, transform .12s; min-height: 56px; }
.tba-choice:hover { border-color: var(--tba-emerald); background: #fdfcf6; }
.tba-choice:active { transform: translateY(1px); }
.tba-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tba-choice__key { width: 32px; height: 32px; border-radius: 8px; background: var(--tba-emerald-soft); color: var(--tba-emerald-deep); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.tba-choice__text { font-size: 16px; color: var(--tba-ink); }
.tba-choice.is-selected { border-color: var(--tba-emerald); background: #f3faf6; }
.tba-choice.is-selected .tba-choice__key { background: var(--tba-emerald); color: #fff; }
.tba-choice.is-correct { border-color: var(--tba-correct); background: var(--tba-correct-soft); }
.tba-choice.is-correct .tba-choice__key { background: var(--tba-correct); color: #fff; }
.tba-choice.is-wrong { border-color: var(--tba-wrong); background: var(--tba-wrong-soft); }
.tba-choice.is-wrong .tba-choice__key { background: var(--tba-wrong); color: #fff; }

/* Bookmark toggle */
.tba-bookmark { background: none; border: none; color: var(--tba-mute); cursor: pointer; font-size: 14px; padding: 6px 0; display: inline-flex; align-items: center; gap: 6px; }
.tba-bookmark.is-on { color: var(--tba-amber); }
.tba-bookmark svg { width: 18px; height: 18px; }

/* Reveal block */
.tba-reveal { display: none; margin-top: 18px; padding: 22px; border-radius: 12px; background: #fbfaf2; border: 1px solid var(--tba-line); }
.tba-reveal.is-on { display: block; animation: tbaIn .3s ease; }
.tba-reveal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tba-reveal__head .tba-tag { background: var(--tba-correct); color: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.tba-reveal__head .tba-tag.is-wrong { background: var(--tba-wrong); }
.tba-reveal__head h3 { font-family: var(--tba-font-serif); font-size: 20px; color: var(--tba-emerald-deep); margin: 0; }
.tba-reveal h4 { font-family: var(--tba-font-serif); font-size: 17px; color: var(--tba-emerald-deep); margin: 16px 0 6px; }
.tba-reveal p { margin: 0 0 10px; color: var(--tba-ink); }
.tba-reveal ul { margin: 0 0 10px; padding-left: 22px; }
.tba-reveal li { margin-bottom: 8px; }
.tba-reveal .tba-analogy { background: #fff; border: 1px dashed var(--tba-amber); padding: 12px 14px; border-radius: 10px; margin-bottom: 8px; }
.tba-reveal .tba-analogy::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--tba-amber); margin-right: 8px; vertical-align: middle; }
.tba-reveal .tba-distractor { padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--tba-line); margin-bottom: 6px; font-size: 14.5px; }
.tba-reveal .tba-distractor strong { color: var(--tba-wrong); margin-right: 6px; }
.tba-reveal .tba-related { display: inline-flex; align-items: center; gap: 6px; color: var(--tba-emerald); text-decoration: underline; font-weight: 600; margin-top: 6px; }

/* Footer / nav */
.tba-exam__footer { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.tba-btn { font-family: var(--tba-font-sans); font-weight: 600; font-size: 16px; padding: 14px 22px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; transition: transform .12s, background .18s, color .18s, border-color .18s; min-height: 48px; }
.tba-btn:disabled { opacity: .4; cursor: not-allowed; }
.tba-exam [hidden] { display: none !important; }
.tba-btn--primary { background: var(--tba-emerald); color: #fff; }
.tba-btn--primary:hover:not(:disabled) { background: var(--tba-emerald-deep); }
.tba-btn--ghost { background: transparent; border-color: var(--tba-line); color: var(--tba-emerald-deep); }
.tba-btn--ghost:hover:not(:disabled) { border-color: var(--tba-emerald); }
.tba-btn--gold { background: linear-gradient(135deg, var(--tba-amber-bright), var(--tba-amber)); color: #fff; }
.tba-btn--gold:hover:not(:disabled) { filter: brightness(.97); }
.tba-prev { margin-right: auto; }

/* Results screen */
.tba-results { text-align: center; padding: 24px 8px; }
.tba-results__score { font-family: var(--tba-font-serif); font-size: clamp(48px, 8vw, 72px); color: var(--tba-emerald-deep); margin: 0; line-height: 1; }
.tba-results__pct { color: var(--tba-amber); font-size: clamp(20px, 3vw, 28px); font-family: var(--tba-font-serif); }
.tba-results h2 { font-family: var(--tba-font-serif); font-size: 26px; color: var(--tba-emerald-deep); margin: 22px 0 8px; }
.tba-results p { color: var(--tba-mute); margin: 0 0 18px; }
.tba-results__breakdown { text-align: left; max-width: 560px; margin: 18px auto; padding: 0; list-style: none; }
.tba-results__breakdown li { padding: 12px 14px; border: 1px solid var(--tba-line); border-radius: 10px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; background: #fff; }
.tba-results__breakdown .tba-mark { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; }
.tba-results__breakdown .tba-mark.ok { background: var(--tba-correct); }
.tba-results__breakdown .tba-mark.no { background: var(--tba-wrong); }
.tba-results__cta { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Mobile tuning - tap targets, no overlap */
@media (max-width: 600px) {
  .tba-exam { padding: 18px; margin: 16px auto; }
  .tba-exam__title { font-size: 24px; }
  .tba-question__stem { font-size: 18px; }
  .tba-choice { padding: 14px; min-height: 60px; }
  .tba-choice__text { font-size: 15.5px; }
  .tba-btn { width: 100%; padding: 14px 18px; }
  .tba-prev { order: 3; }
  .tba-submit, .tba-next, .tba-finish { order: 1; }
  .tba-exam__footer { flex-direction: column-reverse; }
  .tba-toggle { margin-left: 0; }
  .tba-progress__label { flex-wrap: wrap; }
}

/* Focus visibility */
.tba-choice:focus-within, .tba-btn:focus-visible, .tba-bookmark:focus-visible {
  outline: 3px solid