@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-light: #f0fdfa;
  --primary-border: #99f6e4;
  --accent: #d97706;
  --accent-light: #fffbeb;
  --indigo: #4338ca;
  --indigo-light: #eef2ff;
  --rose: #be123c;
  --rose-light: #fff1f2;
  --sky: #0369a1;
  --sky-light: #f0f9ff;
  --emerald: #047857;
  --emerald-light: #ecfdf5;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.de-text {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  direction: ltr;
  unicode-bidi: isolate;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
  color: #fff;
  padding: 18px 16px 22px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18);
}

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

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

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand h1 {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.25;
}

.brand p {
  font-size: 0.78rem;
  color: #ccfbf1;
  font-weight: 600;
}

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

.progress-pill {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-bar-wrap {
  width: 72px;
  height: 7px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #34d399;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.voice-select {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  max-width: 175px;
  cursor: pointer;
}

.voice-select option {
  color: var(--text);
  background: #fff;
}

/* Main Container */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* Category Selector Strip */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-heading h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.cat-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-card:hover:not(.cat-soon) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cat-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.14);
}

.cat-card.cat-soon {
  opacity: 0.72;
  cursor: default;
  background: #f8fafc;
}

.cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cat-emoji {
  font-size: 1.5rem;
}

.cat-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.cat-badge-ready {
  background: #ccfbf1;
  color: #0f766e;
}

.cat-badge-soon {
  background: #e2e8f0;
  color: #64748b;
}

.cat-title-ar {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.cat-title-de {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 700;
}

/* Mode Tabs */
.mode-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.mode-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 10px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
}

.mode-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.26);
}

.mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 11px;
  padding: 8px 13px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
}

.btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: #115e59;
  border-color: #115e59;
}

.btn-amber {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.btn-amber:hover {
  background: #fde68a;
}

.btn-danger {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fda4af;
}

.btn-active-toggle {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #a5b4fc;
}

/* Filters Panel */
.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip:hover {
  border-color: #94a3b8;
  color: var(--text);
}

.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.chip-grammar.active {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}

/* Vocab Recycled Chips with Gender Color Coding */
.vocab-chip {
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 5px 11px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s;
}

.vocab-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.vocab-chip.gender-m { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.vocab-chip.gender-f { border-color: #fda4af; background: #fff1f2; color: #be123c; }
.vocab-chip.gender-n { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.vocab-chip.gender-p { border-color: #d8b4fe; background: #faf5ff; color: #7e22ce; }
.vocab-chip.gender-v { border-color: #fcd34d; background: #fffbeb; color: #b45309; }

.vocab-chip.active {
  box-shadow: 0 0 0 2.5px #0f172a;
  transform: translateY(-1px);
}

.vocab-count {
  font-size: 0.7rem;
  opacity: 0.75;
  background: rgba(0, 0, 0, 0.07);
  padding: 1px 6px;
  border-radius: 999px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.status-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Active Rule Banner */
.rule-banner {
  background: var(--indigo-light);
  border: 1.5px solid #c7d2fe;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rule-banner h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--indigo);
  margin-bottom: 2px;
}

.rule-banner p {
  font-size: 0.84rem;
  color: #312e81;
}

/* Color Legend Bar */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 16px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* Hands-free Player Bar */
.autoplay-bar {
  background: linear-gradient(90deg, #0f172a, #1e293b);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.autoplay-bar.visible {
  display: flex;
}

/* Sentence Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.sentence-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.sentence-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.sentence-card.mastered {
  border-color: #6ee7b7;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.sentence-card.playing-now {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.card-num {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sentence-card.mastered .card-num {
  background: #d1fae5;
  color: #065f46;
}

.subtopic-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 9px;
  border-radius: 999px;
}

.card-top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 9px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: #f1f5f9;
  transform: scale(1.05);
}

.icon-btn.is-fav {
  background: #fef3c7;
  border-color: #fbbf24;
}

.icon-btn.is-done {
  background: #d1fae5;
  border-color: #34d399;
}

/* German & Arabic Sentence Area */
.german-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 15px;
  cursor: pointer;
  transition: background 0.15s;
}

.german-box:hover {
  background: #f1f5f9;
}

.german-sentence {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  direction: ltr;
  text-align: left;
  font-size: 1.16rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.65;
}

.pronunciation-line {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-light);
  background: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  display: block;
}

.hide-pron .pronunciation-line {
  display: none;
}

.arabic-meaning {
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  padding: 0 2px;
}

/* Highlight Spans inside German */
.hl-verb {
  background: #ccfbf1;
  color: #0f766e;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 800;
}

.hl-prefix {
  background: #ffedd5;
  color: #c2410c;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 800;
}

.hl-end {
  background: #e0e7ff;
  color: #3730a3;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 800;
}

.hl-conn {
  background: #ffe4e6;
  color: #be123c;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 800;
}

.hl-case {
  border-bottom: 2.5px solid #0284c7;
  color: #0369a1;
  font-weight: 700;
}

.hl-key {
  background: #fef9c3;
  color: #854d0e;
  padding: 1px 5px;
  border-radius: 6px;
}

/* Audio Buttons Row */
.audio-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.audio-btn {
  flex: 1;
  min-width: 90px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}

.audio-btn-normal {
  background: #f0fdfa;
  border-color: #5eead4;
  color: #0f766e;
}

.audio-btn-normal:hover {
  background: #ccfbf1;
}

.audio-btn-slow {
  background: #f0f9ff;
  border-color: #7dd3fc;
  color: #0369a1;
}

.audio-btn-slow:hover {
  background: #e0f2fe;
}

.audio-btn-repeat {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #b45309;
}

.audio-btn-repeat:hover {
  background: #fef3c7;
}

/* Grammar Formula Box */
.formula-box {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.box-title {
  font-size: 0.76rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 5px;
}

.formula-box .box-title {
  color: #3730a3;
}

.formula-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  direction: ltr;
  align-items: center;
}

.f-slot {
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
}

.f-sub { background: #fff; color: #334155; border-color: #cbd5e1; }
.f-verb { background: #0f766e; color: #fff; }
.f-mid { background: #f8fafc; color: #475569; border-color: #cbd5e1; }
.f-prefix { background: #ea580c; color: #fff; }
.f-end { background: #4338ca; color: #fff; }
.f-conn { background: #be123c; color: #fff; }

.f-plus {
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.75rem;
}

.rule-note {
  font-size: 0.8rem;
  color: #1e1b4b;
  line-height: 1.55;
}

/* Memory Link Box */
.memory-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 10px 13px;
}

.memory-box .box-title {
  color: #b45309;
  margin-bottom: 3px;
}

.memory-text {
  font-size: 0.81rem;
  color: #78350f;
  line-height: 1.55;
}

/* Card Footer Linked Words */
.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.mini-link-label {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 700;
}

.mini-word-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 7px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  direction: ltr;
}

.mini-word-btn:hover {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}

/* ================= Flashcard Quiz Mode ================= */
.quiz-container {
  max-width: 680px;
  margin: 0 auto;
}

.quiz-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-counter {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-prompt-ar {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text);
  padding: 14px 10px;
}

.quiz-hint-box {
  background: #eef2ff;
  border: 1px dashed #a5b4fc;
  border-radius: 12px;
  padding: 10px 14px;
  text-align: right;
}

.quiz-answer-panel {
  border-top: 2px dashed var(--border);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: right;
  animation: fadeIn 0.25s ease;
}

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

.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.quiz-actions .btn {
  padding: 11px 20px;
  font-size: 0.92rem;
}

/* ================= Interactive Sentence Builder ================= */
.builder-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.builder-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.builder-head h3 {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--primary);
}

.builder-pattern {
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  direction: ltr;
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
}

.builder-result {
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
  border: 2px solid #5eead4;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-result .german-sentence {
  font-size: 1.32rem;
}

.builder-note {
  font-size: 0.82rem;
  color: #0369a1;
  background: #e0f2fe;
  padding: 6px 11px;
  border-radius: 9px;
  font-weight: 700;
}

.slot-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.slot-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
}

.slot-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 8px 13px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all 0.16s;
}

.slot-btn:hover {
  border-color: var(--primary);
}

.slot-btn.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.24);
}

.slot-btn .opt-de {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  direction: ltr;
}

.slot-btn .opt-ar {
  font-size: 0.74rem;
  opacity: 0.85;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

/* Grammar Guide Modal / Section */
.grammar-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.grammar-guide-card {
  background: var(--surface);
  border: 1.5px solid #c7d2fe;
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.18s;
}

.grammar-guide-card:hover {
  background: #eef2ff;
  transform: translateY(-2px);
}

.grammar-guide-card h4 {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--indigo);
  margin-bottom: 4px;
}

.grammar-guide-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 100;
  transition: transform 0.25s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .brand h1 {
    font-size: 1.05rem;
  }
  .german-sentence {
    font-size: 1.05rem;
  }
  .quiz-prompt-ar {
    font-size: 1.2rem;
  }
}

/* ================= Language Toggle & LTR Support ================= */
.lang-toggle {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
}

[dir="ltr"] body,
html[dir="ltr"] body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

html[dir="ltr"] .cat-card,
html[dir="ltr"] .quiz-hint-box,
html[dir="ltr"] .quiz-answer-panel {
  text-align: left;
}

html[dir="ltr"] .legend-count {
  margin-left: auto;
  margin-right: 0 !important;
}

/* ================= Print Study Booklet Overlay & A4 Print ================= */
.btn-print {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

.btn-print:hover {
  background: #ddd6fe;
}

.booklet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.booklet-overlay.open {
  display: flex;
}

.booklet-toolbar {
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.booklet-toolbar-title {
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.booklet-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.booklet-opt-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.booklet-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px 48px;
  display: flex;
  justify-content: center;
}

.booklet-sheet {
  width: 100%;
  max-width: 840px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 16px;
  padding: 28px 30px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.booklet-cover {
  border: 2px solid #0f766e;
  background: linear-gradient(135deg, #f0fdfa 0%, #eef2ff 100%);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.booklet-cover h1 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 2px;
}

.booklet-cover p {
  font-size: 0.84rem;
  color: #334155;
  font-weight: 600;
}

.booklet-meta-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.booklet-badge {
  background: #0f766e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.booklet-section-box {
  border: 1.5px solid #c7d2fe;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.booklet-section-box h2 {
  font-size: 0.95rem;
  font-weight: 900;
  color: #3730a3;
  margin-bottom: 8px;
}

.booklet-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.booklet-rule-mini {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.76rem;
  line-height: 1.45;
  break-inside: avoid;
}

.booklet-rule-mini strong {
  display: block;
  color: #3730a3;
  margin-bottom: 2px;
}

.booklet-subtopic-head {
  background: #0f172a;
  color: #fff;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  margin: 18px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  break-after: avoid;
  page-break-after: avoid;
}

.booklet-items-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.booklet-item {
  border: 1.2px solid #cbd5e1;
  border-radius: 11px;
  padding: 10px 13px;
  background: #fff;
  break-inside: avoid;
  page-break-inside: avoid;
}

.booklet-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.booklet-item-de {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  direction: ltr;
  text-align: left;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.45;
  flex: 1;
}

.booklet-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
}

.booklet-checkbox {
  width: 15px;
  height: 15px;
  border: 1.8px solid #64748b;
  border-radius: 4px;
  display: inline-block;
}

.booklet-item-tr {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f766e;
  margin-bottom: 4px;
}

.booklet-item-pron {
  font-size: 0.74rem;
  color: #64748b;
  margin-bottom: 5px;
}

.booklet-item-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 5px;
}

.booklet-rule-col {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 0.75rem;
  color: #1e1b4b;
  line-height: 1.45;
}

.booklet-mem-col {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 0.75rem;
  color: #78350f;
  line-height: 1.45;
}

.booklet-formula-inline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  direction: ltr;
  display: inline-block;
  background: #fff;
  border: 1px solid #a5b4fc;
  color: #312e81;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 5px;
  margin-bottom: 3px;
}

.booklet-vocab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.booklet-vocab-pill {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  background: #fff;
  break-inside: avoid;
}

@media (max-width: 640px) {
  .booklet-sheet {
    padding: 16px 14px;
  }
  .booklet-rules-grid,
  .booklet-item-details,
  .booklet-vocab-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= Actual A4 Print Rules ================= */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #fff !important;
  }

  .app-header,
  .container,
  .toast,
  .booklet-toolbar {
    display: none !important;
  }

  .booklet-overlay {
    position: static !important;
    display: block !important;
    background: #fff !important;
    backdrop-filter: none !important;
    overflow: visible !important;
  }

  .booklet-scroll {
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }

  .booklet-sheet {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .booklet-rules-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .booklet-item-details {
    grid-template-columns: 1fr 1fr !important;
  }

  .booklet-vocab-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ================= Eco Ink-Saver & Space-Saver Print Mode ================= */
.booklet-opt-eco {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #d1fae5;
}

.booklet-sheet.eco-mode {
  padding: 14px 16px;
  color: #111 !important;
  background: #fff !important;
}

.booklet-sheet.eco-mode .booklet-cover {
  background: #fff !important;
  border: 1.5px solid #222 !important;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.booklet-sheet.eco-mode .booklet-cover h1 {
  font-size: 1.05rem;
  color: #111 !important;
}

.booklet-sheet.eco-mode .booklet-cover p {
  font-size: 0.72rem;
  color: #333 !important;
}

.booklet-sheet.eco-mode .booklet-badge {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #333 !important;
  font-size: 0.68rem;
  padding: 2px 7px;
}

.booklet-sheet.eco-mode .booklet-section-box {
  background: #fff !important;
  border: 1px solid #666 !important;
  border-radius: 6px;
  padding: 7px 9px;
  margin-bottom: 8px;
}

.booklet-sheet.eco-mode .booklet-section-box h2 {
  font-size: 0.8rem;
  color: #111 !important;
  margin-bottom: 5px;
}

.booklet-sheet.eco-mode .booklet-rules-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 5px;
}

.booklet-sheet.eco-mode .booklet-rule-mini {
  background: #fff !important;
  border: 1px solid #bbb !important;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 0.66rem;
  line-height: 1.32;
  color: #111 !important;
}

.booklet-sheet.eco-mode .booklet-rule-mini strong {
  color: #111 !important;
  margin-bottom: 1px;
}

.booklet-sheet.eco-mode .booklet-subtopic-head {
  background: #fff !important;
  color: #111 !important;
  border-bottom: 1.8px solid #111 !important;
  border-top: 1px solid #ccc;
  border-radius: 0;
  padding: 3px 2px;
  margin: 10px 0 6px;
  font-size: 0.82rem;
}

.booklet-sheet.eco-mode .booklet-items-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.booklet-sheet.eco-mode .booklet-item {
  border: 1px solid #999 !important;
  border-radius: 5px;
  padding: 5px 7px;
  background: #fff !important;
}

.booklet-sheet.eco-mode .booklet-item-top {
  margin-bottom: 2px;
  gap: 5px;
}

.booklet-sheet.eco-mode .booklet-item-de {
  font-size: 0.8rem;
  line-height: 1.32;
  color: #000 !important;
}

/* Strip ink-heavy highlight fills -> crisp B&W underline/bold */
.booklet-sheet.eco-mode .hl-verb,
.booklet-sheet.eco-mode .hl-prefix,
.booklet-sheet.eco-mode .hl-end,
.booklet-sheet.eco-mode .hl-conn,
.booklet-sheet.eco-mode .hl-case,
.booklet-sheet.eco-mode .hl-key {
  background: transparent !important;
  color: #000 !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.booklet-sheet.eco-mode .hl-verb {
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.booklet-sheet.eco-mode .hl-prefix,
.booklet-sheet.eco-mode .hl-end {
  font-weight: 900;
  border-bottom: 1.5px dashed #111 !important;
}

.booklet-sheet.eco-mode .hl-conn {
  font-weight: 900;
  font-style: italic;
}

.booklet-sheet.eco-mode .hl-case {
  border-bottom: 1px dotted #333 !important;
}

.booklet-sheet.eco-mode .booklet-check {
  font-size: 0.65rem;
  color: #333 !important;
  gap: 3px;
}

.booklet-sheet.eco-mode .booklet-checkbox {
  width: 11px;
  height: 11px;
  border: 1.2px solid #333;
  border-radius: 2px;
}

.booklet-sheet.eco-mode .booklet-item-tr {
  font-size: 0.74rem;
  color: #111 !important;
  margin-bottom: 2px;
  line-height: 1.3;
}

.booklet-sheet.eco-mode .booklet-item-pron {
  font-size: 0.64rem;
  color: #444 !important;
  margin-bottom: 2px;
  line-height: 1.25;
}

.booklet-sheet.eco-mode .booklet-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px dotted #bbb;
}

.booklet-sheet.eco-mode .booklet-rule-col,
.booklet-sheet.eco-mode .booklet-mem-col {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 0.65rem;
  line-height: 1.32;
  color: #222 !important;
}

.booklet-sheet.eco-mode .booklet-formula-inline {
  background: transparent !important;
  border: 1px solid #666 !important;
  color: #000 !important;
  font-size: 0.63rem;
  padding: 0px 4px;
  border-radius: 3px;
  margin-bottom: 1px;
}

.booklet-sheet.eco-mode .booklet-vocab-grid {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 4px;
}

.booklet-sheet.eco-mode .booklet-vocab-pill {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #aaa !important;
  padding: 2px 5px;
  font-size: 0.66rem;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .booklet-sheet.eco-mode .booklet-items-list,
  .booklet-sheet.eco-mode .booklet-rules-grid,
  .booklet-sheet.eco-mode .booklet-vocab-grid {
    grid-template-columns: 1fr !important;
  }
}

@media print {
  .booklet-sheet.eco-mode .booklet-items-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px !important;
  }
  .booklet-sheet.eco-mode .booklet-rules-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .booklet-sheet.eco-mode .booklet-vocab-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .booklet-sheet.eco-mode .booklet-item-details {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* ================= telc B1 Exam & Strategy Simulator ================= */
.telc-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.telc-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #0f766e 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.telc-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.telc-badge-pill {
  background: #f59e0b;
  color: #1e1b4b;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.telc-hero h2 {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 6px;
}

.telc-hero p {
  font-size: 0.88rem;
  color: #c7d2fe;
  line-height: 1.6;
  max-width: 820px;
}

/* Telc Sub-Navigation Bar */
.telc-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.telc-nav-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
}

.telc-nav-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.telc-nav-btn.active {
  background: #312e81;
  color: #fff;
  box-shadow: 0 3px 10px rgba(49, 46, 129, 0.28);
}

/* Telc Section Cards */
.telc-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.telc-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 12px;
}

.telc-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.telc-card-title h3 {
  font-size: 1.12rem;
  font-weight: 900;
  color: #1e1b4b;
}

.telc-score-badge {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

/* Traps Grid */
.telc-traps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.telc-trap-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
}

.telc-trap-box:hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
}

.telc-trap-head {
  font-size: 0.88rem;
  font-weight: 900;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 6px;
}

.telc-trap-desc {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.55;
}

.telc-trap-code {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: 'Plus Jakarta Sans', monospace;
  direction: ltr;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #0f172a;
}

/* Redemittel Grid */
.telc-redemittel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.telc-rede-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telc-rede-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f766e;
}

.telc-rede-de {
  font-family: 'Plus Jakarta Sans', sans-serif;
  direction: ltr;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.telc-rede-ar {
  font-size: 0.8rem;
  color: #475569;
}

/* Reading Simulation Box */
.telc-paper-box {
  background: #fffdfa;
  border: 2px solid #e7dfd5;
  border-radius: 14px;
  padding: 20px 22px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  direction: ltr;
  text-align: left;
  color: #1c1917;
  line-height: 1.7;
  font-size: 0.92rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.telc-paper-box strong {
  color: #0c0a09;
}

/* Interactive Question Block */
.telc-q-block {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.telc-q-prompt {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
}

.telc-options-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.telc-opt-btn {
  border: 1.5px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 9px 13px;
  text-align: inherit;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.16s;
}

.telc-opt-btn:hover:not(:disabled) {
  border-color: #312e81;
  background: #f8fafc;
}

.telc-opt-btn.opt-correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #065f46 !important;
}

.telc-opt-btn.opt-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.telc-explanation-box {
  background: #eef2ff;
  border: 1px dashed #a5b4fc;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #312e81;
  line-height: 1.5;
  display: none;
}

.telc-explanation-box.show {
  display: block;
}

/* Sprachbausteine Email & Gaps */
.sb-cloze-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 20px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  direction: ltr;
  text-align: left;
  line-height: 2.1;
  font-size: 1rem;
  color: #0f172a;
  position: relative;
}

.sb-gap-pill {
  display: inline-block;
  padding: 2px 10px;
  background: #e0e7ff;
  border: 1.5px dashed #4338ca;
  color: #312e81;
  font-weight: 800;
  border-radius: 8px;
  margin: 0 4px;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.sb-gap-pill.sb-filled-correct {
  background: #d1fae5;
  border: 1.5px solid #10b981;
  color: #065f46;
}

.sb-gap-pill.sb-filled-wrong {
  background: #fee2e2;
  border: 1.5px solid #ef4444;
  color: #991b1b;
}

/* Sprachbausteine Score Bar */
.sb-score-bar {
  background: linear-gradient(135deg, #312e81, #0f766e);
  color: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sb-score-text {
  font-size: 0.95rem;
  font-weight: 900;
}

/* Writing Area */
.telc-write-area {
  width: 100%;
  min-height: 160px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: 0.94rem;
  line-height: 1.6;
  direction: ltr;
  resize: vertical;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.telc-write-area:focus {
  border-color: #312e81;
  background: #fff;
}

.telc-write-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
}

.telc-model-box {
  background: #f0fdfa;
  border: 1.5px solid #5eead4;
  border-radius: 12px;
  padding: 16px 18px;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.telc-model-box.show {
  display: flex;
}

/* Speaking Cards */
.telc-speaking-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.telc-speak-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.telc-speak-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #312e81;
}

.telc-examiner-prompt {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.telc-examiner-prompt .de-text {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
}

.telc-model-speaking-panel {
  border-top: 1px dashed #cbd5e1;
  padding-top: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.25s ease;
}

.telc-model-speaking-panel.show {
  display: flex;
}

@media (max-width: 640px) {
  .telc-traps-grid {
    grid-template-columns: 1fr;
  }
  .telc-hero {
    padding: 16px;
  }
}
