/* ==========================================================================
   Schwebender Chat nach „Webseite eintragen" (16.09.2026)
   ========================================================================== */

.wchat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  width: min(380px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  max-height: min(560px, calc(100vh - 110px));
  background: #fff;
  color: var(--text, #001531);
  border: 1px solid rgba(0, 21, 49, .14);
  border-top: 4px solid var(--orange, #FE8A00);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 21, 49, .22);
  overflow: hidden;
}
.wchat[hidden] { display: none; }

.wchat__kopf {
  display: flex;
  align-items: center;
  background: var(--brand-navy, #001531);
  color: #fff;
}
.wchat__titel {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem .9rem;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.wchat__punkt {
  width: .6rem; height: .6rem;
  border-radius: 50%;
  background: var(--orange, #FE8A00);
  box-shadow: 0 0 0 3px rgba(254, 138, 0, .3);
}
.wchat__zu {
  padding: .4rem .8rem;
  font-size: 1.5rem;
  line-height: 1;
  color: rgba(255, 255, 255, .8);
  background: none;
  border: 0;
  cursor: pointer;
}
.wchat__zu:hover { color: #fff; }

.wchat__rumpf { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.wchat.ist-klein .wchat__rumpf { display: none; }

.wchat__verlauf {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: .8rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  background: var(--bg, #F3F0E9);
}

.wchat__nachricht {
  max-width: 88%;
  padding: .55rem .75rem;
  border-radius: 10px;
  font-size: .9rem;
  line-height: 1.4;
}
.wchat__nachricht p { margin: 0; white-space: pre-wrap; }
.wchat__nachricht--helfer {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(0, 21, 49, .1);
  border-bottom-left-radius: 3px;
}
.wchat__nachricht--besucher {
  align-self: flex-end;
  background: var(--brand-navy, #001531);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.wchat__nachricht-titel { display: block; margin-bottom: .2rem; font-size: .98rem; }

.wchat__karte {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin-top: .55rem;
  padding: .6rem .7rem;
  color: var(--text, #001531);
  text-decoration: none;
  background: var(--orange-soft, #FFEBD1);
  border-left: 3px solid var(--orange, #FE8A00);
  border-radius: 6px;
}
.wchat__karte:hover { background: #FFE0B8; }
.wchat__karte strong { font-size: .98rem; }
.wchat__karte-zeile { font-size: .82rem; color: var(--text-muted, #5F6874); }
.wchat__karte-text  { font-size: .84rem; margin-top: .2rem; }
.wchat__karte-los   { margin-top: .3rem; font-weight: 700; font-size: .84rem; color: var(--orange-dark, #A85400); }

.wchat__tippt { display: flex; gap: .25rem; }
.wchat__tippt span {
  width: .45rem; height: .45rem;
  border-radius: 50%;
  background: var(--text-muted, #5F6874);
  animation: wchat-tippt 1s infinite ease-in-out;
}
.wchat__tippt span:nth-child(2) { animation-delay: .15s; }
.wchat__tippt span:nth-child(3) { animation-delay: .3s; }
@keyframes wchat-tippt { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.wchat__form {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  padding: .6rem;
  border-top: 1px solid rgba(0, 21, 49, .1);
  background: #fff;
}
.wchat__eingabe {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: .5rem .6rem;
  font: inherit;
  font-size: .9rem;
  border: 1px solid rgba(0, 21, 49, .25);
  border-radius: 8px;
}
.wchat__eingabe:focus { outline: 2px solid var(--orange, #FE8A00); outline-offset: 0; border-color: transparent; }
.wchat__senden {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  color: #fff;
  background: var(--orange, #FE8A00);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.wchat__senden:disabled { opacity: .5; cursor: wait; }

@media (max-width: 640px) {
  .wchat {
    right: 8px;
    left: 8px;
    /* Über der Fußleiste der App */
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: calc(100vh - 160px);
  }
}
