/* TelccFree — Hören Premium Design System (bulletproof flex cards) */
/* Inter is loaded via <link> in HTML (no @import). */

html.telc-hoeren-quiz-page,
body[data-section^="Hören Teil"] {
  --hoeren-bg: #f1f5f9;
  --hoeren-surface: #ffffff;
  --hoeren-border: #e2e8f0;
  --hoeren-border-hover: #cbd5e1;
  --hoeren-text: #1e293b;
  --hoeren-muted: #475569;
  --hoeren-primary: #3b82f6;
  --hoeren-primary-dark: #1d4ed8;
  --hoeren-primary-soft: #eff6ff;
  --hoeren-primary-ring: rgba(59, 130, 246, 0.15);
  --hoeren-success: #047857;
  --hoeren-success-border: #10b981;
  --hoeren-success-soft: #ecfdf5;
  --hoeren-danger: #b91c1c;
  --hoeren-danger-border: #ef4444;
  --hoeren-danger-soft: #fef2f2;
  --hoeren-row-correct: #d4edda;
  --hoeren-row-wrong: #f8d7da;
  --hoeren-row-correct-border: #b7dfc5;
  --hoeren-row-wrong-border: #f1b0b7;
  scroll-behavior: smooth;
}

html.telc-hoeren-quiz-page,
html.telc-hoeren-quiz-page body,
body[data-section^="Hören Teil"],
body[data-section^="Hören Teil"] {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

html.telc-hoeren-quiz-page *,
html.telc-hoeren-quiz-page *::before,
html.telc-hoeren-quiz-page *::after,
body[data-section^="Hören Teil"] *,
body[data-section^="Hören Teil"] *::before,
body[data-section^="Hören Teil"] *::after {
  box-sizing: border-box;
}

/* ── Canvas ── */
html.telc-hoeren-quiz-page body,
body[data-section^="Hören Teil"] {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  line-height: 1.6 !important;
  color: var(--hoeren-text);
  background-color: var(--hoeren-bg) !important;
  background-image: none !important;
  padding: 28px 16px 48px !important;
  -webkit-font-smoothing: antialiased;
}

html.telc-hoeren-quiz-page .hoeren-back-wrap,
html.telc-hoeren-quiz-page .quiz-container,
html.telc-hoeren-quiz-page #result,
html.telc-hoeren-quiz-page .auto-nav-wrap,
body[data-section^="Hören Teil"] .hoeren-back-wrap,
body[data-section^="Hören Teil"] .quiz-container,
body[data-section^="Hören Teil"] #result,
body[data-section^="Hören Teil"] .auto-nav-wrap {
  width: 100%;
  max-width: 800px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

html.telc-hoeren-quiz-page .quiz-container,
body[data-section^="Hören Teil"] .quiz-container {
  background: var(--hoeren-surface) !important;
  border: 1px solid var(--hoeren-border);
  border-radius: 20px !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
  padding: 28px 26px 32px !important;
  margin-bottom: 24px !important;
}

html.telc-hoeren-quiz-page .quiz-container > h2:not(.audio-title),
body[data-section^="Hören Teil"] .quiz-container > h2:not(.audio-title) {
  margin: 0 0 22px;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--hoeren-text);
  letter-spacing: -0.025em;
}

/* ── Audio hero ── */
html.telc-hoeren-quiz-page .quiz-container .audio-title,
html.telc-hoeren-quiz-page .quiz-container h2.audio-title,
body[data-section^="Hören Teil"] .quiz-container .audio-title,
body[data-section^="Hören Teil"] .quiz-container h2.audio-title {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 26px;
  padding: 20px 22px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #312e81 0%, #4338ca 48%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.28);
}

html.telc-hoeren-quiz-page .quiz-container .audio-label,
body[data-section^="Hören Teil"] .quiz-container .audio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
}

html.telc-hoeren-quiz-page .quiz-container .audio-label::before,
body[data-section^="Hören Teil"] .quiz-container .audio-label::before {
  content: "\f025";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.95rem;
}

html.telc-hoeren-quiz-page .quiz-container .audio-title audio,
body[data-section^="Hören Teil"] .quiz-container .audio-title audio {
  width: 100% !important;
  min-height: 42px;
  border-radius: 10px;
}

/* ── Table reset ── */
html.telc-hoeren-quiz-page .quiz-container form,
body[data-section^="Hören Teil"] .quiz-container form {
  width: 100%;
}

html.telc-hoeren-quiz-page .quiz-container table,
body[data-section^="Hören Teil"] .quiz-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
}

html.telc-hoeren-quiz-page .quiz-container table tbody > tr:has(th),
body[data-section^="Hören Teil"] .quiz-container table tbody > tr:has(th) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ══ Core card — exam grid: number | R | F | sentence ══ */
html.telc-hoeren-quiz-page .quiz-container tr.question-card,
html.telc-hoeren-quiz-page .quiz-container tr.question-card.correct,
html.telc-hoeren-quiz-page .quiz-container tr.question-card.wrong,
html.telc-hoeren-quiz-page .quiz-container tr.question-card.is-answered,
body[data-section^="Hören Teil"] .quiz-container tr.question-card,
body[data-section^="Hören Teil"] .quiz-container tr.question-card.correct,
body[data-section^="Hören Teil"] .quiz-container tr.question-card.wrong,
body[data-section^="Hören Teil"] .quiz-container tr.question-card.is-answered {
  display: grid !important;
  grid-template-columns: 2.6rem 2.75rem 2.75rem minmax(0, 1fr) !important;
  column-gap: 8px !important;
  row-gap: 0 !important;
  align-items: center !important;
  justify-content: stretch !important;
  flex-wrap: nowrap !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  margin-bottom: 12px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

html.telc-hoeren-quiz-page .quiz-container tr.question-card:not(.is-answered):not(.correct):not(.wrong),
body[data-section^="Hören Teil"] .quiz-container tr.question-card:not(.is-answered):not(.correct):not(.wrong) {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

html.telc-hoeren-quiz-page .quiz-container tr.question-card:hover:not(.is-answered):not(.correct):not(.wrong),
body[data-section^="Hören Teil"] .quiz-container tr.question-card:hover:not(.is-answered):not(.correct):not(.wrong) {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

/* Answered (not yet checked) — Lesen Teil 3 selected-card highlight */
html.telc-hoeren-quiz-page .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
html.telc-hoeren-quiz-page .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong),
body[data-section^="Hören Teil"] .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
body[data-section^="Hören Teil"] .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong) {
  background:
    radial-gradient(120% 95% at 50% 38%,
      #fff6d4 0%,
      #fff1c4 52%,
      #f8e8b4 100%) !important;
  border: 1.5px solid #e2c36a !important;
  box-shadow:
    0 0 8px rgba(212, 148, 40, 0.14),
    inset 0 0 18px rgba(245, 190, 60, 0.16) !important;
}

/* Post-verify row tint — vier-tage-pro gold standard */
html.telc-hoeren-quiz-page .quiz-container tr.question-card.correct,
body[data-section^="Hören Teil"] .quiz-container tr.question-card.correct {
  background: var(--hoeren-row-correct) !important;
  border: 1px solid var(--hoeren-row-correct-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

html.telc-hoeren-quiz-page .quiz-container tr.question-card.wrong,
body[data-section^="Hören Teil"] .quiz-container tr.question-card.wrong {
  background: var(--hoeren-row-wrong) !important;
  border: 1px solid var(--hoeren-row-wrong-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

/* Number column */
html.telc-hoeren-quiz-page .quiz-container .question-num-cell,
body[data-section^="Hören Teil"] .quiz-container .question-num-cell {
  grid-column: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 0 !important;
}

html.telc-hoeren-quiz-page .quiz-container .question-number,
body[data-section^="Hören Teil"] .quiz-container .question-number {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-align: right !important;
  padding-top: 0 !important;
  line-height: 1.5 !important;
}

/* Statement column */
html.telc-hoeren-quiz-page .quiz-container .question-cell,
body[data-section^="Hören Teil"] .quiz-container .question-cell {
  grid-column: 4 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  order: 0 !important;
}

html.telc-hoeren-quiz-page .quiz-container .card-content,
body[data-section^="Hören Teil"] .quiz-container .card-content {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
}

html.telc-hoeren-quiz-page .quiz-container .question-text,
body[data-section^="Hören Teil"] .quiz-container .question-text {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  color: #1e293b !important;
  font-weight: 500 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Legacy inline q-num (pre-JS pages) — still column-safe if present */
html.telc-hoeren-quiz-page .quiz-container .q-num,
body[data-section^="Hören Teil"] .quiz-container .q-num {
  font-weight: 700;
  color: #64748b;
}

html.dark.telc-hoeren-quiz-page .quiz-container .question-number,
html.dark body[data-section^="Hören Teil"] .quiz-container .question-number {
  color: #94a3b8 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .question-text,
html.dark body[data-section^="Hören Teil"] .quiz-container .question-text {
  color: #f8fafc !important;
}

html.telc-hoeren-quiz-page .quiz-container .question-actions,
body[data-section^="Hören Teil"] .quiz-container .question-actions {
  grid-column: 2 / 4 !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  order: 0 !important;
  align-self: center !important;
  padding-right: 0 !important;
}

/* Table cells inside grid row */
html.telc-hoeren-quiz-page .quiz-container tr.question-card > td,
body[data-section^="Hören Teil"] .quiz-container tr.question-card > td {
  display: block !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  vertical-align: middle !important;
}

html.telc-hoeren-quiz-page .hoeren-rf-sr,
body[data-section^="Hören Teil"] .hoeren-rf-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html.telc-hoeren-quiz-page .hoeren-rf-legend,
body[data-section^="Hören Teil"] .hoeren-rf-legend {
  display: grid;
  grid-template-columns: 2.6rem 2.75rem 2.75rem minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  padding: 0 16px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

html.telc-hoeren-quiz-page .hoeren-rf-legend__r,
html.telc-hoeren-quiz-page .hoeren-rf-legend__f,
body[data-section^="Hören Teil"] .hoeren-rf-legend__r,
body[data-section^="Hören Teil"] .hoeren-rf-legend__f {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

html.dark.telc-hoeren-quiz-page .hoeren-rf-legend,
html.dark body[data-section^="Hören Teil"] .hoeren-rf-legend {
  color: #94a3b8;
}

/* Circle pair — R and F columns */
html.telc-hoeren-quiz-page .quiz-container .button-group,
body[data-section^="Hören Teil"] .quiz-container .button-group {
  display: grid !important;
  grid-template-columns: 2.75rem 2.75rem !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: 100% !important;
  justify-content: start !important;
  align-items: center !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn {
  position: relative !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  font-size: 0 !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn::after,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn::after {
  content: "" !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 2px solid #111 !important;
  background: #fff !important;
  box-shadow: none !important;
  pointer-events: none;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn::before,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 12px !important;
  height: 12px !important;
  margin: -6px 0 0 -6px !important;
  border-radius: 50% !important;
  background: #111 !important;
  opacity: 0 !important;
  pointer-events: none;
  z-index: 1;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn:hover::after,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn:hover::after {
  border-color: #334155 !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn:focus-visible,
html.telc-hoeren-quiz-page .quiz-container .quiz-btn:has(input:focus-visible),
body[data-section^="Hören Teil"] .quiz-container .quiz-btn:focus-visible,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn:has(input:focus-visible) {
  outline: 2px solid #111;
  outline-offset: 2px;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::after,
html.telc-hoeren-quiz-page .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::after,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::after,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::after {
  background: #fff !important;
  border-color: #111 !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::before,
html.telc-hoeren-quiz-page .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::before,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::before,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::before {
  opacity: 1 !important;
  background: #111 !important;
}

/* Post-submit validation — color only, after check */
html.telc-hoeren-quiz-page .quiz-container .quiz-btn.correct::after,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn.correct::after {
  background: #fff !important;
  border-color: #047857 !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn.correct::before,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn.correct::before {
  opacity: 1 !important;
  background: #047857 !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn.incorrect::after,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn.incorrect::after {
  background: #fff !important;
  border-color: #b91c1c !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn.incorrect::before,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn.incorrect::before {
  opacity: 1 !important;
  background: #b91c1c !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn input[type="radio"],
body[data-section^="Hören Teil"] .quiz-container .quiz-btn input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  opacity: 0;
  cursor: pointer;
  transform: none !important;
}

html.telc-hoeren-quiz-page .quiz-container .quiz-btn:hover,
html.telc-hoeren-quiz-page .quiz-container .quiz-btn:active,
html.telc-hoeren-quiz-page .quiz-container .quiz-btn.selected,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn:hover,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn:active,
body[data-section^="Hören Teil"] .quiz-container .quiz-btn.selected {
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ── Primary CTA + retry (black & white) ── */
html.telc-hoeren-quiz-page .hoeren-action-row,
body[data-section^="Hören Teil"] .hoeren-action-row {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 28px auto 0 !important;
}

html.telc-hoeren-quiz-page .btn-check,
html.telc-hoeren-quiz-page .quiz-container button.btn-check,
html.telc-hoeren-quiz-page .quiz-container button.btn-check.telc-global-check-btn,
html.telc-hoeren-quiz-page .quiz-container button.btn-check.lesen-teil2-check-btn,
body[data-section^="Hören Teil"] .btn-check,
body[data-section^="Hören Teil"] .quiz-container button.btn-check.telc-global-check-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  margin: 0 !important;
  padding: 11px 18px !important;
  min-height: 42px;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: #111111 !important;
  background-image: none !important;
  border: 1px solid #111111 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  cursor: pointer;
  touch-action: manipulation;
  filter: none !important;
}

html.telc-hoeren-quiz-page .quiz-container button.hoeren-retry-btn,
html.telc-hoeren-quiz-page .quiz-container button.hoeren-retry-btn.telc-global-reset-btn,
html.telc-hoeren-quiz-page #hoeren-retry-btn,
body[data-section^="Hören Teil"] .quiz-container button.hoeren-retry-btn,
body[data-section^="Hören Teil"] #hoeren-retry-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  margin: 0 !important;
  padding: 11px 16px !important;
  min-height: 42px;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  color: #111111 !important;
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #c5ccd6 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  cursor: pointer;
  touch-action: manipulation;
  filter: none !important;
}

html.telc-hoeren-quiz-page .btn-check:hover,
html.telc-hoeren-quiz-page .quiz-container button.btn-check.telc-global-check-btn:hover,
body[data-section^="Hören Teil"] .btn-check:hover {
  background: #2a2a2a !important;
  background-image: none !important;
  border-color: #2a2a2a !important;
  color: #ffffff !important;
  filter: none !important;
  box-shadow: none !important;
}

html.telc-hoeren-quiz-page .quiz-container button.hoeren-retry-btn:hover,
html.telc-hoeren-quiz-page #hoeren-retry-btn:hover,
body[data-section^="Hören Teil"] .quiz-container button.hoeren-retry-btn:hover {
  background: #f3f4f6 !important;
  background-image: none !important;
  border-color: #111111 !important;
  color: #111111 !important;
  filter: none !important;
  box-shadow: none !important;
}

html.telc-hoeren-quiz-page .btn-check .telc-global-check-btn__icon,
html.telc-hoeren-quiz-page .btn-check .lesen-teil2-check-btn__icon,
body[data-section^="Hören Teil"] .btn-check .telc-global-check-btn__icon {
  color: #ffffff !important;
}

html.telc-hoeren-quiz-page .hoeren-retry-btn__icon,
body[data-section^="Hören Teil"] .hoeren-retry-btn__icon {
  color: #111111 !important;
}

html.telc-hoeren-quiz-page #result,
body[data-section^="Hören Teil"] #result {
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

html.telc-hoeren-quiz-page #result .correct-count,
body[data-section^="Hören Teil"] #result .correct-count {
  color: var(--hoeren-success-border);
}

html.telc-hoeren-quiz-page .hoeren-back-link,
body[data-section^="Hören Teil"] .hoeren-back-link {
  margin-bottom: 18px;
  border-radius: 12px;
  border: 1px solid var(--hoeren-border);
  background: var(--hoeren-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ── Mobile: keep R/F columns aligned; sentence wraps ── */
@media (max-width: 600px) {
  html.telc-hoeren-quiz-page body,
  body[data-section^="Hören Teil"] {
    padding: 14px 12px 36px !important;
  }

  html.telc-hoeren-quiz-page .quiz-container,
  body[data-section^="Hören Teil"] .quiz-container {
    padding: 20px 14px 24px !important;
  }

  html.telc-hoeren-quiz-page .quiz-container tr.question-card,
  html.telc-hoeren-quiz-page .quiz-container tr.question-card.correct,
  html.telc-hoeren-quiz-page .quiz-container tr.question-card.wrong,
  html.telc-hoeren-quiz-page .quiz-container tr.question-card.is-answered,
  body[data-section^="Hören Teil"] .quiz-container tr.question-card,
  body[data-section^="Hören Teil"] .quiz-container tr.question-card.correct,
  body[data-section^="Hören Teil"] .quiz-container tr.question-card.wrong,
  body[data-section^="Hören Teil"] .quiz-container tr.question-card.is-answered,
  html.telc-hoeren-quiz-page .hoeren-rf-legend,
  body[data-section^="Hören Teil"] .hoeren-rf-legend {
    grid-template-columns: 2.2rem 2.75rem 2.75rem minmax(0, 1fr) !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  html.telc-hoeren-quiz-page .quiz-container .question-cell,
  body[data-section^="Hören Teil"] .quiz-container .question-cell {
    width: auto !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    order: 0 !important;
    margin-bottom: 0;
  }

  html.telc-hoeren-quiz-page .quiz-container .question-actions,
  body[data-section^="Hören Teil"] .quiz-container .question-actions {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    order: 0 !important;
    align-self: center !important;
    padding-right: 0 !important;
  }

  html.telc-hoeren-quiz-page .quiz-container .button-group,
  body[data-section^="Hören Teil"] .quiz-container .button-group {
    grid-template-columns: 2.75rem 2.75rem !important;
    justify-content: start !important;
  }

  html.telc-hoeren-quiz-page .quiz-container .quiz-btn,
  body[data-section^="Hören Teil"] .quiz-container .quiz-btn {
    flex: 0 0 auto !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  html.telc-hoeren-quiz-page .btn-check,
  body[data-section^="Hören Teil"] .btn-check {
    max-width: 100%;
  }
}

/* ══ Dark mode ══ */
html.dark.telc-hoeren-quiz-page,
html.dark body[data-section^="Hören Teil"] {
  --hoeren-bg: #0f172a;
  --hoeren-surface: #1e293b;
  --hoeren-border: #334155;
  --hoeren-text: #f8fafc;
}

html.dark.telc-hoeren-quiz-page body,
html.dark body[data-section^="Hören Teil"] {
  background-color: var(--hoeren-bg) !important;
  color: #e2e8f0;
}

html.dark.telc-hoeren-quiz-page .quiz-container,
html.dark body[data-section^="Hören Teil"] .quiz-container {
  background: var(--hoeren-surface) !important;
  border-color: var(--hoeren-border);
}

html.dark.telc-hoeren-quiz-page .quiz-container tr.question-card.correct,
html.dark body[data-section^="Hören Teil"] .quiz-container tr.question-card.correct {
  background: rgba(6, 78, 59, 0.38) !important;
  border: 1px solid #059669 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container tr.question-card.wrong,
html.dark body[data-section^="Hören Teil"] .quiz-container tr.question-card.wrong {
  background: rgba(127, 29, 29, 0.32) !important;
  border: 1px solid #dc2626 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container tr.question-card:not(.is-answered):not(.correct):not(.wrong),
html.dark body[data-section^="Hören Teil"] .quiz-container tr.question-card:not(.is-answered):not(.correct):not(.wrong) {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container tr.question-card,
html.dark body[data-section^="Hören Teil"] .quiz-container tr.question-card {
  background: #1e293b;
}

html.dark.telc-hoeren-quiz-page .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
html.dark.telc-hoeren-quiz-page .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong),
html.dark body[data-section^="Hören Teil"] .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
html.dark body[data-section^="Hören Teil"] .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong) {
  background:
    radial-gradient(120% 95% at 50% 38%,
      #5c4a1f 0%,
      #4a3c18 55%,
      #3a3016 100%) !important;
  border: 1.5px solid #d4a017 !important;
  box-shadow:
    0 0 8px rgba(212, 160, 23, 0.22),
    inset 0 0 18px rgba(212, 160, 23, 0.12) !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .question-text,
html.dark body[data-section^="Hören Teil"] .quiz-container .question-text {
  color: #f8fafc !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn {
  background: transparent !important;
  border-color: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn::after,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn::after {
  background: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn::before,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn::before {
  background: #f8fafc !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::after,
html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::after,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::after,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::after {
  background: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::before,
html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::before,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn.selected:not(.correct):not(.incorrect)::before,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn:has(input:checked):not(.correct):not(.incorrect)::before {
  opacity: 1 !important;
  background: #f8fafc !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn.correct::after,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn.correct::after {
  background: #0f172a !important;
  border-color: #34d399 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn.correct::before,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn.correct::before {
  opacity: 1 !important;
  background: #34d399 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn.incorrect::after,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn.incorrect::after {
  background: #0f172a !important;
  border-color: #f87171 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn.incorrect::before,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn.incorrect::before {
  opacity: 1 !important;
  background: #f87171 !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn:focus-visible,
html.dark.telc-hoeren-quiz-page .quiz-container .quiz-btn:has(input:focus-visible),
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn:focus-visible,
html.dark body[data-section^="Hören Teil"] .quiz-container .quiz-btn:has(input:focus-visible) {
  outline-color: #f8fafc;
}

html.dark.telc-hoeren-quiz-page .quiz-container .audio-title,
html.dark body[data-section^="Hören Teil"] .quiz-container .audio-title {
  background: linear-gradient(145deg, #1e1b4b 0%, #312e81 100%) !important;
}

html.dark.telc-hoeren-quiz-page .quiz-container .audio-title audio,
html.dark body[data-section^="Hören Teil"] .quiz-container .audio-title audio {
  filter: invert(0.9) hue-rotate(180deg);
}

/* ── Hören Teil 2: normalized score line inside the #result card ── */
#result .telc-teil2-score-normalized {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: #1f3655;
}

#result .telc-teil2-score-normalized .telc-teil2-score-value {
  color: #2e7d32;
}

html.dark #result .telc-teil2-score-normalized {
  color: #e2e8f0;
}

html.dark #result .telc-teil2-score-normalized .telc-teil2-score-value {
  color: #4ade80;
}

/* B1 Hören Teil 2: official RICHTIG statements get amber highlight AFTER Prüfen only.
   Student .correct/.wrong feedback stays separate. */
body[data-level="b1"][data-section="Hören Teil 2"] .hoeren-t2-memory {
  display: none !important;
}

body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong),
html.telc-hoeren-quiz-page body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
html.telc-hoeren-quiz-page body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong) {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

html.dark body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
html.dark body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong),
html.dark.telc-hoeren-quiz-page body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card.is-answered:not(.correct):not(.wrong),
html.dark.telc-hoeren-quiz-page body[data-level="b1"][data-section="Hören Teil 2"] .quiz-container tr.question-card:has(input:checked):not(.correct):not(.wrong) {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: none !important;
}

body[data-level="b1"][data-section="Hören Teil 2"] .hoeren-aussage {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-level="b1"][data-section="Hören Teil 2"] .hoeren-aussage.hoeren-statement--official-richtig,
html.telc-hoeren-quiz-page body[data-level="b1"][data-section="Hören Teil 2"] .hoeren-aussage.hoeren-statement--official-richtig {
  background: #fde68a !important;
  color: #1e293b !important;
  border-radius: 8px;
  padding: 6px 10px !important;
  box-shadow: inset 0 0 0 1px #eab308;
}

html.dark body[data-level="b1"][data-section="Hören Teil 2"] .hoeren-aussage.hoeren-statement--official-richtig,
html.dark.telc-hoeren-quiz-page body[data-level="b1"][data-section="Hören Teil 2"] .hoeren-aussage.hoeren-statement--official-richtig {
  background: #ca8a04 !important;
  color: #0f172a !important;
  box-shadow: inset 0 0 0 1px #facc15;
}

body[data-level="b1"][data-section="Hören Teil 2"] .hoeren-aussage.hoeren-statement--official-richtig mark.t1-kw {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  box-shadow: none !important;
}
