/* ==========================================================================
   telc B1 Opinion Dialogs - Stylesheet
   Modern, responsive, touch-friendly with dedicated A4 flashcard print engine
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --teal: #0d9488;
  --teal-light: #f0fdfa;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --rose: #e11d48;
  --rose-light: #fff1f2;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --card-bg: #ffffff;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --font-ar: 'Cairo', system-ui, sans-serif;
  --font-de: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ar);
  background: #f8fafc;
  color: var(--slate-800);
  line-height: 1.6;
  direction: rtl;
  padding-bottom: max(80px, env(safe-area-inset-bottom));
}

/* ---------------- App Header ---------------- */
.app-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  padding: max(16px, env(safe-area-inset-top)) 20px 16px;
  box-shadow: 0 4px 20px rgba(37,99,235,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2.2rem;
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-group h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.brand-group p {
  font-size: 0.8rem;
  color: #bfdbfe;
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-nav:hover {
  background: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

.btn-print {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.btn-print:hover {
  background: #059669 !important;
}

.voice-select {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}
.voice-select option {
  background: #1e293b;
  color: #fff;
}

/* ---------------- Container ---------------- */
.container {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------------- TELC Exam Training Hub ---------------- */
.telc-hub-section {
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
  margin-bottom: 8px;
}

.telc-hub-header {
  margin-bottom: 12px;
}

.telc-hub-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telc-hub-title .hub-icon {
  font-size: 2rem;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.telc-hub-title h3 {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: 2px;
}

.telc-hub-title p {
  font-size: 0.84rem;
  color: #64748b;
  font-weight: 600;
}

.telc-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.telc-hub-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.telc-hub-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.15);
}

.telc-hub-card.active {
  background: #eff6ff;
  border-color: #2563eb;
  border-width: 2px;
}

.hub-card-icon {
  font-size: 1.8rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hub-card-info {
  flex: 1;
  min-width: 0;
}

.hub-card-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  color: #2563eb;
  background: #dbeafe;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
}

.hub-card-info h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
  line-height: 1.3;
}

.hub-card-info p {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.3;
}

.hub-card-status {
  font-size: 0.72rem;
  font-weight: 800;
  color: #1e40af;
  background: #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.hub-card-go {
  font-size: 0.72rem;
  font-weight: 800;
  color: #2563eb;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ---------------- Exam Strategy Hero ---------------- */
.exam-hero {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1.5px solid #dbeafe;
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.exam-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.badge-pill {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
}

.btn-toggle-info {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--slate-700);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-toggle-info:hover {
  background: #e2e8f0;
}

.strategy-content {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exam-rule-card {
  background: #fafaf9;
  border-right: 4px solid #f59e0b;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.65;
}
.exam-rule-card h3 {
  font-size: 1rem;
  color: #92400e;
  margin-bottom: 6px;
}

/* 5-Step Formula Grid */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.formula-card {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
  transition: transform 0.2s;
}
.formula-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
}
.f-num {
  width: 26px;
  height: 26px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.f-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--slate-900);
  margin-bottom: 4px;
}
.f-code {
  font-family: var(--font-de);
  font-size: 0.76rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 3px 6px;
  border-radius: 4px;
  direction: ltr;
  display: inline-block;
  margin-bottom: 6px;
}
.f-desc {
  font-size: 0.76rem;
  color: var(--slate-600);
  line-height: 1.45;
}

/* Redemittel Box */
.redemittel-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 680px) {
  .redemittel-box {
    grid-template-columns: 1fr;
  }
}
.redemittel-col {
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.col-pro {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.col-contra {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.col-head h4 {
  font-size: 0.92rem;
  font-weight: 800;
}
.col-pro h4 { color: #166534; }
.col-contra h4 { color: #991b1b; }
.redemittel-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.redemittel-col li {
  line-height: 1.4;
}

/* ---------------- Topic Ribbon ---------------- */
.topic-ribbon-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
}
.ribbon-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ribbon-head h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--slate-800);
}
.badge-count {
  background: #e2e8f0;
  color: var(--slate-700);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.topic-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.topic-chip {
  flex-shrink: 0;
  background: #f8fafc;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  max-width: 220px;
}
.topic-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.topic-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37,99,235,0.18);
}
.chip-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}
.chip-title-de {
  font-family: var(--font-de);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--slate-900);
  direction: ltr;
  text-align: left;
}
.chip-title-ar {
  font-size: 0.74rem;
  color: var(--slate-600);
  margin-top: 2px;
}

/* ---------------- Active Card Section ---------------- */
.active-card-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Authentic Exam Card Replica (Like the Gray Bubble in User's Photo) */
.exam-task-replica {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.replica-header {
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.replica-meta {
  font-family: var(--font-de);
  font-weight: 800;
  color: #475569;
  font-size: 0.88rem;
  direction: ltr;
}
.replica-submeta {
  font-size: 0.78rem;
  color: #64748b;
  font-style: italic;
  direction: ltr;
}

/* The Authentic Grey Prompt Bubble */
.exam-bubble-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 20px 0;
}
.exam-bubble {
  background: #f1f5f9;
  border: 2px dashed #94a3b8;
  border-radius: 50px;
  padding: 16px 40px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}
.bubble-title {
  font-family: var(--font-de);
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  direction: ltr;
}
.bubble-sub {
  font-size: 0.85rem;
  color: #475569;
  margin-top: 4px;
}

/* Vocabulary & Adjectives Chips Bank (Directly from User's uploaded photo) */
.adj-bank-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}
.adj-bank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.adj-bank-head h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}
.adj-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.adj-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.adj-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-1px);
}
.adj-de {
  font-family: var(--font-de);
  font-weight: 700;
  color: #1e3a8a;
  direction: ltr;
}
.adj-ar {
  color: #64748b;
  font-size: 0.74rem;
}
.adj-comp {
  font-size: 0.7rem;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-de);
  direction: ltr;
}

/* ---------------- Dialogue Transcript Box ---------------- */
.dialogue-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.dialogue-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}
.dialogue-title-group h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}
.dialogue-title-group p {
  font-size: 0.78rem;
  color: #64748b;
}

/* Dialogue Tabs (Weil Exam formula vs Extended dialogue) */
.dialog-tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dialog-tab-btn {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.dialog-tab-btn.active {
  background: #f59e0b;
  border-color: #d97706;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.dialog-tab-btn#tabExtended.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.weil-pattern-badge {
  display: inline-block;
  font-size: 0.74rem;
  color: #b45309;
  background: #fef3c7;
  border: 1px dashed #f59e0b;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 6px;
  direction: ltr;
  text-align: left;
}

/* Print mode selector */
.print-mode-selector-row {
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.print-mode-label {
  font-weight: 800;
  color: #92400e;
  font-size: 0.85rem;
}
.print-mode-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.print-mode-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: #78350f;
}

.dialogue-actions {
  display: flex;
  gap: 8px;
}
.btn-action {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--slate-700);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn-action:hover {
  background: #e2e8f0;
}
.btn-print-pair {
  background: #0d9488 !important;
  color: #fff !important;
  border-color: #0f766e !important;
}
.btn-print-pair:hover {
  background: #0f766e !important;
  transform: translateY(-1px);
}
.btn-play-all {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #1d4ed8 !important;
}
.btn-play-all:hover {
  background: #1d4ed8 !important;
}

/* Custom Selection Modal Box */
.custom-topics-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 8px;
}
.custom-topics-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.custom-summary-text {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
}
.custom-quick-actions {
  display: flex;
  gap: 6px;
}
.btn-micro {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-micro:hover {
  background: #e2e8f0;
}
.custom-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}
@media (max-width: 580px) {
  .custom-checkbox-grid {
    grid-template-columns: 1fr;
  }
}
.custom-topic-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.custom-topic-item:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.custom-topic-item input {
  cursor: pointer;
}
.custom-topic-item .t-idx {
  font-weight: 800;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.72rem;
}
.custom-topic-item .t-de {
  font-weight: 700;
  font-family: var(--font-de);
  direction: ltr;
  color: #1e293b;
  flex: 1;
  text-align: left;
}

/* Dialogue Speech Bubbles */
.dialogue-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.speech-turn {
  display: flex;
  gap: 12px;
  max-width: 92%;
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.turn-speaker-a {
  align-self: flex-start;
}
.turn-speaker-b {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.turn-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.avatar-a {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.avatar-b {
  background: linear-gradient(135deg, #0d9488, #0f766e);
}

.turn-bubble {
  border-radius: 16px;
  padding: 14px 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.bubble-a {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-top-right-radius: 4px;
}
.bubble-b {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-top-left-radius: 4px;
}

.turn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 10px;
}
.turn-name {
  font-size: 0.8rem;
  font-weight: 800;
}
.turn-name-a { color: #1e40af; }
.turn-name-b { color: #115e59; }

.turn-btn-play {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.turn-btn-play:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.turn-text-de {
  font-family: var(--font-de);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.55;
  color: #0f172a;
  direction: ltr;
  text-align: left;
}

.turn-text-ar {
  font-size: 0.85rem;
  color: #334155;
  margin-top: 8px;
  line-height: 1.5;
  border-top: 1px dashed rgba(0,0,0,0.08);
  padding-top: 6px;
}

.turn-tip {
  margin-top: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.73rem;
  color: #92400e;
  font-weight: 700;
}

/* Highlight for Grammar rules inside German text */
.weil-highlight {
  background: #fef08a;
  color: #854d0e;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}
.verb-end-highlight {
  background: #bbf7d0;
  color: #166534;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 800;
  text-decoration: underline;
}

/* ---------------- 1-Minute Monologue Collapse ---------------- */
.monologue-accordion {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  margin-top: 14px;
  overflow: hidden;
}
.mono-head {
  padding: 12px 16px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.88rem;
}
.mono-body {
  padding: 16px;
  display: none;
  font-size: 0.88rem;
  line-height: 1.6;
}
.mono-body.open {
  display: block;
}
.mono-de {
  font-family: var(--font-de);
  font-weight: 600;
  direction: ltr;
  text-align: left;
  color: #1e293b;
  margin-bottom: 8px;
}

/* ---------------- Roleplay Section ---------------- */
.roleplay-section {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 20px;
}
.roleplay-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.rp-info h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 4px;
}
.rp-info p {
  font-size: 0.82rem;
  color: #047857;
  max-width: 550px;
}
.rp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-rp {
  background: #fff;
  border: 1.5px solid #6ee7b7;
  color: #065f46;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-rp:hover, .btn-rp.active {
  background: #10b981;
  color: #fff;
  border-color: #059669;
}

/* ---------------- Modal Backdrop ---------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-head h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}
.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #64748b;
  cursor: pointer;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.print-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.print-option-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s;
}
.print-option-card:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}
.print-option-card input {
  margin-top: 3px;
}
.print-option-card strong {
  display: block;
  font-size: 0.9rem;
  color: #0f172a;
}
.print-option-card span {
  font-size: 0.78rem;
  color: #64748b;
}

.eco-toggle-wrap {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px;
}
.eco-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: #166534;
  cursor: pointer;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-secondary {
  background: #e2e8f0;
  color: #334155;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

/* ==========================================================================
   PRINT ENGINE (Half-A4 Split Role-Cards: Rolle A & Rolle B)
   Optimized for 2 topics per A4 page (A5 each), zero Arabic in dialogue,
   vertical scissor cut line, and separate adjectives box with Arabic translation
   ========================================================================== */
.print-container {
  display: none;
}

@page {
  size: A4 portrait;
  margin: 5mm 6mm;
}

@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 8pt !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  }

  .app-header,
  .exam-hero,
  .topic-ribbon-section,
  .active-card-section,
  .roleplay-section,
  .modal-backdrop {
    display: none !important;
  }

  .print-container {
    display: block !important;
    width: 100% !important;
  }

  /* Full A4 page wrapper holding exactly 2 half-page topics (A5) */
  .print-a4-page {
    width: 100%;
    page-break-after: always;
    break-after: page;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3mm;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Half-A4 Topic Sheet (A5) - Guaranteed to fit 2 per page */
  .print-half-a4-topic {
    width: 100%;
    max-height: 135mm;
    box-sizing: border-box;
    border: 1.5px solid #000000;
    border-radius: 4px;
    padding: 2mm 3mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 2mm;
  }

  /* Top metadata bar of the topic */
  .print-topic-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000;
    padding-bottom: 1mm;
    margin-bottom: 1mm;
    font-size: 7.2pt;
    font-weight: 700;
  }
  .meta-exam {
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  .meta-title {
    font-size: 8pt;
    font-weight: 800;
  }
  .meta-badge {
    border: 1px solid #000;
    padding: 0 3px;
    border-radius: 2px;
    font-size: 6.8pt;
  }

  /* Split Columns Layout (Left = Rolle A, Middle = Scissor, Right = Rolle B) */
  .print-split-columns {
    display: grid;
    grid-template-columns: 1fr 7mm 1fr;
    gap: 1.5mm;
    box-sizing: border-box;
  }

  /* Individual Role Card (A or B) */
  .print-role-card {
    border: 1px solid #000000;
    border-radius: 3px;
    padding: 2mm 2.5mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    background: #ffffff !important;
  }

  .role-card-head {
    border-bottom: 1px dashed #000;
    padding-bottom: 1mm;
    margin-bottom: 1mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .role-card-badge {
    font-size: 8.2pt;
    font-weight: 800;
  }
  .role-card-title {
    font-size: 8.2pt;
    font-weight: 800;
    direction: ltr;
  }

  /* Dialogue Body: Pure German, Zero Arabic, 100% Complete Text */
  .role-dialogue-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8mm;
    margin-bottom: 1mm;
  }

  /* Active Role: Bold & prominent text with left border */
  .turn-active-role {
    font-size: 8.2pt;
    line-height: 1.2;
    direction: ltr;
    text-align: left;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    border-left: 2.2px solid #000000;
    padding-left: 3px;
    margin-bottom: 0.8mm;
    background: #ffffff !important;
  }
  .turn-active-role strong.speaker-tag {
    font-weight: 800;
    color: #000;
    font-size: 8.4pt;
    margin-right: 2px;
  }

  /* Partner Role: Full complete text so partner can follow along */
  .turn-partner-role {
    font-size: 7.2pt;
    line-height: 1.15;
    direction: ltr;
    text-align: left;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    color: #333333 !important;
    background: #f8fafc !important;
    padding: 1px 3px;
    border-radius: 2px;
    margin-bottom: 0.8mm;
  }
  .turn-partner-role .speaker-tag {
    font-weight: 700;
    font-size: 7.2pt;
    color: #555555 !important;
    margin-right: 2px;
  }

  /* Dedicated Adjectives & Vocabulary Box WITH Arabic Translation */
  .role-vocab-box {
    border-top: 1px solid #000;
    padding-top: 1mm;
    margin-top: 0.8mm;
    font-size: 7pt;
    line-height: 1.18;
  }
  .role-vocab-title {
    font-weight: 800;
    margin-bottom: 0.5mm;
    font-size: 7.2pt;
  }
  .role-vocab-pills {
    display: block;
    word-break: break-word;
  }
  .p-vocab-item {
    display: inline-block;
    margin-right: 3px;
  }
  .p-vocab-item strong {
    font-weight: 800;
    direction: ltr;
  }
  .p-vocab-item small {
    font-size: 6.5pt;
    direction: ltr;
  }

  .role-card-foot {
    border-top: 1px dashed #888;
    padding-top: 0.8mm;
    margin-top: 0.6mm;
    font-size: 6.5pt;
    color: #222 !important;
    line-height: 1.15;
  }

  /* Vertical Scissor Divider between Column A and Column B */
  .print-scissor-col {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .scissor-line-wrap {
    height: 100%;
    border-left: 1.5px dashed #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 0 1px;
  }
  .scissor-icon {
    font-size: 8pt;
    background: #fff !important;
  }
  .scissor-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 6pt;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #000 !important;
    background: #fff !important;
    padding: 2px 0;
  }

  /* Eco print guarantees: complete white background, deep black borders and text */
  * {
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
}
