.bmb-chatbot {
    --bmb-chat-black: #11111f;
    --bmb-chat-red: #ff0e14;
    --bmb-chat-red-dark: #d90006;
    --bmb-chat-white: #fff;
    --bmb-chat-grey: #909192;
    --bmb-chat-light-grey: #f5f5f5;
    --bmb-chat-border: #dcdcdc;
    --bmb-chat-muted: #68696b;
    --bmb-chat-surface: var(--bmb-chat-white);
    --bmb-chat-background: var(--bmb-chat-light-grey);
    --bmb-chat-text: var(--bmb-chat-black);
    color: var(--bmb-chat-text);
    font-family: "Lato", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    z-index: 9999;
}

.bmb-chatbot *,
.bmb-chatbot *::before,
.bmb-chatbot *::after {
    box-sizing: border-box;
}

.bmb-chatbot [hidden] {
    display: none !important;
}

.bmb-chatbot button,
.bmb-chatbot textarea {
    font: inherit;
}

.bmb-chatbot__toggle {
    align-items: center;
    background: var(--bmb-chat-white);
    border: 3px solid var(--bmb-chat-white);
    border-radius: 50%;
    bottom: 20px;
    box-shadow: 0 0 0 3px var(--bmb-chat-red), 0 8px 24px rgba(17, 17, 31, 0.3);
    color: var(--bmb-chat-white);
    cursor: pointer;
    display: flex;
    height: 76px;
    justify-content: center;
    padding: 0;
    position: fixed;
    right: 95px;
    transition: box-shadow 160ms ease, transform 160ms ease;
    width: 76px;
}

.bmb-chatbot__prompt {
    background: var(--bmb-chat-black);
    border: 0;
    border-radius: 8px;
    bottom: 114px;
    box-shadow: 0 7px 22px rgba(17, 17, 31, 0.22);
    color: var(--bmb-chat-white);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    max-width: 210px;
    padding: 10px 13px;
    position: fixed;
    right: 28px;
    text-align: left;
}

.bmb-chatbot__prompt::after {
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 9px solid var(--bmb-chat-black);
    bottom: -8px;
    content: "";
    position: absolute;
    right: 92px;
}

.bmb-chatbot__prompt:hover,
.bmb-chatbot__prompt:focus-visible {
    background: var(--bmb-chat-red);
    outline: 3px solid rgba(255, 14, 20, 0.18);
    outline-offset: 2px;
}

.bmb-chatbot__prompt:hover::after,
.bmb-chatbot__prompt:focus-visible::after {
    border-top-color: var(--bmb-chat-red);
}

.bmb-chatbot__toggle:hover,
.bmb-chatbot__toggle:focus-visible {
    background: var(--bmb-chat-white);
    box-shadow: 0 0 0 4px var(--bmb-chat-red), 0 11px 28px rgba(17, 17, 31, 0.36);
    outline: 3px solid transparent;
    transform: translateY(-3px) scale(1.02);
}

.bmb-chatbot__toggle-icon {
    border-radius: 50%;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.bmb-chatbot__panel {
    background: var(--bmb-chat-surface);
    border: 1px solid var(--bmb-chat-border);
    border-radius: 12px;
    box-shadow: 0 16px 46px rgba(17, 17, 31, 0.24);
    display: flex;
    flex-direction: column;
    height: min(620px, calc(100vh - 150px));
    overflow: hidden;
    width: min(390px, calc(100vw - 40px));
}

.bmb-chatbot--floating .bmb-chatbot__panel {
    bottom: 116px;
    position: fixed;
    right: 20px;
}

.bmb-chatbot--embedded .bmb-chatbot__panel {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
    height: min(680px, 80vh);
    max-width: 760px;
    width: 100%;
}

.bmb-chatbot__header {
    align-items: flex-start;
    background: var(--bmb-chat-black);
    border-top: 4px solid var(--bmb-chat-red);
    color: var(--bmb-chat-white);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 16px 17px 15px;
}

.bmb-chatbot__title {
    color: inherit;
    font-family: "Roboto", "Lato", Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.bmb-chatbot__subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    margin: 3px 0 0;
}

.bmb-chatbot__header-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
}

.bmb-chatbot__new-chat,
.bmb-chatbot__close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 5px;
    color: var(--bmb-chat-white);
    cursor: pointer;
}

.bmb-chatbot__new-chat {
    font-size: 12px;
    padding: 5px 8px;
}

.bmb-chatbot__close {
    align-items: center;
    display: flex;
    font-size: 22px;
    height: 29px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 29px;
}

.bmb-chatbot__new-chat:hover,
.bmb-chatbot__new-chat:focus-visible,
.bmb-chatbot__close:hover,
.bmb-chatbot__close:focus-visible {
    background: var(--bmb-chat-red);
    border-color: var(--bmb-chat-red);
}

.bmb-chatbot__new-chat:disabled,
.bmb-chatbot__close:disabled {
    cursor: wait;
    opacity: 0.55;
}

.bmb-chatbot__messages {
    background: var(--bmb-chat-background);
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 16px;
    scroll-behavior: smooth;
}

.bmb-chatbot__message {
    display: flex;
    margin: 0 0 14px;
}

.bmb-chatbot__message--user {
    justify-content: flex-end;
}

.bmb-chatbot__message--assistant {
    justify-content: flex-start;
}

.bmb-chatbot__bubble {
    background: var(--bmb-chat-white);
    border: 1px solid var(--bmb-chat-border);
    border-radius: 12px 12px 12px 3px;
    max-width: 88%;
    overflow-wrap: anywhere;
    padding: 10px 13px;
}

.bmb-chatbot__message--user .bmb-chatbot__bubble {
    background: var(--bmb-chat-red);
    border-color: var(--bmb-chat-red);
    border-radius: 12px 12px 3px 12px;
    color: var(--bmb-chat-white);
}

.bmb-chatbot__message--user .bmb-chatbot__bubble,
.bmb-chatbot__message--user .bmb-chatbot__bubble p,
.bmb-chatbot__message--user .bmb-chatbot__bubble li,
.bmb-chatbot__message--user .bmb-chatbot__bubble strong,
.bmb-chatbot__message--user .bmb-chatbot__bubble code {
    color: var(--bmb-chat-white);
}

.bmb-chatbot__bubble > :first-child {
    margin-top: 0;
}

.bmb-chatbot__bubble > :last-child {
    margin-bottom: 0;
}

.bmb-chatbot__bubble p,
.bmb-chatbot__bubble ul,
.bmb-chatbot__bubble ol,
.bmb-chatbot__bubble pre,
.bmb-chatbot__bubble h3,
.bmb-chatbot__bubble h4,
.bmb-chatbot__bubble h5 {
    font-size: inherit;
    line-height: inherit;
    margin: 0.55em 0;
}

.bmb-chatbot__bubble h3,
.bmb-chatbot__bubble h4,
.bmb-chatbot__bubble h5 {
    font-weight: 700;
}

.bmb-chatbot__bubble ul,
.bmb-chatbot__bubble ol {
    padding-left: 1.4em;
}

.bmb-chatbot__bubble li + li {
    margin-top: 0.25em;
}

.bmb-chatbot__bubble code {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
    padding: 0.1em 0.25em;
}

.bmb-chatbot__bubble pre {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    overflow-x: auto;
    padding: 8px;
}

.bmb-chatbot__bubble pre code {
    background: none;
    padding: 0;
}

.bmb-chatbot__message--user a {
    color: var(--bmb-chat-white);
    text-decoration: underline;
}

.bmb-chatbot__message--assistant a {
    color: var(--bmb-chat-red-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bmb-chatbot__thinking .bmb-chatbot__bubble {
    align-items: center;
    display: flex;
    gap: 5px;
    min-height: 38px;
}

.bmb-chatbot__thinking span {
    animation: bmb-chatbot-thinking 1.2s infinite ease-in-out both;
    background: var(--bmb-chat-red);
    border-radius: 50%;
    height: 7px;
    width: 7px;
}

.bmb-chatbot__thinking span:nth-child(2) {
    animation-delay: 150ms;
}

.bmb-chatbot__thinking span:nth-child(3) {
    animation-delay: 300ms;
}

.bmb-chatbot__status {
    background: var(--bmb-chat-surface);
    color: var(--bmb-chat-muted);
    font-size: 12px;
    margin: 0;
    min-height: 0;
    padding: 0 14px;
}

.bmb-chatbot__status:not(:empty) {
    padding-bottom: 7px;
    padding-top: 7px;
}

.bmb-chatbot__status--error {
    color: var(--bmb-chat-red-dark);
}

.bmb-chatbot__composer {
    align-items: flex-end;
    background: var(--bmb-chat-surface);
    border-top: 1px solid var(--bmb-chat-border);
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 11px;
}

.bmb-chatbot__input {
    border: 1px solid var(--bmb-chat-grey);
    border-radius: 6px;
    flex: 1 1 auto;
    line-height: 1.4;
    max-height: 120px;
    min-height: 42px;
    padding: 10px;
    resize: none;
}

.bmb-chatbot__input:focus {
    border-color: var(--bmb-chat-red);
    box-shadow: 0 0 0 3px rgba(255, 14, 20, 0.14);
    outline: 0;
}

.bmb-chatbot__send {
    background: var(--bmb-chat-red);
    border: 0;
    border-radius: 6px;
    color: var(--bmb-chat-white);
    cursor: pointer;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 15px;
}

.bmb-chatbot__send:hover,
.bmb-chatbot__send:focus-visible {
    background: var(--bmb-chat-red-dark);
    outline: 3px solid rgba(255, 14, 20, 0.18);
    outline-offset: 1px;
}

.bmb-chatbot__send:disabled,
.bmb-chatbot__input:disabled {
    cursor: wait;
    opacity: 0.58;
}

@keyframes bmb-chatbot-thinking {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@media (max-width: 520px) {
    .bmb-chatbot__toggle {
        bottom: 14px;
        right: 89px;
    }

    .bmb-chatbot__prompt {
        bottom: 108px;
        right: 22px;
    }

    .bmb-chatbot--floating .bmb-chatbot__panel {
        border-radius: 0;
        border-width: 0;
        bottom: 0;
        height: 100dvh;
        right: 0;
        width: 100vw;
    }

    .bmb-chatbot__header {
        padding-top: max(15px, env(safe-area-inset-top));
    }

    .bmb-chatbot__composer {
        padding-bottom: max(11px, env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .bmb-chatbot__toggle,
    .bmb-chatbot__messages {
        scroll-behavior: auto;
        transition: none;
    }

    .bmb-chatbot__thinking span {
        animation: none;
    }
}
