/**
 * kundenberaterin.css — Voice-Bot Overlay (Wi.Fo!-Lab Design System)
 *
 * Single-File-Stylesheet für das Plugin-Frontend. Enthält:
 * - Design-Tokens (Farben, Typo, Spacing, Radii, Shadows, Motion)
 * - Komponenten: FAB, Modal mit Brand-Frame, Header, Chat,
 *   Tool-Pills, Produkt-Carousel, Quickstart-Chips, Input-Dock,
 *   Voice-Wave + Text-Card, Error-Banner, Orb-Container
 *
 * Klassen-Präfix: .kb-* (alle Selektoren scoped, kein Element-Selektor
 * außerhalb von .kb-modal-root).
 *
 * Z-Index-Bereich: 9998 (FAB) / 9999 (Modal) — verträglich mit den
 * üblichen Cookie-Bannern (~9000).
 *
 * Schriften: Nunito + Nunito Sans. Werden via <link> im PHP-Inject
 * geladen (FrontendInject.php), nicht via @import (FOUT vermeiden).
 */

/* ==========================================================================
   Design Tokens
   ========================================================================== */

:root {
  /* Brand-Palette */
  --wl-orange-500: #F78B16;
  --wl-orange-600: #DC811E;
  --wl-orange-100: #FFEAD3;
  --wl-cyan-500:   #65B4C0;
  --wl-cyan-700:   #16262A;
  --wl-cyan-100:   #DEEEF2;
  --wl-green-500:  #9BC44A;

  /* Neutrals */
  --wl-ink-900: #1B1A16;
  --wl-ink-800: #1A1A1E;
  --wl-ink-700: #2A2A26;
  --wl-ink-500: #5A5C5E;
  --wl-ink-400: #939898;
  --wl-ink-200: #D6D6D6;
  --wl-ink-100: #ECECEC;
  --wl-ink-50:  #F6F7F8;
  --wl-white:   #FFFFFF;

  /* Typografie */
  --wl-font-display: 'Nunito', 'Nunito Sans', system-ui, sans-serif;
  --wl-font-body:    'Nunito Sans', 'Nunito', system-ui, sans-serif;
  --wl-font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Komponenten-Tokens (scoped) */
  --kb-accent:        var(--wl-orange-500);
  --kb-accent-hover:  var(--wl-orange-600);
  --kb-accent-soft:   var(--wl-orange-100);
  --kb-cyan:          var(--wl-cyan-500);
  --kb-green:         var(--wl-green-500);

  /* Brand-Frame-Gradient */
  --kb-frame-top:    var(--wl-orange-500);
  --kb-frame-bottom: #fcd9b3;

  --kb-user-bubble-bg: var(--wl-cyan-500);
  --kb-user-bubble-fg: #fff;

  --kb-fg:       var(--wl-ink-50);
  --kb-fg-muted: rgba(246, 246, 244, 0.62);
  --kb-fg-dim:   rgba(246, 246, 244, 0.42);

  --kb-glass-bg:           rgba(255, 255, 255, 0.06);
  --kb-glass-border:       rgba(255, 255, 255, 0.18);
  --kb-glass-strong-bg:    rgba(0, 0, 0, 0.32);
  --kb-glass-strong-border: rgba(255, 255, 255, 0.34);

  --kb-modal-bg:     #14130f;
  --kb-modal-border: rgba(255, 255, 255, 0.08);

  --kb-shadow-card: 0 12px 36px rgba(0, 0, 0, 0.34), 0 2px 6px rgba(0, 0, 0, 0.22);
  --kb-shadow-fab:  0 14px 32px -8px rgba(247, 139, 22, 0.55), 0 4px 12px rgba(0, 0, 0, 0.35);

  --kb-radius-card:   22px;
  --kb-radius-bubble: 20px;
  --kb-radius-input:  22px;

  --kb-blur: 14px;
}

/* ==========================================================================
   Floating Action Button (FAB)
   ========================================================================== */

.kb-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: var(--kb-accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--kb-shadow-fab);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1), box-shadow 220ms ease;
  font-family: var(--wl-font-display);
}

.kb-fab::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(247, 139, 22, .35), transparent 70%);
  z-index: -1;
  opacity: 0;
  transition: opacity 280ms ease;
}

.kb-fab:hover { transform: translateY(-2px) scale(1.04); }
.kb-fab:hover::before { opacity: 1; }
.kb-fab:active { transform: scale(.96); }
.kb-fab.is-open { transform: scale(.9) rotate(-8deg); }

.kb-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: .5;
  animation: kbFabPulse 2.2s ease-out infinite;
  pointer-events: none;
}

@keyframes kbFabPulse {
  0%   { transform: scale(1);   opacity: .45; }
  100% { transform: scale(1.6); opacity: 0;   }
}

.kb-fab__icon { width: 26px; height: 26px; }

/* ==========================================================================
   Modal mit Brand-Frame
   ========================================================================== */

.kb-modal-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.kb-modal-root.is-open { pointer-events: auto; }

.kb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 5, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 280ms ease;
}

.kb-modal-root.is-open .kb-backdrop { opacity: 1; }

/* Brand-Frame: 3px Gradient außen, Stage darin */
.kb-modal {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(440px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 48px));
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg,
    var(--kb-frame-top) 0%,
    var(--kb-frame-top) 18%,
    var(--kb-frame-bottom) 100%);
  color: var(--kb-fg);
  font-family: var(--wl-font-body);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55), 0 8px 24px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(.96);
  transform-origin: bottom right;
  opacity: 0;
  transition: transform 320ms cubic-bezier(.2, .85, .25, 1.05),
              opacity 240ms ease,
              background 200ms ease;
}

.kb-modal-root.is-open .kb-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Innere dunkle Stage — Inner-Radius parallel zu Outer (28 − 3 = 25) */
.kb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 3px 3px;
  background: var(--kb-modal-bg);
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25) inset;
}

@media (max-width: 520px) {
  .kb-modal {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: calc(100vh - 16px);
    border-radius: 22px;
  }
}

/* ==========================================================================
   Stage-Hintergrund (Glow-Scene)
   ========================================================================== */

.kb-scene {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(80% 70% at 20% 25%, rgba(247, 139, 22, 0.18), transparent 60%),
    radial-gradient(65% 60% at 85% 90%, rgba(101, 180, 192, 0.20), transparent 60%),
    radial-gradient(50% 40% at 60% 50%, rgba(247, 139, 22, 0.10), transparent 70%),
    linear-gradient(160deg, #1b1812 0%, #14130f 60%, #0e0d0a 100%);
}

.kb-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 2px 2px;
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.kb-modal-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header (Logo + Brand + 3-Punkte-Placeholder)
   ========================================================================== */

.kb-header {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px 18px 18px;
  background: transparent;
  color: #fff;
}

.kb-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--kb-accent);
  flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18), 0 1px 0 rgba(255, 255, 255, .6) inset;
  overflow: hidden;
}

.kb-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kb-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}

.kb-brand__name {
  font-family: var(--wl-font-display);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.01em;
}

.kb-brand__shop {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .82);
  font-weight: 500;
  margin-top: 2px;
}

.kb-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.kb-header__btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 160ms ease, transform 160ms ease;
}

.kb-header__btn:hover { background: rgba(255, 255, 255, .28); transform: scale(1.05); }
.kb-header__btn:active { transform: scale(.94); }
.kb-header__btn svg { width: 16px; height: 16px; }

/* ==========================================================================
   Chat-Bereich
   ========================================================================== */

.kb-chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.kb-chat::-webkit-scrollbar { width: 6px; }
.kb-chat::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 999px; }
.kb-chat::-webkit-scrollbar-track { background: transparent; }

.kb-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.kb-msg--user  { align-self: flex-end;   align-items: flex-end; }
.kb-msg--agent { align-self: flex-start; align-items: flex-start; }

.kb-bubble {
  padding: 11px 15px;
  border-radius: var(--kb-radius-bubble);
  font-size: 14.5px;
  line-height: 1.45;
  word-break: break-word;
  animation: kbBubbleIn .32s cubic-bezier(.2, .8, .2, 1);
  text-wrap: pretty;
}

.kb-msg--user .kb-bubble {
  background: var(--kb-user-bubble-bg);
  color: var(--kb-user-bubble-fg);
  border-radius: var(--kb-radius-bubble) var(--kb-radius-bubble) 4px var(--kb-radius-bubble);
  font-weight: 500;
}

.kb-msg--agent .kb-bubble {
  background: var(--kb-glass-strong-bg);
  color: var(--kb-fg);
  border: 1px solid var(--kb-glass-strong-border);
  -webkit-backdrop-filter: blur(var(--kb-blur));
  backdrop-filter: blur(var(--kb-blur));
  border-radius: var(--kb-radius-bubble) var(--kb-radius-bubble) var(--kb-radius-bubble) 4px;
  box-shadow: var(--kb-shadow-card);
}

@keyframes kbBubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Bot-Thinking — nackte Dots, kein Bubble-Rahmen */
.kb-thinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 4px 6px;
  animation: kbBubbleIn .3s cubic-bezier(.2, .8, .2, 1);
}

.kb-thinking span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--kb-fg-muted);
  animation: kbThink 1.2s ease-in-out infinite;
}

.kb-thinking span:nth-child(2) { animation-delay: .15s; }
.kb-thinking span:nth-child(3) { animation-delay: .3s; }

@keyframes kbThink {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50%      { opacity: 1;  transform: translateY(-3px); }
}

/* ==========================================================================
   Tool-Pills (pending / ok / err)
   ========================================================================== */

.kb-tool {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  font-size: 12.5px;
  color: rgba(246, 246, 244, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  max-width: 100%;
  animation: kbToolIn .3s cubic-bezier(.2, .8, .2, 1);
  margin-left: 4px;
}

.kb-tool__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.kb-tool__icon svg { width: 12px; height: 12px; }

.kb-tool--pending .kb-tool__icon {
  background: rgba(247, 139, 22, 0.18);
  color: var(--kb-accent);
}

.kb-tool--pending .kb-tool__icon::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: kbSpin .8s linear infinite;
}

@keyframes kbSpin { to { transform: rotate(360deg); } }

.kb-tool--ok .kb-tool__icon {
  background: rgba(155, 196, 74, 0.18);
  color: var(--kb-green);
}

.kb-tool--err .kb-tool__icon {
  background: rgba(229, 64, 64, 0.18);
  color: #ff6b6b;
}

.kb-tool__label { font-weight: 600; white-space: nowrap; }

.kb-tool__args {
  color: var(--kb-fg-muted);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 24ch;
}

.kb-tool__meta {
  font-family: var(--wl-font-mono);
  color: var(--kb-fg-dim);
  font-size: 11px;
}

@keyframes kbToolIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Produkt-Carousel (horizontal Scroll-Snap)
   ========================================================================== */

.kb-products {
  align-self: stretch;
  width: 100%;
  margin: 4px 0 2px;
  animation: kbBubbleIn .32s cubic-bezier(.2, .8, .2, 1);
}

.kb-products__rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 10px;
  margin: 0 -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}

.kb-products__rail::-webkit-scrollbar { height: 5px; }
.kb-products__rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 999px; }

.kb-product {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--kb-glass-strong-bg);
  border: 1px solid var(--kb-glass-strong-border);
  -webkit-backdrop-filter: blur(var(--kb-blur));
  backdrop-filter: blur(var(--kb-blur));
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 180ms cubic-bezier(.34, 1.56, .64, 1), box-shadow 180ms ease;
  box-shadow: var(--kb-shadow-card);
}

.kb-product:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .4);
}

.kb-product:active { transform: translateY(0) scale(.97); }

.kb-product__media {
  position: relative;
  aspect-ratio: 5/4;
  background: linear-gradient(135deg, #2a241c, #1a1611);
  overflow: hidden;
}

.kb-product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kb-product__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kb-product__name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  font-family: var(--wl-font-display);
  color: var(--kb-fg);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-product__sub {
  font-size: 11.5px;
  color: var(--kb-fg-muted);
  line-height: 1.3;
}

.kb-product__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.kb-product__price {
  font-family: var(--wl-font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--kb-cyan);
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Quickstart-Chips (Glassmorphism-Pills, ohne Icons)
   ========================================================================== */

.kb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 4px;
  animation: kbBubbleIn .32s cubic-bezier(.2, .8, .2, 1);
}

.kb-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-family: var(--wl-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--kb-fg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--kb-glass-strong-border);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 160ms ease, border-color 160ms, transform 80ms;
  text-align: left;
}

.kb-chip:hover {
  background: rgba(247, 139, 22, 0.22);
  border-color: rgba(247, 139, 22, 0.6);
}

.kb-chip:active { transform: scale(.96); }

/* ==========================================================================
   State-Visibility — gesteuert über data-state auf .kb-modal-inner
   States: closed | start | active | voice | text | error
   ========================================================================== */

.kb-modal-inner [data-show] { display: none; }

.kb-modal-inner[data-state="start"] [data-show~="start"]   { display: flex; }
.kb-modal-inner[data-state="active"] [data-show~="active"],
.kb-modal-inner[data-state="voice"]  [data-show~="active"],
.kb-modal-inner[data-state="text"]   [data-show~="active"],
.kb-modal-inner[data-state="error"]  [data-show~="active"] { display: flex; }
.kb-modal-inner[data-state="voice"]  [data-show~="voice"]  { display: block; }
.kb-modal-inner[data-state="text"]   [data-show~="text"]   { display: block; }
.kb-modal-inner[data-state="error"]  [data-show~="error"]  { display: flex; }

/* Default: Active-State zeigt die Voice-Buttons-Reihe (Mic + Text nebeneinander) */
.kb-modal-inner[data-state="active"] [data-show~="active-default"] { display: flex; }

/* ==========================================================================
   Start-State (Orb-Wrapper + Hint + Sub + CTA)
   ========================================================================== */

.kb-start {
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 80px 24px 120px;
  pointer-events: none;
  text-align: center;
}

.kb-start__orb-wrap {
  pointer-events: auto;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(.2, .8, .2, 1);
}

.kb-start__orb-wrap:hover { transform: scale(1.04); }

.kb-start__hint {
  margin-top: 32px;
  font-family: var(--wl-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--kb-fg);
  letter-spacing: -0.01em;
}

.kb-start__sub {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--kb-fg-muted);
  max-width: 30ch;
  line-height: 1.45;
}

.kb-start__cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--kb-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--wl-font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: var(--kb-shadow-fab);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.kb-start__cta:hover { transform: translateY(-2px); }
.kb-start__cta:active { transform: translateY(0) scale(.97); }
.kb-start__cta svg { width: 16px; height: 16px; }

/* ==========================================================================
   Orb (Three.js Canvas) — lebt im .kb-start__orb-wrap, nur im Start-State sichtbar
   ========================================================================== */

#kundenberaterin-orb-canvas {
  display: block;
  margin: 0 auto;
  cursor: pointer;
}

/* ==========================================================================
   Input-Dock (Voice-Buttons + Voice-Wave + Text-Card)
   ========================================================================== */

.kb-input-dock {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-card {
  background: var(--kb-glass-strong-bg);
  border: 1px solid var(--kb-glass-strong-border);
  -webkit-backdrop-filter: blur(var(--kb-blur));
  backdrop-filter: blur(var(--kb-blur));
  border-radius: var(--kb-radius-input);
  box-shadow: var(--kb-shadow-card);
  padding: 12px 14px;
  animation: kbCardIn .26s cubic-bezier(.2, .8, .2, 1);
}

@keyframes kbCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kb-card.hidden { display: none; }

/* Voice-Buttons-Reihe (Mic + Text-Toggle nebeneinander) */
.kb-vbtns {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.kb-vbtns.hidden { display: none; }

.kb-rbtn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: var(--kb-accent);
  box-shadow: 0 10px 24px -6px rgba(247, 139, 22, 0.55),
              0 2px 6px rgba(0, 0, 0, .3);
  transition: transform 150ms ease, box-shadow 150ms ease, background 160ms ease;
  flex: 0 0 auto;
}

.kb-rbtn:hover { transform: scale(1.06); }
.kb-rbtn:active { transform: scale(.94); }

.kb-rbtn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kb-rbtn--ghost {
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--kb-glass-strong-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  width: 48px;
  height: 48px;
}

.kb-rbtn--ghost:hover { background: rgba(255, 255, 255, .16); }

.kb-rbtn--listening {
  animation: kbListening 1.4s ease-in-out infinite;
}

@keyframes kbListening {
  0%, 100% {
    box-shadow: 0 10px 24px -6px rgba(247, 139, 22, .55),
                0 0 0 0 rgba(247, 139, 22, .5),
                0 2px 6px rgba(0, 0, 0, .3);
  }
  50% {
    box-shadow: 0 10px 24px -6px rgba(247, 139, 22, .7),
                0 0 0 12px rgba(247, 139, 22, 0),
                0 2px 6px rgba(0, 0, 0, .3);
  }
}

/* Voice-Wave-Card (SiriWave-Container) */
.kb-wave {
  height: 60px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 0 4px;
}

.kb-wave__bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.kb-wave__stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .06);
  color: rgba(246, 246, 244, 0.92);
  border-radius: 999px;
  font-family: var(--wl-font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 160ms ease, color 160ms ease,
              border-color 160ms ease, transform 80ms ease;
}

.kb-wave__stop:hover {
  background: rgba(229, 64, 64, 0.18);
  border-color: rgba(229, 64, 64, 0.45);
  color: #fff;
}

.kb-wave__stop:active { transform: scale(.96); }
.kb-wave__stop svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* Text-Card (Textarea + Send-Button) */
.kb-textcard__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
}

.kb-textcard textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--kb-fg);
  font-family: var(--wl-font-body);
  font-size: 14px;
  line-height: 1.4;
  padding: 6px 0;
  max-height: 120px;
  min-height: 24px;
}

.kb-textcard textarea::placeholder { color: var(--kb-fg-muted); }

.kb-textcard__send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--kb-accent);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 150ms ease;
}

.kb-textcard__send:hover { transform: scale(1.06); }
.kb-textcard__send:active { transform: scale(.94); }
.kb-textcard__send svg { width: 16px; height: 16px; fill: currentColor; }

.kb-textcard__send:disabled {
  background: rgba(255, 255, 255, .1);
  color: var(--kb-fg-muted);
  cursor: not-allowed;
}

/* ==========================================================================
   Error-Banner (Toast oben im Modal)
   ========================================================================== */

.kb-error {
  position: absolute;
  top: 70px;
  left: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(228, 62, 62, 0.94);
  color: #fff;
  font-size: 13px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  animation: kbCardIn .26s cubic-bezier(.2, .8, .2, 1);
}

.kb-error[hidden] { display: none; }

.kb-error__text { flex: 1; }

.kb-error__close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 6px;
  flex: 0 0 auto;
}

.kb-error__close:hover { background: rgba(255, 255, 255, .2); }
.kb-error__close svg { width: 16px; height: 16px; }

/* ==========================================================================
   Status-Banner (kurzlebig, „Verbinde…")
   ========================================================================== */

.kb-status {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: var(--kb-fg);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.kb-status[hidden] { display: none; }
