.chatai__wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;

    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.chatai__output {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 13px;
    color: #eee;
    display: flex;
    flex-direction: column;
}

.chatai__inputarea {
    border-top: 1px solid #333;
    display: flex;
    padding: 5px;
    gap: 5px;
}

.chatai__input {
    flex: 1;
    resize: none;
    font-size: 13px;
    padding: 5px;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    height: 40px;
}

.chatai__submit {
    padding: 0 12px;
    background: #4ea3ff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.chatai__submit:hover {
    background: #318ee2;
}

.chatai__bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4ea3ff;
    color: white;
    font-size: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
    z-index: 9999;

    opacity: 0.8;
    transition: all 200ms ease-in-out;
}

    .chatai__bubble:hover {
        opacity: 1;
    }

    .chatai__bubble svg {
        margin: 12px;
        width: 26px;
        height: 26px;
    }

.hidden {
    display: none !important;
}

.chatai__header {
    background: #2c2c2c;
    padding: 6px 10px;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.chatai__title {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.chatai__button {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;

    display: flex;
    justify-content: center;
    align-items: center;

    transition: all 200ms ease-in-out;
}

    .chatai__button:hover {
        color: #fff;
    }

.chat__icon {
    display: inline-block;
    vertical-align: middle;
    width: 1em;
    height: 1em;
    fill: currentColor;
    margin-right: 0.4em;
}

/* Optional spezifische Farben */
.chat__icon--trash           { color: #ff4e4e; } /* rot */
.chat__icon--checkCircle     { color: #54ff4e; } /* grün */
.chat__icon--xCircle         { color: #ff4e4e; }
.chat__icon--wifi            { color: #54ff4e; }
.chat__icon--wifiOff         { color: #6c757d; }
.chat__icon--mic             { color: #4ea3ff; }
.chat__icon--bolt            { color: #ffc74e; }
.chat__icon--arrowClockwise  { color: #17a2b8; }


.chatai__status {
    font-size: 12px;
    color: #ccc;
    padding: 4px 10px 4px 4px;
    border-top: 1px solid #333;
    min-height: 18px;
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

    .chatai__status__text {
        display: flex;
        justify-content: center;
        gap: 4px;
    }

    .chatai__status__dot {
        aspect-ratio: 1;
        border-radius: 50%;
        flex: 0 0 9px;
        max-block-size: 9px;
    }

        .chatai__status__dot.success {
            background: #54ff4e;
        }

        .chatai__status__dot.waiting {
            background: #ffc74e;
        }

        .chatai__status__dot.error {
            background: #ff4e4e;
        }

.chatai__message {
    margin: 5px 0;
    --color: #4ea3ff;
    padding: 6px 10px;
    border-radius: 4px;
    max-width: 90%;
    word-break: break-word;
    /*white-space: pre-wrap;*/

    position: relative;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .chatai__message p {
        margin: 0;
    }

    .chatai__message ul {
        margin: 0;
        padding-left: 18px;
    }

    .chatai__message li {
        margin-bottom: 4px;
    }

    .chatai__message a {
        color: var( --color );
        text-decoration: underline;
    }

    .chatai__message a:hover {
        text-decoration: none;
    }

    .chatai__message table {
        border-collapse: collapse;
        margin-block: 6px;
    }

        .chatai__message th {
            background: rgba(0,0,0,0.4);
        }

        .chatai__message td,
        .chatai__message th {
            border: 1px solid #fffa;
            padding: 4px 6px;
            text-align: left;
        }

.chatai__message--user {
    background: #4ea3ff;
    --color: #222;
    color: #fff;
    align-self: flex-end;
}

.chatai__message--assistant {
    background: #333;
    --color: #4ea3ff;
    color: #eee;
    align-self: flex-start;
}

.chatai__message--human {
    background: #3d2346;
    --color: #4ea3ff;
    color: #eee;
    align-self: flex-start;
}

.chatai__message .chatai__button {
    position: absolute;
    top: 0;
    color: #fff;
    opacity: 0.5;
    display: none;
    font-size: 1rem;
}

    .chatai__button:hover {
        opacity: 1;
    }

    .chatai__message[data-id] .chatai__button {
        display: block;
    }

    .chatai__message--user .chatai__button {
        left: -1.5rem;
    }

    .chatai__message--assistant .chatai__button {
        right: -1.5rem;
    }

    .chatai__message--human .chatai__button {
        right: -1.5rem;
    }


.chatai__resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: nwse-resize;
    background: transparent;
}
