/* CertaRounds — Review center styles (src/screens/review.js). Owned by its screen agent.
   Semantic tokens only (docs/COMPONENTS.md §2); every rule is scoped to .rv* classes. Components and
   widgets (ModeCard, SectionHeader, WidgetPanel, RingGauge, Button) are used as they are.

   Buckets have two anatomies, chosen in JS:
     rows   (.rv-buckets > .rv-b)   phones and the desktop rail: gem · title / hint · count · chevron
     cards  (.rv-mc > ModeCard)     ≥ 768: gem / title / stat / description / Start (BACKLOG V7)
   The hero puts the 7-day forecast beside the numbers once the card itself is ≥ 620px wide. */

/* ============ Page rhythm ============ */
.rv { display: flex; flex-direction: column; gap: var(--sp-5); }
.rv .rv-head { margin-bottom: 0; }
.rv .page-header__sub { max-width: 60ch; }
.rv-groups { display: flex; flex-direction: column; gap: var(--sp-6); }
.rv-group { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.rv-group__head { display: flex; flex-direction: column; gap: 2px; }
.rv-group__sub { font-size: var(--fs-13); color: var(--text-3); line-height: 1.4; }
.rv-extras { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
@media (min-width: 768px) {
  .rv { gap: var(--sp-6); }
  .rv-groups { gap: var(--sp-7); }
  .rv-group { gap: var(--sp-4); }
  .rv-extras--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
}
.rv-rail { display: flex; flex-direction: column; gap: var(--sp-5); }
.rv-rail .rv-group { gap: var(--sp-3); }

/* ============ Resume banner ============ */
.rv-resume { display: flex; align-items: center; gap: var(--sp-3); }
.rv-resume__body { flex: 1 1 auto; min-width: 0; }
.rv-resume__title { font-size: var(--fs-15); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; }
.rv-resume__meta { font-size: var(--fs-13); color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ============ Hero: due today · overdue · the round the CTA starts · forecast ============ */
.rv-hero { container-type: inline-size; container-name: rvhero; }
.rv-hero__in { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
.rv-hero__main { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.rv-hero__top { display: flex; align-items: center; gap: var(--sp-3); }
.rv-hero__gem { display: inline-flex; flex: 0 0 auto; }
.rv-hero__heading { flex: 1 1 auto; min-width: 0; }
.rv-hero__title { font-size: var(--fs-20); line-height: 1.2; }
.rv-hero__sub { font-size: var(--fs-13); color: var(--text-2); line-height: 1.4; margin-top: 3px; }
.rv-hero__note { font-size: var(--fs-15); color: var(--text-2); line-height: 1.5; max-width: 58ch; text-wrap: pretty; }

/* One numeral size for both figures (same baseline); colour and label carry the difference. */
.rv-hero__stats { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3) var(--sp-7); }
.rv-stat { display: flex; flex-direction: column; min-width: 0; }
.rv-stat__n {
  font-size: 2.5rem;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  color: var(--text-accent);
  font-variant-numeric: tabular-nums;
}
.rv-stat__l { margin-top: 6px; font-size: var(--fs-15); font-weight: var(--fw-medium); color: var(--text-2); line-height: 1.3; }
.rv-stat--quiet .rv-stat__n { color: var(--text-strong); }

/* What the button starts, said in full above it (D1). */
.rv-hero__plan { font-size: var(--fs-15); color: var(--text-2); line-height: 1.45; font-variant-numeric: tabular-nums; text-wrap: pretty; }
.rv-hero__plan strong { color: var(--text-strong); font-weight: var(--fw-semibold); }
.rv-hero__cta { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-2); margin-top: calc(-1 * var(--sp-1)); }
.rv-hero__cta .btn { width: 100%; }
.rv-hero__foot { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-13); color: var(--text-2); line-height: 1.45; }
.rv-hero__foot .icon { color: var(--accent); flex: 0 0 auto; margin-top: 1px; }

.rv-hero__side { min-width: 0; padding-top: var(--sp-4); border-top: 1px solid var(--divider); }

@media (min-width: 768px) {
  .rv-hero__in { gap: var(--sp-5); }
  .rv-hero__title { font-size: var(--fs-24); }
  .rv-hero__sub { font-size: var(--fs-15); }
  .rv-stat__n { font-size: var(--fs-44); }
  .rv-hero__cta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
  .rv-hero__cta .btn { width: auto; }
  .rv-hero__cta .btn--lg { min-width: 232px; }
  .rv-hero__side { padding-top: var(--sp-5); }
}
@container rvhero (min-width: 620px) {
  .rv-hero--split .rv-hero__in { grid-template-columns: minmax(0, 1fr) minmax(236px, 296px); gap: var(--sp-7); }
  .rv-hero__side { padding: 0 0 0 var(--sp-7); border-top: 0; border-left: 1px solid var(--divider); display: flex; flex-direction: column; justify-content: center; }
  .rv-hero--split .rv-hero__main { justify-content: center; }
}

/* Day one: Dr. Round beside the explanation on wide heroes only (BUILD_BRIEF §2.3: empty study state). */
.rv-hero--fresh .rv-hero__side { display: none; }
@container rvhero (min-width: 620px) {
  .rv-hero--fresh .rv-hero__side { display: flex; align-items: flex-end; justify-content: center; border-left: 0; padding: 0; margin: calc(-1 * var(--sp-2)) 0 calc(-1 * var(--card-p, var(--sp-6))); }
  .rv-hero--fresh.rv-hero--split .rv-hero__in { grid-template-columns: minmax(0, 1fr) 200px; }
}
.rv-hero__art { display: flex; align-items: flex-end; justify-content: center; }

/* ============ 7-day forecast: bars on a baseline, no empty tracks ============ */
.rv-fc { margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.rv-fc__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.rv-fc__title { font-size: var(--fs-15); font-weight: var(--fw-semibold); color: var(--text-strong); }
.rv-fc__sub { font-size: var(--fs-13); color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.rv-fc__bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  height: 96px;
}
.rv-fc__day { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 6px; min-width: 0; }
.rv-fc__track {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px;
  width: 100%; height: 100%;
  border-bottom: 1px solid var(--border-strong);
}
.rv-fc__n { font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-fc__fill { display: block; width: 100%; max-width: 22px; border-radius: 6px 6px 0 0; background: var(--bar-fill-v); }
.rv-fc__d { font-size: var(--fs-12); color: var(--text-2); line-height: 1; white-space: nowrap; padding-bottom: 2px; }
.rv-fc__day.is-next .rv-fc__d { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rv-fc__day.is-zero .rv-fc__n { color: var(--text-3); font-weight: var(--fw-medium); }
@media (min-width: 768px) { .rv-fc__bars { height: 120px; gap: 8px; } }

/* ============ Bucket rows (phones, desktop rail) ============ */
.rv-buckets {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.rv-buckets__item { min-width: 0; }
.rv-buckets > .rv-buckets__item + .rv-buckets__item { border-top: 1px solid var(--divider); }
.rv-b {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  grid-template-areas: "gem title count go" "gem line count go";
  column-gap: var(--sp-3);
  row-gap: 2px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  text-align: left;
  color: var(--text);
  transition: background var(--dur-1) var(--ease-out);
}
button.rv-b { cursor: pointer; }
.rv-b__gem { grid-area: gem; display: inline-flex; }
.rv-b__title { grid-area: title; align-self: end; font-size: var(--fs-15); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; }
.rv-b__line {
  grid-area: line; align-self: start; min-width: 0;
  font-size: var(--fs-13); line-height: 1.4; color: var(--text-3);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.rv-b__count { grid-area: count; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.rv-b__num { font-size: var(--fs-17); font-weight: var(--fw-bold); letter-spacing: var(--tracking-snug); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.rv-b__unit { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
.rv-b__go { grid-area: go; display: inline-flex; align-items: center; color: var(--text-3); }
button.rv-b:hover { background: var(--surface-hover); }
button.rv-b:hover .rv-b__go { color: var(--link); }
button.rv-b:active { background: var(--surface-pressed); }
button.rv-b:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
/* Nothing to start: the reason is the content, the gem goes quiet (the text says it — never colour alone). */
.rv-b.is-off { cursor: default; grid-template-areas: "gem title title title" "gem line line line"; }
.rv-b.is-off .rv-b__gem { filter: grayscale(1); opacity: .45; }
.rv-b.is-off .rv-b__title { color: var(--text-2); }
.rv-b.is-off .rv-b__line { -webkit-line-clamp: 3; line-clamp: 3; }

/* ============ Bucket cards (≥ 768): ModeCard grid ============ */
.rv-mc { display: grid; grid-template-columns: repeat(var(--rv-n, 3), minmax(0, 1fr)); gap: var(--sp-4); min-width: 0; }
.rv-mc__item { display: flex; min-width: 0; }
.rv-mc__item > .mode-card { flex: 1 1 auto; min-width: 0; }
.rv-mc__go { display: inline-flex; align-items: center; gap: 2px; color: var(--link); font-size: var(--fs-13); font-weight: var(--fw-semibold); }
@media (min-width: 1200px) { .rv-mc { gap: var(--sp-5); } }

/* ============ Day one: what fills in (one compact, inert list) ============ */
.rv-fills__list { display: flex; flex-direction: column; }
.rv-fills__row { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-4); min-height: 56px; }
.rv-fills__row + .rv-fills__row { border-top: 1px solid var(--divider); }
.rv-fills__gem { display: inline-flex; flex: 0 0 auto; filter: grayscale(.35); opacity: .8; }
.rv-fills__text { display: flex; flex-direction: column; min-width: 0; }
.rv-fills__title { font-size: var(--fs-15); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; }
.rv-fills__hint { font-size: var(--fs-13); color: var(--text-3); line-height: 1.4; }
@media (min-width: 768px) {
  .rv-fills__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-fills__row + .rv-fills__row { border-top: 0; }
  .rv-fills__row:nth-child(n+3) { border-top: 1px solid var(--divider); }
  .rv-fills__row:nth-child(even) { border-left: 1px solid var(--divider); }
}

/* ============ Retention + how spacing works (rail widgets) ============ */
.rv-ret { display: flex; align-items: center; gap: var(--sp-4); }
.rv-ret__text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rv-ret__lead { font-size: var(--fs-15); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; }
.rv-ret__detail { font-size: var(--fs-13); color: var(--text-2); line-height: 1.45; }
.rv-rail .rv-ret { flex-direction: row; align-items: center; }

.rv-sp { display: flex; flex-direction: column; gap: var(--sp-4); }
.rv-sp__cap { font-size: var(--fs-13); color: var(--text-3); line-height: 1.4; margin-bottom: calc(-1 * var(--sp-2)); }
.rv-sp__steps { display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--sp-2); }
.rv-sp__step { display: inline-flex; align-items: center; }
.rv-sp__d {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-soft-fg);
  font-size: var(--fs-13); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.rv-sp__u { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rv-sp__arrow { display: inline-flex; color: var(--text-3); margin: 0 1px; }
.rv-sp__rules { display: flex; flex-direction: column; gap: 10px; }
.rv-rule { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-13); color: var(--text-2); line-height: 1.45; }
.rv-rule .icon { flex: 0 0 auto; }
.rv-rule--up .icon { color: var(--success); }
.rv-rule--hold .icon { color: var(--accent); }
.rv-rule--down .icon { color: var(--warning); }
.rv-rule--miss .icon { color: var(--danger); }

/* ============ Flashcard reviewer (sheet) ============ */
.rv-fcs { display: flex; flex-direction: column; gap: var(--sp-4); }
.rv-fcs__progress { display: flex; flex-direction: column; gap: 6px; }
.rv-fcs__card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.rv-fcs__eyebrow { font-size: var(--fs-12); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-3); }
.rv-fcs__stem, .rv-fcs__front { font-size: var(--fs-17); line-height: var(--lh-stem); color: var(--text); }
.rv-fcs__front { font-weight: var(--fw-medium); white-space: pre-wrap; }
.rv-fcs__card .options { margin-top: var(--sp-1); }
.rv-fcs__back { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--divider); }
.rv-fcs__backtext { font-size: var(--fs-15); line-height: 1.55; color: var(--text); white-space: pre-wrap; }
.rv-fcs__done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-7) var(--sp-4); }
.rv-fcs__donegem { display: inline-flex; margin-bottom: var(--sp-2); }
.rv-fcs__donetitle { font-size: var(--fs-20); font-weight: var(--fw-bold); color: var(--text-strong); letter-spacing: var(--tracking-snug); }
.rv-fcs__donetext { font-size: var(--fs-15); color: var(--text-2); }

.rv-fcs__foot { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.rv-fcs__hint, .rv-fcs__ask { font-size: var(--fs-13); color: var(--text-3); text-align: center; }
.rv-fcs__ask { color: var(--text-2); font-weight: var(--fw-medium); }
.rv-fcs__grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
/* All four grades share one resting state (nothing looks pre-selected). */
.rv-grade {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; padding: 6px 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.rv-grade__label { font-size: var(--fs-15); font-weight: var(--fw-semibold); line-height: 1.2; }
.rv-grade__key {
  position: absolute; top: 4px; right: 6px;
  font: inherit; font-size: 10px; color: var(--text-3); line-height: 1;
}
.rv-grade:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.rv-grade:active { background: var(--surface-pressed); transform: translateY(1px); }
.rv-grade:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.rv-grade--again .rv-grade__label { color: var(--danger-strong); }   /* text-safe on the pill tint (R4) */
@media (min-width: 768px) {
  .rv-fills__row:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* A stacked (narrow) hero keeps its forecast short so the columns stay balanced at 1024–1280. */
@container rvhero (max-width: 619px) {
  .rv-fc__bars { height: 88px; }
}


/* ============ F2 (R2 defects) ============ */
/* Flashcard reviewer: DS openSheet({size:'center'}) is the centred panel ≥1024; only the stem size is ours. */
@media (min-width: 1024px) { .rv-fcs-sheet .rv-fcs__stem { font-size: var(--fs-stem); } }
.rv-fcs__askrow { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; min-height: 24px; }
.rv-fcs__why {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--link);
  padding: 2px 4px; border-radius: var(--r-xs); cursor: pointer;
}
.rv-fcs__why::after { content: ''; position: absolute; inset: -10px -6px; }        /* 44px hit area */
.rv-fcs__why[hidden] { display: none; }
.rv-fcs__why:hover { color: var(--link-hover); text-decoration: underline; }
.rv-fcs__why:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* Grades: the icon sheet's soft pill buttons (their outcomes are the ruler below them). */
.rv-grade { border-radius: var(--r-pill); background: var(--surface-2); border-color: var(--border); }
.rv-grade__key { top: 6px; right: 12px; }

/* Forecast: a 2px stub marks a zero day; tomorrow is plain bold (no tab-like underline). */
.rv-fc__fill { min-height: 2px; }
.rv-fc__day.is-zero .rv-fc__fill { background: var(--border-strong); }
.rv-fc__day.is-next .rv-fc__d { text-decoration: none; color: var(--text-strong); font-weight: var(--fw-semibold); }

/* Split hero: the forecast starts level with the card title and its bars fill the column. */
@container rvhero (min-width: 620px) {
  .rv-hero__side { justify-content: flex-start; }
  .rv-hero--due .rv-hero__side .rv-fc, .rv-hero--clear .rv-hero__side .rv-fc { flex: 1 1 auto; }
  .rv-hero--due .rv-hero__side .rv-fc__bars, .rv-hero--clear .rv-hero__side .rv-fc__bars { flex: 1 1 auto; height: auto; min-height: 132px; }
  .rv-hero--split .rv-hero__main { justify-content: flex-start; }
  /* "Review all" sits centred under the pill, the same width (not inset under it). */
  .rv-hero--split .rv-hero__cta { display: grid; grid-template-columns: max-content; justify-content: start; gap: var(--sp-1); }
  .rv-hero--split .rv-hero__cta .btn { width: 100%; }
}

/* ≥1200: the rail's last card stretches so both columns end on one line (SHELL_API §8.4 screen hook). */
@media (min-width: 1200px) {
  .shell[data-screen="review"] .app-grid { align-items: stretch; }
  .shell[data-screen="review"] .app-grid > .page__aside > .rv-rail { flex: 1 1 auto; }
  .rv-rail > :last-child { flex: 1 1 auto; }
}

/* ============ F3 (R3 defects) ============ */
/* Hero: "due today" is the headline; overdue steps down in size and ink (labels share one baseline). */
.rv-hero__stats { align-items: flex-end; }
.rv-stat--quiet .rv-stat__n { font-size: var(--fs-30); font-weight: var(--fw-semibold); color: var(--text-2); }

/* Retention / How spacing works now use the page's one section grammar: header outside, card below. */
.rv-info__card { flex: 1 1 auto; }
.rv-extras--2 { align-items: stretch; }
.rv-extras > .rv-info { height: 100%; }
.rv-rail > .rv-info:last-child .rv-info__card { flex: 1 1 auto; }
.rv-rail .rv-ret, .rv-info--ret .rv-ret { flex-direction: row; align-items: center; }

/* No one-word orphans in hints, rules and details (360). */
.rv-b__line, .rv-rule > span, .rv-ret__detail, .rv-group__sub { text-wrap: pretty; }

/* Flashcard sheet ---------------------------------------------------------- */
/* The card region is the sheet's first focus stop (R3 P1). */
.rv-fcs__card:focus { outline: none; }
.rv-fcs__card:focus-visible { box-shadow: var(--focus-ring); }
/* Grades: single-line pills; the outcome ruler under them groups identical intervals. */
.rv-grade { min-height: 48px; }
.rv-fcs__ruler { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); margin-top: -2px; }
.rv-fcs__seg {
  position: relative;
  margin: 0 var(--sp-3);
  padding-top: 6px;
  border-top: 2px solid var(--border-strong);
  font-size: var(--fs-12); font-weight: var(--fw-medium); color: var(--text-2); line-height: 1.3;
  text-align: center; white-space: nowrap;
}
.rv-fcs__seg::before, .rv-fcs__seg::after {
  content: ''; position: absolute; top: -6px; width: 2px; height: 6px; background: var(--border-strong);
}
.rv-fcs__seg::before { left: 0; }
.rv-fcs__seg::after { right: 0; }

/* Day one: hero + "Fills in as you answer" side by side on wide screens. */
.rv-fresh { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
@media (min-width: 768px) { .rv-fresh { gap: var(--sp-6); } }
@media (min-width: 1200px) {
  .rv-fresh { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: stretch; }
  .rv-fresh > .rv-group--fills { display: flex; flex-direction: column; }
  .rv-fresh .rv-fills { flex: 1 1 auto; }
  .rv-fresh .rv-fills__list { display: flex; flex-direction: column; }
  .rv-fresh .rv-fills__row + .rv-fills__row { border-top: 1px solid var(--divider); border-left: 0; }
  .rv-fresh .rv-fills__row:nth-child(even) { border-left: 0; }
}
/* A one-pill bracket never runs past its column; the day-one hero centres its content vertically. */
.rv-fcs__seg { overflow: hidden; margin: 0 var(--sp-2); }
@media (min-width: 1200px) {
  .rv-fresh .rv-hero__in { height: 100%; }
  .rv-fresh .rv-hero__main { justify-content: center; }
}

/* ============ F4 (R4 defects) ============ */
/* Flashcard sheet: one surface at every width (no card inside the sheet); stem at a reading measure. */
.rv-fcs__card { padding: 0; border: 0; border-radius: var(--r-sm); background: none; }
.rv-fcs__card:focus-visible { box-shadow: none; outline: 2px solid var(--focus); outline-offset: 6px; }
.rv-fcs__stem, .rv-fcs__front, .rv-fcs__backtext { max-width: var(--measure, 68ch); }
/* The card counter sits in the sheet header, beside the title; a hairline appears once the body scrolls. */
.rv-fcs-sheet .sheet__title { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.rv-fcs__hcount { font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-2); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.rv-fcs-sheet .sheet__head { border-bottom: 1px solid transparent; transition: border-color var(--dur-1) var(--ease-out); }
.rv-fcs-sheet.rv-fcs--scrolled .sheet__head { border-bottom-color: var(--divider); }
/* Phones have no keyboard: no key legend, no 1–4 digits on the grades. */
@media (max-width: 767px) {
  .rv-fcs__hint, .rv-grade__key { display: none; }
}
/* ≥768: a natural-width "Show answer" / "Done", centred, not a full-width bar. */
@media (min-width: 768px) {
  .rv-fcs-sheet [data-key=fc-reveal], .rv-fcs-sheet [data-key=fc-done] { width: auto; min-width: 240px; align-self: center; }
  /* Anchored to the top, so revealing the answer grows the panel downward instead of re-centring it,
     and a short card leaves no dead band (no fixed height). */
  .sheet.sheet--center.rv-fcs-sheet { top: max(var(--sp-7), 6vh); transform: translate(-50%, 12px); }
  .sheet.sheet--center.rv-fcs-sheet.is-open { transform: translate(-50%, 0); }
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) { .sheet.sheet--center.rv-fcs-sheet { transform: translate(-50%, 0); } }
@media (min-width: 768px) { :root[data-motion="reduce"] .sheet.sheet--center.rv-fcs-sheet { transform: translate(-50%, 0); } }

/* Split hero: a balanced split (1180 left the chart squeezed into a third). */
@container rvhero (min-width: 620px) {
  .rv-hero--split .rv-hero__in { grid-template-columns: minmax(0, 1.15fr) minmax(236px, 1fr); }
}

/* Bucket-card reason notes: the info icon aligns with the first line of a 2–3-line note. */
.rv-mc .mode-card__why { align-items: flex-start; }
.rv-mc .mode-card__why > .icon { flex: 0 0 auto; margin-top: 2px; }

/* Retention stretched to its neighbour's height (1024/768): content centred, no empty band. */
.rv-info--ret .rv-info__card { display: flex; align-items: center; }
.rv-info--ret .rv-ret { width: 100%; }

/* Day one, lone full-width spacing card: the ladder, then the four rules in two balanced columns. */
@media (min-width: 1024px) {
  .rv-extras--1 .rv-sp__rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px var(--sp-8); }
}

/* Phones: a focused row never scrolls under the bottom tab bar (or the top bar). */
@media (max-width: 767px) {
  .rv button, .rv a, .rv [tabindex] {
    scroll-margin-bottom: calc(var(--tabbar-h) + var(--safe-bottom, 0px) + var(--sp-3));
    scroll-margin-top: calc(var(--topbar-h) + var(--sp-3));
  }
}
.rv-nw { white-space: nowrap; }
