/* Abstand des Toni-Widgets vom unteren Rand. Layouts mit Bottom-Bar (Kunden-App)
   setzen .toni-offset-bottom-bar; Desktop bleibt 0. */
:root { --toni-bottom-offset: 0px; }
@media (max-width: 767px) {
  .toni-offset-bottom-bar { --toni-bottom-offset: calc(3.5rem + env(safe-area-inset-bottom, 0px)); }
}

/* Willkommens-Bühne — Systemfarben der App (globale Tokens aus app.react.css, hell und
   dunkel). Keine eigenen Grundfarben. */
.wb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  animation: wb-ein 420ms ease-out;
}

.wb :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Kopf */
.wb-kopf {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  padding-top: calc(14px + env(safe-area-inset-top));
}
.wb-toni { display: flex; align-items: center; gap: 8px; font-weight: 600; flex: none; }
.wb-toni img { border-radius: 9999px; box-shadow: 0 0 0 2px var(--gold); }
.wb-fortschritt { flex: 1; display: flex; gap: 6px; max-width: 420px; margin: 0 auto; }
.wb-strich {
  flex: 1;
  height: 4px;
  border-radius: 9999px;
  background: var(--stroke-strong);
  transition: background 300ms;
}
.wb-strich[data-stand='fertig'] { background: var(--gold-soft); }
.wb-strich[data-stand='jetzt'] { background: var(--gold); }

/* Bühne */
.wb-buehne {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: 8px clamp(16px, 6vw, 96px) 24px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  animation: wb-szene 480ms ease-out;
}
.wb-bild { display: flex; justify-content: center; align-items: center; min-width: 0; }
.wb-text { max-width: 34rem; }
.wb-ueber {
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--copper); font-weight: 600; margin-bottom: 10px;
}
.wb-titel {
  font-family: var(--font-serif, Lora, Georgia, serif);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  font-weight: 600;
  margin-bottom: 18px;
  text-wrap: balance;
}
.wb-fliess { display: grid; gap: 12px; font-size: 17px; line-height: 1.6; color: var(--ink-soft); }
.wb-merksatz {
  font-family: var(--font-serif, Lora, Georgia, serif);
  font-size: 20px; color: var(--ink); border-left: 3px solid var(--gold); padding-left: 12px;
}
.wb-aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.wb-zahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.wb-zahlen div { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; padding: 10px 12px; }
.wb-zahlen dt { font-family: var(--font-serif, Lora, Georgia, serif); font-size: 24px; font-weight: 600; color: var(--ink); }
.wb-zahlen dd { font-size: 13px; color: var(--ink-muted); }

/* Fuß */
.wb-fuss {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--stroke);
}

/* Knöpfe */
.wb-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 9999px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background 200ms, box-shadow 200ms, opacity 200ms;
}
.wb-knopf:disabled { opacity: .35; cursor: default; }
.wb-knopf--gold { background: var(--gold); color: var(--sh-bg-0, #141210); box-shadow: var(--shadow-gold); }
.wb-knopf--gold:hover { background: var(--gold-soft); }
.wb-knopf--rand { border: 1px solid var(--stroke-strong); color: var(--ink); background: var(--surface); }
.wb-knopf--rand:hover { border-color: var(--gold); }
.wb-knopf--leise { color: var(--ink-muted); }
.wb-knopf--leise:not(:disabled):hover { color: var(--ink); }

/* SVG-Grafiken */
.wb-svg { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.wb-f-flaeche { fill: var(--surface); }
.wb-f-rand { fill: none; stroke: var(--stroke-strong); stroke-width: 1.5; }
.wb-f-gold { fill: var(--gold); }
.wb-f-goldweich { fill: var(--gold-bg); stroke: var(--gold-border); }
.wb-f-tinte { fill: var(--ink); }
.wb-f-leise { fill: var(--bg-subtle, var(--surface-muted)); stroke: var(--stroke); }
.wb-f-linie { stroke: var(--gold-border); stroke-width: 1.5; fill: none; }
.wb-f-welle { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.wb-svg-klein { font-size: 8px; fill: var(--ink-soft); }
.wb-svg-mittel { font-size: 14px; font-weight: 600; fill: var(--ink); }
.wb-svg-auf-gold { fill: var(--sh-bg-0, #141210); font-size: 6px; }
.wb-svg-frage { font-size: 42px; font-weight: 600; fill: var(--ink-faint); }
.wb-wellen path { animation: wb-welle 1.8s ease-in-out infinite; }
.wb-wellen path:nth-child(2) { animation-delay: .25s; }
.wb-wellen path:nth-child(3) { animation-delay: .5s; }

.wb-vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 460px; }
.wb-vgl { border-radius: 18px; padding: 16px; border: 1px solid var(--stroke); background: var(--surface); }
.wb-vgl--gold { border-color: var(--gold-border); box-shadow: var(--shadow-gold); }
.wb-vgl figcaption { display: grid; gap: 4px; margin-top: 10px; font-size: 14px; color: var(--ink-muted); }
.wb-vgl figcaption strong { color: var(--ink); font-size: 15px; }
.wb-vgl--grau figcaption span { text-decoration: line-through; text-decoration-color: var(--ink-faint); }

.wb-video { width: 100%; max-width: 520px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--onyx); }
.wb-video video { display: block; width: 100%; max-height: 60vh; }
.wb-video--poster { position: relative; display: block; padding: 0; }
.wb-video--poster img { display: block; width: 100%; max-height: 60vh; -o-object-fit: cover; object-fit: cover; }
.wb-play {
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--sh-bg-0, #141210); box-shadow: var(--shadow-gold);
}

.wb-toni-gross img { border-radius: 9999px; box-shadow: 0 0 0 4px var(--gold), var(--shadow-xl); }

/* Handy */
@media (max-width: 767px) {
  .wb-buehne { grid-template-columns: 1fr; align-content: start; gap: 20px; padding-top: 4px; }
  .wb-set { max-height: 34vh; }
  .wb-svg--klein { max-height: 22vh; }
  .wb-titel { font-size: 26px; margin-bottom: 12px; }
  .wb-vergleich { gap: 10px; }
  .wb-vgl { padding: 10px; border-radius: 14px; }
  .wb-vgl .wb-svg { max-height: 64px; }
  .wb-vgl figcaption { margin-top: 6px; font-size: 13px; gap: 2px; }
  .wb-vgl figcaption strong { font-size: 14px; }
  .wb-zahlen dt { font-size: 20px; }
  .wb-svg { max-width: 300px; }
  .wb-video video, .wb-video--poster img { max-height: 34vh; }
  .wb-fliess { font-size: 16px; }
  .wb-toni span { display: none; }
  .wb-aktionen .wb-knopf { width: 100%; }
}

@keyframes wb-ein { from { opacity: 0; } to { opacity: 1; } }
@keyframes wb-szene { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes wb-welle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .wb, .wb-buehne, .wb-wellen path { animation: none; }
}

/* Stefan */
.wb-stefan { margin: 0; width: 100%; max-width: 380px; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--stroke); box-shadow: var(--shadow-lg); }
.wb-stefan img { display: block; width: 100%; aspect-ratio: 4 / 4.2; -o-object-fit: cover; object-fit: cover; -o-object-position: 60% 30%; object-position: 60% 30%; }
.wb-stefan figcaption { display: grid; gap: 2px; padding: 12px 16px; font-size: 14px; color: var(--ink-muted); }
.wb-stefan figcaption strong { color: var(--ink); font-size: 16px; }
@media (max-width: 767px) {
  .wb-stefan { display: flex; align-items: center; max-width: none; }
  .wb-stefan img { width: 96px; height: 96px; aspect-ratio: 1; flex: none; -o-object-position: 62% 32%; object-position: 62% 32%; }
}

/* Marcel / Selbstläufer */
.wb-marcel { margin: 0; width: 100%; max-width: 520px; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--stroke); box-shadow: var(--shadow-lg); }
.wb-marcel img { display: block; width: 100%; aspect-ratio: 16 / 9; -o-object-fit: cover; object-fit: cover; -o-object-position: 70% 40%; object-position: 70% 40%; }
.wb-marcel figcaption { display: grid; gap: 2px; padding: 12px 16px; font-size: 14px; color: var(--ink-muted); }
.wb-marcel figcaption strong { color: var(--ink); font-size: 16px; }

/* Rückruf von Stefan */
.wb-rueckruf { display: grid; gap: 12px; width: 100%; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--gold-border); }
.wb-feld { display: grid; gap: 6px; font-size: 14px; color: var(--ink-muted); }
.wb-feld input {
  min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 17px;
  border: 1px solid var(--stroke-strong); background: var(--bg); color: var(--ink);
}
.wb-feld input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.wb-zeiten { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-zeit { min-height: 40px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--stroke-strong); color: var(--ink-soft); font-size: 14px; }
.wb-zeit[aria-checked='true'] { border-color: var(--gold); background: var(--gold-bg); color: var(--ink); font-weight: 600; }
.wb-fehler { color: var(--danger); font-size: 14px; }
.wb-rueckruf-ok { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 14px; background: var(--patina-bg); color: var(--ink); font-weight: 600; }

/* Was aus einem Interview entsteht — Bildkacheln */
.wb-alles { width: 100%; max-width: 520px; display: grid; gap: 14px; justify-items: center; }
.wb-alles-kern { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 9999px; background: var(--gold); color: var(--sh-bg-0, #141210); font-weight: 600; box-shadow: var(--shadow-gold); }
.wb-alles-kern img { width: 36px; height: 36px; border-radius: 9999px; -o-object-fit: cover; object-fit: cover; -o-object-position: 60% 30%; object-position: 60% 30%; }
.wb-alles-liste { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.wb-alles-liste li { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--surface-muted); box-shadow: var(--shadow-sm); }
.wb-alles-liste img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; display: block; }
.wb-alles-label {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 5px;
  padding: 18px 8px 7px; font-size: 12px; font-weight: 600; color: #FAF8F3;
  background: linear-gradient(to top, rgba(20,18,16,.82), rgba(20,18,16,0));
}
.wb-alles-label svg { color: var(--gold-light, #EBC96F); flex: none; }

/* Netzwerk */
.wb-netz { max-width: 380px; }
.wb-svg-auf-gold-gross { fill: var(--sh-bg-0, #141210); }
.wb-netz-linie { stroke: var(--gold); stroke-width: 2; animation: wb-welle 2.4s ease-in-out infinite; }
@media (max-width: 767px) {
  .wb-alles-liste { gap: 6px; }
  .wb-alles-label { font-size: 10px; padding: 14px 5px 5px; gap: 3px; }
  .wb-alles-label svg { display: none; }
  .wb-netz { max-height: 30vh; }
}

/* Haupt-CTA Rückruf */
.wb-rueckruf-cta { display: grid; gap: 6px; justify-items: start; }
.wb-rueckruf-cta span { font-size: 13px; color: var(--ink-muted); }
@media (max-width: 767px) { .wb-rueckruf-cta { justify-items: stretch; width: 100%; } }

/* Reiter „Kommunikation" (Superhuman-Vorlage) — Systemfarben der App, hell und dunkel. */
.km { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) 280px; height: min(78vh, 900px); min-height: 520px; border-top: 1px solid var(--rcm-border-2, var(--stroke-soft)); background: var(--surface, #fff); color: var(--ink); outline: none; }
@media (max-width: 1279px) { .km { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); } .km-person { display: none; } }
@media (max-width: 767px) {
  .km { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .km .km-lesen { display: none; }
  .km[data-lesen] .km-liste { display: none; }
  .km[data-lesen] .km-lesen { display: flex; }
}
.km-leise { color: var(--ink-muted); }

/* Liste */
.km-liste { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--stroke-soft); }
.km-leiste { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--stroke-soft); }
.km-filter { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9999px; background: var(--surface-muted); }
.km-filter button { border-radius: 9999px; padding: 4px 10px; font-size: 0.75rem; color: var(--ink-muted); white-space: nowrap; }
.km-filter button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.km-neu { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 0.8125rem; color: var(--ink-soft); }
.km-neu:hover { background: var(--surface-muted); color: var(--ink); }
.km-neu:disabled { opacity: 0.4; }
.km-zeilen { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 767px) { .km-zeilen { max-height: 70vh; } }
.km-gruppe { padding: 12px 14px 4px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.km-zeile { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; grid-template-areas: 'icon wer datum' 'icon was was'; -moz-column-gap: 8px; column-gap: 8px; row-gap: 1px; width: 100%; padding: 9px 14px; text-align: left; border-left: 2px solid transparent; }
.km-zeile:hover { background: var(--surface-muted); }
.km-zeile[aria-current] { background: var(--gold-bg, var(--surface-muted)); border-left-color: var(--gold); }
.km-zeile > svg, .km-terminmarke { grid-area: icon; margin-top: 3px; color: var(--ink-muted); }
.km-terminmarke { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; }
.km-zeile-wer { grid-area: wer; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.km-zeile[data-ungelesen] .km-zeile-wer { color: var(--ink); font-weight: 700; }
.km-zeile-was { grid-area: was; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-muted); }
.km-zeile-was b { font-weight: 500; color: var(--ink); }
.km-datum { grid-area: datum; font-size: 0.6875rem; letter-spacing: 0.04em; color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.km-leer { padding: 24px 16px; font-size: 0.875rem; color: var(--ink-muted); line-height: 1.5; }

/* Lesen */
.km-lesen { display: flex; min-height: 0; background: var(--bg, var(--surface)); }
.km-nav { flex: none; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 10px; }
.km-rund { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9999px; background: var(--surface); color: var(--ink-muted); box-shadow: var(--shadow-xs), 0 0 0 1px var(--stroke-soft); }
.km-rund:hover { color: var(--ink); }
.km-rund-gruppe { display: flex; flex-direction: column; border-radius: 9999px; background: var(--surface); box-shadow: var(--shadow-xs), 0 0 0 1px var(--stroke-soft); }
.km-rund-gruppe .km-rund { box-shadow: none; background: transparent; }
.km-zurueck { display: none; }
@media (max-width: 767px) { .km-nav { flex-direction: row; padding: 10px 10px 0; } .km-lesen { flex-direction: column; } .km-zurueck { display: inline-flex; } .km-rund-gruppe { flex-direction: row; margin-left: auto; } }
.km-inhalt { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px 32px 8px; }
@media (max-width: 767px) { .km-inhalt { padding: 12px; } }
.km-betreff-gross { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; margin: 4px 0 16px; overflow-wrap: anywhere; }
@media (max-width: 767px) { .km-betreff-gross { font-size: 1.25rem; } }
.km-karte { border-radius: 4px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--stroke-soft); overflow: hidden; }
.km-karte-kopf { display: flex; align-items: baseline; gap: 8px; padding: 18px 22px 4px; font-size: 0.9375rem; }
.km-karte-kopf .km-datum { margin-left: auto; }
.km-karte-text { padding: 8px 22px 18px; font-size: 0.9375rem; line-height: 1.6; }
.km-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 16px; }
.km-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; border: 1px solid color-mix(in srgb, #6aa9d8 45%, var(--stroke)); color: #3d7fb8; font-size: 0.8125rem; font-weight: 500; background: color-mix(in srgb, #6aa9d8 8%, var(--surface)); }
.km-chip:hover { background: color-mix(in srgb, #6aa9d8 16%, var(--surface)); }

/* Entwurf direkt in der Karte */
.km-entwurf { border-top: 1px solid var(--stroke-soft); padding: 16px 22px 14px; }
.km-entwurf-kopf { font-size: 0.9375rem; color: var(--ink-soft); margin-bottom: 8px; }
.km-entwurf-marke { color: #5a9e6f; font-weight: 600; }
.km-wahl { border: 0; border-bottom: 1px dashed var(--stroke-strong, var(--stroke)); background: transparent; color: var(--ink); font-size: 0.9375rem; outline: none; }
.km-betreff { width: 100%; border: 0; border-bottom: 1px solid var(--stroke-soft); padding: 6px 0; margin-bottom: 6px; font-size: 16px; color: var(--ink); background: transparent; outline: none; }
.km-text { width: 100%; resize: vertical; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.6; color: var(--ink); min-height: 96px; }
@media (min-width: 768px) { .km-betreff, .km-text { font-size: 0.9375rem; } }
.km-entwurf-fuss { display: flex; align-items: center; gap: 18px; padding-top: 10px; }
.km-senden { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.km-senden:disabled { color: var(--ink-faint, var(--ink-muted)); }
.km-leise-knopf { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--ink-muted); }
.km-leise-knopf:hover { color: var(--ink); }

/* Personenleiste */
.km-person { min-height: 0; overflow-y: auto; padding: 20px 20px 24px; border-left: 1px solid var(--stroke-soft); background: var(--bg-subtle, var(--surface-muted)); }
.km-person-name { font-size: 1.125rem; font-weight: 500; margin-bottom: 14px; }
.km-person-kopf { display: flex; align-items: center; gap: 12px; }
.km-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 9999px; background: var(--gold-bg, var(--surface-muted)); color: var(--ink-soft); font-weight: 600; box-shadow: 0 0 0 2px var(--surface); }
.km-person-mail { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.km-person-unter { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--ink-muted); }
.km-person-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: 0.875rem; font-weight: 600; color: var(--ink-soft); }
.km-person-h svg { color: var(--ink-muted); }
.km-person-liste { display: flex; flex-direction: column; gap: 2px; }
.km-person-liste button { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; width: 100%; text-align: left; padding: 4px 0; font-size: 0.8125rem; color: var(--ink-soft); }
.km-person-liste button:hover { color: var(--ink); }
.km-person-liste button i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.km-person-liste button span { flex-basis: 100%; padding-left: 14px; font-size: 0.6875rem; color: var(--ink-muted); }
.km-person-liste .km-vorbei button { opacity: 0.65; }
.km-link-knopf { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.8125rem; color: var(--ink-soft); }
.km-link-knopf:hover { color: var(--ink); }
.km-person-links { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.km-person-links a { display: inline-flex; align-items: center; gap: 10px; font-size: 0.875rem; font-weight: 500; color: var(--ink-soft); }
.km-person-links a:hover { color: var(--ink); }
.km-person-links svg { color: var(--ink-muted); }

