.sipaola-chatbot {
    position: fixed;
    right: 20px;
    bottom: 90px; /* keeps clear of the #scrollTopBtn scroll-to-top button */
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    font-family: 'Poppins', system-ui, sans-serif;
}

.chatbot-toggle {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.06);
}

.chatbot-panel {
    width: min(360px, calc(100vw - 40px));
    height: min(480px, calc(100vh - 160px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #0d6efd;
    color: #fff;
}

.chatbot-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.chatbot-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
}

.chatbot-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f6f8fb;
}

.chatbot-msg {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chatbot-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #212529;
    border: 1px solid #e4e8ee;
    border-bottom-left-radius: 4px;
}

.chatbot-msg-user {
    align-self: flex-end;
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-msg-typing {
    color: #6c757d;
    font-style: italic;
}

.chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e4e8ee;
    background: #fff;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.85rem;
    outline: none;
}

.chatbot-input input:focus {
    border-color: #0d6efd;
}

.chatbot-input button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.chatbot-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 576px) {
    .sipaola-chatbot {
        right: 12px;
        bottom: 80px;
    }
}
