:root {
    --chatbot-teal: #00AA9B;
    --chatbot-green: #34cc67;
    --chatbot-navy: #172333;
    --chatbot-soft: #f8fafc;
}

.spp-chatbot {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 99999;
    font-family: 'Inter', 'Plus Jakarta Sans', Arial, sans-serif;
}

.spp-chatbot-bubble {
    position: absolute;
    right: 72px;
    bottom: 10px;
    width: max-content;
    max-width: 210px;
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    background: #ffffff;
    color: var(--chatbot-navy);
    font-size: .82rem;
    font-weight: 700;
    box-shadow: 0 14px 34px rgba(23, 35, 51, .16);
    border: 1px solid rgba(0, 170, 155, .16);
    transition: opacity .2s ease, transform .2s ease;
}

.spp-chatbot.is-open .spp-chatbot-bubble {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.spp-chatbot-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--chatbot-teal), var(--chatbot-green));
    box-shadow: 0 18px 38px rgba(0, 170, 155, .34);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease;
}

.spp-chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 46px rgba(0, 170, 155, .4);
}

.spp-chatbot-toggle .bx-x {
    display: none;
}

.spp-chatbot.is-open .spp-chatbot-toggle .bx-message-rounded-dots {
    display: none;
}

.spp-chatbot.is-open .spp-chatbot-toggle .bx-x {
    display: block;
}

.spp-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 360px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(0, 170, 155, .14);
    box-shadow: 0 28px 80px rgba(7, 27, 51, .24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(.98);
    transition: opacity .22s ease, transform .22s ease;
}

.spp-chatbot.is-open .spp-chatbot-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.spp-chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--chatbot-teal), var(--chatbot-green));
}

.spp-chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.spp-chatbot-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.spp-chatbot-header small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: .9;
    font-size: .78rem;
}

.spp-chatbot-header small::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #ffffff;
}

.spp-chatbot-messages {
    height: 310px;
    padding: 16px;
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fffd 100%);
}

.spp-chatbot-message {
    max-width: 88%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: .88rem;
    line-height: 1.5;
}

.spp-chatbot-message.bot {
    color: var(--chatbot-navy);
    background: #eefbf8;
    border-bottom-left-radius: 4px;
}

.spp-chatbot-message.user {
    margin-left: auto;
    color: #ffffff;
    background: var(--chatbot-teal);
    border-bottom-right-radius: 4px;
}

.spp-chatbot-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 58px;
}

.spp-chatbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--chatbot-teal);
    opacity: .35;
    animation: sppChatTyping 1.05s infinite ease-in-out;
}

.spp-chatbot-typing span:nth-child(2) {
    animation-delay: .14s;
}

.spp-chatbot-typing span:nth-child(3) {
    animation-delay: .28s;
}

@keyframes sppChatTyping {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: .35;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.spp-chatbot-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--chatbot-teal);
    font-weight: 800;
    text-decoration: none;
}

.spp-chatbot-quick {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
    background: #f8fffd;
}

.spp-chatbot-quick button {
    flex: 0 0 auto;
    border: 1px solid rgba(0, 170, 155, .22);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--chatbot-teal);
    background: #ffffff;
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer;
}

.spp-chatbot-form {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eef2f6;
    background: #ffffff;
}

.spp-chatbot-form input {
    min-height: 44px;
    border: 1px solid #dfe7ee;
    border-radius: 999px;
    padding: 0 14px;
    font-size: .88rem;
    outline: none;
}

.spp-chatbot-form input:focus {
    border-color: var(--chatbot-teal);
    box-shadow: 0 0 0 .2rem rgba(0, 170, 155, .12);
}

.spp-chatbot-form button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--chatbot-teal);
    font-size: 1.25rem;
    cursor: pointer;
}

@media (max-width: 576px) {
    .spp-chatbot {
        right: 16px;
        bottom: 18px;
    }

    .spp-chatbot-bubble {
        display: none;
    }

    .spp-chatbot-toggle {
        width: 54px;
        height: 54px;
    }

    .spp-chatbot-panel {
        right: -2px;
        bottom: 70px;
        width: calc(100vw - 28px);
        border-radius: 18px;
    }

    .spp-chatbot-messages {
        height: min(54vh, 330px);
    }
}
