/* ==========================================================================
   Kundenstimme als Chat (Startseite Welt Websites, Block #stimme-denise)
   Inhalt: tools/welten.py → kundenstimme(). Ablauf: js/kundenstimme.js.
   Nur bestehende Tokens aus css/welten.css, damit Hell, Dunkel und beide Welten passen.
   Gestaltet von Claude am 09.11.2026 (Freigabe Julian, Ausnahme zur Regel „Optik macht GPT“).
   ========================================================================== */

.w-kunde__inhalt { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .w-kunde__inhalt { grid-template-columns: minmax(0, 440px) 1fr; gap: 72px; } }
.w-kunde__seite { display: grid; gap: 22px; }
.w-kunde__marke-kunde { display: grid; gap: 14px; justify-items: start; }
.w-kunde__logo {   /* Kundenlogo als Maske: färbt sich mit dem Thema (Hell dunkel, Dunkel hell) */
  display: block; width: clamp(150px, 16vw, 210px); aspect-ratio: 496 / 360; background: var(--stark);
  -webkit-mask: url('/img/kunden/done-logo.webp?v=2026-11-09-2') center / contain no-repeat; mask: url('/img/kunden/done-logo.webp?v=2026-11-09-2') center / contain no-repeat;
}
.w-kunde__hinweis { font-size: 13.5px; line-height: 1.55; color: var(--leise); max-width: 46ch; }

/* ---------- Karte ---------- */
.w-kunde__chat {
  position: relative; width: min(100%, 440px); justify-self: center; overflow: hidden;
  border: 1px solid var(--linie); border-radius: 30px;
  background: var(--glas-karte, var(--flaeche)); box-shadow: var(--schatten-gross);
}
.w-kunde__chat::before {   /* Lichtkante oben in der Weltfarbe */
  content: ''; position: absolute; inset: 0 0 auto; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--akzent), transparent); opacity: .55;
}
.w-kunde__kopf { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--linie); }
.w-kunde__avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--grund), 0 0 0 3.5px var(--akzent-weich); }
.w-kunde__wer { display: grid; min-width: 0; line-height: 1.25; }
.w-kunde__wer b { color: var(--stark); font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.w-kunde__status { font-size: 12.5px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s; }
.w-kunde__status.ist-aufnahme { color: var(--akzent); }
.w-kunde__status.ist-aufnahme::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #ef4f5a; vertical-align: 1px; animation: w-kunde-blink 1s ease-in-out infinite; }
.w-kunde__marke { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; opacity: .75; }
.w-kunde__marke .w-marke { width: 26px; height: 26px; }

/* ---------- Verlauf ---------- */
.w-kunde__verlauf {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 14px 18px; min-height: 360px;
  background-image: radial-gradient(var(--linie-stark) .8px, transparent 1.1px); background-size: 16px 16px;
}
.w-kunde__tag { align-self: center; margin-bottom: 4px; }
.w-kunde__tag span { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--flaeche-2); border: 1px solid var(--linie); font: 500 10.5px/1.4 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--leise); }

.w-kunde__blase { position: relative; max-width: 88%; padding: 10px 14px; border-radius: 20px; font-size: 15px; line-height: 1.45; }
.w-kunde__blase--wir { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--akzent); color: var(--akzent-auf); box-shadow: 0 12px 28px -16px var(--akzent); }
.w-kunde__blase--sie { align-self: flex-start; border-bottom-left-radius: 6px; background: var(--flaeche-2); color: var(--text); border: 1px solid var(--linie); }
.w-kunde__meta { display: inline-flex; vertical-align: -1px; margin-left: 8px; opacity: .45; transition: opacity .3s; }
.w-kunde__haken { width: 17px; height: 11px; }
.ist-gelesen .w-kunde__meta, .w-kunde:not(.ist-bereit) .w-kunde__meta { opacity: 1; }
.ist-gelesen .w-kunde__haken { animation: w-kunde-pop .4s var(--ease); }

/* Tippen (DPW) */
.w-kunde__tippt { align-self: flex-end; display: none; gap: 4px; padding: 13px 16px; border-radius: 20px 20px 6px 20px; background: var(--akzent-weich); border: 1px solid var(--linie); }
.w-kunde__tippt i { width: 7px; height: 7px; border-radius: 50%; background: var(--akzent); animation: w-kunde-tipp 1s ease-in-out infinite; }
.w-kunde__tippt i:nth-child(2) { animation-delay: .15s; }
.w-kunde__tippt i:nth-child(3) { animation-delay: .3s; }

/* Aufnahme (Denise) */
.w-kunde__aufnahme { align-self: flex-start; display: none; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 22px 22px 22px 6px; background: var(--flaeche-2); border: 1px solid var(--linie); }
.w-kunde__rec { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #ef4f5a; color: #fff; }
.w-kunde__rec::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ef4f5a; animation: w-kunde-ring 1.2s ease-out infinite; }
.w-kunde__rec svg { width: 18px; height: 18px; }
.w-kunde__live { display: flex; align-items: center; gap: 3px; height: 28px; }
.w-kunde__live i { width: 3px; height: 100%; border-radius: 2px; background: var(--leise); transform-origin: center; animation: w-kunde-pegel .9s ease-in-out infinite alternate; }
.w-kunde__live i:nth-child(3n) { animation-duration: .7s; } .w-kunde__live i:nth-child(4n+1) { animation-duration: 1.1s; animation-delay: -.3s; } .w-kunde__live i:nth-child(5n+2) { animation-duration: .6s; animation-delay: -.5s; }
.w-kunde__rec-zeit { font: 500 13px/1 'IBM Plex Mono', ui-monospace, monospace; color: var(--stark); font-variant-numeric: tabular-nums; }

/* ---------- Sprachnachricht ---------- */
.w-kunde__sprach { width: 100%; max-width: 100%; padding: 12px 14px 14px; }
.w-kunde__spieler { display: grid; grid-template-columns: 44px minmax(0, 1fr) 48px; align-items: center; gap: 12px; }
.w-kunde__play {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--akzent); color: var(--akzent-auf); box-shadow: 0 10px 24px -12px var(--akzent); transition: transform .2s var(--ease);
}
.w-kunde__play:hover { transform: scale(1.06); }
.w-kunde__play:active { transform: scale(.94); }
.w-kunde__play svg { width: 20px; height: 20px; }
.w-kunde__i-pause, .ist-spielt .w-kunde__i-play { display: none; }
.ist-spielt .w-kunde__i-pause { display: block; }

.w-kunde__welle { --p: 0; position: relative; display: flex; align-items: center; gap: 2px; height: 36px; cursor: pointer; touch-action: none; border-radius: 6px; }
.w-kunde__welle i { flex: 1 1 0; min-width: 1.5px; height: var(--h); min-height: 3px; border-radius: 2px; background: var(--leise); opacity: .42; transition: background-color .2s, opacity .2s; }
.w-kunde__welle i.an { background: var(--akzent); opacity: 1; }
.w-kunde__welle::after {   /* Abspielkopf */
  content: ''; position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-weich); opacity: 0; transition: opacity .25s;
}
.ist-laeuft-oder-pos .w-kunde__welle::after { opacity: 1; }
.w-kunde__welle:focus-visible { outline-offset: 6px; }

.w-kunde__bild { position: relative; width: 48px; height: 48px; }
.w-kunde__bild img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.w-kunde__bild-mikro { position: absolute; left: -4px; bottom: -2px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--akzent); color: var(--akzent-auf); box-shadow: 0 0 0 2px var(--flaeche-2); }
.w-kunde__bild-mikro svg { width: 12px; height: 12px; }

.w-kunde__leiste { display: flex; align-items: center; gap: 10px; min-height: 30px; margin-top: 6px; padding-left: 56px; }
.w-kunde__zeit { font: 500 12.5px/1 'IBM Plex Mono', ui-monospace, monospace; color: var(--leise); font-variant-numeric: tabular-nums; }
.w-kunde__ton, .w-kunde__tempo { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border-radius: 999px; font: 600 12.5px/1 'Archivo', system-ui, sans-serif; }
.w-kunde__ton { position: relative; padding: 0 12px 0 10px; border: 0; background: var(--akzent); color: var(--akzent-auf); }
.w-kunde__ton::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--akzent); animation: w-kunde-ring 1.6s ease-out infinite; pointer-events: none; }
.w-kunde__ton svg { width: 16px; height: 16px; }
.w-kunde__tempo { margin-left: auto; justify-content: center; min-width: 40px; padding: 0 10px; border: 1px solid var(--linie-stark); background: transparent; color: var(--stark); font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.w-kunde__tempo:hover { border-color: var(--akzent); }

.w-kunde__audio { width: 100%; margin-top: 10px; }
.w-kunde.ist-bereit .w-kunde__audio { display: none; }
.w-kunde:not(.ist-bereit) .w-kunde__play, .w-kunde:not(.ist-bereit) .w-kunde__leiste { display: none; }
.w-kunde:not(.ist-bereit) .w-kunde__spieler { grid-template-columns: minmax(0, 1fr) 48px; }

/* Transkript mit Mitlesen */
.w-kunde__transkript { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linie); }
.w-kunde__transkript-titel { margin-bottom: 6px; font: 500 10.5px/1.4 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--leise); }
.w-kunde__text { position: relative; font-size: 15px; line-height: 1.6; color: var(--text); }
.ist-bereit .w-kunde__text {
  max-height: 9.6em; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent);
  padding-block: 1.1em 1.6em;
}
.ist-bereit .w-kunde__text::-webkit-scrollbar { display: none; }
.ist-bereit .w-kunde__transkript.ist-offen .w-kunde__text { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-block: 0; }
.w-kunde__satz { border-radius: 6px; padding: .05em .1em; margin: 0 -.1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color .4s var(--ease); }
.w-kunde__wort { transition: color .25s var(--ease), text-shadow .25s; }
.ist-mitlesen .w-kunde__wort { color: var(--leise); }
.ist-mitlesen .w-kunde__wort.ist-gesagt { color: var(--stark); }
.ist-mitlesen .w-kunde__wort.ist-jetzt { color: var(--akzent); text-shadow: 0 0 18px var(--akzent-weich); }
.ist-mitlesen .w-kunde__satz.ist-jetzt { background: var(--akzent-weich); }
.w-kunde__mehr { margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--akzent); font: 600 13px/1.3 'Archivo', system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; }

/* Reaktion: Auswahl blitzt kurz auf, dann sitzt das Herz an der Blase */
.w-kunde__sprach.hat-reaktion { margin-bottom: 16px; }
.w-kunde__reaktion {
  position: absolute; right: 14px; bottom: -15px; z-index: 2; display: none; align-items: center; justify-content: center;
  height: 28px; min-width: 36px; padding: 0 8px; border-radius: 999px; font-size: 15px; line-height: 1;
  background: var(--grund-2); border: 1px solid var(--linie-stark); box-shadow: var(--schatten);
}
.hat-reaktion .w-kunde__reaktion { display: inline-flex; animation: w-kunde-herz .65s var(--ease) both; }
.w-kunde__waehler {
  position: absolute; right: 6px; top: -50px; z-index: 3; display: none; gap: 2px; padding: 5px 7px; border-radius: 999px;
  background: var(--grund-2); border: 1px solid var(--linie-stark); box-shadow: var(--schatten-gross);
}
.w-kunde__waehler i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-style: normal; font-size: 21px; line-height: 1; transition: transform .3s var(--ease), background-color .3s; }
.zeigt-waehler .w-kunde__waehler { display: flex; animation: w-kunde-rein-r .35s var(--ease) both; }
.waehlt .w-kunde__waehler .ist-herz { transform: scale(1.35) translateY(-3px); background: var(--akzent-weich); }
@keyframes w-kunde-herz { 0% { opacity: 0; transform: translateY(-34px) scale(.4); } 60% { opacity: 1; transform: scale(1.25); } 100% { transform: none; } }

/* ---------- Ablauf: Teile erscheinen nacheinander (nur mit JS und ohne „weniger Bewegung“) ---------- */
.w-kunde.ist-bereit .w-kunde__blase--wir, .w-kunde.ist-bereit .w-kunde__sprach, .w-kunde.ist-bereit .w-kunde__transkript { display: none; }
.w-kunde.s-tippt .w-kunde__tippt { display: inline-flex; animation: w-kunde-rein .35s var(--ease) both; }
.w-kunde.s-wir .w-kunde__blase--wir { display: block; animation: w-kunde-rein-r .55s var(--ease) both; }
.w-kunde.s-aufnahme .w-kunde__aufnahme { display: inline-flex; animation: w-kunde-rein .45s var(--ease) both; }
.w-kunde.s-sprach .w-kunde__sprach { display: block; animation: w-kunde-rein .6s var(--ease) both; }
.w-kunde.s-transkript .w-kunde__transkript { display: block; animation: w-kunde-auf .7s var(--ease) both; }
.w-kunde.s-sprach .w-kunde__welle i { animation: w-kunde-balken .6s var(--ease) both; animation-delay: calc(var(--n, 0) * 12ms); }

@keyframes w-kunde-rein { from { opacity: 0; transform: translateY(10px) scale(.94); transform-origin: left bottom; } to { opacity: 1; transform: none; } }
@keyframes w-kunde-rein-r { from { opacity: 0; transform: translateY(10px) scale(.94); transform-origin: right bottom; } to { opacity: 1; transform: none; } }
@keyframes w-kunde-auf { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes w-kunde-balken { from { transform: scaleY(.15); opacity: 0; } to { transform: none; } }
@keyframes w-kunde-tipp { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes w-kunde-pegel { from { transform: scaleY(.18); } to { transform: scaleY(1); } }
@keyframes w-kunde-ring { from { transform: scale(1); opacity: .7; } to { transform: scale(1.5); opacity: 0; } }
@keyframes w-kunde-blink { 50% { opacity: .25; } }
@keyframes w-kunde-pop { 40% { transform: scale(1.35); } }

@media (prefers-reduced-motion: reduce) {
  .w-kunde *, .w-kunde *::before, .w-kunde *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 420px) {
  .w-kunde__verlauf { padding-inline: 10px; }
  .w-kunde__spieler { grid-template-columns: 40px minmax(0, 1fr) 42px; gap: 10px; }
  .w-kunde__play { width: 40px; height: 40px; }
  .w-kunde__bild, .w-kunde__bild img { width: 42px; height: 42px; }
  .w-kunde__leiste { padding-left: 50px; }
}
