/**
 * Sven Bot – Frontend-Widget. Selbst-enthalten, keine Theme-Abhängigkeit.
 * Elegantes monochromes Dunkel-Theme, passend zur Moderations-/Kommentations-Marke.
 */
.svbot-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    border: none;
    border-radius: 999px;
    background: #18181a;
    color: #fff;
    font: 600 0.95rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    transition: background 0.15s ease, transform 0.06s ease;
}
.svbot-launcher:hover { background: #000; }
.svbot-launcher:active { transform: translateY(1px); }
.svbot-launcher__ico { font-size: 1.15rem; line-height: 1; }

/* Dezentes Pulsieren (Aufmerksamkeit), stoppt sobald geöffnet. */
.svbot-launcher::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    pointer-events: none;
    animation: svbot-pulse 2.4s ease-out infinite;
}
.svbot-launcher[aria-expanded="true"]::after { animation: none; }
@keyframes svbot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(24, 24, 26, 0.45); }
    70% { box-shadow: 0 0 0 16px rgba(24, 24, 26, 0); }
    100% { box-shadow: 0 0 0 0 rgba(24, 24, 26, 0); }
}

.svbot-panel {
    position: fixed;
    right: 22px;
    bottom: 88px;
    z-index: 99999;
    width: 374px;
    max-width: calc(100vw - 32px);
    height: 544px;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
    font: 0.95rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1d2327;
}
.svbot-panel.is-open { display: flex; }

.svbot-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px;
    background: linear-gradient(135deg, #2a2a2d 0%, #161618 100%);
    color: #fff;
}
.svbot-head__t { flex: 1 1 auto; min-width: 0; }
.svbot-head__title { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; }
.svbot-head__sub { font-size: 0.76rem; opacity: 0.82; letter-spacing: 0.03em; text-transform: uppercase; margin-top: 1px; }
.svbot-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.svbot-close:hover { background: rgba(255, 255, 255, 0.28); }

.svbot-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    background: #f6f6f7;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.svbot-msg { display: flex; }
.svbot-msg--user { justify-content: flex-end; }
.svbot-bubble {
    max-width: 84%;
    padding: 9px 13px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.svbot-msg--bot .svbot-bubble { background: #fff; border: 1px solid #e3e6ea; border-bottom-left-radius: 4px; }
.svbot-msg--user .svbot-bubble { background: #18181a; color: #fff; border-bottom-right-radius: 4px; }

.svbot-sources {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    padding: 8px 10px;
}
.svbot-sources__label { font-size: 0.78rem; font-weight: 700; color: #646970; margin-bottom: 4px; }
.svbot-source {
    display: block;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #1d2327;
}
.svbot-source:hover { background: #f1f1f2; }
.svbot-source__title { display: block; font-weight: 700; color: #18181a; }
.svbot-source__ex { display: block; font-size: 0.82rem; color: #646970; }

.svbot-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.svbot-chip {
    border: 1px solid #d4d4d6;
    background: #fff;
    color: #18181a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}
.svbot-chip:hover { background: #f1f1f2; border-color: #18181a; }

.svbot-typing .svbot-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.svbot-dot { width: 7px; height: 7px; border-radius: 50%; background: #b3b8bf; animation: svbot-blink 1.2s infinite both; }
.svbot-dot:nth-child(2) { animation-delay: 0.2s; }
.svbot-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes svbot-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.svbot-form {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e3e6ea;
    background: #fff;
}
.svbot-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 999px;
    font: inherit;
}
.svbot-input:focus { outline: none; border-color: #18181a; box-shadow: 0 0 0 3px rgba(24, 24, 26, 0.12); }
.svbot-send {
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    background: #18181a;
    color: #fff;
    font: 600 0.9rem/1 system-ui, sans-serif;
    padding: 0 16px;
    cursor: pointer;
}
.svbot-send:hover { background: #000; }

.svbot-hint {
    flex: 0 0 auto;
    padding: 7px 12px 9px;
    font-size: 0.72rem;
    color: #8a8f96;
    background: #fff;
    text-align: center;
    line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
    .svbot-launcher::after { animation: none; }
}

@media (max-width: 480px) {
    .svbot-panel { right: 8px; left: 8px; bottom: 80px; width: auto; height: calc(100vh - 100px); }
    .svbot-launcher { right: 14px; bottom: 14px; }
}

/* Kontakt-Button (CTA) in einer Bot-Antwort */
.svbot-cta-wrap { margin: 2px 0 10px; }
.svbot-cta {
    display: inline-block;
    background: #18181a;
    color: #fff;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s ease, transform 0.06s ease;
}
.svbot-cta:hover { background: #000; transform: translateY(-1px); }
.svbot-cta:active { transform: translateY(0); }
