
    #aiChatModal .modal-content {
        display: flex;
        flex-direction: column;
        /*max-height: 90%;*/
    }

    #aiChatModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #aiChatModal .modal-footer {
        flex: 0 0 auto;
    }

    .ai-chat-container {
        width: 100%;
        min-height: 60%;
        overflow: hidden;
        font-size: 1.1em;
    }

    .ai-chat-header {
        padding: 16px;
        font-size: 1.2em;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .ai-chat-messages {
        flex: 1;
        min-height: 0;
        padding: 16px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .ai-chat-message {
        max-width: 80%;
        padding: 14px 24px;
        border-radius: 18px;
        font-size: 1em;
        line-height: 1.4;
        margin-bottom: 2px;
        word-break: break-word;
        position: relative;
    }

    .ai-chat-message.user {
        align-self: flex-end;
        background: var(--cui-light-bg-subtle);
    }

    .ai-chat-message.agent {
        align-self: flex-start;
        max-width: 100% !important;
        margin-left:20px;
        padding-left:30px;
    }

.ai-chat-message.agent::before {
    content: ""; 
    position: absolute;
    left: 0;
    top: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235146e5a0' viewBox='0 0 16 16'><path d='M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.6 26.6 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.93.93 0 0 1-.765.935c-.845.147-2.34.346-4.235.346s-3.39-.2-4.235-.346A.93.93 0 0 1 3 9.219zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a25 25 0 0 1-1.871-.183.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25 25 0 0 0 1.922-.188.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785-.842-1.7a.25.25 0 0 0-.182-.135'/><path d='M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2zM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5'/></svg>") no-repeat center / contain;
    color: #5146e5a0;
}

    .ai-chat-message pre:has(code.language-json) {
        display: none;
    }

    .ai-chat-input-area {
        display: flex;
    }

    .ai-chat-input {
        flex: 1;
        border: 1px solid #d1d1d1;
        border-radius: 20px;
        padding: 10px 16px;
        font-size: 1em;
        outline: none;
        margin-right: 8px;
        transition: border 0.2s;
    }

    .ai-chat-messages p:last-child {
        margin-bottom: 0;
    }

    .ai-chat-messages li p {
        margin-bottom: 0;
    }
    .ai-chat-messages li {
        margin-top: 4px;
    }

    .header-btns {
        margin-left:auto; 
        display:flex; 
        gap:8px; 
        align-items:center;
    }
    pre {
        --cui-alert-bg: transparent;
        --cui-alert-padding-x: 1rem;
        --cui-alert-padding-y: 1rem;
        --cui-alert-margin-bottom: 1rem;
        --cui-alert-color: inherit;
        --cui-alert-border-color: transparent;
        --cui-alert-border: var(--cui-border-width) solid var(--cui-alert-border-color);
        --cui-alert-border-radius: var(--cui-border-radius);
        --cui-alert-link-color: inherit;
        position: relative;
        padding: var(--cui-alert-padding-y) var(--cui-alert-padding-x);
        margin-bottom: var(--cui-alert-margin-bottom);
        color: var(--cui-alert-color);
        background-color: var(--cui-alert-bg);
        border: var(--cui-alert-border);
        border-radius: var(--cui-alert-border-radius);
        --cui-alert-color: var(--cui-light-text-emphasis);
        --cui-alert-bg: var(--cui-light-bg-subtle);
        --cui-alert-border-color: var(--cui-light-border-subtle);
        --cui-alert-link-color: var(--cui-light-text-emphasis);
        text-wrap: auto;
    }