/* ==========================================================================
   ORI TOEIC SHARED WEB ENGINE — CORE DESIGN SYSTEM (CSS) V2
   Approved Direction: macOS-Inspired • Premium • Modern • Airy • Calm
   Strict Palette: Deep Navy / Blue + Green + White + Soft Blue-Gray Neutrals
   Warm Orange for Primary CTA / Current Question Highlight
   Zero Full-Screen Dark Navy Background
   ========================================================================== */

:root {
  /* Surfaces & Canvas */
  --bg: var(--surface-soft, #f8fafc);
  --bg-card: var(--surface, #ffffff);
  --bg-card-hover: #fdfefe;
  --bg-elevated: #ffffff;
  --border: #e2e8f0;
  --border-focus: var(--blue-primary, #0284c7);
  --border-strong: #cbd5e1;

  /* Typography Colors */
  --text: var(--navy-900, #0b1329);
  --text-primary: var(--navy-900, #0b1329);
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  /* Accent & State Colors */
  --gold: #f59e0b;
  --gold-hover: #d97706;
  --gold-glow: rgba(245, 158, 11, 0.2);
  --orange-primary: #ea580c;
  --orange-soft: #fff7ed;
  --orange-border: #ffedd5;

  --success: var(--green-primary, #059669);
  --success-hover: var(--green-hover, #047857);
  --success-soft: var(--green-soft, #ecfdf5);
  --success-border: var(--green-border, #a7f3d0);

  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --accent: var(--blue-primary, #0284c7);
  --accent-soft: var(--blue-soft, #f0f9ff);
  --accent-border: var(--blue-border, #bae6fd);

  --font: var(--font-sans, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* Shadows & Elevation */
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 6px 20px -2px rgba(15, 23, 42, 0.08);

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: linear-gradient(180deg, #f0f7ff 0%, var(--bg) 320px);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ACCESSIBLE FOCUS */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* UTILITIES */
.hidden { display: none !important; }
.mobile-only { display: none !important; }

/* ==========================================================================
   TOPBAR — Branded Emerald Green Theme & Clean Precision Controls
   ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--green-primary, #059669);
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 100vw;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.08);
}

.brand { display: flex; flex-direction: column; }
.brand-link { text-decoration: none; display: flex; flex-direction: column; color: inherit; }
.brand b { color: #064e3b; font-size: 15px; font-weight: 800; letter-spacing: 0.5px; }
.brand span { font-size: 10px; color: var(--green-primary, #059669); font-weight: 700; letter-spacing: 0.8px; }

.testname {
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green-border, #a7f3d0);
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.05);
}

.spacer { flex: 1; }

.mode-select-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--green-border, #a7f3d0);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.04);
}

.nav-mode-btn {
  background: transparent;
  border: none;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-mode-btn:hover:not(.active) {
  color: #064e3b;
  background: var(--green-soft, #ecfdf5);
}

.nav-mode-btn.active {
  background: var(--green-primary, #059669);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
  font-weight: 700;
}

.mode-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--green-border, #a7f3d0);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.04);
}

.mode-toggle button {
  background: transparent;
  border: none;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-toggle button:hover:not(.active) {
  color: #064e3b;
  background: var(--green-soft, #ecfdf5);
}

.mode-toggle button.active {
  background: var(--green-primary, #059669);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
  font-weight: 700;
}

/* Auto-advance toggle ("Tự chuyển câu") — visible only in Listening */
.auto-advance-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #065f46;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green-border, #a7f3d0);
  background: #ffffff;
  user-select: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.04);
}

.auto-advance-toggle:hover {
  background: var(--green-soft, #ecfdf5);
  border-color: var(--green-primary, #059669);
}

.auto-advance-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--green-primary, #059669);
  cursor: pointer;
}

.auto-advance-label {
  line-height: 1;
}

.timer {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green-border, #a7f3d0);
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.05);
  white-space: nowrap;
}

.timer.warning-amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
  animation: pulse-slow 2s infinite;
}

.timer.warning-red {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
  animation: pulse-fast 1s infinite;
}

@keyframes pulse-slow { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes pulse-fast { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ==========================================================================
   UNIFIED BUTTON DESIGN SYSTEM
   Standardized heights, radii, colors, hover, active, focus, and disabled states
   ========================================================================== */
.btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--btn-radius, 8px);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast, 0.15s ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--btn-height, 40px);
  box-sizing: border-box;
  text-decoration: none;
  user-select: none;
  line-height: 1.2;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring);
}

.btn:disabled,
.btn.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

/* Primary Action: Emerald Green */
.btn-primary,
#nextBtn.btn-primary {
  background: var(--btn-primary-bg, #059669);
  color: var(--btn-primary-text, #ffffff);
  border-color: transparent;
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover:not(:disabled),
#nextBtn.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover, #047857);
  box-shadow: var(--btn-primary-shadow-hover);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled),
#nextBtn.btn-primary:active:not(:disabled) {
  background: var(--btn-primary-active, #065f46);
  transform: translateY(1px);
}

/* Secondary Action: Navigation Blue */
.btn-secondary,
#nextBtn.btn-secondary {
  background: var(--btn-secondary-bg, #0284c7);
  color: var(--btn-secondary-text, #ffffff);
  border-color: transparent;
  box-shadow: var(--btn-secondary-shadow);
}

.btn-secondary:hover:not(:disabled),
#nextBtn.btn-secondary:hover:not(:disabled) {
  background: var(--btn-secondary-hover, #0369a1);
  box-shadow: var(--btn-secondary-shadow-hover);
  transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled),
#nextBtn.btn-secondary:active:not(:disabled) {
  background: var(--btn-secondary-active, #075985);
  transform: translateY(1px);
}

.btn-secondary:focus-visible,
#nextBtn.btn-secondary:focus-visible {
  box-shadow: var(--btn-focus-ring-blue);
}

/* Warning / Submit Action: Warm Orange (Strictly Nộp bài & Irreversible Submit) */
.btn-warning,
.btn-submit,
#submitBtn,
#nextBtn.btn-warning {
  background: var(--btn-warning-bg, #ea580c);
  color: var(--btn-warning-text, #ffffff);
  border-color: transparent;
  box-shadow: var(--btn-warning-shadow);
}

.btn-warning:hover:not(:disabled),
.btn-submit:hover:not(:disabled),
#submitBtn:hover:not(:disabled),
#nextBtn.btn-warning:hover:not(:disabled) {
  background: var(--btn-warning-hover, #c2410c);
  box-shadow: var(--btn-warning-shadow-hover);
  transform: translateY(-1px);
}

.btn-warning:active:not(:disabled),
.btn-submit:active:not(:disabled),
#submitBtn:active:not(:disabled),
#nextBtn.btn-warning:active:not(:disabled) {
  background: var(--btn-warning-active, #9a3412);
  transform: translateY(1px);
}

.btn-warning:focus-visible,
#submitBtn:focus-visible {
  box-shadow: var(--btn-focus-ring-warning);
}

/* Neutral Action: Crisp White with Slate Gray Outline */
.btn-neutral,
.btn-outline,
#prevBtn,
#nextBtn.btn-outline {
  background: var(--btn-neutral-bg, #ffffff);
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  color: var(--btn-neutral-text, #334155);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn-neutral:hover:not(:disabled),
.btn-outline:hover:not(:disabled),
#prevBtn:hover:not(:disabled),
#nextBtn.btn-outline:hover:not(:disabled) {
  background: var(--btn-neutral-hover-bg, #f8fafc);
  border-color: var(--btn-neutral-hover-border, #cbd5e1);
  color: var(--navy-900, #0b1329);
  transform: translateY(-1px);
}

.btn-neutral:active:not(:disabled),
.btn-outline:active:not(:disabled),
#prevBtn:active:not(:disabled),
#nextBtn.btn-outline:active:not(:disabled) {
  background: var(--btn-neutral-active-bg, #f1f5f9);
  transform: translateY(1px);
}

/* Danger Action: Red */
.btn-danger {
  background: var(--btn-danger-bg, #dc2626);
  color: var(--btn-danger-text, #ffffff);
  border-color: transparent;
}

.btn-danger:hover:not(:disabled) {
  background: var(--btn-danger-hover, #b91c1c);
  transform: translateY(-1px);
}

/* Backward-compatible .btn-gold fallback */
.btn-gold {
  background: var(--btn-warning-bg, #ea580c);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--btn-warning-shadow);
}

.btn-gold:hover:not(:disabled) {
  background: var(--btn-warning-hover, #c2410c);
  transform: translateY(-1px);
}

/* Size Utilities */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  min-height: var(--btn-height-sm, 34px);
  border-radius: var(--btn-radius-sm, 6px);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 14px;
  min-height: var(--btn-height-lg, 46px);
  border-radius: var(--btn-radius-lg, 10px);
}

.mobile-palette-btn {
  background: var(--btn-neutral-bg, #ffffff);
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  color: var(--navy-900, #0b1329);
  min-height: var(--btn-height-sm, 34px);
  border-radius: var(--btn-radius-sm, 6px);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.layout {
  display: flex;
  flex: 1;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 32px 24px;
  gap: 24px;
  box-sizing: border-box;
}

/* ==========================================================================
   SIDEBAR / PALETTE
   ========================================================================== */
.sidebar {
  width: 320px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  border: 1px solid var(--blue-border, #bae6fd);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - 128px);
  position: sticky;
  top: 72px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.06);
}

.sec-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-subtle, #f1f5f9);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.sec-tabs button {
  flex: 1;
  padding: 7px 6px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary, #475569);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 34px;
}

.sec-tabs button:hover:not(.active) {
  color: var(--navy-900, #0b1329);
}

.sec-tabs button.active {
  background: #ffffff;
  color: var(--blue-primary, #0284c7);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font-weight: 700;
}

.part-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.part-nav-chip {
  flex: 1;
  min-width: 34px;
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--btn-radius-sm, 6px);
  background: var(--btn-neutral-bg, #ffffff);
  color: var(--text-secondary, #475569);
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  min-height: 32px;
  box-sizing: border-box;
}

.part-nav-chip:hover {
  border-color: var(--btn-secondary-bg, #0284c7);
  color: var(--btn-secondary-bg, #0284c7);
  background: var(--btn-secondary-soft-bg, #f0f9ff);
}

.part-nav-chip.active {
  background: var(--btn-secondary-soft-bg, #f0f9ff);
  border-color: var(--btn-secondary-bg, #0284c7);
  color: var(--btn-secondary-bg, #0284c7);
  font-weight: 800;
}

.part-nav-chip:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring-blue);
}

.palette-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-primary, #0284c7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}

.palette-btn {
  height: 38px;
  border-radius: var(--btn-radius, 8px);
  background: var(--btn-neutral-bg, #ffffff);
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  color: var(--navy-800, #0f172a);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast, 0.12s ease);
  box-sizing: border-box;
}

.palette-btn:hover {
  border-color: var(--btn-secondary-bg, #0284c7);
  background: var(--surface-soft, #f8fafc);
}

.palette-btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring-blue);
}

/* Current Active Question: Navigation Blue Outline/Accent */
.palette-btn.active {
  border: 2px solid var(--btn-secondary-bg, #0284c7);
  color: var(--btn-secondary-bg, #0284c7);
  background: var(--btn-secondary-soft-bg, #f0f9ff);
  box-shadow: 0 0 0 1px var(--btn-secondary-bg, #0284c7);
  font-weight: 800;
}

/* Answered State: Blue-green / Teal Tint */
.palette-btn.answered {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #99f6e4;
  font-weight: 700;
}

/* Correct State: Emerald Green */
.palette-btn.correct {
  background: var(--success-soft, #ecfdf5);
  color: #047857;
  border-color: var(--success-border, #a7f3d0);
  font-weight: 700;
}

/* Incorrect State: Clean Soft Red */
.palette-btn.wrong {
  background: var(--danger-soft, #fef2f2);
  color: #b91c1c;
  border-color: var(--danger-border, #fecaca);
  font-weight: 700;
}

/* Flagged State: Yellow Indicator */
.palette-btn.flagged {
  background: #fefce8;
  color: #a16207;
  border-color: #fde047;
  font-weight: 700;
}

/* Active Composite States (Blue border priority for current position) */
.palette-btn.active.answered {
  outline: 2px solid var(--btn-secondary-bg, #0284c7);
  outline-offset: 1px;
}
.palette-btn.active.correct {
  outline: 2px solid var(--btn-secondary-bg, #0284c7);
  outline-offset: 1px;
  background: var(--success-soft, #ecfdf5);
  color: #047857;
  border-color: var(--success-border, #a7f3d0);
}
.palette-btn.active.wrong {
  outline: 2px solid var(--btn-secondary-bg, #0284c7);
  outline-offset: 1px;
  background: var(--danger-soft, #fef2f2);
  color: #b91c1c;
  border-color: var(--danger-border, #fecaca);
}
.palette-btn.active.flagged {
  outline: 2px solid var(--btn-secondary-bg, #0284c7);
  outline-offset: 1px;
  background: #fefce8;
  color: #a16207;
  border-color: #fde047;
}

.legend {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

/* ==========================================================================
   MAIN CONTENT & QUESTION CARD
   ========================================================================== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.qcard {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.qmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qbadge {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue-primary, #0284c7), #0369a1);
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}

.qstem {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy-900, #0b1329);
  line-height: 1.65;
}

/* Question Images (Part 1 Photos & Diagrams) */
.qcard img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  display: block;
  margin: 0 auto;
}

/* ==========================================================================
   CHOICES — MODERN SELECTABLE ANSWER CARDS
   ========================================================================== */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: #ffffff;
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  border-radius: var(--btn-radius-lg, 10px);
  cursor: pointer;
  color: var(--navy-900, #0b1329);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: all var(--transition-fast, 0.15s ease);
  min-height: 48px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.choice-btn:hover:not(.locked) {
  background: var(--surface-soft, #f8fafc);
  border-color: var(--blue-border, #bae6fd);
  transform: translateY(-1px);
}

.choice-btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring-blue);
}

/* Option Selected State BEFORE Checking — Calm Soft Blue Fill & Border (Selected != Correct) */
.choice-btn.selected {
  background: var(--btn-secondary-soft-bg, #f0f9ff);
  border-color: var(--btn-secondary-bg, #0284c7);
  border-width: 2px;
  color: var(--navy-900, #0b1329);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
}

.choice-btn.selected .choice-letter {
  color: var(--btn-secondary-bg, #0284c7);
  font-weight: 800;
}

/* Option Correct State AFTER Checking — Emerald Green */
.choice-btn.correct {
  background: var(--green-soft, #ecfdf5);
  border-color: var(--btn-primary-bg, #059669);
  border-width: 2px;
  color: #065f46;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.12);
}

.choice-btn.correct .choice-letter {
  color: var(--btn-primary-bg, #059669);
  font-weight: 800;
}

/* Option Wrong Selected State AFTER Checking — Clean Soft Red */
.choice-btn.wrong {
  background: var(--danger-soft, #fef2f2);
  border-color: var(--btn-danger-bg, #dc2626);
  border-width: 2px;
  color: #991b1b;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.12);
}

.choice-btn.wrong .choice-letter {
  color: var(--btn-danger-bg, #dc2626);
  font-weight: 800;
}

/* Locked state after answer checking */
.choice-btn.locked {
  cursor: default;
}
.choice-btn.locked:hover {
  transform: none;
  border-color: inherit;
}

/* Study Action Bar & Check Answer Button */
.study-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.btn-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-height-lg, 46px);
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--btn-radius-lg, 10px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  border: 1.5px solid transparent;
  outline: none;
}

.btn-check.btn-active {
  background: var(--btn-primary-bg, #059669);
  color: var(--btn-primary-text, #ffffff);
  box-shadow: var(--btn-primary-shadow);
}

.btn-check.btn-active:hover {
  background: var(--btn-primary-hover, #047857);
  box-shadow: var(--btn-primary-shadow-hover);
  transform: translateY(-1px);
}

.btn-check.btn-active:active {
  background: var(--btn-primary-active, #065f46);
  transform: translateY(1px);
}

.btn-check.btn-disabled,
.btn-check:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.btn-check:focus-visible {
  box-shadow: var(--btn-focus-ring);
}

.btn-check-icon {
  font-size: 14px;
  font-weight: 900;
}

/* Study Feedback Banner — Calm, Compact Inline Badge (No Giant Colored Blocks) */
.study-feedback-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  margin-top: 22px;
  max-width: fit-content;
  box-sizing: border-box;
  animation: feedbackSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes feedbackSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.study-feedback-card.feedback-correct {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.study-feedback-card.feedback-wrong {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.feedback-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.feedback-correct .feedback-status-badge {
  color: #15803d;
}

.feedback-wrong .feedback-status-badge {
  color: #dc2626;
}

.feedback-divider {
  width: 1px;
  height: 16px;
  background: currentColor;
  opacity: 0.25;
}

.feedback-correct-answer {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-800, #1e293b);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.correct-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 5px;
  font-weight: 800;
  font-size: 12.5px;
  border: 1px solid #86efac;
}

.choice-text {
  flex: 1;
  line-height: 1.45;
}

/* ==========================================================================
   AUDIO PLAYER — CLEAN macOS LIGHT SURFACE
   ========================================================================== */
.audioplayer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 100%);
  border: 1.5px solid var(--green-border, #a7f3d0);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(5, 150, 105, 0.06);
}

.playbtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--btn-primary-bg, #059669);
  border: none;
  color: var(--btn-primary-text, #ffffff);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast, 0.15s ease);
  box-shadow: var(--btn-primary-shadow);
}

.playbtn:hover {
  background: var(--btn-primary-hover, #047857);
  transform: scale(1.05);
  box-shadow: var(--btn-primary-shadow-hover);
}

.playbtn:active {
  background: var(--btn-primary-active, #065f46);
  transform: scale(0.98);
}

.playbtn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring);
}

.rewind-btn {
  background: var(--btn-neutral-bg, #ffffff);
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  color: var(--btn-neutral-text, #334155);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--btn-radius-sm, 6px);
  cursor: pointer;
  white-space: nowrap;
  min-height: var(--btn-height-sm, 34px);
  transition: all var(--transition-fast, 0.15s ease);
  box-shadow: var(--shadow-sm);
}

.rewind-btn:hover {
  background: var(--btn-neutral-hover-bg, #f8fafc);
  border-color: var(--btn-neutral-hover-border, #cbd5e1);
  color: var(--navy-900, #0b1329);
}

.rewind-btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring);
}

.audio-timeline {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  min-width: 80px;
}

.audio-progress {
  height: 100%;
  background: var(--btn-primary-bg, #059669);
  border-radius: 9999px;
  width: 0%;
}

.audio-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.audio-speed-chips {
  display: flex;
  gap: 4px;
}

.audio-speed-btn {
  background: var(--btn-neutral-bg, #ffffff);
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  color: var(--btn-neutral-text, #334155);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--btn-radius-sm, 6px);
  cursor: pointer;
  min-height: var(--btn-height-sm, 34px);
  transition: all var(--transition-fast, 0.15s ease);
  box-shadow: var(--shadow-sm);
}

.audio-speed-btn:hover {
  border-color: var(--btn-primary-bg, #059669);
  color: var(--btn-primary-bg, #059669);
  background: var(--green-soft, #ecfdf5);
}

.audio-speed-btn.active {
  background: var(--green-soft, #ecfdf5);
  color: var(--btn-primary-bg, #059669);
  border-color: var(--btn-primary-bg, #059669);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.15);
}

.audio-speed-btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring);
}

/* ==========================================================================
   READING PASSAGE SPLIT VIEW (PART 6 & 7)
   ========================================================================== */
.split-view {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
}

.passage-pane {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
  position: sticky;
  top: 75px;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
}

.passage-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue-border, #bae6fd);
}

.passage-pane-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, var(--blue-primary, #0284c7), #0369a1);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}

.passage-doc { margin-bottom: 20px; }

.passage-doc-card {
  background: var(--surface-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

.passage-doc-card-header {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-primary, #0284c7);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
  padding: 3px 10px;
  background: var(--blue-soft, #f0f9ff);
  border: 1px solid var(--blue-border, #bae6fd);
  border-radius: 6px;
}

.passage-doc-content {
  font-size: 15px;
  color: var(--navy-800, #0f172a);
  line-height: 1.7;
}

.passage-doc-content p { margin-bottom: 10px; }

/* ACTIVE BLANK IN PART 6 */
.active-part6-blank {
  background: #fef08a !important;
  color: #713f12 !important;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #eab308;
  display: inline-block;
  animation: pulse-slow 2s infinite;
}

/* ==========================================================================
   LEARNING PANEL (EXPLANATIONS, SCRIPTS, VOCAB)
   ========================================================================== */
/* Learning content must fill its card and may shrink within every flex/grid parent.
   This prevents the transcript/explanation from collapsing to min-content width. */
.layout,
.workspace,
.main,
.qcard,
.group-q,
.group-q-scroll,
.rs-questions,
.learning-panel,
.learning-panel > *,
.learning-tab-content,
.learning-sec,
.learning-sec > *,
.script-turns,
.script-turn,
.script-line,
.script-text,
.script-prompt,
.script-sentence,
.script-passage,
.exp-summary,
.exp-options,
.exp-opt-item,
.exp-evidence,
.exp-paraphrase,
.exp-formula,
.exp-trap,
.exp-tip,
.lp-tips,
.vocab-list,
.vocab-card {
  min-width: 0;
  max-width: 100%;
}

.main,
.qcard,
.group-q,
.learning-panel,
.learning-tab-content,
.learning-sec,
.script-turns,
.script-text,
.script-prompt,
.script-sentence,
.script-passage,
.exp-summary,
.exp-options,
.exp-evidence,
.exp-paraphrase,
.exp-formula,
.exp-trap,
.exp-tip,
.lp-tips,
.vocab-list {
  width: 100%;
}

.learning-panel,
.learning-tab-content,
.learning-sec {
  box-sizing: border-box;
}

.learning-panel :is(p, li, .script-turn, .script-line, .script-text, .script-prompt,
  .script-sentence, .script-passage, .exp-summary, .exp-opt-item, .exp-evidence,
  .exp-paraphrase, .exp-formula, .exp-trap, .exp-tip, .vocab-card) {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.learning-panel {
  background: linear-gradient(135deg, #f0f9ff 0%, #f0fdf4 100%);
  border: 1px solid var(--blue-border, #bae6fd);
  border-left: 4px solid var(--green-primary, #059669);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.06);
}

.learning-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  overflow-x: auto;
}

.learning-tab-btn {
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--btn-neutral-text, #475569);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--btn-radius-sm, 6px);
  cursor: pointer;
  white-space: nowrap;
  min-height: var(--btn-height-sm, 34px);
  transition: all var(--transition-fast, 0.15s ease);
}

.learning-tab-btn:hover {
  color: var(--navy-900, #0b1329);
  background: var(--surface-subtle, #f1f5f9);
}

.learning-tab-btn.active {
  background: #ffffff;
  color: var(--btn-secondary-bg, #0284c7);
  border-color: var(--btn-secondary-soft-border, #bae6fd);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.1);
}

.learning-tab-btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring-blue);
}

.learning-tab-content { display: none; }
.learning-tab-content.active { display: block; }

.learning-sec h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy-900, #0b1329);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.learning-sec p {
  font-size: 14px;
  color: var(--navy-700, #1e293b);
  line-height: 1.65;
}

.vocab-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.vocab-card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.vocab-word {
  font-weight: 700;
  color: var(--blue-primary, #0284c7);
}

.vocab-meaning {
  color: var(--text-secondary, #475569);
  margin-left: 4px;
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.overlay.hidden { display: none; }

.modal {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 40px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.modal-header h2 {
  font-size: 18px;
  color: var(--navy-900, #0b1329);
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  font-size: 18px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--navy-900, #0b1329);
  background: var(--surface-subtle, #f1f5f9);
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface-soft, #f8fafc);
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #ffffff;
}

/* SCORE REPORT MODAL (RAW SCORES ONLY) */
.score-modal {
  max-width: 680px;
}

.score-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.score-metric-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.score-metric-val {
  font-size: 34px;
  font-weight: 800;
  color: var(--green-primary, #059669);
}

.score-metric-lbl {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 4px;
}

.score-part-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.part-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.part-bar-lbl {
  width: 60px;
  font-weight: 700;
  color: var(--navy-800, #0f172a);
}

.part-bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.part-bar-fill {
  height: 100%;
  background: var(--green-primary, #059669);
  border-radius: 4px;
}

.part-bar-val {
  width: 55px;
  text-align: right;
  font-weight: 700;
  color: var(--green-primary, #059669);
}

/* ==========================================================================
   QUESTION NAVIGATION — COMPACT CONTROLS DOCKED UNDER THE ANSWER AREA
   core.js moves the single #qNav node into .q-nav-slot inside the question
   card (after choices / check / feedback, before the explanation). In-flow,
   right-aligned, never overlays image, answers or explanation.
   ========================================================================== */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-nav-slot:empty {
  display: none;
}

.q-nav-slot {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.q-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.q-nav .btn {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.q-nav #nextBtn.btn-outline {
  background: var(--btn-neutral-bg, #ffffff);
  border: 1.5px solid var(--btn-neutral-border, #dbe4ee);
  color: var(--navy-800, #1e293b);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.q-nav #nextBtn.btn-outline:hover {
  background: var(--btn-neutral-hover-bg, #f8fafc);
  border-color: var(--btn-neutral-hover-border, #cbd5e1);
  color: var(--navy-900, #0b1329);
}

/* EXAM GROUP VIEW (Part 3/4): one talk, all its questions stacked */
.group-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.group-q {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  scroll-margin-top: 110px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.group-q.active {
  border-color: var(--blue-primary, #0284c7);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.10);
}

.group-q-num {
  font-weight: 800;
  color: var(--blue-primary, #0284c7);
  margin-right: 4px;
}

.palette-btn.group-mate {
  border-color: var(--blue-border, #bae6fd);
  background: var(--blue-soft, #f0f9ff);
}

/* Part 3/4 exam group: fixed frame, only the questions scroll */
.group-q-scroll {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 380px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 6px 2px 2px;
  scroll-padding-top: 4px;
}

.group-q-scroll:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(2, 132, 199, 0.25));
  border-radius: var(--radius-sm);
}

/* EXAM PICTURE + ANSWERS SIDE BY SIDE (Part 1 photo, Part 3/4 graphic)
   The picture stays pinned in view while the learner scrolls the answers/questions. */
.exam-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.exam-split-media {
  position: sticky;
  top: 112px;
  display: flex;
  justify-content: center;
}

.exam-split-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
}

.exam-split-work {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.exam-split-work .audioplayer {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .exam-split-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .exam-split-media {
    position: static;
  }
  .exam-split-img {
    max-height: 42vh;
  }
}

/* FOOTER */
footer {
  text-align: center;
  padding: 18px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  border-top: 1px solid var(--border);
  background: var(--surface-soft, #f8fafc);
}

/* ==========================================================================
   RESPONSIVE DESIGN RULES — TABLET (<= 1024px) & MOBILE (<= 768px)
   ========================================================================== */

@media (max-width: 1024px) {
  .layout {
    flex-direction: column;
    padding: 16px 16px 24px 16px;
    gap: 16px;
  }
  .main {
    width: 100%;
    min-width: 0;
  }
  .workspace {
    width: 100%;
  }
  /* Mobile Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    height: 100vh;
    z-index: 300;
    transition: right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    border-radius: 0;
    border-left: 1px solid var(--border);
  }
  .sidebar.open {
    right: 0;
    box-shadow: -10px 0 35px rgba(15, 23, 42, 0.15);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    z-index: 250;
  }
  .mobile-only {
    display: flex !important;
  }
  .sidebar-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #64748b);
    font-size: 20px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .split-view {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand b { font-size: 13px; }
  .brand span { font-size: 9px; }
  .testname { font-size: 12px; margin-left: 2px; }
  .mode-select-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
  }
  .mode-toggle {
    margin-left: auto;
  }
  .mobile-palette-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 38px;
  }
  /* Mobile Segmented Reading Controller */
  .mobile-split-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: var(--surface-subtle, #f1f5f9);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
  }
  .mobile-split-hidden {
    display: none !important;
  }
  .mobile-split-tab-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-split-tab-btn.active {
    background: #ffffff;
    color: var(--blue-primary, #0284c7);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    font-weight: 700;
  }
  .split-view {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .passage-pane {
    position: static;
    max-height: 480px;
    padding: 16px;
    width: 100%;
  }
  .question-pane {
    width: 100%;
  }
  .qcard {
    padding: 18px 16px;
  }
  /* Mobile: two equal-width buttons, 44px touch targets, in-flow under the answers */
  .q-nav-slot {
    justify-content: stretch;
  }
  .q-nav {
    width: 100%;
  }
  .q-nav .btn {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
  }
  .score-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Touch targets >= 44px for touch pointers */
@media (pointer: coarse) {
  .btn, .choice-btn, .nav-mode-btn, .mode-toggle button {
    min-height: 44px;
  }
  .palette-btn {
    height: 44px;
  }
}

/* ==========================================================================
   BRAND SYSTEM V2 — "EDITORIAL EMERALD" · PASS 1
   Scope: header, sidebar/palette, question card, audio player, answer cards,
   timer/progress badges, navigation. Visual only — no layout logic changes.
   Everything below reads from tokens.css (V2 block). Loaded last on purpose.
   ========================================================================== */

body {
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 380px at 12% -120px, rgba(52, 211, 153, 0.16), transparent 70%),
    radial-gradient(900px 320px at 100% -140px, rgba(2, 132, 199, 0.10), transparent 70%),
    var(--canvas);
  color: var(--ink-900);
}

/* ---------- 1. HEADER ---------- */
.topbar {
  gap: var(--space-3);
  padding: 12px 28px;
  min-height: 72px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 3px solid var(--brand-600);
  box-shadow: 0 10px 30px -24px rgba(6, 78, 59, 0.45);
}

.brand-link {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
}

.brand-link::before {
  content: "O";
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  background: var(--brand-600);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--shadow-hard-ink);
}

.brand b {
  color: var(--brand-900);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand span {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  color: var(--brand-600);
  font-weight: 800;
}

.testname {
  margin-left: var(--space-2);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-800);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: none;
}

/* Segmented rails: navigation (blue) and mode (emerald) */
.mode-select-nav,
.mode-toggle {
  background: var(--card-tint);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  gap: 2px;
  box-shadow: none;
}

.nav-mode-btn,
.mode-toggle button {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-600);
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 36px;
  box-shadow: none;
}

.nav-mode-btn:hover:not(.active),
.mode-toggle button:hover:not(.active) {
  background: #fff;
  color: var(--ink-900);
}

.nav-mode-btn.active {
  background: var(--nav-600);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(2, 132, 199, 0.8);
}

.mode-toggle button.active {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(5, 150, 105, 0.9);
}

.auto-advance-toggle {
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 12px;
  font-weight: 700;
  color: var(--ink-600);
}

.auto-advance-toggle input[type="checkbox"] {
  accent-color: var(--brand-600);
}

/* Branded numerals: timer + question counter */
.timer {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-300);
  background: var(--ink-900);
  border: none;
  border-radius: var(--r-control);
  padding: 7px 14px;
  box-shadow: var(--shadow-hard-brand);
}

.timer.warning-amber {
  color: #fff7ed;
  background: #b45309;
  box-shadow: 3px 3px 0 var(--ink-900);
}

.timer.warning-red {
  color: #fff;
  background: var(--error);
  box-shadow: 3px 3px 0 var(--ink-900);
}

#submitBtn {
  background: var(--submit);
  color: #fff;
  border: none;
  border-radius: var(--r-control);
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 9px 18px;
  min-height: 40px;
  box-shadow: 0 8px 18px -10px rgba(234, 88, 12, 0.9);
}

#submitBtn:hover:not(:disabled) {
  background: var(--submit-hover);
}

.mobile-palette-btn {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-900);
  background: #fff;
  border: 2px solid var(--ink-900);
  border-radius: var(--r-control);
  padding: 6px 12px;
  box-shadow: var(--shadow-hard-brand);
}

/* ---------- 2. SIDEBAR / PALETTE ---------- */
.sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card-v2);
  padding: 18px;
}

.sec-tabs {
  background: var(--card-tint);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
}

.sec-tabs button {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 13px;
  color: var(--ink-500);
  border-radius: 10px;
}

.sec-tabs button.active {
  background: #fff;
  color: var(--brand-800);
  box-shadow: 0 1px 0 var(--line), 0 6px 14px -10px rgba(6, 78, 59, 0.6);
}

.part-nav {
  gap: 6px;
}

.part-nav-chip {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-600);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  min-height: 34px;
}

.part-nav-chip:hover {
  border-color: var(--nav-200);
  color: var(--nav-700);
  background: var(--nav-50);
}

.part-nav-chip.active {
  background: var(--nav-600);
  border-color: var(--nav-600);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(2, 132, 199, 0.8);
}

.palette-title {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  font-weight: 800;
  color: var(--ink-500);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.palette-title::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand-600);
}

.palette {
  gap: 7px;
}

.palette-btn {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-600);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  box-shadow: none;
}

.palette-btn:hover {
  border-color: var(--nav-200);
  background: var(--nav-50);
  color: var(--nav-700);
}

.palette-btn.answered {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}

.palette-btn.correct {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

.palette-btn.wrong {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.palette-btn.group-mate {
  background: var(--nav-50);
  border-color: var(--nav-200);
  color: var(--nav-700);
}

.palette-btn.group-mate.answered {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}

.palette-btn.active,
.palette-btn.active.answered,
.palette-btn.active.correct,
.palette-btn.active.wrong {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--nav-600);
}

.palette-btn.active:not(.answered):not(.correct):not(.wrong) {
  background: var(--nav-50);
  border-color: var(--nav-600);
  color: var(--nav-700);
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-item em {
  font-style: normal;
  color: var(--ink-400);
  font-weight: 500;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.sw-current { background: var(--nav-50); border-color: var(--nav-600); box-shadow: 0 0 0 1px var(--nav-600); }
.sw-answered { background: var(--ink-900); }
.sw-correct { background: var(--brand-600); }
.sw-wrong { background: var(--error); }

/* ---------- 3. QUESTION CARD ---------- */
.qcard,
.passage-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card-v2);
}

.qcard {
  padding: 28px 32px;
  gap: 20px;
}

.qbadge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink-900);
  border: none;
  border-radius: var(--r-pill);
  padding: 7px 16px;
  box-shadow: var(--shadow-hard-brand);
}

.group-hint {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 800;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--r-pill);
  padding: 5px 12px;
}

.qstem {
  font-size: var(--fs-question);
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink-900);
}

/* Study Part 1: photo on an intentional "stage" instead of floating in white */
.q-photo-stage {
  display: flex;
  justify-content: center;
  padding: 16px;
  border-radius: var(--r-panel);
  background:
    radial-gradient(circle at 1px 1px, rgba(6, 78, 59, 0.10) 1px, transparent 0) 0 0 / 14px 14px,
    var(--brand-50);
  border: 1px solid var(--brand-100);
}

.q-photo {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.55);
}

/* Exam split: framed photo / graphic */
.exam-split-media {
  padding: 12px;
  border-radius: var(--r-panel);
  background:
    radial-gradient(circle at 1px 1px, rgba(6, 78, 59, 0.10) 1px, transparent 0) 0 0 / 14px 14px,
    var(--brand-50);
  border: 1px solid var(--brand-100);
}

.exam-split-img {
  border: none;
  border-radius: 12px;
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.55);
}

/* Part 3/4 group questions */
.group-q {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: #fff;
  padding: 16px 18px;
}

.group-q.active {
  border-color: var(--nav-600);
  box-shadow: 0 0 0 3px var(--nav-100);
}

.group-q-num {
  font-family: var(--font-display);
  color: var(--brand-700);
}

/* Part 6/7: passage as a document */
.passage-pane {
  padding: 26px 30px;
}

.passage-pane-title {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  background: var(--ink-900);
  color: #fff;
  box-shadow: var(--shadow-hard-brand);
}

.passage-pane-head {
  border-bottom: 1px solid var(--line);
}

.passage-doc-card {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.passage-doc-card-header {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 800;
  color: var(--brand-800);
  background: var(--brand-50);
  border-bottom: 1px solid var(--brand-100);
}

.passage-doc-content {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-800);
}

/* ---------- 4. AUDIO PLAYER ---------- */
.audioplayer {
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-600);
  border-radius: var(--r-panel);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.playbtn {
  width: 46px;
  height: 46px;
  background: var(--brand-600);
  box-shadow: 0 0 0 4px var(--brand-100), 0 8px 16px -8px rgba(5, 150, 105, 0.9);
}

.playbtn:hover {
  background: var(--brand-700);
  transform: none;
  box-shadow: 0 0 0 5px var(--brand-100), 0 8px 16px -8px rgba(5, 150, 105, 0.9);
}

.playbtn:focus-visible {
  box-shadow: 0 0 0 4px var(--brand-100), var(--focus-ring-brand);
}

.rewind-btn,
.audio-speed-btn {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--ink-600);
  background: var(--card-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  box-shadow: none;
}

.rewind-btn:hover,
.audio-speed-btn:hover {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-900);
}

.audio-speed-btn.active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
  box-shadow: none;
}

.audio-timeline {
  height: 6px;
  background: var(--line);
}

.audio-progress {
  position: relative;
  background: linear-gradient(90deg, var(--brand-600), var(--nav-600));
}

.audio-progress::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand-600);
  transform: translateY(-50%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.audio-time {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-600);
}

/* ---------- 5. ANSWER CARDS ---------- */
.choices {
  gap: 10px;
}

.choice-btn {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--ink-800);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  gap: 12px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.choice-letter {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-600);
  background: var(--card-tint);
  border: 1px solid var(--line);
}

.choice-btn:hover:not(.locked) {
  border-color: var(--nav-200);
  background: var(--nav-50);
  box-shadow: 0 6px 16px -12px rgba(2, 132, 199, 0.7);
}

.choice-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.choice-btn.selected {
  border-color: var(--nav-600);
  background: var(--nav-50);
  box-shadow: 0 0 0 1px var(--nav-600);
}

.choice-btn.selected .choice-letter {
  background: var(--nav-600);
  border-color: var(--nav-600);
  color: #fff;
}

.choice-btn.correct {
  border-color: var(--brand-600);
  background: var(--brand-50);
  box-shadow: 0 0 0 1px var(--brand-600);
}

.choice-btn.correct .choice-letter {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

.choice-btn.wrong {
  border-color: var(--error);
  background: var(--error-soft);
  box-shadow: 0 0 0 1px var(--error);
}

.choice-btn.wrong .choice-letter {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

/* ---------- 7. NAVIGATION / ACTIONS ---------- */
.q-nav .btn,
.btn-check {
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: 0.01em;
  border-radius: var(--r-control);
  min-height: 44px;
  padding: 10px 18px;
}

.q-nav #prevBtn {
  background: #fff;
  color: var(--ink-600);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.q-nav #prevBtn:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--ink-900);
}

.q-nav #nextBtn.btn-secondary {
  background: var(--nav-600);
  color: #fff;
  border: none;
  box-shadow: 0 8px 18px -10px rgba(2, 132, 199, 0.9);
}

.q-nav #nextBtn.btn-primary {
  background: var(--brand-600);
  color: #fff;
  border: none;
  box-shadow: 0 8px 18px -10px rgba(5, 150, 105, 0.9);
}

.q-nav #nextBtn.btn-outline {
  background: #fff;
  color: var(--ink-900);
  border: 1.5px solid var(--line-strong);
}

.q-nav #nextBtn.btn-warning {
  background: var(--submit);
  color: #fff;
  border: none;
}

.btn-check.btn-active {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(5, 150, 105, 0.9);
}

.btn-check:disabled,
.btn-check.btn-disabled {
  background: var(--card-tint);
  color: var(--ink-400);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
}

/* ---------- RESPONSIVE (pass 1) ---------- */
@media (max-width: 1024px) {
  .topbar {
    padding: 10px 16px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .brand-link::before {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }
  .brand b { font-size: 15px; }
  .testname { font-size: 11px; padding: 6px 10px; }
  .nav-mode-btn,
  .mode-toggle button {
    padding: 8px 10px;
    min-height: 40px;
  }
  .timer { font-size: 15px; padding: 7px 10px; }
  .qcard { padding: 18px 16px; border-radius: 18px; }
  .qbadge { font-size: 12px; padding: 6px 12px; }
  .choice-btn { min-height: 48px; }
  .audioplayer { padding: 10px 12px; }
  .legend { grid-template-columns: 1fr; }
}

/* ---------- PASS 1 refinements ---------- */
.legend-note {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-400);
}

/* Scroll hint for the Part 3/4 question list: soft shadows appear only where more content exists */
.group-q-scroll {
  background:
    linear-gradient(#fff 30%, rgba(255, 255, 255, 0)) top / 100% 28px no-repeat local,
    linear-gradient(rgba(255, 255, 255, 0), #fff 70%) bottom / 100% 28px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(15, 23, 42, 0.16), transparent) top / 100% 10px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(15, 23, 42, 0.16), transparent) bottom / 100% 10px no-repeat scroll;
  border-radius: var(--r-panel);
}

/* "Tự chuyển câu" is a Study-mode feature; it has no effect in THI THỬ */
body[data-mode="exam"] .auto-advance-toggle {
  display: none !important;
}

/* The top bar is one nowrap flex row whose controls need about 1052px. Above 1280px there is
   room; at 768px and below the block underneath wraps and reorders it. Between those two there
   was no rule at all, so the row simply overflowed to the right: document.scrollWidth stuck at
   1052px, which pushed #paletteToggleBtn and (further down) the choice buttons, submit control
   and mistake-history modal off-screen — 227px of horizontal overflow at 834x1112, the common
   iPad portrait size. Letting it wrap across the whole band closes the gap without touching the
   desktop row or the mobile ordering. */
@media (max-width: 1279px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
}

@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .brand { order: 0; }
  .testname { order: 1; max-width: 42vw; }
  .mobile-palette-btn { order: 2; margin-left: auto; }
  .mode-toggle { order: 3; margin-left: 0; }
  .auto-advance-toggle { order: 4; }
  .timer { order: 5; margin-left: auto; }
  #submitBtn { order: 6; }
  .mode-select-nav { order: 7; width: 100%; margin-top: 0; }
  .mode-select-nav .nav-mode-btn { flex: 1; }
  .spacer { display: none; }
}

@media (max-width: 400px) {
  .brand span { display: none; }
  .nav-mode-btn, .mode-toggle button { font-size: 11px; padding: 8px 8px; }
  .timer { font-size: 14px; }
  #submitBtn { padding: 8px 12px; }
}

/* ==========================================================================
   IMMERSIVE WORKSPACE — PROTOTYPE (opt-in: test.html?layout=immersive)
   Content-first: no permanent palette; question map is an on-demand drawer.
   ========================================================================== */

/* Map trigger icon (3×3 grid) — used in both layouts */
.map-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  background:
    radial-gradient(circle, currentColor 1.6px, transparent 1.8px) 0 0 / 5px 5px;
  opacity: 0.85;
}

body.layout-immersive .layout {
  display: block;
  max-width: 1380px;
  padding: 28px 32px 40px;
}

body.layout-immersive .workspace {
  width: 100%;
}

/* Header: fewer controls, clearer emphasis */
body.layout-immersive .topbar {
  gap: var(--space-4);
}

body.layout-immersive .mobile-palette-btn {
  display: inline-flex !important;
  align-items: center;
  cursor: pointer;
}

/* ---------- Question map drawer (all widths) ---------- */
body.layout-immersive .sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  z-index: 300;
  border-radius: 24px 0 0 24px;
  border: none;
  padding: 22px 22px 28px;
  overflow-y: auto;
  box-shadow: none;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body.layout-immersive .sidebar.open {
  right: 0;
  box-shadow: -24px 0 60px -20px rgba(15, 23, 42, 0.35);
}

body.layout-immersive .sidebar-mobile-header {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

body.layout-immersive .sidebar-mobile-header span {
  font-family: var(--font-display);
  font-size: 15px !important;
  letter-spacing: 0.08em;
  color: var(--ink-900);
}

body.layout-immersive .sidebar-close-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
}

body.layout-immersive .sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
  z-index: 250;
}

body.layout-immersive .palette {
  grid-template-columns: repeat(6, 1fr);
  max-height: none;
  overflow: visible;
}

.drawer-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 6px;
}

.drawer-tools .mode-select-nav {
  display: flex;
  width: 100%;
  margin: 0;
}

.drawer-tools .mode-select-nav .nav-mode-btn {
  flex: 1;
  font-size: 11px;
  padding: 8px 6px;
}

.drawer-tools .auto-advance-toggle {
  align-self: flex-start;
}

/* ---------- Shared immersive card base ---------- */
body.layout-immersive .qcard {
  padding: 28px;
}

.imm-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.imm-count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--ink-500);
  font-weight: 600;
}

.imm-count b {
  font-size: 26px;
  line-height: 1;
  color: var(--ink-900);
}

.imm-verdict {
  margin-left: auto;
  font-weight: 800;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
}

.imm-verdict.ok { color: var(--brand-700); background: var(--brand-50); }
.imm-verdict.bad { color: var(--error); background: var(--error-soft); }

.imm-instruction {
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 500;
  margin-top: -6px;
}

/* ---------- PART 1: photo hero + work column ---------- */
.imm-p1-grid {
  display: grid;
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  gap: 32px;
  align-items: start;
}

.imm-photo {
  margin: 0;
  position: sticky;
  top: 104px;
  border-radius: 20px;
  padding: 18px;
  background:
    radial-gradient(circle at 1px 1px, rgba(6, 78, 59, 0.12) 1px, transparent 0) 0 0 / 16px 16px,
    linear-gradient(160deg, var(--brand-50), var(--aqua-50));
  display: flex;
  justify-content: center;
}

.imm-photo-img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.6);
}

.imm-work {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.imm-work .audioplayer {
  flex-wrap: wrap;
}

.imm-work .choice-btn {
  min-height: 54px;
}

/* ---------- PART 3/4: Group Listening Workspace ---------- */
.imm-group {
  padding: 0 !important;
  overflow: hidden;
}

.imm-group-grid {
  display: grid;
  grid-template-columns: minmax(300px, 36fr) minmax(0, 64fr);
  align-items: stretch;
}

.imm-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background:
    radial-gradient(circle at 1px 1px, rgba(6, 78, 59, 0.10) 1px, transparent 0) 0 0 / 16px 16px,
    linear-gradient(180deg, var(--brand-50), #fff 70%);
  border-right: 1px solid var(--line);
}

.imm-rail .qbadge {
  align-self: flex-start;
}

.imm-rail-title h2 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin-top: 6px;
}

.imm-kicker {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 800;
  color: var(--brand-700);
}

.imm-rail .audioplayer {
  flex-wrap: wrap;
  border-left-width: 1px;
  border-color: var(--brand-100);
}

.imm-rail .audio-timeline {
  flex-basis: 100%;
  order: 5;
}

.imm-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.imm-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-500);
}

.imm-progress-head b {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0;
  color: var(--ink-900);
}

.imm-dots {
  display: flex;
  gap: 8px;
}

.imm-dot {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 0;
  border-radius: var(--r-chip);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-500);
}

.imm-dot.done {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}

.imm-rail-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-500);
  margin-top: auto;
}

.imm-graphic {
  margin: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}

.imm-graphic .exam-split-img {
  max-height: 42vh;
  width: 100%;
  box-shadow: none;
}

.imm-questions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 28px;
  min-width: 0;
}

.imm-group .group-q-scroll {
  gap: 16px;
  padding: 4px 8px 4px 4px;
}

.imm-group .group-q {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  gap: 12px;
  background: #fff;
}

.imm-group .group-q.active {
  border-color: var(--nav-200);
  box-shadow: 0 0 0 3px var(--nav-50), 0 10px 24px -18px rgba(2, 132, 199, 0.8);
}

.gq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.imm-group .group-q-num {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  margin: 0;
}

.gq-done {
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s var(--transition-fast);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-600);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.group-q.is-answered .gq-done {
  opacity: 1;
  transform: scale(1);
}

.imm-group .qstem {
  font-size: 16.5px;
}

.imm-group .choice-btn {
  padding: 10px 14px;
}

/* ---------- PART 6/7: document-first editorial ---------- */
body.layout-immersive .split-view {
  display: grid;
  grid-template-columns: minmax(0, 60fr) minmax(0, 40fr);
  gap: 28px;
  align-items: start;
}

body.layout-immersive .passage-pane {
  position: static;
  max-height: none;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.layout-immersive .passage-pane-head {
  border: none;
  padding: 0 0 14px;
  margin: 0;
}

body.layout-immersive .passage-doc,
body.layout-immersive .passage-doc-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

body.layout-immersive .passage-doc-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

body.layout-immersive .passage-doc-content .p-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-500);
  font-style: italic;
}

/* Each document looks like a real sheet of paper, labelled by its kind */
body.layout-immersive .cdoc {
  position: relative;
  background: #fff;
  border-radius: 6px 6px 18px 18px;
  padding: 44px 40px 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-800);
  box-shadow:
    0 1px 0 rgba(15, 23, 42, 0.04),
    0 26px 50px -34px rgba(15, 23, 42, 0.45);
  border-top: 5px solid var(--brand-600);
}

body.layout-immersive .cdoc::before {
  content: attr(data-kind);
  position: absolute;
  top: -14px;
  left: 32px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink-900);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-hard-brand);
}

body.layout-immersive .cdoc[data-kind="e-mail"],
body.layout-immersive .cdoc[data-kind="email"],
body.layout-immersive .cdoc[data-kind="text message"],
body.layout-immersive .cdoc[data-kind="text-message chain"],
body.layout-immersive .cdoc[data-kind="online chat discussion"] {
  border-top-color: var(--nav-600);
  font-family: var(--font-ui);
  font-size: 15.5px;
}

body.layout-immersive .cdoc p {
  margin-bottom: 12px;
}

body.layout-immersive .cdoc p:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--ink-900);
}

body.layout-immersive .question-pane {
  position: sticky;
  top: 104px;
}

body.layout-immersive .question-pane .qcard {
  border-radius: 22px;
}

/* ---------- Immersive responsive ---------- */
@media (max-width: 1100px) {
  .imm-group-grid { grid-template-columns: 1fr; }
  .imm-rail { border-right: none; border-bottom: 1px solid var(--line); }
  .imm-rail-title h2 { font-size: 30px; }
}

@media (max-width: 900px) {
  body.layout-immersive .layout { padding: 16px 14px 28px; }
  .imm-p1-grid { grid-template-columns: 1fr; gap: 18px; }
  .imm-photo { position: static; padding: 10px; }
  .imm-photo-img { max-height: 46vh; }
  body.layout-immersive .split-view { display: flex; flex-direction: column; gap: 16px; }
  body.layout-immersive .question-pane { position: static; }
  body.layout-immersive .cdoc { padding: 34px 20px 24px; font-size: 15.5px; }
  body.layout-immersive .qcard { padding: 18px 16px; }
  .imm-rail { padding: 18px 16px; gap: 14px; }
  .imm-questions { padding: 16px 14px; }
  .imm-rail-title h2 { font-size: 26px; }
}

/* Drawer: fixed head (title, tools, section tabs, parts); only the number grid scrolls */
body.layout-immersive .sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

body.layout-immersive .sidebar > * {
  flex-shrink: 0;
}

body.layout-immersive .sidebar .palette {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  padding: 4px 4px 8px 2px;
}

/* Immersive refinements */
body.layout-immersive .passage-doc-card-header {
  display: none;
}

body.layout-immersive .passage-doc-card + .passage-doc-card {
  margin-top: 30px;
}

.drawer-testname {
  display: block;
  margin-top: 2px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-700);
}

body.layout-immersive .sidebar-mobile-header > span {
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  /* Phones/tablets: the page scrolls; no cramped inner list */
  .imm-group .group-q-scroll {
    max-height: none !important;
    overflow: visible;
    background: none;
    padding: 0;
  }
  .imm-rail-note { display: none; }
}

@media (max-width: 768px) {
  body.layout-immersive .brand { order: 0; }
  body.layout-immersive .mobile-palette-btn { order: 1; margin-left: auto; }
  body.layout-immersive .mode-toggle { order: 2; }
  body.layout-immersive .timer { order: 3; margin-left: auto; }
  body.layout-immersive #submitBtn { order: 4; }
  body.layout-immersive .testname { order: 5; }
}

@media (max-width: 480px) {
  body.layout-immersive .testname { display: none; }
}

/* ==========================================================================
   IMMERSIVE READING SET (Part 6/7): documents left, ALL set questions right
   ========================================================================== */
.reading-set {
  display: grid;
  grid-template-columns: minmax(0, 60fr) minmax(0, 40fr);
  gap: 28px;
  align-items: start;
}

.reading-set.part-6 {
  grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
}

.rs-docs {
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-width: 0;
}

.rs-docs-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.rs-docs .passage-pane-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink-900);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-hard-brand);
}

.rs-docs .rs-doc {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.rs-docs .passage-doc-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.rs-docs .p-header {
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  color: var(--ink-500);
}

.rs-figure {
  margin: 0;
  padding: 10px;
  background: #fff;
  border-radius: var(--r-panel);
  border: 1px solid var(--line);
}

.rs-figure img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 8px;
}

/* Part 6 blanks inside the passage: focusable numbered markers */
.p6-blank {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 26px;
  padding: 0 8px;
  margin: 0 2px;
  vertical-align: 1px;
  border-radius: var(--r-pill);
  border: 1.5px dashed var(--nav-600);
  background: var(--nav-50);
  color: var(--nav-700);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.p6-blank.filled {
  border-style: solid;
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}

.p6-blank.active-part6-blank {
  box-shadow: 0 0 0 3px var(--nav-100);
  border-color: var(--nav-600);
}

.p6-blank.filled.active-part6-blank {
  background: var(--nav-600);
  border-color: var(--nav-600);
}

.rs-docs .evidence-highlight {
  background: rgba(52, 211, 153, 0.28);
  border-bottom: 2px solid var(--brand-600);
  border-radius: 3px;
  padding: 1px 3px;
  color: inherit;
}

/* Right column: sticky question stack; only the list scrolls */
.rs-questions {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px !important;
  min-width: 0;
}

.rs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rs-progress {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-500);
}

.rs-progress b {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0;
  color: var(--ink-900);
  margin-left: 4px;
}

.rs-questions .imm-dot { padding: 5px 0; font-size: 12px; }

.rs-questions .group-q-scroll {
  gap: 14px;
  padding: 4px 8px 6px 4px;
}

.rs-questions .group-q {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  gap: 12px;
  background: #fff;
}

.rs-questions .group-q.active {
  border-color: var(--nav-200);
  box-shadow: 0 0 0 3px var(--nav-50), 0 10px 24px -18px rgba(2, 132, 199, 0.8);
}

.rs-questions .group-q-num {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  margin: 0;
}

.rs-questions .qstem {
  font-size: 16px;
}

.rs-hint {
  font-size: 13px;
  color: var(--ink-500);
}

.rs-questions .choice-btn {
  padding: 10px 14px;
  min-height: 48px;
}

.rs-actions .btn-check {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}

.rs-result {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rs-result .imm-verdict { margin-left: 0; }

.rs-answer {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-600);
}

.rs-answer b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-family: var(--font-display);
}

.rs-explain-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--nav-700);
  font-weight: 700;
  font-size: 12px;
  border-radius: var(--r-pill);
  padding: 6px 12px;
  cursor: pointer;
}

.rs-questions .learning-panel {
  margin-top: 4px;
  border-radius: 14px;
}

@media (max-width: 900px) {
  .reading-set,
  .reading-set.part-6 {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .rs-questions {
    position: static;
    padding: 16px !important;
  }
  .rs-questions .group-q-scroll {
    max-height: none !important;
    overflow: visible;
    background: none;
    padding: 0;
  }
}

/* Part 6 blank chip: hide the dashes, show the number (content untouched) */
.rs-docs .p6-blank {
  font-size: 0;
  line-height: 1;
}

.rs-docs .p6-blank sub {
  font-size: 13px;
  vertical-align: baseline;
  line-height: 1;
}

.rs-docs .p6-blank sub::before {
  content: "\2009";
}

/* Document-title treatment only for Part 7 documents; Part 6 articles start with body text */
body.layout-immersive .reading-set.part-6 .cdoc p:first-child {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: inherit;
  letter-spacing: 0;
  color: var(--ink-800);
}

.rs-docs .p6-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  height: 24px;
  padding: 0 10px;
}

.rs-docs .p6-blank sub {
  position: static;
  vertical-align: 0;
}

.rs-docs .p6-blank.active-part6-blank:not(.filled) {
  background: var(--nav-100);
  color: var(--nav-700);
  border-style: solid;
}

.rs-docs .p6-blank:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Reading set: blue "current" chip instead of the default layout's yellow pulse */
.rs-docs .p6-blank.active-part6-blank {
  animation: none;
  display: inline-flex;
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 0 10px;
  background: var(--nav-100) !important;
  color: var(--nav-700) !important;
  border: 1.5px solid var(--nav-600);
}

.rs-docs .p6-blank.filled.active-part6-blank {
  background: var(--nav-600) !important;
  color: #fff !important;
}

/* Font swap must not shift the workspace: fixed header height on desktop */
@media (min-width: 769px) {
  .topbar {
    height: 72px;
    min-height: 72px;
  }
}

/* Immersive listening group in HỌC & GIẢI: per-card check + explanation */
.imm-group .learning-panel {
  margin-top: 4px;
  border-radius: 14px;
}

.imm-group .rs-actions .btn-check {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}

/* Student-release gate (data integrity; runtime/quarantine/part7_quarantine.json is metadata only) */
.quarantine-notice {
  margin: 12px auto 0;
  max-width: 1100px;
  padding: 10px 14px;
  border: 1px solid var(--error);
  border-radius: var(--r-card, 10px);
  background: var(--error-soft);
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.5;
}
.gate-blocked-msg { margin-top: 12px; font-weight: 600; color: var(--ink-900); }
.part-practice-card.part-locked { opacity: 0.55; cursor: not-allowed; }
.part-practice-card.part-locked .part-select-chk { cursor: not-allowed; }
.part-status-pill.badge-locked { background: var(--error-soft); color: var(--error); border-color: var(--error); }
.part-preset-chip.preset-locked { opacity: 0.45; cursor: not-allowed; }
body.gate-locked #sidebar,
body.gate-locked #qNav,
body.gate-locked #modeToggle,
body.gate-locked #paletteToggleBtn,
body.gate-locked #autoAdvanceToggle,
body.gate-locked .nav-mode-btn { display: none !important; }
.gate-blocked .btn { text-decoration: none; }

/* ==========================================================================
   MISTAKE HISTORY (engine/js/mistakes.js)
   Per-question misses plus skill verdicts. The "insufficient evidence" state is styled as
   neutral information, never as a warning: it is the honest default, not a problem.
   ========================================================================== */
.mistake-history { max-width: 720px; width: 100%; max-height: 86vh; overflow-y: auto; }
.mistake-history .mh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mistake-history .mh-table th,
.mistake-history .mh-table td { padding: 7px 9px; border-bottom: 1px solid var(--border); text-align: left; }
.mistake-history .mh-table th { font-weight: 600; color: var(--text-muted); font-size: 12px; }
.mistake-history .mh-chosen { color: var(--danger); font-weight: 600; }
.mistake-history .mh-correct { color: var(--green-primary, #059669); font-weight: 600; }
.mistake-history h4 { margin: 18px 0 8px; font-size: 14px; }
.mistake-history .mh-verdicts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mistake-history .mh-verdicts li { padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; }
.mistake-history .mh-verdicts li[data-status="LIKELY_WEAKNESS"] { border-color: var(--danger); background: rgba(239, 68, 68, 0.07); }
.mistake-history .mh-verdicts li[data-status="WATCH"] { border-color: var(--gold, #f59e0b); background: rgba(245, 158, 11, 0.08); }
.mistake-history .mh-verdicts li[data-status="STRENGTH"] { border-color: var(--green-border, #a7f3d0); background: rgba(5, 150, 105, 0.07); }
.mistake-history .mh-reason { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.mistake-history .mh-empty { color: var(--text-muted); font-size: 13px; font-style: italic; }
.mistake-history .mh-note { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
                            color: var(--text-muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 640px) {
  .mistake-history .mh-table { font-size: 12px; }
  .mistake-history .mh-table th, .mistake-history .mh-table td { padding: 6px 5px; }
}
