/* IELTS Academic Reading Full Test Simulator Stylesheet
 * Computer-Delivered Examination Ergonomics
 */
@import url('practice.css');

:root {
  --base-font-size: 16px;
  --simulator-font-size: var(--base-font-size, 16px);
  --header-height: 56px;
  --footer-height: 72px;
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none;
  background-color: #0f172a;
  color: #f1f5f9;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  user-select: text;
}

/* Master Exam Container - STRICT FULL-VIEWPORT FLEX COLUMN */
.exam-container {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  width: 100% !important;
  max-width: 100vw !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  background-color: #0f172a;
  position: relative;
}

/* Header */
.exam-header {
  flex: 0 0 var(--header-height);
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  box-sizing: border-box;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 0.5rem;
  z-index: 30;
  user-select: none;
  overflow: hidden;
}

.header-left {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#examMainTitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

@media (min-width: 1280px) {
  #examMainTitle {
    max-width: 280px;
  }
}

/* Passage Tabs */
.passage-tabs-container {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #0f172a;
  padding: 0.2rem;
  border-radius: 0.75rem;
  border: 1px solid #334155;
}

.passage-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.passage-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.passage-tab-btn.active {
  color: #38bdf8;
  background: #1e293b;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: #334155;
  color: #cbd5e1;
  font-weight: 700;
}

.passage-tab-btn.active .tab-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

/* Header Right Actions */
.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Timer Display */
.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  background: #0f172a;
  border: 1px solid #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #38bdf8;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.timer-pill.urgent-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

.timer-pill.urgent-critical {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  animation: timerPulse 1s infinite alternate;
}

@keyframes timerPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  100% { transform: scale(1.03); box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
}

/* Work Area Split Screen - STRICT MATHEMATICAL 50/50 WITH MINMAX(0, ...) */
.content-panes {
  flex: 1 1 0px !important;
  min-height: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  display: grid !important;
  grid-template-columns: minmax(0, calc(50% - 3px)) 6px minmax(0, calc(50% - 3px)) !important;
  height: 100% !important;
  overflow: hidden !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.pane {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: var(--simulator-font-size);
  scroll-behavior: smooth;
}

#left-pane {
  background-color: var(--rte-bg, #ffffff);
  color: var(--rte-text, #1e293b);
  border-right: 1px solid var(--rte-border, #e2e8f0);
  padding: 1.5rem 1.75rem 6rem;
}

#right-pane {
  background-color: var(--rte-surface, #f8fafc);
  color: var(--rte-text, #0f172a);
  /* Generous 5.5rem right padding guarantees questions are NEVER covered by the floating toolkit (#geToolkitContainer) */
  padding: 1.5rem 5.5rem 6rem 1.75rem !important;
}

/* Fluid Viewports and Centering without overflow */
.passage-viewport,
.questions-viewport {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

.passage-viewport.block,
.questions-viewport.block {
  animation: emhPaneFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reading-passage {
  font-size: var(--simulator-font-size, var(--base-font-size, 16px));
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.95;
  color: #334155;
  text-align: justify;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

.reading-passage p {
  font-size: 1em;
  line-height: 1.95;
}

.questions-container {
  width: 100% !important;
  max-width: 640px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

/* Override any hardcoded Tailwind max-w-2xl or max-w-3xl inside imported questions */
.questions-container .max-w-2xl,
.questions-container .max-w-3xl,
.questions-container .max-w-xl,
.questions-container .max-w-4xl {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Ensure all nested cards and elements stay within container width */
.questions-container *,
.reading-passage * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.questions-container table,
.reading-passage table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.q-item {
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
}

.q-item .flex,
.q-item .flex-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.q-item label {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.text-input,
.select-input,
select,
input[type="text"] {
  max-width: 100%;
  box-sizing: border-box;
}

.splitter {
  background-color: #334155;
  cursor: col-resize;
  z-index: 20;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splitter:hover, .splitter:active {
  background-color: #0284c7;
}

.splitter-handle {
  width: 2px;
  height: 32px;
  background-color: #94a3b8;
  border-radius: 9999px;
}

/* Authentic Reading Passage Styling */
.passage-viewport.block,
.questions-viewport.block {
  animation: emhPaneFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reading-passage {
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.95;
  color: #334155;
  text-align: justify;
  max-width: 820px;
  margin: 0 auto;
}

.reading-passage p {
  margin-bottom: 1.5rem;
  text-indent: 1.5rem;
}

.reading-passage h3 {
  font-family: 'Inter', sans-serif;
  color: #0f172a;
  margin-bottom: 0.5rem;
  font-weight: 800;
  font-size: 1.6em;
  text-align: center;
  text-indent: 0;
  letter-spacing: -0.01em;
}

.reading-passage h4, .reading-passage .subtitle {
  font-family: 'Inter', sans-serif;
  color: #64748b;
  margin-bottom: 2rem;
  font-weight: 500;
  font-size: 1.05em;
  text-align: center;
  text-indent: 0;
  font-style: italic;
}

.para-label, .paragraph-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.45rem;
  margin-right: 0.75rem;
  margin-bottom: 0.15rem;
  background-color: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 800;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  border-radius: 0.375rem;
  vertical-align: middle;
  text-indent: 0;
  user-select: none;
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.08);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* Question Items & Inputs */
.q-item {
  padding: 1.15rem 1.25rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.q-item.highlight-focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
  animation: pulseFocus 1.2s ease-out;
}

@keyframes pulseFocus {
  0% { transform: scale(1.01); background-color: #f0f9ff; }
  100% { transform: scale(1); background-color: #ffffff; }
}

/* Proportional Inline Text Inputs for Summary & Notes Completion */
.text-input,
.select-input,
input[type="text"].text-input {
  display: inline-block !important;
  height: 32px !important;
  min-height: 32px !important;
  line-height: 30px !important;
  padding: 0 0.5rem !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1.5px solid #94a3b8 !important;
  border-radius: 6px !important;
  text-align: center !important;
  vertical-align: middle !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease !important;
}

.text-input:focus,
.select-input:focus,
input[type="text"].text-input:focus {
  outline: none !important;
  border-color: #0284c7 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25) !important;
}

/* Constrained widths matching authentic IELTS response lengths */
.text-input-word,
.summary-block input[type="text"]:not(.text-input-two):not(.text-input-md),
.notes-block input[type="text"]:not(.text-input-two):not(.text-input-md) {
  width: 115px !important;
  min-width: 100px !important;
  max-width: 130px !important;
}

.text-input-two,
.text-input-md {
  width: 145px !important;
  min-width: 125px !important;
  max-width: 175px !important;
}

/* Summary & Notes Completion Paragraphs - Generous line-height prevents input vertical collisions */
.summary-block,
.notes-block {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  padding: 1.25rem 1.5rem !important;
  margin-bottom: 1.25rem !important;
}

.summary-block h5,
.notes-block h5 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.05rem !important;
  color: #0369a1 !important;
  margin: 0 0 1rem 0 !important;
  letter-spacing: -0.01em !important;
}

.summary-block p,
.notes-block p,
.notes-block ul li,
.q-item p:has(input[type="text"]),
.leading-loose {
  line-height: 2.5 !important;
  font-size: 1rem !important;
  color: #334155 !important;
  margin-bottom: 0.85rem !important;
}

.notes-block ul {
  list-style: disc !important;
  padding-left: 1.5rem !important;
  margin: 0 !important;
}

.notes-block ul li {
  margin-bottom: 0.75rem !important;
  line-height: 2.4 !important;
  color: #334155 !important;
}

/* Question Number + Input Container Alignment */
span[id^="container-q"]:has(input[type="text"]),
.inline-block:has(input[type="text"]) {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  margin: 0 0.35rem !important;
  white-space: nowrap !important;
}

span[id^="container-q"] strong,
.inline-block:has(input[type="text"]) strong {
  display: inline-block !important;
  font-weight: 800 !important;
  font-size: 0.875rem !important;
  margin-right: 0.35rem !important;
  color: #0284c7 !important;
}

/* Choose Two & Multiple-Option Instruction Banner */
.choose-two-notice {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem 0.85rem !important;
  font-size: 0.85rem !important;
  color: #1e3a8a !important;
  font-weight: 600 !important;
  margin-bottom: 0.85rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* Option Containers Stacking (Fixes un-styled Tailwind space-y-* run-on lists) */
.space-y-1,
.space-y-1\.5,
.space-y-2,
.space-y-3,
.space-y-4,
.space-y-5,
[id*="container-q"].space-y-2,
[id*="container-q"].space-y-1 {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.45rem !important;
  width: 100% !important;
}

/* Multiple-Choice, Choose TWO & Full-Width Option Cards */
.mc-label,
.choose2-label,
label.tfng-label,
.q-item label.mc-label,
.q-item label:has(input[type="checkbox"].choose2),
.q-item .space-y-1 > label,
.q-item .space-y-2 > label,
.space-y-1 > label,
.space-y-2 > label,
[id*="container-q"] label.mc-label,
[id*="container-q"] label:has(input[type="checkbox"]) {
  display: flex !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.75rem 1rem !important;
  margin: 0.25rem 0 !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 0.625rem !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
  font-weight: 500 !important;
  font-size: 0.9375rem !important;
  line-height: 1.55 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.mc-label:hover,
.choose2-label:hover,
label.tfng-label:hover,
.q-item label.mc-label:hover,
.q-item label:has(input[type="checkbox"].choose2):hover,
[id*="container-q"] label:has(input[type="checkbox"]):hover {
  background-color: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0f172a !important;
}

.mc-label input[type="checkbox"],
.mc-label input[type="radio"],
.choose2-label input[type="checkbox"],
label.tfng-label input[type="radio"],
[id*="container-q"] label input[type="checkbox"] {
  width: 1.2rem !important;
  height: 1.2rem !important;
  margin: 0.15rem 0.75rem 0 0 !important;
  flex-shrink: 0 !important;
  accent-color: #0284c7 !important;
  cursor: pointer !important;
}

/* Selected State for Multi-Choice / Checkbox Cards */
.mc-label:has(input:checked),
.choose2-label:has(input:checked),
label.tfng-label:has(input:checked),
.q-item label.mc-label:has(input:checked),
.q-item label:has(input[type="checkbox"]:checked),
[id*="container-q"] label:has(input[type="checkbox"]:checked) {
  background-color: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0f172a !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25) !important;
}

.mc-label:has(input:checked) strong,
.choose2-label:has(input:checked) strong,
label.tfng-label:has(input:checked) strong {
  color: #0284c7 !important;
}

/* Universal IELTS Short Option Pills (e.g. TFNG/YNNG horizontal pills where explicitly not mc-label) */
.custom-radio-label,
.custom-checkbox-label,
.q-option-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.55rem 1rem !important;
  margin: 0.25rem 0.25rem 0.25rem 0 !important;
  border-radius: 0.5rem !important;
  border: 1.5px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.custom-radio-label:hover,
.custom-checkbox-label:hover,
.q-option-label:hover {
  background-color: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* Checked State - Vibrant IELTS Academic Blue Pill */
.custom-radio-label:has(input:checked),
.custom-radio-label.is-selected,
.custom-checkbox-label:has(input:checked),
.custom-checkbox-label.is-selected,
.q-option-label:has(input:checked),
.q-option-label.is-selected {
  background-color: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35) !important;
}

.custom-radio-label:has(input:checked) span,
.custom-radio-label.is-selected span,
.custom-checkbox-label:has(input:checked) span,
.custom-checkbox-label.is-selected span,
.q-option-label:has(input:checked) span,
.q-option-label.is-selected span {
  color: #ffffff !important;
}

.custom-radio-label:has(input:checked) strong,
.custom-radio-label.is-selected strong,
.custom-checkbox-label:has(input:checked) strong,
.custom-checkbox-label.is-selected strong,
.q-option-label:has(input:checked) strong,
.q-option-label.is-selected strong {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* Hide legacy check-all wrappers completely */
#check-all-wrapper,
.check-btn {
  display: none !important;
}

.correct-answer {
  border-color: #16a34a !important;
  background-color: #f0fdf4 !important;
  color: #15803d !important;
}

.incorrect-answer {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}

.explanation-box {
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  background-color: #f0f9ff;
  border-left: 4px solid #0284c7;
  border-radius: 0.5rem;
  font-size: 0.925rem;
  color: #0369a1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  line-height: 1.6;
}

.explanation-box .correct-badge {
  display: inline-block;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85em;
  margin-bottom: 0.5rem;
}

/* Bottom Question Navigation Strip (IELTS on Computer) - RESPONSIVE & HORIZONTALLY SCROLLABLE */
.exam-footer {
  flex: 0 0 var(--footer-height) !important;
  width: 100% !important;
  max-width: 100vw !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  position: relative;
  z-index: 30;
  user-select: none;
}

/* Thin Animated Progress Line across the top of footer */
.progress-line-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-line-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #10b981);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.footer-content {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important; /* CRITICAL: Must be 0 so flex child can shrink */
  height: 100% !important;
  padding: 0 1rem !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  gap: 0.75rem !important;
}

.footer-left {
  flex: 0 0 auto !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

/* Segmented Question Line (1 to 40) - FLUID SCROLLABLE */
.questions-strip-scroll {
  flex: 1 1 0px !important;
  min-width: 0 !important; /* CRITICAL: Enables shrinking and horizontal scroll */
  max-width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 0.25rem 0.5rem !important;
  scrollbar-width: thin !important;
  scrollbar-color: #475569 transparent !important;
  -webkit-overflow-scrolling: touch !important;
}

.footer-right {
  flex: 0 0 auto !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.passage-group-strip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.625rem;
  flex-shrink: 0;
}

.group-label {
  font-size: 0.6875rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.q-nav-btn {
  width: 30px;
  height: 32px;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid #475569;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2), transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  flex-shrink: 0;
}

.q-nav-btn:hover {
  border-color: #38bdf8;
  color: #ffffff;
  background: #334155;
  transform: translateY(-1px) scale(1.08);
}

.q-nav-btn:active {
  transform: scale(0.92);
}

/* Question Statuses */
.q-nav-btn.is-answered {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.4);
}

.q-nav-btn.is-active {
  box-shadow: 0 0 0 2px #38bdf8, 0 0 10px rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  font-weight: 900;
  transform: scale(1.1);
  z-index: 2;
}

.q-nav-btn.is-flagged::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 4px #f59e0b;
}

/* Live Answer Count */
.stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #cbd5e1;
  white-space: nowrap;
}

/* Modals */
.exam-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.exam-modal-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1.25rem;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  color: #f8fafc;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Exam Readiness Gate Modal */
.readiness-modal-card {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 1.5rem;
  max-width: 720px;
  width: 100%;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85), 0 0 32px rgba(56, 189, 248, 0.15);
  color: #f8fafc;
  animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.readiness-rule-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 0.875rem;
  padding: 1rem;
  transition: all 0.2s ease;
}

.readiness-rule-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-2px);
}

.readiness-start-btn {
  background: linear-gradient(135deg, #059669 0%, #0d9488 50%, #0284c7 100%);
  color: #ffffff;
  font-weight: 800;
  border-radius: 0.875rem;
  padding: 1rem 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px -4px rgba(5, 150, 105, 0.4), 0 0 16px rgba(13, 148, 136, 0.25);
  cursor: pointer;
}

.readiness-start-btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 12px 30px -4px rgba(5, 150, 105, 0.55), 0 0 24px rgba(13, 148, 136, 0.35);
  filter: brightness(1.08);
}

.readiness-start-btn:active {
  transform: scale(0.98);
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Custom Scrollbar for Panes */
.pane::-webkit-scrollbar {
  width: 8px;
}
.pane::-webkit-scrollbar-track {
  background: transparent;
}
.pane::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.pane::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Comprehensive Multi-Device Ergonomics */
@media (max-width: 1440px) and (min-width: 1024px) {
  #left-pane {
    padding: 1.5rem 1.75rem 5.5rem;
  }
  #right-pane {
    padding: 1.5rem 4.5rem 5.5rem 1.5rem !important;
  }
}

@media (max-width: 1023px) and (min-width: 861px) {
  #left-pane {
    padding: 1.25rem 1.25rem 5rem;
  }
  #right-pane {
    padding: 1.25rem 4.25rem 5rem 1.25rem !important;
  }
  .exam-header {
    padding: 0 0.75rem;
  }
}

/* Mobile & Tablet Full-Bleed Adaptive Mode (< 860px) */
@media (max-width: 860px) {
  .exam-container {
    height: 100dvh;
    max-height: 100dvh;
  }

  .exam-header {
    height: auto !important;
    min-height: var(--header-height) !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    padding: 0.4rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .content-panes {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .splitter {
    display: none !important;
  }

  .pane {
    padding: 1.25rem 1rem 4.5rem !important;
    width: 100%;
    flex: 1 1 auto;
    overflow-y: auto;
  }

  /* When mobile pane is toggled */
  .pane.mobile-hidden {
    display: none !important;
  }

  .pane.mobile-active {
    display: block !important;
  }

  .passage-tabs-container {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
  }

  .passage-tab-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .footer-content {
    padding: 0 0.75rem !important;
    gap: 0.5rem !important;
  }

  .stats-badge {
    font-size: 0.75rem;
  }

  .q-nav-btn {
    width: 26px;
    height: 28px;
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Standardized Reading Question Tags & Notes Layout System
   ========================================================================== */
.q-section-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.q-range-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.q-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.q-type-badge.tfng, .q-type-badge.ynng {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.q-type-badge.mc {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.q-type-badge.headings, .q-type-badge.matching {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.q-type-badge.summary, .q-type-badge.notes, .q-type-badge.sentence {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.q-type-badge.table {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}
.q-type-badge.generic {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.notes-block {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.9;
  color: #1e293b;
}
.notes-block h5 {
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.notes-block h6 {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  color: #0284c7;
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.notes-block h6::before {
  content: "•";
  color: #38bdf8;
  font-size: 1.2rem;
  line-height: 1;
}
.notes-block ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.25rem 0 0.5rem 0;
}
.notes-block ul ul {
  list-style: circle;
  padding-left: 1.5rem;
  margin-top: 0.25rem;
}
.notes-block li {
  margin-bottom: 0.4rem;
  color: #334155;
}

.text-input-word {
  width: 8.5rem;
  min-width: 110px;
  max-width: 150px;
  height: 32px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.q-num-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.5rem !important;
  min-width: 1.5rem !important;
  max-width: 1.5rem !important;
  height: 1.5rem !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  border-radius: 9999px !important;
  background: #e0f2fe !important;
  color: #0284c7 !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  margin-right: 0.5rem !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  align-self: flex-start !important;
  user-select: none !important;
}

/* Inline text fill-in-the-blank question elements (summary/notes/table completion) */
span[id^="container-q"],
.q-inline-blank {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  margin: 0 0.25rem !important;
}

/* Sentence Completion & Notes Cards (Natural Running Text Flow) */
.q-sentence-card,
div.bg-gray-50:has(input[type="text"]),
div[id^="container-q"]:has(input[type="text"]) {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 1rem !important;
  line-height: 2 !important;
}

/* Question Items & Containers with Choice Options (MCQ, TFNG) — strictly vertical top-to-bottom layout */
div.q-item,
.q-mc-item,
.q-tfng-item,
div.q-item:has(input[type="radio"]) {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 1.25rem !important;
}

/* Matching Headings & Features with dropdown on the right side */
div.q-item.justify-between {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
}

@media (max-width: 640px) {
  div.q-item.justify-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
}

div.q-item > p,
.q-mc-item > p,
.q-tfng-item > p,
.q-item-question-text {
  display: block !important;
  width: 100% !important;
  margin-bottom: 0.75rem !important;
  line-height: 1.6 !important;
}

/* True / False / Not Given & Yes / No / Not Given Button Group Layout */
.tfng-btn-group,
.q-item .flex.gap-4,
.q-item .flex.flex-wrap {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.625rem !important;
  width: 100% !important;
  margin-top: 0.5rem !important;
}

.tfng-chip,
.q-item .flex.gap-4 > label,
.q-item .flex.flex-wrap > label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #ffffff !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.15s ease-in-out !important;
}

.tfng-chip:hover,
.q-item .flex.gap-4 > label:hover,
.q-item .flex.flex-wrap > label:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
}

.tfng-chip input[type="radio"],
.q-item .flex.gap-4 > label input[type="radio"],
.q-item .flex.flex-wrap > label input[type="radio"] {
  accent-color: #2563eb !important;
  cursor: pointer !important;
}

.tfng-chip.selected,
.q-item .flex.gap-4 > label.selected,
.q-item .flex.flex-wrap > label.selected,
.q-item .flex.gap-4 > label:has(input:checked),
.q-item .flex.flex-wrap > label:has(input:checked) {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: 0 0 0 1px #2563eb, 0 2px 4px rgba(37, 99, 235, 0.08) !important;
}

/* Multiple Choice Cards & Full-Width Vertical Stacking */
.mc-card-list,
.custom-radio-group,
.q-item .flex-col,
.q-item .space-y-2,
.q-item .space-y-1\.5 {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  width: 100% !important;
  margin-top: 0.35rem !important;
}

.mc-option-card,
.custom-radio-label,
.mcq-label {
  display: flex !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  gap: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  border-radius: 0.625rem !important;
  border: 1.5px solid #e2e8f0 !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
  font-size: 0.9375rem !important;
  line-height: 1.5 !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  user-select: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

/* Instruction Line Formatting */
.instruction-line {
  display: block;
  margin-bottom: 0.35rem;
  line-height: 1.6;
}
.instruction-line:last-child {
  margin-bottom: 0;
}

/* Pick from a List Clickable Option Cards */
.pick-list-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.pick-option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  position: relative;
  user-select: none;
}
.pick-option-card:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}
.pick-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.15s;
}
.pick-option-card:hover .pick-letter-badge {
  background: #e2e8f0;
  color: #0f172a;
}
.pick-option-text {
  font-size: 0.9375rem;
  color: #1e293b;
  line-height: 1.5;
  flex-grow: 1;
}
.pick-option-card.selected {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.pick-option-card.selected .pick-letter-badge {
  background: #2563eb;
  color: #ffffff;
}
.pick-option-card.correct-answer {
  border-color: #10b981 !important;
  background-color: #f0fdf4 !important;
  color: #065f46 !important;
}
.pick-option-card.correct-answer .pick-letter-badge {
  background: #10b981 !important;
  color: #ffffff !important;
}
.pick-option-card.incorrect-answer {
  border-color: #f43f5e !important;
  background-color: #fff1f2 !important;
  color: #9f1239 !important;
}
.pick-option-card.incorrect-answer .pick-letter-badge {
  background: #f43f5e !important;
  color: #ffffff !important;
}
.pick-option-card.missed-answer {
  border-color: #10b981 !important;
  border-style: dashed !important;
  background-color: #f0fdf4 !important;
}

.pick-choices-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}
.pick-choice-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}
.pick-choice-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 1.85rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.875rem;
}

/* Instruction Line Formatting */
.instruction-line {
  display: block;
  margin-bottom: 0.35rem;
  line-height: 1.6;
}
.instruction-line:last-child {
  margin-bottom: 0;
}

/* Universal Question Instruction Box */
.q-instruction-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.6;
}
.q-instruction-box .instruction-line {
  display: block;
  margin-bottom: 0.35rem;
}
.q-instruction-box .instruction-line:last-child {
  margin-bottom: 0;
}


/* Mobile Question Cards & Inputs Containment (<= 860px) */
@media (max-width: 860px) {
  .q-section-card,
  .question-section-card,
  div[id^="section-"] {
    padding: 0.85rem 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-radius: 0.75rem !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .summary-block,
  .notes-block {
    padding: 0.75rem 0.75rem !important;
    border-radius: 0.625rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  span[id^="container-q"],
  .q-inline-blank {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    margin: 0.15rem 0.2rem !important;
    white-space: normal !important;
    max-width: 100% !important;
  }

  .text-input-word,
  .summary-block input[type="text"],
  .notes-block input[type="text"] {
    width: 95px !important;
    min-width: 80px !important;
    max-width: 115px !important;
    font-size: 0.8125rem !important;
    height: 30px !important;
    padding: 0 0.35rem !important;
  }

  .tfng-btn-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }

  .tfng-chip {
    padding: 0.4rem 0.2rem !important;
    font-size: 0.72rem !important;
    min-width: 0 !important;
    width: 100% !important;
    justify-content: center !important;
  }
}
