/* Chatfenster von Lucy. Liegt unter den Vollbild-Fenstern (Kontakt, Termin). */
.lucy {
  --lucy-navy: #0F2544;
  --lucy-gold: #C9A961;
  --lucy-gold-text: #8A6A1F;
  --lucy-rand: #E4E7EC;
  --lucy-grau: #667085;
  --lucy-flaeche: #F5F7FA;
  position: fixed;
  right: 16px;
  /* Ueber dem Knopf Cookie-Einstellungen, der immer erreichbar bleiben muss. */
  bottom: 60px;
  z-index: 900;
  font-family: inherit;
}

.lucy-punkt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--lucy-gold);
  color: var(--lucy-navy);
  font-weight: 700;
  font-size: 15px;
}

.lucy .lucy-knopf {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 17px 9px 9px;
  border: 1px solid var(--lucy-gold);
  /* Die Website setzt Knoepfe am Handy eckig. */
  border-radius: 999px !important;
  background: var(--lucy-navy);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 37, 68, 0.28);
}

.lucy .lucy-knopf[hidden] { display: none; }
.lucy .lucy-knopf:hover { background: #17345e; }
.lucy-knopf:focus-visible,
.lucy-vorschlag:focus-visible,
.lucy-termin:focus-visible,
.lucy-senden:focus-visible,
.lucy-zu:focus-visible { outline: 3px solid var(--lucy-gold); outline-offset: 2px; }

.lucy-fenster {
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100dvh - 76px);
  background: #fff;
  border: 1px solid var(--lucy-rand);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(15, 37, 68, 0.24);
}

.lucy-fenster[hidden] { display: none; }

.lucy-kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--lucy-navy);
  color: #fff;
  border-bottom: 3px solid var(--lucy-gold);
}

.lucy-kopf-text { flex: 1; min-width: 0; }
.lucy-kopf h2 { margin: 0; color: #fff; font-size: 16px; line-height: 1.2; }
.lucy-kopf p { margin: 2px 0 0; color: #D5DCE8; font-size: 12.5px; line-height: 1.3; }

.lucy-zu {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.lucy-zu:hover { background: rgba(255, 255, 255, 0.12); }

.lucy-verlauf {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: var(--lucy-flaeche);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lucy-blase {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lucy-blase-lucy { align-self: flex-start; background: #fff; color: #1D2939; border: 1px solid var(--lucy-rand); }
.lucy-blase-besucher { align-self: flex-end; background: var(--lucy-navy); color: #fff; }
.lucy-blase-fehler { align-self: flex-start; background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }

.lucy-tippt { display: inline-flex; gap: 4px; padding: 3px 0; }
.lucy-tippt span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lucy-grau);
  animation: lucy-tippen 1.1s infinite ease-in-out;
}
.lucy-tippt span:nth-child(2) { animation-delay: 0.15s; }
.lucy-tippt span:nth-child(3) { animation-delay: 0.3s; }

@keyframes lucy-tippen {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lucy-tippt span { animation: none; opacity: 0.7; }
}

.lucy-vorschlaege {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
  background: var(--lucy-flaeche);
}

.lucy-vorschlaege[hidden] { display: none; }

.lucy-vorschlag,
.lucy-termin {
  padding: 6px 11px;
  border: 1px solid var(--lucy-gold);
  border-radius: 999px;
  background: #fff;
  color: var(--lucy-navy);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.lucy-vorschlag:hover,
.lucy-termin:hover { background: #FBF6EA; }

.lucy-terminfrage { align-self: flex-start; display: flex; gap: 8px; }
.lucy-termine { align-self: flex-start; display: flex; flex-direction: column; gap: 6px; max-width: 92%; }
.lucy-termine p { margin: 0; color: var(--lucy-grau); font-size: 13px; }
.lucy-termin { text-align: left; border-radius: 10px; }
.lucy-termin-link { align-self: flex-start; padding: 2px 0; border: 0; background: none; color: var(--lucy-gold-text); font: inherit; font-size: 13.5px; text-decoration: underline; cursor: pointer; }

.lucy-buchung {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--lucy-rand);
  border-radius: 12px;
  font-size: 13.5px;
}

.lucy-buchung strong { color: var(--lucy-navy); }
.lucy-buchung label { display: flex; flex-direction: column; gap: 2px; color: #344054; }
.lucy-buchung input[type="text"],
.lucy-buchung input[type="email"],
.lucy-buchung input[type="tel"] {
  padding: 7px 9px;
  border: 1px solid #D0D5DD;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  color: #1D2939;
  background: #fff;
}

.lucy-buchung .lucy-haken { flex-direction: row; align-items: flex-start; gap: 7px; }
.lucy-buchung .lucy-haken input { margin-top: 3px; }
.lucy-buchung .lucy-haken span { display: inline; }
.lucy-buchung a { color: var(--lucy-gold-text); }
.lucy-buchung-knoepfe { display: flex; gap: 8px; align-items: center; }
.lucy-buchung-fehler { margin: 0; color: #B42318; }

.lucy-turnstile { background: #fff; }
.lucy-turnstile:not(:empty) { padding: 8px 14px 0; }

.lucy-formular {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid var(--lucy-rand);
}

.lucy-formular textarea {
  flex: 1;
  min-width: 0;
  max-height: 96px;
  padding: 8px 10px;
  border: 1px solid #D0D5DD;
  border-radius: 10px;
  resize: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  color: #1D2939;
  background: #fff;
}

.lucy-senden {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--lucy-navy);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.lucy-senden:disabled { opacity: 0.55; cursor: default; }

.lucy-hinweis {
  margin: 0;
  padding: 0 14px 10px;
  background: #fff;
  color: var(--lucy-grau);
  font-size: 11.5px;
  line-height: 1.35;
}

.lucy-hinweis a { color: var(--lucy-gold-text); }
.lucy-hinweis-kurz { display: none; }

.lucy-feld-versteckt,
.lucy-unsichtbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Handy, auch quer (Kristina 31.10.2026): kleiner runder Knopf, geoeffnet Vollbild.
   Dieselbe Bedingung steht als HANDY in lucy_chat.js. */
@media (max-width: 767px), (max-height: 500px) {
  html.lucy-voll,
  html.lucy-voll body { overflow: hidden; }

  .lucy { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .lucy .lucy-knopf { padding: 7px; }
  .lucy-knopf .lucy-punkt { width: 38px; height: 38px; font-size: 18px; }
  .lucy-knopf-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Links, damit sich unten rechts nichts stapelt. Bleibt immer erreichbar. */
  body .lp-cookie-manage-btn { right: auto; left: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); }

  /* Hoehe und Lage folgen dem sichtbaren Bereich, also auch der Tastatur (lucy_chat.js). */
  .lucy.lucy-offen {
    top: var(--lucy-oben, 0);
    right: 0;
    bottom: auto;
    left: 0;
    height: var(--lucy-hoehe, 100dvh);
  }

  /* Safari legt seine Adressleiste ueber die Tastatur: Dahinter darf die Seite nicht durchscheinen. */
  .lucy.lucy-offen::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #fff;
  }

  .lucy-fenster {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .lucy-kopf { padding: calc(8px + env(safe-area-inset-top)) 6px 8px 14px; }
  .lucy-zu { width: 44px; height: 44px; font-size: 20px; }
  .lucy-verlauf { overscroll-behavior: contain; }
  .lucy-blase { font-size: 15px; }
  .lucy-vorschlag { padding: 9px 12px; font-size: 14px; }
  .lucy-senden { padding: 10px 14px; }
  .lucy-hinweis { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

  /* Vor der ersten Frage steht der volle Hinweis, danach zaehlt der Platz fuers Gespraech. */
  .lucy-fenster:not(.lucy-start) .lucy-hinweis-lang { display: none; }
  .lucy-fenster:not(.lucy-start) .lucy-hinweis-kurz { display: inline; }
}

@media print {
  .lucy { display: none; }
}
