/* Brutus Flow Studio: Support-Chat. Alle Ecken eckig, Farben aus site.css (mit Rückfallwerten). */
.fs-chat-root, .fs-chat-root * { box-sizing: border-box; border-radius: 0; }
.fs-chat-root {
    --c-bg: var(--ink-2, #0b1028); --c-panel: var(--panel-solid, #10163a); --c-line: var(--line-2, rgba(150, 160, 255, .28));
    --c-fg: var(--fg, #eef0ff); --c-muted: var(--muted, #a3a9cc); --c-acc: var(--glow, #a8d8ff); --c-blue: var(--blue-2, #2438ff);
    position: fixed; z-index: 2147483000; bottom: max(16px, env(safe-area-inset-bottom, 0px));
    right: max(16px, env(safe-area-inset-right, 0px)); left: auto;
    font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--c-fg);
}
html[dir="rtl"] .fs-chat-root, .fs-chat-root[dir="rtl"] {
    right: auto; left: max(16px, env(safe-area-inset-left, 0px)); text-align: right;
}
.fs-chat-fab {
    display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0; padding: 0;
    color: #fff; background: var(--c-blue); border: 1px solid var(--c-acc); cursor: pointer;
    box-shadow: 0 8px 24px -8px rgba(36, 56, 255, .8); font: inherit;
    margin-inline-start: auto;
}
.fs-chat-fab:hover { background: #3a4dff; }
.fs-chat-root.fs-chat-open .fs-chat-fab { display: none; }

.fs-chat-panel {
    position: absolute; bottom: 0; right: 0; width: 380px; max-width: calc(100vw - 32px);
    height: 560px; max-height: calc(100vh - 6rem); display: flex; flex-direction: column;
    background: var(--c-bg); border: 1px solid var(--c-line); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .75);
}
.fs-chat-panel[hidden] { display: none; }
html[dir="rtl"] .fs-chat-panel, .fs-chat-root[dir="rtl"] .fs-chat-panel { right: auto; left: 0; }

.fs-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 10px 14px; background: var(--c-panel); border-bottom: 1px solid var(--c-line); }
.fs-chat-root[dir="rtl"] .fs-chat-head { padding: 10px 14px 10px 8px; }
.fs-chat-title { font-weight: 700; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.fs-chat-close { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: transparent; color: var(--c-fg); border: 1px solid transparent; cursor: pointer; }
.fs-chat-close:hover { border-color: var(--c-line); background: rgba(255, 255, 255, .06); }

.fs-chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.fs-chat-msg { display: flex; max-width: 100%; }
.fs-chat-bubble { max-width: 92%; padding: 9px 12px; overflow-wrap: anywhere; word-break: break-word; border: 1px solid var(--c-line); background: var(--c-panel); }
.fs-chat-user { justify-content: flex-end; }
.fs-chat-user .fs-chat-bubble { background: var(--c-blue); border-color: var(--c-acc); color: #fff; white-space: pre-wrap; }
.fs-chat-note .fs-chat-bubble, .fs-chat-err .fs-chat-bubble { max-width: 100%; }
.fs-chat-note .fs-chat-bubble { background: transparent; color: var(--c-muted); font-size: 13.5px; }
.fs-chat-err .fs-chat-bubble { border-color: #ff8a8a; }
.fs-chat-wait .fs-chat-bubble { color: var(--c-muted); font-style: italic; }
.fs-chat-p { margin: 0 0 8px; }
.fs-chat-srclabel { margin-top: 8px; font-size: 12.5px; color: var(--c-muted); }
.fs-chat-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.fs-chat-link { color: var(--c-acc); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.fs-chat-link:hover { color: #fff; }

.fs-chat-quick { display: flex; flex-direction: column; gap: 8px; }
.fs-chat-qbtn { width: 100%; min-height: 44px; padding: 8px 12px; text-align: start; font: inherit; color: var(--c-fg); background: transparent; border: 1px solid var(--c-line); cursor: pointer; overflow-wrap: anywhere; }
.fs-chat-qbtn:hover { border-color: var(--c-acc); background: rgba(255, 255, 255, .06); }

.fs-chat-form { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--c-line); background: var(--c-panel); }
.fs-chat-input { display: block; width: 100%; min-height: 56px; max-height: 120px; resize: none; padding: 8px 10px; font: inherit; color: var(--c-fg); background: var(--c-bg); border: 1px solid var(--c-line); }
.fs-chat-input::placeholder { color: var(--c-muted); opacity: 1; }
.fs-chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.fs-chat-count { font-size: 12.5px; color: var(--c-muted); min-width: 0; }
.fs-chat-send { flex: none; min-height: 44px; padding: 0 18px; font: inherit; font-weight: 700; color: #fff; background: var(--c-blue); border: 1px solid var(--c-acc); cursor: pointer; }
.fs-chat-send:hover:not(:disabled) { background: #3a4dff; }
.fs-chat-send:disabled { opacity: .55; cursor: not-allowed; }

.fs-chat-root a:focus-visible, .fs-chat-root button:focus-visible, .fs-chat-root textarea:focus-visible, .fs-chat-log:focus-visible {
    outline: 2px solid var(--c-acc); outline-offset: 2px;
}
.fs-chat-fab:focus-visible { outline-color: #fff; }

@media (max-width: 480px) {
    .fs-chat-root { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
    .fs-chat-panel { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; height: 80vh; height: 80dvh; max-height: 80vh; max-height: 80dvh; }
    html[dir="rtl"] .fs-chat-panel, .fs-chat-root[dir="rtl"] .fs-chat-panel { left: 16px; right: 16px; }
    .fs-chat-fab { position: absolute; bottom: 0; right: 0; margin: 0; }
    html[dir="rtl"] .fs-chat-fab, .fs-chat-root[dir="rtl"] .fs-chat-fab { right: auto; left: 0; }
    .fs-chat-root { height: 48px; pointer-events: none; }
    .fs-chat-root > * { pointer-events: auto; }
    .fs-chat-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .fs-chat-root * { animation: none !important; transition: none !important; } }
