.bsscos-chatbot-toggle {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1080;
    width: 68px;
    min-width: 68px;
    height: 68px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 16px 36px rgba(37, 99, 235, .32);
    font-size: 1.7rem;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.bsscos-chatbot-toggle:hover,
.bsscos-chatbot-toggle:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 20px 44px rgba(37, 99, 235, .4);
}

.bsscos-chatbot-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .24);
    outline-offset: 3px;
}

.bsscos-chatbot-toggle.is-open {
    min-width: 68px;
    width: 68px;
    padding: 0;
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.bsscos-chatbot-toggle.is-open .bsscos-chatbot-toggle-label {
    display: none;
}

.bsscos-chatbot-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.bsscos-chatbot-notification {
    position: absolute;
    top: 2px;
    right: 4px;
    width: 13px;
    height: 13px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #22c55e;
}

.bsscos-chatbot-panel {
    position: fixed;
    right: 22px;
    bottom: 94px;
    z-index: 1080;
    width: min(480px, calc(100vw - 28px));
    height: min(720px, calc(100dvh - 120px));
    display: none;
    grid-template-rows: auto auto minmax(190px, 1fr) auto auto auto;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .28);
}

.bsscos-chatbot-panel.is-open {
    display: grid;
    animation: bsscosChatOpen .2s ease-out;
}

.bsscos-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px;
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #0f766e);
}

.bsscos-chatbot-title {
    display: flex;
    align-items: center;
    gap: 11px;
}

.bsscos-chatbot-title strong {
    display: block;
    font-size: 1rem;
    letter-spacing: -.01em;
}

.bsscos-chatbot-title small {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: rgba(255, 255, 255, .86);
    font-size: .72rem;
}

.bsscos-chatbot-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    font-size: 1.35rem;
}

.bsscos-chatbot-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #86efac;
    box-shadow: 0 0 0 3px rgba(134, 239, 172, .17);
}

.bsscos-chatbot-controls {
    display: flex;
    gap: 5px;
}

.bsscos-chatbot-reset,
.bsscos-chatbot-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-size: 1.05rem;
}

.bsscos-chatbot-reset:hover,
.bsscos-chatbot-close:hover,
.bsscos-chatbot-reset:focus-visible,
.bsscos-chatbot-close:focus-visible {
    background: rgba(255, 255, 255, .2);
    outline: 0;
}

.bsscos-chatbot-subtitle {
    padding: 10px 18px;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    background: #fff;
    font-size: .78rem;
    font-weight: 650;
}

.bsscos-chatbot-messages {
    min-height: 190px;
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

.bsscos-chat-message {
    width: fit-content;
    max-width: 88%;
    margin-bottom: 11px;
    padding: 11px 14px;
    border-radius: 16px;
    line-height: 1.5;
    white-space: pre-line;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .06);
}

.bsscos-chat-message.bot {
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 5px;
    color: #1e293b;
    background: #fff;
}

.bsscos-chat-message.user {
    margin-left: auto;
    border-bottom-right-radius: 5px;
    color: #fff;
    background: #2563eb;
}

.bsscos-chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.bsscos-chat-actions a {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid #93c5fd;
    border-radius: 9px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: .76rem;
    font-weight: 750;
    text-decoration: none;
}

.bsscos-chat-actions a::after {
    content: "\2192";
    margin-left: 6px;
}

.bsscos-chatbot-quick {
    min-height: 185px;
    max-height: 245px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
    padding: 14px 16px 17px;
    overflow-y: scroll;
    overscroll-behavior: contain;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    scrollbar-width: auto;
    scrollbar-color: #2563eb #dbeafe;
}

.bsscos-chatbot-quick::-webkit-scrollbar {
    width: 15px;
}

.bsscos-chatbot-quick::-webkit-scrollbar-track {
    border-left: 1px solid #bfdbfe;
    background: #dbeafe;
}

.bsscos-chatbot-quick::-webkit-scrollbar-thumb {
    min-height: 72px;
    border: 3px solid #dbeafe;
    border-radius: 10px;
    background: #2563eb;
}

.bsscos-chatbot-quick-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #475569;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bsscos-chatbot-quick-heading i {
    color: #f59e0b;
}

.bsscos-chatbot-quick button {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: .82rem;
    font-weight: 750;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.bsscos-chatbot-quick button i {
    flex: 0 0 auto;
    font-size: .72rem;
}

.bsscos-chatbot-quick button:hover,
.bsscos-chatbot-quick button:focus-visible {
    transform: translateY(-1px);
    border-color: #2563eb;
    color: #fff;
    background: #2563eb;
    outline: 0;
}

.bsscos-chatbot-form {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.bsscos-chatbot-form input {
    min-width: 0;
    min-height: 54px;
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 15px;
    padding: 13px 16px;
    color: #172033;
    background: #f8fafc;
    font-size: .95rem;
}

.bsscos-chatbot-form input:focus {
    border-color: #2563eb;
    outline: 0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.bsscos-chatbot-form button {
    width: 58px;
    min-width: 58px;
    min-height: 54px;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: #2563eb;
    font-size: 1.15rem;
}

.bsscos-chatbot-form button:hover,
.bsscos-chatbot-form button:focus-visible {
    background: #1d4ed8;
    outline: 0;
}

.bsscos-chatbot-form button:disabled {
    cursor: wait;
    opacity: .6;
}

.bsscos-chatbot-note {
    padding: 0 14px 10px;
    color: #94a3b8;
    background: #fff;
    font-size: .66rem;
    text-align: center;
}

.bsscos-chat-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 54px;
}

.bsscos-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
    animation: bsscosTyping 1s ease-in-out infinite;
}

.bsscos-chat-typing span:nth-child(2) { animation-delay: .14s; }
.bsscos-chat-typing span:nth-child(3) { animation-delay: .28s; }

@keyframes bsscosChatOpen {
    from { transform: translateY(8px) scale(.985); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes bsscosTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 575.98px) {
    .bsscos-chatbot-toggle {
        right: 14px;
        bottom: 14px;
        width: 58px;
        min-width: 58px;
        height: 58px;
        padding: 0;
    }

    .bsscos-chatbot-toggle-label { display: none; }

    .bsscos-chatbot-panel {
        right: 8px;
        bottom: 80px;
        width: calc(100vw - 16px);
        height: min(700px, calc(100dvh - 92px));
        border-radius: 18px;
        grid-template-rows: auto auto minmax(170px, 1fr) auto auto auto;
    }

    .bsscos-chatbot-header { padding: 14px; }
    .bsscos-chatbot-messages { padding: 14px; }

    .bsscos-chatbot-quick {
        min-height: 175px;
        max-height: 230px;
        grid-template-columns: 1fr;
        padding: 13px 14px 15px;
    }

    .bsscos-chatbot-form { padding: 12px; }
    .bsscos-chatbot-form input { min-height: 52px; }
    .bsscos-chatbot-form button { width: 54px; min-width: 54px; min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    .bsscos-chatbot-panel.is-open { animation: none; }
    .bsscos-chatbot-toggle,
    .bsscos-chatbot-quick button { transition: none; }
    .bsscos-chat-typing span { animation: none; opacity: .75; }
}
