/* PawBot Voice — Premium Edition */

/* ── Scroll-to-Bottom Button (Telegram-Style) ─────────────
   v7.8.20: Dezent statt dominant. Gleiche Größe wie Mic-Button (36px),
   semi-transparenter Hintergrund mit Blur, subtler Border + Schatten,
   chevron-down statt Triangle. Schwebt unauffällig über dem Composer
   und macht klar dass es nur eine Position-Hilfe ist, kein Action-Button. */
#scroll-to-bottom {
  position: fixed;
  right: 14px;
  /* v7.8.23: Position kommt jetzt aus --scroll-btn-bottom — JS misst die
     Composer-Position live (siehe voice.js: ResizeObserver auf
     #chat-input-bar) und setzt den Wert auf 16px ÜBER dem Composer-Top.
     Das 140px-Fallback greift nur kurz beim ersten Render bevor JS läuft. */
  bottom: var(--scroll-btn-bottom, 140px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  color: rgba(60, 60, 60, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
  z-index: 200;
}
#scroll-to-bottom.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.92);
}
#scroll-to-bottom:hover {
  background: rgba(255, 255, 255, 0.95);
  color: rgba(30, 30, 30, 0.92);
  transform: translateY(-1px);
}
#scroll-to-bottom:active {
  transform: translateY(0) scale(0.96);
}
/* Dark-Mode: dunkler Glas-Look statt heller */
[data-mode="dark"] #scroll-to-bottom {
  background: rgba(40, 40, 44, 0.72);
  color: rgba(230, 230, 230, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.32),
    0 1px 2px rgba(0, 0, 0, 0.18);
}
[data-mode="dark"] #scroll-to-bottom:hover {
  background: rgba(56, 56, 60, 0.9);
  color: rgba(255, 255, 255, 0.95);
}
/* Desktop (App 420px zentriert) — Button ans App-rechten Rand statt Viewport */
@media (min-width: 600px) {
  #scroll-to-bottom {
    right: calc(50vw - 210px + 14px);
  }
}
/* v7.8.18: Im Call-Modus blendet das Voice-Banner den Hangup-Button auf
   ~100px Höhe ein — der Scroll-to-Bottom liegt dann darüber und überdeckt
   den Auflegen-Button. Im Telefon-Modus scrollt der User eh nicht
   manuell, also wegblenden. */
body.in-call #scroll-to-bottom {
  display: none !important;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base structural vars ─────────────────────────────── */
:root {
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 50%;
  --transition-fast: 0.15s;
  --transition-theme: 0.3s;
}

/* ═══════════════════════════════════════════════════════════
   THEME SYSTEM: [data-theme] = color palette
                 [data-mode]  = dark / light
   Each theme has dark (default) + light variant.
   Moon button toggles mode. Settings choose theme.
   ═══════════════════════════════════════════════════════════ */

/* ── Default (Elegant) — warm gold, refined ──────────── */
:root,
[data-theme="elegant"] {
  --accent: #b89940;
  --accent-soft: rgba(184, 153, 64, 0.18);
  --accent-glow: rgba(184, 153, 64, 0.35);
  --green: #5da048;
  --red: #b85540;
  --call-bg: #b89940;
  --call-shadow: rgba(184, 153, 64, 0.3);
  --viz-primary: #b89940;
  --viz-secondary: #7a6428;
  --viz-glow: rgba(184, 153, 64, 0.45);
}

/* ── Cyberpunk — vivid teal, digital ─────────────────── */
[data-theme="cyberpunk"] {
  --accent: #22a0b5;
  --accent-soft: rgba(34, 160, 181, 0.18);
  --accent-glow: rgba(34, 160, 181, 0.35);
  --green: #30a880;
  --red: #b84848;
  --call-bg: #22a0b5;
  --call-shadow: rgba(34, 160, 181, 0.3);
  --viz-primary: #22a0b5;
  --viz-secondary: #105560;
  --viz-glow: rgba(34, 160, 181, 0.45);
}

/* ── Nature — lush sage, organic ─────────────────────── */
[data-theme="nature"] {
  --accent: #5ea87a;
  --accent-soft: rgba(94, 168, 122, 0.18);
  --accent-glow: rgba(94, 168, 122, 0.35);
  --green: #5ea87a;
  --red: #a06050;
  --call-bg: #5ea87a;
  --call-shadow: rgba(94, 168, 122, 0.3);
  --viz-primary: #5ea87a;
  --viz-secondary: #3a6a4a;
  --viz-glow: rgba(94, 168, 122, 0.45);
}

/* ── Synthwave — rich purple, nostalgic ──────────────── */
[data-theme="synthwave"] {
  --accent: #9955aa;
  --accent-soft: rgba(153, 85, 170, 0.18);
  --accent-glow: rgba(153, 85, 170, 0.35);
  --green: #7088b0;
  --red: #b84466;
  --call-bg: #9955aa;
  --call-shadow: rgba(153, 85, 170, 0.3);
  --viz-primary: #9955aa;
  --viz-secondary: #5a2a6a;
  --viz-glow: rgba(153, 85, 170, 0.45);
}

/* ── KITT — bold red, classic ────────────────────────── */
[data-theme="kitt"] {
  --accent: #c62828;
  --accent-soft: rgba(178, 34, 34, 0.18);
  --accent-glow: rgba(178, 34, 34, 0.35);
  --green: #38b855;
  --red: #c62828;
  --call-bg: #c62828;
  --call-shadow: rgba(178, 34, 34, 0.3);
  --viz-primary: #e53935;
  --viz-secondary: #7f1d1d;
  --viz-glow: rgba(229, 57, 53, 0.4);
}

/* ── Mode: Dark (default) ────────────────────────────── */
:root,
[data-mode="dark"] {
  --bg: #0a0a0c;
  --surface: #161618;
  --surface-2: #222226;
  --border: #333338;
  --text: #eeeef0;
  --text-sec: #b0b0b8;
  --text-ter: #707078;
  --body-bg: #0a0a0c;
}

/* ── Mode: Light ─────────────────────────────────────── */
[data-mode="light"] {
  --bg: #f4f4f8;
  --surface: #ffffff;
  --surface-2: #e8e8ee;
  --border: #d0d0d8;
  --text: #1a1a1e;
  --text-sec: #4a4a54;
  --text-ter: #7a7a84;
  --body-bg: #f4f4f8;
}

/* ── Smooth theme transitions ─────────────────────────── */
html,
body,
.screen,
#voice-center,
#bot-avatar,
.call-button,
.ctrl-button {
  transition:
    background var(--transition-theme),
    color var(--transition-theme),
    border-color var(--transition-theme),
    box-shadow var(--transition-theme);
}

body {
  font-family:
    -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue",
    sans-serif;
  background: var(--body-bg, #000);
  color: var(--text);
  margin: 0;
  padding: 0;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Mobile: fixed fullscreen */
.screen {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}
.screen.active {
  display: flex;
}

/* Desktop: centered phone container */
@media (min-width: 600px) {
  body {
    padding: 20px;
  }
  [data-mode="light"] body {
    background: #e5e5ea;
  }
  .screen {
    position: relative;
    max-width: 420px;
    max-height: 820px;
    width: 420px;
    height: calc(100dvh - 40px);
    border-radius: 24px;
    background: var(--bg);
    box-shadow:
      0 0 60px rgba(108, 99, 255, 0.08),
      0 0 0 1px rgba(255, 255, 255, 0.06);
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }
  [data-mode="light"] .screen {
    box-shadow:
      0 0 60px rgba(0, 0, 0, 0.15),
      0 0 0 1px rgba(0, 0, 0, 0.08);
  }
  [data-theme="kitt"] .screen {
    box-shadow:
      0 0 60px rgba(178, 34, 34, 0.06),
      0 0 0 1px rgba(178, 34, 34, 0.1);
  }
  [data-theme="elegant"] .screen {
    box-shadow:
      0 0 60px rgba(160, 136, 72, 0.05),
      0 0 0 1px rgba(160, 136, 72, 0.08);
  }
  [data-theme="cyberpunk"] .screen {
    box-shadow:
      0 0 60px rgba(26, 136, 153, 0.06),
      0 0 0 1px rgba(26, 136, 153, 0.1);
  }
  [data-theme="nature"] .screen {
    box-shadow:
      0 0 60px rgba(90, 138, 106, 0.05),
      0 0 0 1px rgba(90, 138, 106, 0.08);
  }
  [data-theme="synthwave"] .screen {
    box-shadow:
      0 0 60px rgba(136, 68, 136, 0.06),
      0 0 0 1px rgba(136, 68, 136, 0.1);
  }
}
.hidden {
  display: none !important;
}

/* ── Auth ─────────────────────────────────────────────── */

#auth-screen {
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(240, 138, 46, 0.18) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at 50% 100%,
      rgba(163, 58, 10, 0.22) 0%,
      transparent 60%
    ),
    var(--bg);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
/* Desktop: Auth-Screen bricht aus dem Phone-Frame aus → volle Fläche */
@media (min-width: 600px) {
  #auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

.auth-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 44px 32px 36px;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 24px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 20px 60px -20px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  color: var(--accent);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.auth-subtitle {
  color: var(--text-sec);
  margin-bottom: 4px;
  font-size: 14px;
}
.auth-brand {
  color: var(--text-ter);
  margin-bottom: 28px;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.auth-card input[type="text"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.auth-card input::placeholder {
  color: var(--text-ter);
}
.auth-card input:focus {
  border-color: var(--accent);
  box-shadow: none;
}
/* v7.8.36: Augen-Toggle für Passwort-Felder */
.pw-field-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 8px;
}
.pw-field-wrap input[type="password"],
.pw-field-wrap input[type="text"] {
  margin-bottom: 0;
  padding-right: 44px;
}
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-ter);
  border-radius: 6px;
  transition:
    color 0.15s,
    background 0.15s;
}
.pw-toggle:hover {
  color: var(--text-sec);
  background: rgba(0, 0, 0, 0.04);
}
[data-mode="dark"] .pw-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}
.pw-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.auth-card .remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  justify-content: center;
}
.auth-card .remember input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.auth-card button:not(.pw-toggle) {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.auth-card button:not(.pw-toggle):hover {
  opacity: 0.9;
}
.auth-card button:not(.pw-toggle):active {
  opacity: 0.8;
  transform: scale(0.98);
}

.auth-card .auth-link {
  display: block;
  width: auto;
  margin: 18px auto 0;
  background: none;
  color: var(--text-ter);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  opacity: 0.75;
}
.auth-card .auth-link:hover {
  color: var(--text-sec);
  opacity: 1;
  text-decoration: underline;
}
.auth-card .auth-link:active {
  transform: none;
}

.error {
  color: var(--red);
  margin-top: 10px;
  font-size: 14px;
}

.s-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-ter);
  font-size: 11px;
  line-height: 1.35;
}

/* ── Passwort vergessen Modal ─────────────────────────── */
.forgot-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 24px;
}
.forgot-modal.hidden {
  display: none;
}
.forgot-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}
.forgot-card h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}
.forgot-hint {
  margin: 0 0 20px;
  color: var(--text-sec);
  font-size: 13px;
  line-height: 1.45;
}
#forgot-form input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
#forgot-form input[type="email"]:focus {
  border-color: var(--accent);
}
.forgot-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.forgot-actions .btn-ghost,
.forgot-actions .btn-primary {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: opacity 0.15s;
}
.forgot-actions .btn-ghost {
  background: transparent;
  color: var(--text-sec);
}
.forgot-actions .btn-ghost:hover {
  color: var(--text);
}
.forgot-actions .btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.forgot-actions .btn-primary:hover {
  opacity: 0.9;
}
.forgot-result {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.forgot-result.hidden {
  display: none;
}
.forgot-result.success {
  background: color-mix(in srgb, var(--green, #5ea87a) 15%, transparent);
  color: var(--green, #5ea87a);
  border: 1px solid color-mix(in srgb, var(--green, #5ea87a) 30%, transparent);
}
.forgot-result.error {
  background: color-mix(in srgb, var(--red, #e53935) 12%, transparent);
  color: var(--red, #e53935);
  border: 1px solid color-mix(in srgb, var(--red, #e53935) 30%, transparent);
}

/* ── Connection Banner ────────────────────────────────── */
.conn-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  animation: slide-down 0.3s ease-out;
  transition:
    background 0.3s,
    color 0.3s;
}
.conn-banner.hidden {
  display: none !important;
}
.conn-banner.offline {
  background: #dc2626;
  color: white;
}
.conn-banner.slow {
  background: #f59e0b;
  color: #1a1a1a;
}
.conn-banner.reconnecting {
  background: #6366f1;
  color: white;
}

/* ── Update Banner ───────────────────────────────────── */

/* legacy #update-banner removed — see .update-banner below */

@keyframes slide-down {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ── Top Bar ──────────────────────────────────────────── */

#top-bar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--accent);
  flex-shrink: 0;
  z-index: 100;
  gap: 10px;
}
.header-left {
  flex-shrink: 0;
}
.header-logo {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  opacity: 0.95;
  letter-spacing: -0.3px;
}
.header-spacer {
  flex: 1;
}

/* ── Project Context Bar (thin bar below header) ──── */
/* v6.10.31: project-bar ist ein Container mit Switch + Clear-X */
.project-bar {
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
  color: var(--accent);
  width: 100%;
  flex-shrink: 0;
}
.project-bar.hidden {
  display: none;
}
.project-bar-switch {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.project-bar-switch:active {
  background: color-mix(in srgb, var(--accent) 15%, var(--bg));
}
.project-bar-switch svg {
  opacity: 0.6;
}
.project-bar-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: transparent;
  border: none;
  color: var(--accent);
  opacity: 0.55;
  cursor: pointer;
  transition:
    opacity 0.15s,
    background 0.15s;
  border-left: 0.5px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.project-bar-clear:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.project-bar-clear:active {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
#project-bar-name {
  font-weight: 600;
  flex: 1;
}
.project-bar-chevron {
  opacity: 0.4;
  font-size: 10px;
  transition: transform 0.18s ease;
}
.project-bar.pq-open .project-bar-chevron {
  transform: rotate(180deg);
  opacity: 0.85;
}
/* v7.8.7: Empty-State (kein Projekt aktiv) — etwas dezenter, klarer Hint */
.project-bar.project-bar-empty {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
  color: color-mix(in srgb, var(--accent) 75%, var(--text-ter));
}
.project-bar.project-bar-empty #project-bar-name {
  font-weight: 500;
  opacity: 0.85;
}

/* v7.8.7: Quick-Switcher-Dropdown — nutzt das vd-menu-Pattern aus dem
   Stimm-Picker, plus pq-* fuer projekt-spezifische Details. */
.project-bar {
  position: relative;
}
.pq-menu {
  /* override vd-menu's absolute positioning to anchor below the bar */
  position: absolute;
  top: calc(100% + 4px);
  left: 8px;
  right: 8px;
  z-index: 1500;
}
.pq-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--text-ter);
  text-align: center;
}
.pq-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
}
.pq-icon-knowledge {
  color: #4a6b96;
  background: rgba(107, 143, 184, 0.15);
}
.pq-icon-code {
  color: #8a6e20;
  background: rgba(184, 153, 64, 0.18);
}
[data-mode="dark"] .pq-icon-knowledge {
  color: #93b5db;
}
[data-mode="dark"] .pq-icon-code {
  color: #d4b96a;
}
.pq-action-icon {
  color: var(--accent);
  background: var(--accent-soft);
}
.pq-item.active {
  background: var(--accent-soft);
}
.pq-action {
  /* Footer-Aktionen visuell etwas abgesetzt */
}

/* Header icon buttons — adapted for neutral background */
#top-bar .icon-button {
  color: #fff;
  opacity: 0.8;
}
#top-bar .icon-button:hover {
  opacity: 1;
}
#top-bar .user-avatar-btn {
  width: 38px;
  height: 38px;
  background: #8b5cf6;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.85);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
#top-bar .user-avatar-btn:hover {
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.15);
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#voice-select,
#viz-style {
  padding: 6px 10px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text-sec);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
#voice-select:focus,
#viz-style:focus {
  border-color: var(--accent);
}

/* ── Hero View ────────────────────────────────────────── */

#hero-view {
  position: relative;
  background: var(--bg);
}
#voice-main {
  background: var(--bg);
}

[data-theme="synthwave"] #hero-view::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background:
    linear-gradient(180deg, transparent, rgba(136, 68, 136, 0.03)),
    linear-gradient(rgba(136, 68, 136, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(136, 68, 136, 0.04) 1px, transparent 1px);
  background-size:
    100% 100%,
    30px 30px,
    30px 30px;
  pointer-events: none;
  z-index: 0;
}

/* ── Voice Center ─────────────────────────────────────── */

#voice-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#voice-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(108, 99, 255, 0.04) 0%,
    transparent 50%
  );
}

#bot-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* (Removed: old user-dropdown project items — replaced by Projekt-Switcher Bottom-Sheet) */

/* ── Connector Disconnect Button ───────────────────── */
.connector-btn-disconnect {
  background: #ffffff !important;
  color: #b91c1c !important;
  border: 1.5px solid #b91c1c !important;
  border-radius: 10px !important;
  padding: 10px 18px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  box-shadow: none !important;
}

.connector-btn-disconnect:hover {
  background: #b91c1c !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
  box-shadow: 0 3px 8px rgba(185, 28, 28, 0.35) !important;
}

.connector-btn-disconnect.hidden {
  display: none;
}

#bot-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.bot-choice {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.bot-choice:hover {
  border-color: var(--text-sec);
}
.bot-choice.active {
  border-color: var(--accent);
  background: var(--surface);
}
.bot-choice:disabled {
  opacity: 0.4;
  cursor: default;
}

#bot-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s;
}

#bot-avatar.speaking {
  box-shadow:
    0 0 0 3px var(--accent),
    0 0 32px rgba(108, 99, 255, 0.25);
}

#bot-avatar.listening {
  box-shadow:
    0 0 0 3px #4ade80,
    0 0 24px rgba(74, 222, 128, 0.3);
}

#bot-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

#viz-canvas {
  width: min(460px, 90vw);
  height: 96px;
}

/* ── Call Controls ────────────────────────────────────── */

/* v6.12.21: Timer oben ausgeblendet — war doppelt mit unterer Latenz-Anzeige */
#call-duration {
  display: none !important;
}

#call-buttons {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 12px;
  max-width: 100%;
  box-sizing: border-box;
}

.ctrl-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.ctrl-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ctrl-button:active {
  transform: scale(0.9);
}
.ctrl-button.muted {
  background: #e83030;
  color: white;
  border-color: #e83030;
  box-shadow: 0 2px 12px rgba(232, 48, 48, 0.3);
}
#stop-speaking-btn {
  width: 56px;
  height: 56px;
  background: #e83030;
  color: white;
  border-color: #e83030;
  box-shadow: 0 2px 16px rgba(232, 48, 48, 0.4);
  animation: pulse-stop 1.5s ease-in-out infinite;
}
#stop-speaking-btn:hover {
  opacity: 0.85;
}
@keyframes pulse-stop {
  0%,
  100% {
    box-shadow: 0 2px 16px rgba(232, 48, 48, 0.4);
  }
  50% {
    box-shadow: 0 2px 24px rgba(232, 48, 48, 0.6);
  }
}

/* Update Banner — neuer Server-Code wartet auf manuelle Aktivierung */
/* Update-Banner: voller Streifen am oberen Rand, mit SVG-Icons */
.update-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  padding-top: max(env(safe-area-inset-top, 0px) + 12px, 12px);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  animation: update-banner-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.update-banner.hidden {
  display: none;
}
@keyframes update-banner-in {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Icon-Container: SVG statt Unicode */
.update-banner-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.update-banner-icon svg {
  display: block;
}
.update-banner-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.update-banner-title {
  font-weight: 600;
  color: #fff;
  font-size: 13px;
}
.update-banner-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
/* Aktualisieren-Button: weiß auf transparentem Akzent, klar erkennbar */
.update-banner-btn {
  background: #fff;
  color: var(--accent, #b89940);
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px; /* Touch-Target */
  letter-spacing: 0.01em;
  transition:
    transform 0.1s,
    box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  -webkit-tap-highlight-color: transparent;
}
.update-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.update-banner-btn:active {
  transform: translateY(0);
}
.update-banner-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
/* Dismiss-Button: SVG-X, dezent */
.update-banner-dismiss {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: rgba(255, 255, 255, 0.9);
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  margin-left: 6px; /* etwas Abstand zum Aktualisieren-Button */
}
/* Content nimmt allen verfuegbaren Platz - schiebt Buttons + X komplett rechts */
.update-banner-content {
  flex: 1;
}
.update-banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.update-banner-dismiss svg {
  display: block;
}
/* Mobile: kompakter */
@media (max-width: 480px) {
  .update-banner {
    padding: 8px 6px 8px 12px;
    gap: 8px;
    font-size: 12px;
  }
  .update-banner-title {
    font-size: 12px;
  }
  .update-banner-sub {
    font-size: 10px;
  }
  .update-banner-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}

/* Task Banner — persistent indicator for background tasks */
.task-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(108, 99, 255, 0.1);
  border-bottom: 1px solid rgba(108, 99, 255, 0.2);
  font-size: 0.8em;
  color: var(--text-secondary, #aaa);
  transition:
    opacity 0.3s,
    background 0.15s;
  cursor: pointer;
  user-select: none;
}
.task-banner:hover {
  background: rgba(108, 99, 255, 0.18);
}
.task-banner.hidden {
  display: none;
}
.task-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6c63ff;
  animation: pulse-dot 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
#task-banner-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-banner-chevron {
  opacity: 0.6;
  font-size: 0.9em;
  transition: transform 0.2s;
}
.task-banner.expanded .task-banner-chevron {
  transform: rotate(180deg);
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Task Detail Panel — expanded view with live progress log */
.task-detail-panel {
  position: relative;
  margin: 0 12px 8px;
  padding: 12px 14px;
  background: rgba(108, 99, 255, 0.06);
  border: 1px solid rgba(108, 99, 255, 0.25);
  border-radius: 10px;
  font-size: 0.82em;
  color: var(--text, #ddd);
  animation: slide-down 0.2s ease-out;
}
.task-detail-panel.hidden {
  display: none;
}
.task-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.task-detail-header strong {
  color: #9b94ff;
  font-size: 1.05em;
}
.task-detail-elapsed {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  color: var(--text-secondary, #888);
  background: rgba(108, 99, 255, 0.12);
  padding: 1px 7px;
  border-radius: 4px;
}
.task-detail-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary, #888);
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
  width: 24px;
  height: 24px;
  padding: 0;
}
.task-detail-close:hover {
  color: var(--text, #fff);
}
.task-detail-task {
  margin-bottom: 10px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  font-style: italic;
  white-space: pre-wrap;
  word-break: break-word;
}
.task-detail-history-label {
  font-size: 0.85em;
  color: var(--text-secondary, #888);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.task-detail-history {
  margin: 0;
  padding-left: 20px;
  max-height: 220px;
  overflow-y: auto;
  list-style-type: decimal;
}
.task-detail-history li {
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.task-detail-history li:last-child {
  font-weight: 500;
  color: #9b94ff;
}
.task-detail-history .history-time {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  opacity: 0.6;
  margin-right: 6px;
}

/* ── Notification Banner ─────────────────────────────── */
.notify-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--green);
  animation: slide-down 0.2s ease-out;
}
.notify-banner.hidden {
  display: none;
}
.notify-banner.error {
  border-bottom-color: var(--red);
}
.notify-banner-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse 1.5s infinite;
}
.notify-banner.error .notify-banner-icon {
  background: var(--red);
}
.notify-banner-content {
  flex: 1;
  min-width: 0;
}
.notify-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notify-banner-body {
  font-size: 11px;
  color: var(--text-sec);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notify-banner-close {
  background: none;
  border: none;
  color: var(--text-ter);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}
.notify-banner-close:hover {
  color: var(--text);
}

/* ── Notify Toggle Badge ─────────────────────────────── */
#notify-toggle {
  position: relative;
}
.notify-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notify-badge.hidden {
  display: none;
}

.call-button {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #16a34a;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* v7.10.12: touch-action: manipulation entfernt — iOS-Safari hatte
     damit einen Bug wo Hangup-Button-Klick nicht mehr durchkam. Standard-
     :active reagiert auch ohne sofort sichtbar genug (siehe Active-Block). */
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.1s,
    box-shadow 0.15s;
  box-shadow:
    0 6px 28px rgba(22, 163, 74, 0.35),
    0 0 0 3px rgba(22, 163, 74, 0.15);
}
.call-button:hover {
  background: #15803d;
  box-shadow:
    0 6px 32px rgba(22, 163, 74, 0.5),
    0 0 16px rgba(22, 163, 74, 0.4);
}
/* v7.10.11: kraeftigeres :active-Feedback. CSS-only, keine JS-Latenz. */
.call-button:active {
  transform: scale(0.88);
  background: #14532d;
  box-shadow:
    0 2px 12px rgba(22, 163, 74, 0.5),
    0 0 0 6px rgba(22, 163, 74, 0.3);
  transition-duration: 0s; /* sofort */
}
.call-button.active {
  background: #e83030;
  box-shadow:
    0 6px 28px rgba(232, 48, 48, 0.4),
    0 0 0 3px rgba(232, 48, 48, 0.15);
}
.call-button.active:hover {
  background: #c62828;
  box-shadow:
    0 6px 32px rgba(232, 48, 48, 0.55),
    0 0 16px rgba(232, 48, 48, 0.5);
}

#call-status {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-ter);
  text-align: center;
  min-height: 24px;
  letter-spacing: 0.2px;
  margin-top: 6px;
  padding: 5px 14px;
  border-radius: 14px;
  transition:
    color 0.2s,
    background 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
}

/* ── Call-Status States ──────────────────────────────── */
/* Active states bekommen Background-Tint damit man sie NICHT uebersehen kann. */
#call-status.cs-idle {
  color: var(--text-ter);
}
#call-status.cs-connecting {
  color: var(--text-sec);
  background: rgba(148, 163, 184, 0.12);
  animation: cs-pulse 1.2s ease-in-out infinite;
}
#call-status.cs-live {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
#call-status.cs-listening {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.18);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.28);
  animation: cs-pulse 1s ease-in-out infinite;
  font-weight: 600;
}
#call-status.cs-thinking {
  color: #6c63ff;
  background: rgba(108, 99, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(108, 99, 255, 0.28);
  animation: cs-dots 1.4s ease-in-out infinite;
  font-weight: 600;
}
#call-status.cs-speaking {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.18);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.28);
  animation: cs-wave 1.1s ease-in-out infinite;
  font-weight: 600;
}
#call-status.cs-tool {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.22);
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.4),
    0 0 20px rgba(245, 158, 11, 0.25);
  animation: cs-pulse 1.2s ease-in-out infinite;
  font-weight: 700;
}
#call-status.cs-warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.22);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
  animation: cs-pulse 0.8s ease-in-out infinite;
  font-weight: 700;
}
#call-status.cs-reconnecting {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.22);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4);
  animation: cs-pulse 0.6s ease-in-out infinite;
  font-weight: 700;
}
#call-status.cs-error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  font-weight: 700;
}

@keyframes cs-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
@keyframes cs-dots {
  0%,
  100% {
    opacity: 1;
    letter-spacing: 0.3px;
  }
  50% {
    opacity: 0.75;
    letter-spacing: 1.2px;
  }
}
@keyframes cs-wave {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

/* ── Call Duration Timer ─────────────────────────────── */
#call-duration.warning {
  color: #f59e0b;
  font-weight: 600;
}
#call-duration.critical {
  color: #ef4444;
  font-weight: 700;
  animation: cs-pulse 0.8s ease-in-out infinite;
}

/* ── Open Chat Button ────────────────────────────────── */

.open-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
  padding: 10px 24px;
  background: var(--surface-2);
  color: var(--text-sec);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.open-chat-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
}
.open-chat-btn:active {
  transform: scale(0.97);
}

/* ── Action Window ───────────────────────────────────── */

#action-window {
  margin: 0 24px 8px;
  flex-shrink: 0;
  display: none; /* shown when items exist */
}
#action-window.has-items {
  display: block;
}

.aw-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-ter);
  margin-bottom: 8px;
}
.aw-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

/* ── Voice Banner ────────────────────────────────────── */

.voice-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  box-sizing: border-box;
}

.banner-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2.5px solid var(--accent);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.banner-avatar.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(108, 99, 255, 0.35);
}
.banner-avatar.listening {
  border-color: #4ade80;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.35);
}

.banner-info {
  flex-shrink: 0;
  min-width: 0;
}
.banner-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.banner-status {
  font-size: 12px;
  color: var(--text-ter);
  transition: color 0.2s;
}
.banner-status.live {
  color: var(--green);
}

/* Connection quality indicator */
.conn-quality {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-ter);
  margin-left: 6px;
  vertical-align: middle;
}
.conn-quality .conn-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 12px;
}
.conn-quality .conn-bar {
  width: 3px;
  border-radius: 1px;
  background: var(--text-ter);
  opacity: 0.3;
  transition:
    opacity 0.3s,
    background 0.3s;
}
.conn-quality .conn-bar:nth-child(1) {
  height: 4px;
}
.conn-quality .conn-bar:nth-child(2) {
  height: 7px;
}
.conn-quality .conn-bar:nth-child(3) {
  height: 10px;
}
.conn-quality .conn-bar:nth-child(4) {
  height: 12px;
}
.conn-quality .conn-bar.active {
  opacity: 1;
}
.conn-quality.good .conn-bar.active {
  background: #22c55e;
}
.conn-quality.ok .conn-bar.active {
  background: #f59e0b;
}
.conn-quality.slow .conn-bar.active {
  background: #ef4444;
}
.conn-quality .conn-label {
  font-size: 10px;
  opacity: 0.7;
}

/* Slow connection warning toast */
.conn-warning {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.conn-warning.visible {
  opacity: 1;
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.banner-viz {
  width: 68px;
  height: 52px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  flex-shrink: 0;
}
.banner-viz.active {
  background: transparent;
}

/* Mute button in banner */
.banner-mute {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.banner-mute:hover {
  background: var(--surface-3);
}
.banner-mute.muted {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.banner-ctrl:active {
  transform: scale(0.9);
}
.banner-ctrl.muted {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.banner-call {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.35);
}
.banner-call:hover {
  background: #15803d;
}
.banner-call.hidden {
  display: none;
}
.banner-hangup {
  background: #e83030;
  color: white;
  border-color: #e83030;
  box-shadow: 0 2px 10px rgba(232, 48, 48, 0.3);
  display: none;
}
.banner-hangup.visible {
  display: flex;
}
.banner-hangup:hover {
  opacity: 0.85;
}
.banner-ctrl.banner-mute {
  display: none;
}
.banner-ctrl.banner-mute.visible {
  display: flex;
}

/* Hidden tab-bar elements for JS compatibility */
#tab-bar {
  display: none;
}

/* ── Views ───────────────────────────────────────────── */

.view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.view.active {
  display: flex;
}
.ch-row-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  flex-shrink: 0;
}
.ch-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* v6.10.30: Einheitliche Hoehe fuer alle Toolbar-Buttons (inkl. Telegram-Toggle) */
  padding: 6px 12px;
  min-height: 32px;
  line-height: 1;
  border-radius: 12px;
  border: none;
  background: var(--surface-2);
  color: var(--text-sec);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ch-tool-btn svg {
  flex-shrink: 0;
}
.ch-tool-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.ch-tool-btn.tg-off {
  opacity: 0.35;
}
.ch-tool-btn.filter-active {
  background: var(--accent);
  color: white;
}
.ch-tool-btn.muted {
  background: #ef4444;
  color: white;
}
.ch-tool-label {
  font-size: 11px;
}
.ch-tool-spacer {
  flex: 1;
}
/* (mini-viz styles moved to .mini-viz in Voice Banner) */
/* Activity indicator */
.ch-activity {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--accent);
}
.ch-activity.hidden {
  display: none;
}
.ch-activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: ch-pulse 1.5s ease-in-out infinite;
}
@keyframes ch-pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}
.ch-activity-text {
  font-weight: 500;
}

/* (old chat header controls removed — replaced by voice-banner) */

/* (old chat call/hangup buttons removed — replaced by banner controls) */

#chat-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  transition: background 0.2s;
  position: relative;
}
#chat-transcript.drag-over {
  background: rgba(108, 99, 255, 0.08);
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
  border-radius: 8px;
}

#transcript {
  max-width: 560px;
  margin: 0 auto;
}

.msg {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 82%;
  font-size: 15px;
  line-height: 1.5;
  animation: msg-in 0.15s ease-out;
  overflow-wrap: break-word;
  word-break: break-word;
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* v7.7.3 M3 Tonal-Bubbles. User=Filled (Akzent), Bot=Filled-Tonal (Akzent-Tönung).
   Border-left raus, größerer Radius, mehr Padding — M3-konform. */
.msg.user {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
  border-radius: 20px;
  border-bottom-right-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.msg.assistant {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  color: var(--text);
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  padding: 14px 16px;
  border: none;
}
[data-mode="dark"] .msg.assistant {
  background: color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.04));
}

/* Bot-Name als M3-Header oben in der Bot-Bubble */
.msg-bot-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.005em;
  margin-bottom: 6px;
  display: block;
}
[data-mode="dark"] .msg-bot-name {
  color: color-mix(in srgb, var(--accent) 75%, white);
}
.msg-channel {
  display: block;
  font-size: 10px;
  margin-bottom: 3px;
  opacity: 0.55;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.msg-time {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  opacity: 0.45;
  font-weight: 400;
}
.msg.user .msg-time {
  text-align: right;
}
.msg-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  word-break: break-all;
}
.msg.user .msg-link {
  color: rgba(255, 255, 255, 0.95);
}
.msg.assistant .msg-link {
  color: var(--accent);
}

/* Tool result cards — structured info from voice tools */
.msg.tool-result {
  background: var(--surface-2);
  color: var(--text);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  margin: 4px 2px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.app-btn:hover {
  opacity: 0.85;
}
.app-btn svg {
  flex-shrink: 0;
}

/* ── Call Card ──────────────────────────────────────── */
.call-card {
  display: inline-block;
  margin: 6px 0;
}
.call-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 8px;
  padding-left: 2px;
}
.call-card-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.call-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0;
  border-radius: 14px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  width: 72px;
  height: 72px;
  transition:
    opacity 0.15s,
    transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.call-card-btn:active {
  transform: scale(0.93);
  opacity: 0.85;
}
.call-card-icon {
  line-height: 1;
}
.call-card-label {
  line-height: 1;
  letter-spacing: 0.1px;
}
.call-card-phone {
  background: #22c55e;
}
.call-card-wa {
  background: #25d366;
}
.call-card-tg {
  background: #229ed9;
}

/* Call-Card rechtsbuendig in Chat — Daumen-Reichweite */
.msg.assistant:has(> .call-card) {
  background: transparent !important;
  border-left: none !important;
  padding-left: 0 !important;
  margin-left: auto !important;
  align-self: flex-end !important;
  text-align: right;
  border-bottom-left-radius: 0 !important;
  box-shadow: none !important;
}
.msg.assistant > .call-card {
  display: inline-block;
  text-align: left;
}
.msg.assistant .call-card-title {
  text-align: right;
  padding-right: 2px;
  padding-left: 0;
}

/* ── Media Card (PDF/Maps/Download) — rechtsbuendig mit Pill-Buttons ──── */
.media-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin: 4px 0;
}
.media-card-label {
  font-size: 12px;
  color: var(--text-sec);
  max-width: 100%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.media-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.1s,
    background 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
/* v6.10.46: Phone-Play Button — im Card-Feld, Brand-Farben pro Provider. */
.phone-play-msg .media-card {
  align-items: flex-end;
}
.phone-play-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
  color: #fff;
}
.phone-play-btn:active {
  transform: scale(0.97);
}
.phone-play-ytmusic,
.phone-play-youtube {
  background: #ff0000;
}
.phone-play-ytmusic:hover,
.phone-play-youtube:hover {
  background: #cc0000;
}
.phone-play-spotify {
  background: #1db954;
}
.phone-play-spotify:hover {
  background: #169c46;
}
.phone-play-apple {
  background: #fa233b;
}
.phone-play-apple:hover {
  background: #d91a30;
}
.phone-play-generic {
  background: var(--accent, #6c63ff);
}
.media-pill:hover {
  opacity: 0.88;
}
.media-pill:active {
  transform: scale(0.96);
}
.media-pill-primary {
  background: var(--accent, #6c63ff);
  color: #fff;
}
.media-pill-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #fff);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.media-pill-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}
.media-pill-maps {
  background: #ea4335;
  color: #fff;
}

.msg.action {
  background: none;
  color: var(--text-ter);
  font-size: 12px;
  text-align: center;
  max-width: 100%;
  padding: 4px;
}

/* Telegram filter */
.tg-hidden .msg[data-channel="telegram"] {
  display: none;
}

/* Telegram filter toggle — akzent-Farbe aktiv, sonst gleich zu anderen ch-tool-btn */
#tg-filter-btn {
  font-weight: 600;
  background: var(--accent, #6c63ff);
  color: #fff;
  opacity: 1;
}
#tg-filter-btn:hover {
  filter: brightness(1.1);
  color: #fff;
  background: var(--accent, #6c63ff);
}
#tg-filter-btn.tg-off {
  background: var(--surface-2);
  color: var(--text-sec);
  opacity: 1;
}
#tg-filter-btn.tg-off:hover {
  background: var(--surface);
  color: var(--text);
}
#tg-filter-btn.tg-off::after {
  content: "aus";
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-ter);
  margin-left: 2px;
}
#tg-filter-btn:not(.tg-off)::after {
  content: "ein";
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  margin-left: 2px;
}

/* Chat filter bar */
.chat-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.chat-filter-bar.hidden {
  display: none;
}
.chat-filter-days {
  display: flex;
  gap: 4px;
}
.chat-day-btn {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sec);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-day-btn:hover {
  border-color: var(--accent);
}
.chat-day-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.chat-search-input {
  flex: 1;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  min-width: 0;
}
.chat-search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.chat-search-input::placeholder {
  color: var(--text-ter);
}
/* Search + Day filter hide */
.msg.chat-search-hidden {
  display: none;
}
.msg.chat-day-hidden {
  display: none;
}
#chat-filter-toggle.filter-active {
  color: var(--accent);
}

/* ── Chat Input Bar ───────────────────────────────────── */

#chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 0.5px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  min-height: 60px;
}

/* v7.10.13: Quick-Modules-Button im chat-input-bar versteckt — wandert
   in den Top-Bar-Header (#quick-modules-btn-top). Footer hat dadurch
   mehr Platz fuer [Plus] [Eingabefeld] [Mic] [Send] und ist nicht mehr
   so zerrissen. */
#chat-input-bar #quick-modules-btn-global {
  display: none;
}

/* v7.10.13/14: Phone-Button im Chat-Footer (Anruf-Start) gruen wie auf
   der Hero-Seite. !important weil .pw-btn--primary spaeter im File die
   bot-color ueberschreibt. */
#chat-send-btn.has-no-text:not(.in-call) {
  background: #16a34a !important;
  color: #fff !important;
}
#chat-send-btn.has-no-text:not(.in-call) > svg {
  fill: #fff !important;
}
#chat-send-btn.has-no-text:not(.in-call):hover {
  background: #15803d !important;
}
#chat-send-btn.has-no-text:not(.in-call):active {
  transform: scale(0.92);
  background: #14532d !important;
  transition-duration: 0s;
}

/* .upload-button → migriert zu .pw-btn.pw-btn--ghost.pw-btn--icon (M1-A) */

#chat-text-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  outline: none;
  min-width: 0;
  resize: none;
  overflow-y: hidden;
  max-height: 120px;
  line-height: 1.4;
  font-family: inherit;
  field-sizing: content;
}
#chat-text-input::placeholder {
  color: var(--text-ter);
}
#chat-text-input:focus {
  border-color: var(--accent);
}

.emoji-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  color: var(--text-ter);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  flex-shrink: 0;
  padding: 0;
}
.emoji-button:hover {
  color: var(--text);
}

.emoji-picker {
  position: absolute;
  bottom: 56px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  width: 280px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 500;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.emoji-picker.hidden {
  display: none;
}
.emoji-picker button {
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
.emoji-picker button:hover {
  background: var(--surface-2);
}

/* .send-button → migriert zu .pw-btn.pw-btn--primary.pw-btn--icon (M1-A) */
.pw-btn--icon:disabled {
  opacity: 0.3;
}

#upload-status {
  position: absolute;
  bottom: 60px;
  left: 24px;
  right: 24px;
  font-size: 13px;
  color: var(--text-ter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#upload-status.uploading {
  color: var(--accent);
}
#upload-status.error {
  color: var(--red);
}

/* Upload preview in transcript */
.msg-upload {
  margin-bottom: 6px;
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 85%;
  background: var(--accent);
  margin-left: auto;
  border-bottom-right-radius: 4px;
  animation: msg-in 0.15s ease-out;
}

.msg-upload img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin-bottom: 6px;
}

.msg-upload .upload-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.msg-upload .upload-analysis {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  font-style: italic;
}

::-webkit-scrollbar {
  width: 0;
}

/* ── File Manager Panel ───────────────────────────────── */

#archive-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: var(--surface);
  transform: translateX(100%);
  transition: transform 0.25s;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
#archive-panel.open {
  transform: translateX(0);
}

/* v7.8.6: .fm-header / .fm-icon-btn nutzen jetzt das vereinheitlichte
   Header-Modul aus dem fs-panel-Block (gleiche Padding/Font/Buttons).
   Zusatz: dieser Block bleibt fuer historische Klassen, die noch nicht
   migriert sind, leer/verzichtbar. */

/* Toolbar */
.fm-toolbar {
  padding: 8px 12px;
}
.fm-type-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.fm-type-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text-ter);
  transition: all 0.15s;
}
.fm-type-btn:hover {
  color: var(--text-sec);
}
.fm-type-btn.active {
  background: var(--accent);
  color: #fff;
}
.fm-search {
  width: 100%;
  padding: 10px 14px;
  margin-top: 4px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-family: inherit;
}
.fm-search:focus {
  border-color: var(--accent);
}

/* Sort menu */
.fm-sort-menu {
  padding: 4px 12px 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.fm-sort-menu.hidden {
  display: none;
}
.fm-sort-opt {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 11px;
  cursor: pointer;
  background: transparent;
  color: var(--text-ter);
  transition: all 0.15s;
  font-family: inherit;
}
.fm-sort-opt:hover {
  border-color: var(--accent);
  color: var(--text-sec);
}
.fm-sort-opt.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Grid View (default) ─────────────────────────────── */
.fm-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  align-content: start;
}

.fm-item {
  position: relative;
  border-radius: 12px;
  background: var(--surface-2);
  overflow: clip;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.fm-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.fm-item:active {
  transform: scale(0.97);
}

/* Grid thumbnail area */
.fm-item-thumb {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  flex-shrink: 0;
  position: relative;
}
.fm-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fm-item-thumb-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
}
.fm-item-thumb-icon svg {
  opacity: 0.5;
}
.fm-item-thumb-icon .fm-ext-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-ter);
  letter-spacing: 0.5px;
}

/* Grid info bar */
.fm-item-info {
  padding: 8px 10px;
}
.fm-item-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-item-meta {
  font-size: 10px;
  color: var(--text-ter);
  margin-top: 2px;
}

/* Grid overlay actions (on hover / long press) */
.fm-item-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.fm-item:hover .fm-item-actions {
  opacity: 1;
}
.fm-item-action {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.fm-item-action:hover {
  background: rgba(0, 0, 0, 0.8);
}
.fm-item-action.fm-delete:hover {
  background: var(--red, #ef4444);
}

/* ── Audio player in grid ────────────────────────────── */
.fm-item.fm-audio-item .fm-item-thumb {
  position: relative;
}
.fm-audio-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.fm-audio-play:hover {
  background: rgba(0, 0, 0, 0.15);
}
.fm-audio-play svg {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}
.fm-audio-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
}
.fm-audio-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s linear;
}
.fm-audio-time {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}

/* ── List View ───────────────────────────────────────── */
.fm-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fm-list .fm-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
}
.fm-list .fm-item:hover {
  transform: none;
  box-shadow: none;
  background: var(--border);
}
.fm-list .fm-item-thumb {
  width: 44px;
  height: 44px;
  aspect-ratio: 1;
  border-radius: 8px;
  flex-shrink: 0;
}
.fm-list .fm-item-info {
  flex: 1;
  min-width: 0;
  padding: 0;
}
.fm-list .fm-item-name {
  font-size: 13px;
}
.fm-list .fm-item-meta {
  font-size: 11px;
}
.fm-list .fm-item-actions {
  position: static;
  opacity: 1;
  flex-shrink: 0;
}
.fm-list .fm-audio-play {
  border-radius: 8px;
}
.fm-list .fm-audio-progress {
  border-radius: 0 0 8px 8px;
}

/* ── Empty state ─────────────────────────────────────── */
.fm-empty {
  text-align: center;
  color: var(--text-ter);
  padding: 60px 20px;
  font-size: 14px;
  grid-column: 1 / -1;
}
.fm-empty svg {
  opacity: 0.3;
  margin-bottom: 12px;
}

/* ── GLightbox overrides for dark theme ──────────────── */
.glightbox-clean .gslide-description {
  background: transparent;
}
.glightbox-clean .gslide-title {
  color: #fff;
  font-size: 14px;
}
.glightbox-clean .gdesc-inner {
  padding: 8px 0;
}
.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  backdrop-filter: blur(8px);
}
.goverlay {
  background: rgba(0, 0, 0, 0.92) !important;
}

/* ── Delete confirm toast ────────────────────────────── */
.fm-delete-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  color: var(--text);
}
.fm-delete-toast button {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.fm-delete-confirm {
  background: var(--red, #ef4444);
  color: #fff;
}
.fm-delete-cancel {
  background: var(--surface);
  color: var(--text-sec);
}

/* .icon-button (top bar) → migriert zu .pw-btn.pw-btn--ghost.pw-btn--icon (M1-A) */

/* ── User Avatar Menu (Google-Style) ─────────────────── */
.user-menu {
  position: relative;
}
.user-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s;
}
.user-avatar-btn:hover {
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* (Removed: old user-dropdown + appearance row — replaced by Profil-Panel Bottom-Sheet) */

/* ── What's New Modal ───────────────────────────────── */
.whatsnew-content {
  max-width: 460px !important;
  max-height: 85vh !important;
}
.whatsnew-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}
.whatsnew-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.whatsnew-header h3 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.whatsnew-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 2px;
}
.wn-entry {
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  position: relative;
}
.wn-entry.wn-highlight {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.wn-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  margin-bottom: 8px;
}
.wn-entry h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.wn-entry p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-sec);
}

/* ── Settings Panel (hidden data source for Fullscreen panels) ── */
/* #settings-panel is display:none in HTML — these styles kept for cloned content */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px;
}
.settings-tab-content {
  display: none;
}
.settings-tab-content.active {
  display: block;
}

.settings-section {
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  border: 0.5px solid var(--border);
}

.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 12px;
}

/* v7.6.12: Connector-Cards komplett überarbeitet — Sandbox-Style.
   Layout: [icon-box] [name+desc (flex:1)] [status oben + button unten].
   Kein flex-wrap mehr (vorher hat GPS-Card mit langer Desc + Button
   chaotisch gewrapped). Bei schmalem Viewport stackt der rechte Block
   responsiv unter den Text. */
.connector {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface, var(--bg));
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition:
    border-color 0.14s ease,
    background 0.14s ease;
}
.connector:hover {
  border-color: var(--accent, #0a84ff);
}
.connector:last-child {
  margin-bottom: 0;
}

.connector-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-sec);
}
.connector-icon svg {
  width: 22px;
  height: 22px;
}

.connector-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.connector-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.connector-desc {
  font-size: 12px;
  color: var(--text-ter);
  line-height: 1.4;
}

.connector-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-ter);
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-ter);
  flex-shrink: 0;
}
/* v7.8.102: Connected-State kräftiger — solid Grün + Glow */
.status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.status-dot.disconnected {
  background: var(--red, #ff3b30);
}
/* v7.8.102: status-text kräftiger im verbundenen Zustand, gedämpft sonst */
.status-text.connected {
  color: #10b981;
  font-weight: 600;
}
.status-text.disconnected {
  color: var(--text-sec);
}

.connector-btn {
  padding: 10px 18px !important;
  border-radius: 10px !important;
  border: 1.5px solid #047857 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  background: #047857 !important;
  color: #ffffff !important;
  transition: all 0.14s !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 4px rgba(4, 120, 87, 0.25) !important;
  letter-spacing: 0.2px;
}
.connector-btn:hover {
  background: #065f46 !important;
  border-color: #065f46 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(4, 120, 87, 0.4) !important;
}
.connector-btn.connected,
.connector-btn.btn-ghost {
  background: #ffffff !important;
  color: #047857 !important;
  border: 1.5px solid #047857 !important;
  box-shadow: none !important;
}
.connector-btn.connected:hover,
.connector-btn.btn-ghost:hover {
  background: #ecfdf5 !important;
  border-color: #047857 !important;
  color: #047857 !important;
}

/* Bei schmalem Viewport: Status + Button stacken unter den Text */
@media (max-width: 480px) {
  .connector {
    flex-wrap: wrap;
  }
  .connector-info {
    flex-basis: calc(100% - 54px);
  }
  .connector-status,
  .connector-btn {
    flex-basis: auto;
  }
}

/* ── Provider Status ─────────────────────────────────── */
.provider-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.provider-badge {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.provider-badge.ok {
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: var(--green);
}
.provider-badge.warn {
  background: color-mix(in srgb, var(--red) 15%, transparent);
  color: var(--red);
}
.provider-switch-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--text-ter);
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}
.provider-switch-link:hover {
  color: var(--text-sec);
  text-decoration: underline;
}

/* ── Connector Dimming (not connected) ───────────────── */
.connector.dimmed {
  opacity: 0.6;
}
.connector.dimmed:hover {
  opacity: 0.85;
}

/* ── Bot Voice Rows ──────────────────────────────────── */
.bot-voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.bot-voice-row + .bot-voice-row {
  border-top: 1px solid var(--border);
}
.bot-voice-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.bot-voice-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  width: 60px;
  flex-shrink: 0;
}
.bot-voice-row select {
  flex: 1;
  padding: 7px 10px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

/* ── Extension Wizard ────────────────────────────────── */
.ext-wizard {
  padding: 0 16px 10px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 0 0 12px 12px;
  margin-top: -10px;
  margin-bottom: 10px;
}
.ext-wizard.hidden {
  display: none;
}
.wizard-step {
  display: flex;
  gap: 12px;
  padding: 14px 0;
}
.wizard-step + .wizard-step {
  border-top: 1px solid var(--border);
}
.wizard-step-num {
  font-size: 18px;
  width: 28px;
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 700;
}
.wizard-step-body {
  flex: 1;
}
.wizard-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.wizard-step-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wizard-step-hint {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 8px;
  line-height: 1.4;
}
.ext-code-display {
  font-family: "SF Mono", monospace;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  text-align: center;
}
.ext-code-display.hidden {
  display: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text-sec);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-sec);
}

/* ── Extension Details Accordion ─────────────────────── */
.ext-details {
  padding: 0 16px;
  margin-bottom: 10px;
}
.ext-details.hidden {
  display: none;
}
.ext-details-toggle {
  background: none;
  border: none;
  color: var(--text-sec);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
  width: 100%;
  text-align: left;
}
.ext-details-toggle:hover {
  color: var(--text);
}
.ext-details-content {
  padding-bottom: 8px;
}
.ext-details-content.hidden {
  display: none;
}

/* ── Version Footer ──────────────────────────────────── */
.settings-version-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-ter);
  cursor: pointer;
}
.settings-version-footer:hover {
  color: var(--text-sec);
}
.version-value {
  font-weight: 600;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
}
.setting-row label {
  font-size: 14px;
  color: var(--text-sec);
}
.setting-row select {
  padding: 6px 10px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text-sec);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

/* ── SSI Footer ──────────────────────────────────────── */

/* v7.7.21: Footer auf 1 dezente Zeile reduziert. */
#ssi-footer {
  padding: 6px 16px 8px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-ter);
  letter-spacing: 0;
  flex-shrink: 0;
}
body.keyboard-open #ssi-footer {
  display: none;
}
.ssi-footer-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-chip {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 2px 0;
  font-size: 10.5px;
  color: var(--text-sec);
  font-family: inherit;
  letter-spacing: 0;
  transition: color 0.14s;
  max-width: 38vw;
}
.footer-chip .chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.footer-chip .chip-prefix {
  opacity: 0.55;
  margin-right: 4px;
  font-weight: 500;
}
.footer-chip:hover {
  color: var(--accent);
}

.ssi-brand {
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ssi-sep {
  margin: 0 4px;
  opacity: 0.4;
}
.ssi-ver {
  opacity: 0.6;
}

/* Light mode overrides */
[data-mode="light"] #auth-screen {
  background: var(--bg);
}
[data-mode="light"] #voice-center {
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(88, 86, 214, 0.04) 0%,
    transparent 50%
  );
}
[data-theme="kitt"] #voice-center {
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(178, 34, 34, 0.04) 0%,
    transparent 50%
  );
}
[data-theme="elegant"] #voice-center {
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(160, 136, 72, 0.03) 0%,
    transparent 50%
  );
}
[data-theme="cyberpunk"] #voice-center {
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(26, 136, 153, 0.04) 0%,
    transparent 50%
  );
}
[data-theme="nature"] #voice-center {
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(90, 138, 106, 0.04) 0%,
    transparent 50%
  );
}
[data-theme="synthwave"] #voice-center {
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(136, 68, 136, 0.05) 0%,
    transparent 50%
  );
}
[data-mode="light"] #bot-avatar {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}
[data-mode="light"] #bot-avatar.speaking {
  box-shadow:
    0 0 0 3px var(--accent),
    0 0 32px rgba(88, 86, 214, 0.2);
}
[data-theme="kitt"] #bot-avatar {
  box-shadow: 0 2px 20px rgba(178, 34, 34, 0.2);
}
[data-theme="elegant"] #bot-avatar {
  box-shadow: 0 2px 20px rgba(160, 136, 72, 0.15);
}
[data-theme="cyberpunk"] #bot-avatar {
  box-shadow: 0 2px 20px rgba(26, 136, 153, 0.2);
}
[data-theme="nature"] #bot-avatar {
  box-shadow: 0 2px 20px rgba(90, 138, 106, 0.15);
}
[data-theme="synthwave"] #bot-avatar {
  box-shadow: 0 2px 20px rgba(136, 68, 136, 0.2);
}
[data-mode="light"] .msg.assistant {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
  color: var(--text);
}
[data-mode="light"] .auth-card button:not(.pw-toggle) {
  background: var(--accent);
}
[data-mode="light"] .ssi-brand {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Changelog Modal ──────────────────────────────────── */

#changelog-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#changelog-modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
}

#changelog-body {
  overflow-y: auto;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-sec);
}

.changelog-version {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  margin-top: 16px;
}
.changelog-version:first-child {
  margin-top: 0;
}

.changelog-entry {
  margin-bottom: 16px;
}

.changelog-entry h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-ter);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 8px 0 4px;
}

.changelog-entry ul {
  list-style: none;
  padding: 0;
}

.changelog-entry li {
  padding: 2px 0 2px 16px;
  position: relative;
  color: var(--text-sec);
}

.changelog-entry li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}

.setting-row.clickable {
  cursor: pointer;
  border-radius: 8px;
  padding: 10px 8px;
  margin: 0 -8px;
  transition: background 0.15s;
}
.setting-row.clickable:hover {
  background: var(--surface-2);
}
.setting-row.clickable label {
  cursor: pointer;
}

.setting-value {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.setting-hint {
  font-size: 13px;
  color: var(--text-ter);
}

/* Settings grid layout */
.s-grid {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}
.s-grid > .s-field {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0 !important;
}
.s-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.s-field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-ter);
  text-transform: none;
  letter-spacing: 0;
}
.s-field select,
.s-field input,
.s-field textarea {
  padding: 7px 10px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  width: 100%;
  font-family: inherit;
}
.s-field textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.4;
}
.s-field select {
  cursor: pointer;
}
.s-field input::placeholder,
.s-field textarea::placeholder {
  color: var(--text-ter);
}

/* Consistent spacing between s-fields (labels + their pickers) in settings sections */
.settings-section .s-field + .s-field,
.settings-section .s-field + .s-grid,
.settings-section .s-grid + .s-field,
.settings-section .s-grid + .s-grid {
  margin-top: 18px;
}

/* v7.8.112: Sprechgeschwindigkeits-Slider im Mein-Bot-Panel.
   Inspiriert vom voice-loop-Sandbox-Pattern (.slider-row + .slider-val). */
.s-field.tts-speed-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.s-field.tts-speed-field .slider-val {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-sec);
  font-weight: 500;
  min-width: 44px;
  text-align: right;
}
.s-field .slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.s-field .slider-row input[type="range"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  accent-color: var(--accent, #a33a0a);
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.s-field .slider-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-ter);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ── Theme Picker — visual swatches ──────────────────── */
.theme-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 54px;
  padding: 7px 6px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.theme-swatch:hover {
  border-color: var(--border);
}
.theme-swatch.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.swatch-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
.swatch-label {
  font-size: 10px;
  color: var(--text-sec);
  font-weight: 500;
  white-space: nowrap;
}
.theme-swatch.active .swatch-label {
  color: var(--text);
}

/* ── Visualizer Picker — icon cards ──────────────────── */
.viz-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.viz-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 54px;
  padding: 7px 6px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.viz-card:hover {
  border-color: var(--border);
}
.viz-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.viz-icon {
  flex-shrink: 0;
}
.viz-card span {
  font-size: 10px;
  color: var(--text-sec);
  font-weight: 500;
  white-space: nowrap;
}
.viz-card.active span {
  color: var(--text);
}

/* ── Settings Save Toast — v7.8.111 hübscher ────────── */
.settings-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(24px) scale(0.96);
  background: rgba(20, 25, 30, 0.92);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  color: #fff;
  padding: 12px 20px 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
  z-index: 9999;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.1px;
}
.settings-toast::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #10b981;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/></svg>");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}
.settings-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
[data-mode="light"] .settings-toast {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.06) inset;
}

/* API Service Cards */
/* API Service Cards */
.svc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 6px;
  transition:
    opacity 0.2s,
    background 0.15s;
  cursor: pointer;
}
.svc-card:hover {
  background: var(--border);
}
.svc-card.missing {
  opacity: 0.4;
}
.svc-card.missing:hover {
  opacity: 0.65;
}
.svc-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.svc-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.svc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
  line-height: 1.3;
}
.svc-desc {
  font-size: 11px;
  color: var(--text-ter);
  display: block;
  margin-top: 2px;
  line-height: 1.3;
}
.svc-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.svc-badge.system {
  background: rgba(48, 209, 88, 0.15);
  color: var(--green);
}
.svc-badge.user {
  background: rgba(139, 131, 255, 0.15);
  color: var(--accent);
}
.svc-badge.missing {
  background: rgba(255, 69, 58, 0.1);
  color: var(--red);
}

/* Key editor (slide-up panel) */
.key-editor {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 0;
  margin-top: 12px;
}
.key-editor.hidden {
  display: none;
}
.key-editor-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.key-input-full {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-family: monospace;
}
.key-input-full:focus {
  border-color: var(--accent);
}
.key-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.key-btn-cancel {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sec);
  cursor: pointer;
  font-size: 12px;
}
.key-btn-save {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.key-btn-save:hover {
  opacity: 0.85;
}

/* Module cards */
.mod-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  margin-bottom: 8px;
  border: 0.5px solid var(--border);
  opacity: 0.4;
}
.mod-card.active {
  opacity: 1;
}
.mod-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.8;
}
.mod-icon svg {
  width: 20px;
  height: 20px;
}
.mod-info {
  flex: 1;
  min-width: 0;
}
.mod-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.mod-tools {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-ter);
  margin-left: 4px;
}
.mod-desc {
  font-size: 11px;
  color: var(--text-ter);
  display: block;
  margin-top: 2px;
  line-height: 1.35;
}
.mod-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.mod-badge.on {
  background: rgba(48, 209, 88, 0.15);
  color: var(--green);
}
.mod-badge.core {
  background: rgba(139, 131, 255, 0.15);
  color: var(--accent);
}
.mod-badge.off {
  background: rgba(128, 128, 128, 0.12);
  color: var(--text-ter);
}

/* Module categories (accordion) */
.mod-category {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.mod-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--surface-2);
  user-select: none;
}
.mod-cat-header:hover {
  background: var(--surface-3);
}
.mod-cat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.mod-cat-count {
  font-size: 11px;
  color: var(--text-ter);
}
.mod-cat-arrow {
  color: var(--text-ter);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.mod-category.open .mod-cat-arrow {
  transform: rotate(180deg);
}
.mod-cat-body {
  display: none;
  padding: 6px;
}
.mod-category.open .mod-cat-body {
  display: block;
}
.mod-cat-body .mod-card {
  border-radius: 8px;
  margin-bottom: 4px;
}
.mod-cat-body .mod-card:last-child {
  margin-bottom: 0;
}
.mod-badge.off {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-ter);
}

/* ── Module Detail Modal ─────────────────────────────── */
.mod-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mod-modal.hidden {
  display: none;
}
.mod-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.mod-modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.mod-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.mod-modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.mod-modal-icon {
  flex-shrink: 0;
  color: var(--accent);
}
.mod-modal-icon svg {
  width: 28px;
  height: 28px;
}
.mod-modal-desc {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.4;
  display: block;
  margin-top: 2px;
}
.mod-modal-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-ter);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.mod-modal-close:hover {
  color: var(--text);
}

.mod-modal-toggle {
  margin-bottom: 16px;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.toggle-label input {
  display: none;
}
.toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--surface-2);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-ter);
  transition: all 0.2s;
}
.toggle-label input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-label input:checked + .toggle-slider::after {
  left: 20px;
  background: white;
}
.toggle-label input:disabled + .toggle-slider {
  opacity: 0.4;
  cursor: not-allowed;
}

.mod-modal-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-ter);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.mod-tool-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 4px;
}
.mod-tool-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-family: monospace;
}
.mod-tool-desc {
  font-size: 11px;
  color: var(--text-sec);
  line-height: 1.3;
}
.mod-modal-meta {
  margin-top: 12px;
  font-size: 10px;
  color: var(--text-ter);
}

/* Usage — cost-focused redesign */
.usage-total {
  text-align: center;
  padding: 16px 0 12px;
}
.usage-total-value {
  font-size: 32px;
  font-weight: 200;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.usage-total-label {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 2px;
}
.usage-breakdown {
  margin-top: 12px;
}
.usage-svc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.usage-svc-icon {
  width: 18px;
  text-align: center;
}
.usage-svc-name {
  flex: 1;
  color: var(--text-sec);
}
.usage-svc-calls {
  color: var(--text-ter);
  min-width: 36px;
  text-align: right;
}
.usage-svc-cost {
  color: var(--text);
  font-weight: 600;
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.usage-bar-wrap {
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.usage-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.5s ease;
}

/* Help Overlay */
.help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.help-overlay.hidden {
  display: none;
}
.help-panel {
  background: var(--surface);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.help-body {
  overflow-y: auto;
  padding: 14px 18px;
}
.help-section {
  margin-bottom: 16px;
}
.help-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.help-text {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.5;
}
.help-example {
  font-size: 12px;
  color: var(--text);
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  margin: 3px 0;
  font-style: italic;
}

/* Tip lightbulb button — subtle glow, click to show tip */
.tip-btn {
  position: absolute;
  bottom: 108px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  transition: all 0.3s;
  animation: tip-glow 3s ease-in-out infinite;
}
.tip-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
@keyframes tip-glow {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 12px var(--accent-glow);
  }
}

/* Tipp-Banner — positioned above input bar */
.tip-banner {
  position: absolute;
  bottom: 108px;
  left: 16px;
  right: 60px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-sec);
  z-index: 50;
  animation: tipSlideIn 0.3s ease;
}
.tip-banner.hidden {
  display: none;
}
.tip-banner #tip-close {
  background: none;
  border: none;
  color: var(--text-ter);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  margin-left: auto;
  flex-shrink: 0;
}
@keyframes tipSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Timeline / Verlauf */
.tl-day {
  margin-bottom: 16px;
}
.tl-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.tl-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 5px;
}
.tl-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.tl-card-header .tl-icon {
  font-size: 14px;
}
.tl-card-header .tl-meta {
  margin-left: auto;
  font-weight: 400;
  color: var(--text-ter);
  font-size: 11px;
}
.tl-card-body {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-sec);
  line-height: 1.5;
}
.tl-topic {
  display: inline-block;
  padding: 2px 6px;
  margin: 1px;
  background: rgba(139, 131, 255, 0.1);
  border-radius: 4px;
  font-size: 10px;
  color: var(--accent);
}
.tl-cli {
  font-family: monospace;
  font-size: 10px;
  color: var(--text-ter);
  padding: 4px 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.04);
  margin-top: 4px;
}

.chat-archive-list {
  overflow-y: auto;
}

.archive-entry {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.archive-entry:hover {
  background: var(--border);
}
.archive-entry.expanded {
  border-color: var(--border);
}

.archive-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.archive-entry-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
}
.archive-entry-type {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.archive-entry-type.voice {
  background: rgba(52, 199, 89, 0.15);
  color: var(--green);
}
.archive-entry-type.chat {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
}
.archive-entry-type.telegram {
  background: rgba(0, 136, 204, 0.15);
  color: #0088cc;
}

.archive-entry-topics {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.archive-entry-preview {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 8px;
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 1px solid var(--border);
  padding-top: 0;
}
.archive-entry.expanded .archive-entry-preview {
  max-height: 400px;
  padding-top: 8px;
}

.archive-preview-line {
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 8px;
  margin-bottom: 2px;
  font-size: 13px;
  line-height: 1.5;
}
.archive-preview-line.user {
  color: var(--accent);
  border-left-color: var(--accent);
}
.archive-preview-line.assistant {
  color: var(--text);
  opacity: 0.85;
  border-left-color: var(--border);
}

/* ── Usage Tab ───────────────────────────────────────── */

.usage-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.usage-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.usage-card-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.usage-card-label {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 4px;
}
.usage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.usage-service {
  flex: 1;
  color: var(--text-sec);
}
.usage-model {
  color: var(--text-ter);
  font-size: 11px;
}
.usage-calls {
  color: var(--text);
  font-weight: 600;
}
.usage-date-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 12px;
  margin-bottom: 4px;
}

body.embed #top-bar,
body.embed #transcript-panel {
  display: none;
}

@media (max-width: 480px) {
  #bot-avatar {
    width: 80px;
    height: 80px;
  }
  #bot-name {
    font-size: 18px;
  }
  #call-duration {
    font-size: 32px;
  }
  .call-button {
    width: 86px;
    height: 86px;
  }
  .ctrl-button {
    width: 44px;
    height: 44px;
  }
  .auth-card {
    margin: auto 16px;
  }
}

/* ── Image Viewer Modal ─────────────────────────────────── */
/* Legacy img-viewer removed — GLightbox handles image viewing */

/* ── Voice Activity Feed ─────────────────────────────────── */
.voice-activity-feed {
  width: 100%;
  max-width: 320px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.voice-activity-feed:empty {
  display: none;
}
.vaf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-sec);
  animation: msg-in 0.2s ease-out;
}
.vaf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: ch-pulse 1.5s ease-in-out infinite;
}
.vaf-dot.running {
  background: var(--accent, #6366f1);
}
.vaf-dot.done {
  background: var(--green, #22c55e);
  animation: none;
}
.vaf-dot.error {
  background: var(--red, #ef4444);
  animation: none;
}
.vaf-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vaf-time {
  font-size: 10px;
  color: var(--text-ter);
  flex-shrink: 0;
}

/* Bot Profiles */
/* Bot Profile Tabs */
.bp-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.bp-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.bp-tab:hover {
  background: var(--surface-2);
}
.bp-tab.active {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
}
.bp-tab .bp-tab-emoji {
  font-size: 16px;
}
.bp-content {
  padding: 4px 0;
}
.bp-emoji {
  font-size: 22px;
}
.bp-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.bp-voice-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bp-voice-row select {
  flex: 1;
}
.bp-preview-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-sec);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.bp-preview-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.bp-preview-btn.playing {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Browser Extension Settings + Takeover Banner */
.ext-takeover-banner {
  background: linear-gradient(
    90deg,
    rgba(221, 40, 24, 0.2),
    rgba(221, 40, 24, 0.08)
  );
  border-bottom: 2px solid #dd2818;
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ext-takeover-banner.hidden {
  display: none;
}
.ext-takeover-off-btn {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
}
.ext-takeover-off-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: 14px;
  font-size: 12px;
}
.chip .chip-x {
  cursor: pointer;
  color: var(--text-sec);
  font-weight: bold;
  user-select: none;
}
.chip .chip-x:hover {
  color: var(--red);
}

/* ── Mic Record Button ─────────────────────────────── */
.mic-record-btn {
  transition: all 0.2s;
}

.mic-record-btn.recording {
  color: #ff5555 !important;
  animation: mic-pulse 1s ease-in-out infinite;
}

/* v7.10.45: Globaler Status-Banner über dem Chat-Eingabefeld. Zeigt
   sofort nach Mic-Druck/Stop dass etwas passiert — User sieht früher
   visuelles Feedback (vorher kam Status erst mit Bot-Antwort 2-6s spät). */
/* v7.10.51: Status-Banner ohne Emojis. Pulse-Dot via ::before, Text via
   ::after — beide Pseudo-Elemente nutzen die vorhandenen body-Klassen.
   Wirkt in Smart-Stream UND Realtime, bottom-fixed (76px überm Input). */
body.voice-recording::before,
body.voice-transcribing::before,
body.voice-bot-speaking::before {
  content: "";
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  z-index: 1001;
  pointer-events: none;
  animation: voice-banner-dot 1.1s ease-in-out infinite;
}
body.voice-recording::after,
body.voice-transcribing::after,
body.voice-bot-speaking::after {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 28, 0.92);
  color: #fff;
  padding: 10px 18px 10px 30px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  animation: voice-banner-pop 0.18s ease-out;
  letter-spacing: 0.01em;
}
body.voice-recording::before {
  background: #ff5b5b;
  /* Dot-Position innerhalb der Pille (links neben dem Text) */
  margin-left: -50px;
  margin-bottom: 4px;
}
body.voice-recording::after {
  content: "Du sprichst";
  background: rgba(220, 38, 38, 0.95);
}
body.voice-transcribing::before {
  background: #93c5fd;
  margin-left: -42px;
  margin-bottom: 4px;
}
body.voice-transcribing::after {
  content: "Verstehe";
  background: rgba(37, 99, 235, 0.95);
}
body.voice-bot-speaking::before {
  background: #a7f3d0;
  margin-left: -56px;
  margin-bottom: 4px;
}
body.voice-bot-speaking::after {
  content: "Lumina spricht";
  background: rgba(16, 185, 129, 0.95);
}
@keyframes voice-banner-dot {
  0%,
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translate(-50%, 0) scale(0.7);
  }
}
@keyframes voice-banner-pop {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.mic-record-btn.transcribing {
  color: var(--accent-color, #6ec6ff) !important;
  animation: mic-spin 1s linear infinite;
}

@keyframes mic-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.7;
  }
}

@keyframes mic-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ── Send Button Morphing (Phone ↔ Send ↔ Hangup ↔ Check) ── */
/* Hide ALL icons by default, show only the one matching current state */
#chat-send-btn > svg {
  display: none !important;
}
#chat-send-btn.has-no-text > svg.icon-phone {
  display: inline-block !important;
}
#chat-send-btn.has-text > svg.icon-send {
  display: inline-block !important;
}
#chat-send-btn.in-call > svg.icon-hangup {
  display: inline-block !important;
}
/* Im Anruf + Text eingegeben → Send-Icon statt Hangup */
#chat-send-btn.in-call.has-text > svg.icon-hangup {
  display: none !important;
}
#chat-send-btn.in-call.has-text > svg.icon-send {
  display: inline-block !important;
}
#chat-input-bar.recording #chat-send-btn > svg {
  display: none !important;
}
#chat-input-bar.recording #chat-send-btn > svg.icon-check {
  display: inline-block !important;
}

/* In-call: red hangup button */
#chat-send-btn.in-call {
  background: #ef4444;
  color: #fff;
  animation: call-pulse 1.5s ease-in-out infinite;
}
#chat-send-btn.in-call:hover {
  background: #dc2626;
}
/* In-call + Text: blauer Send-Button, kein roter Puls */
#chat-send-btn.in-call.has-text {
  background: var(--send-color, #6ec6ff);
  color: #000;
  animation: none;
}
#chat-send-btn.in-call.has-text:hover {
  background: #5ab8f5;
}
@keyframes call-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* Hide mic-record-btn during call (the call already uses the mic) */
#chat-input-bar.in-call #mic-record-btn {
  display: none !important;
}

/* When empty: phone button color (green — call button) */
#chat-send-btn.has-no-text {
  background: #10b981;
  color: #fff;
}

#chat-send-btn.has-no-text:hover {
  background: #059669;
}

/* When typing: send button color (accent blue) */
#chat-send-btn.has-text {
  background: var(--send-color, #6ec6ff);
  color: #000;
}

/* Emoji button entirely removed — see #emoji-btn { display: none } below */

/* During call: visualizer active */
.voice-banner.in-call .banner-viz {
  background: transparent;
}

/* Banner viz handled by .banner-viz class */

/* ── Mic Recording Overlay (ChatGPT-style) ─────────── */
#chat-input-bar {
  position: relative;
}

.mic-record-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface, #1a1a1f);
  border-radius: 24px;
  z-index: 10;
}

.mic-record-overlay.hidden {
  display: none;
}

.mic-record-overlay canvas {
  flex: 1 1 auto;
  width: 100% !important;
  height: 44px !important;
  border-radius: 22px;
  background: rgba(34, 197, 94, 0.08);
}

.mic-overlay-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.mic-overlay-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #aaa);
}
.mic-overlay-btn.cancel:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.mic-overlay-btn.stop {
  background: #22c55e;
  color: #fff;
}
.mic-overlay-btn.stop:hover {
  background: #16a34a;
}
.mic-overlay-btn:active {
  transform: scale(0.92);
}

.mic-record-overlay.transcribing canvas {
  opacity: 0.4;
}
.mic-record-overlay.transcribing::after {
  content: "Transkribiere...";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}

/* recording-mode overlay pattern removed — recording state handled by .recording class */

/* ── ChatGPT-Style Input Bar v2 ─────────────────────── */
#chat-input-bar {
  position: relative;
  gap: 6px;
}

/* Hide emoji button entirely */
#emoji-btn,
#emoji-picker {
  display: none !important;
}

/* Upload button: round + cleaner — 44px for mobile touch */
#upload-btn {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Generic icon button (mic, cancel) — min 44px for touch targets */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-sec, #aaa);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #fff);
}

/* Mic button: prevent iOS text-selection magnifier on long-press (PTT) */
.mic-btn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.18s ease-out,
    background 0.18s,
    box-shadow 0.18s,
    color 0.18s;
}
.mic-btn svg {
  pointer-events: none;
}

/* Telegram-Style PTT: Mic-Button bleibt sichtbar + waechst gross + roter Glow */
#chat-input-bar.recording.ptt-mode #mic-record-btn {
  display: flex !important;
  transform: scale(1.85);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
  box-shadow:
    0 0 0 14px rgba(239, 68, 68, 0.12),
    0 0 32px rgba(239, 68, 68, 0.55);
  z-index: 20;
  position: relative;
  animation: none; /* mic-pulse aus, Scale-Effekt ist genug */
}
/* Cancel-Button im PTT-Mode ausblenden (Loslassen = Senden, kein Cancel-UI) */
#chat-input-bar.recording.ptt-mode #mic-cancel-btn {
  display: none !important;
}

/* Mic button: recording = red pulse */
.mic-btn.recording {
  color: #ef4444;
  animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

/* Hide mic when input has text */
#chat-input-bar.has-typed-text .hide-when-text {
  display: none !important;
}

/* Inline waveform canvas inside input bar (takes input's place during recording) */
.mic-viz-inline {
  height: 40px;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.08);
  overflow: hidden;
}
.mic-viz-inline.hidden {
  display: none;
}

/* During recording: hide text input + mic + upload, show cancel + waveform + check */
#chat-input-bar.recording #chat-text-input {
  display: none !important;
}
#chat-input-bar.recording #mic-record-btn {
  display: none !important;
}
#chat-input-bar.recording #upload-btn {
  display: none !important;
}
#chat-input-bar.recording .qa-popover {
  display: none !important;
}
#chat-input-bar.recording #mic-cancel-btn {
  display: flex !important;
  z-index: 10;
  flex-shrink: 0;
}
#chat-input-bar.recording .mic-viz-inline {
  display: block !important;
  flex: 1 1 auto;
  min-width: 0;
}
#chat-input-bar.recording #chat-send-btn {
  flex-shrink: 0;
  z-index: 10;
}

/* Recording: send-button shows checkmark (green, finish) */
#chat-send-btn .icon-check {
  display: none;
}
#chat-input-bar.recording #chat-send-btn .icon-check {
  display: inline-block !important;
}
#chat-input-bar.recording #chat-send-btn .icon-phone,
#chat-input-bar.recording #chat-send-btn .icon-send,
#chat-input-bar.recording #chat-send-btn .icon-hangup {
  display: none !important;
}
#chat-input-bar.recording #chat-send-btn {
  background: #10b981 !important;
  color: #fff !important;
  animation: none !important;
}

/* Transcribing: pulsing wave indicator on send button */
#chat-input-bar.transcribing #chat-send-btn {
  background: transparent !important;
  pointer-events: none;
  position: relative;
  overflow: visible;
}
#chat-input-bar.transcribing #chat-send-btn > svg {
  display: none !important;
}
#chat-input-bar.transcribing #chat-send-btn::before,
#chat-input-bar.transcribing #chat-send-btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent, #6ec6ff);
  animation: transcribe-ripple 1.4s ease-out infinite;
}
#chat-input-bar.transcribing #chat-send-btn::after {
  animation-delay: 0.7s;
}
@keyframes transcribe-ripple {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Transcribing: subtle glow on input bar */
#chat-input-bar.transcribing {
  box-shadow:
    0 0 0 1px var(--accent, #6ec6ff),
    0 0 12px rgba(110, 198, 255, 0.15);
  transition: box-shadow 0.3s;
}

/* Waveform fades to gentle pulse during transcribing */
#chat-input-bar.transcribing .mic-viz-inline {
  opacity: 0.1;
  transition: opacity 0.4s;
}
#chat-input-bar.transcribing #mic-cancel-btn {
  opacity: 0.15;
  pointer-events: none;
  transition: opacity 0.3s;
}
/* Mic button shows gentle pulse during transcribing */
#chat-input-bar.transcribing #mic-record-btn {
  color: var(--accent, #6ec6ff);
  animation: transcribe-mic-pulse 1.4s ease-in-out infinite;
}
@keyframes transcribe-mic-pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* v6.14.1: #call-btn-Versteck entfernt — Call-Button ist im Voice-Mode zentral */

/* Hide floating tip button — distracting */
#tip-btn {
  display: none !important;
}

/* ── Bottom-Sheet Component ──────────────────────────── */

.bs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}
.bs-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bs-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 2001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}
.bs-sheet.open {
  transform: translateY(0);
}
.bs-sheet.half {
  max-height: 55vh;
}

.bs-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
  flex-shrink: 0;
}
.bs-handle::after {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--text);
  opacity: 0.15;
}

.bs-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Fullscreen Panel — wiederverwertbar, einheitlich ──
   v7.8.5: slide-from-right auf ALLEN Bildschirmgroessen. Auf Mobile
   deckt es das ganze Viewport, auf Desktop slidet es in die zentrierte
   App-Box (420px breit). Keine Fade-/TranslateY-Variante mehr. */

.fs-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 2002;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
}
.fs-panel.open {
  transform: translateX(0);
}

/* Desktop: Panel deckt genau die App-Box ab (420px breit, zentriert) —
   gleiche Slide-from-right-Animation wie Mobile, nur in einem
   schmaleren Container. */
@media (min-width: 768px) {
  .fs-panel {
    inset: auto;
    top: 20px;
    left: 50%;
    width: 420px;
    height: calc(100dvh - 40px);
    max-height: 820px;
    border-radius: 24px;
    border: 0.5px solid var(--border);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
    /* Slide kommt von 210px rechts der Mitte = ausserhalb des Containers
       — Endposition translateX(-50%) zentriert das Panel. */
    transform: translateX(calc(-50% + 480px));
  }
  .fs-panel.open {
    transform: translateX(-50%);
  }
  .fs-panel-header {
    border-radius: 24px 24px 0 0;
  }
  .fs-panel-body:last-child {
    border-radius: 0 0 24px 24px;
  }
}

/* Backdrop fuer Desktop-Modal */
.fs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.fs-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
/* v7.8.6: vereinheitlichter Header — gleiches Layout fuer Settings,
   Termine, Dateien, Was-Neu, Neues-Projekt etc. */
.fs-panel-header,
.fm-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
  min-height: 56px;
  background: var(--surface);
  position: relative;
  z-index: 2;
}
.fs-panel-back,
.fs-panel-close,
.fs-panel-action,
.fm-icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  flex-shrink: 0;
}
.fs-panel-back:hover,
.fs-panel-close:hover,
.fs-panel-action:hover,
.fm-icon-btn:hover {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}
.fs-panel-back:active,
.fs-panel-close:active,
.fs-panel-action:active,
.fm-icon-btn:active {
  transform: scale(0.9);
}
.fs-panel-back:focus-visible,
.fs-panel-close:focus-visible,
.fs-panel-action:focus-visible,
.fm-icon-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.fs-panel-back svg,
.fs-panel-close svg,
.fs-panel-action svg,
.fm-icon-btn svg {
  display: block;
}
.fs-panel-title,
.fm-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-panel-count,
.fm-title #file-count {
  font-weight: 500;
  font-size: 16px;
  color: var(--text-ter);
  margin-left: 4px;
}
.fs-panel-header-actions,
.fm-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.fm-close-btn {
  /* v7.8.6: identisch zur fs-panel-close — kein extra Style mehr */
}
.fs-panel-subheader {
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
  position: relative;
  z-index: 1;
}
.fs-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  overscroll-behavior: contain;
}

/* ── Menu Items (for Profil-Panel, reusable) ───────── */

/* v7.8.41: Menu-Items größer für leichteres Tippen — vorher 8px Padding,
   14px Font; jetzt 12px Padding + 18px Icons + 15px Label-Text. */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  transition: background var(--transition-fast);
}
.menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.menu-item:active {
  background: rgba(255, 255, 255, 0.08);
}
.menu-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--text);
  opacity: 0.6;
  flex-shrink: 0;
  stroke-width: 2;
}
.menu-item-label {
  flex: 1;
  font-size: 15px;
  letter-spacing: 0.1px;
}
.menu-item-chevron {
  opacity: 0.35;
  font-size: 16px;
}
.menu-item.danger {
  color: var(--red);
}
.menu-item.danger svg {
  stroke: var(--red);
}
.menu-divider {
  height: 0.5px;
  background: var(--border);
  margin: 2px 0;
}

/* ── Projekt-Switcher (v7.8.2 redesign) ──────────────── */

.ps-search {
  padding: 12px 14px 10px;
  border-bottom: 0.5px solid var(--border);
}
.ps-search-input {
  width: 100%;
  background: var(--bg, var(--surface));
  border: 1px solid var(--border);
  color: var(--text-pri, var(--text-sec));
  font-size: 14px;
  outline: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.ps-search-input:focus {
  border-color: var(--accent);
}
.ps-search-input::placeholder {
  color: var(--text-ter);
  opacity: 1;
}
.ps-list {
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ps-project {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.ps-project:hover,
.ps-project:focus-visible {
  background: var(--accent-soft);
  outline: none;
}
.ps-project.ps-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.ps-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.1);
}
.ps-icon-knowledge {
  color: #4a6b96;
  background: rgba(107, 143, 184, 0.15);
}
.ps-icon-code {
  color: #8a6e20;
  background: rgba(184, 153, 64, 0.18);
}
[data-mode="dark"] .ps-icon-knowledge {
  color: #93b5db;
}
[data-mode="dark"] .ps-icon-code {
  color: #d4b96a;
}
.ps-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ps-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-pri, var(--text-sec));
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-ter);
  min-width: 0;
}
.ps-meta .ps-desc {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  color: var(--text-ter);
  opacity: 1;
}
.ps-delete {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-ter);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.ps-delete:hover,
.ps-delete:focus-visible {
  background: color-mix(in srgb, var(--red, #c62828) 15%, transparent);
  color: var(--red, #c62828);
  outline: none;
}
.ps-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-ter);
  font-size: 14px;
}
.ps-footer {
  padding: 10px 12px 14px;
  border-top: 0.5px solid var(--border);
}
.ps-add-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
}
.ps-add-btn:hover,
.ps-add-btn:focus-visible {
  background: var(--accent-glow);
  outline: none;
}
.ps-add-icon {
  display: inline-flex;
  align-items: center;
}

/* Desktop Projekt-Popover */
.ps-popover {
  position: absolute;
  left: 16px;
  right: 16px;
  z-index: 1500;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
}
.ps-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@media (min-width: 768px) {
  .ps-popover {
    left: auto;
    right: 16px;
    width: 340px;
  }
}
.ps-popover .ps-list {
  overflow-y: auto;
  max-height: 280px;
}

/* ── Quick-Actions Grid ────────────────────────────── */

/* ── Quick-Actions Popover (ChatGPT-Style) ─────── */

.qa-popover {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  z-index: 1500;
  min-width: 220px;
  padding: 6px 0;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
}
.qa-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.qa-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text);
}
.qa-item:active {
  background: rgba(255, 255, 255, 0.06);
}
.qa-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--text);
  opacity: 0.5;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}
.qa-label {
  font-size: 14px;
  color: var(--text);
}

/* ── Profil-Panel Popover (Avatar Dropdown) ──────── */

.profil-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  z-index: 1500;
  min-width: 320px;
  padding: 6px 0;
  /* v6.33.0: max-height + scroll damit alle Einträge erreichbar sind */
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
}
.profil-popover::-webkit-scrollbar {
  width: 6px;
}
.profil-popover::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--text-ter) 40%, transparent);
  border-radius: 3px;
}
.profil-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
/* ── Neue Unterhaltung Modal ────────────────────── */

.nc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.2s;
}
.nc-backdrop.open {
  opacity: 1;
}

.nc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  z-index: 3001;
  width: min(380px, 90vw);
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.nc-modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.nc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.nc-body {
  padding: 0 20px 16px;
}
.nc-body p {
  font-size: 14px;
  color: var(--text);
  opacity: 0.7;
  line-height: 1.5;
  margin: 0 0 14px;
}

.nc-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nc-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  opacity: 0.6;
}
.nc-info-row svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.nc-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px 18px;
  justify-content: flex-end;
}
.nc-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background var(--transition-fast);
}
.nc-cancel {
  background: none;
  color: var(--text);
  opacity: 0.6;
}
.nc-cancel:active {
  opacity: 1;
}
.nc-confirm {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.nc-confirm:active {
  opacity: 0.8;
}
.nc-confirm:disabled {
  opacity: 0.5;
  cursor: wait;
}

.profil-popover-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent),
    color-mix(in srgb, var(--accent) 60%, #764ba2)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ── Custom Audio Player (Theme-aware, iOS-PWA + Mac/Web identisch) ── */
/* v6.10.26: Container umschliesst Titel + Player */
.audio-player-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin: 8px 0;
}
.audio-player-container .audio-player {
  margin: 0;
}
.ap-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec, #aaa);
  letter-spacing: 0.2px;
  padding: 0 8px;
  max-width: 340px;
  text-align: right;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Hebt sich vom .msg.assistant (--surface-2) durch dezenten Akzent-Tint ab */
  background: color-mix(
    in srgb,
    var(--accent, #b89940) 9%,
    var(--surface, #161618)
  );
  border: 1px solid
    color-mix(
      in srgb,
      var(--accent, #b89940) 25%,
      var(--border, rgba(255, 255, 255, 0.08))
    );
  border-radius: 999px;
  /* Play-Button RECHTS (Rechtshaender-Daumen-Reichweite) → row-reverse */
  flex-direction: row-reverse;
  padding: 6px 6px 6px 14px;
  max-width: 340px;
  margin: 8px 0;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
/* Time-Anzeige links statt rechts (war bedingt durch Play-Position) */
.audio-player .ap-time {
  text-align: left;
  min-width: 72px;
}

/* In-Player Auto-Play Toggle — v6.10.25, setzt GLOBALES Setting (cross-device). */
.ap-autoplay {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-ter, #8b8b8f);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background 0.15s,
    color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ap-autoplay:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #fff);
}
.ap-autoplay[data-state="on"] {
  color: var(--accent, #b89940);
}
.ap-autoplay[data-state="on"]:hover {
  background: color-mix(in srgb, var(--accent, #b89940) 14%, transparent);
}
.ap-autoplay .ap-icon {
  width: 12px;
  height: 12px;
}
/* Off-State: Play-Icon mit Durchstrich — direkt im SVG per <line> geloest. */
.audio-player:hover {
  border-color: var(--accent-soft, rgba(184, 153, 64, 0.25));
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 3px var(--accent-soft, rgba(184, 153, 64, 0.12));
}
/* Play/Pause Button — accent-Color, leicht erhoeht */
.ap-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #b89940);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.15s,
    filter 0.15s;
  box-shadow:
    0 2px 6px var(--accent-soft, rgba(184, 153, 64, 0.35)),
    0 1px 2px rgba(0, 0, 0, 0.12);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.ap-play:hover {
  filter: brightness(1.08);
  box-shadow: 0 3px 10px var(--accent-glow, rgba(184, 153, 64, 0.45));
}
.ap-play:active {
  transform: scale(0.92);
}
.ap-play:focus-visible {
  outline: 2px solid var(--accent, #b89940);
  outline-offset: 2px;
}
.ap-icon {
  display: block;
}
.ap-icon.hidden {
  display: none;
}
/* Play-Icon optisch zentrieren (Dreieck wirkt sonst leicht links) */
.ap-icon-play {
  transform: translateX(1px);
}
/* Bar Track */
.ap-bar {
  flex: 1;
  height: 6px;
  background: var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-width: 60px;
}
/* Progress Fill */
.ap-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent, #b89940);
  border-radius: 3px;
  width: 0%;
  transition: width 0.05s linear;
}
/* Hover-Effekt: Bar wird etwas dicker */
.audio-player:hover .ap-bar {
  height: 7px;
}
.audio-player:hover .ap-bar {
  transition: height 0.15s;
}
/* Time-Anzeige */
.ap-time {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sec, #999);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 72px;
  text-align: right;
  letter-spacing: 0.02em;
}

/* Auto-Play Header-Toggle: visuell deutlicher AN-Zustand */
#autoplay-toggle[data-state="on"] {
  color: var(--accent, #b89940);
  background: color-mix(in srgb, var(--accent, #b89940) 15%, transparent);
  border-radius: 50%;
}
#autoplay-toggle svg.hidden {
  display: none;
}

/* ── PDF-Modal: Overlay statt neuem Tab ── */
.pdf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pdf-modal-in 0.18s ease-out;
}
@keyframes pdf-modal-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.pdf-modal-card {
  width: 100%;
  max-width: 900px;
  height: 90vh;
  max-height: 90vh;
  background: var(--surface, #1a1a1f);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}
.pdf-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2, #222226);
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.pdf-modal-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sec, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.pdf-modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.pdf-modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* Hero Status (v6.11.0) — flach, ohne Pill */
.call-status-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.call-status-line #call-status {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}
.hs-ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  transition:
    background 0.3s,
    box-shadow 0.3s;
  flex-shrink: 0;
}
.hs-ready-dot.cs-error,
.hs-ready-dot.cs-warning {
  background: #ef4444;
}
@keyframes hs-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
.hero-status-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 4px auto 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  justify-content: center;
}
.hs-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 2px;
  border: none;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #888;
  cursor: pointer;
}
.hs-chip:hover {
  opacity: 0.85;
}
.hs-chip svg {
  width: 16px;
  height: 16px;
}
.hs-popover {
  position: fixed;
  z-index: 10001;
  min-width: 200px;
  max-width: 260px;
  padding: 10px 12px;
  background: rgba(20, 20, 24, 0.96);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}
.hs-popover-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.hs-popover-status {
  opacity: 0.75;
  margin-bottom: 10px;
  font-size: 12px;
}
.hs-popover-btn {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.22);
  color: #fff;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.hs-popover-btn:hover {
  background: rgba(59, 130, 246, 0.35);
}
#hero-indicators {
  display: none !important;
}

/* v6.11.0: Chips inline in call-status-line */
.hs-chips-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}
.hs-chips-inline .hs-chip {
  padding: 0;
}
.hs-chips-inline .hs-chip svg {
  width: 15px;
  height: 15px;
}
.call-status-line .conn-quality {
  margin-left: 6px;
}
/* Visualizer groesser fuer Auto-Modus */
#viz-canvas {
  height: 160px !important;
}

/* v6.11.3: Push-Status gross & loud */
.push-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.push-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #888;
  flex-shrink: 0;
}
.push-status-dot.on {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e99;
}
.push-status-dot.off {
  background: #888;
}
.push-status-dot.err {
  background: #ef4444;
  box-shadow: 0 0 6px #ef444499;
}
.push-status-text {
  font-size: 13px;
  font-weight: 500;
}
.push-status-text.on {
  color: #22c55e;
}
.push-status-text.off {
  color: var(--text-ter, #888);
}
.push-status-text.err {
  color: #ef4444;
}
#push-permission-btn.state-active {
  background: #22c55e33;
  color: #22c55e;
  border-color: #22c55e66;
}
#push-permission-btn.state-denied,
#push-permission-btn.state-error {
  background: #ef444433;
  color: #ef4444;
  border-color: #ef444466;
}
/* Update-Banner */
.push-debug-log {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  color: #ccc;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.4;
}
.push-debug-log:empty {
  display: none;
}

/* v7.8.5: .schedule-overlay/.schedule-modal/.schedule-header/.schedule-body/
   .schedule-close komplett entfernt — die DOM-Elemente sind seit v7.8.4
   weg, Schedule laeuft ueber FullscreenPanel.

   Aktive Schedule-Klassen: .schedule-list, .schedule-group-title,
   .schedule-item, .schedule-empty, .schedule-form, .sf-* */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.schedule-group-title {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-ter, #888);
  text-transform: uppercase;
  font-weight: 600;
  margin: 14px 4px 8px;
}
.schedule-group-title:first-child {
  margin-top: 4px;
}
.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface, #f5f5f7));
  border: 1px solid color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 14px;
  transition:
    border-color 0.14s,
    background 0.14s;
}
.schedule-item:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface, #f5f5f7));
}
.schedule-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.schedule-item-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-item-meta {
  font-size: 12px;
  color: var(--text-sec);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.schedule-item-meta > span:first-child {
  color: var(--text-sec);
}
.schedule-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
[data-mode="dark"] .schedule-item-badge {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: color-mix(in srgb, var(--accent) 75%, white);
}
.schedule-item-del {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-ter);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition:
    background 0.14s,
    color 0.14s;
}
.schedule-item-del:hover {
  background: rgba(255, 69, 58, 0.14);
  color: #ff453a;
}
.schedule-empty {
  color: var(--text-ter, #888);
  text-align: center;
  padding: 32px 0;
  font-size: 13px;
  font-style: italic;
}

/* + Neuer Termin Button als M3 Filled */
.settings-section .connector-btn[id="schedule-new-btn"] {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 13px 18px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    filter 0.14s,
    transform 0.06s;
  font-family: inherit;
}
.settings-section .connector-btn[id="schedule-new-btn"]:hover {
  filter: brightness(1.08);
}
.settings-section .connector-btn[id="schedule-new-btn"]:active {
  transform: scale(0.98);
}
.schedule-new-wrapper {
  margin-top: 8px;
}
.schedule-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.schedule-form.hidden {
  display: none;
}
/* v7.7.25: M3-Form-Felder konsistent rahmen — Eingabe, Datum, Time,
   Select alle mit 1px Border, 12px Radius, Akzent on Focus. */
.sf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.sf-field label {
  font-size: 11px;
  color: var(--text-ter, #888);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.sf-field input,
.sf-field select {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--surface, #f5f5f7);
  color: var(--text);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  font-size: 14px;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition:
    border-color 0.14s,
    background 0.14s;
  width: 100%;
  box-sizing: border-box;
}
.sf-field input:hover,
.sf-field select:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}
.sf-field input:focus,
.sf-field select:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--card-bg, #fff);
}
.sf-field input::placeholder {
  color: var(--text-ter);
  opacity: 0.7;
}
[data-mode="dark"] .sf-field input,
[data-mode="dark"] .sf-field select {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
[data-mode="dark"] .sf-field input:focus,
[data-mode="dark"] .sf-field select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}
.sf-row {
  display: flex;
  gap: 12px;
}
.sf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* v7.7.24/v7.8.5: schedule-modal/h3-Overrides raus (DOM existiert nicht
   mehr). Restliche dark-mode-Overrides fuer aktive Schedule-Items
   bleiben erhalten. */
[data-mode="dark"] .schedule-item-title {
  color: #f0f2f5;
}
[data-mode="dark"] .schedule-item-meta {
  color: #9ca3af;
}
[data-mode="dark"] .sf-field input,
[data-mode="dark"] .sf-field select {
  color: #f0f2f5 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
[data-mode="dark"] .sf-field input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
[data-mode="dark"] .sf-field select option {
  background: #1f2328;
  color: #f0f2f5;
}
[data-mode="dark"] .sf-field label {
  color: #9ca3af;
}
[data-mode="dark"] .schedule-empty {
  color: #9ca3af;
}
[data-mode="dark"] .schedule-group-title {
  color: #9ca3af;
}

/* v6.11.51: task-banner sitzt unter der Projekt-Zeile, Header bleibt stabil */
#task-banner {
  position: relative !important;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
  z-index: 100;
  max-width: none;
  width: 100%;
  padding: 10px 16px !important;
  background: linear-gradient(
    180deg,
    rgba(79, 70, 229, 0.95) 0%,
    rgba(67, 56, 202, 0.95) 100%
  ) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.15px;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.22);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: background 0.2s;
}
#task-banner:hover {
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 1) 0%,
    rgba(79, 70, 229, 1) 100%
  ) !important;
}
#task-banner .task-banner-dot {
  width: 10px;
  height: 10px;
  background: #10b981 !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.25),
    0 0 12px rgba(16, 185, 129, 0.5);
  animation: banner-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes banner-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(16, 185, 129, 0.25),
      0 0 8px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(16, 185, 129, 0.35),
      0 0 16px rgba(16, 185, 129, 0.7);
  }
}
#task-banner #task-banner-text {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
#task-banner .task-banner-chevron {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  flex-shrink: 0;
}
#task-banner #task-banner-text {
  font-size: 14px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#task-banner .task-banner-dot {
  width: 10px;
  height: 10px;
}
#task-detail-panel {
  position: fixed !important;
  top: 106px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 19998;
  width: min(640px, 94vw);
  max-width: none;
  background: rgba(20, 22, 28, 0.98) !important;
  color: #f0f2f5;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}
#task-banner.hidden,
#task-detail-panel.hidden {
  display: none !important;
}

/* v6.11.12: tooltip + pointer */
.fm-item-action {
  position: relative;
  cursor: pointer;
}
.fm-item-action[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 28, 0.95);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10000;
  pointer-events: none;
}

/* v6.11.14: Kebab-Menu */
.fm-kebab {
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(4px);
  border-radius: 50% !important;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.fm-kebab:hover {
  background: rgba(20, 22, 28, 0.9) !important;
}
.fm-item-actions {
  gap: 4px;
}
.fm-kebab-menu {
  min-width: 200px;
  background: rgba(20, 22, 28, 0.98);
  color: #f0f2f5;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}
.fm-kebab-item {
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.fm-kebab-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.fm-kebab-item.destructive {
  color: #fca5a5;
}
.fm-kebab-item.destructive:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}
.fm-kebab-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}
/* v6.11.14: hover-tooltip hack not needed anymore */
.fm-item-action[title]:hover::after {
  content: none !important;
}

/* v6.11.15: transcript modal */
.fm-transcript-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-tm-card {
  width: min(680px, 94vw);
  max-height: 86vh;
  background: #16181d;
  color: #f0f2f5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.fm-tm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.fm-tm-head strong {
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
}
.fm-tm-head button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
#fm-tm-body {
  overflow-y: auto;
  padding: 4px 2px 8px;
  font-size: 15px;
  line-height: 1.55;
}
.fm-tm-plain {
  white-space: pre-wrap;
}
.fm-tm-block {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.fm-tm-block:last-child {
  border-bottom: none;
}
.fm-tm-speaker {
  font-weight: 700;
  font-size: 13px;
  padding-top: 1px;
}
.fm-tm-text {
  white-space: pre-wrap;
}
@media (max-width: 540px) {
  .fm-tm-block {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .fm-tm-speaker {
    font-size: 12px;
    opacity: 0.9;
  }
}

/* v6.11.16: analyzing overlay */
.fm-item {
  position: relative;
}
.fm-analyzing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 22, 0.78);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: inherit;
  color: #f0f2f5;
  z-index: 5;
  pointer-events: none;
}
.fm-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: fm-spin 0.9s linear infinite;
}
.fm-analyzing-label {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  max-width: 90%;
  text-align: center;
}
@keyframes fm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* v6.11.18: tags & filter */
.fm-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.fm-tag-chip-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.15px;
  white-space: nowrap;
}
.fm-tag-chip-sm::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.9;
}
.fm-tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 2px 0;
  margin: 8px 0 12px;
}
.fm-tag-filter-chip {
  padding: 6px 14px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text-sec, var(--text));
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fm-tag-filter-chip:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text);
}
.fm-tag-filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
  font-weight: 600;
}

/* Tag editor modal */
.fm-tag-editor {
  position: fixed;
  inset: 0;
  z-index: 20100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-te-card {
  width: min(440px, 94vw);
  background: #16181d;
  color: #f0f2f5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.fm-te-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.fm-te-head strong {
  font-size: 15px;
}
.fm-te-head button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.fm-te-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-te-current,
.fm-te-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
.fm-te-suggest-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.fm-te-empty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding: 2px 4px;
}
.fm-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  letter-spacing: 0.15px;
}
.fm-tag-chip-on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 600;
}
.fm-tag-chip-on:hover {
  filter: brightness(1.08);
}
.fm-tag-chip-on button {
  background: rgba(255, 255, 255, 0.22);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
}
.fm-tag-chip-on button:hover {
  background: rgba(255, 255, 255, 0.35);
}
.fm-tag-chip-off {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
}
.fm-tag-chip-off:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}
.fm-te-new {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.fm-te-new input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f0f2f5;
  font-size: 14px;
}

/* v6.11.20: shared modal system — einheitliches Erscheinungsbild fuer alle Overlays */
.pb-modal {
  position: fixed;
  inset: 0;
  z-index: 20050;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pb-modal.hidden {
  display: none;
}
.pb-modal-card {
  width: min(560px, 94vw);
  max-height: 86vh;
  background: #16181d;
  color: #f0f2f5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.pb-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pb-modal-head strong {
  font-size: 15px;
  font-weight: 600;
}
.pb-modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.pb-modal-body {
  overflow-y: auto;
  padding: 2px 0;
  font-size: 14px;
  line-height: 1.55;
}
.pb-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Unified chips */
.pb-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pb-chip-on {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
  cursor: pointer;
}
.pb-chip-off {
  background: rgba(255, 255, 255, 0.06);
  color: #f0f2f5;
  border-color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
}
.pb-chip-off:hover {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.5);
}
.pb-chip-info {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
}

/* Migrations: bestehende Modal-Klassen erben vom Shared-System.
   v7.8.5: .schedule-overlay/.schedule-modal raus — DOM existiert nicht mehr. */
.fm-transcript-modal,
.fm-tag-editor {
  position: fixed;
  inset: 0;
  z-index: 20050;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-tm-card,
.fm-te-card {
  background: #16181d;
  color: #f0f2f5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

/* v6.11.39: file-preview-bar INSIDE #chat-input-bar als first flex-row */
#chat-input-bar.has-attachment {
  flex-wrap: wrap;
}
/* v6.12.12: Attachment-Chip — HARDER Kontrast, definitiv sichtbar */
.file-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: -12px -16px 10px;
  flex-basis: 100%;
  background: rgba(59, 130, 246, 0.12);
  border: none;
  border-left: 3px solid #3b82f6;
  border-bottom: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
}
[data-mode="dark"] .file-preview-bar,
.dark .file-preview-bar {
  background: rgba(59, 130, 246, 0.18);
  border-left-color: #60a5fa;
  border-bottom-color: rgba(59, 130, 246, 0.5);
}
.file-preview-thumb,
.file-preview-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}
.file-preview-icon {
  background: #3b82f6 !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}
.file-preview-info {
  flex: 1;
  min-width: 0;
}
.file-preview-name {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
[data-mode="dark"] .file-preview-name,
.dark .file-preview-name {
  color: #f1f5f9 !important;
}
.file-preview-filename {
  font-size: 10.5px;
  color: #64748b !important;
  font-family: ui-monospace, monospace;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-mode="dark"] .file-preview-filename,
.dark .file-preview-filename {
  color: #94a3b8 !important;
}
.file-preview-sub {
  font-size: 12px;
  color: #475569 !important;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}
[data-mode="dark"] .file-preview-sub,
.dark .file-preview-sub {
  color: #cbd5e1 !important;
}
.file-preview-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--red, #c4684a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition:
    background 0.15s,
    transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.file-preview-close:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}
.file-preview-close:active {
  transform: scale(0.95);
}

/* v6.11.27: pick-preview modal */
.fm-pick-preview-card {
  width: min(640px, 94vw);
  max-height: 88vh;
}
.fm-pp-meta {
  font-size: 11.5px;
  color: var(--text-ter, rgba(255, 255, 255, 0.55));
  word-break: break-all;
  margin-bottom: 10px;
}
.fm-pp-image,
.fm-pp-video {
  width: 100%;
  max-height: 320px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}
.fm-pp-audio {
  width: 100%;
  margin: 8px 0;
}
.fm-pp-pdf {
  width: 100%;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.fm-pp-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 6px;
}
.fm-pp-transcript-box {
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.55;
}
.fm-pp-block {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.fm-pp-block:last-child {
  border-bottom: none;
}
.fm-pp-speaker {
  font-weight: 700;
  font-size: 12.5px;
}
.fm-pp-text {
  white-space: pre-wrap;
}
.fm-pp-footer {
  gap: 10px;
}
.fm-pp-attach {
  background: #3b82f6 !important;
  color: #fff !important;
  border-color: #2563eb !important;
  font-weight: 600;
}
.fm-pp-attach:hover {
  background: #2563eb !important;
}
@media (max-width: 540px) {
  .fm-pp-block {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .fm-pp-speaker {
    font-size: 12px;
    opacity: 0.95;
  }
}

/* v6.11.29: preview modal head actions */
.fm-pp-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fm-pp-kebab {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.fm-pp-kebab:hover {
  background: rgba(148, 163, 184, 0.3);
}
.fm-pp-error {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
  margin: 8px 0;
}
.fm-pp-error a {
  color: #fecaca;
  text-decoration: underline;
}

/* v6.11.30: send-button auf File-Tile */
.fm-item-action.fm-send {
  background: #3b82f6 !important;
  color: #fff !important;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  transition:
    background 0.15s,
    transform 0.1s;
}
.fm-item-action.fm-send:hover {
  background: #2563eb !important;
  transform: scale(1.05);
}
.fm-item-action.fm-send:active {
  transform: scale(0.95);
}
/* ══════════════════════════════════════════════════════════════
   Verbindungen & Module — Redesign v6.11.57
   ══════════════════════════════════════════════════════════════ */

.cp-tabs {
  display: flex;
  gap: 0;
  background: transparent;
  padding: 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}
.cp-tabs::-webkit-scrollbar {
  display: none;
}

.cp-tab {
  flex: 1;
  min-width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: var(--text-ter);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
  white-space: nowrap;
  border-radius: 0;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.cp-tab:hover {
  color: var(--text-sec);
}
.cp-tab.active {
  color: var(--accent);
  font-weight: 600;
}
.cp-tab svg {
  flex-shrink: 0;
  opacity: 0.85;
}
.cp-tab.active svg {
  opacity: 1;
}

.cp-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1.5px 1.5px 0 0;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 0 6px var(--accent-glow);
}
.cp-tab-panel {
  display: none;
  animation: cp-fade-in 0.25s ease;
}
.cp-tab-panel.active {
  display: block;
}

@keyframes cp-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cp-tab-panel > .settings-section > .settings-section-title:first-child {
  display: none;
}
.cp-tab-panel > .settings-section {
  padding: 0;
  border: none;
  background: transparent;
}

.cp-search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.cp-search-icon {
  left: 12px !important;
}
.cp-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-ter);
  pointer-events: none;
}
.cp-search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.cp-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cp-search-input::placeholder {
  color: var(--text-ter);
}

.cp-tab-panel #connectors-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-tab-panel .connector {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cp-tab-panel .connector:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.cp-tab-panel .connector.dimmed {
  opacity: 0.55;
}
.cp-tab-panel .connector.dimmed:hover {
  opacity: 0.85;
}

.cp-tab-panel .connector-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cp-tab-panel .connector-info {
  flex: 1;
  min-width: 0;
}
.cp-tab-panel .connector-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 1px;
}
.cp-tab-panel .connector-desc {
  font-size: 12px;
  color: var(--text-ter);
  line-height: 1.3;
}
.cp-tab-panel .connector-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-ter);
  margin-right: 4px;
}
.cp-tab-panel .connector-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-ter);
  flex-shrink: 0;
}
.cp-tab-panel .connector-status .status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.cp-tab-panel .connector-status .status-dot.disconnected {
  background: var(--red);
}
/* v7.8.102: connected status-text kräftiger im Connectoren-Panel */
.cp-tab-panel .connector-status .status-text.connected {
  color: #10b981;
  font-weight: 600;
}
.cp-tab-panel .connector-status .status-text.disconnected {
  color: var(--text-sec);
}
/* Listen-Container für System & Admin-Tools (ohne Sortierung wie #connectors-list) */
.cp-tab-panel .connectors-system-list,
.cp-tab-panel .connectors-admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-tab-panel .connector-btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid #10b981;
  background: #10b981;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.cp-tab-panel .connector-btn:hover {
  background: #059669;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.cp-tab-panel .connector-btn-disconnect {
  background: transparent;
  color: #dc2626;
  border-color: #dc2626;
  box-shadow: none;
}
.cp-tab-panel .connector-btn-disconnect:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.cp-tab-panel .ext-wizard {
  margin-top: 6px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cp-tab-panel .wizard-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cp-tab-panel .wizard-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.cp-tab-panel .wizard-step-body {
  flex: 1;
}
.cp-tab-panel .wizard-step-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.cp-tab-panel .wizard-step-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.cp-tab-panel .wizard-step-hint {
  font-size: 11px;
  color: var(--text-ter);
  line-height: 1.4;
}
.cp-tab-panel .ext-code-display {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
  padding: 12px;
  background: var(--bg);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent);
  margin: 8px 0;
}

.cp-tab-panel[data-cp-panel="notifications"] #notify-profile-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.cp-tab-panel[data-cp-panel="notifications"] .theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.cp-tab-panel[data-cp-panel="notifications"] .theme-swatch:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}
.cp-tab-panel[data-cp-panel="notifications"] .theme-swatch.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cp-tab-panel[data-cp-panel="notifications"] .swatch-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.cp-tab-panel[data-cp-panel="notifications"] .swatch-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

#push-permission-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
#push-permission-btn.connected {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.cp-tab-panel[data-cp-panel="modules"] .mod-category {
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .cp-tab span {
    display: none;
  }
  .cp-tab {
    padding: 14px;
  }
  .cp-tab-panel .connector {
    flex-wrap: wrap;
  }
  .cp-tab-panel .connector-btn {
    margin-left: auto;
  }
}

/* ══════════════════════════════════════════════════════════════
   Identity Panel (Dein Assistent) — v6.12.0 Launch Phase B
   ══════════════════════════════════════════════════════════════ */

.identity-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.identity-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.identity-preset:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.identity-preset.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.ip-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 26px;
}
.ip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.ip-avatar .ip-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.ip-avatar img + .ip-fallback {
  display: none;
}

.ip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ip-desc {
  font-size: 10.5px;
  color: var(--text-ter);
  text-align: center;
  line-height: 1.2;
}

/* Avatar current preview */
.avatar-current {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 12px;
}
.avatar-current-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
  border: 2px solid var(--accent-soft);
}
.avatar-current-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-current-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Icon button rounded (reusable) */
.icon-btn-round {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-ter);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn-round:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

/* Save bar at bottom — v7.8.73: KEIN sticky mehr.
   Vorher: position:sticky → semi-transparent Hintergrund liess Content
   durchschimmern. Jetzt: regulaeres Schluss-Element des Scroll-Bereichs.
   Der Save-Button scrollt mit ans Ende, klare Trennung statt Overlay. */
.identity-save-bar {
  position: static;
  margin: 24px -12px -12px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
/* v7.8.113: Auto-Save-Status mittig + größer + Icon-Badge bei OK. */
.identity-save-bar-status {
  align-items: center;
  min-height: 44px;
}
.ident-save-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-ter);
  transition: all 0.25s ease;
  letter-spacing: 0.1px;
  padding: 8px 16px;
  border-radius: 12px;
  min-height: 22px;
}
.ident-save-status:empty {
  display: none;
}
.ident-save-status[data-mode="pending"] {
  color: var(--text-sec, var(--text-ter));
  background: rgba(127, 127, 127, 0.08);
}
.ident-save-status[data-mode="ok"] {
  color: #ffffff;
  background: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}
.ident-save-status[data-mode="ok"]::before {
  content: "";
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}
.ident-save-status[data-mode="error"] {
  color: #ffffff;
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
}
.connector-btn-primary {
  background: var(--accent) !important;
  color: var(--bg) !important;
  border-color: var(--accent) !important;
  padding: 10px 24px !important;
  font-weight: 600 !important;
}
.connector-btn-primary:hover {
  filter: brightness(1.1);
}

/* Mobile: kompaktere Presets */
@media (max-width: 600px) {
  .identity-presets {
    grid-template-columns: repeat(2, 1fr);
  }
  .avatar-current {
    flex-direction: column;
    text-align: center;
  }
  .avatar-current-actions {
    width: 100%;
  }
}

/* ════════════════════════════════════════════════════════
   Identity Panel (Avatar-Redesign) — v6.12.3
   ════════════════════════════════════════════════════════ */

.avatar-group {
  margin-bottom: 16px;
}
.avatar-group:last-child {
  margin-bottom: 0;
}
.avatar-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-ter);
  margin-bottom: 10px;
  padding-left: 2px;
}

.avatar-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
}

.avatar-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.avatar-tile:hover {
  border-color: var(--accent-soft);
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
/* v7.8.91: Active-State drastisch verstärkt — vorher war Auswahl kaum
   sichtbar (Border-Color allein reicht bei dunklem UI nicht). Jetzt:
   4px Accent-Border, 4px Glow-Ring, Scale 1.08, Tint-Hintergrund,
   stärkerer Drop-Shadow + größerer SVG-Check-Badge. */
.avatar-tile.active {
  border-color: var(--accent);
  border-width: 4px;
  box-shadow:
    0 0 0 4px var(--accent-glow),
    0 6px 18px rgba(0, 0, 0, 0.3);
  transform: scale(1.08);
  background: var(--accent-glow);
  z-index: 1;
}
.avatar-tile.active::after {
  content: "";
  position: absolute;
  inset: auto 3px 3px auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/></svg>");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.avatar-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.avatar-tile-zoom {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.avatar-tile:hover .avatar-tile-zoom,
.avatar-tile:focus-within .avatar-tile-zoom,
.avatar-tile-zoom:focus-visible {
  opacity: 1;
  transform: scale(1);
}
/* Mobile: Zoom-Icon immer sichtbar (kein Hover) */
@media (hover: none) {
  .avatar-tile-zoom {
    opacity: 1;
    transform: scale(1);
  }
}
.avatar-tile-zoom:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Upload Row */
.avatar-upload-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.avatar-upload-row .connector-btn {
  padding: 8px 18px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text-sec) !important;
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
}
.avatar-upload-row .connector-btn:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ═══ Zoom Lightbox ═══ */
.avatar-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: zoom-out;
}
.avatar-zoom-overlay.open {
  opacity: 1;
}

.avatar-zoom-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  cursor: default;
}

.avatar-zoom-close {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.15s;
  font-family: inherit;
}
.avatar-zoom-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

/* v7.8.94: Avatar-Zoom Browse-Mode — Pfeile, Counter, Wählen-Button. */
.avatar-zoom-prev,
.avatar-zoom-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition:
    background 0.15s,
    transform 0.15s;
  padding: 0;
  z-index: 2;
}
.avatar-zoom-prev {
  left: 16px;
}
.avatar-zoom-next {
  right: 16px;
}
.avatar-zoom-prev:hover,
.avatar-zoom-next:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-50%) scale(1.05);
}
.avatar-zoom-prev:active,
.avatar-zoom-next:active {
  transform: translateY(-50%) scale(0.96);
}

.avatar-zoom-nav {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.avatar-zoom-counter {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 12px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.avatar-zoom-select-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: white;
  color: #111;
  font-family: inherit;
  transition:
    transform 0.12s,
    background 0.15s,
    opacity 0.15s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.avatar-zoom-select-btn:hover:not(:disabled) {
  transform: scale(1.03);
}
.avatar-zoom-select-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.avatar-zoom-select-btn:disabled,
.avatar-zoom-select-btn.is-current {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.7);
  cursor: default;
  box-shadow: none;
}

@media (max-width: 600px) {
  .avatar-zoom-prev,
  .avatar-zoom-next {
    width: 42px;
    height: 42px;
  }
  .avatar-zoom-prev {
    left: 8px;
  }
  .avatar-zoom-next {
    right: 8px;
  }
  .avatar-zoom-select-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

/* Mobile: Tiles kleiner */
@media (max-width: 600px) {
  .avatar-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 5px;
  }
}

/* ════════════════════════════════════════
   Feature-Gating — v6.12.9
   ════════════════════════════════════════ */

.lab-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 100px;
  background: linear-gradient(135deg, #8e4dd4, #c15cc6);
  color: white;
  vertical-align: middle;
  margin-left: 6px;
  box-shadow: 0 1px 3px rgba(142, 77, 212, 0.35);
  text-transform: uppercase;
  font-family: ui-monospace, monospace;
  line-height: 1.2;
}
.mod-category .lab-badge {
  margin-left: 8px;
}

/* v6.12.12: Attached-Message-Bubble — Text + Audio + Icon in EINER Einheit */
.msg.user.attached-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px !important;
  background: var(--accent-soft, rgba(59, 130, 246, 0.1)) !important;
  border-left: 3px solid var(--accent, #3b82f6);
  border-radius: 12px;
  max-width: 420px;
}
.msg.user.attached-msg .attached-caption {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.msg.user.attached-msg .attached-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95) !important;
}
.msg.user.attached-msg .attached-filename {
  color: rgba(255, 255, 255, 0.95) !important;
}
[data-mode="dark"] .msg.user.attached-msg .attached-file-row,
.dark .msg.user.attached-msg .attached-file-row {
  background: rgba(255, 255, 255, 0.08);
}
.msg.user.attached-msg .attached-file-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.msg.user.attached-msg .attached-filename {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* v6.12.16: ap-play prominenter (einziger Play-Button) */
.ap-play {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: var(--accent) !important;
  color: white !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.15s ease;
}
.ap-play:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}
.ap-play:active {
  transform: scale(0.95);
}
.ap-play svg {
  width: 16px !important;
  height: 16px !important;
}

/* v6.12.20: Thinking Indicator — zeigt dass Bärli arbeitet */
.thinking-indicator {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 14px !important;
  background: var(--surface-2, rgba(0, 0, 0, 0.04)) !important;
  border-radius: 12px;
  color: var(--text-sec) !important;
  font-size: 13px;
  font-style: italic;
  opacity: 0.85;
  max-width: 240px;
}
.think-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.think-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #b89940);
  animation: think-pulse 1.2s ease-in-out infinite;
}
.think-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.think-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes think-pulse {
  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* v6.12.21: Conn-Quality-Zeile stabile Breite gegen Layout-Shift */
#conn-quality-hero .conn-label {
  font-variant-numeric: tabular-nums;
  min-width: 6ch;
  display: inline-block;
  text-align: right;
}

/* v6.12.21: Multi-Upload additional chips */
.file-preview-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 4px 0 0 0;
  flex-basis: 100%;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-sec);
}
[data-mode="dark"] .file-preview-extra,
.dark .file-preview-extra {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  border-left-color: var(--accent);
  color: var(--text-sec);
}
.fpx-icon {
  flex-shrink: 0;
  opacity: 0.6;
}
.fpx-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.fpx-close {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-sec);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0.7;
  flex-shrink: 0;
  line-height: 1;
}
.fpx-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.12);
}

/* v6.12.22: Klickbarer Thinking-Indicator — Hover + Chevron */
.thinking-indicator {
  cursor: pointer !important;
  transition:
    background 0.15s,
    transform 0.1s !important;
}
.thinking-indicator:hover {
  background: var(--accent-soft, rgba(184, 153, 64, 0.18)) !important;
  opacity: 1 !important;
}
.thinking-indicator:active {
  transform: scale(0.99) !important;
}
.think-hint {
  margin-left: auto;
  font-size: 18px;
  color: var(--text-ter);
  opacity: 0.55;
  padding-left: 6px;
}
.thinking-indicator:hover .think-hint {
  opacity: 1;
  color: var(--accent);
}

/* Additional file chip — sublime wenn extra */
.file-preview-bar:not(:only-of-type) .file-preview-sub {
  display: none;
}

/* v6.12.23: "Ich höre/spreche" kompakter, dezente Icons via ::before */
#call-status.cs-listening,
#call-status.cs-speaking {
  font-size: 15px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}
#call-status.cs-listening::before,
#call-status.cs-speaking::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
  animation: cs-pulse 1.2s ease-in-out infinite;
}
#call-status.cs-speaking::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
@keyframes cs-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.75);
  }
}

/* ─── #15: Avatar-Rand edler, mehr Luft ─── */
#bot-avatar {
  border: 3px solid transparent !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
/* Ring als äußerer box-shadow mit mehr Abstand */
#bot-avatar.speaking {
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 6px var(--accent),
    0 0 40px rgba(184, 153, 64, 0.25) !important;
}
#bot-avatar.listening {
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 6px #4ade80,
    0 0 32px rgba(74, 222, 128, 0.28) !important;
}

/* v6.12.26: Model-Info-Box und Mode-Legend */
.model-info-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-soft, rgba(184, 153, 64, 0.12));
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-sec);
}
.model-mode-legend {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface-2, rgba(0, 0, 0, 0.03));
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.45;
}
.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-sec);
}
.legend-item strong {
  color: var(--text);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}
.legend-dot.legend-cli {
  background: #b85540;
}
.legend-dot.legend-llm {
  background: var(--accent, #b89940);
}
.legend-dot.legend-voice {
  background: #5da048;
}

/* v7.8.2: Projekt-Typ Badges (in der neuen ps-meta-Zeile, ohne margin-left) */
.ps-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 100px;
  line-height: 1.5;
  flex-shrink: 0;
}
.ps-type-knowledge {
  background: rgba(107, 143, 184, 0.15);
  color: #4a6b96;
}
.ps-type-code {
  background: rgba(184, 153, 64, 0.18);
  color: #8a6e20;
}
[data-mode="dark"] .ps-type-knowledge {
  color: #93b5db;
}
[data-mode="dark"] .ps-type-code {
  color: #d4b96a;
}

.project-bar-type-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--accent);
  opacity: 0.85;
  cursor: help;
}
.project-bar-type-badge svg {
  display: block;
}

/* v6.12.29: Vollbild-UI-Polish — stabilere Layouts */

/* Timer klein + inline mit conn-quality */
#call-duration {
  display: inline-block !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-sec) !important;
  letter-spacing: 1.5px !important;
  font-variant-numeric: tabular-nums;
  margin-left: 10px;
  min-width: 5ch;
  opacity: 0.75;
}
#conn-quality-hero {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
#conn-quality-hero .conn-label {
  font-variant-numeric: tabular-nums;
  min-width: 5ch;
  font-size: 12px;
  color: var(--text-sec);
}

/* Chat öffnen Button — Icon sauberer */
.open-chat-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 18px !important;
  border-radius: 24px !important;
  background: var(--surface-2) !important;
  color: var(--text-sec) !important;
  border: 1px solid var(--border) !important;
  font-size: 13px !important;
  cursor: pointer;
  transition: all 0.15s;
}
.open-chat-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ════════════════════════════════════════════════════════════════════
   v6.13 Hero Redesign — "warm & organisch, ruhig & groß"
   Scope: Voice-Hauptseite (Hero-View) — Avatar, Name, Status, Viz,
   Call-Button, Bot-Selector. Visualiser-Canvas unberührt.
   Rollback: Block löschen.
   ════════════════════════════════════════════════════════════════════ */

/* Bot-Farben — Halo-Tints pro Charakter. Default = Neutral-Accent. */
:root {
  --bot-color: var(--accent);
}
[data-bot="baerli"] {
  --bot-color: #d4a782;
}
[data-bot="theo"] {
  --bot-color: #ed8668;
}
[data-bot="waldi"] {
  --bot-color: #a8cb99;
}
[data-bot="lumina"] {
  --bot-color: #f0d585;
}
[data-mode="light"][data-bot="baerli"] {
  --bot-color: #c4926e;
}
[data-mode="light"][data-bot="theo"] {
  --bot-color: #e16a4d;
}
[data-mode="light"][data-bot="waldi"] {
  --bot-color: #8fb580;
}
[data-mode="light"][data-bot="lumina"] {
  --bot-color: #e8c66b;
}

/* Weicher Hintergrund-Wash in Bot-Farbe */
#voice-center {
  background: radial-gradient(
    ellipse 70% 50% at 50% 30%,
    color-mix(in oklab, var(--bot-color) 14%, transparent) 0%,
    transparent 60%
  ) !important;
  transition: background 0.6s ease;
}

/* ════════════════════════════════════════════════════════════════════
   v6.13 Schritt 2 — Bot-Akzent auf konversationsnahe Oberflächen
   Chat-Header, Voice-Banner, Input-Bar. Kein Hero-Relevant.
   ════════════════════════════════════════════════════════════════════ */

/* Voice-Banner Avatar: Ring in Bot-Farbe */
.banner-avatar {
  border-color: var(--bot-color) !important;
  transition:
    border-color 0.3s ease,
    box-shadow 0.2s ease !important;
}
.banner-avatar.speaking {
  border-color: var(--bot-color) !important;
  box-shadow: 0 0 16px color-mix(in oklab, var(--bot-color) 45%, transparent) !important;
}

/* Banner-Call-Button in Bot-Farbe (statt hardcoded grün) */
.banner-call {
  background: var(--bot-color) !important;
  border-color: var(--bot-color) !important;
  box-shadow: 0 2px 10px color-mix(in oklab, var(--bot-color) 40%, transparent) !important;
}
.banner-call:hover {
  background: color-mix(in oklab, var(--bot-color) 80%, #000) !important;
}

/* Chat-Header: aktiver Bot-Selector-Chip in Bot-Farbe */
.chat-bot-btn.active {
  border-color: var(--bot-color) !important;
  background: color-mix(in oklab, var(--bot-color) 14%, transparent) !important;
}

/* Input-Bar Send+Upload → siehe .pw-btn--primary / .pw-btn--ghost (M1-A) */

/* Text-Input Focus: Border in Bot-Farbe */
#chat-text-input:focus {
  border-color: var(--bot-color) !important;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--bot-color) 18%, transparent) !important;
}

/* Chat-Transcript Drag-Over: Outline in Bot-Farbe */
#chat-transcript.drag-over {
  background: color-mix(in oklab, var(--bot-color) 8%, transparent) !important;
  outline-color: var(--bot-color) !important;
}

/* ════════════════════════════════════════════════════════════════════
   v6.13 Schritt 3 — Design-System-Layer
   Tokens (Spacing/Radius/Shadow/Typo/Transition) + .pw-* Component-Base.
   Ziel: Eine Sprache, auf die bestehende Views migrieren können.
   Diese Schicht ueberschreibt NICHTS — nur neue Klassen, neue Vars.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Spacing-Skala — 4px Basis */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius-Skala */
  --radius-xs: 6px;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Elevation-Skala (Dark als Default) */
  --elev-1: 0 1px 3px rgba(0, 0, 0, 0.2);
  --elev-2: 0 4px 12px rgba(0, 0, 0, 0.3);
  --elev-3: 0 8px 32px rgba(0, 0, 0, 0.4);
  --elev-4: 0 16px 48px rgba(0, 0, 0, 0.5);

  /* Typo-Skala */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.12s;
  --dur-med: 0.25s;
  --dur-slow: 0.4s;
}
[data-mode="light"] {
  --elev-1: 0 1px 3px rgba(0, 0, 0, 0.06);
  --elev-2: 0 4px 12px rgba(0, 0, 0, 0.08);
  --elev-3: 0 8px 28px rgba(0, 0, 0, 0.12);
  --elev-4: 0 16px 48px rgba(0, 0, 0, 0.18);
}

/* ── Component Layer (.pw-*) — unabhaengig, opt-in ──────────────── */

/* Panel: universeller Container fuer Modals/Dropdowns/Sidebars */
.pw-panel {
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--elev-3);
  border: 1px solid var(--border);
  padding: var(--space-5);
  color: var(--text);
}
.pw-panel--floating {
  box-shadow: var(--elev-4);
}
.pw-panel--inline {
  box-shadow: var(--elev-1);
  padding: var(--space-4);
}

/* Card: kleinerer Container fuer Listen-Items */
.pw-card {
  background: var(--surface-2);
  border-radius: var(--radius-m);
  padding: var(--space-3) var(--space-4);
  transition: background var(--dur-fast) var(--ease-out);
}
.pw-card:hover {
  background: color-mix(in oklab, var(--surface-2) 70%, var(--border));
}

/* Button — Base + Varianten */
.pw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  font-size: var(--text-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  background: transparent;
  color: var(--text);
  line-height: 1;
}
.pw-btn:hover {
  transform: translateY(-1px);
}
.pw-btn:active {
  transform: translateY(0);
  opacity: 0.85;
}
.pw-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.pw-btn--primary {
  background: var(--bot-color);
  color: #fff;
  box-shadow: var(--elev-2);
}
.pw-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: currentColor;
  opacity: 0.75;
}
.pw-btn--ghost:hover {
  background: color-mix(in oklab, currentColor 12%, transparent);
  border-color: transparent;
  opacity: 1;
}
.pw-btn--danger {
  background: var(--red);
  color: #fff;
}
.pw-btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.pw-btn--icon svg {
  width: 20px;
  height: 20px;
}
.pw-btn--icon.pw-btn--sm {
  width: 36px;
  height: 36px;
}
.pw-btn--icon.pw-btn--sm svg {
  width: 16px;
  height: 16px;
}

/* Input — Base */
.pw-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--text-md);
  outline: none;
  transition:
    border-color var(--dur-fast),
    box-shadow var(--dur-fast);
}
.pw-input::placeholder {
  color: var(--text-ter);
}
.pw-input:focus {
  border-color: var(--bot-color);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--bot-color) 18%, transparent);
}

/* Row — Label + Value Pattern (fuer Settings, Details) */
.pw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-md);
}
.pw-row:last-child {
  border-bottom: none;
}
.pw-row__label {
  color: var(--text-sec);
}
.pw-row__value {
  color: var(--text);
}

/* Divider */
.pw-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
  border: none;
}

/* Badge */
.pw-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-s);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.6;
  background: color-mix(in oklab, var(--bot-color) 18%, transparent);
  color: var(--text);
}
.pw-badge--muted {
  background: var(--surface-2);
  color: var(--text-ter);
}

/* Modal — Overlay + Panel-Combo */
.pw-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  animation: pw-fade-in var(--dur-med) var(--ease-out);
}
[data-mode="light"] .pw-modal {
  background: rgba(0, 0, 0, 0.25);
}
.pw-modal__dialog {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--elev-4);
  animation: pw-scale-in var(--dur-med) var(--ease-out);
}
.pw-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-lg);
  font-weight: 600;
}
.pw-modal__body {
  padding: var(--space-5);
}
.pw-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}

@keyframes pw-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes pw-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ════════════════════════════════════════════════════════════════════
   v6.14.0 — Voice-Mode aufgeräumt, Input-Bar nur im Chat-Mode
   Struktur-Fix auf Martins Vorgabe: luftige Voice-Präsenz, zentraler Call-Button,
   sichtbarer Chat-Wechsel, keine Chat-Chrome im Voice-Mode.
   ════════════════════════════════════════════════════════════════════ */

/* Top-Bar Icons sichtbar auf projekt-farbigem Hintergrund */
#top-bar .pw-btn--ghost {
  color: #fff !important;
  opacity: 0.85 !important;
}
#top-bar .pw-btn--ghost:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.14) !important;
}

/* Kein blauer Browser-Fokusring, dafür custom Ring in Bot-Farbe */
.bot-choice:focus,
.pw-btn:focus,
button:focus {
  outline: none;
}
.bot-choice:focus-visible,
.pw-btn:focus-visible {
  outline: 2px solid var(--bot-color);
  outline-offset: 3px;
}

/* Input-Bar NUR im Chat-Mode sichtbar — im Voice-Mode verschwunden */
#chat-input-bar {
  display: none !important;
}
#chat-view.active ~ #chat-input-bar {
  display: flex !important;
}

/* ════════════════════════════════════════════════════════════════════
   v6.16.0 — Hero Clean
   Single source of truth für den Hero-Screen.
   Ersetzt alle v6.15.x Patch-Overrides durch einen konsolidierten Block.
   Baut auf der v6.13-Basis auf (Halo, Bot-Color-Vars, pw-Tokens).
   ════════════════════════════════════════════════════════════════════ */

/* ── Layout: vertikal + horizontal zentriert ───────────────── */
/* display intentionally NOT set — .view { display: none } / .view.active { display: flex }
   handhabt die Sichtbarkeit. Nur wenn .active, greifen die layout-Properties hier. */
#hero-view {
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#hero-view:not(.active) {
  display: none !important;
}
#hero-view #voice-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#hero-view #voice-center {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 24px 20px;
  gap: 16px;
}
#hero-view #bot-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
  gap: 8px;
  text-align: center;
}

/* ── Bot-Selector (PNG-Thumbnails statt Emojis) ───────────── */
#hero-view #bot-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 0;
  position: relative;
  z-index: 2;
}
#hero-view .bot-choice {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  padding: 0;
  overflow: hidden;
  opacity: 0.5;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition:
    opacity 0.2s,
    border-color 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
}
#hero-view .bot-choice > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}
#hero-view .bot-choice:hover {
  opacity: 0.85;
}
#hero-view .bot-choice.active {
  opacity: 1;
  border-color: var(--bot-color);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--bot-color) 22%, transparent);
  transform: scale(1.04);
}
#hero-view .bot-choice:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ── Avatar + Halo ───────────────────────────────────────── */
#hero-view #bot-section::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54px;
  width: 200px;
  height: 200px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--bot-color) 0%, transparent 65%);
  opacity: 0.25;
  filter: blur(6px);
  z-index: 0;
  pointer-events: none;
  animation: hero-breathe 4s ease-in-out infinite;
}
[data-mode="light"] #hero-view #bot-section::before {
  opacity: 0.16;
}
@keyframes hero-breathe {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.25;
  }
  50% {
    transform: translateX(-50%) scale(1.05);
    opacity: 0.32;
  }
}
#hero-view #bot-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  padding: 0;
  position: relative;
  z-index: 1;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 0 0 3px var(--bot-color);
  transition: box-shadow 0.3s;
}
[data-mode="light"] #hero-view #bot-avatar {
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.1),
    0 0 0 3px var(--bot-color);
}
#hero-view #bot-avatar.speaking {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 0 0 3px var(--bot-color),
    0 0 36px color-mix(in oklab, var(--bot-color) 50%, transparent);
}
#hero-view #bot-avatar.listening {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 0 0 3px var(--bot-color),
    0 0 30px color-mix(in oklab, var(--bot-color) 40%, transparent);
}

/* ── Name ────────────────────────────────────────────────── */
#hero-view #bot-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 4px 0 0;
  position: relative;
  z-index: 1;
}

/* ── Status-Zeile: zwei Zeilen, zentriert ──────────────── */
#hero-view .call-status-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 6px;
  min-height: 44px;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
#hero-view .status-primary,
#hero-view .status-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
#hero-view .status-primary {
  gap: 8px;
}
#hero-view .status-meta {
  gap: 16px;
  min-height: 22px;
  font-size: 12px;
  color: var(--text-ter);
}

/* Ready-Dot — state-reactive */
#hero-view .hs-ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  transition:
    background 0.2s,
    box-shadow 0.2s;
  flex-shrink: 0;
}
#hero-view .hs-ready-dot.cs-idle,
#hero-view .hs-ready-dot.cs-live {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}
#hero-view .hs-ready-dot.cs-listening {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
  animation: hero-pulse 1.2s ease-in-out infinite;
}
#hero-view .hs-ready-dot.cs-thinking {
  background: #6c63ff;
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.45);
  animation: hero-pulse 1.4s ease-in-out infinite;
}
#hero-view .hs-ready-dot.cs-speaking {
  background: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.45);
  animation: hero-pulse 1s ease-in-out infinite;
}
#hero-view .hs-ready-dot.cs-tool {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
  animation: hero-pulse 1.2s ease-in-out infinite;
}
#hero-view .hs-ready-dot.cs-error,
#hero-view .hs-ready-dot.cs-warning,
#hero-view .hs-ready-dot.cs-reconnecting {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
  animation: hero-pulse 0.8s ease-in-out infinite;
}
@keyframes hero-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Call-Status Text — farbig je State, kein Pill */
#hero-view #call-status {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  padding: 0;
  margin: 0;
  min-height: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
  color: var(--text-sec);
  letter-spacing: 0.1px;
  display: inline-flex;
  align-items: center;
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
#hero-view #call-status.cs-idle,
#hero-view #call-status.cs-live,
#hero-view #call-status.cs-listening {
  color: #22c55e;
}
#hero-view #call-status.cs-thinking {
  color: #6c63ff;
}
#hero-view #call-status.cs-speaking {
  color: #a855f7;
}
#hero-view #call-status.cs-tool,
#hero-view #call-status.cs-warning {
  color: #f59e0b;
}
#hero-view #call-status.cs-error,
#hero-view #call-status.cs-reconnecting {
  color: #ef4444;
}
/* Legacy v6.12.23 ::before-Dot am call-status im Hero unterdrücken (hs-ready-dot übernimmt) */
#hero-view #call-status::before {
  display: none;
  content: none;
}

/* Chips (Monitor/Ext) */
#hero-view .hs-chips-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
#hero-view .hs-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: none;
  background: transparent;
  color: var(--text-ter);
  opacity: 0.4;
  cursor: pointer;
  transition:
    opacity 0.15s,
    color 0.15s;
}
#hero-view .hs-chip:hover {
  opacity: 0.85;
}
#hero-view .hs-chip.is-connected {
  opacity: 1;
  color: #22c55e;
}
#hero-view .hs-chip svg {
  width: 14px;
  height: 14px;
}

/* Connection-Quality (Latenz-Bars) immer in Meta-Zeile */
#hero-view .status-meta #conn-quality-hero {
  display: inline-flex !important; /* overrides inline style display:none */
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 11px;
  color: var(--text-ter);
  opacity: 0.9;
}
#hero-view .status-meta #conn-quality-hero .conn-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
#hero-view .status-meta #conn-quality-hero .conn-bar {
  width: 2.5px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.3;
}
#hero-view .status-meta #conn-quality-hero .conn-bar:nth-child(1) {
  height: 30%;
}
#hero-view .status-meta #conn-quality-hero .conn-bar:nth-child(2) {
  height: 55%;
}
#hero-view .status-meta #conn-quality-hero .conn-bar:nth-child(3) {
  height: 75%;
}
#hero-view .status-meta #conn-quality-hero .conn-bar:nth-child(4) {
  height: 100%;
}
#hero-view .status-meta #conn-quality-hero .conn-bar.active {
  opacity: 1;
}
#hero-view .status-meta #conn-quality-hero.good {
  color: #22c55e;
}
#hero-view .status-meta #conn-quality-hero.ok {
  color: #f59e0b;
}
#hero-view .status-meta #conn-quality-hero.slow {
  color: #ef4444;
}
#hero-view .status-meta #conn-quality-hero .conn-label {
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  letter-spacing: 0.2px;
}

/* Timer-Pille — IMMER sichtbar, im Idle "00:00" als Placeholder (Martin's Wunsch:
   "damit man sieht was alles verfügbar ist, auch wenn offline") */
#hero-view .status-meta #call-duration {
  min-width: 56px;
  text-align: center;
  padding: 2px 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: var(--text-ter);
  background: color-mix(in oklab, var(--text-ter) 8%, transparent);
  border-radius: 10px;
  visibility: visible;
  opacity: 0.55;
  transition:
    opacity 0.2s,
    color 0.2s,
    background 0.2s;
}
#hero-view .status-meta #call-duration.active,
#hero-view .status-meta #call-duration.live {
  opacity: 1;
  color: var(--text-sec);
  background: color-mix(in oklab, var(--text-sec) 12%, transparent);
}
#hero-view .status-meta #call-duration.hidden {
  visibility: visible;
  opacity: 0.55;
  display: inline-flex;
}
#hero-view .status-meta #call-duration.warning {
  color: #f59e0b;
  background: color-mix(in oklab, #f59e0b 14%, transparent);
}
#hero-view .status-meta #call-duration.critical {
  color: #ef4444;
  background: color-mix(in oklab, #ef4444 16%, transparent);
  animation: hero-pulse 1s ease-in-out infinite;
}

/* ── Visualizer — immer sichtbar, Idle = passives Ornament ─ */
#hero-view #viz-canvas {
  display: block;
  height: 110px;
  width: min(360px, 86vw);
  margin: 6px auto 0;
  background-image:
    radial-gradient(
      circle at center,
      color-mix(in oklab, var(--bot-color) 28%, transparent) 0 4px,
      transparent 5px
    ),
    radial-gradient(
      circle at center,
      color-mix(in oklab, var(--bot-color) 28%, transparent) 0 4px,
      transparent 5px
    ),
    radial-gradient(
      circle at center,
      color-mix(in oklab, var(--bot-color) 28%, transparent) 0 4px,
      transparent 5px
    );
  background-repeat: no-repeat;
  background-size:
    8px 8px,
    8px 8px,
    8px 8px;
  background-position:
    calc(50% - 22px) 50%,
    50% 50%,
    calc(50% + 22px) 50%;
  animation: viz-idle 3.2s ease-in-out infinite;
}
body.in-call #hero-view #viz-canvas {
  background-image: none;
  animation: none;
}
@keyframes viz-idle {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
}

/* ── Call-Buttons — symmetrisch zentriert ──────────────── */
#hero-view #call-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 12px auto 0;
  padding: 0 16px;
  gap: 22px;
}
#hero-view .ctrl-button.hidden,
#hero-view .call-button.hidden {
  display: none;
}
#hero-view #call-buttons .ctrl-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
#hero-view #call-buttons .ctrl-button:hover {
  background: var(--surface);
}
#hero-view #call-buttons .ctrl-button:active {
  transform: scale(0.92);
}
#hero-view #call-buttons .ctrl-button.muted {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
#hero-view #call-buttons .call-button {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  border: none;
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
}
#hero-view #call-buttons .call-button svg {
  width: 28px;
  height: 28px;
}
#hero-view #call-buttons .call-button:hover {
  background: #059669;
  box-shadow: 0 6px 26px rgba(16, 185, 129, 0.45);
}
#hero-view #call-buttons .call-button:active {
  transform: scale(0.94);
}
#hero-view #call-buttons .call-button.active {
  background: #ef4444;
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.4);
}
#hero-view #call-buttons .call-button.active:hover {
  background: #dc2626;
}

/* ── Chat-Öffnen-Button ─────────────────────────────────── */
#hero-view .open-chat-btn,
#hero-view #open-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  max-width: 360px;
  margin: 12px auto;
  padding: 11px 18px;
  flex-shrink: 0;
  flex-grow: 0;
  background: var(--surface-2);
  color: var(--text-sec);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s,
    transform 0.1s;
}
#hero-view .open-chat-btn:hover,
#hero-view #open-chat-btn:hover {
  border-color: var(--bot-color);
  color: var(--text);
  background: var(--surface);
}
#hero-view .open-chat-btn:active,
#hero-view #open-chat-btn:active {
  transform: scale(0.98);
}
#hero-view .open-chat-btn svg,
#hero-view #open-chat-btn svg {
  opacity: 0.7;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-height: 680px) {
  #hero-view #voice-center {
    padding: 16px;
    gap: 12px;
  }
  #hero-view #bot-avatar {
    width: 100px;
    height: 100px;
  }
  #hero-view #bot-section::before {
    width: 170px;
    height: 170px;
    top: 44px;
  }
  #hero-view #bot-name {
    font-size: 22px;
  }
  #hero-view #viz-canvas {
    height: 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #hero-view #bot-section::before,
  #hero-view #viz-canvas,
  #hero-view .hs-ready-dot {
    animation: none;
  }
}

/* Chat-Banner: kein zusätzlicher ::before Dot (der originale bleibt) */
.banner-status::before {
  display: none;
  content: none;
}

/* ════════════════════════════════════════════════════════════════════
   v6.17.1 — Chat-Bot-Selector (im Voice-Banner, Wechsel ohne Hero-Rückkehr)
   Nutzt die gleiche .bot-choice-Styling wie der Hero, aber kompakter.
   ════════════════════════════════════════════════════════════════════ */
.chat-bot-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 6px;
  flex-shrink: 0;
}
.chat-bot-selector .bot-choice {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  padding: 0;
  overflow: hidden;
  opacity: 0.45;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition:
    opacity 0.2s,
    border-color 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
}
.chat-bot-selector .bot-choice > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}
.chat-bot-selector .bot-choice:hover {
  opacity: 0.85;
}
.chat-bot-selector .bot-choice.active {
  opacity: 1;
  border-color: var(--bot-color);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--bot-color) 22%, transparent);
  transform: scale(1.05);
}
.chat-bot-selector .bot-choice:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ════════════════════════════════════════════════════════════════════
   v6.18.0 — PawBot-Instanzen (Gmail-Account-Pattern)
   ════════════════════════════════════════════════════════════════════ */

/* Hero- und Chat-Bot-Selector weg — Avatar-Dropdown übernimmt */
#hero-view #bot-selector,
.chat-bot-selector {
  display: none !important;
}

/* Instanz-Switcher im Profil-Popover — v6.33.0: kompakter */
.pp-instances {
  display: flex;
  flex-direction: column;
  padding: 2px 0;
}
.pp-instance {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 4px;
  transition:
    background 0.12s,
    opacity 0.12s;
}
.pp-instance:hover {
  background: color-mix(in oklab, var(--text-sec) 8%, transparent);
}
.pp-instance.active {
  background: color-mix(in oklab, var(--bot-color) 12%, transparent);
}
.pp-instance-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--text-sec);
}
.pp-instance-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pp-instance-info {
  flex: 1;
  min-width: 0;
}
.pp-instance-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.15;
}
.pp-instance-server {
  font-size: 10.5px;
  color: var(--text-ter);
  line-height: 1.2;
}
.pp-instance-check {
  color: var(--bot-color);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  min-width: 14px;
  text-align: right;
}
.pp-instance-add .pp-instance-avatar {
  border: 1.5px dashed var(--border);
  background: transparent;
}
.pp-instance-add .pp-instance-name {
  color: var(--text-sec);
}

/* Settings-Panel "Instanzen verwalten" */
.inst-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.inst-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.inst-row .inst-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 20px;
  flex-shrink: 0;
}
.inst-row .inst-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inst-info {
  flex: 1;
  min-width: 0;
}
.inst-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.inst-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--bot-color) 18%, transparent);
  color: var(--bot-color);
  padding: 2px 6px;
  border-radius: 4px;
}
.inst-meta {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 2px;
}
.inst-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.inst-actions .connector-btn {
  padding: 6px 10px;
  font-size: 11px;
}

/* ════════════════════════════════════════════════════════════════════
   v6.19.0 — Verrechnung (Billing) UI
   ════════════════════════════════════════════════════════════════════ */
/* v7.8.35: Total-Card im Apple-Style — Hero-Wert prominent, sanfter
   Gradient, weicher Schatten. Gleiche Sprache wie die Tool-Cards. */
.bill-total,
.bill-total-card {
  text-align: center;
  padding: 28px 20px 22px;
  border-radius: 18px;
  background: linear-gradient(
    140deg,
    color-mix(in oklab, var(--bot-color) 18%, var(--surface)) 0%,
    color-mix(in oklab, var(--bot-color) 8%, var(--surface)) 100%
  );
  border: 1px solid color-mix(in oklab, var(--bot-color) 20%, var(--border));
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.06);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.bill-total-value {
  font-size: 44px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bill-total-label {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  opacity: 0.75;
}
.bill-total-wrap {
  margin-top: 4px;
}
/* Wrapper für die Detail-Rows unter der Hero-Card */
.bill-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}
.bill-row {
  padding: 12px 16px;
}
.bill-row.row-plus .bill-row-v {
  color: var(--text);
  font-weight: 600;
}
.bill-row.row-total {
  background: color-mix(in oklab, var(--bot-color) 6%, transparent);
  border-top: 1px solid color-mix(in oklab, var(--bot-color) 25%, var(--border));
  font-weight: 600;
}
.bill-row.row-total .bill-row-v {
  font-size: 16px;
  color: var(--text);
}
.bill-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bill-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.bill-row:last-child {
  border-bottom: none;
}
.bill-row-k {
  color: var(--text-sec);
}
.bill-row-v {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.bill-row-hint {
  width: 100%;
  font-size: 11px;
  color: #f59e0b;
  margin-top: 2px;
}

.bill-svc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.bill-svc-row:last-child {
  border-bottom: none;
}
.bill-svc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.bill-svc-meta {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 2px;
}
.bill-svc-cost {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bill-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.bill-admin-row:hover {
  background: var(--surface);
}
.bill-admin-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.bill-admin-meta {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 2px;
}
.bill-admin-cost {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bill-admin-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}
.bill-config-title {
  font-size: 12px;
  color: var(--text-sec);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
#bill-month-switch .connector-btn.active {
  background: var(--bot-color);
  color: #fff;
}

/* ════════════════════════════════════════════════════════════════════
   v6.19.2 — Verrechnung UI-Refresh: Accordion + Farben + Save/Clear
   ════════════════════════════════════════════════════════════════════ */
.bill-month-bar {
  padding: 0 0 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.bill-month-switch {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.bill-month-btn {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.bill-month-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.bill-month-btn.active {
  background: var(--bot-color);
  border-color: var(--bot-color);
  color: #fff;
  font-weight: 500;
}

.bill-total-wrap {
  margin-bottom: 12px;
}
.bill-total-card {
  padding: 22px 16px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--bot-color) 14%, transparent),
    color-mix(in oklab, var(--bot-color) 6%, transparent)
  );
  border: 1px solid color-mix(in oklab, var(--bot-color) 26%, transparent);
  text-align: center;
}
.bill-total-value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.bill-total-label {
  font-size: 12px;
  color: var(--text-ter);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.bill-rows {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}
.bill-row:last-child {
  border-bottom: none;
}
.bill-row-k {
  color: var(--text-sec);
}
.bill-row-v {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bill-row.row-plus {
  background: color-mix(in oklab, #22c55e 6%, transparent);
}
.bill-row.row-plus .bill-row-v {
  color: #16a34a;
}
.bill-row.row-min-active {
  background: color-mix(in oklab, #f59e0b 10%, transparent);
}
.bill-row.row-min-active .bill-row-v {
  color: #b45309;
}
.bill-row-hint {
  width: 100%;
  font-size: 11px;
  color: #b45309;
  margin-top: 4px;
}

/* Accordion-Sektionen — verhalten sich wie Settings-Sections */
.bill-acc {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 10px;
  padding: 0;
}
.bill-acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  margin-bottom: 0;
}
.bill-acc > summary::-webkit-details-marker {
  display: none;
}
.bill-acc > summary::after {
  content: "›";
  transition: transform 0.2s;
  color: var(--text-ter);
  font-size: 18px;
}
.bill-acc[open] > summary::after {
  transform: rotate(90deg);
}
.bill-acc > summary:hover {
  background: color-mix(in oklab, var(--text) 4%, transparent);
  border-radius: 10px 10px 0 0;
}
.bill-acc-body {
  padding: 6px 14px 14px;
}

.bill-svc-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.bill-svc-row:last-child {
  border-bottom: none;
}
.bill-svc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bill-svc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.bill-svc-meta {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 2px;
}
.bill-svc-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.bill-svc-cost {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bill-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.bill-admin-row:hover {
  border-color: var(--bot-color);
}
.bill-admin-row.selected {
  border-color: var(--bot-color);
  background: color-mix(in oklab, var(--bot-color) 6%, transparent);
}
.bill-admin-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.bill-admin-meta {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 2px;
}
.bill-admin-cost {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bill-admin-total {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--bot-color) 8%, transparent);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.bill-config-title {
  font-size: 12px;
  color: var(--text-sec);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.bill-config-btnrow {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.bill-btn-save {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
  flex: 1;
}
.bill-btn-save:hover {
  background: #059669 !important;
  border-color: #059669 !important;
}
.bill-btn-clear {
  flex: 0 0 auto;
}

/* Screen-Agent Live-Preview (Bot-Augen) — Mini-Thumbnail rechts oben */
/* v6.39.0: Preview + Reopen nur sichtbar wenn Daemon verbunden UND kein Settings-Panel offen */
body:not(.screen-agent-connected) #screen-preview,
body:not(.screen-agent-connected) #screen-preview-reopen,
body:has(.fs-panel.open) #screen-preview,
body:has(.fs-panel.open) #screen-preview-reopen {
  display: none !important;
}

#screen-preview {
  position: fixed;
  /* v6.34.0: Unter Header + Bot-Card in Hero-View, unter Header in Chat-View */
  /* v6.38.0: 24px Rand damit nicht an App-Kante klebt */
  top: 160px;
  right: 24px;
  width: 280px;
  height: 182px;
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  z-index: 9000;
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}
/* v6.34.0: Desktop (App ist 420px zentriert) — an App-rechten Rand statt Viewport */
@media (min-width: 600px) {
  #screen-preview {
    right: calc(50vw - 210px + 24px);
  }
}
#screen-preview:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}
#screen-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Kein src gesetzt → img-Element unsichtbar (kein Broken-Icon/Alt-Text) */
#screen-preview-img:not([src]),
#screen-preview-img[src=""] {
  display: none;
}
/* Placeholder wenn Container sichtbar aber noch kein Frame da ist */
#screen-preview:has(#screen-preview-img:not([src]))::before,
#screen-preview:has(#screen-preview-img[src=""])::before {
  content: "warte auf Screen-Agent…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 0 12px;
}
#screen-preview-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  display: flex;
  justify-content: space-between;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
#screen-preview.flash {
  border-color: #4ade80;
  box-shadow:
    0 0 0 2px rgba(74, 222, 128, 0.4),
    0 6px 18px rgba(0, 0, 0, 0.4);
}
@media (max-width: 640px) {
  #screen-preview {
    width: 240px;
    height: 156px;
    /* v6.34.0: unter Bot-Card (Hero) bzw. weit unter Header (Chat) */
    /* v6.38.0: 20px Rand für Mobile */
    top: 160px;
    right: 20px;
  }
  #screen-preview-reopen {
    top: 160px;
    right: 20px;
  }
}
/* v6.25.1: Eye-Button — links oben, 32px, klares Toggle (Eye/X) statt cycle */
#screen-preview-eye {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 3;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}
#screen-preview-eye:hover {
  transform: scale(1.06);
}
#screen-preview-eye .eye-icon-on,
#screen-preview-eye .eye-icon-off {
  display: none;
}
#screen-preview-eye.eye-off {
  opacity: 0.7;
}
#screen-preview-eye.eye-off .eye-icon-on {
  display: block;
}
#screen-preview-eye.eye-passive,
#screen-preview-eye.eye-active {
  background: rgba(34, 197, 94, 0.9);
  border-color: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
  opacity: 1;
}
#screen-preview-eye.eye-passive .eye-icon-off,
#screen-preview-eye.eye-active .eye-icon-off {
  display: block;
}

/* v6.25.2 — Drag-Handle deckt das gesamte Thumbnail ab. Buttons (z-index 3)
   bleiben klickbar weil sie höher liegen als handle (z-index 1). */
#screen-preview-drag-handle {
  position: absolute;
  inset: 0;
  cursor: grab;
  pointer-events: auto;
  z-index: 1;
  /* Kein Background mehr — soll unsichtbar über dem Bild liegen.
     Drag-Indikator-Punkte oben mitte zeigen "ziehbar". */
  background: transparent;
}
#screen-preview-drag-handle::before {
  content: "⋯⋯⋯";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
#screen-preview-drag-handle:active {
  cursor: grabbing;
}
#screen-preview.dragging {
  transition: none !important;
  opacity: 0.85;
}

/* v6.25.3 — Resize-Handle in Ecke unten-rechts (PiP-Style wie iPhone) */
#screen-preview-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
  z-index: 4;
  pointer-events: auto;
  background: transparent;
}
#screen-preview-resize::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom-right-radius: 4px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
#screen-preview.resizing {
  transition: none !important;
}

/* Close-Button (X) — rechts oben, 32px Touch-Target */
#screen-preview-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0.85;
  z-index: 3;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
#screen-preview-close:hover {
  opacity: 1;
  transform: scale(1.06);
}

/* Mini-Reopen-Button: floating, immer da wenn Preview hidden ist */
/* v6.34.0: Gleiche Position wie #screen-preview — unter Bot-Card in Hero + in App-Box auf Desktop */
#screen-preview-reopen {
  position: fixed;
  /* v6.38.0: 24px Rand damit nicht an App-Kante klebt */
  top: 160px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0.85;
  transition:
    opacity 0.2s,
    transform 0.15s;
}
#screen-preview-reopen:hover {
  opacity: 1;
  transform: scale(1.06);
}
@media (prefers-color-scheme: dark) {
  #screen-preview-reopen {
    background: rgba(40, 40, 44, 0.9);
    color: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.15);
  }
}
/* v6.34.0: Desktop — Reopen-Button ans App-rechten Rand holen */
@media (min-width: 600px) {
  #screen-preview-reopen {
    right: calc(50vw - 210px + 24px);
  }
}

/* v6.22.0 — Strukturierte Message-Parts (Single Source of Truth Renderer) */
.msg .msg-text {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg .msg-text + .msg-text {
  margin-top: 6px;
}
.msg .msg-audio-meta {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.msg .msg-image {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.04);
  object-fit: contain;
}
.msg .msg-image-caption {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-sec, var(--text));
  line-height: 1.4;
  letter-spacing: -0.005em;
}
[data-mode="dark"] .msg .msg-image-caption {
  color: rgba(255, 255, 255, 0.85);
}
.msg .msg-tool {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
  border-left: 2px solid rgba(96, 165, 250, 0.55);
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────
   v6.22.3 — ChatGPT-Style Input Bar v3
   Pill-form, kompakt, schwarzer Voice-Button rechts.
   ───────────────────────────────────────────────────────── */
#chat-input-bar {
  margin: 8px 12px 10px;
  padding: 6px 8px 6px 6px;
  gap: 4px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 28px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  min-height: 52px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Upload-Button: schlicht, kein Background, nur das + */
#chat-input-bar #upload-btn {
  width: 40px !important;
  height: 40px !important;
  background: transparent !important;
  border: none !important;
  color: var(--text, #2e2e2e) !important;
  border-radius: 50% !important;
  margin-right: 2px;
}
#chat-input-bar #upload-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

/* Text-Input integriert in den Pill — kein eigener Border, iOS-Safari-Reset */
#chat-input-bar #chat-text-input {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  padding: 8px 6px;
  font-size: 16px;
  color: var(--text, #2e2e2e);
}
#chat-input-bar #chat-text-input:focus,
#chat-input-bar #chat-text-input:focus-visible,
#chat-input-bar #chat-text-input:active {
  border: 0 !important;
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}
#chat-input-bar #chat-text-input::placeholder {
  color: var(--text-ter, rgba(0, 0, 0, 0.4));
  font-weight: 400;
}

/* Mic-Button: dezent grau im Pill */
#chat-input-bar #mic-record-btn {
  width: 36px !important;
  height: 36px !important;
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text, #2e2e2e) !important;
  border-radius: 50% !important;
}
#chat-input-bar #mic-record-btn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}

/* Send/Voice/Phone-Button: schwarzer runder Knopf rechts (ChatGPT-Look) */
#chat-input-bar #chat-send-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: var(--text, #1a1a1a) !important;
  color: var(--surface, #fff) !important;
  border: none !important;
  margin-left: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#chat-input-bar #chat-send-btn:hover {
  opacity: 0.85;
}
#chat-input-bar #chat-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Dark-Mode-Anpassung: schwarzer Pill-Hintergrund, weißer Voice-Button */
@media (prefers-color-scheme: dark) {
  #chat-input-bar {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }
  #chat-input-bar #upload-btn,
  #chat-input-bar #chat-text-input {
    color: rgba(255, 255, 255, 0.92) !important;
  }
  #chat-input-bar #upload-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
  }
  #chat-input-bar #mic-record-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.85) !important;
  }
  #chat-input-bar #mic-record-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
  }
  #chat-input-bar #chat-send-btn {
    background: #fff !important;
    color: #1a1a1a !important;
  }
}

/* ── Quick-Modules Sheet ───────────────────────────────────────── */
@keyframes qmFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes qmSlide {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.qm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: qmFade 0.18s ease-out;
}

.qm-sheet {
  background: var(--surface, #fff);
  width: 100%;
  max-width: 720px;
  max-height: 84vh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  padding: 22px 20px 32px;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.22);
  animation: qmSlide 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text);
}
/* v7.8.108: Dark-Mode für Quick-Modules-Sheet (vorher var(--card-bg, #fff)
   fiel im Dark-Mode auf weiß zurück → unleserliche Texte). Jetzt direkt
   auf data-mode-aware Surface-Variable + explizite Text-Farben. */
[data-mode="dark"] .qm-sheet {
  background: #1a1a1d;
  color: var(--text);
}
[data-mode="dark"] .qm-title {
  color: var(--text);
}
[data-mode="dark"] .qm-sub {
  color: var(--text-sec);
}
[data-mode="dark"] .qm-section-header {
  color: var(--text-sec);
}
[data-mode="dark"] .qm-tile {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
[data-mode="dark"] .qm-tile:hover {
  background: rgba(255, 255, 255, 0.09);
}
[data-mode="dark"] .qm-tile-name {
  color: var(--text);
}
[data-mode="dark"] .qm-tile-prompt {
  color: var(--text-sec);
}
@media (min-width: 720px) {
  .qm-overlay {
    align-items: center;
  }
  .qm-sheet {
    border-radius: 22px;
    max-height: 80vh;
  }
}

.qm-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.qm-title-wrap {
  flex: 1;
  min-width: 0;
}
.qm-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.qm-sub {
  font-size: 12.5px;
  color: var(--text-ter);
  line-height: 1.4;
}
.qm-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  color: var(--text-sec);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  flex-shrink: 0;
}
.qm-close:hover {
  background: var(--surface-2, rgba(0, 0, 0, 0.05));
}

/* v7.7.10: Kompaktes Tile-Layout — Icon links, Text rechts, eine Zeile.
   Desktop: ~5-6 pro Zeile. Mobile: 3 pro Zeile. */
/* v7.7.16: Tabs + großzügigeres Tile-Layout. */
.qm-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: color-mix(
    in srgb,
    var(--accent) 6%,
    var(--surface-2, rgba(0, 0, 0, 0.04))
  );
  border-radius: 12px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.qm-tabs::-webkit-scrollbar {
  display: none;
}
.qm-tab {
  flex: 1;
  min-width: max-content;
  background: transparent;
  border: 0;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition:
    background 0.14s,
    color 0.14s;
  white-space: nowrap;
}
.qm-tab:hover {
  color: var(--text);
}
.qm-tab.active {
  background: var(--surface, #fff);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
[data-mode="dark"] .qm-tab.active {
  background: rgba(255, 255, 255, 0.1);
}

.qm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

/* v7.8.38: Sections statt Tabs — alle Module auf einer scrollbaren Seite. */
.qm-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 8px;
}
.qm-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qm-section-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sec);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 0 2px;
  opacity: 0.75;
}

.qm-tile {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface, #f5f5f7));
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 14px;
  padding: 12px 13px;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  min-height: 68px;
}
.qm-tile:hover {
  border-color: var(--accent, #0a84ff);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface, #f5f5f7));
}
.qm-tile:active {
  transform: scale(0.98);
}

.qm-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent, #0a84ff);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qm-tile-icon svg {
  width: 20px;
  height: 20px;
}
.qm-tile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.qm-tile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qm-tile-prompt {
  font-size: 11.5px;
  color: var(--text-ter);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qm-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--text-ter);
  padding: 32px 0;
  font-style: italic;
}

/* v7.8.108: Favoriten-Sektion — visuell abgehoben, kompakte Schnellbuttons.
   Max 6 Tiles, nur Icon + Name in einer Zeile (kein Demo-Prompt). */
.qm-section-favorites {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 16px;
  padding: 12px 12px 14px;
  gap: 10px;
}
[data-mode="dark"] .qm-section-favorites {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.qm-section-favorites .qm-section-header {
  color: var(--accent);
  opacity: 1;
}
.qm-section-favorites .qm-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.qm-tile-fav {
  min-height: 44px;
  padding: 8px 10px;
  gap: 9px;
  border-radius: 11px;
  background: var(--surface, #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
}
[data-mode="dark"] .qm-tile-fav {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}
.qm-tile-fav .qm-tile-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.qm-tile-fav .qm-tile-icon svg {
  width: 16px;
  height: 16px;
}
.qm-tile-fav .qm-tile-name {
  font-size: 13px;
}
.qm-tile-fav .qm-tile-prompt {
  display: none;
}

/* v7.8.109: Hint-Card wenn Termine-Sektion mangels Google-Connect leer
   ist. Klick öffnet Connectoren-Settings. */
.qm-hint-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.15s ease;
}
.qm-hint-card:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
[data-mode="dark"] .qm-hint-card {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
}

@media (max-width: 480px) {
  .qm-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 7px;
  }
  .qm-tile {
    min-height: 60px;
    padding: 10px 11px;
    gap: 10px;
  }
  .qm-tile-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .qm-tile-icon svg {
    width: 18px;
    height: 18px;
  }
  .qm-tile-name {
    font-size: 13px;
  }
  .qm-tile-prompt {
    font-size: 11px;
  }
  .qm-tab {
    padding: 6px 12px;
    font-size: 12.5px;
  }
}

[data-mode="dark"] .qm-tile-icon {
  background: rgba(120, 170, 255, 0.18);
  color: #79b1ff;
}
[data-mode="dark"] .qm-tile:hover {
  border-color: #79b1ff;
  box-shadow: 0 3px 14px rgba(121, 177, 255, 0.18);
}

/* ──────────────────────────────────────────────────────────────────
   Tool-Cards — Apple-Style (v7.7.0)
   Konsistente Card-Sprache: weiche Surfaces, klare Hierarchie,
   Hero-Werte groß, tonale Icon-Boxes pro Kategorie. Wenig Borders.
   ────────────────────────────────────────────────────────────────── */

.tc-card {
  background: var(--surface, rgba(0, 0, 0, 0.04));
  border-radius: 18px;
  padding: 16px 18px 18px;
  margin: 6px 0;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: inherit;
  color: var(--text);
}
[data-mode="dark"] .tc-card {
  background: rgba(255, 255, 255, 0.06);
}

.tc-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.tc-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(120, 120, 128, 0.16);
  color: var(--text-sec);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tc-icon-sky {
  background: rgba(0, 122, 255, 0.15);
  color: #007aff;
}
.tc-icon-blue {
  background: rgba(10, 132, 255, 0.15);
  color: #0a84ff;
}
.tc-icon-amber {
  background: rgba(255, 159, 10, 0.18);
  color: #ff9f0a;
}
.tc-icon-red {
  background: rgba(255, 69, 58, 0.16);
  color: #ff453a;
}
.tc-icon-green {
  background: rgba(48, 209, 88, 0.16);
  color: #30d158;
}
.tc-icon-purple {
  background: rgba(175, 82, 222, 0.16);
  color: #af52de;
}
.tc-icon-neutral {
  background: rgba(120, 120, 128, 0.16);
  color: var(--text-sec);
}
[data-mode="dark"] .tc-icon-sky {
  color: #5ac8fa;
}
[data-mode="dark"] .tc-icon-blue {
  color: #64b5ff;
}
[data-mode="dark"] .tc-icon-amber {
  color: #ffb340;
}
[data-mode="dark"] .tc-icon-red {
  color: #ff6b60;
}
[data-mode="dark"] .tc-icon-green {
  color: #5ee190;
}
[data-mode="dark"] .tc-icon-purple {
  color: #c77dff;
}

.tc-title-wrap {
  flex: 1;
  min-width: 0;
}
.tc-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}
.tc-sub {
  font-size: 12px;
  color: var(--text-ter);
  margin-top: 1px;
  letter-spacing: -0.005em;
}

/* Hero-Block — für Wetter (Temp), Uhrzeit etc. */
.tc-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 4px 0;
}
.tc-hero-value {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.tc-hero-label {
  font-size: 13px;
  color: var(--text-sec);
  margin-top: 4px;
  letter-spacing: -0.005em;
}

/* Stats-Reihe (Wetter: Wind, Luftfeuchte) */
.tc-stats {
  display: flex;
  gap: 8px;
}
.tc-stat {
  flex: 1;
  background: rgba(120, 120, 128, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}
[data-mode="dark"] .tc-stat {
  background: rgba(255, 255, 255, 0.04);
}
.tc-stat-label {
  font-size: 11px;
  color: var(--text-ter);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.tc-stat-value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Wetter-Forecast-Liste */
.tc-forecast {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 0.5px solid rgba(120, 120, 128, 0.2);
  padding-top: 10px;
}
.tc-fc-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  font-size: 13px;
}
.tc-fc-row + .tc-fc-row {
  border-top: 0.5px solid rgba(120, 120, 128, 0.15);
}
.tc-fc-day {
  font-weight: 500;
  color: var(--text);
}
.tc-fc-cond {
  color: var(--text-ter);
  font-size: 12px;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-fc-range {
  display: flex;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.tc-fc-min {
  color: var(--text-ter);
}
.tc-fc-max {
  color: var(--text);
  font-weight: 500;
}

/* List-Rows (Mail-Items, Calendar-Events, Search-Results) */
.tc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tc-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  font-size: 13px;
}
.tc-row + .tc-row {
  border-top: 0.5px solid rgba(120, 120, 128, 0.15);
}
.tc-row-meta {
  flex: 1;
  min-width: 0;
}
.tc-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  text-decoration: none;
  /* v7.10.42: Auf Smartphones war nowrap+ellipsis zu eng — Titel wurden
     mitten im Wort abgeschnitten. Jetzt: 2 Zeilen erlaubt mit Wort-
     Umbruch. Reicht für die typischen Web-Such-Treffer-Titel. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.tc-row-desc {
  font-size: 12px;
  color: var(--text-ter);
  margin-top: 1px;
  /* v7.10.17: 2 Zeilen erlaubt + Wortbruch — Suchergebnisse haben oft
     laengere Beschreibungen die nicht alle in eine Zeile passen. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* v7.10.17: Hostname-Zeile unter dem Treffer (kompakt + grau). Lange URLs
   werden NIE als bold-Zeile gezeigt — nur der Hostname ist relevant fuer
   den User. */
.tc-row-host {
  font-size: 11px;
  color: var(--text-ter);
  margin-top: 2px;
  opacity: 0.75;
}
.tc-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #007aff;
  flex-shrink: 0;
}
[data-mode="dark"] .tc-row-dot {
  background: #5ac8fa;
}

/* Mail-Avatar — Initials in tonaler Box */
.tc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.15);
  color: #007aff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
[data-mode="dark"] .tc-avatar {
  background: rgba(90, 200, 250, 0.18);
  color: #5ac8fa;
}

/* Generic-Body (Plain-Text-Tools) */
.tc-body {
  font-size: 13px;
  color: var(--text-sec, var(--text));
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: -0.005em;
}
.tc-empty {
  font-size: 13px;
  color: var(--text-ter);
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}
.tc-more {
  font-size: 11.5px;
  color: var(--text-ter);
  font-style: italic;
}

/* Error-State */
.tc-error .tc-icon {
  background: rgba(255, 69, 58, 0.16);
  color: #ff453a;
}

/* ── Mode-Indikator (Audio / Card / Beides) ─────────────────────
   Ein winziger Pill am Anfang einer Bot-Bubble der zeigt was kommt.
   Per opts.mode in renderStructuredMessage gesetzt. */
.msg-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-ter);
  margin-bottom: 6px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.12);
  align-self: flex-start;
}
[data-mode="dark"] .msg-mode {
  background: rgba(255, 255, 255, 0.07);
}
.msg-mode svg {
  flex-shrink: 0;
  opacity: 0.85;
}
.msg-mode-card {
  color: #007aff;
}
.msg-mode-audio {
  color: #af52de;
}
.msg-mode-both {
  color: #ff9f0a;
}
[data-mode="dark"] .msg-mode-card {
  color: #5ac8fa;
}
[data-mode="dark"] .msg-mode-audio {
  color: #c77dff;
}
[data-mode="dark"] .msg-mode-both {
  color: #ffb340;
}

/* Channel-Badge — bleibt wie gehabt, aber dezenter */
.msg-channel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-ter);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.msg-channel svg {
  color: currentColor;
}

/* Stat-Tile Hint (Tagesprognose-Bedingung wenn anders als Jetzt) */
.tc-stat-hint {
  font-size: 10.5px;
  color: var(--text-ter);
  margin-top: 3px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Action-Buttons in Cards (M3 Tonal/Filled) ─────────────────── */
.tc-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.tc-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  background: rgba(120, 120, 128, 0.12);
  color: var(--text);
  transition:
    background 0.14s ease,
    transform 0.06s ease;
  font-family: inherit;
}
[data-mode="dark"] .tc-action {
  background: rgba(255, 255, 255, 0.08);
}
.tc-action:hover {
  background: rgba(120, 120, 128, 0.2);
}
.tc-action:active {
  transform: scale(0.97);
}
.tc-action-primary {
  background: var(--accent);
  color: #fff;
}
.tc-action-primary:hover {
  filter: brightness(1.06);
  background: var(--accent);
}

/* Contact-Row mit Anruf-Button rechts */
.tc-row-contact {
  align-items: center;
}
.tc-row-contact .tc-action {
  flex-shrink: 0;
}

/* M3-Polish für Mode-Badge — Akzent-tonal statt knallige Farben */
.msg-mode {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
[data-mode="dark"] .msg-mode {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: color-mix(in srgb, var(--accent) 75%, white);
}
.msg-mode-card,
.msg-mode-audio,
.msg-mode-both {
  color: inherit;
}

/* ── Pending-Card Spinner (Tool-läuft Indicator) ───────────────── */
.tc-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--text-ter) 30%, transparent);
  border-top-color: var(--accent);
  animation: tcSpin 0.8s linear infinite;
}
@keyframes tcSpin {
  to {
    transform: rotate(360deg);
  }
}
.tc-pending {
  opacity: 0.92;
}
.tc-pending .tc-icon {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tc-pending-msg {
  animation: tcFadeIn 0.18s ease-out;
}
@keyframes tcFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Klickbare Mail/Item-Rows mit Hover-Highlight */
.tc-row-link {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  margin: 0 -6px;
  padding-left: 6px;
  padding-right: 6px;
  transition: background 0.12s ease;
}
.tc-row-link:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.tc-row-link + .tc-row-link {
  border-top-color: rgba(120, 120, 128, 0.1);
}

/* Timer-Card Live-Counter */
.tc-timer-hero .tc-hero-value {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.tc-timer-done .tc-hero-value {
  color: #ff453a;
  animation: tcTimerPulse 1s ease-in-out infinite;
}
.tc-timer-done .tc-icon {
  background: rgba(255, 69, 58, 0.18);
  color: #ff453a;
}
@keyframes tcTimerPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ── Timer-Alarm-Modal (lautes Klingeln + Stop-Button) ────────── */
.tc-alarm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tcAlarmFade 0.18s ease-out;
}
@keyframes tcAlarmFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.tc-alarm-overlay.tc-alarm-closing {
  opacity: 0;
  transition: opacity 0.18s;
}

.tc-alarm-card {
  background: var(--card-bg, #fff);
  border-radius: 22px;
  padding: 28px 30px 24px;
  width: min(90vw, 360px);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: tcAlarmPop 0.32s cubic-bezier(0.16, 1.16, 0.45, 1);
}
@keyframes tcAlarmPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.tc-alarm-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 159, 10, 0.18);
  color: #ff9f0a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  animation: tcAlarmShake 0.5s ease-in-out infinite alternate;
}
@keyframes tcAlarmShake {
  from {
    transform: rotate(-8deg);
  }
  to {
    transform: rotate(8deg);
  }
}
.tc-alarm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.tc-alarm-sub {
  font-size: 14px;
  color: var(--text-sec);
  margin-bottom: 12px;
}
.tc-alarm-stop {
  margin-top: 4px;
  padding: 11px 28px;
  border-radius: 999px;
  border: 0;
  background: var(--accent, #0a84ff);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition:
    filter 0.14s,
    transform 0.06s;
}
.tc-alarm-stop:hover {
  filter: brightness(1.08);
}
.tc-alarm-stop:active {
  transform: scale(0.97);
}

/* Wikipedia-Card Thumbnail */
.tc-wiki-thumb-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(120, 120, 128, 0.08);
  max-height: 200px;
}
.tc-wiki-thumb {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 200px;
}

/* Calculator-Card: Hero in lila Akzent */
.tc-card .tc-icon-purple ~ .tc-title-wrap + * .tc-hero-value,
.tc-card .tc-hero-value {
  font-variant-numeric: tabular-nums;
}

/* msg-time Stempel — WhatsApp/Telegram-Style, klein dezent unten */
.msg-time {
  display: block;
  font-size: 10.5px;
  color: var(--text-ter);
  margin-top: 6px;
  opacity: 0.7;
  font-feature-settings: "tnum" 1;
}
.msg.user .msg-time {
  text-align: right;
  color: rgba(255, 255, 255, 0.75);
}

/* v7.7.18: Wenn Bot-Antwort NUR eine Tool-Card ist → outer Bubble
   transparent. Die Card spricht für sich, keine Card-in-Card-Wrapper.
   Bot-Name + Mode-Badge + Time bleiben sichtbar als freie Elemente. */
.msg.assistant.msg-card-only {
  background: transparent !important;
  border: 0 !important;
  padding: 4px 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.msg.assistant.msg-card-only .msg-bot-name {
  margin-left: 2px;
  margin-bottom: 4px;
}
.msg.assistant.msg-card-only .msg-mode {
  margin-left: 2px;
  margin-bottom: 6px;
}
.msg.assistant.msg-card-only .msg-time {
  margin-left: 4px;
  margin-top: 4px;
}
.msg.assistant.msg-card-only .tc-card {
  margin: 0;
}

/* Expand-Button für Listen ('5 weitere anzeigen') — M3-Tonal */
.tc-more-btn {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  margin-top: 6px;
  transition: background 0.14s;
}
.tc-more-btn:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
[data-mode="dark"] .tc-more-btn {
  background: rgba(255, 255, 255, 0.06);
}
[data-mode="dark"] .tc-more-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* v7.8.2 — Custom-Voice-Dropdown (ersetzt v7.7.33 Vorschau-Liste).
   Trigger sieht aus wie ein Select; aufgeklappt erscheint eine Liste mit
   Play-Icon + Name + Check-Mark fuer aktive Stimme. */
.vd-wrap {
  position: relative;
  width: 100%;
}
.vd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border, transparent);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  color: var(--text-pri, var(--text-sec));
  cursor: pointer;
  text-align: left;
  min-height: 42px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.vd-trigger:hover,
.vd-trigger:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.vd-wrap.open .vd-trigger {
  border-color: var(--accent);
}
.vd-current {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vd-chev {
  flex: 0 0 auto;
  color: var(--text-ter);
  transition: transform 0.18s ease;
}
.vd-wrap.open .vd-chev {
  transform: rotate(180deg);
  color: var(--accent);
}
.vd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface-2);
  border: 1px solid var(--border, transparent);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  padding: 6px;
  /* v7.8.59: hidden-Attribut MUSS gewinnen — vorher display:flex hat es
     überschrieben → Menü war immer offen, Stimmen-Liste komplett
     ausgebreitet sichtbar. */
  display: none;
  flex-direction: column;
  gap: 2px;
}
.vd-menu:not([hidden]) {
  display: flex;
}
.vd-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-ter);
  padding: 8px 8px 4px;
}
.vd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  min-height: 38px;
  transition: background 0.12s ease;
}
.vd-item:hover,
.vd-item:focus-visible {
  background: var(--accent-soft);
  outline: none;
}
.vd-item.active {
  background: var(--accent-soft);
}
.vd-play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 0;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.vd-play:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 6px var(--accent-glow);
}
.vd-play:active {
  transform: scale(0.96);
}
.vd-play:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.vd-name {
  flex: 1 1 auto;
  font-size: 13.5px;
  color: var(--text-pri, var(--text-sec));
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vd-item.active .vd-name {
  font-weight: 600;
}
.vd-check {
  flex: 0 0 auto;
  color: var(--accent);
  display: none;
  align-items: center;
}
.vd-item.active .vd-check {
  display: inline-flex;
}
/* Loading/Playing spiegeln den globalen Audio-Slot — gleiche row-Klasse
   wie der alte Vorschau-Code (.loading/.playing), greift jetzt auf .vd-play. */
.vd-item.loading .vd-play svg {
  animation: vd-spin 0.9s linear infinite;
  opacity: 0.9;
}
.vd-item.playing .vd-play {
  background: var(--accent-glow);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.vd-item.playing .vd-play svg {
  animation: vd-pulse 1.1s ease-in-out infinite;
}
@keyframes vd-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes vd-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

/* ── Settings Router (v7.8.0) ──────────────────────────── */
/* Hub: Cluster-Karten. Cluster: Item-Liste. Beide nutzen das normale
   FullscreenPanel als Container; die hier definierten Klassen geben
   Mobile-First-Layouts mit grossen Touch-Targets. */
.sr-panel .fs-panel-body {
  padding: 12px 14px 24px;
}

/* Hub: vertikale Liste grosser Cluster-Karten */
.sr-hub {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sr-cluster-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--text-pri, var(--text-sec));
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
  min-height: 64px;
}
.sr-cluster-card:hover,
.sr-cluster-card:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}
.sr-cluster-card:active {
  transform: scale(0.985);
}
.sr-cluster-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.sr-cluster-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sr-cluster-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-pri);
}
.sr-cluster-desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-ter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-cluster-chev {
  flex: 0 0 auto;
  color: var(--text-ter);
  display: inline-flex;
  align-items: center;
}

/* Cluster-View: Sub-Header + Item-Liste */
.sr-cluster-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sr-cluster-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 8px;
  font-size: 12.5px;
  color: var(--text-ter);
  border-bottom: 1px solid var(--border, transparent);
  margin-bottom: 4px;
}
.sr-cluster-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 auto;
}
.sr-cluster-header-text {
  flex: 1 1 auto;
}
.sr-item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sr-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--text-pri, var(--text-sec));
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
  min-height: 56px;
}
.sr-item-row:hover,
.sr-item-row:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}
.sr-item-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.1);
  color: var(--text-sec);
}
.sr-item-row:hover .sr-item-icon,
.sr-item-row:focus-visible .sr-item-icon {
  background: var(--accent-glow);
  color: var(--accent);
}
.sr-item-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sr-item-title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-pri);
}
.sr-item-desc {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-ter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-item-chev {
  flex: 0 0 auto;
  color: var(--text-ter);
  display: inline-flex;
  align-items: center;
}

/* Hub bleibt einspaltig — der FullscreenPanel-Container ist auf Desktop
   zentriert und schmal (<400px), also macht 2-spaltig die Karten unleserlich.
   Auf richtig grossen Panels (Tablet im Querformat) leichtes Padding-Bonus. */
@media (min-width: 600px) {
  .sr-cluster-card {
    min-height: 78px;
    padding: 18px 16px;
  }
  .sr-cluster-icon {
    width: 48px;
    height: 48px;
  }
}

/* ── Settings flat (v7.8.96) ────────────────────────────
   Eine-Ebene-Hub: jeder Eintrag ist eine .sr-item-card. Reused Look
   der frueheren .sr-cluster-card, leicht kompakter weil's mehr Items
   gibt. Admin-only Items bekommen ein dezentes „Admin"-Badge rechts. */
.sr-item-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--text-pri, var(--text-sec));
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
  min-height: 60px;
}
.sr-item-card:hover,
.sr-item-card:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}
.sr-item-card:active {
  transform: scale(0.985);
}
.sr-item-card .sr-item-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.sr-item-card:hover .sr-item-icon,
.sr-item-card:focus-visible .sr-item-icon {
  background: var(--accent-glow, var(--accent-soft));
  color: var(--accent);
}
.sr-item-card .sr-item-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sr-item-card .sr-item-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-pri);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sr-item-card .sr-item-desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-ter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-item-card .sr-item-chev {
  flex: 0 0 auto;
  color: var(--text-ter);
  display: inline-flex;
  align-items: center;
}

/* Admin-Badge: kleine, gedaempfte Tag-Pille rechts vom Titel.
   Sichtbar nur fuer Admin-Items im Admin-Modus (siehe settings-router.js). */
.sr-admin-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-ter);
  background: rgba(127, 127, 127, 0.14);
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 6px;
  padding: 1px 6px;
  line-height: 1.4;
  white-space: nowrap;
}

@media (min-width: 600px) {
  .sr-item-card {
    min-height: 70px;
    padding: 16px 16px;
  }
  .sr-item-card .sr-item-icon {
    width: 46px;
    height: 46px;
  }
}

/* ── Neues Projekt — als FullscreenPanel (v7.8.4) ─────── */
.pm-panel .fs-panel-body {
  padding: 14px 14px 24px;
}
.pm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.pm-field[hidden] {
  display: none;
}
.pm-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-ter);
  letter-spacing: 0.02em;
}
.pm-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-pri, var(--text-sec));
  font: inherit;
  font-size: 14.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.pm-input:focus {
  border-color: var(--accent);
}
.pm-input::placeholder {
  color: var(--text-ter);
  opacity: 1;
}
.pm-input-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.pm-type-row {
  display: flex;
  gap: 8px;
}
.pm-type-btn {
  flex: 1 1 50%;
  padding: 11px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-pri, var(--text-sec));
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.pm-type-btn:hover {
  border-color: var(--accent);
}
.pm-type-btn.pm-type-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.pm-create-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.pm-create-btn:hover {
  box-shadow: 0 2px 12px var(--accent-glow);
}
.pm-create-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Was-Neu — als FullscreenPanel (v7.8.4) ─────────── */
.wn-panel .fs-panel-body {
  padding: 14px 14px 24px;
}
.wn-intro {
  font-size: 12px;
  color: var(--text-ter);
  margin: 0 4px 14px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 600;
}
.wn-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.wn-card:hover {
  border-color: var(--accent);
}
.wn-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.wn-card-desc {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.45;
}

/* ── v7.8.25: Bug-Report (Long-Press auf Bot-Message) ──── */
.msg.assistant {
  -webkit-touch-callout: none;
}
.msg.assistant.bug-report-pressing {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  transform: scale(0.985);
  box-shadow: 0 0 0 2px var(--accent-soft);
  user-select: none;
  -webkit-user-select: none;
}
.bug-report-panel .fs-panel-body {
  padding: 14px 14px 24px;
}
.bug-report-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bug-report-context {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  max-height: 220px;
  overflow-y: auto;
}
.bug-report-ctx-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bug-report-ctx-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0.85;
}
.bug-report-ctx-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.bug-report-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.bug-report-textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.15));
  background: var(--card-bg, var(--bg, #fff));
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
  box-sizing: border-box;
}
.bug-report-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.bug-report-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.bug-report-actions button {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    background 0.15s ease;
}
.bug-report-cancel {
  background: transparent;
  color: var(--text-ter, var(--text));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.15)) !important;
}
.bug-report-submit {
  background: var(--accent);
  color: #fff;
}
.bug-report-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.bug-report-hint {
  font-size: 11px;
  color: var(--text-ter, rgba(0, 0, 0, 0.5));
  text-align: center;
  margin-top: 4px;
}

/* v7.8.86: Antwort-Modus Radio-Cards im „Dein Assistent"-Panel */
.am-option {
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.am-option:hover {
  border-color: var(--accent);
}
.am-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* v7.8.97: Verbrauch & Kosten — schlankes User-Panel mit Progress-Bar.
   Status-Farben gedämpft (soft-fills) damit Mehrverbrauch nicht dramatisch
   wirkt — Abrechnung läuft manuell, das Panel ist Info, nicht Alarm. */
.usage-progress {
  width: 100%;
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  margin: 16px 0 8px;
}
.usage-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
  border-radius: 6px;
}
.usage-progress-fill[data-status="warning"] {
  background: #f59e0b;
}
.usage-progress-fill[data-status="over"] {
  background: #ef4444;
}
.usage-stats {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-sec);
}
.usage-stats-eur {
  font-weight: 600;
  color: var(--text);
}
.usage-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.usage-status[data-status="ok"] {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.usage-status[data-status="warning"] {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.usage-status[data-status="over"] {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* v7.10.10: Sofort-Feedback fuer Call-Button. User klickt → Button zeigt
   Press-Animation + Pulse waehrend Verbindung aufgebaut wird. Damit weiss
   der User: ja, mein Klick ist angekommen. Wenn startCall() async wartet
   auf Mic-Permission + WebSocket, sieht der User trotzdem dass was passiert. */
#call-btn.pressed-feedback {
  transform: scale(0.92);
  transition: transform 0.12s ease-out;
}
#call-btn.connecting:not(.active) {
  animation: call-btn-pulse 1.2s ease-in-out infinite;
}
@keyframes call-btn-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(108, 99, 255, 0);
    transform: scale(1.04);
  }
}
