/* ============================================================
   EXAM MODE — Cambridge Flyers Gerçek Sınav Formatı
   ============================================================ */

/* ── Sayfa Wrap ──────────────────────────────────────────── */
.exam-page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ── Başlık ──────────────────────────────────────────────── */
.exam-page-header {
  text-align: center;
  margin-bottom: 20px;
}
.exam-page-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6c63ff, #a29bfe);
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.exam-page-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-dark);
  margin: 0 0 6px;
}
.exam-page-inst {
  font-size: 13px;
  color: var(--text-medium);
  font-weight: 600;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Set Seçici ──────────────────────────────────────────── */
.exam-set-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.exam-set-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.18s;
}
.exam-set-btn:hover  { border-color: var(--primary); color: var(--primary); }
.exam-set-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 3px 10px rgba(108,99,255,0.35);
}

/* ── Ana 3 Sütun Layout ──────────────────────────────────── */
.exam-main-layout {
  display: grid;
  grid-template-columns: 130px 1fr 140px;
  gap: 12px;
  align-items: start;
}

/* ── Sol / Sağ Kelime Sütunları ──────────────────────────── */
.exam-words-left,
.exam-words-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 56px; /* kutu başlangıcına hizala */
}
.exam-words-right { padding-top: 56px; }

/* ── Üst / Alt Kelime Satırları ──────────────────────────── */
.exam-words-top,
.exam-words-bottom {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

/* ── Kelime Rozeti ───────────────────────────────────────── */
.exam-word-badge {
  font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-block;
  user-select: none;
}
.exam-word-badge:hover {
  background: rgba(108,99,255,0.08);
  border-color: currentColor;
  transform: translateY(-1px);
}
.exam-word-badge.picked {
  background: rgba(108,99,255,0.15);
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
  transform: translateY(-2px);
}
.exam-word-badge.used {
  opacity: 0.38;
  pointer-events: none;
}

/* ── Orta Sütun ──────────────────────────────────────────── */
.exam-center-col {
  display: flex;
  flex-direction: column;
}

/* ── Sınav Kutusu ────────────────────────────────────────── */
.exam-box {
  background: white;
  border: 2.5px solid #333;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
}

/* ── Örnek Satırı ────────────────────────────────────────── */
.exam-example-row {
  display: grid;
  grid-template-columns: 70px 1fr 160px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9ff;
  border-bottom: 1px solid #ddd;
}
.exam-example-label {
  font-size: 12px;
  font-weight: 800;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.exam-divider {
  height: 2px;
  background: #333;
  margin: 0;
}

/* ── Soru Satırı ─────────────────────────────────────────── */
.exam-question-row {
  display: grid;
  grid-template-columns: 36px 1fr 160px;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #e8e8e8;
  cursor: pointer;
  transition: background 0.12s;
}
.exam-question-row:last-child { border-bottom: none; }
.exam-question-row:hover { background: #fafbff; }
.exam-question-row.has-answer { background: #f0eeff; }
.exam-question-row.correct    { background: #f0fff8 !important; }
.exam-question-row.incorrect  { background: #fff5f5 !important; }

.exam-q-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
  text-align: center;
}

.exam-def-text {
  font-size: 13.5px;
  color: #222;
  line-height: 1.5;
}

/* ── Cevap Alanı ─────────────────────────────────────────── */
.exam-answer-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.exam-dotted-line {
  flex: 1;
  border-bottom: 1.5px dotted #999;
  min-width: 100px;
  height: 24px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
  position: relative;
}
.exam-answer-line {
  font-size: 13px;
  color: #333;
  font-style: italic;
  padding: 0 4px;
}
.exam-answer-line.answered {
  color: #2c3e50;
  font-style: italic;
  font-weight: 700;
}
.eq-filled {
  font-size: 13px;
  font-style: italic;
  color: var(--primary);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.eq-feedback {
  flex-shrink: 0;
}

/* ── Seçim Çubuğu ────────────────────────────────────────── */
.exam-pick-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f0eeff, #e8f4ff);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 10px 18px;
  margin-top: 16px;
  animation: examPickIn 0.2s ease;
}
@keyframes examPickIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.exam-pick-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-medium);
}
.exam-pick-word {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Comic Sans MS', cursive, sans-serif;
}
.exam-pick-clear {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.exam-pick-clear:hover { background: rgba(0,0,0,0.07); }

/* ── Aksiyon Butonları ───────────────────────────────────── */
.exam-action-btns {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ── Tıklama ipucu ───────────────────────────────────────── */
.exam-tip {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
}

/* ============================================================
   PART 2 — Yes / No Styles
   ============================================================ */

/* ── Ana Layout ──────────────────────────────────────────── */
.p2-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}

/* ── Sol: Resim ──────────────────────────────────────────── */
.p2-left { position: sticky; top: 80px; }

.p2-image-wrap {
  border: 3px solid #333;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.p2-scene-img {
  width: 100%;
  display: block;
}

/* Emoji fallback sahne kutusu */
.p2-scene-emoji-box {
  background: linear-gradient(135deg, #f8f9ff, #f0eeff);
  border: 3px solid #333;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}
.p2-scene-emoji {
  font-size: 72px;
  margin-bottom: 12px;
}
.p2-scene-desc {
  font-size: 13px;
  color: var(--text-medium);
  font-style: italic;
  line-height: 1.6;
  text-align: left;
}

/* ── Sağ: Sorular ────────────────────────────────────────── */
.p2-right { }

.p2-section-label {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--border);
}

/* Örnek satırları */
.p2-examples-box {
  background: #f8f9ff;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
}
.p2-example-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}
.p2-example-row:last-child { border-bottom: none; }

.p2-answer-given {
  margin-left: auto;
  font-size: 14px;
  font-weight: 800;
  color: #555;
  font-style: italic;
  flex-shrink: 0;
  min-width: 30px;
  text-align: right;
  border-bottom: 1.5px dotted #aaa;
  padding-bottom: 1px;
}

/* ── Soru Satırı ─────────────────────────────────────────── */
.p2-question-row {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.p2-question-row:last-child { border-bottom: none; }
.p2-question-row.correct   { background: #f0fff8; border-radius: 8px; padding: 10px 8px; }
.p2-question-row.incorrect { background: #fff5f5; border-radius: 8px; padding: 10px 8px; }

.p2-q-num {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-dark);
  text-align: center;
}
.p2-q-text {
  font-size: 13.5px;
  color: #222;
  line-height: 1.5;
}
.p2-fb {
  font-size: 15px;
  flex-shrink: 0;
}

/* ── Yes / No Butonları ──────────────────────────────────── */
.p2-btn-group {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.p2-yn-btn {
  padding: 5px 13px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.15s;
  font-style: italic;
  letter-spacing: 0.3px;
}
.p2-yn-btn:hover    { border-color: var(--primary); color: var(--primary); }
.p2-yn-btn.selected { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 2px 8px rgba(108,99,255,0.3); }
.p2-yn-btn.correct  { background: #00b894; border-color: #00b894; color: white; }
.p2-yn-btn.wrong    { background: #d63031; border-color: #d63031; color: white; opacity: 0.8; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .p2-layout {
    grid-template-columns: 1fr;
  }
  .p2-left { position: static; }
  .p2-question-row {
    grid-template-columns: 24px 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px;
  }
  .p2-btn-group {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
  .p2-fb { grid-column: 3; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .exam-main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .exam-words-left,
  .exam-words-right {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 0;
    gap: 8px;
  }
  .exam-words-right { order: 3; }
  .exam-center-col  { order: 2; }
  .exam-words-left  { order: 1; }

  .exam-question-row {
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
  }
  .exam-answer-cell {
    grid-column: 1 / -1;
    padding-left: 36px;
  }
  .exam-example-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
}

/* ============================================================
   PART 2 — Yes/No Scene Styles
   ============================================================ */
.p2-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.p2-scene-img {
  width: 100%;
  border-radius: 12px;
  border: 2.5px solid #333;
  display: block;
}
.p2-examples-box {
  background: #f8f9ff;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.p2-section-label {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.p2-example-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-style: italic;
  font-size: 13.5px;
  color: #444;
}
.p2-answer-given {
  font-weight: 800;
  color: #2c3e50;
  min-width: 28px;
}
.p2-question-row {
  display: grid;
  grid-template-columns: 28px 1fr auto 28px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  transition: background 0.12s;
}
.p2-question-row:last-child { border-bottom: none; }
.p2-question-row.correct   { background: #f0fff8; border-radius: 8px; }
.p2-question-row.incorrect { background: #fff5f5; border-radius: 8px; }
.p2-q-num {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-dark);
  text-align: center;
}
.p2-q-text {
  font-size: 13.5px;
  color: #222;
  line-height: 1.5;
}
.p2-btn-group {
  display: flex;
  gap: 6px;
}
.p2-yn-btn {
  padding: 5px 13px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: white;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: lowercase;
}
.p2-yn-btn:hover    { border-color: var(--primary); color: var(--primary); }
.p2-yn-btn.selected { background: var(--primary); border-color: var(--primary); color: white; }
.p2-yn-btn.correct  { background: #00b894; border-color: #00b894; color: white; }
.p2-yn-btn.wrong    { background: #d63031; border-color: #d63031; color: white; }
.p2-fb { font-size: 15px; }

@media (max-width: 700px) {
  .p2-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   PART 3 — Dialogue Letter Match Styles
   ============================================================ */
.p3-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}
.p3-scene-img {
  width: 100%;
  border-radius: 12px;
  border: 2.5px solid #333;
  display: block;
  margin-bottom: 14px;
}
.p3-options-box {
  background: white;
  border: 2px solid #333;
  border-radius: 8px;
  overflow: hidden;
}
.p3-option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.p3-option-row:last-child { border-bottom: none; }
.p3-option-row:hover      { background: #f5f3ff; }
.p3-option-row.picked     { background: #ede9fe; border-left: 4px solid var(--primary); }
.p3-option-row.used-correct { background: #f0fff8; border-left: 4px solid #00b894; pointer-events:none; }
.p3-option-row.used-wrong   { background: #fff5f5; opacity: 0.6; pointer-events:none; }
.p3-option-row.show-correct { background: #f0fff8; border-left: 4px solid #00b894; }

.p3-opt-letter {
  font-size: 14px;
  font-weight: 900;
  color: var(--primary);
  min-width: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.p3-opt-text {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
  font-style: italic;
}
.p3-example-badge {
  font-size: 10px;
  font-weight: 800;
  color: #888;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

/* Sağ taraf - diyalog */
.p3-context-box {
  background: #f0eeff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.p3-example-box {
  background: #f8f9ff;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 4px;
}
.p3-section-label {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.p3-dialogue-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
}
.p3-speaker-badge {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  min-width: 90px;
  flex-shrink: 0;
  padding: 3px 0;
}
.speaker-a { color: #e17055; }
.speaker-b { color: #0984e3; }

.p3-q-text {
  font-size: 13.5px;
  color: #222;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.p3-answer-given {
  font-size: 18px;
  font-weight: 900;
  color: #2c3e50;
  min-width: 28px;
}
.p3-q-block {
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
}
.p3-q-block.correct   { background: #f0fff8; }
.p3-q-block.incorrect { background: #fff5f5; }
.p3-q-block.has-answer { background: #f0eeff; }

.p3-answer-row {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 0 0 8px 8px;
  transition: background 0.12s;
  border-top: 1px dashed #ddd;
  min-height: 44px;
  align-items: center;
}
.p3-answer-row:hover { background: rgba(108,99,255,0.07); }

.p3-dotted-ans {
  font-size: 13px;
  color: #aaa;
  letter-spacing: 2px;
  min-width: 80px;
  transition: all 0.2s;
}
.p3-q-fb {
  font-size: 13px;
  margin-left: 6px;
  flex-shrink: 0;
  align-self: center;
}
.p3-fb-correct {
  font-size: 12px;
  color: #00b894;
  font-weight: 700;
}
.p3-fb-correct em {
  font-style: italic;
  font-weight: 400;
  opacity: 0.85;
}

/* ── Cevap baloncuğu: HARF + TAM METİN ──────────────── */
.p3-ans-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* Harf rozeti — boşken görünmez */
.p3-ans-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
  background: transparent;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.18s;
}

/* Harf seçilince → mor rozet */
.p3-ans-letter-filled {
  background: #6c5ce7;
  color: #fff;
  box-shadow: 0 2px 6px rgba(108,92,231,0.35);
  padding: 0 6px;
  min-width: 28px;
}

/* Boş durum — noktalı yer tutucu */
.p3-ans-bubble:not(.p3-ans-filled) .p3-ans-text {
  font-size: 13px;
  color: #bbb;
  letter-spacing: 3px;
}

/* Dolu durum — tam metin */
.p3-ans-bubble.p3-ans-filled .p3-ans-text {
  font-size: 14px;
  color: var(--text);
  font-style: italic;
  line-height: 1.45;
  white-space: normal;
}

/* Doğru → harf rozeti yeşil */
.p3-q-block.correct   .p3-ans-letter-filled { background: #00b894; }
/* Yanlış → harf rozeti kırmızı */
.p3-q-block.incorrect .p3-ans-letter-filled { background: #d63031; }

.p3-ans-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
}
.p3-ans-letter-filled {
  width: 28px;
  height: 28px;
  background: #6c5ce7;
  box-shadow: 0 2px 6px rgba(108,92,231,0.4);
  animation: p3-letter-pop 0.2s ease;
}
@keyframes p3-letter-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1);   opacity: 1; }
}

.p3-ans-text {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: color 0.2s;
  line-height: 1.45;
}

/* Seçili harf çubuğu */
.p3-pick-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #5f3dc4, #845ef7);
  border-radius: 12px;
  padding: 10px 16px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 3px 12px rgba(95,61,196,0.35);
  animation: examPickIn 0.2s ease;
}
.p3-pick-letter {
  font-size: 22px;
  font-weight: 900;
  color: #ffd43b;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p3-pick-text {
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  font-style: italic;
  flex: 1;
}
.p3-pick-bar button {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-light);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.p3-pick-bar button:hover { background: rgba(0,0,0,0.07); }

@media (max-width: 760px) {
  .p3-layout { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   PART 4 — Story Gap-Fill
═══════════════════════════════════════════════════════ */

/* Two-column layout */
.p4-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── LEFT column ─────────────────────────────────────── */
.p4-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.p4-scene-img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 220px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.p4-scene-placeholder {
  width: 100%;
  height: 160px;
  background: #f3f0ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

/* Word box */
.p4-word-box-wrap {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.p4-word-box-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.p4-word-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p4-word-btn {
  background: #f0eeff;
  border: 2px solid #c4b5f7;
  color: #5f3dc4;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.p4-word-btn:hover:not(:disabled) {
  background: #e0d4ff;
  border-color: #845ef7;
}
.p4-word-btn.picked {
  background: #5f3dc4;
  color: #fff;
  border-color: #5f3dc4;
  box-shadow: 0 2px 8px rgba(95,61,196,0.35);
}
.p4-word-btn.used {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.p4-word-example {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #868e96;
  font-style: italic;
}

/* Pick bar */
.p4-pick-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #5f3dc4;
  color: #fff;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
}
.p4-pick-bar strong { font-size: 15px; }
.p4-pick-cancel {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p4-pick-cancel:hover { background: rgba(255,255,255,0.35); }

/* ── RIGHT column ────────────────────────────────────── */
.p4-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Story box */
.p4-story-box {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.p4-story-example-note {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 0 10px;
}

.p4-story-para {
  font-size: 15px;
  line-height: 2;
  color: var(--text);
  margin: 0;
}

.p4-story-text { /* plain story text */ }

/* In-story gap markers */
.p4-gap {
  display: inline-block;
  background: #f3f0ff;
  border: 2px dashed #c4b5f7;
  color: #5f3dc4;
  font-weight: 700;
  border-radius: 6px;
  padding: 0 8px;
  margin: 0 2px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 60px;
  text-align: center;
}
.p4-gap:hover {
  background: #e0d4ff;
  border-color: #845ef7;
}
.p4-gap-filled {
  background: #e0f0ff;
  border-color: #74c0fc;
  border-style: solid;
  color: #1971c2;
}
.p4-gap-example {
  display: inline-block;
  background: #e9ecef;
  border: 2px solid #adb5bd;
  color: #495057;
  font-weight: 700;
  border-radius: 6px;
  padding: 0 8px;
  margin: 0 2px;
  font-style: italic;
}

/* Answer slots 1–5 */
.p4-answer-slots {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.p4-slot-row {
  display: grid;
  grid-template-columns: 30px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.p4-slot-row:last-child { border-bottom: none; }
.p4-slot-row:hover { background: #f8f7ff; }
.p4-slot-row.correct   { background: #f0fff8; }
.p4-slot-row.incorrect { background: #fff5f5; }

.p4-slot-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
}

.p4-slot-line {
  font-size: 15px;
  font-weight: 600;
  color: #5f3dc4;
  border-bottom: 2px dotted #c4b5f7;
  padding-bottom: 2px;
}
.p4-slot-line.filled { border-bottom-style: solid; border-color: #845ef7; }

.p4-slot-fb { font-size: 13px; }
.p4-correct-ans {
  font-size: 12px;
  color: #00b894;
  font-weight: 800;
}

/* Title section — Q6 */
.p4-title-section {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.p4-title-question {
  font-size: 14px;
  margin: 0 0 12px;
  color: var(--text);
}
.p4-title-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.p4-title-btn {
  background: #f8f7ff;
  border: 2px solid #c4b5f7;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.p4-title-btn:hover { background: #e0d4ff; border-color: #845ef7; }
.p4-title-btn.picked {
  background: #5f3dc4;
  color: #fff;
  border-color: #5f3dc4;
}
.p4-title-btn.p4-title-correct {
  background: #d4edda;
  border-color: #00b894;
  color: #00b894;
  font-weight: 700;
}
.p4-title-btn.p4-title-wrong {
  background: #fde8e8;
  border-color: #d63031;
  color: #d63031;
  text-decoration: line-through;
}

/* Check button */
.p4-check-btn {
  align-self: flex-start;
}

@media (max-width: 760px) {
  .p4-layout { grid-template-columns: 1fr; }
  .p4-left { order: 1; }
  .p4-right { order: 0; }
}

/* ═══════════════════════════════════════════════════════
   PART 5 — Story Reading + Open Answer + Sync TTS
═══════════════════════════════════════════════════════ */

.p5-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ── LEFT: story card ─────────────────────────────── */
.p5-left { display: flex; flex-direction: column; gap: 0; }

.p5-story-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.p5-story-title {
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  margin: 0;
  padding: 14px 20px 10px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.p5-scene-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* TTS control bar */
.p5-tts-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f8f7ff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.p5-tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(108,92,231,0.3);
}
.p5-tts-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(108,92,231,0.4); }

.p5-tts-stop {
  background: linear-gradient(135deg, #e17055, #d63031);
  box-shadow: 0 2px 8px rgba(214,48,49,0.3);
}
.p5-tts-stop:hover { box-shadow: 0 4px 14px rgba(214,48,49,0.4); }

.p5-tts-hint {
  font-size: 11px;
  color: var(--text-light);
  font-style: italic;
  margin-left: auto;
}

/* Story text area */
.p5-story-text {
  padding: 16px 20px 20px;
  max-height: 420px;
  overflow-y: auto;
}

.p5-para {
  font-size: 14px;
  line-height: 2;
  color: var(--text);
  margin: 0 0 12px;
}
.p5-para:last-child { margin-bottom: 0; }

/* Individual word spans — default */
.p5-word {
  display: inline;
  border-radius: 3px;
  padding: 1px 0;
  transition: background 0.08s, color 0.08s;
  cursor: default;
}

/* ✨ THE HIGHLIGHT — fired by TTS boundary event */
.p5-word-active {
  background: #ffd43b;
  color: #1a1a2e;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 3px;
  box-shadow: 0 0 0 2px #fab005;
  animation: p5-pop 0.12s ease;
}

@keyframes p5-pop {
  0%   { transform: scale(1);    }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1);    }
}

/* ── RIGHT: QA card ───────────────────────────────── */
.p5-right { display: flex; flex-direction: column; }

.p5-qa-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.p5-section-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 10px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}

/* Examples */
.p5-example-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-medium);
  font-style: italic;
}
.p5-q-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-light);
  white-space: nowrap;
  min-width: 58px;
}
.p5-example-ans {
  display: inline-block;
  border-bottom: 2px solid #adb5bd;
  padding: 0 6px;
  font-weight: 700;
  color: #495057;
  font-style: normal;
}
.p5-q-after {
  color: var(--text-medium);
  font-style: italic;
  margin-left: 4px;
}

/* Questions */
.p5-question-row {
  display: grid;
  grid-template-columns: 26px 1fr 28px;
  align-items: start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.p5-question-row:last-of-type { border-bottom: none; }
.p5-question-row.correct   { background: #f0fff8; border-radius: 8px; padding: 8px 8px; }
.p5-question-row.incorrect { background: #fff5f5; border-radius: 8px; padding: 8px 8px; }

.p5-q-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  padding-top: 6px;
}

.p5-q-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  font-size: 14px;
  line-height: 1.7;
}

.p5-q-text {
  color: var(--text);
}

/* Free-text input */
.p5-answer-input {
  border: none;
  border-bottom: 2px solid #c4b5f7;
  background: transparent;
  color: #5f3dc4;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  min-width: 140px;
  max-width: 220px;
  padding: 2px 4px;
  transition: border-color 0.15s;
}
.p5-answer-input::placeholder {
  color: #c4b5f7;
  font-weight: 400;
  font-style: italic;
  font-size: 12px;
}
.p5-answer-input:focus { border-bottom-color: #845ef7; }
.p5-answer-input:disabled { cursor: not-allowed; }

.p5-input-correct {
  border-bottom-color: #00b894 !important;
  color: #00b894 !important;
}
.p5-input-wrong {
  border-bottom-color: #d63031 !important;
  color: #d63031 !important;
  text-decoration: line-through;
}

.p5-q-fb { font-size: 13px; padding-top: 4px; }
.p5-fb-ans {
  font-size: 12px;
  color: #00b894;
  font-weight: 700;
  white-space: nowrap;
}

.p5-check-btn { align-self: flex-start; }

@media (max-width: 860px) {
  .p5-layout { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   PART 6 — Choose the Right Word
   • Turkish tooltip bar on word tap
   • Inline 3-choice popup on gap click
   • Feedback explanation on wrong answer
═══════════════════════════════════════════════════════ */

/* Two-column layout: passage left, sidebar right */
.p6-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

/* ── Floating Turkish Tooltip Bar ─────────────────── */
.p6-tooltip-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 15px;
  box-shadow: 0 4px 18px rgba(108,92,231,0.35);
  margin-bottom: 16px;
  min-height: 46px;
}
.p6-tip-icon { font-size: 18px; }
.p6-tip-en {
  font-weight: 800;
  font-size: 16px;
  text-transform: lowercase;
  min-width: 60px;
}
.p6-tip-arrow { opacity: 0.8; font-size: 16px; }
.p6-tip-tr {
  font-size: 14px;
  font-style: italic;
  opacity: 0.92;
}

@keyframes p6-bar-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.p6-bar-pop { animation: p6-bar-pop 0.25s ease; }

/* ── Passage card ─────────────────────────────────── */
.p6-passage-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07);
}

.p6-passage-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px 10px;
  border-bottom: 2px solid var(--border);
  background: #f8f7ff;
}
.p6-passage-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  text-align: center;
}
.p6-passage-img {
  height: 56px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
}

.p6-passage-body {
  padding: 20px 26px 24px;
  font-size: 15px;
  line-height: 2.8;
  color: var(--text);
}

/* ── Tooltip-enabled words ───────────────────────── */
.p6-word {
  cursor: pointer;
  border-bottom: 1.5px dotted #b197fc;
  border-radius: 3px;
  padding: 0 1px;
  transition: background 0.12s, color 0.12s;
}
.p6-word:hover,
.p6-word:focus { background: #f0ecff; color: #5f3dc4; outline: none; }
.p6-word-tap {
  background: #d8ccff !important;
  color: #3b1fa3 !important;
  border-radius: 4px;
}
.p6-word-plain { }

/* ── Example gap (pre-filled) ────────────────────── */
.p6-gap-example {
  display: inline-block;
  background: #e9ecef;
  border: 2px solid #adb5bd;
  color: #495057;
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 10px;
  margin: 0 3px;
  font-style: italic;
  font-size: 14px;
  vertical-align: middle;
}

/* ── Gap wrapper (gap-btn + popup together) ──────── */
.p6-gap-wrap {
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

/* ── Interactive gap button ──────────────────────── */
.p6-gap-btn {
  display: inline-block;
  background: #f3efff;
  border: 2px dashed #845ef7;
  color: #5f3dc4;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  padding: 3px 14px;
  margin: 0 2px;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
  min-width: 96px;
  text-align: center;
}
.p6-gap-btn:hover {
  background: #e0d4ff;
  border-color: #5f3dc4;
  box-shadow: 0 2px 8px rgba(95,61,196,0.22);
  transform: translateY(-1px);
}
.p6-gap-btn.p6-gap-open {
  background: #5f3dc4;
  color: #fff;
  border-style: solid;
  box-shadow: 0 3px 12px rgba(95,61,196,0.45);
  transform: translateY(-1px);
}
.p6-gap-btn.p6-gap-filled {
  border-style: solid;
  background: #e0f0ff;
  border-color: #74c0fc;
  color: #1971c2;
}
.p6-gap-btn.p6-gap-correct {
  background: #d4edda;
  border-color: #00b894;
  border-style: solid;
  color: #00b894;
  font-weight: 800;
}
.p6-gap-btn.p6-gap-wrong {
  background: #fde8e8;
  border-color: #d63031;
  border-style: solid;
  color: #d63031;
}
.p6-gap-wrongtext { text-decoration: line-through; font-size: 12px; }
.p6-gap-chosen { font-weight: 700; }

/* ── 3-Choice Popup ──────────────────────────────── */
.p6-popup {
  display: none;        /* hidden by default */
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 2px solid #845ef7;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 8px 28px rgba(95,61,196,0.22);
  white-space: nowrap;
}
.p6-popup.p6-popup-open {
  display: inline-flex;
  animation: p6-popup-in 0.15s ease;
}
@keyframes p6-popup-in {
  from { opacity: 0; transform: translateX(-50%) scale(0.88) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) scale(1)    translateY(0); }
}

.p6-opt-btn {
  background: #f3efff;
  border: 2px solid #c4b5f7;
  color: #5f3dc4;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.p6-opt-btn:hover {
  background: #5f3dc4;
  color: #fff;
  border-color: #5f3dc4;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(95,61,196,0.3);
}
.p6-popup-close {
  background: none;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  font-size: 15px;
  padding: 3px 5px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.1s;
}
.p6-popup-close:hover { color: #d63031; background: #fde8e8; }

/* ── Inline wrong-answer feedback ────────────────── */
.p6-inline-fb {
  display: block;
  background: #fff8e1;
  border-left: 4px solid #fab005;
  border-radius: 0 8px 8px 0;
  padding: 6px 12px;
  font-size: 13px;
  color: #495057;
  line-height: 1.65;
  margin: 4px 0 4px 6px;
  animation: p6-fb-in 0.22s ease;
  max-width: 440px;
}
@keyframes p6-fb-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.p6-fb-correct {
  font-weight: 800;
  color: #00b894;
  margin-right: 8px;
  font-size: 14px;
}
.p6-fb-explain {
  color: #495057;
  font-size: 13px;
  display: block;
  margin-top: 2px;
}

/* ── Sidebar ─────────────────────────────────────── */
.p6-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.p6-progress-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.p6-progress-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.p6-progress-count {
  font-size: 32px;
  font-weight: 800;
  color: #5f3dc4;
  line-height: 1;
  margin-bottom: 10px;
}
.p6-progress-count span {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 400;
}
.p6-progress-bar-wrap {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.p6-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.p6-check-btn { width: 100%; justify-content: center; }

.p6-tip-note {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  background: #f8f7ff;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}

/* ── Gap dots animation ──────────────────────────── */
.p6-gap-dots {
  display: inline-block;
  letter-spacing: 2px;
  animation: p6-dots-pulse 1.5s ease-in-out infinite;
}
@keyframes p6-dots-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
.p6-gap-btn.p6-gap-filled .p6-gap-dots,
.p6-gap-btn.p6-gap-open   .p6-gap-dots { animation: none; }

@media (max-width: 860px) {
  .p6-layout { grid-template-columns: 1fr; }
  .p6-sidebar { position: static; }
  .p6-passage-img { display: none; }
}

/* ═══════════════════════════════════════════════════════
   PART 7 — Email / Letter Gap-Fill (Write ONE word)
═══════════════════════════════════════════════════════ */

.p7-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── LEFT column ─────────────────────────────────────── */
.p7-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.p7-scene-img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 200px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.12);
}

.p7-side-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.p7-prog-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}
.p7-prog-count {
  font-size: 30px;
  font-weight: 800;
  color: #6c5ce7;
  line-height: 1;
}
.p7-prog-count span {
  font-size: 15px;
  color: var(--text-light);
  font-weight: 400;
}
.p7-prog-bar-wrap {
  height: 7px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.p7-prog-bar {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.p7-check-btn { width: 100%; justify-content: center; margin-top: 4px; }
.p7-hint {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.65;
  background: #f8f7ff;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0;
}

/* ── RIGHT column — email card ───────────────────────── */
.p7-right { display: flex; flex-direction: column; }

.p7-email-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07);
  overflow: hidden;
}

.p7-email-type-badge {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 20px;
  letter-spacing: 0.5px;
}

.p7-greeting {
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  padding: 14px 24px 0;
  margin: 0;
}

.p7-email-body {
  padding: 8px 24px 16px;
}

/* Example label row */
.p7-example-label-row {
  margin-bottom: 2px;
}
.p7-ex-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  background: #f0ecff;
  border-radius: 4px;
  padding: 2px 8px;
}

/* Email lines */
.p7-email-line {
  font-size: 15px;
  line-height: 2.6;
  color: var(--text);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.p7-example-line { color: var(--text-medium); font-style: italic; }

.p7-text { display: inline; }

/* Pre-filled example gap */
.p7-example-gap {
  display: inline-block;
  background: #e9ecef;
  border: 2px solid #adb5bd;
  color: #495057;
  font-weight: 700;
  font-style: normal;
  border-radius: 6px;
  padding: 1px 10px;
  margin: 0 2px;
  min-width: 60px;
  text-align: center;
}

/* Gap wrapper */
.p7-gap-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}

/* Gap number badge */
.p7-gap-num {
  font-size: 11px;
  font-weight: 800;
  background: #6c5ce7;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Text input */
.p7-gap-input {
  border: none;
  border-bottom: 2.5px solid #c4b5f7;
  background: transparent;
  color: #5f3dc4;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  min-width: 100px;
  max-width: 160px;
  padding: 2px 6px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
  border-radius: 4px 4px 0 0;
}
.p7-gap-input:focus {
  border-bottom-color: #845ef7;
  background: #f8f5ff;
}
.p7-gap-input::placeholder {
  color: #c4b5f7;
  font-weight: 400;
  letter-spacing: 4px;
  font-style: italic;
  font-size: 12px;
}
.p7-gap-input:disabled { cursor: not-allowed; }

/* Correct / wrong states */
.p7-input-correct {
  border-bottom-color: #00b894 !important;
  color: #00b894 !important;
  background: #f0fff8 !important;
}
.p7-input-wrong {
  border-bottom-color: #d63031 !important;
  color: #d63031 !important;
  background: #fff5f5 !important;
  text-decoration: line-through;
}
.p7-gap-wrap.p7-correct .p7-gap-num { background: #00b894; }
.p7-gap-wrap.p7-wrong   .p7-gap-num { background: #d63031; }

/* Feedback icons / text */
.p7-gap-fb {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}
.p7-icon-ok { color: #00b894; font-size: 15px; }
.p7-fb-correct {
  font-size: 12px;
  font-weight: 800;
  color: #00b894;
  background: #d4edda;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* Explanation block — below the gap wrap, displayed as block */
.p7-fb-explain {
  display: block;
  font-size: 12px;
  color: #495057;
  background: #fff8e1;
  border-left: 4px solid #fab005;
  border-radius: 0 6px 6px 0;
  padding: 6px 12px;
  margin: 2px 0 6px 25px;
  line-height: 1.6;
  animation: p7-fb-in 0.2s ease;
}
@keyframes p7-fb-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.p7-closing {
  font-size: 14px;
  font-style: italic;
  color: var(--text-medium);
  padding: 0 24px 18px;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

@media (max-width: 760px) {
  .p7-layout { grid-template-columns: 1fr; }
  .p7-left { position: static; }
  .p7-scene-img { max-height: 160px; }
}
