/* ============================================================================
   TTA results review + Targeted Practice — theme layer (2026-10-06)
   Used by resources/views/Student/tests/result.blade.php and
   resources/views/Student/practice/index.blade.php.

   Tokens = dashboard-v3 tokens (public/css/dashboard-embed.css §1), switched by
   html[data-theme] exactly like dashboard-v2: Web.layout sets it from
   localStorage['tta-theme'] on a normal visit and from ?theme= inside the
   dashboard page zone. Everything is scoped to .rr so no other page changes.
   Own rr-* class names; the few legacy class names the review script needs
   (.q-box, .answer-option, .question-card-*, .dtx-*, .dtree-*, .tutor-*) are
   restyled here instead of in the old inline <style> blocks.
   ============================================================================ */

/* ---- 1. Tokens ----------------------------------------------------------- */
.rr, .rr-overlay {
  --r-bg: #F8FAFC; --r-surface: #FFFFFF; --r-surface-2: #EEF2F7; --r-surface-3: #E2E8F0;
  --r-line: #E2E8F0; --r-line-strong: #CBD5E1;
  --r-ink: #0F172A; --r-ink-2: #334155; --r-ink-3: #556274;
  --r-navy: #0A2342; --r-navy-2: #163A5F;
  --r-gold: #7A6619; --r-gold-fill: #D4AF37; --r-gold-soft: rgba(212,175,55,.16); --r-on-gold: #0A2342;
  --r-ok: #047857; --r-ok-fill: #10B981; --r-ok-soft: rgba(16,185,129,.12);
  --r-bad: #A40E1E; --r-bad-fill: #DC2626; --r-bad-soft: rgba(164,14,30,.08);
  --r-warn: #A3480A; --r-warn-soft: rgba(245,158,11,.14);
  --r-focus: #0A2342;
  --r-shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  --r-shadow-lg: 0 18px 50px rgba(15,23,42,.18);
  --r-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-font-display: 'Fraunces', Georgia, serif;
  --r-font-read: 'IBM Plex Serif', Georgia, serif;
  --r-font-mono: 'Roboto Mono', ui-monospace, monospace;
  --r-r-sm: 10px; --r-r-md: 14px; --r-r-lg: 20px; --r-pill: 999px;
  --r-fast: 150ms; --r-mid: 240ms; --r-ease: cubic-bezier(.32,.72,0,1);
}
html[data-theme="dark"] .rr, html[data-theme="dark"] .rr-overlay {
  --r-bg: #041529; --r-surface: #0A2342; --r-surface-2: #163A5F; --r-surface-3: #1E5080;
  --r-line: #284663; --r-line-strong: #3A5C7E;
  --r-ink: #F8FAFC; --r-ink-2: #B8C6D8; --r-ink-3: #8FA3BC;
  --r-gold: #D4AF37; --r-gold-fill: #D4AF37; --r-gold-soft: rgba(212,175,55,.16); --r-on-gold: #0A2342;
  --r-ok: #34D399; --r-ok-fill: #10B981; --r-ok-soft: rgba(16,185,129,.16);
  --r-bad: #FF8A80; --r-bad-fill: #E5484D; --r-bad-soft: rgba(229,72,77,.18);
  --r-warn: #FBBF24; --r-warn-soft: rgba(245,158,11,.16);
  --r-focus: #F0D060;
  --r-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
  --r-shadow-lg: 0 24px 60px rgba(0,0,0,.5);
}

/* ---- 2. Shell (only on pages that load this file) --------------------------
   Web.layout paints .student-topbar #fff with no dark rule while tta-workspace.css
   turns its text white in dark mode → white on white (fixture screenshot). */
html[data-theme="dark"] body.tta-workspace { background: #041529; }
html[data-theme="dark"] body.tta-workspace .student-main,
html[data-theme="dark"] body.tta-workspace .student-content { background: #041529; }
html[data-theme="dark"] body.tta-workspace .student-topbar { background: #0A2342; border-bottom-color: #284663; }
html[data-theme="dark"] body.tta-workspace .student-topbar-title,
html[data-theme="dark"] body.tta-workspace .tta-workspace-home { color: #F8FAFC; }
body.tta-workspace .student-content:has(> .rr) { padding: 20px 24px 40px; }
body.tta-workspace .student-topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { body.tta-workspace .student-topbar { gap: 8px; padding: 0 12px; } body.tta-workspace .student-topbar .tta-workspace-home { display: none; } }
@media (max-width: 768px) { body.tta-workspace .student-content:has(> .rr) { padding: 12px 12px 32px; } }

/* ---- 3. Base --------------------------------------------------------------- */
.rr { font-family: var(--r-font); color: var(--r-ink); font-size: 15px; line-height: 1.5; max-width: 1480px; margin: 0 auto; -webkit-text-size-adjust: 100%; }
.rr *, .rr *::before, .rr *::after { box-sizing: border-box; }
.rr button, .rr input, .rr select, .rr textarea { font-family: inherit; }
.rr [hidden] { display: none !important; }
/* style.css gives every <section> 60px top/bottom padding. */
.rr section.rr-summary, .rr section.rr-panel, .rr section.question-display-area, .rr-sp section { padding: 0; }
.rr a { color: var(--r-gold); }
.rr :focus-visible { outline: 2px solid var(--r-focus); outline-offset: 2px; }
.rr-muted { color: var(--r-ink-3); font-size: 13px; font-weight: 500; }
.rr-mono { font-family: var(--r-font-mono); font-variant-numeric: tabular-nums; }
.rr-p { color: var(--r-ink-2); margin: .5rem 0 0; font-size: 14px; }
.rr-bad { color: var(--r-bad); }
.rr-h { font-family: var(--r-font); font-size: 15px; font-weight: 800; color: var(--r-ink); margin: 0; letter-spacing: 0; display: flex; align-items: center; gap: 8px; }
.rr-h i { color: var(--r-gold); }
.rr-h3 { font-size: 15px; font-weight: 800; margin: 0 0 10px; color: var(--r-ink); }
.rr-card { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); box-shadow: var(--r-shadow); padding: 18px 20px; }
.rr-card + .rr-card { margin-top: 14px; }
.rr-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rr-card-head-out { margin: 18px 2px 12px; }
.rr-link { color: var(--r-gold); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.rr-empty { text-align: center; padding: 36px 16px; color: var(--r-ink-2); }
.rr-empty i { font-size: 30px; color: var(--r-ink-3); display: block; margin-bottom: 10px; }
.rr-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 10px; color: var(--r-ink-2); }
.rr .spinner, .rr-overlay .spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--r-line); border-top-color: var(--r-gold-fill); animation: rr-spin 900ms linear infinite; }
@keyframes rr-spin { to { transform: rotate(360deg); } }
.rr kbd { font-family: var(--r-font-mono); font-size: 11px; border: 1px solid var(--r-line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--r-surface); color: var(--r-ink-2); }

/* ---- 4. Buttons, chips, pills -------------------------------------------- */
.rr-btn, .rr-overlay .rr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-pill); border: 1px solid transparent; font-size: 14px; font-weight: 700; line-height: 1;
  text-decoration: none !important; cursor: pointer; white-space: nowrap; touch-action: manipulation;
  transition: background var(--r-fast) var(--r-ease), border-color var(--r-fast) var(--r-ease), color var(--r-fast), transform var(--r-fast);
}
.rr-btn:active { transform: scale(.97); }
.rr-btn:disabled, .rr-btn[aria-busy="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.rr-btn-sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
.rr-btn-block { display: flex; width: 100%; margin-top: 10px; }
.rr-btn-gold { background: var(--r-gold-fill); color: var(--r-on-gold) !important; }
.rr-btn-gold:hover { background: #F0D060; }
.rr-btn-primary { background: var(--r-navy); color: #fff !important; }
.rr-btn-primary:hover { background: var(--r-navy-2); }
html[data-theme="dark"] .rr-btn-primary { background: var(--r-gold-fill); color: var(--r-on-gold) !important; }
html[data-theme="dark"] .rr-btn-primary:hover { background: #F0D060; }
.rr-btn-ghost { background: var(--r-surface); border-color: var(--r-line-strong); color: var(--r-ink) !important; }
.rr-btn-ghost:hover { background: var(--r-surface-2); }
.rr-btn-danger { background: var(--r-bad-fill); color: #fff !important; }
.rr-icon-btn { width: 40px; height: 40px; min-width: 40px; border-radius: var(--r-pill); border: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; transition: background var(--r-fast); }
.rr-icon-btn:hover { background: var(--r-surface-2); color: var(--r-ink); }
.rr-icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.rr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--r-surface-2); color: var(--r-ink-2); font-size: 13px; font-weight: 700; }
.rr-chip.ok { background: var(--r-ok-soft); color: var(--r-ok); }
.rr-chip.bad { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-chip.gold { background: var(--r-gold-soft); color: var(--r-gold); }
.rr-chip strong { color: var(--r-ink); }
.rr-chiprow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.rr-chip-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--r-line-strong); background: var(--r-surface); color: var(--r-ink); font-size: 13px; font-weight: 700; cursor: pointer; touch-action: manipulation; transition: background var(--r-fast), border-color var(--r-fast); }
.rr-chip-btn i { color: var(--r-gold); }
.rr-chip-btn:hover { background: var(--r-surface-2); }
.rr-chip-btn.gold { border-color: var(--r-gold-fill); background: var(--r-gold-soft); }
.rr-chip-btn.is-on { background: var(--r-navy); border-color: var(--r-navy); color: #fff; }
.rr-chip-btn.is-on i { color: var(--r-gold-fill); }
html[data-theme="dark"] .rr-chip-btn.is-on { background: var(--r-gold-fill); border-color: var(--r-gold-fill); color: var(--r-on-gold); }
html[data-theme="dark"] .rr-chip-btn.is-on i { color: var(--r-on-gold); }
.rr-chip-sm { min-height: 36px; padding: 0 12px; font-size: 12.5px; }
.rr-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--r-surface-2); color: var(--r-ink-2); font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rr-pill i { opacity: .8; }
.rr-pill-warn { background: var(--r-warn-soft); color: var(--r-warn); }
.rr-diff-easy { background: var(--r-ok-soft); color: var(--r-ok); }
.rr-diff-intermediate { background: var(--r-warn-soft); color: var(--r-warn); }
.rr-diff-hard { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-tag { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-pill); padding: 2px 10px; font-size: 11.5px; font-weight: 800; }
.rr-tag-gold { background: var(--r-gold-soft); color: var(--r-gold); }
.rr-count { font-family: var(--r-font-mono); font-size: 11px; background: var(--r-surface-2); color: var(--r-ink-2); border-radius: var(--r-pill); padding: 1px 7px; }
.rr-inline-msg { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-r-sm); font-size: 13.5px; font-weight: 600; background: var(--r-surface-2); color: var(--r-ink-2); }
.rr-inline-msg.ok { background: var(--r-ok-soft); color: var(--r-ok); }
.rr-inline-msg.bad { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-inline-msg .rr-link { color: inherit; }

/* ---- 5. Bar ---------------------------------------------------------------- */
.rr-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.rr-bar-title { flex: 1 1 320px; min-width: 0; }
.rr-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--r-ink-3); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.rr-title { font-family: var(--r-font-display) !important; font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; color: var(--r-ink) !important; margin: 4px 0 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
html[data-theme="dark"] .rr-title { color: var(--r-gold) !important; }
.rr-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 6. Summary ------------------------------------------------------------ */
.rr-summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; margin-bottom: 18px; }
.rr-summary > .rr-card { margin: 0; }
.rr-score { display: flex; gap: 20px; align-items: center; }
.rr-ring { position: relative; width: 132px; height: 132px; flex: 0 0 132px; }
.rr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-ring-track { fill: none; stroke: var(--r-surface-2); stroke-width: 11; }
.rr-ring-fill { fill: none; stroke: var(--r-gold-fill); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 900ms var(--r-ease); }
.rr-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rr-ring-pct { font-family: var(--r-font-mono); font-size: 28px; font-weight: 700; color: var(--r-ink); line-height: 1; }
.rr-ring-lbl { font-size: 11px; font-weight: 800; color: var(--r-ink-3); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.rr-score-body { flex: 1; min-width: 0; }
.rr-score-note { font-weight: 800; font-size: 16px; color: var(--r-ink); margin-bottom: 10px; }
.rr-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px 14px; margin: 0; }
.rr-stat { margin: 0; min-width: 0; }
.rr-stat dt { font-size: 11px; font-weight: 800; color: var(--r-ink-3); text-transform: uppercase; letter-spacing: .07em; }
.rr-stat dd { margin: 2px 0 0; font-family: var(--r-font-mono); font-size: 22px; font-weight: 700; color: var(--r-ink); line-height: 1.1; }
.rr-stat dd small { font-size: 13px; color: var(--r-ink-3); }
.rr-stat.ok dd { color: var(--r-ok); } .rr-stat.bad dd { color: var(--r-bad); } .rr-stat.gold dd { color: var(--r-gold); }
.rr-stat-sub { display: block; font-size: 11.5px; color: var(--r-ink-3); font-weight: 600; }
.rr-score-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.rr-secbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rr-secbar { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name num" "meter pct"; column-gap: 12px; row-gap: 6px; align-items: center; padding: 9px 10px; border-radius: var(--r-r-sm); border: 0; background: transparent; color: var(--r-ink); text-align: left; cursor: pointer; min-height: 48px; touch-action: manipulation; transition: background var(--r-fast); }
.rr-secbar:hover { background: var(--r-surface-2); }
.rr-secbar-name { grid-area: name; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-secbar-num { grid-area: num; font-size: 13px; color: var(--r-ink-2); }
.rr-secbar .rr-meter { grid-area: meter; }
.rr-secbar-pct { grid-area: pct; font-family: var(--r-font-mono); font-weight: 700; font-size: 13px; min-width: 40px; text-align: right; }
.rr-meter { display: flex; height: 8px; border-radius: var(--r-pill); background: var(--r-surface-2); overflow: hidden; }
.rr-meter i { display: block; height: 100%; }
.rr-meter i.ok { background: var(--r-ok-fill); }
.rr-meter i.bad { background: var(--r-bad-fill); opacity: .75; }
.rr-diffrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--r-line); }

.rr-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rr-step { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--r-line); }
.rr-step:last-child { border-bottom: 0; }
.rr-step > .rr-inline-msg { grid-column: 1 / -1; margin-top: 0; }
.rr-step-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--r-surface-2); color: var(--r-ink-2); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.rr-step-ic.gold { background: var(--r-gold-soft); color: var(--r-gold); }
.rr-step-body { min-width: 0; }
.rr-step-body strong { display: block; font-size: 14px; color: var(--r-ink); }
.rr-step-body span { display: block; font-size: 12.5px; color: var(--r-ink-3); line-height: 1.4; }
.rr-step-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- 7. Tabs --------------------------------------------------------------- */
.rr-tabs { display: flex; gap: 6px; padding: 6px; background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-pill); box-shadow: var(--r-shadow); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: 16px; scroll-margin-top: 72px; }
.rr-tabs::-webkit-scrollbar { display: none; }
.rr-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--r-ink-2); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; flex: 0 0 auto; touch-action: manipulation; transition: background var(--r-fast), color var(--r-fast); }
.rr-tab:hover { color: var(--r-ink); background: var(--r-surface-2); }
.rr-tab.is-active { background: var(--r-navy); color: #fff; }
html[data-theme="dark"] .rr-tab.is-active { background: var(--r-gold-fill); color: var(--r-on-gold); }
.rr-tab.is-active .rr-count { background: rgba(255,255,255,.18); color: inherit; }

.rr-panels { position: relative; }
.rr-panel { animation: rr-fade var(--r-mid) var(--r-ease); }
@keyframes rr-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.rr-row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---- 8. Review layout ------------------------------------------------------ */
.rr-review { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.rr-rail { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); padding: 14px; box-shadow: var(--r-shadow); max-height: calc(100vh - 96px); overflow-y: auto; }
.rr[data-embed="1"] .rr-rail { position: static; max-height: none; }
.rr-rail-block { min-width: 0; }
.rr-rail-label { font-size: 11px; font-weight: 800; color: var(--r-ink-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.rr-modules { display: grid; gap: 6px; }
.rr-module { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-r-sm); border: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-ink); font-size: 13.5px; font-weight: 700; text-align: left; cursor: pointer; touch-action: manipulation; transition: background var(--r-fast), border-color var(--r-fast); }
.rr-module:hover { background: var(--r-surface-2); }
.rr-module.active { border-color: var(--r-gold-fill); background: var(--r-gold-soft); box-shadow: inset 3px 0 0 var(--r-gold-fill); }
.rr-module-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-module-num { font-size: 12.5px; color: var(--r-ink-2); }
.rr-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.rr-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--r-line-strong); background: var(--r-surface); color: var(--r-ink-2); font-size: 13px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.rr-filter .rr-mono { font-size: 11.5px; color: var(--r-ink-3); }
.rr-filter.is-on { background: var(--r-navy); border-color: var(--r-navy); color: #fff; }
.rr-filter.is-on .rr-mono { color: rgba(255,255,255,.75); }
html[data-theme="dark"] .rr-filter.is-on { background: var(--r-gold-fill); border-color: var(--r-gold-fill); color: var(--r-on-gold); }
html[data-theme="dark"] .rr-filter.is-on .rr-mono { color: rgba(10,35,66,.7); }
.rr-filters-inline { justify-content: flex-end; }
.rr-map-summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 32px; margin-bottom: 8px; }
.rr-map-summary::-webkit-details-marker { display: none; }
.rr-map-summary::after { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; transition: transform var(--r-fast); }
.rr-map-wrap:not([open]) .rr-map-summary::after { transform: rotate(-90deg); }
.rr-map-summary .rr-muted { font-size: 11px; text-transform: none; letter-spacing: 0; }
.rr-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
.rr-map-sec { grid-column: 1 / -1; font-size: 11.5px; font-weight: 800; color: var(--r-ink-3); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-map-sec:first-child { margin-top: 0; }
.rr .q-box { position: relative; height: 36px; min-width: 36px; border-radius: 9px; border: 1.5px solid var(--r-line-strong); background: var(--r-surface); color: var(--r-ink-2); font-family: var(--r-font-mono); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; touch-action: manipulation; transition: transform var(--r-fast), opacity var(--r-fast), box-shadow var(--r-fast); }
.rr .q-box.correct { background: var(--r-ok-soft); border-color: var(--r-ok-fill); color: var(--r-ok); }
.rr .q-box.incorrect { background: var(--r-bad-soft); border-color: var(--r-bad-fill); color: var(--r-bad); }
.rr .q-box.skipped { border-style: dashed; color: var(--r-ink-3); }
.rr .q-box.active { box-shadow: 0 0 0 3px var(--r-gold-fill); z-index: 1; }
.rr .q-box.is-dim { opacity: .28; }
.rr .q-box.has-video::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--r-gold-fill); }
.rr .q-box.is-tagged::before { content: ''; position: absolute; bottom: 3px; left: 50%; width: 12px; height: 2px; margin-left: -6px; border-radius: 2px; background: currentColor; opacity: .7; }
.rr-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 11.5px; color: var(--r-ink-3); font-weight: 600; }
.rr-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rr-legend .fa-circle-play { color: var(--r-gold-fill); }
.rr-dot { width: 10px; height: 10px; border-radius: 3px; border: 1.5px dashed var(--r-line-strong); display: inline-block; }
.rr-dot.ok { background: var(--r-ok-fill); border: 0; } .rr-dot.bad { background: var(--r-bad-fill); border: 0; }
.rr-kbd-hint { font-size: 12px; color: var(--r-ink-3); margin: 0; }

.rr-stage { min-width: 0; }
.rr-blind { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--r-r-md); border: 1px solid var(--r-gold-fill); background: var(--r-gold-soft); }
.rr-blind-text { flex: 1 1 260px; min-width: 0; }
.rr-blind .blind-review-title { font-weight: 800; font-size: 14.5px; color: var(--r-ink); }
.rr-blind .blind-review-subtitle { font-size: 13px; color: var(--r-ink-2); margin-top: 2px; }
.rr-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; margin: 0; user-select: none; }
.rr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rr-switch-track { position: relative; width: 46px; height: 26px; border-radius: var(--r-pill); background: var(--r-line-strong); transition: background var(--r-fast); flex: 0 0 46px; }
.rr-switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--r-mid) var(--r-ease); }
.rr-switch input:checked + .rr-switch-track { background: var(--r-navy); }
html[data-theme="dark"] .rr-switch input:checked + .rr-switch-track { background: var(--r-gold-fill); }
.rr-switch input:checked + .rr-switch-track .rr-switch-thumb { transform: translateX(20px); }
.rr-switch input:focus-visible + .rr-switch-track { outline: 2px solid var(--r-focus); outline-offset: 2px; }
.rr-switch-label { font-weight: 800; font-size: 14px; color: var(--r-ink); }

.rr .test-content-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; position: relative; }
.rr .test-content-columns.no-passage { grid-template-columns: minmax(0, 1fr); }
.rr .test-content-columns.no-passage .passage-display-area { display: none; }
.rr .passage-display-area { position: sticky; top: 76px; background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); padding: 16px 20px 20px; max-height: calc(100vh - 96px); overflow-y: auto; min-height: 160px; box-shadow: var(--r-shadow); }
.rr[data-embed="1"] .passage-display-area { position: relative; top: 0; max-height: 70vh; }
.rr-passage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--r-line); }
.rr .current-passage-title { font-size: 13px !important; font-weight: 800; color: var(--r-ink-3) !important; text-transform: uppercase; letter-spacing: .06em; margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--r-font) !important; }
.rr .current-passage-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr .current-passage-content { font-family: var(--r-font-read); font-size: 16.5px; line-height: 1.75; color: var(--r-ink); overflow-wrap: break-word; }
.rr .current-passage-content img, .rr .question-content img, .rr .answer-text img { max-width: 100%; height: auto; }
.rr .current-passage-content table, .rr .question-content table { max-width: 100%; display: block; overflow-x: auto; border-collapse: collapse; }
.rr .current-passage-content td, .rr .current-passage-content th, .rr .question-content td, .rr .question-content th { border: 1px solid var(--r-line); padding: 4px 8px; }
.rr-passage-toggle { display: none; }
/* Bank figures (tables, charts, images) carry light inline colours; in dark mode they sit on a light card
   instead of being half-recoloured. */
html[data-theme="dark"] .rr .current-passage-content table,
html[data-theme="dark"] .rr .question-content table,
html[data-theme="dark"] .rr .current-passage-content img,
html[data-theme="dark"] .rr .question-content img,
html[data-theme="dark"] .rr .answer-text img,
html[data-theme="dark"] .rr .current-passage-content svg,
html[data-theme="dark"] .rr .question-content svg { background: #fff; color: #0F172A; border-radius: 8px; padding: 6px; }
html[data-theme="dark"] .rr .current-passage-content table *, html[data-theme="dark"] .rr .question-content table * { color: #0F172A; border-color: #CBD5E1; }
/* Bank HTML often hard-codes black text (style="color:#000"); outside figures it follows the theme. */
html[data-theme="dark"] .rr :is(.current-passage-content, .question-content, .answer-text) :not(table, table *, svg, svg *, mark, mark *) { color: inherit !important; }
html[data-theme="dark"] .rr :is(.current-passage-content, .question-content, .answer-text) :not(table, table *, svg, svg *, mark, mark *, img)[style*="background"] { background-color: transparent !important; }
.rr .question-display-area { min-width: 0; position: relative; min-height: 240px; }
.rr .area-loading-indicator { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: color-mix(in srgb, var(--r-surface) 85%, transparent); border-radius: var(--r-r-lg); z-index: 5; color: var(--r-ink-2); font-size: 13.5px; }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .rr .area-loading-indicator { background: var(--r-surface); } }

/* ---- 9. Question card ------------------------------------------------------ */
.rr .question-card-dynamic { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); box-shadow: var(--r-shadow); overflow: hidden; }
.rr-q-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "status title count nav" "chips chips chips chips"; align-items: center; gap: 8px 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--r-line); background: var(--r-surface); }
.rr-q-ok .rr-q-head { box-shadow: inset 0 3px 0 var(--r-ok-fill); }
.rr-q-bad .rr-q-head { box-shadow: inset 0 3px 0 var(--r-bad-fill); }
.rr-q-blind .rr-q-head { box-shadow: inset 0 3px 0 var(--r-gold-fill); }
.rr-q-skip .rr-q-head { box-shadow: inset 0 3px 0 var(--r-line-strong); }
.rr-status { grid-area: status; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 800; white-space: nowrap; }
.rr-status-ok { background: var(--r-ok-soft); color: var(--r-ok); }
.rr-status-bad { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-status-blind { background: var(--r-gold-soft); color: var(--r-gold); }
.rr-status-skip { background: var(--r-surface-2); color: var(--r-ink-2); }
.rr .question-card-title { grid-area: title; margin: 0; font-size: 15px !important; font-weight: 800; color: var(--r-ink) !important; font-family: var(--r-font) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr .question-card-title .rr-muted { font-weight: 600; }
.rr-qcount { grid-area: count; font-size: 12px; white-space: nowrap; }
.rr-q-nav { grid-area: nav; display: inline-flex; gap: 6px; }
.rr-q-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.rr-topic-pill { max-width: 280px; }
.rr .question-card-body { padding: 18px 18px 6px; }
.rr .question-content { font-size: 16px; line-height: 1.65; color: var(--r-ink); font-weight: 500; margin-bottom: 16px; overflow-wrap: break-word; }
.rr .question-content p:last-child { margin-bottom: 0; }
.rr-blind-hint { font-size: 13px; color: var(--r-gold); font-weight: 700; margin: -4px 0 12px; }
.rr .answers-list { display: flex; flex-direction: column; gap: 10px; }
.rr .answer-option { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; border: 1.5px solid var(--r-line); border-radius: var(--r-r-md); background: var(--r-surface); transition: border-color var(--r-fast), background var(--r-fast), opacity var(--r-fast); }
.rr .answer-option.correct-answer { border-color: var(--r-ok-fill); background: var(--r-ok-soft); }
.rr .answer-option.incorrect-user-answer { border-color: var(--r-bad-fill); background: var(--r-bad-soft); }
.rr .answer-option.blind-option { cursor: pointer; }
.rr .answer-option.blind-option:hover { border-color: var(--r-gold-fill); background: var(--r-gold-soft); }
.rr .answer-option.eliminated { opacity: .45; }
.rr .answer-option.eliminated .answer-text { text-decoration: line-through; }
.rr-letter { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--r-line-strong); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: var(--r-ink-2); background: var(--r-surface); margin-top: 1px; }
.rr .correct-answer .rr-letter { background: var(--r-ok-fill); border-color: var(--r-ok-fill); color: #fff; }
.rr .incorrect-user-answer .rr-letter { background: var(--r-bad-fill); border-color: var(--r-bad-fill); color: #fff; }
.rr-choice-main { flex: 1; min-width: 0; }
.rr .answer-choice-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr .answer-choice-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rr .answer-choice-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.rr .answer-choice-badges:empty { display: none; }
.rr .answer-state-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-pill); padding: 2px 9px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.rr .answer-state-badge.correct { background: var(--r-ok-fill); color: #fff; }
.rr .answer-state-badge.user-correct { background: var(--r-ok-soft); color: var(--r-ok); }
.rr .answer-state-badge.user-wrong { background: var(--r-bad-fill); color: #fff; }
.rr .answer-state-badge.trap { background: var(--r-warn-soft); color: var(--r-warn); }
.rr .answer-text { font-size: 15.5px; line-height: 1.6; color: var(--r-ink); margin-top: 4px; overflow-wrap: break-word; }
.rr .answer-choice-badges:empty + .answer-text, .rr .answer-choice-header:has(.answer-choice-badges:empty) + .answer-text { margin-top: 4px; }
.rr .answer-stats-container { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.rr .stats-bar-bg { flex: 1; height: 5px; border-radius: var(--r-pill); background: var(--r-surface-2); overflow: hidden; }
.rr .stats-bar-fill { height: 100%; border-radius: var(--r-pill); background: var(--r-ink-3); }
.rr .stats-bar-fill.correct-bar { background: var(--r-ok-fill); }
.rr .stats-bar-fill.trap-bar { background: var(--r-warn); }
.rr .stats-info { font-family: var(--r-font-mono); font-size: 11.5px; color: var(--r-ink-3); white-space: nowrap; }
.rr .eliminate-btn { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--r-ink-3); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .6; touch-action: manipulation; }
.rr .eliminate-btn:hover, .rr .eliminate-btn[aria-pressed="true"] { opacity: 1; background: var(--r-surface-2); color: var(--r-ink); }
.rr .shake-animation { animation: rr-shake 400ms ease-in-out; }
@keyframes rr-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* grid-in */
.rr .gridin-review { display: flex; flex-direction: column; gap: 10px; }
.rr .gridin-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1.5px solid var(--r-line); border-left-width: 5px; border-radius: var(--r-r-md); padding: 12px 16px; background: var(--r-surface); }
.rr .gridin-row.is-correct, .rr .gridin-row.is-key { border-left-color: var(--r-ok-fill); }
.rr .gridin-row.is-correct { background: var(--r-ok-soft); }
.rr .gridin-row.is-wrong { border-left-color: var(--r-bad-fill); background: var(--r-bad-soft); }
.rr .gridin-row.is-blank { border-left-color: var(--r-line-strong); }
.rr .gridin-row.is-missing { border-left-color: var(--r-warn); background: var(--r-warn-soft); }
.rr .gridin-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--r-ink-3); min-width: 110px; }
.rr .gridin-value { font-family: var(--r-font-mono); font-size: 20px; font-weight: 700; color: var(--r-ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rr .gridin-empty { font-family: var(--r-font); font-size: 14px; font-weight: 600; color: var(--r-ink-3); }
.rr .gridin-flag { font-size: 12.5px; font-weight: 800; }
.rr .gridin-row.is-correct .gridin-flag { color: var(--r-ok); } .rr .gridin-row.is-wrong .gridin-flag { color: var(--r-bad); }
.rr .gridin-alt, .rr .gridin-note { font-size: 12.5px; color: var(--r-ink-3); }

/* miss reasons */
.rr-reasons-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; padding: 12px; border-radius: var(--r-r-md); background: var(--r-surface-2); }
.rr-reasons-q { font-size: 13px; font-weight: 800; color: var(--r-ink); margin-right: 4px; flex: 1 1 100%; }
.rr-reason-advice { flex: 1 1 100%; font-size: 13px; color: var(--r-ink-2); }
.rr-reason-advice:empty { display: none; }

/* learn row */
.rr .question-tools.rr-learn { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; padding-top: 14px; border-top: 1px solid var(--r-line); }
.rr-learn-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-r-sm); border: 1px solid var(--r-line-strong); background: var(--r-surface); color: var(--r-ink); font-size: 13.5px; font-weight: 700; cursor: pointer; touch-action: manipulation; transition: background var(--r-fast), border-color var(--r-fast); text-align: left; }
.rr-learn-btn i { color: var(--r-gold); }
.rr-learn-btn:hover { background: var(--r-surface-2); }
.rr-learn-btn.is-primary { background: var(--r-navy); border-color: var(--r-navy); color: #fff; }
.rr-learn-btn.is-primary i { color: var(--r-gold-fill); }
html[data-theme="dark"] .rr-learn-btn.is-primary { background: var(--r-gold-fill); border-color: var(--r-gold-fill); color: var(--r-on-gold); }
html[data-theme="dark"] .rr-learn-btn.is-primary i { color: var(--r-on-gold); }
.rr-learn-btn.is-quiet { border-color: transparent; background: transparent; color: var(--r-ink-3); margin-left: auto; }
.rr-learn-btn.is-quiet i { color: inherit; }
.rr-learn-btn[disabled] { opacity: .6; cursor: wait; }

/* explanation / lesson video */
.rr .tta-qvid { margin-top: 16px; }
.rr .tta-qvid-btn { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-r-md); border: 1px solid var(--r-gold-fill); background: var(--r-gold-soft); color: var(--r-ink); cursor: pointer; text-align: left; touch-action: manipulation; }
.rr .tta-qvid-btn:hover { background: color-mix(in srgb, var(--r-gold-fill) 26%, transparent); }
.rr .tta-qvid-ic { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: var(--r-gold-fill); color: var(--r-on-gold); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.rr .tta-qvid-btn[aria-expanded="true"] .tta-qvid-ic { background: var(--r-navy); color: #fff; }
.rr .tta-qvid-txt { display: flex; flex-direction: column; min-width: 0; }
.rr .tta-qvid-main { font-weight: 800; font-size: 14.5px; }
.rr .tta-qvid-sub { font-size: 12.5px; color: var(--r-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr .tta-qvid-stage { position: relative; padding-top: 56.25%; margin-top: 10px; border-radius: var(--r-r-md); overflow: hidden; background: #000; }
.rr .tta-qvid-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rr .tta-qvid-link { display: inline-flex; align-items: center; min-height: 40px; font-size: 13px; font-weight: 800; color: var(--r-gold); }

/* mistake analysis (AI) */
.rr .mistake-analysis-card { margin-top: 16px; padding: 16px; border-radius: var(--r-r-md); border: 1px solid var(--r-line); border-left: 4px solid var(--r-bad-fill); background: var(--r-surface-2); animation: rr-fade var(--r-mid) var(--r-ease); }
.rr .mistake-analysis-card h4 { font-size: 14.5px !important; font-weight: 800; color: var(--r-ink) !important; margin: 0 0 10px; display: flex; gap: 8px; align-items: center; font-family: var(--r-font) !important; }
.rr .mistake-analysis-card h4 i { color: var(--r-bad); }
.rr .mistake-point { padding: 8px 0; border-top: 1px solid var(--r-line); color: var(--r-ink-2); font-size: 14px; }
.rr .mistake-point:first-of-type { border-top: 0; }
.rr .mistake-point strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--r-ink-3); margin-bottom: 2px; }

.rr-q-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 14px; border-top: 1px solid var(--r-line); background: var(--r-surface); }
.rr-q-foot-mid { font-family: var(--r-font-mono); }

/* ---- 10. Insights ---------------------------------------------------------- */
.rr-brain { border-left: 4px solid var(--r-gold-fill); }
.rr-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.rr-topic { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--r-shadow); }
.rr-topic.is-recurring { border-color: var(--r-gold-fill); }
.rr-topic-head { display: flex; gap: 6px; flex-wrap: wrap; }
.rr-band { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-pill); padding: 2px 10px; font-size: 11.5px; font-weight: 800; }
.rr-band.ok { background: var(--r-ok-soft); color: var(--r-ok); }
.rr-band.warn { background: var(--r-warn-soft); color: var(--r-warn); }
.rr-band.bad { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-band.gold { background: var(--r-gold-soft); color: var(--r-gold); }
.rr-topic-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rr-topic-title h3 { margin: 0; font-size: 15.5px !important; font-weight: 800; color: var(--r-ink) !important; line-height: 1.3; font-family: var(--r-font) !important; }
.rr-topic-pct { font-family: var(--r-font-mono); font-size: 24px; font-weight: 700; line-height: 1; }
.rr-topic-pct.ok { color: var(--r-ok); } .rr-topic-pct.warn { color: var(--r-warn); } .rr-topic-pct.bad { color: var(--r-bad); }
.rr-topic-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--r-ink-3); font-weight: 600; }
.rr-topic .rr-chiprow { margin-top: 0; }
.rr-topic-tip { margin: 0; font-size: 13px; color: var(--r-ink-2); }
.rr-topic-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.rr-callouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.rr-callout { border-radius: var(--r-r-md); padding: 14px 16px; background: var(--r-surface); border: 1px solid var(--r-line); display: flex; flex-direction: column; gap: 3px; }
.rr-callout strong { font-size: 14.5px; color: var(--r-ink); }
.rr-callout span:last-child { font-size: 12.5px; color: var(--r-ink-3); }
.rr-callout-k { font-size: 11px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; display: flex; gap: 6px; align-items: center; }
.rr-callout.bad { box-shadow: inset 4px 0 0 var(--r-bad-fill); } .rr-callout.bad .rr-callout-k { color: var(--r-bad) !important; }
.rr-callout.ok { box-shadow: inset 4px 0 0 var(--r-ok-fill); } .rr-callout.ok .rr-callout-k { color: var(--r-ok) !important; }
.rr-callout.warn { box-shadow: inset 4px 0 0 var(--r-warn); } .rr-callout.warn .rr-callout-k { color: var(--r-warn) !important; }
.rr-reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rr-reason-row { border: 1px solid var(--r-line); border-radius: var(--r-r-md); padding: 12px 14px; }
.rr-reason-head { display: flex; align-items: center; gap: 8px; }
.rr-reason-head i { color: var(--r-gold); }
.rr-reason-n { margin-left: auto; font-size: 12px; color: var(--r-ink-3); }
.rr-reason-row p { margin: 6px 0 0; font-size: 13px; color: var(--r-ink-2); }

/* ---- 11. Mr. O -------------------------------------------------------------- */
.rr-coach { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--r-shadow); }
.rr-coach-intro { display: flex; gap: 12px; align-items: center; }
.rr-coach-intro strong { display: block; font-size: 15px; }
.rr-coach-intro span { display: block; font-size: 13px; color: var(--r-ink-3); }
.rr-avatar { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; background: var(--r-gold-fill); color: var(--r-on-gold); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.rr-ai-host { scroll-margin-top: 80px; }
.rr .ai-tutor-card {
  --ai-bg: var(--r-surface); --ai-bg-light: var(--r-surface-2); --ai-bg-hover: var(--r-surface-2); --ai-border: var(--r-line);
  --ai-text: var(--r-ink); --ai-text-light: var(--r-ink-3); --ai-user-bubble: var(--r-navy); --ai-gold: var(--r-gold-fill);
  --ai-yellow: var(--r-gold); --ai-blood-red: var(--r-bad-fill); --ai-success: var(--r-ok-fill);
  font-family: var(--r-font); border-radius: var(--r-r-lg); box-shadow: var(--r-shadow); margin-bottom: 0;
}
.rr .ai-tutor-card:hover { box-shadow: var(--r-shadow); }
.rr .ai-tutor-header { background: var(--r-surface); border-bottom: 1px solid var(--r-line); }
.rr .ai-tutor-title h5 { font-size: 16px !important; font-weight: 800; color: var(--r-ink) !important; font-family: var(--r-font) !important; }
.rr .ai-tutor-title i { animation: none; color: var(--r-on-gold); font-size: 1.1rem; }
.rr .ai-action-button { width: 44px; height: 44px; border-radius: 50%; }
.rr .ai-action-button:hover { transform: none; }
.rr .ai-tutor-body { min-height: 320px; }
.rr .ai-loading-container { background: color-mix(in srgb, var(--r-surface) 94%, transparent); }
.rr .ai-message-user { color: #fff; }
html[data-theme="dark"] .rr .ai-message-user { background: var(--r-surface-3); }
.rr .ai-message-bot { box-shadow: none; }
.rr .ai-chat-interface { height: min(640px, 72vh); }
.rr .ai-chat-input { font-size: 16px; }
.rr .ai-voice-button, .rr .ai-send-button, .rr .ai-stop-button { width: 46px; height: 46px; }
.rr .ai-send-button { color: var(--r-on-gold); }
.rr .ai-empty-state { padding: 2.5rem 1.25rem; }
.rr .ai-empty-state h5 { font-size: 18px !important; color: var(--r-ink) !important; }
.rr .pro-tip-box { color: var(--r-ink-2); border-left-color: var(--r-gold-fill); background: var(--r-gold-soft); }
.rr .ai-primary-button { color: var(--r-on-gold); font-size: 15px; padding: .85rem 1.6rem; }
.rr .ai-insights-content { padding: 1.25rem; color: var(--r-ink); }
.rr .ai-insights-content .card { background: var(--r-surface-2) !important; color: var(--r-ink); border-color: var(--r-line) !important; }

/* ---- 12. Videos ------------------------------------------------------------ */
.rr-vidlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rr-vid-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 60px; border-radius: var(--r-r-md); border: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-ink); text-align: left; cursor: pointer; touch-action: manipulation; transition: background var(--r-fast); }
.rr-vid-item:hover { background: var(--r-surface-2); }
.rr-vid-item > i { margin-left: auto; color: var(--r-gold-fill); font-size: 20px; }
.rr-vid-q { flex: 0 0 auto; font-family: var(--r-font-mono); font-weight: 700; font-size: 13px; padding: 4px 8px; border-radius: 8px; background: var(--r-surface-2); }
.rr-vid-item.is-wrong .rr-vid-q { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-vid-item.is-correct .rr-vid-q { background: var(--r-ok-soft); color: var(--r-ok); }
.rr-vid-txt { display: flex; flex-direction: column; min-width: 0; }
.rr-vid-txt strong { font-size: 14px; }
.rr-vid-txt span { font-size: 12.5px; color: var(--r-ink-3); }
.rr-player-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
.rr-playlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; }
.rr-playlist .list-group-item { background: transparent !important; border: 1px solid var(--r-line) !important; border-radius: var(--r-r-sm) !important; padding: 0 !important; box-shadow: none !important; }
.rr-playlist .list-group-item.active { border-color: var(--r-gold-fill) !important; background: var(--r-gold-soft) !important; }
.rr-playlist a { display: flex; gap: 8px; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--r-ink) !important; text-decoration: none; font-weight: 700; font-size: 14px; }
.rr-playlist a i { color: var(--r-gold); }
.rr-video iframe, .rr-video video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--r-r-md); background: #000; }

/* ---- 13. Score estimator --------------------------------------------------- */
.rr-calc-scores { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.rr-calc-total, .rr-calc-sec { border-radius: var(--r-r-md); padding: 14px 16px; background: var(--r-surface-2); display: flex; flex-direction: column; gap: 4px; }
.rr-calc-total { background: var(--r-navy); color: #fff; }
.rr-calc-total span, .rr-calc-sec span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; opacity: .8; }
.rr-calc-total strong { font-size: 30px; color: var(--r-gold-fill); }
.rr-calc-sec strong { font-size: 22px; color: var(--r-ink); }
.rr-calc-total small, .rr-calc-sec small { font-size: 12px; opacity: .7; }
.rr-calc-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rr-calc-sliders fieldset { border: 1px solid var(--r-line); border-radius: var(--r-r-md); padding: 12px 16px 16px; margin: 0; min-width: 0; }
.rr-calc-sliders legend { font-size: 13px; font-weight: 800; color: var(--r-ink); padding: 0 6px; width: auto; float: none; margin: 0; }
.rr-calc-sliders label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; color: var(--r-ink-2); margin: 10px 0 6px; }
.rr-calc-sliders input[type="range"] { width: 100%; height: 32px; accent-color: var(--r-gold-fill); background: transparent; }

/* ---- 14. Dialogs (report, drill) + Bootstrap modals ----------------------- */
.rr-overlay { position: fixed; inset: 0; z-index: 10060; background: rgba(4,21,41,.6); display: flex; align-items: center; justify-content: center; padding: 16px; font-family: var(--r-font); }
.rr-dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--r-surface); color: var(--r-ink); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); box-shadow: var(--r-shadow-lg); padding: 20px; animation: rr-pop var(--r-mid) var(--r-ease); }
@keyframes rr-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.rr-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.rr-dialog-head h3 { margin: 0; font-size: 17px !important; font-weight: 800; color: var(--r-ink) !important; display: flex; gap: 8px; align-items: center; font-family: var(--r-font) !important; }
.rr-dialog-head h3 i { color: var(--r-gold); }
.rr-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.rr-label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--r-ink-3); margin: 12px 0 6px; }
.rr-input { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--r-r-sm); border: 1px solid var(--r-line-strong) !important; background: var(--r-surface) !important; color: var(--r-ink) !important; font-size: 16px; }
.rr-input:focus { outline: 2px solid var(--r-focus); outline-offset: 1px; }
textarea.rr-input { resize: vertical; }
.rr-overlay .rr-p { color: var(--r-ink-2); font-size: 14px; }

/* The shell sidebar is z-index 9999; Bootstrap modals (1055) and the backdrop (1050) sat under it. */
.rr .rr-modal { z-index: 10050; }
body.tta-workspace > .modal-backdrop { z-index: 10040; }
.rr-modal .modal-content { background: var(--r-surface) !important; color: var(--r-ink); border: 1px solid var(--r-line) !important; border-radius: var(--r-r-lg) !important; box-shadow: var(--r-shadow-lg); overflow: hidden; font-family: var(--r-font); }
.rr-modal .modal-header { background: var(--r-surface); border-bottom: 1px solid var(--r-line) !important; align-items: center; padding: 14px 18px; }
.rr-modal .modal-title { font-size: 16px !important; font-weight: 800; color: var(--r-ink) !important; display: flex; gap: 8px; align-items: center; font-family: var(--r-font) !important; }
.rr-modal .modal-title i { color: var(--r-gold); }
.rr-modal .modal-body { background: var(--r-bg); color: var(--r-ink); }
.rr-modal .modal-footer { background: var(--r-surface); border-top: 1px solid var(--r-line) !important; display: flex; justify-content: space-between; gap: 10px; }
.rr-modal .accordion-item { background: var(--r-surface); border-color: var(--r-line); color: var(--r-ink); }
.rr-modal .accordion-button { background: var(--r-surface); color: var(--r-ink); font-weight: 700; }
.rr-modal .accordion-button:not(.collapsed) { background: var(--r-surface-2); color: var(--r-ink); box-shadow: none; }
.rr-modal .accordion-body { color: var(--r-ink-2); }
.rr .decision-tree-modal-body { position: relative; padding: 0; min-height: 60vh; }
.rr .decision-tree-modal-loading { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; padding: 2rem; text-align: center; background: var(--r-bg); }
.rr .decision-tree-modal-spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--r-line); border-top-color: var(--r-gold-fill); animation: rr-spin 900ms linear infinite; }
.rr .decision-tree-loading-title { font-weight: 800; font-size: 16px; color: var(--r-ink); }
.rr .decision-tree-loading-subtitle { color: var(--r-ink-3); font-size: 13.5px; max-width: 440px; }
.rr .decision-tree-progress-shell { width: min(420px, 90%); height: 8px; border-radius: var(--r-pill); background: var(--r-surface-2); overflow: hidden; }
.rr .decision-tree-progress-bar { width: 8%; height: 100%; border-radius: var(--r-pill); background: var(--r-gold-fill); transition: width .35s ease; }
.rr .decision-tree-modal-result { max-height: 74vh; overflow-y: auto; padding: 18px; background: var(--r-bg); }
.rr .decision-tree-modal-error { margin: 18px; padding: 14px; border-radius: var(--r-r-md); border-left: 4px solid var(--r-bad-fill); background: var(--r-bad-soft); color: var(--r-bad); font-weight: 700; }
.rr .decision-tree-modal-result .dt-render-shell { display: grid; gap: 12px; }
.rr .decision-tree-modal-result .dt-render-card { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-md); padding: 14px; }
.rr .decision-tree-modal-result .dt-render-card.full { grid-column: 1 / -1; }
.rr .decision-tree-modal-result .dt-render-card.danger { border-left: 4px solid var(--r-bad-fill); }
.rr .decision-tree-modal-result .dt-render-label { color: var(--r-ink-3); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.rr .decision-tree-modal-result .dt-render-value { color: var(--r-ink); font-size: 14px; }
.rr .decision-tree-modal-result .dtx-shell { display: grid; gap: 14px; }
.rr .decision-tree-modal-result .dtx-hero { background: var(--r-navy); color: #fff; border-radius: var(--r-r-md); padding: 14px 16px; }
.rr .decision-tree-modal-result .dtx-hero strong { display: block; font-size: 15px; font-weight: 800; margin-bottom: 4px; color: var(--r-gold-fill); }
.rr .decision-tree-modal-result .dtx-hero span { display: block; color: rgba(255,255,255,.82); font-size: 13.5px; line-height: 1.55; }
.rr .decision-tree-modal-result .dtx-progress { display: flex; gap: 5px; margin-top: 10px; }
.rr .decision-tree-modal-result .dtx-dot { width: 28px; height: 6px; border-radius: var(--r-pill); background: rgba(255,255,255,.22); transition: width var(--r-mid), background var(--r-mid); }
.rr .decision-tree-modal-result .dtx-dot.active { background: var(--r-gold-fill); width: 42px; }
.rr .decision-tree-modal-result .dtx-step { display: none; background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-md); padding: 16px; animation: rr-fade var(--r-mid) var(--r-ease); }
.rr .decision-tree-modal-result .dtx-step.active { display: block; }
.rr .decision-tree-modal-result .dtx-k { color: var(--r-ink-3); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.rr .decision-tree-modal-result .dtx-title { font-size: 15.5px; font-weight: 800; color: var(--r-ink); margin-bottom: 6px; }
.rr .decision-tree-modal-result .dtx-text { color: var(--r-ink-2); font-size: 14px; line-height: 1.6; margin: 0; }
.rr .decision-tree-modal-result .dtx-chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rr .decision-tree-modal-result .dtx-chip { min-height: 40px; border: 1px solid var(--r-line-strong); background: var(--r-surface); border-radius: var(--r-pill); padding: 0 14px; color: var(--r-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.rr .decision-tree-modal-result .dtx-chip.active { background: var(--r-navy); border-color: var(--r-navy); color: #fff; }
.rr .decision-tree-modal-result .dtx-chip.correct.active { background: var(--r-ok-fill); border-color: var(--r-ok-fill); }
.rr .decision-tree-modal-result .dtx-chip.missed { background: var(--r-warn-soft); border-color: var(--r-warn); color: var(--r-warn); }
.rr .decision-tree-modal-result .dtx-feedback { display: none; margin-top: 12px; border-left: 4px solid var(--r-gold-fill); background: var(--r-gold-soft); border-radius: var(--r-r-sm); padding: 10px 12px; color: var(--r-ink); font-size: 13.5px; }
.rr .decision-tree-modal-result .dtx-feedback.show { display: block; }
.rr .decision-tree-modal-result .dtx-answer-row, .rr .decision-tree-modal-result .dtx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rr .decision-tree-modal-result .dtx-answer, .rr .decision-tree-modal-result .dtx-card { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-md); padding: 14px; }
.rr .decision-tree-modal-result .dtx-answer.student, .rr .decision-tree-modal-result .dtx-card.student { box-shadow: inset 4px 0 0 var(--r-bad-fill); }
.rr .decision-tree-modal-result .dtx-answer.correct, .rr .decision-tree-modal-result .dtx-card.correct { box-shadow: inset 4px 0 0 var(--r-ok-fill); }
.rr .decision-tree-modal-result .dtx-answer b, .rr .decision-tree-modal-result .dtx-card h4 { display: block; color: var(--r-ink-3); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 6px; font-family: var(--r-font) !important; }
.rr .decision-tree-modal-result .dtx-answer span { color: var(--r-ink); font-size: 14px; line-height: 1.55; }
.rr .decision-tree-modal-result .dtx-card ol { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
.rr .decision-tree-modal-result .dtx-card li { color: var(--r-ink-2); font-size: 13.5px; line-height: 1.5; }
.rr .decision-tree-modal-result .dtx-trap details { background: var(--r-surface); border: 1px solid var(--r-line); border-left: 4px solid var(--r-bad-fill); border-radius: var(--r-r-sm); padding: 10px 12px; margin-bottom: 8px; }
.rr .decision-tree-modal-result .dtx-trap summary { cursor: pointer; color: var(--r-bad); font-weight: 800; font-size: 13.5px; min-height: 32px; display: flex; align-items: center; }
.rr .decision-tree-modal-result .dtx-trap p { margin: 8px 0 0; color: var(--r-ink-2); font-size: 13.5px; }
.rr .decision-tree-modal-result .dtx-check { display: grid; gap: 8px; margin-top: 10px; }
.rr .decision-tree-modal-result .dtx-check label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--r-line); border-radius: var(--r-r-sm); background: var(--r-surface); padding: 10px 12px; color: var(--r-ink-2); font-size: 14px; cursor: pointer; min-height: 44px; }
.rr .decision-tree-modal-result .dtx-check label.done { background: var(--r-ok-soft); border-color: var(--r-ok-fill); color: var(--r-ok); font-weight: 700; }
.rr .decision-tree-modal-result .dtx-actions { display: flex; justify-content: space-between; gap: 10px; }
.rr .decision-tree-modal-result .dtx-btn { min-height: 44px; border: 1px solid var(--r-line-strong); background: var(--r-surface); color: var(--r-ink); border-radius: var(--r-pill); padding: 0 16px; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.rr .decision-tree-modal-result .dtx-btn.primary { background: var(--r-gold-fill); border-color: var(--r-gold-fill); color: var(--r-on-gold); }
.rr .decision-tree-modal-result .dtx-btn:disabled { opacity: .45; cursor: not-allowed; }
.rr .decision-tree-modal-result .dtx-tree-toggle { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-md); padding: 12px 14px; }
.rr .decision-tree-modal-result .dtx-tree-toggle summary { cursor: pointer; color: var(--r-ink); font-size: 13.5px; font-weight: 800; min-height: 32px; display: flex; align-items: center; gap: 8px; }
.rr .decision-tree-modal-result .dtree-summary-card { background: var(--r-surface-2); border: 1px solid var(--r-line); border-radius: var(--r-r-sm); padding: 10px 12px; }
.rr .decision-tree-modal-result .dtree-summary-card strong { color: var(--r-ink); }
.rr .decision-tree-modal-result .dtree-summary-card span { color: var(--r-ink-2); }
.rr .decision-tree-modal-result .dtree-canvas-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--r-line); border-radius: var(--r-r-md); background: var(--r-bg); padding: 12px; }
.rr .decision-tree-modal-result .dtree-canvas { position: relative; min-height: 260px; }
.rr .decision-tree-modal-result .dtree-svg { position: absolute; inset: 0; pointer-events: none; }
.rr .decision-tree-modal-result .dtree-svg path, .rr .decision-tree-modal-result .dtree-svg line { stroke: var(--r-line-strong); }
.rr .decision-tree-modal-result .dtree-node { position: absolute; width: 190px; min-height: 58px; border-radius: 10px; border: 1.5px solid var(--r-line-strong); background: var(--r-surface); padding: 8px 10px; font-size: 11.5px; line-height: 1.3; color: var(--r-ink); }
.rr .decision-tree-modal-result .dtree-node .k { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--r-ink-3); font-weight: 800; margin-bottom: 3px; }
.rr .decision-tree-modal-result .dtree-node.root { background: var(--r-navy); color: #fff; border-color: var(--r-navy); }
.rr .decision-tree-modal-result .dtree-node.root .k { color: rgba(255,255,255,.7); }
.rr .decision-tree-modal-result .dtree-node.correct, .rr .decision-tree-modal-result .dtree-node.correct_leaf { background: var(--r-ok-soft); border-color: var(--r-ok-fill); color: var(--r-ok); }
.rr .decision-tree-modal-result .dtree-node.wrong, .rr .decision-tree-modal-result .dtree-node.wrong_leaf { background: var(--r-bad-soft); border-color: var(--r-bad-fill); color: var(--r-bad); }
.rr .decision-tree-modal-result .dtree-node.on-path { box-shadow: 0 0 0 3px var(--r-gold-soft); border-color: var(--r-gold-fill); }
.rr .decision-tree-modal-result .dtree-node.branch-hit::after { content: "You are here"; position: absolute; top: -10px; right: 8px; background: var(--r-gold-fill); color: var(--r-on-gold); border-radius: var(--r-pill); padding: 2px 7px; font-size: 9.5px; font-weight: 800; }
.rr .decision-tree-modal-result .dtree-recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 12px; }
.rr .decision-tree-modal-result .dtree-rec { border: 1px solid var(--r-line); background: var(--r-gold-soft); color: var(--r-ink); border-radius: var(--r-r-sm); padding: 9px 10px; font-size: 12.5px; }

/* ---- 15. Guided explanation, tutor overlay, toast -------------------------- */
.rr #tutor-overlay-container { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.rr #tutor-svg-overlay { width: 100%; height: 100%; }
.rr .tutor-annotation { stroke-width: 3px; stroke-linecap: round; stroke-linejoin: round; fill: none; transition: stroke-dashoffset .8s cubic-bezier(.45,0,.55,1); }
.rr .tutor-circle { stroke: var(--r-gold-fill); stroke-width: 4px; }
.rr .tutor-underline { stroke: var(--r-bad-fill); stroke-width: 2.5; }
.rr .tutor-highlight { fill: rgba(212,175,55,.35); stroke: rgba(212,175,55,.8); stroke-width: 1; }
.rr .tutor-arrow { stroke: var(--r-ok-fill); }
.rr .tutor-callout { position: absolute; background: var(--r-surface); color: var(--r-ink); border: 1px solid var(--r-gold-fill); border-radius: var(--r-r-sm); padding: 10px 12px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--r-shadow-lg); max-width: 260px; z-index: 40; pointer-events: auto; animation: rr-pop var(--r-mid) var(--r-ease); }
.rr .tutor-hard-focus { animation: rr-glow 2.4s ease-in-out infinite; border-radius: 6px; position: relative; z-index: 10; }
@keyframes rr-glow { 0%,100% { box-shadow: 0 0 0 2px rgba(212,175,55,.35); } 50% { box-shadow: 0 0 0 6px rgba(212,175,55,.45); } }
.rr .tutor-cross-out { position: relative; opacity: .6; }
.rr .tutor-cross-out::after { content: ''; position: absolute; top: 50%; left: 5%; width: 90%; height: 3px; background: var(--r-bad-fill); transform: rotate(-4deg); border-radius: 2px; }
.rr .tutor-annotation-wrapper { position: relative; display: inline; }
.rr .tutor-highlight-text { background: rgba(212,175,55,.35); border-radius: 3px; padding: 1px 3px; color: inherit; }
.rr .tutor-underline-text { border-bottom: 2px solid var(--r-bad-fill); }
.rr .tutor-focus { box-shadow: 0 0 0 3px rgba(212,175,55,.45); border-color: var(--r-gold-fill) !important; }
.rr #ai-guide-ui { display: none; position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10020; width: min(880px, calc(100vw - 24px)); background: #0A2342; color: #F8FAFC; border: 1px solid #D4AF37; border-radius: var(--r-r-lg); padding: 18px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.rr #ai-guide-explanation { margin: 0 32px 14px 0; font-size: 15.5px; line-height: 1.6; max-height: 34vh; overflow-y: auto; }
.rr #ai-guide-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rr #ai-guide-controls .rr-btn-ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff !important; }
.rr #ai-guide-step-counter { font-family: var(--r-font-mono); font-size: 13px; opacity: .8; }
.rr #ai-guide-close-btn { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #fff; font-size: 18px; cursor: pointer; opacity: .75; }
.rr #ai-guide-close-btn:hover { opacity: 1; background: rgba(255,255,255,.1); }
.rr #ai-guide-loading-overlay { display: none; position: fixed; inset: 0; z-index: 10030; background: rgba(4,21,41,.7); align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: #fff; font-weight: 700; }
.rr #ai-toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 10070; transform: translate(-50%, 160%); visibility: hidden; opacity: 0; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px); padding: 12px 18px; border-radius: var(--r-pill); background: #0A2342; color: #F8FAFC; border: 1px solid #284663; font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.35); transition: transform var(--r-mid) var(--r-ease), opacity var(--r-mid), visibility 0s linear var(--r-mid); }
.rr #ai-toast.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; transition: transform var(--r-mid) var(--r-ease), opacity var(--r-mid), visibility 0s; }
.rr #ai-toast.is-success .icon { color: #34D399; }
.rr #ai-toast.is-error .icon { color: #FF8A80; }
.rr #ai-toast.is-info .icon { color: #D4AF37; }

/* ---- 16. Responsive -------------------------------------------------------- */
/* Laptops / iPad landscape: rail becomes a toolbar above the question. */
@media (max-width: 1439px) {
  .rr-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rr-summary .rr-next { grid-column: 1 / -1; }
  .rr-steps { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); column-gap: 18px; }
  .rr-step:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--r-line); }
  .rr-review { grid-template-columns: minmax(0, 1fr); }
  .rr-rail { position: static; max-height: none; display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 12px 18px; align-items: start; }
  .rr-rail .rr-map-wrap { grid-column: 1 / -1; }
  .rr-modules { grid-auto-flow: column; grid-auto-columns: minmax(150px, max-content); overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .rr-map { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); max-height: 200px; }
  .rr .q-box { height: 40px; min-width: 40px; }
  .rr-kbd-hint { display: none; }
}
/* iPad portrait and below: one column; the passage is a short scrolling box with an expand button. */
@media (max-width: 1100px) {
  .rr .test-content-columns { grid-template-columns: minmax(0, 1fr); }
  .rr .passage-display-area { position: relative; top: 0; max-height: 44vh; }
  .rr .passage-display-area.is-expanded { max-height: none; }
  .rr-passage-toggle { display: inline-flex; }
  .rr-callouts { grid-template-columns: minmax(0, 1fr); }
  .rr-player-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .rr-summary { grid-template-columns: minmax(0, 1fr); }
  .rr-rail { grid-template-columns: minmax(0, 1fr); }
  .rr-calc-scores, .rr-calc-sliders { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .rr { font-size: 15px; }
  .rr-hide-sm { display: none !important; }
  .rr-bar { gap: 10px; }
  .rr-bar-actions { width: 100%; }
  .rr-bar-actions .rr-btn { flex: 1 1 0; padding: 0 10px; }
  .rr-card { padding: 14px; border-radius: var(--r-r-md); }
  .rr-score { flex-direction: column; align-items: stretch; text-align: left; }
  .rr-ring { width: 112px; height: 112px; flex-basis: 112px; align-self: center; }
  .rr-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rr-steps { grid-template-columns: minmax(0, 1fr); }
  .rr-step { grid-template-columns: 32px minmax(0, 1fr); }
  .rr-step-ic { width: 32px; height: 32px; }
  .rr-step > .rr-btn, .rr-step > .rr-step-actions { grid-column: 2; justify-content: flex-start; justify-self: start; }
  .rr-tabs { border-radius: var(--r-r-md); margin-left: -2px; margin-right: -2px; }
  .rr-tab { padding: 0 14px; }
  .rr-rail { padding: 12px; }
  .rr-q-head { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "status status nav" "title title count" "chips chips chips"; padding: 12px; }
  .rr .question-card-body { padding: 14px 12px 4px; }
  .rr .answer-option { padding: 10px; gap: 10px; }
  .rr-letter { flex-basis: 30px; width: 30px; height: 30px; }
  .rr .question-tools.rr-learn { display: grid; grid-template-columns: minmax(0, 1fr); }
  .rr-learn-btn { width: 100%; }
  .rr-learn-btn.is-quiet { margin-left: 0; }
  .rr-q-foot { padding: 10px 12px 12px; }
  .rr-q-foot .rr-btn { flex: 1 1 0; }
  .rr-q-foot-mid { display: none; }
  .rr .current-passage-content { font-size: 16px; }
  .rr-topics { grid-template-columns: minmax(0, 1fr); }
  .rr-topic-actions .rr-btn { flex: 1 1 auto; }
  .rr .gridin-label { min-width: 0; flex: 1 1 100%; }
  .rr .decision-tree-modal-result .dtx-answer-row, .rr .decision-tree-modal-result .dtx-grid { grid-template-columns: minmax(0, 1fr); }
  .rr .decision-tree-modal-result .dtree-node { width: 170px; }
  .rr-modal .modal-dialog { margin: 8px; }
  .rr #ai-guide-ui { padding: 14px; }
  .rr #ai-guide-explanation { font-size: 14.5px; margin-right: 34px; }
}
/* Coarse pointers (phones, iPads): every tap target at least 44px. */
@media (pointer: coarse) {
  .rr-filter, .rr-chip-sm, .rr-chip-btn, .rr-btn-sm, .rr-icon-btn { min-height: 44px; }
  .rr-icon-btn { width: 44px; min-width: 44px; }
  .rr .q-box { height: 44px; min-width: 44px; }
  .rr .eliminate-btn { width: 44px; height: 44px; flex-basis: 44px; }
}
/* Touch screens: no hover-only affordances or sticky hover colours. */
@media (hover: none) {
  .rr .eliminate-btn { opacity: .85; }
  .rr-btn:hover, .rr-chip-btn:hover, .rr-learn-btn:hover, .rr-module:hover, .rr-secbar:hover { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rr *, .rr *::before, .rr *::after, .rr-overlay * { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media print {
  .rr-bar-actions, .rr-tabs, .rr-rail, .rr-learn, .rr-q-foot, .rr-q-nav, .rr-next { display: none !important; }
  .rr .test-content-columns { grid-template-columns: 1fr; }
  .rr .passage-display-area { position: static; max-height: none; box-shadow: none; }
}

/* ============================================================================
   Targeted Practice list (Student/practice/index.blade.php)
   ============================================================================ */
.rr-sp { max-width: 1040px; }
.rr-sp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.rr-sp-head p { margin: 6px 0 0; color: var(--r-ink-2); max-width: 620px; }
.rr-sp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.rr-sp-stat { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-md); padding: 14px 16px; box-shadow: var(--r-shadow); }
.rr-sp-stat span { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--r-ink-3); }
.rr-sp-stat strong { display: block; font-family: var(--r-font-mono); font-size: 24px; color: var(--r-ink); margin-top: 2px; }
.rr-sp-group { margin-top: 22px; }
.rr-sp-group > h2 { font-size: 13px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--r-ink-3) !important; margin: 0 0 10px; font-family: var(--r-font) !important; display: flex; gap: 8px; align-items: center; }
.rr-sp-list { display: grid; gap: 10px; }
.rr-sp-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); padding: 16px 18px; box-shadow: var(--r-shadow); }
.rr-sp-card.is-due { border-color: var(--r-warn); }
.rr-sp-card.is-live { border-color: var(--r-gold-fill); box-shadow: inset 4px 0 0 var(--r-gold-fill), var(--r-shadow); }
.rr-sp-title { font-weight: 800; font-size: 16px; color: var(--r-ink); line-height: 1.3; overflow-wrap: anywhere; }
.rr-sp-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; align-items: center; }
.rr-sp-prog { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--r-ink-3); }
.rr-sp-prog .rr-meter { flex: 1; max-width: 360px; }
.rr-sp-prog .rr-meter i { background: var(--r-gold-fill); }
.rr-sp-score { font-family: var(--r-font-mono); font-weight: 700; font-size: 20px; }
.rr-sp-score.ok { color: var(--r-ok); } .rr-sp-score.warn { color: var(--r-warn); } .rr-sp-score.bad { color: var(--r-bad); }
.rr-sp-side { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.rr-sp-empty { text-align: center; padding: 44px 20px; background: var(--r-surface); border: 1px dashed var(--r-line-strong); border-radius: var(--r-r-lg); color: var(--r-ink-2); }
.rr-sp-empty i { font-size: 30px; color: var(--r-gold); display: block; margin-bottom: 12px; }
.rr-sp-more { margin-top: 10px; }
@media (max-width: 760px) {
  .rr-sp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rr-sp-card { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .rr-sp-side { justify-content: space-between; }
  .rr-sp-side .rr-btn { flex: 1 1 auto; }
  .rr-sp-head .rr-btn { width: 100%; }
}

/* ============================================================================
   Shared extras (2026-10-06 pack 2): details, small stats, qvid slots, icon-danger
   ============================================================================ */
.rr-details { margin-top: 12px; border-top: 1px solid var(--r-line); padding-top: 10px; }
.rr-details summary { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--r-ink-2); min-height: 32px; display: flex; align-items: center; }
.rr-stats-sm { margin-top: 10px; }
.rr-stats-sm .rr-stat dd { font-size: 16px; }
.rr-qvid-slot:empty { display: none; }
.rr-icon-danger { color: var(--r-bad); }
.rr-icon-danger:hover { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-free-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; border-color: var(--r-gold-fill); }
.rr-free-cta > i { font-size: 24px; color: var(--r-gold); }
.rr-free-cta > div { flex: 1 1 260px; }
.rr-free-cta strong { display: block; }
.rr-free-cta span { font-size: 13px; color: var(--r-ink-3); }

/* ============================================================================
   Practice-set results (Student/practice/result.blade.php)
   ============================================================================ */
.rr-pr-list { display: grid; gap: 14px; }
.rr-pr-q .question-card-body { padding-bottom: 8px; }
.rr-pr-passage { margin-bottom: 14px; border: 1px solid var(--r-line); border-radius: var(--r-r-md); background: var(--r-surface-2); }
.rr-pr-passage summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 13px; font-weight: 800; color: var(--r-ink-2); }
.rr-pr-passage .current-passage-content { padding: 4px 16px 16px; font-size: 15.5px; }
.rr .rr-pr-why { border-left-color: var(--r-gold-fill); }
.rr .rr-pr-why h4 i { color: var(--r-gold); }
.rr-pr-q .rr-learn { margin-top: 8px; }

/* ============================================================================
   Adaptive results (Web/tests/adaptive-results.blade.php) — the page keeps its own JS hooks
   (.review-card / .tab-pane / .bm-sq / .review-choice …); these rules restyle them inside .rr.
   ============================================================================ */
html body:has(.rr-adapt) { background: var(--ad-page-bg, #F8FAFC); }
html[data-theme="dark"] body:has(.rr-adapt) { --ad-page-bg: #041529; background: #041529; }
.rr-adapt { padding: 20px 24px 96px; }
.rr-adapt .results-wrap { max-width: none; padding: 0; margin: 0; }
.rr-adapt .ad-console { padding: 0; overflow: hidden; }
.ad-console-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--r-line); }
.ad-console-head .rr-filters { flex: 1 1 auto; }
.rr-adapt .battle-map { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 14px 18px; background: var(--r-surface); border-bottom: 1px solid var(--r-line); margin: 0; }
.rr-adapt .bm-module-title { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--r-ink-3); margin-bottom: 8px; display: flex; gap: 8px; }
.rr-adapt .bm-module-title span { font-family: var(--r-font-mono); color: var(--r-ink-2); }
.rr-adapt .bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.rr-adapt .bm-sq { position: relative; height: 40px; min-width: 40px; border-radius: 9px; border: 1.5px solid var(--r-line-strong); background: var(--r-surface); color: var(--r-ink-2); font-family: var(--r-font-mono); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transform: none; box-shadow: none; opacity: 1; touch-action: manipulation; transition: opacity var(--r-fast), box-shadow var(--r-fast); }
.rr-adapt .bm-sq:hover { transform: none; box-shadow: none; opacity: 1; background: var(--r-surface-2); }
.rr-adapt .bm-correct { background: var(--r-ok-soft); border-color: var(--r-ok-fill); color: var(--r-ok); }
.rr-adapt .bm-incorrect { background: var(--r-bad-soft); border-color: var(--r-bad-fill); color: var(--r-bad); }
.rr-adapt .bm-skipped { border-style: dashed; color: var(--r-ink-3); }
.rr-adapt .bm-sq.active-q { transform: none; box-shadow: 0 0 0 3px var(--r-gold-fill); border-width: 1.5px; }
.rr-adapt .bm-sq.is-dim { opacity: .28; }
.rr-adapt .bm-sq.has-video::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--r-gold-fill); }
.rr-adapt .tab-nav { display: flex; gap: 6px; padding: 10px 18px 0; background: var(--r-surface); border-bottom: 1px solid var(--r-line); overflow-x: auto; }
.rr-adapt .tab-btn { min-height: 44px; padding: 0 16px; border-radius: var(--r-r-sm) var(--r-r-sm) 0 0; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--r-ink-2); font-size: 14px; font-weight: 800; cursor: pointer; }
.rr-adapt .tab-btn.active { color: var(--r-ink); border-bottom-color: var(--r-gold-fill); background: transparent; }
.rr-adapt .tab-pane { padding: 16px 18px 18px; background: var(--r-bg); }
.rr-adapt .review-card { border: 1px solid var(--r-line); border-radius: var(--r-r-lg); background: var(--r-surface); overflow: hidden; box-shadow: var(--r-shadow); }
.rr-adapt .pane-left { background: var(--r-surface); border-right: 1px solid var(--r-line); padding: 18px 20px; max-height: calc(100vh - 140px); overflow-y: auto; }
.rr-adapt .pane-right, .rr-adapt .pane-full { padding: 18px 20px; }
.rr-adapt .passage-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--r-ink-3); margin-bottom: 10px; }
.rr-adapt .passage-body { font-family: var(--r-font-read); font-size: 16.5px; line-height: 1.75; color: var(--r-ink); }
.rr-adapt .q-meta-header { gap: 10px; align-items: center; margin-bottom: 10px; }
.rr-adapt .q-badge { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-family: var(--r-font-mono); }
.rr-adapt .q-badge.correct { background: var(--r-ok-fill); } .rr-adapt .q-badge.incorrect { background: var(--r-bad-fill); } .rr-adapt .q-badge.skipped { background: var(--r-ink-3); }
.rr-adapt .q-status-text.correct { color: var(--r-ok); } .rr-adapt .q-status-text.incorrect { color: var(--r-bad); } .rr-adapt .q-status-text.skipped { color: var(--r-ink-3); }
.rr-adapt .meta-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--r-surface-2); color: var(--r-ink-2); font-size: 12px; font-weight: 700; border: 0; }
.rr-adapt .meta-chip.mastered { background: var(--r-ok-soft); color: var(--r-ok); }
.rr-adapt .meta-chip.priority { background: var(--r-bad-soft); color: var(--r-bad); }
.rr-adapt .question-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rr-adapt .q-stem-text { font-family: var(--r-font); font-size: 16px; line-height: 1.65; color: var(--r-ink); font-weight: 500; }
.rr-adapt .user-ans-box { background: var(--r-surface-2); border: 1px solid var(--r-line); border-radius: var(--r-r-md); color: var(--r-ink); }
.rr-adapt .user-ans-box > div, .rr-adapt .user-answer-value { color: var(--r-ink) !important; font-family: var(--r-font) !important; }
.rr-adapt .ans-correct-pill { background: var(--r-ok-soft); color: var(--r-ok); border-radius: var(--r-r-sm); }
.rr-adapt .review-choice { border: 1.5px solid var(--r-line); border-radius: var(--r-r-md); background: var(--r-surface); color: var(--r-ink); padding: 12px 14px; min-height: 48px; gap: 10px; }
.rr-adapt .review-choice.is-correct { border-color: var(--r-ok-fill); background: var(--r-ok-soft); }
.rr-adapt .review-choice.user-wrong { border-color: var(--r-bad-fill); background: var(--r-bad-soft); }
.rr-adapt .review-choice.blind-option { border-color: var(--r-line); background: var(--r-surface); cursor: pointer; }
.rr-adapt .review-choice.blind-option:hover { border-color: var(--r-gold-fill); background: var(--r-gold-soft); }
.rr-adapt .choice-label { color: var(--r-ink); }
.rr-adapt .cross-toggle { min-width: 36px; min-height: 36px; border-radius: 50%; border: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-ink-3); }
.rr-adapt .btn-tools, .rr-adapt .btn-ai-explain { min-height: 40px; border-radius: var(--r-pill); background: var(--r-navy); color: #fff; border: 1px solid var(--r-navy); }
html[data-theme="dark"] .rr-adapt .btn-tools, html[data-theme="dark"] .rr-adapt .btn-ai-explain { background: var(--r-gold-fill); border-color: var(--r-gold-fill); color: var(--r-on-gold); }
.rr-adapt .btn-ai-mistake, .rr-adapt .btn-report-q { min-height: 40px; border-radius: var(--r-pill); background: var(--r-surface); color: var(--r-ink); border: 1px solid var(--r-line-strong); }
.rr-adapt .tool-menu { background: var(--r-surface); border: 1px solid var(--r-line); box-shadow: var(--r-shadow-lg); }
.rr-adapt .tool-menu button { color: var(--r-ink); min-height: 44px; background: var(--r-surface); }
.rr-adapt .tool-menu button:hover { background: var(--r-surface-2); color: var(--r-ink); }
.rr-adapt .ai-section { border-top-color: var(--r-line); }
.rr-adapt .ai-result-card.explain-card { background: var(--r-gold-soft); border-color: var(--r-gold-fill); color: var(--r-ink); }
.rr-adapt .ai-result-card.mistake-card { background: var(--r-bad-soft); border-color: var(--r-bad-fill); color: var(--r-ink); }
.rr-adapt .mistake-row { background: var(--r-surface); border-color: var(--r-line); }
.rr-adapt .mistake-row span { color: var(--r-ink-2); }
.rr-adapt .review-nav-row { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-md); margin-top: 12px; padding: 10px 12px; }
.rr-adapt .btn-nav-q { min-height: 44px; border-radius: var(--r-pill); background: var(--r-surface); color: var(--r-ink); border: 1px solid var(--r-line-strong); font-weight: 800; }
.rr-adapt .btn-nav-q.next { background: var(--r-navy); color: #fff; border-color: var(--r-navy); }
html[data-theme="dark"] .rr-adapt .btn-nav-q.next { background: var(--r-gold-fill); color: var(--r-on-gold); border-color: var(--r-gold-fill); }
.rr-adapt .q-counter-text { color: var(--r-ink-3); font-family: var(--r-font-mono); }
.rr-adapt .ad-qvid { margin-top: 12px; }
.rr-adapt.ad-blind .ad-qvid { display: none; }
.rr-adapt .dtree-widget { margin-top: 12px; }
/* Floating tools (Mr. O sidebar, notes, toast, whiteboard) follow the theme too. */
.rr-adapt .ai-fab { background: var(--r-navy); color: #fff; border: 1px solid var(--r-gold-fill); z-index: 10010; }
html[data-theme="dark"] .rr-adapt .ai-fab { background: var(--r-gold-fill); color: var(--r-on-gold); }
.rr-adapt .ai-sidebar { background: var(--r-surface); color: var(--r-ink); z-index: 10020; }
.rr-adapt .ai-chat-body { background: var(--r-bg); }
.rr-adapt .ai-msg.ai { background: var(--r-surface); color: var(--r-ink); border-color: var(--r-line); }
.rr-adapt .ai-msg.user { background: var(--r-navy); color: #fff; }
html[data-theme="dark"] .rr-adapt .ai-msg.user { background: var(--r-surface-3); }
.rr-adapt .ai-chat-footer { background: var(--r-surface); border-top-color: var(--r-line); }
.rr-adapt .ai-chat-footer input { background: var(--r-surface-2); color: var(--r-ink); border-color: var(--r-line); font-size: 16px; min-height: 44px; }
.rr-adapt .ai-chat-footer button { width: 44px; height: 44px; flex-basis: 44px; }
.rr-adapt .notes-popup, .rr-adapt .tta-whiteboard { background: var(--r-surface); color: var(--r-ink); border-color: var(--r-line); }
.rr-adapt .tta-toast { z-index: 10070; visibility: hidden; }
.rr-adapt .tta-toast.show { visibility: visible; }
#rp-overlay #rp-box select, #rp-overlay #rp-box textarea { font-size: 16px; }
@media (max-width: 1100px) {
  .rr-adapt .review-card.active { flex-direction: column; }
  .rr-adapt .pane-left { border-right: 0; border-bottom: 1px solid var(--r-line); max-height: 44vh; }
}
@media (max-width: 900px) {
  .rr-adapt .battle-map { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .rr-adapt { padding: 12px 10px 90px; }
  .ad-console-head { padding: 12px; }
  .rr-adapt .battle-map, .rr-adapt .tab-pane { padding: 12px; }
  .rr-adapt .pane-left, .rr-adapt .pane-right, .rr-adapt .pane-full { padding: 14px; }
  .rr-adapt .review-nav-row { grid-template-columns: 1fr 1fr; }
  .rr-adapt .q-counter-text { display: none; }
  .rr-adapt .ai-sidebar { width: 100vw; right: -100vw; }
  .rr-adapt .ai-sidebar.open { right: 0; }
}
/* The page's own #review-console-top rules (id specificity) paint white panes — re-theme them at the same weight. */
.rr-adapt #review-console-top .tab-pane { padding: 16px 18px 18px; background: var(--r-bg); }
.rr-adapt #review-console-top .review-card { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: var(--r-r-lg); }
.rr-adapt #review-console-top .pane-left { background: var(--r-surface); border-color: var(--r-line); }
.rr-adapt #review-console-top .ai-section.ai-section-standalone { background: var(--r-surface-2); border-color: var(--r-line); }
.rr-adapt #review-console-top .review-nav-row { background: var(--r-surface); border: 0; border-top: 1px solid var(--r-line); border-radius: 0; margin: 16px -18px -18px; padding: 12px 18px; box-shadow: 0 -8px 20px rgba(0,0,0,.08); }
@media (max-width: 640px) {
  .rr-adapt #review-console-top .tab-pane { padding: 12px; }
  .rr-adapt #review-console-top .review-nav-row { margin: 14px -12px -12px; padding: 10px 12px; grid-template-columns: 1fr 1fr; }
  .rr-adapt #review-console-top .q-counter-text { display: none; }
}
.rr-adapt .ai-fab { bottom: 96px; } /* clear of the sticky Previous/Next bar */
body:has(.rr-adapt) .scroll-to-top { display: none !important; } /* the sticky review bar already sits in that corner */
.rr-adapt .meta-chip.skill { background: var(--r-gold-soft); color: var(--r-gold); } .rr-adapt .meta-chip i { opacity: .85; } @media (max-width: 640px) { .rr-adapt .q-meta-header { justify-content: flex-start; flex-wrap: wrap; } }
/* Adaptive analytics (restored) */
.ad-analytics { margin-bottom: 18px; scroll-margin-top: 20px; }
.ad-analytics-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; }
.ad-analytics-grid > .rr-card { margin: 0; }
.ad-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-diffbars { display: grid; gap: 8px; }
.ad-diffbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 54px 44px; gap: 10px; align-items: center; }
.ad-diffbar .rr-pill { justify-content: center; }
.ad-diffbar-num, .ad-diffbar-pct { font-size: 12.5px; color: var(--r-ink-2); text-align: right; }
.ad-legend { display: flex; gap: 14px; font-size: 12px; color: var(--r-ink-3); font-weight: 600; margin-bottom: 8px; }
.ad-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ad-key { width: 12px; height: 6px; border-radius: 3px; display: inline-block; }
.ad-key.m1, .ad-domain .rr-meter i.m1 { background: var(--r-navy-2); }
html[data-theme="dark"] .ad-key.m1, html[data-theme="dark"] .ad-domain .rr-meter i.m1 { background: #8FA3BC; }
.ad-key.m2, .ad-domain .rr-meter i.m2 { background: var(--r-gold-fill); }
.ad-domains { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ad-domain { padding: 10px 0; border-bottom: 1px solid var(--r-line); }
.ad-domain:last-child { border-bottom: 0; }
.ad-domain-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; margin-bottom: 6px; }
.ad-domain-practice { min-height: 36px; padding: 0 12px; }
.ad-domain-name { font-weight: 700; font-size: 14px; color: var(--r-ink); min-width: 0; overflow-wrap: anywhere; }
.ad-domain-score { font-size: 15px; font-weight: 700; color: var(--r-ink-2); }
.ad-domain-score.ok { color: var(--r-ok); } .ad-domain-score.warn { color: var(--r-warn); } .ad-domain-score.bad { color: var(--r-bad); }
.ad-domain-bar { display: grid; grid-template-columns: 26px minmax(0, 1fr) 44px; gap: 8px; align-items: center; margin-top: 4px; }
.ad-domain-lbl { font-size: 11px; font-weight: 800; color: var(--r-ink-3); }
.ad-domain-pct { font-size: 12px; color: var(--r-ink-2); text-align: right; }
.ad-domain-act { margin-top: 8px; }
.ad-domain .rr-inline-msg { margin-top: 8px; }
#adDomainsMore { margin-top: 10px; }
@media (max-width: 1100px) { .ad-analytics-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .ad-diffbar { grid-template-columns: 96px minmax(0, 1fr) 48px; } .ad-diffbar-pct { display: none; } }

/* ---- 2026-11-11 contrast fixes (measured in the page with the WCAG formula; normal text needs 4.5:1) --------
   count inside the active filter, dark theme: navy at 70% on gold was 4.17 -> solid navy 7.5
   adaptive question badge: white on green #10B981 was 2.5 -> dark green text 6.2
                            dark theme, white on red #E5484D was 3.9 -> red #B3261E 6.5
                            dark theme, white on grey-blue #8FA3BC -> surface-3 with the page's light text
   "Correct answer" badge: white on green #10B981 was 2.5 -> dark green text 6.2
   "Your answer" badge on a right choice, light theme: 4.43 -> darker green 6.3
   "Your answer" badge on a wrong choice, dark theme: white on #E5484D was 3.9 -> red #B3261E 6.5 */
html[data-theme="dark"] .rr-filter.is-on .rr-mono { color: var(--r-on-gold); }
.rr-adapt .q-badge.correct { color: #06281B; }
html[data-theme="dark"] .rr-adapt .q-badge.incorrect { background: #B3261E; }
html[data-theme="dark"] .rr-adapt .q-badge.skipped { background: var(--r-surface-3); color: var(--r-ink); }
.rr .answer-state-badge.correct { color: #06281B; }
html:not([data-theme="dark"]) .rr .answer-state-badge.user-correct { color: #035E46; }
html[data-theme="dark"] .rr .answer-state-badge.user-wrong { background: #B3261E; }
/* a table caption inside a passage took the browser/Bootstrap grey (#6C757D on the passage box = 4.17) */
.rr caption { color: var(--r-ink-2); }

/* 2026-11-11: the "Your bands now" panel and the Site Builder slots sit inside the three-column summary grid.
   As grid cells they were squeezed into one column (table text ran out of the white panel) and pushed the
   cards out of place. They now take a full row of their own, after the cards.
   The bands panel keeps its own colours (white #fff, text #0f172a, 17.9:1) in both themes. */
.rr-summary > .student-bands-now, .rr-summary > .bx-conv { grid-column: 1 / -1; order: 5; margin: 0; min-width: 0; max-width: 100%; overflow-x: auto; }

/* 2026-11-11: Site Builder blocks on the results pages. The block's headline took the site's dark heading
   colour and sat on the dark page (unreadable). The block is now a card of this page, and its text takes the
   card's text colour. Light: #0F172A on #FFFFFF 17.9:1, gold #7A6619 on #FFFFFF 5.7:1.
   Dark: #F8FAFC on #0A2342 15.1:1, gold #D4AF37 on #0A2342 7.5:1. A block with its own colours keeps them. */
.rr .bx-conv { background: var(--r-surface); color: var(--r-ink); border: 1px solid var(--r-line); border-radius: 14px; padding: 16px 18px; }
.rr .bx-conv .bx-h, .rr .bx-conv .bx-h3, .rr .bx-conv .bx-p, .rr .bx-conv .bx-note, .rr .bx-conv .bx-list li { color: inherit; }
.rr .bx-conv .bx-eyebrow, .rr .bx-conv .bx-h span { color: var(--r-gold); }

/* ============================================================================
   2026-11-14 design overhaul (viz-results, batch 2): colour means one thing; headline first.
   ============================================================================ */
/* Difficulty is not a grade: Easy / Intermediate / Hard pills are neutral, with a 1/2/3-bar glyph beside the word
   (red "Hard 18/22" read as a failure next to red "Needs work" topics). Light #0F172A on #FFFFFF 17.9:1,
   dark #F8FAFC on #0A2342 15.1:1; glyph bars currentColor vs --r-line-strong. */
.rr .rr-diff-easy, .rr .rr-diff-intermediate, .rr .rr-diff-hard { background: var(--r-surface); color: var(--r-ink); box-shadow: inset 0 0 0 1px var(--r-line-strong); }
.rr .rr-diff-easy::before, .rr .rr-diff-intermediate::before, .rr .rr-diff-hard::before {
  content: ''; flex: 0 0 13px; width: 13px; height: 11px;
  background:
    linear-gradient(var(--rr-d1, currentColor), var(--rr-d1, currentColor)) 0 100% / 3px 45% no-repeat,
    linear-gradient(var(--rr-d2, currentColor), var(--rr-d2, currentColor)) 5px 100% / 3px 72% no-repeat,
    linear-gradient(var(--rr-d3, currentColor), var(--rr-d3, currentColor)) 10px 100% / 3px 100% no-repeat;
}
.rr .rr-diff-easy { --rr-d2: var(--r-line-strong); --rr-d3: var(--r-line-strong); }
.rr .rr-diff-intermediate { --rr-d3: var(--r-line-strong); }
/* The score ring says what it counts ("of all N") — the 55% ring sat beside "Accuracy 83% of 109 answered". */
.rr-ring-sub { font-size: 10.5px; font-weight: 700; color: var(--r-ink-3); margin-top: 1px; }
/* Skipped questions get their own hatched share of the bar and a word, instead of an empty track reading as 0%. */
.rr-meter i.skip { background: repeating-linear-gradient(135deg, var(--r-line-strong) 0 3px, transparent 3px 6px); }
.rr-secbar-note { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--r-ink-3); }
/* Headline first: the spaced-review card (results-extras partial, inserted after the title bar) follows the result
   summary instead of sitting above the score. Only when that card exists; nothing is hidden. */
.rr:has(> .rx-card) { display: flex; flex-direction: column; }
.rr:has(> .rx-card) > .rr-bar { order: -2; }
.rr:has(> .rx-card) > .rr-summary { order: -1; }
.rr:has(> .rx-card) > .rx-card { margin-bottom: 18px; }
/* One score scale (owner 2026-11-14): Strong >= 75, Building 50-74, Needs work < 50, word + status colour. */
.ad-domain-word { font-size: 11.5px; font-weight: 800; margin-left: 4px; }
/* Bigger hit areas on the filter chips and the "or drill it" links (44px). */
.rr .rr-filter { min-width: 44px; justify-content: center; }
.rr .rr-drill-link { min-height: 44px; }
@media (pointer: coarse) { .rr .ad-domain-practice { min-height: 44px; min-width: 44px; } }
/* 2026-11-14: adaptive empty-state line was #7A8794 (3.67:1 light, 4.29:1 dark) -> ink-3 light #556274/#FFFFFF 6.2,
   ink-2 dark #B8C6D8/#0A2342 9.1. The "How this score was calculated" toggle and the Mr. O close button reach 44px. */
.rr-adapt .empty-state { color: var(--r-ink-3); }
html[data-theme="dark"] .rr-adapt .empty-state { color: var(--r-ink-2); }
.rr-details summary { min-height: 44px; }
.rr-adapt .ai-close-btn { min-width: 44px; min-height: 44px; }
.rr .rr-map-summary { min-height: 44px; } /* 2026-11-14: question-map toggle was 32px tall */
/* 2026-11-14: at 1440px+ the "Do this next" column is narrow; the step text was squeezed to ~95px beside its buttons
   (the "Real Digital SAT questions" badge wrapped into a circle). Buttons now sit under the step text, as on phones. */
@media (min-width: 1440px) {
  .rr-summary .rr-next .rr-step { grid-template-columns: 36px minmax(0, 1fr); }
  .rr-summary .rr-next .rr-step > .rr-btn, .rr-summary .rr-next .rr-step > .rr-step-actions { grid-column: 2; justify-self: start; justify-content: flex-start; }
}
.rr .rr-step-body .tp-real-badge { border-radius: 10px; }

/* 2026-11-14 (owner report, live): on the adaptive review cards in the dark theme the passage text was black on
   navy. Bank HTML often hard-codes black text (style="color:#000"); outside figures it now follows the theme,
   the same rule the mock-test review has had since 2026-10-06 (line "Bank HTML often hard-codes black text"). */
html[data-theme="dark"] .rr-adapt :is(.passage-body, .q-stem-text, .user-answer-value, .correct-answer-value, .review-choice > span[style*="flex"]) :not(table, table *, svg, svg *, mark, mark *, i.fas, i.far, .choice-icon *) { color: inherit !important; }
html[data-theme="dark"] .rr-adapt :is(.passage-body, .q-stem-text, .user-answer-value, .correct-answer-value) :not(table, table *, svg, svg *, mark, mark *, img)[style*="background"] { background-color: transparent !important; }
html[data-theme="dark"] .rr-adapt :is(.passage-body, .q-stem-text) :is(img, svg) { background: #fff; color: #0F172A; border-radius: 8px; padding: 6px; }
html[data-theme="dark"] .rr-adapt :is(.passage-body, .q-stem-text) table * { color: #0F172A; border-color: #CBD5E1; }
html[data-theme="dark"] .rr-adapt :is(.passage-body, .q-stem-text) table { background: #fff; }
