/* ─────────────────────────────────────────────────────────────────
   IELTS Reading practice — passage engine styles.
   Mirrors the cream-paper aesthetic of the lesson pages but with a
   split-screen layout: passage on the left, questions on the right.
   ───────────────────────────────────────────────────────────── */

/* ── Practice library index page ──────────────────────────────── */
.rd-pr-index-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}
/* This page renders on the dark IELTS shell, so use IELTS palette
   variables (cream / soft cream) for any text outside the cream cards. */
.rd-pr-index-lede {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ielts-ink-soft, #B6A484);
  margin: .8rem 0 0;
  max-width: 720px;
}
/* 4-up grid — passages are catalogue items, not big lesson cards.
   Cards are squarer (closer to 1:1) so a dense library still scans
   cleanly. Drops to 3 / 2 / 1 columns as the viewport narrows. */
.rd-pr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (max-width: 1100px) {
  .rd-pr-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .rd-pr-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .rd-pr-grid { grid-template-columns: 1fr; }
}
.rd-pr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .8rem;
  aspect-ratio: 1 / 1;
  padding: 1.1rem 1.15rem;
  background: var(--paper, #F5EBD3);
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.12));
  border-radius: 10px;
  text-decoration: none;
  color: var(--paper-ink, #1F1812);
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.rd-pr-card:hover {
  transform: translateY(-2px);
  border-color: var(--paper-honey, #B57A2E);
  box-shadow: 0 12px 28px -16px rgba(31,24,18,.25);
}
/* Completed-passage card — visually distinct "stamped" treatment.
   Stronger green wash over cream + a giant translucent checkmark
   behind the text + slightly faded title/meta so the card reads as
   "filed away / completed" at a glance, not just lightly tinted. */
.rd-pr-card[data-done="true"] {
  border: 1px solid rgba(47, 125, 79, .55);
  background:
    linear-gradient(135deg, rgba(47, 125, 79, .16), rgba(47, 125, 79, .26)),
    var(--paper, #F5EBD3);
  overflow: hidden;
}
.rd-pr-card[data-done="true"]:hover {
  border-color: #2F7D4F;
  box-shadow: 0 12px 28px -16px rgba(47, 125, 79, .45);
}
/* Big translucent checkmark sitting behind the card content. The
   children get an explicit z-index in the rule below so text reads
   cleanly on top of the watermark. */
.rd-pr-card[data-done="true"]::after {
  content: '✓';
  position: absolute;
  bottom: -1.2rem;
  right: -.5rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 7.5rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(47, 125, 79, .18);
  pointer-events: none;
  z-index: 0;
}
.rd-pr-card[data-done="true"] > * {
  position: relative;
  z-index: 1;
}
.rd-pr-card[data-done="true"] .rd-pr-card-tag {
  color: #2F7D4F;
}
.rd-pr-card[data-done="true"] .rd-pr-card-title {
  opacity: .82;
}
.rd-pr-card[data-done="true"] .rd-pr-card-meta {
  opacity: .65;
}

/* Score badge in the top-right — more prominent on done cards. */
.rd-pr-card-badge {
  position: absolute;
  top: .35rem;
  right: .65rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--paper, #F5EBD3);
  background: #2F7D4F;
  border: 0;
  padding: .28rem .65rem;
  border-radius: 99px;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 2px 6px -2px rgba(47, 125, 79, .55);
}
.rd-pr-card-tag {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--paper-honey, #B57A2E);
}
.rd-pr-card-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.32rem;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -.012em;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rd-pr-card-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  color: var(--paper-ink-soft, #4A3F33);
  margin-top: .15rem;
}
/* ── Filter chips on the practice library ────────────────────── */
.rd-pr-filters {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  margin: 1.5rem 0 1rem;
  padding: 1.1rem 1.2rem;
  background: rgba(242, 230, 204, .04);
  border: 1px solid var(--ielts-line, rgba(242,230,204,.10));
  border-radius: 10px;
}
.rd-pr-filter-row {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  flex-wrap: wrap;
}
.rd-pr-filter-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ielts-ink-soft, #B6A484);
  flex-shrink: 0;
  width: 80px;
}
.rd-pr-filter-chips {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  flex: 1;
}
.rd-pr-filter-chip {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 500;
  padding: .4rem .9rem;
  border-radius: 99px;
  border: 1px solid var(--ielts-line-strong, rgba(242,230,204,.18));
  background: transparent;
  color: var(--ielts-ink-soft, #B6A484);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.rd-pr-filter-chip:hover {
  color: var(--ielts-ink, #F2E6CC);
  border-color: var(--ielts-honey, #D9A268);
}
.rd-pr-filter-chip.is-active {
  background: var(--ielts-honey, #D9A268);
  color: #1B1410;
  border-color: var(--ielts-honey, #D9A268);
}
.rd-pr-filter-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .78rem;
  color: var(--ielts-ink-mute, #7A6A52);
  font-style: italic;
}
.rd-pr-filter-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ielts-ink-soft, #B6A484);
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
}

.rd-practice-all {
  display: inline-block;
  margin-top: 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .88rem;
  font-weight: 500;
  color: var(--paper-honey, #B57A2E);
  text-decoration: none;
  transition: color .15s;
}
.rd-practice-all:hover { color: #9C691E; }

.rd-pr-empty {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
  color: var(--paper-ink-soft, #4A3F33);
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
}

/* ── Practice passage page ────────────────────────────────────── */
.rd-pr-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 2rem 6rem;
}
.rd-pr-head {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(242, 230, 204, .08);
}
.rd-pr-eyebrow {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper-honey, #B57A2E);
  margin-bottom: .5rem;
}
.rd-pr-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -.018em;
  margin: 0;
  color: var(--ielts-ink, #F2E6CC);
}
.rd-pr-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  color: var(--ielts-ink-soft, #B6A484);
  margin: .4rem 0 0;
}

/* ── Score banner (post-submit) ───────────────────────────────
   Use :not([hidden]) so the [hidden] attribute actually hides this —
   bare `display: flex` would override [hidden]'s display:none. */
.rd-pr-score-banner[hidden] { display: none; }
.rd-pr-score-banner:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.4rem;
  background: var(--paper, #F5EBD3);
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.18));
  border-radius: 10px;
  margin: 0 0 1.2rem;
  flex-wrap: wrap;
}
.rd-pr-score-num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--paper-honey, #B57A2E);
  line-height: 1;
}
.rd-pr-score-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .98rem;
  color: var(--paper-ink, #1F1812);
  flex: 1;
}
.rd-pr-score-redo,
.rd-pr-score-back {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  font-weight: 500;
  padding: .55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.18));
  background: var(--paper-tint, #EFE2C4);
  color: var(--paper-ink, #1F1812);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.rd-pr-score-redo:hover,
.rd-pr-score-back:hover {
  background: var(--paper-deep, #E7D6B0);
  border-color: var(--paper-honey, #B57A2E);
}

/* ── Split layout ─────────────────────────────────────────────── */
.rd-pr-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 920px) {
  .rd-pr-split { grid-template-columns: 1fr; }
}

/* ── Passage column ───────────────────────────────────────────── */
.rd-pr-passage-col {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: .6rem;
}
@media (max-width: 920px) {
  .rd-pr-passage-col {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
}
.rd-pr-intro {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  font-style: italic;
  color: var(--ielts-ink-soft, #B6A484);
  margin: 0 0 .9rem;
}
.rd-pr-passage {
  background: var(--paper, #F5EBD3);
  border: 1px solid var(--paper-line, rgba(31,24,18,.10));
  border-radius: 12px;
  padding: 1.8rem 2rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.04rem;
  line-height: 1.78;
  color: var(--paper-ink, #1F1812);
}
.rd-pr-para {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: .9rem;
  margin-bottom: 1.1rem;
}
.rd-pr-para:last-child { margin-bottom: 0; }
.rd-pr-para-id {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--paper-honey, #B57A2E);
  padding-top: .15rem;
}
.rd-pr-para-body p { margin: 0; }

/* Evidence span — invisible by default, lights up on click. */
.rd-pr-ev {
  background: transparent;
  border-radius: 3px;
  padding: 0;
  transition: background .25s, box-shadow .25s, padding .15s;
}
.rd-pr-ev.is-highlighted {
  background: rgba(217, 162, 104, .42);
  padding: 1px 3px;
  box-shadow: inset 0 -1.5px 0 var(--paper-honey, #B57A2E);
  animation: rd-pr-pulse 1.6s ease-out;
}
@keyframes rd-pr-pulse {
  0%   { background: rgba(217, 162, 104, .8);  box-shadow: 0 0 0 6px rgba(217, 162, 104, .35); }
  100% { background: rgba(217, 162, 104, .42); box-shadow: inset 0 -1.5px 0 var(--paper-honey, #B57A2E); }
}

/* ── Questions column ─────────────────────────────────────────── */
.rd-pr-q-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.rd-pr-q-col-head h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ielts-ink, #F2E6CC);
  margin: 0 0 .25rem;
}

/* Number-tab navigator — colour-coded by state, click-to-jump.
   Empty = pristine, honey = answered, deep honey = active, green =
   correct (post-submit), ember = wrong (post-submit). */
.rd-pr-q-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .5rem 0 .9rem;
  padding: .55rem .65rem;
  background: rgba(242, 230, 204, .04);
  border: 1px solid var(--ielts-line, rgba(242,230,204,.10));
  border-radius: 8px;
}
.rd-pr-q-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--ielts-line-strong, rgba(242,230,204,.18));
  color: var(--ielts-ink-soft, #B6A484);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.rd-pr-q-nav-btn:hover {
  border-color: var(--ielts-honey, #D9A268);
  color: var(--ielts-ink, #F2E6CC);
}
.rd-pr-q-nav-btn.is-answered {
  background: rgba(217, 162, 104, .18);
  color: var(--ielts-ink, #F2E6CC);
  border-color: rgba(217, 162, 104, .55);
}
.rd-pr-q-nav-btn.is-active {
  background: var(--ielts-honey, #D9A268);
  color: #1B1410;
  border-color: var(--ielts-honey, #D9A268);
  box-shadow: 0 2px 8px -2px rgba(217, 162, 104, .55);
}
.rd-pr-q-nav-btn.is-correct {
  background: rgba(47, 125, 79, .22);
  color: #5BB079;
  border-color: rgba(47, 125, 79, .55);
}
.rd-pr-q-nav-btn.is-correct.is-active {
  background: #2F7D4F;
  color: var(--ielts-ink, #F2E6CC);
  border-color: #2F7D4F;
  box-shadow: 0 2px 8px -2px rgba(47, 125, 79, .55);
}
.rd-pr-q-nav-btn.is-wrong {
  background: rgba(216, 104, 64, .15);
  color: var(--ielts-ember, #D86840);
  border-color: rgba(216, 104, 64, .55);
}
.rd-pr-q-nav-btn.is-wrong.is-active {
  background: var(--ielts-ember, #D86840);
  color: var(--ielts-ink, #F2E6CC);
  border-color: var(--ielts-ember, #D86840);
  box-shadow: 0 2px 8px -2px rgba(216, 104, 64, .55);
}

/* Pager — Previous / Question N of M / Next. */
.rd-pr-q-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: 1rem;
  padding: .55rem .9rem;
  background: rgba(242, 230, 204, .04);
  border: 1px solid var(--ielts-line, rgba(242,230,204,.10));
  border-radius: 8px;
}
.rd-pr-q-prev,
.rd-pr-q-next {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 500;
  padding: .45rem .9rem;
  background: transparent;
  border: 1px solid var(--ielts-line-strong, rgba(242,230,204,.18));
  border-radius: 6px;
  color: var(--ielts-ink-soft, #B6A484);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.rd-pr-q-prev:hover:not(:disabled),
.rd-pr-q-next:hover:not(:disabled) {
  color: var(--ielts-ink, #F2E6CC);
  border-color: var(--ielts-honey, #D9A268);
}
.rd-pr-q-prev:disabled,
.rd-pr-q-next:disabled {
  opacity: .35;
  cursor: not-allowed;
}
/* Next button on the last question (pre-submit) becomes the Submit
   action — fill it with honey so it reads as a primary action. */
.rd-pr-q-next.is-submit {
  background: var(--ielts-honey, #D9A268);
  color: #1B1410;
  border-color: var(--ielts-honey, #D9A268);
  font-weight: 600;
}
.rd-pr-q-next.is-submit:hover:not(:disabled) {
  background: #C58A50;
  color: #1B1410;
  border-color: #C58A50;
}
.rd-pr-q-pager-status {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  color: var(--ielts-ink-soft, #B6A484);
}

.rd-pr-q-stack {
  /* Single-question container — only the active question is visible
     at a time (others have hidden attribute). No max-height needed
     since one question is always short. */
}

/* ── Question card ────────────────────────────────────────────── */
.rd-pr-q {
  background: var(--paper, #F5EBD3);
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.10));
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  transition: border-color .2s, box-shadow .2s;
}
.rd-pr-q-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .6rem;
  flex-wrap: wrap;
}
.rd-pr-q-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--paper-tint, #EFE2C4);
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.18));
  border-radius: 50%;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: .92rem;
  color: var(--paper-honey, #B57A2E);
  flex-shrink: 0;
}
.rd-pr-q-type {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper-ink-soft, #4A3F33);
}
.rd-pr-q-limit {
  margin-left: auto;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--paper-ember, #B6442C);
  background: rgba(182, 68, 44, .08);
  padding: .15rem .4rem;
  border-radius: 4px;
}
.rd-pr-q-stem {
  margin: 0 0 .7rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--paper-ink, #1F1812);
}

/* ── Options (radio-style) ────────────────────────────────────── */
.rd-pr-q-opts {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.rd-pr-q-opts-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: .4rem;
}
.rd-pr-opt {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .75rem;
  background: var(--paper-tint, #EFE2C4);
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.14));
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.rd-pr-opt:hover {
  background: var(--paper-deep, #E7D6B0);
  border-color: var(--paper-honey, #B57A2E);
}
.rd-pr-opt input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--paper-line-strong, rgba(31,24,18,.30));
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  position: relative;
  transition: border-color .12s, background .12s;
}
.rd-pr-opt input[type="radio"]:checked {
  border-color: var(--paper-honey, #B57A2E);
}
.rd-pr-opt input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  background: var(--paper-honey, #B57A2E);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.rd-pr-opt input[type="radio"]:disabled { cursor: default; }
.rd-pr-opt input[type="radio"]:disabled + .rd-pr-opt-mark { opacity: .55; }
.rd-pr-opt-mark { display: none; } /* using ::after pseudo on radio instead */
.rd-pr-opt-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9rem;
  color: var(--paper-ink, #1F1812);
  line-height: 1.4;
}
.rd-pr-opt-tfng {
  flex: 1;
  justify-content: center;
}
.rd-pr-opt-tfng .rd-pr-opt-label {
  font-weight: 600;
  letter-spacing: .04em;
  font-size: .82rem;
}
.rd-pr-q-opts:has(.rd-pr-opt-tfng) {
  flex-direction: row;
  gap: .4rem;
}
@media (max-width: 480px) {
  .rd-pr-q-opts:has(.rd-pr-opt-tfng) { flex-direction: column; }
}

/* Pill-style options for matching-info (paragraph picker) */
.rd-pr-opt-pill {
  flex: 0 0 auto;
  min-width: 56px;
  padding: .5rem .9rem;
  justify-content: center;
}
.rd-pr-opt-pill .rd-pr-opt-label {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--paper-honey, #B57A2E);
}
.rd-pr-opt-pill input[type="radio"]:checked + .rd-pr-opt-mark + .rd-pr-opt-label,
.rd-pr-opt-pill:has(input:checked) .rd-pr-opt-label {
  color: var(--paper-ink, #1F1812);
}

/* ── Text inputs (completion / short answer) ──────────────────── */
.rd-pr-q-input {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: .98rem;
  padding: .5rem .7rem;
  background: var(--paper-tint, #EFE2C4);
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.18));
  border-radius: 6px;
  color: var(--paper-ink, #1F1812);
  outline: none;
  transition: border-color .12s, background .12s;
  width: 100%;
  box-sizing: border-box;
}
.rd-pr-q-input:focus {
  border-color: var(--paper-honey, #B57A2E);
  background: var(--paper, #F5EBD3);
}
.rd-pr-q-input-inline {
  display: inline-block;
  width: auto;
  min-width: 130px;
  padding: .25rem .55rem;
  margin: 0 .2rem;
  font-size: 1rem;
  border-bottom: 1.5px solid var(--paper-honey, #B57A2E);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: rgba(217, 162, 104, .12);
}
.rd-pr-q-input-inline:focus {
  background: rgba(217, 162, 104, .22);
  border-bottom-color: var(--paper-ember, #B6442C);
}

/* ── Submitted state — colored borders ───────────────────────── */
.rd-pr-q.is-submitted {
  pointer-events: auto; /* still allow review-button clicks */
}
/* Submitted-state colors layer a tint OVER the cream base — replacing
   the cream entirely (with rgba alone) makes the card transparent on
   the dark IELTS shell and wipes out all the dark-on-cream text. */
.rd-pr-q.is-correct {
  border-color: rgba(47, 125, 79, .60);
  background:
    linear-gradient(rgba(47, 125, 79, .09), rgba(47, 125, 79, .09)),
    var(--paper, #F5EBD3);
}
.rd-pr-q.is-wrong {
  border-color: rgba(182, 68, 44, .60);
  background:
    linear-gradient(rgba(182, 68, 44, .08), rgba(182, 68, 44, .08)),
    var(--paper, #F5EBD3);
}
.rd-pr-q.is-submitted .rd-pr-opt {
  cursor: default;
}
.rd-pr-q.is-submitted .rd-pr-opt:hover {
  background: var(--paper-tint, #EFE2C4);
  border-color: var(--paper-line-strong, rgba(31,24,18,.14));
}

/* ── Post-submit verdict on option buttons ────────────────────
   The user sees right/wrong from the buttons themselves: a green
   ring + ✓ on the correct option, a red ring + ✗ on their wrong
   pick. Eliminates the noisy "Your answer: X · Correct: Y" line. */
.rd-pr-opt.is-correct-answer {
  border-color: #2F7D4F;
  background: rgba(47, 125, 79, .14);
  color: #1F1812;
}
.rd-pr-opt.is-correct-answer::after {
  content: '✓';
  margin-left: auto;
  padding-left: .55rem;
  color: #2F7D4F;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.rd-pr-opt.is-user-wrong {
  border-color: var(--paper-ember, #B6442C);
  background: rgba(182, 68, 44, .12);
}
.rd-pr-opt.is-user-wrong::after {
  content: '✗';
  margin-left: auto;
  padding-left: .55rem;
  color: var(--paper-ember, #B6442C);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.rd-pr-opt.is-correct-answer .rd-pr-opt-label,
.rd-pr-opt.is-user-wrong .rd-pr-opt-label {
  font-weight: 500;
}

/* ── Per-question review panel (post-submit) ──────────────────── */
.rd-pr-q-review {
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--paper-line-strong, rgba(31,24,18,.18));
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.rd-pr-rev-status {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.rd-pr-rev-status.is-correct {
  color: #2F7D4F;
}
.rd-pr-rev-status.is-wrong {
  color: var(--paper-ember, #B6442C);
}
.rd-pr-rev-correct-inline {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: .92rem;
  color: var(--paper-ink, #1F1812);
}
.rd-pr-rev-correct-inline b {
  color: #2F7D4F;
  font-weight: 600;
}
.rd-pr-rev-explain {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--paper-ink, #1F1812);
  background: rgba(255, 255, 255, .35);
  border-left: 2px solid var(--paper-honey, #B57A2E);
  padding: .6rem .8rem;
  border-radius: 0 6px 6px 0;
}
.rd-pr-rev-evidence {
  align-self: flex-start;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 500;
  padding: .4rem .8rem;
  background: var(--paper-honey, #B57A2E);
  color: var(--paper, #F5EBD3);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.rd-pr-rev-evidence:hover { background: #9C691E; }

/* ── Confirm modal ─────────────────────────────────────────────
   In-page replacement for window.confirm() so dialogs match the
   cream-paper aesthetic. Dark backdrop blurs the underlying page;
   cream card fades + slides in. Click outside or press Escape to
   cancel; Enter or click the confirm button to proceed. */
.rd-pr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, .65);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rd-pr-modal-fadein .15s ease-out;
}
@keyframes rd-pr-modal-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.rd-pr-modal {
  background: var(--paper, #F5EBD3);
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.18));
  border-radius: 12px;
  padding: 1.6rem 1.8rem 1.3rem;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,.55);
  animation: rd-pr-modal-slide .2s ease-out;
}
@keyframes rd-pr-modal-slide {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.rd-pr-modal-message {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--paper-ink, #1F1812);
  margin: 0 0 1.2rem;
}
.rd-pr-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
}
.rd-pr-modal-cancel,
.rd-pr-modal-confirm {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .88rem;
  font-weight: 500;
  padding: .55rem 1.15rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.rd-pr-modal-cancel {
  background: transparent;
  border: 1px solid var(--paper-line-strong, rgba(31,24,18,.18));
  color: var(--paper-ink, #1F1812);
}
.rd-pr-modal-cancel:hover {
  background: var(--paper-tint, #EFE2C4);
  border-color: var(--paper-honey, #B57A2E);
}
.rd-pr-modal-confirm {
  background: var(--paper-honey, #B57A2E);
  border: 1px solid var(--paper-honey, #B57A2E);
  color: var(--paper, #F5EBD3);
  font-weight: 600;
}
.rd-pr-modal-confirm:hover {
  background: #9C691E;
  border-color: #9C691E;
}
.rd-pr-modal-confirm:focus {
  outline: 2px solid var(--paper-honey, #B57A2E);
  outline-offset: 2px;
}

/* ── Submit bar ───────────────────────────────────────────────── */
.rd-pr-submit-bar {
  position: sticky;
  bottom: 1rem;
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  z-index: 10;
}
.rd-pr-submit {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .85rem 2rem;
  background: var(--paper-honey, #B57A2E);
  color: var(--paper, #F5EBD3);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 20px -8px rgba(31,24,18,.4);
  transition: background .15s, transform .12s;
}
.rd-pr-submit:hover {
  background: #9C691E;
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────
   Reading Practice — landing page (single-button redesign).
   The whole page sits on the dark IELTS shell with cream paper
   cards as the focal elements, matching the lesson pages.
   ───────────────────────────────────────────────────────────── */

.rd-pr-hero {
  text-align: center;
  margin: 1.5rem 0 2.4rem;
}
.rd-pr-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ielts-honey, #D9A268);
  margin-bottom: .7rem;
}
.rd-pr-hero-eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px color-mix(in srgb, currentColor 60%, transparent);
}
.rd-pr-hero-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.05;
  color: var(--ielts-ink, #F2E6CC);
  margin: 0 0 .8rem;
}
.rd-pr-hero-lede {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ielts-ink-soft, #B6A484);
  margin: 0 auto;
  max-width: 56ch;
}

/* ── Stats strip (above the launch button) ─────────────────── */
.rd-pr-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
  max-width: 600px;
  margin: 0 auto 2.4rem;
}
.rd-pr-stats-compact { margin-top: 1.6rem; margin-bottom: 2.2rem; }
.rd-pr-stat {
  text-align: center;
  padding: 1.1rem .9rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.97) 0%, rgba(243, 233, 211, 0.95) 100%);
  border: 1px solid rgba(31, 24, 18, 0.10);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 8px 20px -14px rgba(0, 0, 0, 0.45);
}
.rd-pr-stat.is-highlight {
  border-color: rgba(181, 122, 46, 0.42);
  background:
    radial-gradient(70% 80% at 50% 0%, rgba(181, 122, 46, 0.16) 0%, transparent 70%),
    linear-gradient(180deg, rgba(255, 251, 240, 0.97) 0%, rgba(243, 233, 211, 0.95) 100%);
}
.rd-pr-stat-num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.95rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  color: #1F1812;
}
.rd-pr-stat.is-highlight .rd-pr-stat-num { color: #B57A2E; }
.rd-pr-stat-l {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7A6A55;
  margin-top: .4rem;
}

/* First-run "no stats yet" framing. */
.rd-pr-firstrun {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: 0 auto 2.4rem;
  padding: .85rem 1.2rem;
  max-width: 560px;
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.97) 0%, rgba(243, 233, 211, 0.95) 100%);
  border: 1px dashed rgba(181, 122, 46, 0.4);
  border-radius: 999px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .88rem;
  color: #1F1812;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.rd-pr-firstrun-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--paper-honey, #B57A2E);
  box-shadow: 0 0 8px color-mix(in srgb, #B57A2E 60%, transparent);
}

/* ── The big launch button + reveal animation ───────────────── */
.rd-pr-launch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 0 auto 3rem;
  max-width: 600px;
}

.rd-pr-launch-btn {
  /* Cream-paper-on-honey hybrid: warm honey gradient with a bright
     inner highlight, ink-coloured text. Reads as the focal object on
     the dark page. Wide and deep so it's the obvious target. */
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 1.85rem 1.5rem 1.7rem;
  min-height: 96px;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #F0BE7E 0%, #D9A268 55%, #B98248 100%);
  color: #2A1F17;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 14px 30px -10px color-mix(in srgb, #B98248 60%, transparent),
    0 0 0 1px rgba(0, 0, 0, 0.15);
  transition:
    transform .22s cubic-bezier(.2,.8,.2,1),
    box-shadow .22s,
    filter .15s;
}
.rd-pr-launch-btn:not([disabled]):hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 22px 42px -10px color-mix(in srgb, #B98248 70%, transparent),
    0 0 0 1px rgba(0, 0, 0, 0.15);
}
.rd-pr-launch-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Soft sweep highlight that drifts across the button at rest — a slow
   "ready" pulse, much subtler than the AI badge shine. */
.rd-pr-launch-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -30%;
  width: 35%; height: 200%;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 70%);
  transform: skewX(-18deg);
  animation: rd-pr-btn-sweep 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes rd-pr-btn-sweep {
  0%, 100% { left: -30%; }
  55%      { left: 120%; }
}

.rd-pr-launch-btn-icon {
  display: inline-flex;
  width: 32px; height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(31, 24, 18, 0.18);
  color: #2A1F17;
  margin-bottom: .15rem;
}
.rd-pr-launch-btn-label {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.1;
}

/* Loading state — spinner replaces icon. */
.rd-pr-launch-btn.is-loading::after { animation: none; opacity: 0; }
.rd-pr-launch-btn-spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(31, 24, 18, 0.20);
  border-top-color: #2A1F17;
  animation: rd-pr-spin .8s linear infinite;
  margin-bottom: .2rem;
}
@keyframes rd-pr-spin { to { transform: rotate(360deg); } }

/* Reveal state — topic eyebrow + passage title + "Opening…" line.
   Fade-in is staggered so the elements land in sequence. */
.rd-pr-launch-btn.is-revealed { cursor: default; }
.rd-pr-launch-btn.is-revealed::after { animation: none; opacity: 0; }
.rd-pr-launch-btn-topic {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(42, 31, 23, 0.78);
  animation: rd-pr-reveal-in .35s ease-out both;
}
.rd-pr-launch-btn-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: #1F1812;
  text-align: center;
  max-width: 24ch;
  animation: rd-pr-reveal-in .45s .12s ease-out both;
}
.rd-pr-launch-btn-go {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: rgba(42, 31, 23, 0.6);
  margin-top: .3rem;
  animation: rd-pr-reveal-in .4s .35s ease-out both;
}
@keyframes rd-pr-reveal-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rd-pr-launch-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--ielts-ink-soft, #B6A484);
  margin: 0;
  text-align: center;
  max-width: 50ch;
}

/* ── Practice History link (under the button) ───────────────── */
.rd-pr-history-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  padding: .95rem 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.93) 0%, rgba(243, 233, 211, 0.91) 100%);
  border: 1px solid rgba(31, 24, 18, 0.10);
  border-radius: 12px;
  color: #1F1812;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 18px -14px rgba(0, 0, 0, 0.45);
  transition: border-color .15s, transform .15s, background .15s;
}
.rd-pr-history-link:hover {
  border-color: rgba(181, 122, 46, 0.4);
  transform: translateY(-1px);
}
.rd-pr-history-link-l {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1F1812;
}
.rd-pr-history-link-r {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  color: #7A6A55;
}
.rd-pr-history-link svg {
  color: #B57A2E;
}

/* ─────────────────────────────────────────────────────────────
   Practice History page
   ───────────────────────────────────────────────────────────── */

.rd-pr-history-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 2rem 5rem;
}
.rd-pr-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.97) 0%, rgba(243, 233, 211, 0.95) 100%);
  border: 1px dashed rgba(31, 24, 18, 0.16);
  border-radius: 14px;
  color: #1F1812;
}
.rd-pr-empty-h {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: .35rem;
}
.rd-pr-empty-p {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .92rem;
  color: #4A3F33;
  margin: 0 0 1.3rem;
}
.rd-pr-empty-cta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9rem;
  font-weight: 600;
  color: #B57A2E;
  text-decoration: none;
}
.rd-pr-empty-cta:hover { text-decoration: underline; }

.rd-pr-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.rd-pr-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  padding: .95rem 1.2rem .95rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.97) 0%, rgba(243, 233, 211, 0.95) 100%);
  border: 1px solid rgba(31, 24, 18, 0.10);
  border-radius: 12px;
  color: #1F1812;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 8px 18px -16px rgba(0, 0, 0, 0.45);
  transition: border-color .15s, transform .15s;
}
.rd-pr-history-row:hover {
  border-color: rgba(181, 122, 46, 0.4);
  transform: translateX(2px);
}
.rd-pr-history-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 74px;
  padding: .5rem .75rem;
  border-radius: 11px;
  border: 1px solid transparent;
}
.rd-pr-history-score.is-strong { background: rgba(92, 138, 106, 0.14); border-color: rgba(92, 138, 106, 0.32); }
.rd-pr-history-score.is-mid    { background: rgba(181, 122, 46, 0.14); border-color: rgba(181, 122, 46, 0.32); }
.rd-pr-history-score.is-weak   { background: rgba(194, 74, 43, 0.13);  border-color: rgba(194, 74, 43, 0.30); }
.rd-pr-history-score-num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 600;
  color: #1F1812;
  line-height: 1;
}
.rd-pr-history-score-slash {
  font-weight: 400;
  color: #7A6A55;
  margin: 0 1px;
}
.rd-pr-history-score-pct {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #4A3F33;
  margin-top: .25rem;
}
.rd-pr-history-mid { min-width: 0; }
.rd-pr-history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .8rem;
  align-items: center;
  margin-bottom: .25rem;
}
.rd-pr-history-topic {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #B57A2E;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(181, 122, 46, 0.12);
}
.rd-pr-history-when {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .78rem;
  color: #7A6A55;
}
.rd-pr-history-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.04rem;
  font-weight: 500;
  line-height: 1.35;
  color: #1F1812;
  letter-spacing: -.005em;
}
.rd-pr-history-arrow {
  color: #7A6A55;
  transition: color .15s, transform .15s;
}
.rd-pr-history-row:hover .rd-pr-history-arrow {
  color: #B57A2E;
  transform: translateX(3px);
}

/* Responsive */
@media (max-width: 600px) {
  .rd-pr-stats { grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
  .rd-pr-stat { padding: .85rem .55rem .75rem; }
  .rd-pr-stat-num { font-size: 1.55rem; }
  .rd-pr-stat-l { font-size: .58rem; letter-spacing: .1em; }

  .rd-pr-hero-title { font-size: 2.05rem; }
  .rd-pr-hero-lede { font-size: .94rem; }

  .rd-pr-launch-btn { min-height: 84px; padding: 1.4rem 1.2rem 1.3rem; }
  .rd-pr-launch-btn-label { font-size: 1.25rem; }
  .rd-pr-launch-btn-title { font-size: 1.2rem; }

  .rd-pr-history-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: .85rem;
  }
  .rd-pr-history-arrow { display: none; }
  .rd-pr-history-page { padding: 1.2rem 1rem 4rem; }
}

