:root {
    --chat-bg: #f8fafc;
    --chat-border: #e2e8f0;
    --chat-primary: #0ea5e9;
    --chat-primary-strong: #0284c7;
    --chat-muted: #64748b;
}

#chat-panel {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--chat-border);
    background: white;
}

#chat-messages {
    scroll-behavior: smooth;
}

.chat-bubble {
    border-radius: 18px;
    padding: 10px 14px;
    max-width: 80%;
    word-break: break-word;
}

.chat-bubble.user {
    background: var(--chat-primary);
    color: white;
    margin-left: auto;
}

.chat-bubble.agent {
    background: #f8ecd7;
    color: #704214;
    margin-right: auto;
    border: 1px solid #f1d7b3;
}

.chat-bubble.system {
    background: #f1f5f9;
    color: var(--chat-muted);
    margin: 0 auto;
}

.chat-input {
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    padding: 10px 12px;
    outline: none;
    width: 100%;
    resize: none;
    min-height: 44px;
}

.chat-input:focus {
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.chat-send-btn {
    background: var(--chat-primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-send-btn:not(:disabled):active {
    transform: translateY(1px);
    background: var(--chat-primary-strong);
}

.chat-badge {
    background: #dcfce7;
    color: #166534;
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.chat-badge.offline {
    background: #fee2e2;
    color: #991b1b;
}

.chat-form input,
.chat-form textarea {
    width: 100%;
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    padding: 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-form input:focus,
.chat-form textarea:focus {
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.chat-floating-btn {
    box-shadow: 0 15px 35px rgba(14, 165, 233, 0.35);
}

.chat-floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(14, 165, 233, 0.45);
}

@media (max-width: 640px) {
    #chat-panel {
        width: calc(100% - 24px);
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
}
