.lead-modal {
  border: none;
  border-radius: 12px;
  padding: 2.5rem 2rem 2rem;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow-y: auto; /* WAR: overflow: hidden — das war der Bug */
  overflow-x: hidden;
}

/* Defensive: kein Bild im Modal darf das Layout sprengen */
.lead-modal img {
  max-width: 100%;
  height: auto;
}

/* Falls deine .testimonial-chat-Styles im Modal nicht greifen,
   hier ein konservativer Fallback */
.lead-modal .testimonial-chat .chat-speaker img {
  max-width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.lead-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.lead-modal[open] {
  animation: leadModalIn 0.2s ease-out;
}

@keyframes leadModalIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lead-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.lead-modal__close:hover {
  background-color: #f3f4f6;
  color: #111827;
  transform: rotate(90deg);
}

.lead-modal__close:focus-visible {
  outline: 2px solid #066aab; /* Brand-Farbe aus deinem WPForms */
  outline-offset: 2px;
  background-color: #f3f4f6;
  color: #111827;
}

.lead-modal__close:active {
  transform: rotate(90deg) scale(0.92);
  background-color: #e5e7eb;
}

.lead-modal__heading {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

body.lead-modal-open {
  overflow: hidden;
}

/* Modal weitet sich auf, sobald Kalender aktiv ist */
.lead-modal.is-step-calendar {
  max-width: 900px;
}

.lead-modal__step--calendar {
}

.lead-modal__calendar-heading {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.lead-modal__calendar-subline {
  margin: 0 0 1rem;
  color: #555;
}

.lead-modal__cal-embed {
  width: 100%;
  min-height: 600px;
}

/* ============================================
   Image Choices: 2x2 Grid + kompakte Größe
   ============================================ */
.lead-modal ul.wpforms-image-choices,
.lead-modal .wpforms-field-radio ul.wpforms-image-choices,
.lead-modal .wpforms-field-radio .wpforms-image-choices.wpforms-image-choices-modern {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  width: 100% !important;
}

.lead-modal .wpforms-image-choices-item {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: none !important;
  display: block !important;
}

.lead-modal .wpforms-image-choices-modern .wpforms-field-label-inline {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100% !important;
  height: 100%;
  min-height: 140px;
  margin: 0 !important;
  padding: 14px 10px !important;
  box-sizing: border-box;
}

/* Bilder in den Choice-Kacheln verkleinern */
.lead-modal .wpforms-image-choices-image {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
}

.lead-modal .wpforms-image-choices-image img {
  max-width: 80px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Label-Text einheitlich positionieren */
.lead-modal .wpforms-image-choices-label {
  text-align: center;
  line-height: 1.2;
  margin: 0 !important;
}

/* Label-Padding der Choice-Kacheln reduzieren */
.lead-modal .wpforms-image-choices-modern .wpforms-field-label-inline {
  padding: 10px !important;
}

/* ============================================
   testimonial-chat: kompakte Variante im Modal
   ============================================ */
.lead-modal .testimonial-chat {
  margin-bottom: 1rem;
}

.lead-modal .testimonial-chat .chat-speaker img {
  width: 48px;
  height: 48px;
  max-width: 48px;
  border-radius: 50%;
  object-fit: cover;
}

/* Frage-Headings im Form kompakter */
.lead-modal .bewertung-überschrift,
.lead-modal .erste-frage p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  line-height: 1.3;
}

/* ============================================
   Modal-Heading enger ans Form ranziehen
   ============================================ */
.lead-modal__heading {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

/* ============================================
   Felder & Buttons im Modal
   ============================================ */
.lead-modal .wpforms-field {
  margin-bottom: 0.75rem;
  padding: 0;
}

.lead-modal .wpforms-page-button {
  margin-top: 0.5rem;
}

/* ============================================
   Auto-Advance: Weiter-Button verstecken auf
   Pages mit Image Choices (Hauptselektor + Fallback)
   ============================================ */
.lead-modal .wpforms-page:has(.wpforms-image-choices) .wpforms-page-next {
  display: none !important;
}

/* JS-Fallback (älterer Browser) */
.lead-modal .wpforms-page.has-auto-advance .wpforms-page-next {
  display: none !important;
}

/* ============================================
   Inline Calendar (auf Seiten, nicht im Modal)
   ============================================ */
.lead-inline-calendar {
  margin-top: 2rem;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.lead-inline-calendar__heading {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.lead-inline-calendar__subline {
  margin: 0 0 1.5rem;
  color: #555;
}

.lead-inline-calendar__embed {
  width: 100%;
  min-height: 600px;
}
