/* =====================================================================
 * rw-practice.css — SAT R&W 2-column practice (Bluebook-style).
 *
 * Fine-tuned 2026-05-19 against actual Bluebook screenshot:
 *   - Header BG white (not gray)
 *   - Right-side tools: Highlights & Notes + More (stacked icon/label)
 *   - Banner = dark navy
 *   - Passage panel = white (same as question panel)
 *   - Vertical splitter = dashed line with a small white pill containing ⟷
 *   - Question bar: black "n" badge + Mark for Review + ABC annotation button,
 *     dashed bottom border
 *   - Choices: thin-border boxes with circle letter on the left
 *   - Footer Next/Submit = BLUE pill (Bluebook R&W uses blue, not Math-yellow)
 *
 * Overrides dsat-style.css in places where Bluebook R&W diverges from
 * Bluebook Math (e.g. header BG, footer button color).
 * ===================================================================== */

:root {
  --rw-header-h: 86px;
  --rw-banner-h: 32px;
  --rw-footer-h: 48px;                 /* dsat-style.css default */
  --rw-chrome-h: 166px;                /* 86 + 32 + 48 */
  --rw-blue: #2169d6;
  --rw-blue-hover: #1858bd;
  --rw-dash: #c0c4cc;
}

/* ── Header — sized to match real Bluebook R&W (~100px tall, larger title).
 *   Inherits BG from dsat-style.css (#f1f3f6 light blue-gray). ─── */
.dsat-header {
  min-height: 86px;
  padding: 8px 28px;
}
.dsat-section-title { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }
.dsat-directions { font-size: 14px; padding: 2px 0; margin-top: 2px; }
.dsat-header-center { gap: 4px; }
.dsat-timer { font-size: 22px; font-weight: 700; }
.dsat-hide-btn { font-size: 12px; padding: 2px 14px; }
.dsat-header-right { gap: 24px; }
.dsat-tool-btn { font-size: 12px; gap: 3px; }
.dsat-tool-btn .dsat-icon { font-size: 16px; height: 20px; }

/* Combined Highlights+Notes icon — two SVGs side by side */
.rw-hl-notes-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* ── Banner — override sticky top to sit below our taller (100px) header.
 *   dsat-style.css ships top: 76px which would float the banner UP into
 *   the bottom of the header and let content show ABOVE the banner. ── */
.dsat-banner {
  position: sticky;
  top: 86px !important;          /* below our 86px header */
  z-index: 99;
  background: #21304a;
  font-size: 11px;
  letter-spacing: 1.2px;
  padding: 7px 0;
}

/* Screens */
.rw-screen { display: none; }
.rw-screen.active { display: block; }

/* CRITICAL: [hidden] must beat `display: flex` / `display: block`
 * on every popup, modal, panel — otherwise close buttons appear to do
 * nothing because the element keeps its layout display value. */
[hidden] { display: none !important; }

/* When NOT in session (intro/done/empty), hide the test chrome —
 * header / banner / footer / floating popups belong to the test UI only. */
body.rw-no-chrome .dsat-header,
body.rw-no-chrome .dsat-banner,
body.rw-no-chrome .dsat-footer,
body.rw-no-chrome .rw-directions-modal,
body.rw-no-chrome .rw-modal-backdrop,
body.rw-no-chrome .rw-more-menu,
body.rw-no-chrome .rw-qnav-popup,
body.rw-no-chrome .rw-sel-toolbar,
body.rw-no-chrome .rw-hl-panel,
body.rw-no-chrome .rw-hl-panel-backdrop,
body.rw-no-chrome .rw-note-popup {
  display: none !important;
}

/* ── Session: 2-column split ─────────────────────────────────── */
.rw-body-grid {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--rw-chrome-h));
  overflow: hidden;
  background: white;
  /* Horizontal dashed guide lines top + bottom (Bluebook frame) */
  border-top: 1.5px dashed var(--rw-dash);
  border-bottom: 1.5px dashed var(--rw-dash);
}

.rw-passage-panel {
  flex: 0 0 var(--rw-passage-width, 50%);
  min-width: 320px;
  max-width: 70vw;
  background: white;
  overflow-y: auto;
  overflow-x: hidden;
  /* Solid vertical column divider (Bluebook style) */
  border-right: 1.5px solid #b8bcc4;
}
.rw-passage-inner {
  padding: 16px 36px 24px 44px;
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Cambria, Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  color: #1a1a1a;
  max-width: 640px;
}
.rw-passage-body p { margin: 0 0 14px; }
.rw-passage-body p:last-child { margin-bottom: 0; }
.rw-passage-body em { font-style: italic; }
.rw-passage-body .rw-passage {
  background: transparent !important;
  padding: 0 !important;
  border-left: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
/* "Text 1" / "Text 2" / chapter intro labels */
.rw-passage-label {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Cambria, Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 6px;
}

/* ── Splitter: floating handle pill on the dashed boundary ─────
 * Passage panel's border-right provides the dashed line.
 * Splitter has 0 flex-width; handle is absolutely positioned, centered. */
.rw-splitter {
  flex: 0 0 0px;
  position: relative;
}
.rw-splitter-handle {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 32px;
  background: white;
  border: 1px solid #c0c4cc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  z-index: 5;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}
.rw-splitter-handle:hover,
.rw-splitter.dragging .rw-splitter-handle {
  border-color: var(--rw-blue);
  color: var(--rw-blue);
}

.rw-question-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 360px;
  background: white;
}
.rw-question-inner {
  padding: 16px 44px 24px 36px;
  max-width: 720px;
}

.rw-q-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 8px;
  border-bottom: 1.5px dashed var(--rw-dash);
  margin-bottom: 14px;
}
.rw-q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 9px;
  background: #1a1a1a;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  border-radius: 3px;
}
.rw-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  flex: 1;
}
.rw-mark::before {
  content: "";
  display: inline-block;
  width: 14px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='16' viewBox='0 0 14 16' fill='none'%3E%3Cpath d='M2 1.5h10v13L7 11l-5 3.5v-13z' stroke='%231a1a1a' stroke-width='1.4' fill='none' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}
.rw-mark input { display: none; }
.rw-mark.marked::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='16' viewBox='0 0 14 16' fill='none'%3E%3Cpath d='M2 1.5h10v13L7 11l-5 3.5v-13z' fill='%23dc2626' stroke='%23dc2626' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.rw-abc-btn {
  width: 36px;
  height: 28px;
  background: var(--rw-blue);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  position: relative;
}
.rw-abc-btn::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px;
  top: 50%;
  height: 1.5px;
  background: white;
  transform: rotate(-12deg);
}

.rw-question-body {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Cambria, Georgia, serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  margin-bottom: 14px;
}
.rw-question-body p { margin: 0 0 10px; }
.rw-question-body p:last-child { margin-bottom: 0; }

.rw-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.rw-choices .rw-choice {
  display: flex;
  align-items: center;   /* vertical-center text + letter circle (matches Math .choice) */
  gap: 12px;
  padding: 9px 14px;
  border: 1.5px solid #c0c4cc;
  border-radius: 10px;
  cursor: pointer;
  background: white;
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Cambria, Georgia, serif;
  font-size: 15px;
  line-height: 1.45;
  color: #1a1a1a;
  transition: border-color 0.12s, background 0.12s;
}
.rw-choices .rw-choice:hover { border-color: #6b7280; }
.rw-choices .rw-choice.selected { border-color: #1a1a1a; border-width: 2px; padding: 7.5px 12.5px; }
.rw-choices .rw-choice.correct-reveal { background: #dcfce7; border-color: #15803d; }
.rw-choices .rw-choice.wrong { background: #fee2e2; border-color: #dc2626; }

.rw-choices .rw-choice .key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1.5px solid #1a1a1a;
  border-radius: 50%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: white;
  color: #1a1a1a;
}
.rw-choices .rw-choice.selected .key {
  background: #1a1a1a;
  color: white;
}
.rw-choices .rw-choice.correct-reveal .key {
  border-color: #15803d;
  background: #15803d;
  color: white;
}
.rw-choices .rw-choice.wrong .key {
  border-color: #dc2626;
  background: #dc2626;
  color: white;
}
.rw-choices .rw-choice .text { flex: 1; }

.rw-feedback {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: none;
}
.rw-feedback:not(:empty) { display: block; background: #f1f3f6; color: #1a1a1a; }
.rw-feedback.correct { background: #dcfce7; color: #14532d; }
.rw-feedback.wrong { background: #fee2e2; color: #7f1d1d; }

/* ── Show solution toggle + panel ─────────────────────────────────
 * Appears below the verdict feedback. Collapsed by default so the
 * student must opt in to seeing the worked explanation. Rule-pill
 * highlights inside the panel mirror the cheat-sheet rule numbering. */
.rw-solution-container:not(:empty) { margin-top: 12px; }

.rw-solution-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: #2169d6;
  border: 1.5px solid #2169d6;
  border-radius: 999px;
  padding: 7px 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.rw-solution-toggle:hover { background: #eef4fd; }
.rw-solution-toggle.open {
  background: #2169d6;
  color: white;
}
.rw-solution-toggle-ico { font-size: 14px; line-height: 1; }

.rw-solution-panel {
  margin-top: 10px;
  padding: 16px 18px;
  border: 1px solid #d6dde6;
  border-left: 3px solid #2169d6;
  border-radius: 6px;
  background: #fafbfd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #1a1a1a;
}
.rw-solution-panel[hidden] { display: none; }

.rw-solution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e6ebf2;
}
.rw-solution-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b6470;
}
.rw-solution-cheat {
  font-size: 12px;
  font-weight: 600;
  color: #2169d6;
  text-decoration: none;
  border: 1px solid #2169d6;
  border-radius: 999px;
  padding: 4px 11px;
  background: white;
  transition: background 0.12s ease;
}
.rw-solution-cheat:hover { background: #eef4fd; }

.rw-solution-body p { margin: 0 0 8px; }
.rw-solution-body p:last-child { margin-bottom: 0; }
.rw-solution-body strong { font-weight: 700; color: #0f172a; }

/* Rule N / Rules N-M inline mention */
.rw-rule-pill {
  display: inline-block;
  padding: 1px 8px;
  background: #e0ecff;
  color: #1e40af;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
/* [Rn] bracket-tag form (used by Inferences chapter) */
.rw-rule-tag {
  display: inline-block;
  padding: 1px 6px;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  white-space: nowrap;
}

/* ── Footer: Back = white pill w/ blue text, Next = solid blue pill.
 *   Inherits .dsat-footer height/BG from dsat-style.css. */
.dsat-q-pill {
  background: #1a1a1a;
  color: white;
  padding: 8px 22px;
  font-size: 14px;
}
.dsat-nav-btn.dsat-back {
  background: white;
  border: 1.5px solid var(--rw-blue);
  color: var(--rw-blue);
  padding: 9px 30px;
  font-size: 14px;
  font-weight: 600;
}
.dsat-nav-btn.dsat-back:hover { background: #f0f5fd; border-color: var(--rw-blue-hover); color: var(--rw-blue-hover); }
.dsat-nav-btn.dsat-next {
  background: var(--rw-blue);
  border: 1.5px solid var(--rw-blue);
  color: white;
  padding: 9px 32px;
  font-size: 14px;
  font-weight: 600;
}
.dsat-nav-btn.dsat-next:hover { background: var(--rw-blue-hover); border-color: var(--rw-blue-hover); }
.dsat-nav-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Intro / Done / Empty screens ─────────────────────────────── */
#screen-intro,
#screen-done,
#screen-empty {
  min-height: calc(100vh - var(--rw-chrome-h));
  background: white;
  padding: 56px 24px 80px;
}
.rw-intro-wrap {
  max-width: 720px;
  margin: 0 auto;
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Cambria, Georgia, serif;
  color: #1a1a1a;
}
.rw-intro-h1 {
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 8px;
}
.rw-intro-sub {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  color: #5b6470;
  margin: 0 0 28px;
}
.rw-intro-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.rw-intro-tier {
  background: white;
  border: 1px solid #e3e6eb;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}
.rw-intro-tier-num {
  font-size: 30px;
  font-weight: 700;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.rw-intro-tier-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  color: #5b6470;
  margin-top: 4px;
}
/* Lesson CTA (shown on chapter intro when a method lesson exists) */
.rw-lesson-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 16px 18px;
  background: linear-gradient(135deg, #eef4fd 0%, #fef3c7 100%);
  border: 1.5px solid #2169d6;
  border-radius: 12px;
  text-decoration: none;
  color: #1a1a1a;
  transition: transform 0.12s, box-shadow 0.12s;
}
.rw-lesson-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33, 105, 214, 0.18);
}
.rw-lesson-cta-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.rw-lesson-cta-body { flex: 1; }
.rw-lesson-cta-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.rw-lesson-cta-sub {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  color: #5b6470;
}
.rw-lesson-cta-arrow {
  font-size: 22px;
  color: #2169d6;
  flex-shrink: 0;
}

.rw-lesson-cta-group {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rw-lesson-cta-group .rw-lesson-cta { margin: 0; }
.rw-cheatsheet-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
  background: white;
  color: #2169d6;
  border: 1.5px solid #2169d6;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.rw-cheatsheet-cta:hover { background: #eef4fd; }

.rw-intro-hint {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #5b6470;
  margin: 18px 0 24px;
  line-height: 1.55;
}

.rw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rw-blue);
  border: 1px solid var(--rw-blue);
  border-radius: 999px;
  padding: 11px 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  text-decoration: none;
}
.rw-btn:hover { background: var(--rw-blue-hover); border-color: var(--rw-blue-hover); }
.rw-btn-secondary {
  background: white;
  border-color: #c0c4cc;
  color: #1a1a1a;
}
.rw-btn-secondary:hover { background: #f5f5f5; border-color: #6b7280; color: #1a1a1a; }
.rw-btn-block {
  display: flex;
  width: 100%;
  margin-top: 10px;
}

.rw-done-icon {
  font-size: 56px;
  text-align: center;
  margin-bottom: 12px;
}
.rw-done-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

/* ── Hide/Show timer — clock icon shown when hidden ──────────── */
.dsat-timer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
}

/* ── Directions slide-down modal (anchored to Directions button) ── */
.rw-modal-backdrop {
  position: fixed;
  inset: var(--rw-header-h) 0 0 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 980;
}
.rw-directions-modal {
  position: fixed;
  top: var(--rw-header-h);
  left: 0;
  width: 60vw;
  max-width: 900px;
  max-height: calc(100vh - var(--rw-header-h) - 40px);
  background: white;
  border: 1px solid #d0d4dc;
  border-top: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  z-index: 985;
  display: flex;
  flex-direction: column;
}
.rw-directions-arrow {
  position: absolute;
  top: -10px;
  left: 80px;
  width: 18px;
  height: 18px;
  background: white;
  border-left: 1px solid #d0d4dc;
  border-top: 1px solid #d0d4dc;
  transform: rotate(45deg);
}
.rw-directions-body {
  padding: 32px 40px 16px;
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Cambria, Georgia, serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
  overflow-y: auto;
  flex: 1;
}
.rw-directions-body p { margin: 0 0 14px; }
.rw-directions-body p:last-child { margin-bottom: 0; }
.rw-directions-close {
  align-self: flex-end;
  margin: 8px 40px 28px;
  background: #ffe43b;
  border: 1px solid #ffe43b;
  border-radius: 999px;
  padding: 11px 36px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  cursor: pointer;
}
.rw-directions-close:hover { background: #ffd900; border-color: #ffd900; }

/* ── More dropdown menu ───────────────────────────────────────── */
.rw-more-menu {
  position: fixed;
  top: calc(var(--rw-header-h) + 4px);
  right: 24px;
  min-width: 220px;
  background: white;
  border: 1px solid #d0d4dc;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 990;
  padding: 6px 0;
}
.rw-more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  text-align: left;
  cursor: pointer;
}
.rw-more-item:hover { background: #f1f3f6; }
.rw-more-ico {
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b6470;
  font-size: 14px;
}

/* ── Question navigator popup ─────────────────────────────────── */
.rw-qnav-popup {
  position: absolute;
  bottom: calc(var(--rw-footer-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  background: white;
  border: 1px solid #d0d4dc;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 60;
  padding: 18px 20px 16px;
}
.rw-qnav-arrow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: white;
  border-right: 1px solid #d0d4dc;
  border-bottom: 1px solid #d0d4dc;
}
.rw-qnav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e3e6eb;
  margin-bottom: 12px;
}
.rw-qnav-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}
.rw-qnav-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #5b6470;
  cursor: pointer;
  padding: 0 4px;
}
.rw-qnav-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-bottom: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  color: #5b6470;
}
.rw-qnav-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.rw-qnav-leg-current { font-size: 14px; }
.rw-qnav-leg-unanswered {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px dashed #1a73e8;
  background: white;
}
.rw-qnav-leg-review { font-size: 14px; }
.rw-qnav-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.rw-qnav-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  background: white;
  border: 1.5px dashed #1a73e8;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a73e8;
  cursor: pointer;
}
.rw-qnav-cell:hover { background: #eef4fd; }
.rw-qnav-cell.answered {
  background: #1a73e8;
  border-color: #1a73e8;
  border-style: solid;
  color: white;
}
.rw-qnav-cell.review {
  background: #fed7aa;
  border-color: #ea580c;
  border-style: solid;
  color: #1a1a1a;
}
.rw-qnav-cell.review::after {
  content: "🔖";
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 11px;
}
.rw-qnav-cell.current::before {
  content: "📍";
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
}
.rw-qnav-actions {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.rw-qnav-review-btn {
  background: white;
  border: 1.5px solid var(--rw-blue);
  border-radius: 999px;
  padding: 8px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--rw-blue);
  cursor: pointer;
}
.rw-qnav-review-btn:hover { background: #eef4fd; }

/* ── ABC eliminate mode — adds letter circles on choice right side ─ */
.rw-choice-eliminate {
  display: none;
  margin-left: 14px;
  width: 28px;
  height: 28px;
  border: 1.5px solid #1a1a1a;
  border-radius: 50%;
  background: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  align-self: center;
}
body.rw-eliminate-on .rw-choice-eliminate { display: inline-flex; }
body.rw-eliminate-on .rw-choice {
  position: relative;
}
.rw-choice-eliminate::after {
  content: "";
  position: absolute;
  left: 2px; right: 2px;
  top: 50%;
  height: 1.5px;
  background: #1a1a1a;
  display: none;
}
.rw-choice.eliminated .rw-choice-eliminate::after { display: block; }
.rw-choice.eliminated { opacity: 0.45; text-decoration: line-through; }
.rw-choice.eliminated:hover { opacity: 0.65; }

.rw-abc-btn.active {
  background: white;
  color: var(--rw-blue);
  border: 1.5px solid var(--rw-blue);
}
.rw-abc-btn.active::after { background: var(--rw-blue); }

/* ── Highlight span — applied to selected text ────────────────── */
.rw-highlight {
  background: #ffe66b;
  border-radius: 2px;
  padding: 0 1px;
  cursor: pointer;
}
.rw-highlight.with-note {
  background: #ffd34a;
  border-bottom: 2px solid #ea580c;
}

/* ── Floating selection toolbar (appears near selected text) ───── */
.rw-sel-toolbar {
  position: absolute;
  background: #1a1a1a;
  color: white;
  border-radius: 8px;
  padding: 4px;
  display: flex;
  gap: 2px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.rw-sel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.rw-sel-btn:hover { background: rgba(255, 255, 255, 0.15); }
.rw-sel-btn svg { display: block; }

/* ── Note popup (floats near highlight) ────────────────────────── */
.rw-note-popup {
  position: absolute;
  width: 280px;
  background: white;
  border: 1px solid #d0d4dc;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  z-index: 1001;
  padding: 12px;
}
.rw-note-text {
  width: 100%;
  border: 1px solid #d0d4dc;
  border-radius: 6px;
  padding: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
  box-sizing: border-box;
}
.rw-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.rw-note-cancel, .rw-note-save {
  border-radius: 999px;
  padding: 6px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rw-note-cancel {
  background: white;
  border: 1.5px solid #c0c4cc;
  color: #1a1a1a;
}
.rw-note-save {
  background: var(--rw-blue);
  border: 1.5px solid var(--rw-blue);
  color: white;
}

/* ── Highlights & Notes side panel (slides from right) ────────── */
.rw-hl-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 970;
}
.rw-hl-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: white;
  border-left: 1px solid #d0d4dc;
  box-shadow: -4px 0 14px rgba(0, 0, 0, 0.12);
  z-index: 980;
  display: flex;
  flex-direction: column;
}
.rw-hl-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e3e6eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}
.rw-hl-panel-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #5b6470;
  cursor: pointer;
  padding: 0 4px;
}
.rw-hl-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 20px;
}
.rw-hl-empty {
  color: #5b6470;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  margin-top: 40px;
}
.rw-hl-item {
  padding: 12px 14px;
  border: 1px solid #e3e6eb;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fffdf5;
}
.rw-hl-item-q {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #5b6470;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.rw-hl-item-text {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Cambria, Georgia, serif;
  font-size: 14px;
  line-height: 1.45;
  color: #1a1a1a;
  background: #ffe66b;
  padding: 2px 4px;
  border-radius: 2px;
  display: inline;
}
.rw-hl-item-note {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  margin-top: 8px;
  padding: 6px 8px;
  background: white;
  border-left: 3px solid #ea580c;
  border-radius: 0 4px 4px 0;
}
.rw-hl-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}
.rw-hl-item-btn {
  background: none;
  border: 1px solid #c0c4cc;
  border-radius: 4px;
  padding: 4px 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  color: #1a1a1a;
  cursor: pointer;
}
.rw-hl-item-btn:hover { background: #f1f3f6; }
.rw-hl-item-btn.danger { color: #dc2626; border-color: #fecaca; }
.rw-hl-item-btn.danger:hover { background: #fef2f2; }

/* ── Mobile stack ─────────────────────────────────────────────── */
@media (max-width: 880px) {
  .rw-body-grid {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .rw-passage-panel,
  .rw-question-panel {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
    overflow: visible;
  }
  .rw-passage-panel {
    border-right: 0;
    border-bottom: 1.5px dashed var(--rw-dash);
  }
  .rw-splitter { display: none; }
  .rw-passage-inner,
  .rw-question-inner { padding: 22px 18px; }
}
