/* ════════════════════════════════════════════════════════════════
 * SEOLY LOADER (D) — Working/Thinking Mascot statt Spinner
 * ════════════════════════════════════════════════════════════════ */
.seoly-loader {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.seoly-loader--overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9998;
  backdrop-filter: blur(2px);
}
.seoly-loader--compact { padding: 14px; }

.seoly-loader-card {
  display: flex; align-items: center; gap: 22px;
  padding: 24px 28px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(143,95,196,0.18);
  box-shadow: 0 20px 50px rgba(15,23,42,0.18);
  max-width: 460px;
  width: 100%;
}
.seoly-loader--compact .seoly-loader-card {
  padding: 14px 18px;
  gap: 14px;
  max-width: 360px;
}

.seoly-loader-mascot {
  position: relative;
  flex-shrink: 0;
  width: 100px; height: 110px;
}
.seoly-loader--compact .seoly-loader-mascot { width: 64px; height: 72px; }
.seoly-loader-mascot img {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(143,95,196,0.32));
  animation: seolyLoaderBob 1.8s ease-in-out infinite;
}
@keyframes seolyLoaderBob {
  0%, 100% { transform: translateY(0)    scale(1);     }
  50%      { transform: translateY(-5px) scale(1.025); }
}
.seoly-loader-glow {
  position: absolute;
  left: 50%; bottom: 8px;
  transform: translate(-50%, 50%);
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143,95,196,0.55) 0%, rgba(255,128,0,0.22) 45%, transparent 75%);
  filter: blur(14px);
  z-index: 1;
  animation: seolyLoaderGlow 2.2s ease-in-out infinite;
}
.seoly-loader--compact .seoly-loader-glow { width: 80px; height: 80px; filter: blur(10px); }
@keyframes seolyLoaderGlow {
  0%, 100% { opacity: 0.65; transform: translate(-50%, 50%) scale(1);    }
  50%      { opacity: 1.00; transform: translate(-50%, 50%) scale(1.22); }
}

.seoly-loader-body {
  flex: 1; min-width: 0;
}
.seoly-loader-text {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--fg-primary, var(--neutral-900));
  margin-bottom: 4px;
  line-height: 1.3;
}
.seoly-loader--compact .seoly-loader-text { font-size: 13.5px; }
.seoly-loader-sub {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--fg-secondary, var(--neutral-600));
  margin-bottom: 12px;
  line-height: 1.45;
}
.seoly-loader--compact .seoly-loader-sub { font-size: 11.5px; margin-bottom: 8px; }

.seoly-loader-bar {
  position: relative;
  width: 100%; height: 6px;
  background: rgba(143,95,196,0.10);
  border-radius: 999px;
  overflow: hidden;
}
.seoly-loader-bar span {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, #8f5fc4, #ff8000, transparent);
  border-radius: 999px;
  animation: seolyLoaderBar 1.4s ease-in-out infinite;
}
@keyframes seolyLoaderBar {
  0%   { left: -40%; }
  100% { left: 100%; }
}

@media (max-width: 640px) {
  .seoly-loader-card { flex-direction: column; text-align: center; padding: 20px 18px; }
  .seoly-loader-mascot { width: 86px; height: 96px; }
}


/* ════════════════════════════════════════════════════════════════
 * SEOLY TOUR (A) — Mascot in driver.js Popovers
 * Wird automatisch via v4-seoly-tour-hook.js eingefügt
 * ════════════════════════════════════════════════════════════════ */
.driver-popover {
  position: relative;
  padding-top: 50px !important;     /* Platz für Mascot oben */
}
.seoly-tour-mascot {
  position: absolute;
  top: -32px; left: 50%;
  transform: translateX(-50%);
  width: 72px; height: 72px;
  z-index: 10;
  pointer-events: none;
  animation: seolyTourBob 2.8s ease-in-out infinite;
}
@keyframes seolyTourBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}
.seoly-tour-mascot-img {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(143,95,196,0.42));
}
.seoly-tour-mascot-glow {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143,95,196,0.55) 0%, rgba(255,128,0,0.22) 45%, transparent 75%);
  filter: blur(12px);
  z-index: 1;
  animation: seolyTourPulse 2.6s ease-in-out infinite;
}
@keyframes seolyTourPulse {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1);    }
  50%      { opacity: 1.00; transform: translate(-50%, -50%) scale(1.20); }
}


/* ════════════════════════════════════════════════════════════════
 * SEOLY TOAST (C) — Notifications mit Mascot-Avatar
 * API: v4Toast.success() / .error() / .info() / .warning()
 * ════════════════════════════════════════════════════════════════ */
.v4-toast-container {
  position: fixed;
  top: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  max-width: 380px;
}
.v4-toast {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 14px;
  background: #fff;
  border: 1px solid rgba(143,95,196,0.20);
  border-left: 4px solid #8f5fc4;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(15,23,42,0.15);
  opacity: 0; transform: translateX(20px) scale(0.95);
  transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: auto;
}
.v4-toast.is-visible { opacity: 1; transform: translateX(0) scale(1); }
.v4-toast.is-leaving { opacity: 0; transform: translateX(20px) scale(0.95); }

.v4-toast--success { border-left-color: #6FB130; }
.v4-toast--error   { border-left-color: #ef4444; }
.v4-toast--warning { border-left-color: #ff8000; }
.v4-toast--info    { border-left-color: #8f5fc4; }

/* Mascot-Avatar — Wrapper mit overflow:hidden damit das scaled Image NICHT
 * aus dem Slot rausragt und den Text überdeckt. (2026-06-01 Fix) */
.v4-toast-mascot {
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3eaff, #ffe6cc);
  box-shadow: 0 2px 6px rgba(143,95,196,0.20);
  overflow: hidden;
}
.v4-toast-mascot-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 14%;
  transform: scale(1.6);
  transform-origin: center 22%;
  display: block;
}
.v4-toast-body {
  flex: 1; min-width: 0;
  font-family: var(--font-display, system-ui);
}
.v4-toast-title {
  font-size: 13px; font-weight: 700;
  color: var(--fg-primary, var(--neutral-900));
  margin-bottom: 2px;
}
.v4-toast-message {
  font-size: 12.5px; font-weight: 500;
  color: var(--fg-secondary, var(--neutral-600));
  line-height: 1.45;
  word-break: break-word;
}
.v4-toast-close {
  flex-shrink: 0;
  background: transparent; border: 0;
  width: 22px; height: 22px;
  border-radius: 6px; cursor: pointer;
  color: var(--fg-tertiary, var(--neutral-400));
  font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s ease;
}
.v4-toast-close:hover { background: rgba(0,0,0,0.05); color: var(--fg-primary, var(--neutral-900)); }

@media (max-width: 640px) {
  .v4-toast-container { top: 16px; left: 16px; right: 16px; max-width: none; }
}


/* ════════════════════════════════════════════════════════════════
 * SEOLY EMPTY-STATE (B) — Card mit Mascot + Headline + CTA
 * Verwendung: {include "_partials/seoly_empty_state.tmpl.html" ...}
 * ════════════════════════════════════════════════════════════════ */
.seoly-empty-state {
  display: flex; align-items: center; gap: 22px;
  padding: 32px 36px;
  margin: 24px 0;
  background: linear-gradient(135deg, rgba(143,95,196,0.05), rgba(255,128,0,0.03));
  border: 1px solid rgba(143,95,196,0.18);
  border-radius: 18px;
  position: relative;
}
.seoly-empty-state--warning {
  background: linear-gradient(135deg, rgba(255,128,0,0.08), rgba(255,165,80,0.04));
  border-color: rgba(255,128,0,0.30);
}
.seoly-empty-state--success {
  background: linear-gradient(135deg, rgba(111,177,48,0.08), rgba(143,95,196,0.04));
  border-color: rgba(111,177,48,0.32);
}
.seoly-empty-state--compact {
  padding: 18px 22px;
  gap: 16px;
}

.seoly-empty-mascot {
  position: relative;
  flex-shrink: 0;
  width: 110px; height: 130px;
}
.seoly-empty-state--compact .seoly-empty-mascot { width: 76px; height: 90px; }
.seoly-empty-mascot img {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(143,95,196,0.32));
}
.seoly-empty-mascot-glow {
  position: absolute;
  left: 50%; bottom: 12px;
  transform: translate(-50%, 50%);
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143,95,196,0.55) 0%, rgba(255,128,0,0.20) 45%, transparent 75%);
  filter: blur(16px);
  z-index: 1;
  animation: seolyEmptyGlow 3.2s ease-in-out infinite;
}
.seoly-empty-state--compact .seoly-empty-mascot-glow { width: 90px; height: 90px; filter: blur(12px); }
@keyframes seolyEmptyGlow {
  0%, 100% { opacity: 0.70; transform: translate(-50%, 50%) scale(1);    }
  50%      { opacity: 1.00; transform: translate(-50%, 50%) scale(1.18); }
}

.seoly-empty-content {
  flex: 1; min-width: 0;
}
.seoly-empty-headline {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--fg-primary);
  line-height: 1.3;
}
.seoly-empty-state--compact .seoly-empty-headline { font-size: 15px; }
.seoly-empty-sub {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--fg-secondary);
  line-height: 1.55;
  max-width: 540px;
}
.seoly-empty-state--compact .seoly-empty-sub { font-size: 12.5px; margin-bottom: 10px; }

.seoly-empty-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #8f5fc4, #ff8000);
  color: #fff;
  border: 0; border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(143,95,196,0.32);
  transition: transform .14s ease, box-shadow .14s ease;
}
.seoly-empty-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(143,95,196,0.42);
  color: #fff;
}
.seoly-empty-state--compact .seoly-empty-cta { padding: 7px 14px; font-size: 12px; }

/* Mobile */
@media (max-width: 640px) {
  .seoly-empty-state { flex-direction: column; padding: 22px 18px; text-align: center; }
  .seoly-empty-mascot { width: 90px; height: 110px; }
  .seoly-empty-sub { margin-left: auto; margin-right: auto; }
}


/* ════════════════════════════════════════════════════════════════
 * Seoly Mascot — Shared Components (Pull-Tab + Companion)
 * ────────────────────────────────────────────────────────────────
 * Verwendung:
 *   - {include file="_partials/seoly_pulltab.tmpl.html" fabId="..." onClick="..."}
 *   - {include file="_partials/seoly_companion.tmpl.html"}
 *
 * Class-Layer:
 *   .seoly-pulltab          — Pull-Tab unten mittig (idle peek → hover reveal)
 *   .seoly-companion        — Begleit-Mascot rechts unten neben Modal-Card
 *   .seoly-mascot           — gestapelte <img> Layer (peek/reveal/thinking)
 *
 * Thinking-State:
 *   Modul-Modal kriegt .is-thinking → Companion + Pull-Tab wechseln Pose
 *   Pattern: .fd-chat-modal.is-thinking, .kr-chat-modal.is-thinking, ...
 *
 * @since 2026-06-01
 * ════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
 * SITTING-COMPANION rechts unten (ersetzt Pull-Tab unten-mittig)
 * Default: mascot-sitting (entspannt)
 * Hover/Trigger: mascot-hello (winkend mit offenem Mund)
 * Speech-Bubble: "Hey! Brauchst du Hilfe?" — 3s delay, 4s sichtbar, 1×/session
 * ════════════════════════════════════════════════════════════════ */
.seoly-pulltab {
  /* 2026-06-01 Audit-Fix: defensiv mit !important — verhindert alte CSS-Overrides
   * mit left:-110px aus früheren Pull-Tab-Varianten (FinalDoc-Editor war off-screen). */
  position: fixed !important;
  right: 16px !important;
  bottom: 16px !important;
  left: auto !important;
  transform: none;
  z-index: 950;
  width: 130px;
  height: 150px;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-display);
  -webkit-tap-highlight-color: transparent;
  transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
  overflow: visible;
  isolation: isolate;
}
.seoly-pulltab:hover { transform: translateY(-3px) scale(1.03); }

/* 2026-06-01 Hotfix-2: Override-Regel mit höchster Specificity (ID + Class + body).
 * Es gab eine alte Regel in einer anderen CSS-Datei die left:-116px setzt — diese
 * Selektor-Kombination gewinnt durch Specificity garantiert. Plus für alle bekannten
 * FAB-IDs gleichzeitig (fdChatFab, kfChatFab, krChatFab, etc.). */
body .seoly-pulltab,
body button.seoly-pulltab,
body #fdChatFab.seoly-pulltab,
body #kfChatFab.seoly-pulltab,
body #krChatFab.seoly-pulltab,
body [id$="ChatFab"].seoly-pulltab {
  position: fixed !important;
  right: 16px !important;
  bottom: 16px !important;
  left: auto !important;
  top: auto !important;
}

/* ── Glow-Halo hinter Seoly (radial Lila/Orange) — STÄRKER ─────── */
.seoly-pulltab::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 50%);
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle,
              rgba(143, 95, 196, 0.85) 0%,
              rgba(167, 122, 208, 0.55) 25%,
              rgba(255, 128, 0, 0.35) 50%,
              transparent 75%);
  filter: blur(22px);
  z-index: -1;
  pointer-events: none;
  animation: seolyIdleGlow 3s ease-in-out infinite;
}
@keyframes seolyIdleGlow {
  0%, 100% { opacity: 0.80; transform: translate(-50%, 50%) scale(1);    }
  50%      { opacity: 1.00; transform: translate(-50%, 50%) scale(1.15); }
}
/* Bei Hover → kräftigerer + schnellerer Glow */
.seoly-pulltab:hover::before {
  animation: seolyHoverGlow 1.8s ease-in-out infinite;
}
@keyframes seolyHoverGlow {
  0%, 100% { opacity: 0.95; transform: translate(-50%, 50%) scale(1.10); }
  50%      { opacity: 1.00; transform: translate(-50%, 50%) scale(1.28); }
}
/* Bei AI thinking → urgent Pulse, satter purple */
.seoly-pulltab.is-thinking::before {
  animation: seolyThinkGlow 1.05s ease-in-out infinite;
}
@keyframes seolyThinkGlow {
  0%, 100% { opacity: 0.90; transform: translate(-50%, 50%) scale(1.10); background: radial-gradient(circle, rgba(143, 95, 196, 0.95) 0%, rgba(167, 122, 208, 0.60) 28%, rgba(255, 128, 0, 0.30) 50%, transparent 75%); }
  50%      { opacity: 1.00; transform: translate(-50%, 50%) scale(1.35); background: radial-gradient(circle, rgba(143, 95, 196, 1.00) 0%, rgba(167, 122, 208, 0.75) 30%, rgba(255, 128, 0, 0.45) 52%, transparent 75%); }
}
/* Bei Speech-Bubble (Wave-Trigger) → orange-Burst */
.seoly-pulltab.is-waving::before {
  animation: seolyWaveGlow 0.65s ease-in-out 2;
}
@keyframes seolyWaveGlow {
  0%, 100% { opacity: 0.90; transform: translate(-50%, 50%) scale(1.12); }
  50%      { opacity: 1.00; transform: translate(-50%, 50%) scale(1.38); background: radial-gradient(circle, rgba(255, 128, 0, 0.70) 0%, rgba(255, 165, 80, 0.50) 30%, rgba(143, 95, 196, 0.35) 55%, transparent 75%); }
}

/* Mascot-Container hält die 2 Layer (sitting + hello) übereinander
   Atmet sanft (4.5s Loop) — wirkt lebendig ohne aufdringlich */
.seoly-pulltab-mascot {
  position: relative;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(143, 95, 196, 0.35));
  animation: seolyBreathe 4.5s ease-in-out infinite;
}
@keyframes seolyBreathe {
  0%, 100% { transform: translateY(0)    scale(1);    }
  50%      { transform: translateY(-3px) scale(1.015); }
}
/* Bei Hover/Wave → schnelleres "aufgeregtes" Atmen */
.seoly-pulltab:hover .seoly-pulltab-mascot,
.seoly-pulltab.is-waving .seoly-pulltab-mascot {
  animation: seolyBreatheActive 1.6s ease-in-out infinite;
}
@keyframes seolyBreatheActive {
  0%, 100% { transform: translateY(0)    scale(1);    }
  50%      { transform: translateY(-5px) scale(1.04); }
}

.seoly-mascot {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
/* Default-Sichtbarkeit: sitting */
.seoly-mascot-sitting { opacity: 1; }

/* SVG-Fallback (nur wenn alle PNGs broken) */
.seoly-pulltab-svg-fallback {
  position: absolute;
  right: 0; bottom: 0;
  color: #fff;
  background: linear-gradient(135deg, #8f5fc4, #ff8000);
  width: 56px; height: 56px;
  padding: 14px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(143, 95, 196, 0.45);
  display: none;
}
.seoly-pulltab-mascot:has(.seoly-mascot-sitting[style*="display: none"]) .seoly-pulltab-svg-fallback,
.seoly-pulltab-mascot:has(.seoly-mascot-sitting[style*="display:none"])  .seoly-pulltab-svg-fallback {
  display: block;
}

/* HOVER → switch sitting → hello (smooth crossfade) */
.seoly-pulltab:hover .seoly-mascot-sitting { opacity: 0; }
.seoly-pulltab:hover .seoly-mascot-hello   { opacity: 1; }

/* AI thinking — switch zu thinking-Pose */
.seoly-pulltab.is-thinking .seoly-mascot-sitting,
.seoly-pulltab.is-thinking .seoly-mascot-hello { opacity: 0; }
.seoly-pulltab.is-thinking .seoly-mascot-thinking { opacity: 1; }

/* Auto-Wave-Trigger (z.B. nach Speech-Bubble — JS setzt .is-waving) */
.seoly-pulltab.is-waving .seoly-mascot-sitting { opacity: 0; }
.seoly-pulltab.is-waving .seoly-mascot-hello   { opacity: 1; animation: seolyWiggle 0.6s ease-in-out 2; }
@keyframes seolyWiggle {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-5deg); }
  75%      { transform: rotate(5deg); }
}

/* ── SPEECH-BUBBLE ──────────────────────────────────────── */
.seoly-speech-bubble {
  position: fixed;
  right: 150px;          /* links neben dem sitzenden Mascot */
  bottom: 110px;         /* auf Kopfhöhe (statt Bauchhöhe) */
  z-index: 949;
  max-width: 230px;
  padding: 12px 16px;
  background: #fff;
  color: #4c1d95;
  border: 1px solid rgba(143, 95, 196, 0.30);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(143, 95, 196, 0.28);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.seoly-speech-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
/* Pfeil rechts vom Bubble (zeigt auf Mascot-Kopf) — vertikal mittig zur Bubble */
.seoly-speech-bubble::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  margin-top: -8px;
  width: 16px; height: 16px;
  background: #fff;
  border-right: 1px solid rgba(143, 95, 196, 0.30);
  border-bottom: 1px solid rgba(143, 95, 196, 0.30);
  transform: rotate(-45deg);
}

/* Mobile: Seoly etwas kleiner + Bubble ggf. ausblenden */
@media (max-width: 640px) {
  .seoly-pulltab {
    width: 100px; height: 115px;
    right: 10px; bottom: 10px;
  }
  .seoly-speech-bubble {
    right: 115px;
    bottom: 80px;
    max-width: 180px;
    font-size: 12px;
    padding: 9px 12px;
  }
}


/* ════════════════════════════════════════════════════════════════
 * CHAT-AVATARS — User-Picture + Seoly-Kopf-Crop mit Glow-Animation
 * Funktioniert in allen Chat-Modulen (fd, kr, kf)
 * ════════════════════════════════════════════════════════════════ */
.fd-chat-msg-avatar,
.kr-chat-msg-avatar,
.kf-chat-msg-avatar {
  position: relative;
  overflow: visible;       /* Glow darf rausragen */
  isolation: isolate;
}
/* Avatar-Bilder rund + ganzflächig */
.fd-chat-msg-avatar img,
.kr-chat-msg-avatar img,
.kf-chat-msg-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
/* Seoly-Kopf-Crop: zoomt rein auf den Kopf der mascot-hello.png */
.fd-chat-msg-avatar img.seoly-head-crop,
.kr-chat-msg-avatar img.seoly-head-crop,
.kf-chat-msg-avatar img.seoly-head-crop {
  object-fit: cover;
  object-position: center 12%;
  transform: scale(1.85);
  transform-origin: center 18%;
  background: linear-gradient(135deg, #f3eaff, #ffe6cc);
}
/* User-Avatar (Picture) — Hintergrund neutral falls Bild fehlt */
.fd-chat-msg-user .fd-chat-msg-avatar,
.kr-chat-msg-user .kr-chat-msg-avatar,
.kf-chat-msg-user .kf-chat-msg-avatar {
  background: var(--neutral-100);
  color: var(--neutral-600);
  font-weight: 700;
}
/* AI-Avatar (Seoly-Kopf) — sanfter Glow + Idle-Puls */
.fd-chat-msg-ai .fd-chat-msg-avatar,
.kr-chat-msg-ai .kr-chat-msg-avatar,
.kf-chat-msg-ai .kf-chat-msg-avatar {
  background: linear-gradient(135deg, #8f5fc4, #ff8000);
}
.fd-chat-msg-ai .fd-chat-msg-avatar::before,
.kr-chat-msg-ai .kr-chat-msg-avatar::before,
.kf-chat-msg-ai .kf-chat-msg-avatar::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle,
              rgba(143, 95, 196, 0.55) 0%,
              rgba(255, 128, 0, 0.30) 45%,
              transparent 75%);
  filter: blur(6px);
  z-index: 0;
  animation: seolyAvatarGlow 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes seolyAvatarGlow {
  0%, 100% { opacity: 0.55; transform: scale(1);    }
  50%      { opacity: 0.95; transform: scale(1.15); }
}
/* Während Typing → intensiverer Pulse (existing .is-typing Modifier nutzen falls vorhanden) */
.fd-chat-msg-typing.fd-chat-msg-ai .fd-chat-msg-avatar::before,
.kr-chat-msg-typing.kr-chat-msg-ai .kr-chat-msg-avatar::before,
.kf-chat-msg-typing.kf-chat-msg-ai .kf-chat-msg-avatar::before {
  animation: seolyAvatarGlowFast 1.1s ease-in-out infinite;
}
@keyframes seolyAvatarGlowFast {
  0%, 100% { opacity: 0.75; transform: scale(1.05); }
  50%      { opacity: 1.0;  transform: scale(1.30); }
}


/* ════════════════════════════════════════════════════════════════
 * COMPANION — Begleit-Mascot RECHTS UNTEN neben Modal-Card
 * Pattern: .seoly-companion innerhalb .seoly-modal-stage Container
 * Default: reveal-Pose. Modal kriegt .is-thinking → thinking-Pose.
 * ════════════════════════════════════════════════════════════════ */
.seoly-modal-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* max-width wird pro Modul gesetzt (passt zur jeweiligen Chat-Card-Breite):
     .fd-chat-modal .seoly-modal-stage { max-width: 760px; }
     .kr-chat-modal .seoly-modal-stage { max-width: 720px; } */
  pointer-events: none;
}

.seoly-companion {
  position: absolute;
  right: -150px;
  bottom: 8px;
  width: 200px; height: 260px;
  z-index: 5;
  pointer-events: none;
}
.seoly-companion-halo {
  position: absolute;
  left: 50%; top: 55%;
  transform: translate(-50%, -50%);
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 95, 196, 0.32) 0%, rgba(255, 128, 0, 0.14) 45%, transparent 70%);
  filter: blur(14px);
  z-index: 0;
  animation: seolyCompanionHalo 4s ease-in-out infinite;
}
@keyframes seolyCompanionHalo {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 0.95; transform: translate(-50%, -50%) scale(1.06); }
}

.seoly-companion-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .3s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1);
  filter: drop-shadow(0 10px 22px rgba(143, 95, 196, 0.42));
  z-index: 1;
}
.seoly-companion-reveal { opacity: 1; }

/* AI denkt → Companion thinking pose.
 * Selektor matched alle Module: jedes Modal das .is-thinking trägt
 * UND einen Companion enthält — egal ob fd-chat-modal, kr-chat-modal, etc. */
.is-thinking .seoly-companion-reveal { opacity: 0; }
.is-thinking .seoly-companion-thinking { opacity: 1; }

/* Atem-Animation auf der jeweils sichtbaren Pose */
.seoly-companion-reveal,
.is-thinking .seoly-companion-thinking {
  animation: seolyCompanionBreathe 4.5s ease-in-out infinite;
}
@keyframes seolyCompanionBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-4px) scale(1.02); }
}

/* Wenn Modal offen ist → Pull-Tab fade-out (Seoly ist jetzt drinnen).
 * Pattern: jedes Modul muss .seoly-modal-open auf BODY setzen ODER
 * wir nutzen :has() für moderne Browser. */
body:has(.fd-chat-modal:not([hidden])) .seoly-pulltab,
body:has(.kr-chat-modal:not([hidden])) .seoly-pulltab,
body:has(.kf-chat-modal:not([hidden])) .seoly-pulltab,
body:has(.lc-modal:not([hidden]))     .seoly-pulltab,
body:has(.fd-chat-modal:not([hidden])) .seoly-speech-bubble,
body:has(.kr-chat-modal:not([hidden])) .seoly-speech-bubble,
body:has(.kf-chat-modal:not([hidden])) .seoly-speech-bubble,
body:has(.lc-modal:not([hidden]))     .seoly-speech-bubble {
  opacity: 0;
  pointer-events: none;
}

/* Responsive Companion */
@media (max-width: 1180px) {
  .seoly-companion {
    right: -110px;
    width: 170px; height: 220px;
  }
  .seoly-companion-halo { width: 190px; height: 190px; }
}
@media (max-width: 980px) {
  .seoly-companion { display: none; }
}


/* ════════════════════════════════════════════════════════════════
 * SEOLY CONFIRM-MODAL (Pack 1, 2026-06-01)
 * window.seolyConfirm({pose, title, message, ok, cancel, tone, onOk})
 * ════════════════════════════════════════════════════════════════ */
.seoly-confirm-overlay {
  position: fixed; inset: 0;
  z-index: 10500;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .22s ease;
}
.seoly-confirm-overlay.is-visible { opacity: 1; }

.seoly-confirm-card {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  padding: 26px 28px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28), 0 8px 20px rgba(143,95,196,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: opacity .25s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.seoly-confirm-overlay.is-visible .seoly-confirm-card {
  opacity: 1;
  transform: none;
}

/* Mascot */
.seoly-confirm-mascot {
  position: relative;
  width: 96px; height: 96px;
  margin-bottom: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  animation: seolyConfirmBob 2.4s ease-in-out infinite;
}
.seoly-confirm-mascot img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 4px 10px rgba(143,95,196,0.30));
}
.seoly-confirm-mascot::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143,95,196,0.18) 0%, transparent 70%);
  z-index: -1;
  animation: seolyConfirmGlow 2.6s ease-in-out infinite;
}
@keyframes seolyConfirmBob  { 0%, 100% { transform: translateY(-2px) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
@keyframes seolyConfirmGlow { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.95; } }

/* Tone-Variants: Glow-Color */
.seoly-confirm-overlay--danger  .seoly-confirm-mascot::after { background: radial-gradient(circle, rgba(239,68,68,0.22) 0%, transparent 70%); }
.seoly-confirm-overlay--warning .seoly-confirm-mascot::after { background: radial-gradient(circle, rgba(255,128,0,0.24) 0%, transparent 70%); }
.seoly-confirm-overlay--success .seoly-confirm-mascot::after { background: radial-gradient(circle, rgba(111,177,48,0.22) 0%, transparent 70%); }

/* Body */
.seoly-confirm-body { width: 100%; }
.seoly-confirm-title {
  margin: 0 0 8px;
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--fg-primary, var(--neutral-900));
  line-height: 1.3;
}
.seoly-confirm-message {
  margin: 0 0 8px;
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 13.5px;
  color: var(--fg-secondary, var(--neutral-600));
  line-height: 1.55;
}

/* Buttons */
.seoly-confirm-btns {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}
.seoly-confirm-btn {
  padding: 10px 22px;
  border-radius: 9px;
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .14s ease;
  min-width: 120px;
}
.seoly-confirm-btn--cancel {
  background: #fff;
  color: var(--fg-tertiary, var(--neutral-500));
  border-color: var(--border-default, var(--neutral-150));
}
.seoly-confirm-btn--cancel:hover {
  background: var(--neutral-25);
  color: var(--fg-primary, var(--neutral-900));
  border-color: var(--neutral-200);
}
.seoly-confirm-btn--ok { color: #fff; }
.seoly-confirm-btn--primary { background: linear-gradient(135deg, #8F5FC4, #FF8000); }
.seoly-confirm-btn--danger  { background: linear-gradient(135deg, #ef4444, #dc2626); }
.seoly-confirm-btn--warning { background: linear-gradient(135deg, #FF8000, #f59e0b); }
.seoly-confirm-btn--success { background: linear-gradient(135deg, #6FB130, #16a34a); }
.seoly-confirm-btn--ok:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.18); }

@media (max-width: 480px) {
  .seoly-confirm-card { padding: 22px 20px 18px; }
  .seoly-confirm-mascot { width: 80px; height: 80px; }
  .seoly-confirm-btns { flex-direction: column; }
  .seoly-confirm-btn { width: 100%; }
}


/* ════════════════════════════════════════════════════════════════
 * SEOLY FIELD-TIP (Pack 2, 2026-06-01)
 * Inline-Hinweis bei komplexen Form-Fields — kleiner Mascot mit Speech-Bubble
 * Verwendung: {include file="_partials/seoly_field_tip.tmpl.html" tipText="..." tipPose="pointing"}
 * ════════════════════════════════════════════════════════════════ */
.seoly-field-tip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
}
.seoly-field-tip-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(143,95,196,0.10), rgba(255,128,0,0.06));
  border: 1px solid rgba(143,95,196,0.22);
  cursor: pointer;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all .14s ease;
  flex-shrink: 0;
}
.seoly-field-tip-btn:hover {
  background: linear-gradient(135deg, rgba(143,95,196,0.20), rgba(255,128,0,0.14));
  border-color: #8F5FC4;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(143,95,196,0.20);
}
.seoly-field-tip-btn img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 14%;
  transform: scale(1.55);
  transform-origin: center 22%;
}
.seoly-field-tip-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #fff;
  border: 1px solid rgba(143,95,196,0.22);
  border-radius: 10px;
  padding: 10px 14px 11px;
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--fg-primary, var(--neutral-900));
  width: max-content;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.18);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s ease, transform .18s ease;
  text-align: left;
  white-space: normal;
}
.seoly-field-tip-pop::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: #fff;
  border-top: 1px solid rgba(143,95,196,0.22);
  border-left: 1px solid rgba(143,95,196,0.22);
}
.seoly-field-tip:hover .seoly-field-tip-pop,
.seoly-field-tip-btn:focus + .seoly-field-tip-pop,
.seoly-field-tip.is-open .seoly-field-tip-pop {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.seoly-field-tip-pop strong {
  color: #8F5FC4;
  font-weight: 700;
}


/* ════════════════════════════════════════════════════════════════
 * SEOLY SCORE-REVEAL (Pack 3, 2026-06-01)
 * Hero-Mascot reagiert auf Score mit pose-passendem Tipp
 * Verwendung: {include file="_partials/seoly_score_reveal.tmpl.html" srScore=85}
 * ════════════════════════════════════════════════════════════════ */
.seoly-score-reveal {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(143,95,196,0.07), rgba(255,128,0,0.04));
  border: 1px solid rgba(143,95,196,0.18);
  border-radius: 14px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}
.seoly-score-reveal--celebrate { background: linear-gradient(135deg, rgba(111,177,48,0.10), rgba(34,197,94,0.05)); border-color: rgba(111,177,48,0.28); }
.seoly-score-reveal--good      { background: linear-gradient(135deg, rgba(143,95,196,0.10), rgba(255,128,0,0.06)); border-color: rgba(143,95,196,0.28); }
.seoly-score-reveal--ok        { background: linear-gradient(135deg, rgba(255,128,0,0.10), rgba(245,158,11,0.05)); border-color: rgba(255,128,0,0.28); }
.seoly-score-reveal--low       { background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(220,38,38,0.04)); border-color: rgba(239,68,68,0.24); }

.seoly-score-reveal-mascot {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
  animation: seolyScoreBob 2.6s ease-in-out infinite;
}
.seoly-score-reveal-mascot img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 4px 8px rgba(143,95,196,0.30));
}
.seoly-score-reveal-mascot::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.65) 0%, transparent 65%);
  z-index: -1;
  animation: seolyScoreGlow 2.6s ease-in-out infinite;
}
@keyframes seolyScoreBob  { 0%, 100% { transform: translateY(-2px) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes seolyScoreGlow { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.85; } }

.seoly-score-reveal-body { flex: 1; min-width: 0; }
.seoly-score-reveal-headline {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--fg-primary, var(--neutral-900));
  margin: 0 0 4px;
  line-height: 1.3;
}
.seoly-score-reveal--celebrate .seoly-score-reveal-headline { color: #16a34a; }
.seoly-score-reveal--low .seoly-score-reveal-headline       { color: #ef4444; }

.seoly-score-reveal-tip {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 13px;
  color: var(--fg-secondary, var(--neutral-600));
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .seoly-score-reveal { flex-direction: column; text-align: center; }
}


/* ════════════════════════════════════════════════════════════════
 * SEOLY HINT-BUBBLE (Pack 4, 2026-06-01)
 * Idle-Detection Bubble unten rechts via window.SeolyHints.register()
 * ════════════════════════════════════════════════════════════════ */
.seoly-hint-bubble {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 9800;
  width: min(360px, calc(100vw - 48px));
  background: #fff;
  border: 1px solid rgba(143,95,196,0.22);
  border-left: 4px solid #8F5FC4;
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(15,23,42,0.22), 0 4px 12px rgba(143,95,196,0.18);
  padding: 16px 18px 14px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: auto;
}
.seoly-hint-bubble.is-visible {
  opacity: 1;
  transform: none;
}
.seoly-hint-bubble::after {
  /* kleine Pfeil-Nase unten zum Seoly-FAB hin */
  content: '';
  position: absolute;
  bottom: -8px;
  right: 38px;
  width: 16px; height: 16px;
  background: #fff;
  border-right: 1px solid rgba(143,95,196,0.22);
  border-bottom: 1px solid rgba(143,95,196,0.22);
  transform: rotate(45deg);
}
.seoly-hint-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 22px; height: 22px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--fg-tertiary, var(--neutral-400));
  cursor: pointer;
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .14s ease;
}
.seoly-hint-close:hover { background: rgba(0,0,0,0.06); color: var(--fg-primary, var(--neutral-900)); }

.seoly-hint-mascot {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(143,95,196,0.10), rgba(255,128,0,0.06));
  overflow: hidden;
  animation: seolyHintBob 2.6s ease-in-out infinite;
}
.seoly-hint-mascot img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 2px 4px rgba(143,95,196,0.20));
}
@keyframes seolyHintBob { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(-3px); } }

.seoly-hint-body { min-width: 0; padding-right: 18px; }
.seoly-hint-title {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--fg-primary, var(--neutral-900));
  margin-bottom: 4px;
  line-height: 1.3;
}
.seoly-hint-msg {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 12.5px;
  color: var(--fg-secondary, var(--neutral-600));
  line-height: 1.5;
  word-break: break-word;
}
.seoly-hint-msg strong { color: #8F5FC4; font-weight: 700; }

.seoly-hint-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 7px 13px;
  background: linear-gradient(135deg, #8F5FC4, #FF8000);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all .14s ease;
}
.seoly-hint-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(143,95,196,0.30);
  color: #fff;
}

@media (max-width: 480px) {
  .seoly-hint-bubble { bottom: 78px; right: 12px; }
}
