.maintenance-chat-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1060;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    box-shadow: 0 12px 28px rgba(30, 64, 175, 0.32);
    font-size: 1.35rem;
}

.maintenance-chat-toggle:hover {
    transform: translateY(-2px);
}

.maintenance-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 130px));
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.maintenance-chat-panel[hidden] {
    display: none;
}

.maintenance-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #5535a5);
}

.maintenance-chat-subtitle {
    margin-top: 2px;
    font-size: 0.75rem;
    opacity: 0.84;
}

.maintenance-chat-messages {
    flex: 1;
    min-height: 100px;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.maintenance-chat-message {
    width: fit-content;
    max-width: 88%;
    margin-bottom: 12px;
    padding: 10px 13px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.maintenance-chat-message-user {
    margin-left: auto;
    color: #fff;
    border-bottom-right-radius: 4px;
    background: #0d6efd;
}

.maintenance-chat-message-assistant {
    margin-right: auto;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    background: #fff;
}

.maintenance-chat-message-error {
    color: #842029;
    border-color: #f5c2c7;
    background: #f8d7da;
}

.maintenance-chat-evidence {
    margin: -4px 0 14px;
    padding: 10px 12px;
    border-left: 3px solid #0d6efd;
    border-radius: 0 10px 10px 0;
    background: #eef5ff;
    font-size: 0.78rem;
}

.maintenance-chat-evidence-row + .maintenance-chat-evidence-row {
    margin-top: 5px;
}

.maintenance-chat-suggestions {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    gap: 7px;
    max-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    scrollbar-gutter: stable;
}

.maintenance-chat-suggestion {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    padding: 8px 10px;
    border: 1px solid #bfd4ff;
    border-radius: 10px;
    color: #0b5ed7;
    background: #f7faff;
    font-size: 0.75rem;
    text-align: left;
}

.maintenance-chat-suggestion:hover,
.maintenance-chat-suggestion:focus-visible {
    border-color: #78a7ff;
    background: #edf4ff;
}

.maintenance-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

#aiProviderTabs .btn {
    min-width: 150px;
}

@media (max-width: 575.98px) {
    .maintenance-chat-toggle {
        right: 16px;
        bottom: 16px;
    }

    .maintenance-chat-panel {
        right: 16px;
        bottom: 82px;
        height: calc(100vh - 108px);
    }

    .maintenance-chat-suggestions {
        max-height: 42vh;
    }
}
