:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --page: #f6f7fb;          /* Solid page background fixes the "column" */
  --card-bg: #ffffff;
  --radius: 16px;
  --transition: 0.25s ease;
}

/* Reset & base */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100svh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  display: grid;
  place-items: center;       /* centers the card */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 36px;
  background: var(--card-bg);       /* solid white, no frosted blur */
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  text-align: center;
  animation: fade-in 0.45s ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 24px;
}

/* ---------- Form ---------- */
.field { position: relative; margin-bottom: 14px; }

.field input {
  width: 100%;
  padding: 14px 44px 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 8px;
}

.toggle-password:hover { color: var(--primary); }

/* ---------- Button ---------- */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), transform 0.05s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

/* ---------- Messages ---------- */
#message {
  margin-top: 14px;
  font-size: 0.93rem;
  font-weight: 500;
  min-height: 1.2em;
}

.error { color: #d52731; }
.success { color: #269f53; }

/* ---------- Empty / Nice Notice ---------- */
.empty-wrap{
  display:flex; align-items:center; justify-content:center;
  min-height: 70vh; padding: 24px;
  background: linear-gradient(180deg, #f4f6fb, #f9fafb);
}

.empty-card{
  max-width: 640px;
  width: min(92vw, 640px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(16,24,40,.08);
  padding: 24px;
  text-align: center;
}

.empty-illust{ margin-bottom: 12px; }
.empty-card h2{
  margin: 6px 0 6px;
  font-weight: 800;
  font-size: 1.25rem;
  color: #0f172a;
  letter-spacing: .2px;
}
.empty-card p{
  margin: 0 0 10px;
  color: #6b7280;
  font-size: .98rem;
}
.hintline{
  display: inline-flex; gap: 8px; align-items: center;
  padding: 8px 12px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  color: #374151;
  background: #f9fafb;
  font-size: .92rem;
}
.hintline i{ color:#2563eb; }


/* ---------- Logout button ---------- */
/* Tiny logout icon (top-left of the page) */
.logout-icon {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.logout-icon i {
  font-size: 14px;   /* slightly larger than before */
  line-height: 1;
}

.logout-icon:hover { background: var(--primary-dark); }
.logout-icon:active { transform: translateY(1px); }



/* ===== Quiz Creator (minimal styles) ===== */
.quiz-grid { display:grid; gap:16px; grid-template-columns: 1fr 1fr; }
.quiz-panel { background:#f9fafb; border:1px solid #e5e7eb; border-radius:12px; padding:14px; }
.quiz-label { display:block; font-size:.9rem; color:#6b7280; margin-bottom:6px; }
.quiz-codebox { width:100%; min-height:420px; resize:vertical; font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace; font-size:.95rem; background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px; }
.quiz-lint { margin-top:8px; font-size:.9rem; min-height:1.1em; }
.quiz-lint.error { color:#d52731; }
.quiz-lint.success { color:#269f53; }
.quiz-preview { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px; min-height:420px; overflow:auto; }
.quiz-preview .q { padding:10px; border-bottom:1px dashed #e5e7eb; }
.quiz-preview .q:last-child { border-bottom:none; }
.quiz-preview .title { font-weight:700; margin-bottom:4px; }
.quiz-preview .meta { color:#6b7280; font-size:.9rem; margin-bottom:10px; }
.quiz-preview .opt { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:6px; }


/* --- Quiz toolbar buttons (upgraded) --- */
.btnbar {
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap: nowrap;         /* keep in ONE line by default */
}

.btnbar .btn {               /* never stretch a button */
  flex: 0 0 auto;
}



/* pill shape helper (doesn't affect login button) */
.pill { border-radius: 9999px !important; }

.btn.btn-primary {
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color:#fff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 10px 22px rgba(29,78,216,.18), 0 2px 6px rgba(29,78,216,.12);
  transition: transform .06s ease, box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
  min-width: 150px;     /* consistent minimum */
  max-width: 200px;     /* prevents “too long” look */
}


.btn.btn-primary:hover,
.btn.btn-primary:focus-visible {
  background: linear-gradient(180deg, #1e4fdc, #1b46c8);
  box-shadow: 0 14px 30px rgba(29,78,216,.22), 0 2px 8px rgba(29,78,216,.14);
}
.btn.btn-primary:active { transform: translateY(1px); }

/* Ghost (Clear) */
.btn.btn-ghost {
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding: 12px 18px;
  background:#fff;
  color:#111827;
  border:1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
  transition: transform .06s ease, box-shadow var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-width: 120px;
  max-width: 180px;
}


.btn.btn-ghost:hover,
.btn.btn-ghost:focus-visible {
  background:#f9fafb;
  border-color:#d1d5db;
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}
.btn.btn-ghost:active { transform: translateY(1px); }

/* Spinner for Create button */
.has-spinner {
  position: relative;
}
.has-spinner.is-loading {
  pointer-events: none;
  opacity: .9;
}
.has-spinner.is-loading::after {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6);
  border-top-color: #fff;
  position: absolute;
  right: 12px; /* keeps label readable */
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Keep preview & editor heights steady even after clearing */
.quiz-codebox { min-height: 420px; }
.quiz-preview { min-height: 420px; }


.quiz-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
  min-height:60px;
  flex-wrap: wrap;              /* let the toolbar drop to a new row */
}

/* Give the title flexible room so buttons don't collide with it */
.quiz-head h1 { flex: 1 1 280px; min-width: 220px; }

/* When wrapped, make the button row full width and tidy */
@media (max-width: 860px) {
  .btnbar {
    width: 100%;
    justify-content: flex-start;
    margin-top: 6px;
    flex-wrap: wrap;           /* allow wrap only on smaller screens */
  }
}




/* Stack panels on narrow screens to avoid any squeeze */
@media (max-width: 980px) {
.quiz-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}


/* small inline cloze — keep inline, not full width */
/* ======= Inline blanks (pretty underline style) ======= */
.q-input.sm{
  display:inline-block;
  vertical-align:baseline;
  margin:0 6px;                     /* spacing in the sentence */
  padding:6px 6px 4px 6px;          /* tighter padding */
  border:none;                      /* remove box border */
  border-bottom:2px solid #dbe2ea;  /* nice underline */
  background:#fff;
  font:inherit;                     /* same font/size as text */
  line-height:1.2;
  width:auto;                       /* width is controlled in JS */
  min-width:8ch;                    /* safe minimum width */
  max-width:26ch;                   /* avoid going too long */
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.q-input.sm::placeholder{ color:#9aa4b2; opacity:.9; }

/* focus / active state */
.q-input.sm:focus{
  outline:none;
  border-bottom-color:#93c5fd;
  box-shadow:0 2px 0 0 rgba(59,130,246,.35);
  background:#f8fbff;
  border-radius:6px 6px 0 0;        /* small top curve */
}

/* when a blank is empty (optional subtle cue) */
.q-input.sm:placeholder-shown{
  background:#fcfdff;
}


/* small inline dropdown (for cloze_select) */
/* small inline dropdown (for cloze_select) — pretty + compact */
.q-select.sm{
  display:inline-block;
  vertical-align:baseline;
  margin:0 6px;
  padding:6px 28px 6px 10px;     /* room for arrow */
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  font:inherit;
  line-height:1.2;
  width:auto;                    /* JS sets width */
  min-width:9ch;
  max-width:36ch;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.q-select.sm:focus{
  outline:none;
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(59,130,246,.25);
  background:#f8fbff;
}


.q-input:focus,.q-select:focus,.q-textarea:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,.25)}

.q-select{
  appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%),
    linear-gradient(to right,#e5e7eb,#e5e7eb);
  background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%, calc(100% - 36px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 60%;
  background-repeat:no-repeat;
}
.q-select:invalid{ color:#9ca3af; }

.q-select:invalid{color:#9ca3af}
.q-hint{color:#6b7280;font-size:.9rem}

.q-chipgroup{display:flex;gap:8px;flex-wrap:wrap}
.q-chip{display:inline-flex;align-items:center;gap:6px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:999px;background:#fff;cursor:pointer;transition:box-shadow .15s,border-color .15s,background .15s}
.q-chip input{appearance:none;width:14px;height:14px;border:2px solid #9ca3af;border-radius:50%}
.q-chip:has(input:checked){border-color:#93c5fd;background:#f8fbff;box-shadow:0 0 0 3px rgba(59,130,246,.25)}
.q-chip:has(input:checked) input{border-color:#2563eb;background:#2563eb}

.q-draglist{list-style:none;padding:0;margin:8px 0}
.q-draglist li{padding:10px 12px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;margin:8px 0;cursor:grab}
.q-draglist li.dragging{opacity:.6}
.q-dragghost{border:1px dashed #93c5fd;background:#f8fbff}


/* ==== Matching layout (chips + right list) ==== */
.match-wrap{display:grid;grid-template-columns:1fr;gap:10px}
@media(min-width:720px){.match-wrap{grid-template-columns:1fr 1fr}}
.match-left .match-row{display:flex;align-items:flex-start;gap:10px;margin:10px 0}
.match-left .num{min-width:22px;font-weight:700}
.match-choices{display:flex;gap:8px;flex-wrap:wrap}
.match-right{border:1px solid #eef2f7;background:#fafafa;border-radius:10px;padding:10px;position:sticky;top:20px;align-self:flex-start;max-height:calc(100vh - 40px);overflow-y:auto}
.match-right .rline{margin:6px 0}
.q-chip.letter{padding:6px 10px}
.q-chip.letter span{font-weight:700}


/* ===== Rewrite (free sentence) UI ===== */
.q-rewrite{ margin-top:8px; }

.q-source{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:10px 12px;
  margin:6px 0 10px;
}
.q-src-text{ color:#0f172a; }

.q-badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  background:#111827;
  color:#fff;
  font-size:.78rem;
  font-weight:700;
}
.q-badge.ghost{
  background:#eef2ff;            /* indigo-50 vibe */
  color:#1f2937;
}

/* nice textarea */
.q-field{ margin-top:6px; }
.q-textarea{
  width:100%;
  min-height:80px;
  max-height:320px;
  resize:vertical;
  padding:12px 12px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
  font:inherit;
  line-height:1.5;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.q-textarea::placeholder{ color:#9aa4b2; }
.q-textarea:focus{
  outline:none;
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(59,130,246,.25);
  background:#f8fbff;
}

/* tiny meta row under the textarea */
.q-meta{
  display:flex; justify-content:flex-end;
  font-size:.85rem; color:#6b7280;
  margin-top:6px;
}

/* Uncap inline dropdowns used in the passage */
select[data-type="cloze-select"]{
  max-width: none !important;      /* remove the 36ch cap */
}

/* If you want long picks to drop to a new line and be full width */
select[data-type="cloze-select"].break{
  display:block;
  width:100% !important;
  margin:6px 0;
}


/* allow the backdrop to scroll if the modal is taller than the viewport */
.ts-overlay { overflow: auto; }

/* make the modal a flex column and cap its height */
.ts-modal {
  max-height: 92vh;            /* keep inside the viewport */
  display: flex;
  flex-direction: column;
}

/* keep the formatting toolbar visible while scrolling */
.q-toolbar {
  position: sticky;
  top: 0;
  background: #fff;
  padding-bottom: 6px;
  z-index: 1;
}

/* let the editor area scroll, not the whole page */
.q-rich-editor {
  flex: 1 1 auto;              /* take remaining space */
  min-height: 160px;
  max-height: 60vh;            /* any comfortable cap */
  overflow: auto;
}

/* keep action buttons reachable */
.ts-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 10px;
  margin-top: 10px;
}
@supports (padding: env(safe-area-inset-bottom)) {
  .ts-actions { padding-bottom: env(safe-area-inset-bottom); }
}


/* Section headers for textbook-style layout */
.section-header {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-left: 5px solid #0284c7;
  border-radius: 12px;
  margin: 28px 0 18px;
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0369a1;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}
.section-sub {
  color: #475569;
  font-size: 0.98rem;
  margin: 0 0 10px;
  padding-left: 18px;
}
.section-instr {
  background: none;
  padding: 8px 0 4px 18px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 1.08rem;
  font-weight: 600;
  font-style: italic;
  color: #1e40af;
  margin-top: 8px;
}

/* Multiple matching (Cambridge-style) */
.mm-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.mm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
}
.mm-num {
  font-weight: 600;
  color: #64748b;
  min-width: 24px;
}
.mm-text {
  flex: 1;
}
.mm-row select {
  min-width: 60px;
}


/* Sentence arrangement lines */
.q-lines {
  margin: 12px 0;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.q-line {
  margin: 6px 0;
  line-height: 1.6;
  color: #334155;
}

.q-line:first-child {
  margin-top: 0;
}

.q-line:last-child {
  margin-bottom: 0;
}


/* Word Bank Styling */
.word-bank {
  margin-top: 12px;
  padding: 12px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
}

.word-bank-label {
  font-size: 0.85rem;
  color: #0369a1;
  font-weight: 600;
  margin-bottom: 8px;
}

.word-bank-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-bank-item {
  display: inline-block;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #0c4a6e;
}


/* Example Box Styling */
.example-box {
  margin-top: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  border: 1px solid #facc15;
  border-left: 4px solid #eab308;
  border-radius: 10px;
}

.example-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #a16207;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.example-situation {
  font-size: 0.95rem;
  color: #713f12;
  margin-bottom: 6px;
  line-height: 1.5;
}

.example-answer {
  font-size: 1rem;
  color: #166534;
  font-weight: 600;
  padding: 8px 12px;
  background: #fff;
  border-radius: 6px;
  border: 1px dashed #86efac;
  display: inline-block;

}


/* Numbered gap labels (for cloze passages with gapStartNum) */
.gap-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  border-radius: 4px;
  margin-right: 2px;
  vertical-align: middle;
  padding: 0 4px;
}

/* Passage title */
.passage-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

/* Labeled paragraphs (A, B, C, D) */
.passage-para {
  margin-bottom: 16px;
  line-height: 1.7;
  text-align: justify;
}

.para-label {
  display: inline;
  font-weight: 700;
  color: #1e40af;
  margin-right: 8px;
}

.para-text {
  display: inline;
}


/* Passage formatting */
.passage-text ul {
  margin: 8px 0 8px 20px;
  padding: 0;
}

.passage-text li {
  margin: 4px 0;
  line-height: 1.6;
}

.passage-text p {
  margin: 8px 0;
}


/* ========================================
   STRUCTURED NOTES STYLING
   ======================================== */

/* Main title for structured notes - bigger like original textbook */
.notes-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
  line-height: 1.3;
}

/* Section headers within notes - smaller, just bold */
.qitem strong {
  font-weight: 700;
  color: #1e40af;
  display: block;
  margin-top: 16px;
  margin-bottom: 4px;
}

/* Override for short_answer - keep strong inline */
.qitem.short-answer-item strong {
  display: inline;
  margin-top: 0;
  margin-bottom: 0;
}

/* First strong after notes-title should have less top margin */
.notes-title + br + strong,
.notes-title + strong {
  margin-top: 8px;
}

/* Bullet points in structured notes */
.qitem ul {
  margin: 6px 0 12px 20px;
  padding: 0;
  list-style-type: disc;
}

.qitem li {
  margin: 6px 0;
  line-height: 1.6;
  color: #334155;
}

/* Gap number styling */
/* Gap number styling */
.gap-num {
  color: #3b82f6;
  font-weight: 600;
  margin-right: 2px;
}

/* ============================================
   CLOZE OPEN - Line-by-line with dividers
   ============================================ */
.cloze-lines-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
}

.cloze-line {
  padding: 14px 0;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.9;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.cloze-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cloze-line:first-child {
  padding-top: 0;
}

/* Numbered badge for each line */
.cloze-line-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  margin-right: 10px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

/* Hover effect on line for better UX */
.cloze-line:hover {
  background: #fafbfc;
  margin-left: -12px;
  margin-right: -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 8px;
}

/* When input inside line is focused, highlight the line */
.cloze-line:has(.q-input:focus) {
  background: #f0f9ff;
  margin-left: -12px;
  margin-right: -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 8px;
  border-bottom-color: transparent;
}


/* FCE Gapped Text Styles */
.fce-gapped-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fce-passage {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  line-height: 1.85;
  font-size: 0.98rem;
  color: #1e293b;
}

.fce-gap-marker {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 2px;
}

.fce-dropdowns {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.fce-dropdowns-title {
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

/* Container for all gap rows - HORIZONTAL layout */
.fce-dropdowns-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}

.fce-gap-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fce-gap-label {
  font-weight: 700;
  color: #0f172a;
  min-width: 24px;
}

.fce-gap-row .slot-select {
  min-width: 70px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
}

.fce-sentence-bank {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.fce-bank-title {
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.fce-sentence-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.fce-sentence-item:last-child {
  border-bottom: none;
}

.fce-sentence-label {
  font-weight: 700;
  color: #0369a1;
  min-width: 24px;
  flex-shrink: 0;
}

.fce-sentence-text {
  color: #334155;
  line-height: 1.5;
}

/* ========================================
   MATCHING SENTENCE ENDINGS (IELTS Reading)
   ======================================== */
.matching-endings-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.me-sentence-starters {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.me-starters-title {
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.me-starter-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.me-starter-row:last-child {
  border-bottom: none;
}

.me-starter-num {
  font-weight: 700;
  color: #0f172a;
  min-width: 28px;
  flex-shrink: 0;
}

.me-starter-text {
  flex: 1;
  color: #334155;
  line-height: 1.5;
}

.me-starter-select {
  min-width: 70px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  flex-shrink: 0;
}

.me-endings-bank {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.me-endings-title {
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.me-ending-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.me-ending-item:last-child {
  border-bottom: none;
}

.me-ending-label {
  font-weight: 700;
  color: #0369a1;
  min-width: 24px;
  flex-shrink: 0;
}

.me-ending-text {
  color: #334155;
  line-height: 1.5;
}


/* ========================================
   MATCHING HEADINGS (IELTS Reading)
   ======================================== */
.matching-headings-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mh-headings-list {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.mh-headings-title,
.mh-paras-title {
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.mh-heading-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.mh-heading-item:last-child {
  border-bottom: none;
}

.mh-heading-num {
  font-weight: 700;
  color: #0369a1;
  min-width: 28px;
  flex-shrink: 0;
}

.mh-heading-text {
  color: #334155;
  line-height: 1.5;
}

.mh-paragraphs {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.mh-para-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.mh-para-row:last-child {
  border-bottom: none;
}

.mh-para-num {
  font-weight: 700;
  color: #6b7280;
  min-width: 24px;
  flex-shrink: 0;
}

.mh-para-label {
  flex: 1;
  color: #1e293b;
  font-weight: 500;
}

.mh-select {
  min-width: 70px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
}

.mh-example {
  background: #f0fdf4;
  border-radius: 6px;
  padding: 10px 12px !important;
}

.mh-example-answer {
  font-weight: 700;
  color: #166534;
  min-width: 40px;
  text-align: center;
}

.mh-example-tag {
  font-size: 0.75rem;
  color: #166534;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}


/* Word Formation Passage Styles */
.wf-gap-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  vertical-align: middle;
}

.wf-input {
  width: 120px;
  text-align: center;
  border-bottom: 2px solid #2563eb !important;
}

.wf-base {
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  font-size: 0.85em;
  background: #f0fdfa;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* FCE Word Formation Passage Styles */


.wf-input {
  width: 110px;
  text-align: center;
  border: none !important;
  border-bottom: 2px solid #2563eb !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.wf-input:focus {
  border-bottom-color: #1d4ed8 !important;
  outline: none;
}

.wf-base {
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  font-size: 0.8em;
  background: #f0fdfa;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid #99f6e4;
}

/* ============================================
   FCE WORD FORMATION PASSAGE STYLES
   ============================================ */

.wf-passage-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0;
}

.wf-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.wf-layout {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 640px) {
  .wf-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .wf-base-col {
    order: -1;
  }
}

.wf-passage-col {
  line-height: 2.2;
  color: #334155;
  font-size: 1rem;
}

.wf-inline-gap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 2px;
  vertical-align: baseline;
}

.wf-num {
  font-weight: 700;
  color: #2563eb;
  font-size: 0.9em;
}

.wf-input {
  width: auto;
  min-width: 70px;
  max-width: 280px;
  padding: 6px 10px;
  border: none;
  border-bottom: 2px solid #cbd5e1;
  border-radius: 4px 4px 0 0;
  background: #f8fafc;
  font-size: 0.95rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.wf-input:focus {
  outline: none;
  border-bottom-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 -2px 8px rgba(37, 99, 235, 0.15);
}

.wf-input:not(:placeholder-shown) {
  background: #f0fdf4;
  border-bottom-color: #22c55e;
}

/* Right side: Base words column */
.wf-base-col {
  position: sticky;
  top: 80px;
}

.wf-base-list {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 12px 14px;
}

.wf-base-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed #d1fae5;
}

.wf-base-item:last-child {
  border-bottom: none;
}

.wf-base-num {
  font-size: 0.8rem;
  color: #64748b;
  min-width: 24px;
}

.wf-base-word {
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

/* Example box styling for word formation */
.wf-example {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.wf-example-label {
  font-weight: 600;
  color: #854d0e;
  margin-bottom: 4px;
}

.wf-example-text {
  color: #713f12;
}

.wf-example-answer {
  display: inline-block;
  background: #fff;
  border: 1px solid #fde047;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 600;
  color: #0f766e;
  text-transform: uppercase;
}


/* Beautiful Question Number Badge */
.q-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  margin-right: 8px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}


/* Cloze Select Gap Numbering */
.cloze-select-gap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0;
}

.cloze-gap-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  background: var(--primary, #2563eb);
  border-radius: 11px;
  margin-right: 4px;
}


/* ===== CROSS OUT QUESTION TYPE ===== */
.cross-out-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.cross-out-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cross-out-num {
  font-weight: 700;
  color: #6b7280;
  min-width: 24px;
}

.cross-out-words {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.cross-out-word {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cross-out-word:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.cross-out-word.crossed {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #dc2626;
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

.cross-out-slash {
  color: #9ca3af;
  font-weight: 300;
  margin: 0 2px;
}

.cross-out-context {
  color: #374151;
  font-style: italic;
}


/* Structured notes for IELTS listening */
.cloze-notes-wrap {
  line-height: 1.7;
}
.cloze-notes-wrap h3.notes-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e40af;
  margin: 0 0 12px 0;
  text-align: center;
}
/* Section headers - only direct children of the wrap should be block */
.cloze-notes-wrap > strong {
  display: block;
  margin-top: 16px;
  margin-bottom: 4px;
  font-weight: 600;
  color: #334155;
}

/* Inline bold inside list items - stay inline */
.cloze-notes-wrap li strong,
.cloze-notes-wrap li b {
  display: inline;
  margin: 0;
  font-weight: 700;
  color: inherit;
}
.cloze-notes-wrap ul {
  margin: 0 0 8px 0;
  padding-left: 24px;
}
.cloze-notes-wrap li {
  margin-bottom: 6px;
}
.cloze-inline-num {
  display: inline-block;
  min-width: 22px;
  font-weight: 600;
  color: #2563eb;
  margin-right: 4px;
}

/* ===== LESSON CONTENT SECTION ===== */
.lesson-content {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.lesson-content .lesson-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.lesson-content .lesson-badge {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
}

.lesson-content .lesson-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.lesson-content .lesson-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin: 0 0 16px 0;
}

.lesson-content .lesson-body {
  line-height: 1.8;
  color: #334155;
}

.lesson-content .lesson-body p {
  margin: 0 0 12px 0;
}

.lesson-content .lesson-body ul,
.lesson-content .lesson-body ol {
  margin: 8px 0 12px 20px;
  padding: 0;
}

.lesson-content .lesson-body li {
  margin-bottom: 6px;
}

/* Dialogue boxes */
.lesson-content .dialogue-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-left: 4px solid #10b981;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 0.95rem;
}

.lesson-content .dialogue-box.blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #3b82f6;
}

.lesson-content .dialogue-box.yellow {
  background: #fefce8;
  border-color: #fef08a;
  border-left-color: #eab308;
}

.lesson-content .dialogue-box.purple {
  background: #faf5ff;
  border-color: #e9d5ff;
  border-left-color: #a855f7;
}

.lesson-content .dialogue-line {
  margin: 6px 0;
}

.lesson-content .dialogue-line .speaker {
  font-weight: 700;
  color: #065f46;
  margin-right: 8px;
}

.lesson-content .dialogue-box.blue .speaker { color: #1e40af; }
.lesson-content .dialogue-box.yellow .speaker { color: #a16207; }
.lesson-content .dialogue-box.purple .speaker { color: #7e22ce; }

/* Section headers inside lesson */
.lesson-content .lesson-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
}

.lesson-content .lesson-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f766e;
  margin: 0 0 10px 0;
}

/* Highlight box for tips/notes */
.lesson-content .tip-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  color: #92400e;
  font-size: 0.95rem;
}

.lesson-content .tip-box strong {
  color: #78350f;
}

/* Example box */
.lesson-content .example-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.lesson-content .example-label {
  font-weight: 700;
  color: #6366f1;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Collapse/expand toggle */
.lesson-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.lesson-toggle-icon {
  font-size: 1.2rem;
  color: #64748b;
  transition: transform 0.2s;
}

.lesson-content.collapsed .lesson-body {
  display: none;
}

.lesson-content.collapsed .lesson-toggle-icon {
  transform: rotate(-90deg);
}

/* === ADDITIONAL LESSON CONTENT STYLES === */

/* Notes title for structured note exercises */
.lesson-content .notes-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e40af;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  padding: 12px 16px;
  border-radius: 10px;
  margin: 0 0 16px 0;
  border-left: 4px solid #3b82f6;
}

/* Info box (blue variant of tip-box) */
.lesson-content .info-box {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #93c5fd;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  color: #1e40af;
font-size: 0.95rem;
}

/* ===== SUMMARY SECTION (Tổng kết bài học) ===== */
.summary-section {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px dashed #86efac;
  border-radius: 16px;
  padding: 20px 24px;
  margin: 32px 0 24px;
}

.summary-section .summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-section .summary-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #166534;
  margin: 0;
}

.summary-section .summary-title::before {
  content: '📌';
  margin-right: 8px;
}

.summary-section .summary-instr {
  font-style: italic;
  color: #15803d;
  margin: 0 0 16px 0;
  font-size: 0.95rem;
}

.summary-section .qitem {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: none;
  border: 1px solid #bbf7d0;
}

.summary-section .qitem:last-child {
  margin-bottom: 0;
}

.summary-section .qitem .q-head {
  display: none; /* Hide Q# label in summary */
}

/* Warning box (red/orange) */
.lesson-content .warning-box {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  color: #991b1b;
  font-size: 0.95rem;
}

/* Tables inside lessons */
.lesson-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.95rem;
}

.lesson-content th,
.lesson-content td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
}

.lesson-content th {
  background: #f1f5f9;
  font-weight: 600;
  color: #1e293b;
}

.lesson-content tr:nth-child(even) {
  background: #f8fafc;
}

/* Blockquotes */
.lesson-content blockquote {
  border-left: 4px solid #cbd5e1;
  margin: 12px 0;
  padding: 12px 16px;
  background: #f8fafc;
  color: #475569;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

/* Code and pre */
.lesson-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  color: #e11d48;
}

.lesson-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 0.9rem;
}

.lesson-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Highlighted/marked text */
.lesson-content mark {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Images */
.lesson-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 12px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Horizontal rule */
.lesson-content hr {
  border: none;
  border-top: 1px dashed #cbd5e1;
  margin: 20px 0;
}

/* Definition list (for vocabulary) */
.lesson-content dl {
  margin: 12px 0;
}

.lesson-content dt {
  font-weight: 700;
  color: #1e293b;
  margin-top: 10px;
}

.lesson-content dd {
  margin: 4px 0 0 20px;
  color: #475569;
}

/* Keyboard keys */
.lesson-content kbd {
  background: #f1f5f9;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.85em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Links */
.lesson-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lesson-content a:hover {
  color: #1d4ed8;
}

/* Strong emphasis - subtle highlight */
.lesson-content strong {
  color: #1e293b;
  font-weight: 700;
}

/* Audio/video placeholders */
.lesson-content .media-placeholder {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: #64748b;
  margin: 12px 0;
}

/* Vocabulary highlight box */
.lesson-content .vocab-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
}

.lesson-content .vocab-word {
  font-weight: 700;
  color: #166534;
}

.lesson-content .vocab-def {
  color: #475569;
  margin-left: 8px;
}

/* Vocabulary Preview Grid */
.vocab-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px;
  background: #f0f7ff;
  border-radius: 8px;
  margin: 10px 0;
}

.vocab-grid span {
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid #e0e0e0;
}

.vocab-grid b {
  color: #1a73e8;
}


/* Vocabulary Table - 2 columns */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.vocab-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  width: 50%;
}

.vocab-table td:first-child {
  color: #1a73e8;
  font-weight: 600;
}

.vocab-table td:last-child {
  color: #4b5563;
}


/* Vocabulary - Minimalist dotted line style (no cards!) */
.vocab-section {
  margin: 8px 0;
}
.vocab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
}
.vocab-item {
  padding: 6px 8px 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px dotted #d1d5db;
  white-space: normal;
  word-wrap: break-word;
}
.vocab-item * {
  display: inline !important;
}
.vocab-item br {
  display: none !important;
}
/* Right column has left padding for visual separation */
.vocab-item:nth-child(2n) {
  padding-left: 16px;
  border-left: 1px dotted #d1d5db;
}
/* Remove bottom border from last row */
.vocab-item:nth-last-child(1),
.vocab-item:nth-last-child(2) {
  border-bottom: none;
}
.vocab-item strong {
  color: #2563eb;
  font-weight: 600;
}
/* Subtle hover highlight */
.vocab-item:hover {
  background: #f8fafc;
}
@media (max-width: 600px) {
  .vocab-grid {
    grid-template-columns: 1fr;
  }
  .vocab-item {
    white-space: normal;
    padding-left: 0;
    border-left: none;
  }
  .vocab-item:nth-last-child(2) {
    border-bottom: 1px dotted #d1d5db;
  }
}


/* ===== TOEFL Prose Summary ===== */
.prose-sum-intro {
  background: #f0f9ff;
  border-left: 3px solid #0284c7;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-style: italic;
  color: #0369a1;
}

.prose-sum-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prose-sum-opt {
  padding: 12px 16px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.prose-sum-opt:has(input:checked) {
  border-color: #3b82f6 !important;
  background: #eff6ff !important;
}

.prose-sum-note {
  margin-top: 12px;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

/* ===== TOEFL Insert Text ===== */
.insert-sentence {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  font-weight: 500;
}

.insert-passage {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.insert-marker {
  display: inline-block;
  background: #3b82f6;
  color: white;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 4px;
}

.insert-prompt {
  font-weight: 600;
  margin-bottom: 12px;
}

.insert-choices {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.insert-opt {
  min-width: 60px;
  text-align: center;
}