.bssk-chatbot {
    --bssk-blue: #00336f;
    --bssk-coral: #fd7773;
    --bssk-cream: #fdf9f5;
    --bssk-ink: #18324f;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    font-family: "DM Sans", "Nunito Sans", sans-serif;
}

.bssk-chatbot * {
    box-sizing: border-box;
}

.bssk-chatbot__toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--bssk-blue);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 51, 111, 0.25);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.bssk-chatbot__toggle:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 51, 111, 0.3);
}

.bssk-chatbot__toggle:focus-visible,
.bssk-chatbot button:focus-visible,
.bssk-chatbot input:focus-visible,
.bssk-chatbot a:focus-visible {
    outline: 3px solid rgba(253, 119, 115, 0.65);
    outline-offset: 3px;
}

.bssk-chatbot__icon {
    width: 27px;
    height: 27px;
}

.bssk-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(360px, calc(100vw - 32px));
    max-height: min(600px, calc(100vh - 112px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 51, 111, 0.1);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 51, 111, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 180ms ease, transform 180ms ease;
}

.bssk-chatbot.is-open .bssk-chatbot__panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.bssk-chatbot__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 16px;
    color: #fff;
    background: var(--bssk-blue);
}

.bssk-chatbot__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.bssk-chatbot__subtitle {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
}

.bssk-chatbot__close {
    border: 0;
    padding: 2px 6px;
    color: #fff;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.bssk-chatbot__messages {
    flex: 1;
    min-height: 150px;
    max-height: 330px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bssk-cream);
}

.bssk-chatbot__message {
    width: fit-content;
    max-width: 88%;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 13px;
    color: var(--bssk-ink);
    background: #fff;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-line;
}

.bssk-chatbot__message--user {
    margin-left: auto;
    color: #fff;
    background: var(--bssk-coral);
    border-bottom-right-radius: 4px;
}

.bssk-chatbot__message--assistant {
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 51, 111, 0.06);
}

.bssk-chatbot__message a {
    display: inline-block;
    margin-top: 8px;
    color: var(--bssk-blue);
    font-weight: 800;
    text-decoration: underline;
}

.bssk-chatbot__quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 2px 0 13px;
}

.bssk-chatbot__quick-reply {
    border: 1px solid rgba(0, 51, 111, 0.18);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--bssk-blue);
    background: #fff;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease;
}

.bssk-chatbot__quick-reply:hover {
    border-color: var(--bssk-coral);
    background: #fff4f2;
}

.bssk-chatbot__typing {
    display: flex;
    gap: 4px;
    width: fit-content;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 51, 111, 0.06);
}

.bssk-chatbot__typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--bssk-blue);
    animation: bssk-chatbot-dot 1s infinite ease-in-out;
}

.bssk-chatbot__typing span:nth-child(2) { animation-delay: 120ms; }
.bssk-chatbot__typing span:nth-child(3) { animation-delay: 240ms; }

@keyframes bssk-chatbot-dot {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.bssk-chatbot__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee8e3;
    background: #fff;
}

.bssk-chatbot__input {
    min-width: 0;
    flex: 1;
    border: 1px solid #d8dfe8;
    border-radius: 9px;
    padding: 10px 11px;
    color: var(--bssk-ink);
    font: inherit;
    font-size: 13px;
}

.bssk-chatbot__send {
    width: 40px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--bssk-blue);
    font-size: 18px;
    cursor: pointer;
}

.bssk-chatbot__send:disabled {
    cursor: wait;
    opacity: 0.55;
}

@media (max-width: 480px) {
    .bssk-chatbot {
        right: 16px;
        bottom: 16px;
    }

    .bssk-chatbot__panel {
        right: -4px;
        bottom: 68px;
        max-height: calc(100vh - 96px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bssk-chatbot__toggle,
    .bssk-chatbot__panel,
    .bssk-chatbot__quick-reply {
        transition: none;
    }

    .bssk-chatbot__typing span {
        animation: none;
    }
}
