/* ======================================================================
   AMIS CHAT – Version 9.1 – Ultra Stable Edition – WHATSAPP STYLE
   Layout für:
   - Launcher (Floating Bubble)
   - Chat-Fenster (WhatsApp-ähnlich)
   - Dark Mode
   - Bubbles Amis/User
   ====================================================================== */

/* ----------------------------------------------------------
   GLOBAL RESET & BASE
---------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.amis-chat-root,
.amis-chat-root * {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ----------------------------------------------------------
   LAUNCHER (Floating Bubble)
---------------------------------------------------------- */

.amis-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #13a67a;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.amis-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
    background: #10b287;
}

.amis-launcher-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.amis-launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff5252;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ----------------------------------------------------------
   CHAT ROOT & WINDOW
---------------------------------------------------------- */

.amis-chat-root {
    position: fixed;
    bottom: 96px;
    right: 16px;
    width: 360px;
    max-width: calc(100% - 32px);
    z-index: 9999;
    display: none;
    pointer-events: none; /* nur Window selbst klickbar */
}

.amis-chat-root.open {
    display: block;
    pointer-events: auto;
}

.amis-chat-window {
    display: flex;
    flex-direction: column;
    height: 480px;
    max-height: calc(100vh - 120px);
    border-radius: 20px;
    background: #f0f2f5;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

/* ----------------------------------------------------------
   HEADER
---------------------------------------------------------- */

.amis-chat-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #075e54;
    color: #e8f8f5;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.amis-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.amis-header-titles {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.amis-header-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amis-header-status {
    font-size: 12px;
    opacity: 0.9;
}

.amis-dark-toggle {
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 999px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.amis-dark-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

/* ----------------------------------------------------------
   MESSAGES AREA
---------------------------------------------------------- */

.amis-chat-messages {
    flex: 1;
    background: #e5ddd5;
    padding: 10px 8px 12px;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

/* Scrollbar dezent */
.amis-chat-messages::-webkit-scrollbar {
    width: 6px;
}
.amis-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
}
.amis-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

/* ----------------------------------------------------------
   BUBBLES WRAPPER
---------------------------------------------------------- */

.amis-bubble-wrap {
    display: flex;
    margin: 4px 0;
}

.amis-bubble-wrap.user {
    justify-content: flex-end;
}

.amis-bubble-wrap.amis {
    justify-content: flex-start;
}

/* Avatar in Amis-Bubble */
.amis-bubble-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    align-self: flex-end;
}

/* ----------------------------------------------------------
   BUBBLES
---------------------------------------------------------- */

.amis-bubble {
    max-width: 78%;
    padding: 8px 10px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

/* Amis-Bubble (links, grau) */
.amis-bubble.amis {
    background: #ffffff;
    color: #1e1e1e;
    border-bottom-left-radius: 4px;
}

/* User-Bubble (rechts, grünlich) */
.amis-bubble.user {
    background: #d3f8c6;
    color: #1e1e1e;
    border-bottom-right-radius: 4px;
}

/* ----------------------------------------------------------
   INPUTBAR
---------------------------------------------------------- */

.amis-chat-inputbar {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f0f2f5;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#amisInput {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    padding: 7px 12px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    color: #1e1e1e;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

#amisInput:focus {
    border-color: #13a67a;
    box-shadow: 0 0 0 2px rgba(19, 166, 122, 0.25);
}

/* Send Button */
#amisSend {
    margin-left: 6px;
    border-radius: 999px;
    border: none;
    background: #13a67a;
    color: #ffffff;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

#amisSend:hover {
    background: #10b287;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

#amisSend:active {
    transform: translateY(1px);
}

/* Tastatur-Fokus sichtbar machen */
#amisSend:focus-visible,
#amisInput:focus-visible,
.amis-dark-toggle:focus-visible {
    outline: 2px solid #13a67a;
    outline-offset: 2px;
}

/* ----------------------------------------------------------
   DARK MODE
---------------------------------------------------------- */

.amis-chat-root.dark .amis-chat-window {
    background: #111b21;
}

.amis-chat-root.dark .amis-chat-header {
    background: #202c33;
    color: #e9edef;
}

.amis-chat-root.dark .amis-chat-messages {
    background: #0b141a;
}

.amis-chat-root.dark .amis-bubble.amis {
    background: #202c33;
    color: #e9edef;
}

.amis-chat-root.dark .amis-bubble.user {
    background: #005c4b;
    color: #e9edef;
}

.amis-chat-root.dark .amis-chat-inputbar {
    background: #202c33;
}

.amis-chat-root.dark #amisInput {
    background: #111b21;
    color: #e9edef;
    border-color: rgba(255, 255, 255, 0.2);
}

.amis-chat-root.dark #amisInput::placeholder {
    color: rgba(233, 237, 239, 0.6);
}

.amis-chat-root.dark #amisSend {
    background: #00a884;
}

.amis-chat-root.dark #amisSend:hover {
    background: #02c39a;
}

/* ----------------------------------------------------------
   RESPONSIVE (Kleine Screens / Handy)
---------------------------------------------------------- */

@media (max-width: 480px) {
    .amis-chat-root {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
    }

    .amis-chat-window {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .amis-launcher {
        bottom: 16px;
        right: 16px;
    }
}

/* ----------------------------------------------------------
   OPTIONAL: leichte „shake“ Animation bei Badge (z. B. später)
---------------------------------------------------------- */
/*
@keyframes amis-badge-pop {
    0% { transform: scale(0.7); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.amis-launcher-badge {
    animation: amis-badge-pop 0.18s ease-out;
}
*/
.amis-mode-select {
    margin-left: 8px;
    font-size: 11px;
    background: transparent;
    color: inherit;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    padding: 2px 6px;
}
.amis-chat-root.dark .amis-mode-select {
    border-color: rgba(255,255,255,0.25);
}

/* =========================================================
   FIX: Lesbarkeit Modus-Dropdown (Select + Options)
   ========================================================= */

.amis-mode-select {
    color: #ffffff;
    background-color: transparent;
}

.amis-mode-select option {
    color: #1e1e1e;
    background-color: #ffffff;
}

/* Dark Mode – konsistent */
.amis-chat-root.dark .amis-mode-select option {
    color: #1e1e1e;
    background-color: #f0f2f5;
}
/* =========================================================
   HEADER – Modus-Select & Toggle Feinschliff
   ========================================================= */

/* ---------- Modus-Select Grundstil ---------- */
.amis-mode-select {
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 999px;
    background-color: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.35);
}

/* ---------- Dropdown-Optionen lesbar ---------- */
.amis-mode-select option {
    background-color: #ffffff;
    color: #1e1e1e;
}

/* Hover / aktiv – klarer Kontrast */
.amis-mode-select option:hover,
.amis-mode-select option:checked {
    background-color: #13a67a;
    color: #ffffff;
}

/* Dark Mode – Dropdown ruhig halten */
.amis-chat-root.dark .amis-mode-select option {
    background-color: #f0f2f5;
    color: #1e1e1e;
}

.amis-chat-root.dark .amis-mode-select option:hover,
.amis-chat-root.dark .amis-mode-select option:checked {
    background-color: #00a884;
    color: #ffffff;
}

/* ---------- Header-Layout entspannen ---------- */
.amis-chat-header {
    gap: 6px;
}

/* Dark/Light Toggle leicht absetzen */
.amis-dark-toggle {
    margin-left: 6px;
}

/* Status nicht mit Select kollidieren lassen */
.amis-header-status {
    line-height: 1.2;
}
/* =========================================================
   HEADER-FIX: Status ("aktiv…") weiter nach links / mehr Raum
   ========================================================= */

/* Titel/Status bekommt garantierten Platz und darf nicht kollidieren */
.amis-header-titles{
    flex: 1;
    min-width: 0;
    margin-right: 10px; /* schafft Abstand zum Toggle/Select */
}

/* Status etwas kompakter und klar links im Block */
.amis-header-status{
    margin-top: 1px;
    padding-right: 6px; /* kleine Luft, falls Text länger wird */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* =========================================================
   HEADER – Beziehungs- & Kontext-Aufteilung (Empfohlen)
   ========================================================= */

/* Titel + Status + Modus vertikal strukturieren */
.amis-header-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Status klar, ruhig */
.amis-header-status {
    font-size: 12px;
    opacity: 0.85;
}

/* Modus als Kontext, nicht als Technik */
.amis-mode-select {
    align-self: flex-start;
    margin: 2px 0 0 0;
    padding: 2px 8px;
    font-size: 11px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: #ffffff;
}

/* Dark Mode konsistent */
.amis-chat-root.dark .amis-mode-select {
    border-color: rgba(255,255,255,0.2);
}
/* =========================================================
   FIX: Option-Text teilweise zu hell (Browser-Default override)
   ========================================================= */

.amis-mode-select option {
    color: #111 !important;
    background-color: #fff !important;
}

/* Hover + aktiv ausgewählt */
.amis-mode-select option:hover,
.amis-mode-select option:checked {
    color: #fff !important;
    background-color: #13a67a !important;
}

/* Dark Mode – Dropdown bleibt hell (bessere Lesbarkeit) */
.amis-chat-root.dark .amis-mode-select option {
    color: #111 !important;
    background-color: #f0f2f5 !important;
}

.amis-chat-root.dark .amis-mode-select option:hover,
.amis-chat-root.dark .amis-mode-select option:checked {
    color: #fff !important;
    background-color: #00a884 !important;
}
/* =========================================================
   CUSTOM MODE DROPDOWN – PROFESSIONELL & RUHIG
   ========================================================= */

.amis-mode-button {
    margin-top: 2px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.35);
    cursor: pointer;
    text-align: left;
}

.amis-mode-button:hover {
    background: rgba(255,255,255,0.22);
}

/* Dropdown-Container */
.amis-mode-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 240px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.25);
    display: none;
    overflow: hidden;
    z-index: 10000;
}

/* geöffnet */
.amis-mode-dropdown.open {
    display: block;
}

/* einzelne Einträge */
.amis-mode-item {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #1e1e1e;
    background: #ffffff;
}

.amis-mode-item:hover {
    background: #e8f6f1;
}

.amis-mode-item.active {
    background: #13a67a;
    color: #ffffff;
    font-weight: 600;
}

/* Dark Mode */
.amis-chat-root.dark .amis-mode-dropdown {
    background: #202c33;
}

.amis-chat-root.dark .amis-mode-item {
    background: #202c33;
    color: #e9edef;
}

.amis-chat-root.dark .amis-mode-item:hover {
    background: #2a3942;
}

.amis-chat-root.dark .amis-mode-item.active {
    background: #00a884;
    color: #ffffff;
}
/* ======================================================================
   AMIS – FINAL MODE UI (SENIOR CLEANUP)
   Ein aktives Modus-System, alles andere visuell neutralisiert
   ====================================================================== */

/* ----------------------------------------------------------
   1) ALTE / KONKURRIERENDE MODUS-UI STILLLEGEN
---------------------------------------------------------- */

.amis-mode-select,
.amis-mode-button,
.amis-mode-dropdown,
.amis-mode-item,
.amis-mode-toggle {
    display: none !important;
}

/* ----------------------------------------------------------
   2) AKTIVES SYSTEM: SEGMENTED MODE SWITCH
---------------------------------------------------------- */

.amis-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;

    margin-left: 8px;
    padding: 2px;

    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

/* Grundzustand: sehr ruhig */
.amis-mode-btn {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;

    padding: 4px 10px;
    border-radius: 999px;

    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;

    color: rgba(255, 255, 255, 0.75);

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

/* Aktiver Modus: leicht, würdevoll */
.amis-mode-btn.is-active {
    background: rgba(255, 255, 255, 0.9);
    color: #075e54; /* Header-Grün */
    font-weight: 600;
}

/* Hover nur minimal, kein „Button-Gefühl“ */
.amis-mode-btn:hover {
    color: #ffffff;
}

/* Fokus: klar, aber nicht aggressiv */
.amis-mode-btn:focus {
    outline: none;
}

.amis-mode-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

/* ----------------------------------------------------------
   3) DARK MODE – konsistent, ruhig
---------------------------------------------------------- */

.amis-chat-root.dark .amis-mode-switch {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.amis-chat-root.dark .amis-mode-btn {
    color: rgba(233, 237, 239, 0.7);
}

.amis-chat-root.dark .amis-mode-btn.is-active {
    background: rgba(255, 255, 255, 0.85);
    color: #202c33;
}

/* ----------------------------------------------------------
   4) MOBILE: noch zurückhaltender
---------------------------------------------------------- */

@media (max-width: 420px) {
    .amis-mode-btn {
        font-size: 11px;
        padding: 4px 8px;
    }

    .amis-mode-switch {
        padding: 2px;
    }
}
/* ======================================================================
   AMIS CHAT – SENIOR OPTIMIZATION PASS
   1) Chat-Bubbles (Lesbarkeit & Ruhe)
   2) Input-Feld (Motorik & Sicherheit)
   3) Header (Orientierung & Atem)
   ====================================================================== */


/* ======================================================================
   1) CHAT-BUBBLES – TYPOGRAFIE & RHYTHMUS
   ====================================================================== */

/* Grundtext – größer, ruhiger, weniger Enge */
.amis-message,
.amis-message p {
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: 0.1px;
    color: #1f2a2e;
}

/* Amis-Bubble */
.amis-message.amis {
    background: #ffffff;
    border-radius: 18px 18px 18px 6px;
    padding: 14px 16px;
    max-width: 78%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* User-Bubble */
.amis-message.user {
    background: #e6f4f1;
    border-radius: 18px 18px 6px 18px;
    padding: 14px 16px;
    max-width: 78%;
}

/* Abstand zwischen Nachrichten – mehr Atem */
.amis-message + .amis-message {
    margin-top: 10px;
}

/* Absätze in Amis-Nachrichten */
.amis-message.amis p + p {
    margin-top: 10px;
}

/* Dark Mode – Kontrast bleibt ruhig */
.amis-chat-root.dark .amis-message.amis {
    background: #1f2a2e;
    color: #e9edef;
}

.amis-chat-root.dark .amis-message.user {
    background: #2a3a3f;
    color: #e9edef;
}


/* ======================================================================
   2) INPUT-FELD – SENIOR-TOUCH & SICHERHEIT
   ====================================================================== */

.amis-input-area {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* Textfeld */
.amis-input {
    font-size: 16px;
    line-height: 1.4;

    padding: 14px 16px;
    border-radius: 999px;

    border: 1px solid rgba(0,0,0,0.18);
    outline: none;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Fokus: klar, aber nicht aggressiv */
.amis-input:focus {
    border-color: #0b5f55;
    box-shadow: 0 0 0 3px rgba(11,95,85,0.18);
}

/* Placeholder – gut lesbar */
.amis-input::placeholder {
    color: rgba(0,0,0,0.45);
}

/* Senden-Button – groß genug für sichere Motorik */
.amis-send-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;

    background: #0b5f55;
    color: #ffffff;

    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Hover & Active minimal */
.amis-send-btn:hover {
    background: #0a564d;
}

.amis-send-btn:active {
    transform: scale(0.96);
}


/* ======================================================================
   3) HEADER – ORIENTIERUNG & RUHE
   ====================================================================== */

.amis-chat-header {
    min-height: 56px;
    padding: 10px 14px;

    display: flex;
    align-items: center;
    gap: 10px;
}

/* Titel */
.amis-header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Status / Modus-Text */
.amis-header-status {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.85;
}

/* Modus-Switch nicht dominant */
.amis-mode-switch {
    margin-left: auto;
}

/* Dark Mode Header */
.amis-chat-root.dark .amis-chat-header {
    background: #202c33;
}

/* Mobile – alles etwas luftiger */
@media (max-width: 420px) {
    .amis-message,
    .amis-message p {
        font-size: 15px;
    }

    .amis-input {
        font-size: 15px;
    }

    .amis-chat-header {
        min-height: 60px;
    }
}
/* ======================================================================
   AMIS CHAT – ACCESSIBILITY & SENIOR ENHANCEMENT PASS (FINAL)
   - Kontrast-Feinjustierung (Sehschwäche)
   - Zoom-Stufen 125 % / 150 %
   - Nachtmodus-Lesbarkeit
   - Launcher-Position & Größe
   ====================================================================== */


/* ======================================================================
   1) KONTRAST-FEINJUSTIERUNG (SEHSCHWÄCHE)
   ====================================================================== */

/* Grundtext: höherer Kontrast */
.amis-message,
.amis-message p {
    color: #152024; /* dunkler als zuvor */
}

/* User-Bubble klarer */
.amis-message.user {
    background: #dff1ed;
}

/* Trennlinien klarer sichtbar */
.amis-input-area {
    border-top: 1px solid rgba(0,0,0,0.12);
}

/* Placeholder deutlicher */
.amis-input::placeholder {
    color: rgba(0,0,0,0.55);
}

/* Fokus-Rahmen stärker sichtbar */
.amis-input:focus {
    box-shadow: 0 0 0 3px rgba(11,95,85,0.28);
}


/* ======================================================================
   2) ZOOM-STUFEN (125 % / 150 %)
   Umsetzung über CSS-Variablen – zukunftssicher
   ====================================================================== */

:root {
    --amis-zoom: 1;
}

/* optionale Klassen am <body> oder .amis-chat-root */
.amis-zoom-125 {
    --amis-zoom: 1.25;
}

.amis-zoom-150 {
    --amis-zoom: 1.5;
}

/* Skalierung zentral anwenden */
.amis-chat-root {
    font-size: calc(16px * var(--amis-zoom));
}

/* Header & Input konsistent mitskalieren */
.amis-chat-header,
.amis-input,
.amis-message {
    font-size: inherit;
}

/* Buttons mitziehen */
.amis-send-btn,
.amis-mode-btn {
    transform: scale(var(--amis-zoom));
    transform-origin: center;
}


/* ======================================================================
   3) NACHTMODUS – LESEBARKEIT & KONTRAST
   ====================================================================== */

.amis-chat-root.dark {
    background: #111b21;
}

/* Amis-Bubble */
.amis-chat-root.dark .amis-message.amis {
    background: #1e2a30;
    color: #f1f4f6;
    box-shadow: none;
}

/* User-Bubble */
.amis-chat-root.dark .amis-message.user {
    background: #2b3d44;
    color: #f1f4f6;
}

/* Input */
.amis-chat-root.dark .amis-input {
    background: #1e2a30;
    color: #f1f4f6;
    border-color: rgba(255,255,255,0.25);
}

/* Placeholder im Dark Mode */
.amis-chat-root.dark .amis-input::placeholder {
    color: rgba(255,255,255,0.6);
}

/* Fokus im Dark Mode */
.amis-chat-root.dark .amis-input:focus {
    box-shadow: 0 0 0 3px rgba(120,200,190,0.35);
}


/* ======================================================================
   4) LAUNCHER – POSITION & GRÖSSE (SENIOR-TAUGLICH)
   ====================================================================== */

/* Launcher-Button */
.amis-launcher {
    width: 64px;
    height: 64px;

    bottom: 24px;
    right: 24px;

    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Icon im Launcher */
.amis-launcher img,
.amis-launcher svg {
    width: 36px;
    height: 36px;
}

/* Hover ruhig */
.amis-launcher:hover {
    transform: none;
}

/* Mobile: noch etwas größer & höher */
@media (max-width: 420px) {
    .amis-launcher {
        width: 68px;
        height: 68px;
        bottom: 28px;
        right: 18px;
    }
}
/* ======================================================================
   AMIS CHAT – PRINT / PDF READABILITY (WCAG-SAFE)
   ====================================================================== */

@media print {

  /* Hintergrund & Farben neutralisieren */
  body,
  .amis-chat-root {
      background: #ffffff !important;
      color: #000000 !important;
  }

  /* Header vereinfacht */
  .amis-chat-header {
      background: #ffffff !important;
      color: #000000 !important;
      border-bottom: 1px solid #000000;
  }

  /* Modus-Switch & Launcher ausblenden */
  .amis-mode-switch,
  .amis-launcher,
  .amis-send-btn,
  .amis-input-area {
      display: none !important;
  }

  /* Nachrichten als klare Textblöcke */
  .amis-message {
      background: #ffffff !important;
      color: #000000 !important;
      box-shadow: none !important;
      border: 1px solid #000000;
      page-break-inside: avoid;
  }

  .amis-message + .amis-message {
      margin-top: 12px;
  }

  /* Schrift minimal größer für Druck */
  .amis-message,
  .amis-message p {
      font-size: 14pt;
      line-height: 1.5;
  }
}
/* ======================================================================
   AMIS CHAT – EYE FATIGUE REDUCTION (LONG USE)
   ====================================================================== */

/* Leicht gebrochener Hintergrund statt Reinweiß */
.amis-chat-root {
    background: #f5f7f6;
}

/* Maximale Zeilenlänge begrenzen */
.amis-message {
    max-width: 72ch;
}

/* Keine unnötigen Animationen */
* {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.12s;
}

/* Dark Mode: weniger Blauanteil (Augenfreundlicher) */
.amis-chat-root.dark {
    background: #0f171c;
}

/* Cursor & Caret gut sichtbar */
.amis-input {
    caret-color: #0b5f55;
}
/* =========================================================
   HIGH CONTRAST MODE – WCAG SAFE
   ========================================================= */

.amis-high-contrast {
    --amis-bg: #ffffff;
    --amis-text: #000000;
    --amis-accent: #000000;
}

.amis-high-contrast .amis-chat-root {
    background: var(--amis-bg);
}

.amis-high-contrast .amis-message,
.amis-high-contrast .amis-message p {
    color: var(--amis-text);
}

.amis-high-contrast .amis-message.amis,
.amis-high-contrast .amis-message.user {
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: none;
}

.amis-high-contrast .amis-input {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

.amis-high-contrast .amis-input::placeholder {
    color: #333333;
}

.amis-high-contrast .amis-header-title,
.amis-high-contrast .amis-header-status {
    color: #000000;
}
/* =========================================================
   SENIOR PRESET – ALL IN ONE
   ========================================================= */

.amis-senior-preset {
    --amis-zoom: 1.5;
}

.amis-senior-preset {
    animation: none !important;
}

.amis-senior-preset * {
    transition: none !important;
}
/* ======================================================================
   AMIS CHAT – FINAL CSS
   WCAG-AA · Senior UX · Care-Ready · Freeze Candidate
   ====================================================================== */


/* ======================================================================
   ROOT & ZOOM SYSTEM
   ====================================================================== */

:root {
    --amis-zoom: 1;
    --amis-bg-light: #f5f7f6;
    --amis-bg-dark: #0f171c;
    --amis-text-dark: #152024;
    --amis-text-light: #f1f4f6;
    --amis-accent: #0b5f55;
}

/* Zoom Presets */
.amis-zoom-125 { --amis-zoom: 1.25; }
.amis-zoom-150 { --amis-zoom: 1.5; }


/* ======================================================================
   GLOBAL BASE
   ====================================================================== */

.amis-chat-root {
    background: var(--amis-bg-light);
    font-size: calc(16px * var(--amis-zoom));
    color: var(--amis-text-dark);
}

.amis-chat-root.dark {
    background: var(--amis-bg-dark);
    color: var(--amis-text-light);
}


/* ======================================================================
   HEADER (ORIENTATION & CALM)
   ====================================================================== */

.amis-chat-header {
    min-height: 56px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.amis-chat-root.dark .amis-chat-header {
    border-bottom-color: rgba(255,255,255,.18);
}

.amis-header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .2px;
}

.amis-header-status {
    font-size: 13px;
    opacity: .85;
}


/* ======================================================================
   MODE SWITCH – SINGLE SOURCE OF TRUTH
   ====================================================================== */

/* Alte Systeme stilllegen */
.amis-mode-select,
.amis-mode-button,
.amis-mode-dropdown,
.amis-mode-item,
.amis-mode-toggle {
    display: none !important;
}

/* Aktives System */
.amis-mode-switch {
    margin-left: auto;
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
}

.amis-mode-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,.75);
}

.amis-mode-btn.is-active {
    background: rgba(255,255,255,.9);
    color: var(--amis-accent);
    font-weight: 600;
}

.amis-chat-root.dark .amis-mode-btn {
    color: rgba(233,237,239,.7);
}

.amis-chat-root.dark .amis-mode-btn.is-active {
    background: rgba(255,255,255,.85);
    color: #202c33;
}

/* High Contrast Modus */
.amis-high-contrast .amis-mode-btn.is-active {
    background: #000;
    color: #fff;
}


/* ======================================================================
   CHAT BUBBLES – TYPOGRAPHY & RHYTHM
   ====================================================================== */

.amis-message,
.amis-message p {
    font-size: 1em;
    line-height: 1.55;
    letter-spacing: .1px;
    color: var(--amis-text-dark);
    max-width: 72ch;
}

.amis-message.amis {
    background: #ffffff;
    border-radius: 18px 18px 18px 6px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.amis-message.user {
    background: #dff1ed;
    border-radius: 18px 18px 6px 18px;
    padding: 14px 16px;
}

.amis-message + .amis-message {
    margin-top: 10px;
}

.amis-message.amis p + p {
    margin-top: 10px;
}

/* Dark Mode Bubbles */
.amis-chat-root.dark .amis-message.amis {
    background: #1e2a30;
    color: var(--amis-text-light);
    box-shadow: none;
}

.amis-chat-root.dark .amis-message.user {
    background: #2b3d44;
    color: var(--amis-text-light);
}


/* ======================================================================
   INPUT AREA – MOTORIC SAFE
   ====================================================================== */

.amis-input-area {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid rgba(0,0,0,.12);
}

.amis-input {
    font-size: 1em;
    padding: 14px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.18);
    outline: none;
    caret-color: var(--amis-accent);
}

.amis-input:focus {
    border-color: var(--amis-accent);
    box-shadow: 0 0 0 3px rgba(11,95,85,.28);
}

.amis-input::placeholder {
    color: rgba(0,0,0,.55);
}

/* Dark Mode Input */
.amis-chat-root.dark .amis-input {
    background: #1e2a30;
    color: var(--amis-text-light);
    border-color: rgba(255,255,255,.25);
}

.amis-chat-root.dark .amis-input::placeholder {
    color: rgba(255,255,255,.6);
}

/* Send Button – no transform scaling (WCAG-safe) */
.amis-send-btn {
    min-width: calc(44px * var(--amis-zoom));
    min-height: calc(44px * var(--amis-zoom));
    border-radius: 50%;
    background: var(--amis-accent);
    color: #fff;
}


/* ======================================================================
   LAUNCHER – SENIOR FRIENDLY
   ====================================================================== */

.amis-launcher {
    width: 64px;
    height: 64px;
    bottom: 24px;
    right: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

.amis-launcher img,
.amis-launcher svg {
    width: 36px;
    height: 36px;
}


/* ======================================================================
   HIGH CONTRAST MODE – WCAG MAX
   ====================================================================== */

.amis-high-contrast .amis-chat-root,
.amis-high-contrast .amis-message,
.amis-high-contrast .amis-input {
    background: #ffffff !important;
    color: #000000 !important;
}

.amis-high-contrast .amis-message {
    border: 2px solid #000000;
    box-shadow: none;
}

.amis-high-contrast .amis-input {
    border: 2px solid #000000;
}

.amis-high-contrast .amis-chat-header {
    border-bottom: 2px solid #000000;
}


/* ======================================================================
   SENIOR PRESET – ALL IN ONE
   ====================================================================== */

.amis-senior-preset {
    --amis-zoom: 1.5;
}

.amis-senior-preset *,
.amis-senior-preset *::before,
.amis-senior-preset *::after {
    animation: none !important;
    transition: none !important;
}


/* ======================================================================
   PRINT / PDF OUTPUT
   ====================================================================== */

@media print {
    body,
    .amis-chat-root {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .amis-chat-header,
    .amis-mode-switch,
    .amis-launcher,
    .amis-input-area {
        display: none !important;
    }

    .amis-message {
        border: 1px solid #000000;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .amis-message,
    .amis-message p {
        font-size: 14pt;
        line-height: 1.5;
    }
}


/* ======================================================================
   MOBILE TUNING
   ====================================================================== */

@media (max-width: 420px) {
    .amis-chat-header { min-height: 60px; }
    .amis-launcher {
        width: 68px;
        height: 68px;
        bottom: 28px;
        right: 18px;
    }
}
/* ======================================================================
   HEADER TEXT FINAL: "Amis" + "aktiv" (no truncation, no extra labels)
   ====================================================================== */

/* Titel/Status klar erzwingen */
.amis-header-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

/* Falls irgendwo "Chat mit ..." gesetzt wird, nur visuell auf "Amis" reduzieren:
   Wir überschreiben die Anzeige nicht per JS, sondern verstecken nur zu lange Varianten
   und lassen Raum. */
.amis-header-title {
    max-width: none;
}

/* Status: immer "aktiv" wirken, ohne abgeschnittene Zusatztexte */
.amis-header-status {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

/* Wenn dein System zusätzlich Mode-Label in headerStatus schreibt (Begleitung · ...),
   dann verstecken wir es NICHT global (weil A.updateHeaderMode nutzt),
   sondern geben dir eine saubere, feste Header-Zeile:
   -> Wir nutzen pseudo content NUR als visuelle Fixierung auf "aktiv".
   -> Das echte TextContent darf weiter existieren, wird aber nicht angezeigt. */
.amis-header-status {
    position: relative;
    color: transparent; /* vorhandenen Text unsichtbar */
}

.amis-header-status::before {
    content: "aktiv";
    color: rgba(255,255,255,0.92);
}

/* Dark Mode: gleich */
.amis-chat-root.dark .amis-header-status::before {
    color: rgba(233,237,239,0.9);
}
/* ======================================================================
   HEADER FINAL CLEANUP
   Ziel: "Amis" + "aktiv" klar, ohne CSS-Hacks
   ====================================================================== */

/* Sicherstellen: Titel & Status normal sichtbar */
.amis-header-title {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

/* Status sauber und echt (kein ::before / kein transparent) */
.amis-header-status {
    color: rgba(255,255,255,0.92);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

/* Dark Mode Status */
.amis-chat-root.dark .amis-header-status {
    color: rgba(233,237,239,0.9);
}

/* Falls irgendwo noch alte Overlays existieren: neutralisieren */
.amis-header-status::before,
.amis-header-status::after {
    content: none !important;
}

/* Optionales Mode-Label im Header (falls vorhanden) – standardmäßig aus */
.amis-header-mode {
    display: none;
}
/* Header-Status: "online" ruhig & vertraut */
.amis-header-status {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.1px;
}
/* ============================================================================
   VISUAL PATCH 4 – Launcher / Avatar Präsenz / UX-Fokus
============================================================================ */

.amis-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 64px;
  height: 64px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.amis-launcher:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: scale(1.05);
}

.amis-launcher img {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
}

/* Tooltip bei Hover */
.amis-launcher::after {
  content: "Sprich mit mir";
  position: absolute;
  bottom: 80px;
  right: 0;
  background: #444;
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.amis-launcher:hover::after {
  opacity: 1;
}

/* Mobile – kleinere Launcher-Größe */
@media (max-width: 600px) {
  .amis-launcher {
    width: 52px;
    height: 52px;
    bottom: 18px;
    right: 18px;
  }

  .amis-launcher::after {
    font-size: 12px;
    bottom: 70px;
  }
}
/* ============================================================================
   CHAT.CSS · Finaler Visual Patch · Launcher, UI, Responsive, Input
============================================================================ */

/* -----------------------------
   Launcher-Button (unten rechts)
------------------------------ */
.amis-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 64px;
  height: 64px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.amis-launcher:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transform: scale(1.05);
}

.amis-launcher img {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
}

/* Tooltip beim Hover */
.amis-launcher::after {
  content: "Sprich mit mir";
  position: absolute;
  bottom: 80px;
  right: 0;
  background: #444;
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.amis-launcher:hover::after {
  opacity: 1;
}

/* -----------------------------
   Chatfenster (Container)
------------------------------ */
.amis-chat-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 360px;
  max-height: 70vh;
  background: #fefefe;
  border: 1px solid #ccc;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
}

@media (max-width: 600px) {
  .amis-chat-container {
    width: 92%;
    right: 4%;
    bottom: 80px;
  }
}

/* -----------------------------
   Nachrichtenbereich (scrollbar)
------------------------------ */
.amis-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #222;
}

.amis-chat-message {
  margin-bottom: 12px;
  word-break: break-word;
}

.amis-chat-message.bot {
  text-align: left;
  background: #f3f3f3;
  border-radius: 10px;
  padding: 8px 12px;
}

.amis-chat-message.user {
  text-align: right;
  background: #dceeff;
  border-radius: 10px;
  padding: 8px 12px;
}

/* -----------------------------
   Eingabefeld
------------------------------ */
.amis-chat-input {
  padding: 12px;
  border-top: 1px solid #ddd;
  background: #fff;
  display: flex;
  align-items: center;
}

.amis-chat-input input,
.amis-chat-input textarea {
  flex: 1;
  font-size: 15px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: none;
  outline: none;
}

.amis-chat-input button {
  margin-left: 10px;
  padding: 10px 14px;
  background: #0078d7;
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.amis-chat-input button:hover {
  background: #005fa3;
}

/* -----------------------------
   Systemnachricht
------------------------------ */
.amis-chat-message.system {
  text-align: center;
  font-style: italic;
  color: #666;
  padding: 6px 0;
  font-size: 14px;
}

/* -----------------------------
   Avatar rund (optional)
------------------------------ */
.amis-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 8px;
  flex-shrink: 0;
}

.amis-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* ============================================================================
   PART CSS.WORLDCLASS – ACCESSIBILITY + MOBILE + TYPING + FEEDBACK (FINAL)
   POSITION: GANZ UNTEN AN chat.css
============================================================================ */

/* ---------------------------------
   1) Fokusrahmen (Tastatur/RIS)
---------------------------------- */
:where(.amis-chat-container, .amis-chat-container *) :focus-visible {
  outline: 3px solid #0a66ff;
  outline-offset: 2px;
  border-radius: 10px;
}

/* ---------------------------------
   2) Container – mobile stabil, safe-area
---------------------------------- */
.amis-chat-container {
  max-height: min(78vh, 720px);
}

@media (max-width: 600px) {
  .amis-chat-container {
    width: calc(100% - 20px);
    right: 10px;
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 120px);
    border-radius: 18px;
  }
}

/* ---------------------------------
   3) Messages – Lesbarkeit + Luft
---------------------------------- */
.amis-chat-messages {
  padding: 16px 14px;
  scroll-behavior: smooth;
}

@media (max-width: 600px) {
  .amis-chat-messages {
    padding: 14px 12px;
    font-size: 15px;
    line-height: 1.55;
  }
}

/* Bubbles: weichere Kanten, bessere Breite */
.amis-chat-message.bot,
.amis-chat-message.user {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
}

.amis-chat-message.bot {
  border-top-left-radius: 10px;
}

.amis-chat-message.user {
  margin-left: auto;
  border-top-right-radius: 10px;
}

/* ---------------------------------
   4) Input – komfortabel + sticky
---------------------------------- */
.amis-chat-input {
  gap: 10px;
  padding: 12px;
}

.amis-chat-input input,
.amis-chat-input textarea {
  min-height: 44px;
  line-height: 1.35;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.16);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.amis-chat-input input::placeholder,
.amis-chat-input textarea::placeholder {
  color: rgba(0,0,0,0.45);
}

/* Send-Button: besser erreichbar */
.amis-chat-input button {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 14px;
}

/* ---------------------------------
   5) Typing Indicator (wenn du .amis-typing nutzt)
---------------------------------- */
.amis-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  font-size: 13px;
  color: rgba(0,0,0,0.65);
}

.amis-typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  animation: amisDot 1.2s infinite ease-in-out;
}

.amis-typing .dot:nth-child(2) { animation-delay: 0.15s; }
.amis-typing .dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes amisDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-3px); opacity: 0.95; }
}

/* ---------------------------------
   6) Feedback-Buttons (PART 57)
---------------------------------- */
.amis-feedback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.amis-feedback button {
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.amis-feedback button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}

/* ---------------------------------
   7) Darkmode (wenn body.amis-dark gesetzt)
---------------------------------- */
body.amis-dark .amis-chat-container {
  background: #151515 !important;
  border-color: rgba(255,255,255,0.14) !important;
}

body.amis-dark .amis-chat-messages {
  color: rgba(255,255,255,0.92);
}

body.amis-dark .amis-chat-message.bot {
  background: rgba(255,255,255,0.08) !important;
}

body.amis-dark .amis-chat-message.user {
  background: rgba(255,255,255,0.14) !important;
}

body.amis-dark .amis-chat-input {
  background: #1c1c1c !important;
  border-top-color: rgba(255,255,255,0.12) !important;
}

body.amis-dark .amis-chat-input input,
body.amis-dark .amis-chat-input textarea {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.16) !important;
  color: rgba(255,255,255,0.92) !important;
}

body.amis-dark .amis-chat-input input::placeholder,
body.amis-dark .amis-chat-input textarea::placeholder {
  color: rgba(255,255,255,0.55);
}

body.amis-dark .amis-feedback {
  border-top-color: rgba(255,255,255,0.10);
}

body.amis-dark .amis-feedback button {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.14);
}

body.amis-dark :where(.amis-chat-container, .amis-chat-container *) :focus-visible {
  outline-color: #7aa7ff;
}
/* =======================================================================
   PATCH – WORLDCLASS READABILITY (append at end)
   ======================================================================= */

.amis-bubble.amis {
  text-align: left;
  line-height: 1.45;
  letter-spacing: 0.1px;
  word-break: break-word;
  hyphens: auto;
}

.amis-bubble.user {
  line-height: 1.45;
  word-break: break-word;
  hyphens: auto;
}

/* Fokus: weniger "neon", aber klar sichtbar */
.amis-input:focus,
.amis-input:focus-visible {
  outline: 2px solid rgba(0, 120, 90, 0.55);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 120, 90, 0.18);
}
/* ============================================================================
   PATCH – HEADER MINIMIZE BUTTON (FINAL)
   POSITION: GANZ UNTEN an chat.css
============================================================================ */

.amis-header-btn {
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
  user-select: none;
  line-height: 1;
}

.amis-header-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.amis-header-btn:focus-visible {
  outline: 3px solid #0a66ff;
  outline-offset: 2px;
}

.amis-minimize-btn {
  margin-left: 6px;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
}
/* ============================================================================
   PATCH – CLOSE (X) + COLLAPSE (▾/▴) + COLLAPSED MODE (FINAL)
   POSITION: GANZ UNTEN an chat.css
============================================================================ */

#amisCloseBtn {
  font-size: 22px;
  min-width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
}

#amisCollapseBtn {
  font-size: 18px;
  min-width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
}

/* Collapsed: nur Header zeigen */
.amis-chat-container.collapsed .amis-chat-messages,
.amis-chat-container.collapsed .amis-chat-input,
.amis-chat-container.collapsed .amis-chat-footer {
  display: none !important;
}

.amis-chat-container.collapsed {
  max-height: 86px !important;
}

/* Mobile: collapsed bleibt über safe-area */
@media (max-width: 600px) {
  .amis-chat-container.collapsed {
    max-height: 86px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  }
}
/* ============================================================================
   PATCH – COLLAPSED MODE + BUTTONS (FIXED ROOT SELECTOR)
   POSITION: GANZ UNTEN an chat.css
============================================================================ */

#amisMinimizeBtn, #amisCollapseBtn, #amisCloseBtn {
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
  user-select: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  margin-left: 6px;
}

#amisCloseBtn { font-size: 22px; }

#amisMinimizeBtn:hover, #amisCollapseBtn:hover, #amisCloseBtn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

#amisMinimizeBtn:focus-visible, #amisCollapseBtn:focus-visible, #amisCloseBtn:focus-visible {
  outline: 3px solid #0a66ff;
  outline-offset: 2px;
}

/* Collapsed: nur Header bleibt sichtbar */
.amis-chat-root.collapsed .amis-chat-messages,
.amis-chat-root.collapsed .amis-chat-inputbar {
  display: none !important;
}

.amis-chat-root.collapsed .amis-chat-window {
  height: auto !important;
}

.amis-chat-root.collapsed {
  max-height: 86px !important;
}

@media (max-width: 600px) {
  .amis-chat-root.collapsed {
    max-height: 86px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  }
}
/* ============================================================================
   PATCH – HEADER CONTROLS + COLLAPSED MODE (FINAL)
   POSITION: GANZ UNTEN
============================================================================ */

/* Buttons rechts im Header */
.amis-header-controls{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:6px;
}

/* Button-Style */
.amis-hctl-btn{
  border:0;
  background:transparent;
  color:#e8f8f5;
  font-size:18px;
  cursor:pointer;
  padding:4px 8px;
  border-radius:999px;
  line-height:1;
  min-width:34px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.amis-hctl-btn:hover{
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.amis-hctl-btn:focus-visible{
  outline:3px solid #0a66ff;
  outline-offset:2px;
}

/* Collapsed: nur Header bleibt */
.amis-chat-root.collapsed .amis-chat-messages,
.amis-chat-root.collapsed .amis-chat-inputbar{
  display:none !important;
}

.amis-chat-root.collapsed .amis-chat-window{
  height:auto !important;
}

.amis-chat-root.collapsed{
  max-height:86px !important;
}
/* ============================================================================
   PATCH – HEADER CONTROLS ALWAYS VISIBLE (FINAL)
   POSITION: GANZ UNTEN
============================================================================ */

.amis-chat-header{ position: relative; }

.amis-header-controls{
  position: absolute;
  right: 12px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 50;
}

.amis-hctl-btn{
  background: rgba(255,255,255,0.10);
  border: 0;
  color: #eafffb;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1;
  min-width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.amis-hctl-btn:hover{ background: rgba(255,255,255,0.18); }

#amisCloseBtn{ font-size: 22px; }

/* Mobile: etwas dichter */
@media (max-width: 600px){
  .amis-header-controls{ right: 10px; top: 8px; }
}

/* ============================================================================
   PATCH – HEADER FLEX + RIGHT BAR (NO OVERLAP) (FINAL)
   POSITION: GANZ UNTEN an chat.css
============================================================================ */

/* Header zurück auf flex (killt Grid/Absolute-Kollisionen) */
.amis-chat-header{
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-right:12px;
}

/* rechte Sammelleiste */
.amis-header-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  min-width:0;
}

/* Controls: nicht absolut */
.amis-header-controls{
  position:static !important;
  right:auto !important;
  top:auto !important;
  margin:0 !important;
  display:flex;
  align-items:center;
  gap:6px;
}

/* Buttons kompakt */
.amis-hctl-btn{
  background: rgba(255,255,255,0.10);
  border: 0;
  color: #eafffb;
  border-radius: 999px;
  min-width: 34px;
  height: 28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

/* damit Ruhig/Klar nicht „überläuft“ */
.amis-header-right .amis-mode-wrap,
.amis-header-right .amis-modes,
.amis-header-right .amis-mode-toggle,
.amis-header-right .amis-mode-pill{
  flex:0 0 auto;
}

/* Mobile enger */
@media (max-width: 420px){
  .amis-header-right{ gap:6px; }
  .amis-hctl-btn{ min-width:30px; height:26px; }
}
/* ==========================================================================
   CSS PATCH – PART 40 HEADER RIGHT BAR + CONTROLS (SAFE)
   ========================================================================== */

.amis-chat-header { position: relative; }

.amis-header-right{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:10px;
  flex:0 0 auto;
}

/* Mode-Switch kompakt in Header-Rechtsbereich */
.amis-header-right .amis-mode-switch{
  margin-left:6px;
}

/* Header-Buttons: klein, stabil, nicht überlagernd */
.amis-hbtn{
  width:34px;
  height:28px;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,0.12);
  color:#e8f8f5;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  line-height:1;
  padding:0;
}

.amis-hbtn:hover{
  background:rgba(255,255,255,0.20);
}

.amis-hbtn:focus{
  outline:2px solid rgba(255,255,255,0.65);
  outline-offset:2px;
}

/* Collapse State */
.amis-chat-root.is-collapsed .amis-chat-messages,
.amis-chat-root.is-collapsed .amis-chat-inputbar{
  display:none !important;
}

.amis-chat-root.is-collapsed .amis-chat-window{
  height:auto !important;
  max-height:none !important;
}
/* ==========================================================================
   PATCH – HEADER BUTTONS SMALLER + MORE VISIBLE (FINAL)
   POSITION: GANZ UNTEN an chat.css
   Ziel: Buttons kleiner + X deutlich sichtbar
   ========================================================================== */

.amis-header-right{ gap:6px; }

.amis-hbtn{
  width:28px !important;
  height:24px !important;
  font-size:16px !important;
  border-radius:999px !important;
  background:rgba(255,255,255,0.14) !important;
}

/* X extra klar (klein aber kontraststark) */
#amisBtnClose, #amisCloseBtn, #amisBtnCloseChat, #amisBtnCloseX, #amisBtnCloseWidget, #amisBtnClose{
  font-size:18px !important;
  font-weight:700 !important;
  color:#ffffff !important;
  background:rgba(255,255,255,0.20) !important;
}

/* Falls das X als letztes Kind steckt, trotzdem sichtbar */
.amis-header-right .amis-hbtn:last-child{
  background:rgba(255,255,255,0.22) !important;
}

/* Mobile noch kompakter */
@media (max-width: 420px){
  .amis-hbtn{
    width:26px !important;
    height:22px !important;
    font-size:15px !important;
  }
  #amisBtnClose, #amisCloseBtn, #amisBtnCloseChat, #amisBtnCloseX, #amisBtnCloseWidget, #amisBtnClose{
    font-size:17px !important;
  }
}
/* ==========================================================================
   AMIS – LINK STYLE (BUBBLES) · RIS-FREUNDLICH
   Zweck: Links klar erkennbar + Tastaturfokus sichtbar
   ========================================================================== */

.amis-bubble a,
.amis-message a,
.amis-chat-message a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
  font-weight: 600;
  word-break: break-word;
}

.amis-bubble a:focus,
.amis-message a:focus,
.amis-chat-message a:focus {
  outline: 3px solid currentColor;
  outline-offset: 3px;
  border-radius: 8px;
}

.amis-bubble a:hover,
.amis-message a:hover,
.amis-chat-message a:hover {
  text-decoration-thickness: 3px;
}
/* ==========================================================================
   PATCH – ACCESSIBILITY / RIS-LUXUS (ohne Layout-Änderung)
   Einfügen: GANZ am Ende der chat.css
   Inhalt:
   1) prefers-reduced-motion
   2) prefers-color-scheme: dark (Auto-Dark, wenn nicht manuell gesetzt)
   3) Fokus vereinheitlichen + Fallback für Browser ohne :focus-visible
   4) Zoom: Buttons/Text besser über Font/Padding statt Transform
   5) Font-Stack vorbereitet (Atkinson optional)
   ========================================================================== */

/* 0) Optional: bessere Leseschrift (nutzt Atkinson nur, wenn du sie später lädst) */
.amis-chat-root {
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* 1) Motion reduzieren */
@media (prefers-reduced-motion: reduce) {
  .amis-chat-root *,
  .amis-chat-root *::before,
  .amis-chat-root *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* falls du irgendwo "typing"/loader animierst */
  .amis-typing,
  .typing,
  .loader,
  .amis-loader {
    animation: none !important;
  }
}

/* 2) Auto-Dark (nur wenn du nicht explizit .dark setzt) */
@media (prefers-color-scheme: dark) {
  .amis-chat-root:not(.dark) {
    background: #0f1217;
    color: #eef2f6;
  }
}

/* 3) Fokus: konsistent + Fallback */
.amis-chat-root :where(button, a, input, textarea, select, [tabindex]):focus {
  outline: 2px solid rgba(0, 120, 212, 0.85);
  outline-offset: 3px;
}
.amis-chat-root :where(button, a, input, textarea, select, [tabindex]):focus:not(:focus-visible) {
  outline: none;
}
.amis-chat-root :where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid rgba(0, 120, 212, 0.95);
  outline-offset: 3px;
}

/* 4) Zoom: vermeide Transform-Scale auf Buttons (bessere Hitbox)
   Falls du schon transform nutzt, neutralisieren wir es sanft. */
.amis-chat-root button,
.amis-chat-root .btn,
.amis-chat-root .amis-btn {
  transform: none !important;
}

/* 4b) Zoom: leichte, robuste Skalierung über Variable (falls vorhanden) */
.amis-chat-root {
  --amis-zoom-safe: var(--amis-zoom, 1);
}
.amis-chat-root :where(button, .btn, .amis-btn) {
  font-size: calc(1rem * var(--amis-zoom-safe));
  line-height: 1.2;
  padding-top: calc(0.55rem * var(--amis-zoom-safe));
  padding-bottom: calc(0.55rem * var(--amis-zoom-safe));
  padding-left: calc(0.85rem * var(--amis-zoom-safe));
  padding-right: calc(0.85rem * var(--amis-zoom-safe));
}

/* 5) Touch-Targets (mobil): mind. 44px Höhe, ohne Layout zu sprengen */
@media (pointer: coarse) {
  .amis-chat-root :where(button, .btn, .amis-btn, a) {
    min-height: 44px;
  }
}
/* UI/ACTIONS1 */
.amis-action-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.amis-action-btn{ font:inherit; padding:6px 10px; border-radius:12px; border:1px solid currentColor; background:transparent; cursor:pointer; }
.amis-action-btn:focus{ outline:2px solid currentColor; outline-offset:2px; }
/* ==========================================================================
   BLOCK CSS/HDR_MEM1 – Memory Buttons + Collapse (SAFE)
   POSITION: GANZ ANS ENDE von chat.css
   ========================================================================== */

.amis-header-controls{
  display:flex;
  align-items:center;
  gap:6px;
}

.amis-hctl-btn{
  cursor:pointer;
  border:0;
  background:transparent;
  line-height:1;
}

#amisBtnMem { font-size: 15px; }
#amisBtnMemClear { font-size: 14px; opacity: .8; }
#amisBtnMemClear:hover { opacity: 1; }

/* Collapse: body + footer ausblenden, Header bleibt */
.amis-chat-root.is-collapsed .amis-chat-body,
.amis-chat-root.is-collapsed .amis-chat-footer,
.amis-chat-root.collapsed .amis-chat-body,
.amis-chat-root.collapsed .amis-chat-footer{
  display:none !important;
}

/* OPTIONAL: wenn du „Ruhig/Klar“ wirklich entfernen willst: */
/* .amis-mode-switch, .amis-mode-wrap, .amis-modes { display:none !important; } */

/* ==========================================================================
   CSS PATCH – HDR/MEMCTRL_FINAL (DELUXE · SAFE)
   Ziel:
   - Right-Bar wirklich rechts
   - Ruhig/Klar bleibt mittig/sauber
   - Controls (🧠 ⌫ — ▾ ×) kompakt, gut klickbar, ohne Overlap
   POSITION: GANZ UNTEN an chat.css
   ========================================================================== */

/* Header als Flex-Row (falls dein Theme/Elementor es zerschießt) */
.amis-chat-header{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Mode (Ruhig/Klar) soll "in der Mitte" wirken */
.amis-chat-header .amis-mode-switch,
.amis-chat-header .amis-mode-wrap,
.amis-chat-header .amis-modes,
.amis-chat-header [data-amis-mode]{
  margin-left:auto;
  margin-right:auto;
  flex:0 1 auto;
}

/* Right-Bar sitzt rechts */
.amis-header-right{
  display:flex;
  align-items:center;
  gap:6px;
  margin-left:auto;          /* wichtig */
  flex:0 0 auto;
  white-space:nowrap;
}

/* Controls Box */
.amis-header-controls{
  display:flex;
  align-items:center;
  gap:6px;
}

/* Header Buttons (du nutzt .amis-hbtn im JS) */
.amis-hbtn{
  width:28px;
  height:24px;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,0.14);
  color:#e8f8f5;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  padding:0;
}

.amis-hbtn:hover{
  background:rgba(255,255,255,0.22);
}

.amis-hbtn:focus{
  outline:2px solid rgba(255,255,255,0.70);
  outline-offset:2px;
}

/* Close (×) extra sichtbar */
#amisBtnClose{
  font-size:18px;
  font-weight:700;
  color:#ffffff;
  background:rgba(255,255,255,0.20);
}

/* Collapse State (passt zu deinem JS: is-collapsed + collapsed) */
.amis-chat-root.is-collapsed .amis-chat-messages,
.amis-chat-root.is-collapsed .amis-chat-inputbar,
.amis-chat-root.collapsed .amis-chat-messages,
.amis-chat-root.collapsed .amis-chat-inputbar{
  display:none !important;
}

.amis-chat-root.is-collapsed .amis-chat-window,
.amis-chat-root.collapsed .amis-chat-window{
  height:auto !important;
  max-height:none !important;
}

/* Mobile noch kompakter */
@media (max-width: 420px){
  .amis-chat-header{ gap:8px; }
  .amis-header-right, .amis-header-controls{ gap:5px; }

  .amis-hbtn{
    width:26px;
    height:22px;
    font-size:15px;
  }
  #amisBtnClose{
    font-size:17px;
  }
}
/* ==========================================================================
   HEADER LAYOUT FIX – CENTER MODE + RIGHT ICONS (DELUXE · SAFE OVERRIDE)
   POSITION: GANZ UNTEN in chat.css
   Ziel: Ruhig/Klar sauber mittig, Controls sauber rechts, kein Overlap.
   ========================================================================== */

.amis-chat-header{
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  min-height: 52px !important;

  /* Platz reservieren: links Avatar/Name, rechts Icons */
  padding-right: 170px !important;
  padding-left: 14px !important;
}

/* Right-Bar: fest rechts, vertikal zentriert */
.amis-header-right{
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;

  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

/* Controls-Box in Right-Bar */
.amis-header-controls{
  display:flex !important;
  align-items:center !important;
  gap:6px !important;
}

/* Mode Switch: fest zentriert im Header */
.amis-chat-header .amis-mode-switch,
.amis-chat-header .amis-mode-wrap,
.amis-chat-header .amis-modes,
.amis-chat-header [data-amis-mode]{
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;

  /* verhindert, dass es in die rechten Icons läuft */
  max-width: calc(100% - 240px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Buttons (dein JS nutzt .amis-hbtn) */
.amis-hbtn{
  width: 28px !important;
  height: 24px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.14) !important;
  color: #e8f8f5 !important;
  cursor: pointer !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size: 16px !important;
  line-height: 1 !important;
  padding: 0 !important;
}

.amis-hbtn:hover{ background: rgba(255,255,255,0.22) !important; }

.amis-hbtn:focus{
  outline: 2px solid rgba(255,255,255,0.70) !important;
  outline-offset: 2px !important;
}

/* Close (×) extra klar */
#amisBtnClose{
  font-size: 18px !important;
  font-weight: 700 !important;
  background: rgba(255,255,255,0.20) !important;
  color: #fff !important;
}

/* Mobile: weniger Platz rechts reservieren + alles kompakter */
@media (max-width: 420px){
  .amis-chat-header{
    padding-right: 150px !important;
  }

  .amis-hbtn{
    width: 26px !important;
    height: 22px !important;
    font-size: 15px !important;
  }

  #amisBtnClose{
    font-size: 17px !important;
  }

  .amis-chat-header .amis-mode-switch,
  .amis-chat-header .amis-mode-wrap,
  .amis-chat-header .amis-modes,
  .amis-chat-header [data-amis-mode]{
    max-width: calc(100% - 210px) !important;
  }
}
/* ==========================================================================
   CSS PATCH – HDR/MEMCTRL_FINAL (SOUND + HEADER CONTROLS) · FINAL
   POSITION: GANZ UNTEN an chat.css
   ========================================================================== */

/* Ruhig/Klar komplett ausblenden (UI bleibt sauber) */
.amis-mode-switch,
.amis-mode-wrap,
.amis-modes,
[data-amis-mode]{
  display:none !important;
}

/* Right-Bar wirklich rechts halten */
.amis-chat-header{
  display:flex;
  align-items:center;
}

.amis-header-right{
  margin-left:auto !important;
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
  padding-left:8px;
}

/* Button-Row */
.amis-header-controls{
  display:flex;
  align-items:center;
  gap:6px;
}

/* Header Buttons (nutzt deine .amis-hbtn Basis) */
.amis-hbtn{
  width:28px;
  height:24px;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,0.14);
  color:#ffffff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  padding:0;
}

.amis-hbtn:hover{ background:rgba(255,255,255,0.22); }

.amis-hbtn:focus{
  outline:2px solid rgba(255,255,255,0.70);
  outline-offset:2px;
}

/* Muted-Optik */
#amisBtnSound.is-muted{
  opacity:0.75;
  filter:saturate(0.6);
}

/* Mobile noch kompakter */
@media (max-width: 420px){
  .amis-hbtn{ width:26px; height:22px; font-size:15px; }
}
/* ==========================================================================
   CSS – HDR/MEMCTRL_FINAL_V2 (FINAL)
   Ziel: sauberer Header rechts + kompakte Icons + kein Ruhig/Klar
   POSITION: GANZ UNTEN an chat.css
   ========================================================================== */

.amis-chat-header{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Rechtsblock immer nach rechts schieben */
.amis-header-right{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}

/* Controls-Container */
.amis-header-controls{
  display:flex;
  align-items:center;
  gap:6px;
}

/* Ruhig/Klar sicher ausblenden (falls noch irgendwo gerendert) */
.amis-mode-switch,
.amis-mode-wrap,
.amis-modes,
[data-amis-mode]{
  display:none !important;
}

/* Header-Buttons (Icon-Buttons) */
.amis-hbtn{
  width:28px;
  height:24px;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,0.14);
  color:#ffffff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  padding:0;
}

.amis-hbtn:hover{ background:rgba(255,255,255,0.22); }

.amis-hbtn:focus{
  outline:2px solid rgba(255,255,255,0.70);
  outline-offset:2px;
}

/* X minimal stärker */
#amisBtnClose{
  font-size:18px;
  font-weight:700;
}

/* Collapse State (dein Standard) */
.amis-chat-root.is-collapsed .amis-chat-messages,
.amis-chat-root.is-collapsed .amis-chat-inputbar{
  display:none !important;
}
.amis-chat-root.is-collapsed .amis-chat-window{
  height:auto !important;
  max-height:none !important;
}

@media (max-width: 420px){
  .amis-header-right{ gap:5px; }
  .amis-hbtn{ width:26px; height:22px; font-size:15px; }
  #amisBtnClose{ font-size:17px; }
}
/* ==========================================================================
   FIX – Tag/Nacht Button nicht “wegdriften” lassen (Header Align)
   ========================================================================== */

/* Tag/Nacht / Theme Button: keine Auto-Margins / kein absolute-right */
#amisBtnNight,
#amisBtnTheme,
.amis-night-btn,
.amis-theme-btn,
[data-action="theme"],
[data-amis="theme"],
[data-action="night"],
[data-amis="night"]{
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: static !important;
  right: auto !important;
  left: auto !important;
}

/* rechts sauber bündig, ohne extra Lücken */
.amis-header-right{
  justify-content: flex-end;
  margin-left: auto;
  padding-right: 8px;
  gap: 8px;
}

/* FIX – Dark/TagNacht Toggle als echter Header-Button (FINAL) */
#amisDarkToggle,
.amis-dark-toggle{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:36px !important;
  height:36px !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:10px !important;
}
/* ==========================================================================
   FINAL – MEMORY MINI-PANEL UI (optional, aber empfohlen)
   Insert: ganz ans Ende deiner chat.css
   ========================================================================== */

.amis-mem-panel{
  border:1px solid rgba(255,255,255,0.18);
  border-radius:14px;
  padding:12px 12px;
  background:rgba(0,0,0,0.10);
}

.amis-mem-title{
  font-size:14px;
  margin-bottom:6px;
}

.amis-mem-status{
  font-size:13px;
  margin-bottom:8px;
}

.amis-mem-privacy{
  font-size:12.5px;
  line-height:1.35;
  margin-bottom:10px;
  opacity:0.95;
}

.amis-mem-hint{
  font-size:12.5px;
  margin-bottom:10px;
  opacity:0.9;
}

.amis-mem-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:8px;
}

.amis-mem-btn{
  border:0;
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
  font-size:13px;
  line-height:1;
  background:rgba(255,255,255,0.14);
}

.amis-mem-btn:hover{
  background:rgba(255,255,255,0.20);
}

.amis-mem-btn:focus{
  outline:2px solid rgba(255,255,255,0.70);
  outline-offset:2px;
}

.amis-mem-btn.danger{
  background:rgba(255,80,80,0.22);
}

.amis-mem-btn.danger:hover{
  background:rgba(255,80,80,0.30);
}

.amis-mem-foot{
  font-size:12px;
  opacity:0.85;
}
/* ==========================================================================
   FINAL – MEMORY OVERLAY PANEL (DELUXE)
   Insert: ganz ans Ende der chat.css
   ========================================================================== */

.amis-mem-ov{ display:none; position:absolute; inset:0; z-index:9999; }
.amis-mem-ov.open{ display:block; }

.amis-mem-ov-backdrop{
  position:absolute; inset:0;
  background:rgba(0,0,0,0.45);
}

.amis-mem-ov-card{
  position:absolute;
  right:12px; top:58px;
  width:min(360px, calc(100% - 24px));
  border-radius:16px;
  padding:12px;
  background:rgba(30,30,30,0.96);
  border:1px solid rgba(255,255,255,0.16);
  box-shadow:0 10px 30px rgba(0,0,0,0.35);
}

.amis-mem-ov-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-bottom:8px;
}

.amis-mem-ov-title{ font-size:14px; font-weight:700; }
.amis-mem-ov-x{
  width:34px; height:34px;
  border:0; border-radius:10px;
  background:rgba(255,255,255,0.12);
  cursor:pointer; font-size:18px; line-height:1;
}
.amis-mem-ov-x:hover{ background:rgba(255,255,255,0.18); }
.amis-mem-ov-x:focus{ outline:2px solid rgba(255,255,255,0.7); outline-offset:2px; }

.amis-mem-ov-status{ font-size:13px; margin-bottom:8px; }
.amis-mem-ov-privacy{ font-size:12.5px; line-height:1.35; margin-bottom:10px; opacity:0.95; }

.amis-mem-ov-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.amis-mem-ov-btn{
  border:0; border-radius:10px;
  padding:8px 10px;
  cursor:pointer; font-size:13px; line-height:1;
  background:rgba(255,255,255,0.14);
}
.amis-mem-ov-btn:hover{ background:rgba(255,255,255,0.20); }
.amis-mem-ov-btn:focus{ outline:2px solid rgba(255,255,255,0.7); outline-offset:2px; }
.amis-mem-ov-btn.danger{ background:rgba(255,80,80,0.22); }
.amis-mem-ov-btn.danger:hover{ background:rgba(255,80,80,0.30); }

.amis-mem-ov-foot{ font-size:12px; opacity:0.85; }
.amis-mem-ov-foot code{ background:rgba(255,255,255,0.10); padding:1px 6px; border-radius:8px; }
/* ==========================================================================
   FINAL – MEMORY OVERLAY V2 (CLEAN, FRIENDLY, NOT SCARY)
   Insert: ganz ans Ende der chat.css
   ========================================================================== */

.amis-mem2-ov{ position:absolute; inset:0; z-index:9999; }
.amis-mem2-backdrop{
  position:absolute; inset:0;
  background:rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
}

.amis-mem2-card{
  position:absolute;
  right:14px; top:58px;
  width:min(360px, calc(100% - 28px));
  border-radius:18px;
  padding:14px 14px 12px;
  background:rgba(22, 60, 55, 0.94);           /* passt zur Amis-Leiste */
  border:1px solid rgba(255,255,255,0.14);
  box-shadow:0 14px 40px rgba(0,0,0,0.28);
  color:rgba(255,255,255,0.92);
}

.amis-mem2-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:10px;
}

.amis-mem2-title{ font-size:14px; font-weight:700; letter-spacing:0.2px; }

.amis-mem2-x{
  width:36px; height:36px;
  border:0; border-radius:12px;
  background:rgba(255,255,255,0.10);
  color:rgba(255,255,255,0.92);
  cursor:pointer; font-size:18px; line-height:1;
}
.amis-mem2-x:hover{ background:rgba(255,255,255,0.16); }
.amis-mem2-x:focus{ outline:2px solid rgba(255,255,255,0.65); outline-offset:2px; }

.amis-mem2-row{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border-radius:14px;
  background:rgba(255,255,255,0.08);
  margin-bottom:10px;
}
.amis-mem2-label{ font-size:12.5px; opacity:0.85; }
.amis-mem2-value{ font-size:13px; }
.amis-mem2-value .on{ color:rgba(185,255,210,0.95); }
.amis-mem2-value .off{ color:rgba(255,210,210,0.95); }

.amis-mem2-note{
  font-size:12.5px;
  line-height:1.35;
  padding:10px 10px;
  border-radius:14px;
  background:rgba(255,255,255,0.06);
  margin-bottom:12px;
}

.amis-mem2-actions{
  display:flex; gap:8px; flex-wrap:wrap;
  margin-bottom:10px;
}

.amis-mem2-btn{
  border:0;
  border-radius:12px;
  padding:9px 12px;
  cursor:pointer;
  font-size:13px;
  background:rgba(255,255,255,0.12);
  color:rgba(255,255,255,0.92);
}
.amis-mem2-btn:hover{ background:rgba(255,255,255,0.18); }
.amis-mem2-btn:focus{ outline:2px solid rgba(255,255,255,0.60); outline-offset:2px; }
.amis-mem2-btn.is-active{
  background:rgba(255,255,255,0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.amis-mem2-btn.danger{
  background:rgba(255,110,110,0.20);
}
.amis-mem2-btn.danger:hover{ background:rgba(255,110,110,0.28); }

.amis-mem2-more{
  width:100%;
  border:0;
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-size:13px;
  background:rgba(255,255,255,0.16);
  color:rgba(255,255,255,0.95);
  text-align:left;
}
.amis-mem2-more:hover{ background:rgba(255,255,255,0.22); }
.amis-mem2-more:focus{ outline:2px solid rgba(255,255,255,0.65); outline-offset:2px; }

.amis-mem2-details{ margin-top:10px; }
.amis-mem2-detailsbox{
  padding:10px 10px;
  border-radius:14px;
  background:rgba(0,0,0,0.14);
  border:1px solid rgba(255,255,255,0.10);
  font-size:12.5px;
  line-height:1.35;
}
.amis-mem2-detailsline{ margin:6px 0; }

.amis-mem2-foot{
  margin-top:10px;
  font-size:12px;
  opacity:0.85;
}

/* ==========================================================================
   FINAL – MEMORY POPOVER (PRO CHATBOT STYLE)
   Insert: ganz ans Ende der chat.css
   ========================================================================== */

.amis-mem-pop{
  position:absolute;
  inset:0;
  z-index:9999;
}

.amis-mem-pop-card{
  position:absolute;
  right:14px;
  top:56px;
  width:min(320px, calc(100% - 28px));
  border-radius:16px;
  padding:12px;
  background:#ffffff;
  color:#133;
  border:1px solid rgba(0,0,0,0.10);
  box-shadow:0 14px 40px rgba(0,0,0,0.18);
}

.amis-mem-pop-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.amis-mem-pop-title{
  font-size:14px;
  font-weight:700;
  letter-spacing:0.2px;
}

.amis-mem-pop-x{
  width:34px;
  height:34px;
  border:0;
  border-radius:12px;
  background:rgba(0,0,0,0.06);
  cursor:pointer;
  font-size:18px;
  line-height:1;
}
.amis-mem-pop-x:hover{ background:rgba(0,0,0,0.10); }
.amis-mem-pop-x:focus{ outline:2px solid rgba(0,0,0,0.35); outline-offset:2px; }

.amis-mem-pop-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.amis-mem-pop-status{
  font-size:13px;
  color:rgba(0,0,0,0.75);
}
.amis-mem-pop-status .on{ color:#0a7a47; }
.amis-mem-pop-status .off{ color:#9a1f1f; }

.amis-mem-pop-badge{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(0,0,0,0.06);
  color:rgba(0,0,0,0.65);
}

.amis-mem-pop-privacy{
  font-size:12.5px;
  line-height:1.35;
  padding:10px 10px;
  border-radius:14px;
  background:rgba(0,0,0,0.04);
  margin-bottom:10px;
}

.amis-mem-pop-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.amis-mem-pop-btn{
  border:1px solid rgba(0,0,0,0.12);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-size:13px;
  background:#fff;
}

.amis-mem-pop-btn:hover{ background:rgba(0,0,0,0.04); }
.amis-mem-pop-btn:focus{ outline:2px solid rgba(0,0,0,0.30); outline-offset:2px; }

.amis-mem-pop-btn.is-active{
  background:rgba(0,0,0,0.06);
  border-color:rgba(0,0,0,0.16);
}

.amis-mem-pop-btn.danger{
  border-color:rgba(176,40,40,0.30);
  background:rgba(176,40,40,0.06);
}
.amis-mem-pop-btn.danger:hover{ background:rgba(176,40,40,0.10); }

.amis-mem-pop-more{
  width:100%;
  border:1px solid rgba(0,0,0,0.12);
  border-radius:14px;
  padding:9px 10px;
  cursor:pointer;
  font-size:13px;
  background:#fff;
  text-align:left;
}
.amis-mem-pop-more:hover{ background:rgba(0,0,0,0.04); }
.amis-mem-pop-more:focus{ outline:2px solid rgba(0,0,0,0.30); outline-offset:2px; }

.amis-mem-pop-detailsbox{
  margin-top:10px;
  padding:10px 10px;
  border-radius:14px;
  background:rgba(0,0,0,0.04);
  border:1px solid rgba(0,0,0,0.08);
  font-size:12.5px;
  line-height:1.35;
}
/* ==========================================================================
   FINAL – MEMORY POPOVER V4 (GLASKLAR + FRIENDLY)  → ans Ende chat.css
   ========================================================================== */

#amisMemPopoverV4.amis-mem-pop{ position:absolute; inset:0; z-index:9999; }

#amisMemPopoverV4 .amis-mem-pop-card{
  position:absolute;
  right:14px;
  top:56px;
  width:min(340px, calc(100% - 28px));
  border-radius:18px;
  padding:14px;
  background:#ffffff;
  color:#113;
  border:1px solid rgba(0,0,0,0.10);
  box-shadow:0 14px 40px rgba(0,0,0,0.18);
}

#amisMemPopoverV4 .amis-mem-pop-title{ font-size:15px; font-weight:800; }

#amisMemPopoverV4 .amis-mem-pop-badge.strong{
  font-size:12px;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(0,0,0,0.06);
  color:rgba(0,0,0,0.75);
  font-weight:700;
  letter-spacing:0.3px;
}

#amisMemPopoverV4 .amis-mem-pop-privacy.pro{
  font-size:12.8px;
  line-height:1.35;
  padding:10px 10px;
  border-radius:14px;
  background:rgba(0,0,0,0.04);
  margin-bottom:10px;
}

#amisMemPopoverV4 .amis-mem-pop-privacy.pro .line1{ margin-bottom:6px; }
#amisMemPopoverV4 .amis-mem-pop-privacy.pro .line2{ margin-bottom:6px; }
#amisMemPopoverV4 .amis-mem-pop-privacy.pro .line3{ margin-bottom:0; }

#amisMemPopoverV4 .amis-mem-pop-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }

#amisMemPopoverV4 .amis-mem-pop-btn{
  border:1px solid rgba(0,0,0,0.14);
  border-radius:12px;
  padding:9px 12px;
  cursor:pointer;
  font-size:13px;
  background:#fff;
  color:#112;
}

#amisMemPopoverV4 .amis-mem-pop-btn:hover{ background:rgba(0,0,0,0.04); }
#amisMemPopoverV4 .amis-mem-pop-btn.is-active{ background:rgba(0,0,0,0.06); border-color:rgba(0,0,0,0.18); }

#amisMemPopoverV4 .amis-mem-pop-btn.danger{
  border-color:rgba(176,40,40,0.28);
  background:rgba(176,40,40,0.06);
  color:#5a1010;
}
#amisMemPopoverV4 .amis-mem-pop-btn.danger:hover{ background:rgba(176,40,40,0.10); }

#amisMemPopoverV4 .amis-mem-pop-more{
  width:100%;
  border:1px solid rgba(0,0,0,0.14);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-size:13px;
  background:#fff;
  text-align:left;
  color:#112;
}
#amisMemPopoverV4 .amis-mem-pop-more:hover{ background:rgba(0,0,0,0.04); }

#amisMemPopoverV4 .amis-mem-pop-detailsbox{
  margin-top:10px;
  padding:10px 10px;
  border-radius:14px;
  background:rgba(0,0,0,0.04);
  border:1px solid rgba(0,0,0,0.08);
  font-size:12.6px;
  line-height:1.35;
}
/* ============================================================================
   FINAL – MEMORY POPOVER V4 (GLASKLAR + FRIENDLY)
   EINFÜGEORT: ganz ans Ende der chat.css
   ============================================================================ */

#amisMemPopoverV4.amis-memv4{
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 2147483000;
  width: min(360px, calc(100vw - 32px));
  display: none;
}

#amisMemPopoverV4.amis-memv4.is-open{ display:block; }

#amisMemPopoverV4 .amis-memv4__card{
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 14px;
  color: #1b1b1b;
  font-size: 14px;
  line-height: 1.35;
  outline: none;
}

#amisMemPopoverV4 .amis-memv4__card:focus{
  box-shadow: 0 0 0 3px rgba(0,0,0,0.10), 0 10px 30px rgba(0,0,0,0.12);
}

#amisMemPopoverV4 .amis-memv4__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}

#amisMemPopoverV4 .amis-memv4__title{
  font-weight: 700;
  font-size: 14px;
}

#amisMemPopoverV4 .amis-memv4__x{
  border: 0;
  background: transparent;
  color: #1b1b1b;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

#amisMemPopoverV4 .amis-memv4__x:focus{
  outline: 2px solid rgba(0,0,0,0.35);
  outline-offset: 2px;
}

#amisMemPopoverV4 .amis-memv4__copy{ margin-bottom: 12px; }

#amisMemPopoverV4 .amis-memv4__pill{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  background: rgba(0,0,0,0.06);
  margin-bottom: 8px;
}

#amisMemPopoverV4 .amis-memv4__line{
  margin-bottom: 8px;
  color: rgba(0,0,0,0.78);
}

#amisMemPopoverV4 .amis-memv4__status{
  font-weight: 700;
  color: rgba(0,0,0,0.78);
}

#amisMemPopoverV4 .amis-memv4__btnrow{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#amisMemPopoverV4 .amis-memv4__btn{
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  color: #1b1b1b;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

#amisMemPopoverV4 .amis-memv4__btn:hover{
  background: rgba(0,0,0,0.04);
}

#amisMemPopoverV4 .amis-memv4__btn:focus{
  outline: 2px solid rgba(0,0,0,0.35);
  outline-offset: 2px;
}

#amisMemPopoverV4 .amis-memv4__btn.is-active{
  border-color: rgba(0,0,0,0.35);
  background: rgba(0,0,0,0.06);
}

#amisMemPopoverV4 .amis-memv4__btn--danger{
  border-color: rgba(0,0,0,0.18);
}

#amisMemPopoverV4 .amis-memv4__acc{
  border-top: 1px solid rgba(0,0,0,0.10);
  padding-top: 10px;
}

#amisMemPopoverV4 .amis-memv4__accbtn{
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  padding: 8px 8px;
  border-radius: 12px;
}

#amisMemPopoverV4 .amis-memv4__accbtn:hover{
  background: rgba(0,0,0,0.04);
}

#amisMemPopoverV4 .amis-memv4__accbtn:focus{
  outline: 2px solid rgba(0,0,0,0.35);
  outline-offset: 2px;
}

#amisMemPopoverV4 .amis-memv4__accpanel{
  padding: 8px 10px 4px 10px;
  color: rgba(0,0,0,0.78);
}

#amisMemPopoverV4 .amis-memv4__list{
  margin: 0;
  padding-left: 18px;
}

#amisMemPopoverV4 .amis-memv4__list li{
  margin: 6px 0;
}

/* Optional: Memory-Icon Badge/Glow (nur wenn du ein passendes Element hast) */
.is-mem-on{
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.18));
}
/* ============================================================================
   HOTFIX – MEMORY POPOVER V4: "Mehr Infos" deutlicher + Text sichtbar
   EINFÜGEORT: ganz ans Ende der chat.css (unter V4)
   ============================================================================ */

#amisMemPopoverV4 .amis-memv4__accbtn{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;

  width: 100%;
  padding: 10px 12px;

  font-size: 14px;
  font-weight: 800;
  color: #111;

  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 12px;

  text-decoration: none;
}

#amisMemPopoverV4 .amis-memv4__accbtn:hover{
  background: rgba(0,0,0,0.08);
}

#amisMemPopoverV4 .amis-memv4__accbtn:focus{
  outline: 2px solid rgba(0,0,0,0.45);
  outline-offset: 2px;
}

/* Pfeil rechts (visuell eindeutig) */
#amisMemPopoverV4 .amis-memv4__accbtn:after{
  content: "▾";
  font-size: 16px;
  line-height: 1;
  opacity: 0.85;
}

/* Wenn aufgeklappt: Pfeil drehen */
#amisMemPopoverV4 .amis-memv4__accbtn[aria-expanded="true"]:after{
  content: "▴";
}

/* Panel-Text sichtbar & gut lesbar */
#amisMemPopoverV4 .amis-memv4__accpanel{
  margin-top: 8px;
  padding: 10px 12px;

  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;

  color: #222;
}

#amisMemPopoverV4 .amis-memv4__list,
#amisMemPopoverV4 .amis-memv4__list li{
  color: #222;
  font-size: 13.5px;
}
/* HOTFIX – MEMORY POPOVER V4: "Mehr Infos" muss sichtbar & deutlich sein */
#amisMemPopoverV4 .amis-memv4__accbtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  color: #111;
  border-radius: 12px;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  text-decoration: none;
}

#amisMemPopoverV4 .amis-memv4__accbtn:focus{
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

#amisMemPopoverV4 .amis-memv4__accbtn::after{
  content: "▾";
  font-weight: 700;
}

#amisMemPopoverV4 .amis-memv4__accbtn[aria-expanded="true"]::after{
  content: "▴";
}

#amisMemPopoverV4 .amis-memv4__accpanel{
  margin-top: 8px;
}
