.mbm-support-chat {
    --mbm-support-chat-accent: #3366ff;
    --mbm-support-chat-panel-bg: #fff;
    --mbm-support-chat-text: #1f2430;
    --mbm-support-chat-muted: rgba(31, 36, 48, 0.64);
    --mbm-support-chat-soft: #f5f7fb;
    --mbm-support-chat-field-bg: #fff;
    --mbm-support-chat-trigger-bg: var(--mbm-support-chat-accent);
    --mbm-support-chat-trigger-color: #fff;
    --mbm-support-chat-panel-width: 380px;
    --mbm-support-chat-radius: 24px;
    color: var(--mbm-support-chat-text);
    font-family: inherit;
    z-index: 1002;
}

.mbm-support-chat--floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: grid;
    justify-items: end;
    gap: 12px;
}

.mbm-support-chat--bottom-left {
    right: auto;
    left: 20px;
    justify-items: start;
}

.mbm-support-chat--inline {
    position: relative;
    display: grid;
    gap: 12px;
    justify-items: start;
}

.mbm-support-chat__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.34), transparent 34%),
        var(--mbm-support-chat-trigger-bg);
    color: var(--mbm-support-chat-trigger-color);
    box-shadow: 0 18px 38px rgba(25, 45, 90, 0.22);
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.mbm-support-chat__trigger:hover,
.mbm-support-chat__trigger:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(25, 45, 90, 0.28);
    filter: saturate(1.05);
}

.mbm-support-chat.is-open .mbm-support-chat__trigger {
    display: none;
}

.mbm-support-chat__trigger:focus-visible,
.mbm-support-chat__close:focus-visible,
.mbm-support-chat__submit:focus-visible,
.mbm-support-chat__whatsapp:focus-visible,
.mbm-support-chat__field:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--mbm-support-chat-accent) 30%, white);
    outline-offset: 2px;
}

.mbm-support-chat__trigger-icon,
.mbm-support-chat__trigger-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.mbm-support-chat__panel {
    width: min(var(--mbm-support-chat-panel-width), calc(100vw - 32px));
    border: 1px solid rgba(20, 31, 56, 0.09);
    border-radius: var(--mbm-support-chat-radius);
    background:
        linear-gradient(145deg, rgba(51, 102, 255, 0.09), rgba(255, 255, 255, 0) 36%),
        var(--mbm-support-chat-panel-bg);
    box-shadow: 0 28px 70px rgba(18, 28, 54, 0.22);
    overflow: hidden;
    transform-origin: bottom right;
}

.mbm-support-chat--bottom-left .mbm-support-chat__panel {
    transform-origin: bottom left;
}

.mbm-support-chat__panel[hidden] {
    display: none;
}

.mbm-support-chat.is-open .mbm-support-chat__panel {
    animation: mbm-support-chat-pop 180ms ease-out both;
}

.mbm-support-chat__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 22px 12px;
}

.mbm-support-chat__eyebrow {
    margin: 0 0 6px;
    color: var(--mbm-support-chat-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.mbm-support-chat__title {
    margin: 0;
    color: var(--mbm-support-chat-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.12;
}

.mbm-support-chat__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.06);
    color: var(--mbm-support-chat-muted);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.mbm-support-chat__close:hover {
    color: var(--mbm-support-chat-text);
    background: rgba(31, 36, 48, 0.1);
}

.mbm-support-chat__intro {
    margin: 0;
    padding: 0 22px 16px;
    color: var(--mbm-support-chat-muted);
    font-size: 14px;
    line-height: 1.55;
}

.mbm-support-chat__log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    margin: 0 14px 14px;
    padding: 0 8px;
    overflow: auto;
    scroll-behavior: smooth;
}

.mbm-support-chat__log:empty {
    display: none;
}

.mbm-support-chat__message-row {
    display: flex;
    flex-direction: column;
    max-width: 86%;
    margin: 0;
}

.mbm-support-chat__message-row.is-visitor {
    align-self: flex-end;
    align-items: flex-end;
}

.mbm-support-chat__message-row.is-agent {
    align-self: flex-start;
    align-items: flex-start;
}

.mbm-support-chat__bubble {
    margin: 0;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.mbm-support-chat__message-row.is-visitor .mbm-support-chat__bubble {
    border-bottom-right-radius: 6px;
    background: var(--mbm-support-chat-accent);
    color: #fff;
}

.mbm-support-chat__message-row.is-agent .mbm-support-chat__bubble {
    border-bottom-left-radius: 6px;
    background: rgba(31, 36, 48, 0.07);
    color: var(--mbm-support-chat-text);
}

.mbm-support-chat__time {
    margin-top: 4px;
    color: var(--mbm-support-chat-muted);
    font-size: 10px;
    line-height: 1;
}

.mbm-support-chat__form {
    display: grid;
    gap: 10px;
    padding: 0 22px 20px;
}

.mbm-support-chat__contact-fields {
    display: grid;
    gap: 10px;
}

.mbm-support-chat.has-profile .mbm-support-chat__contact-fields,
.mbm-support-chat.has-conversation .mbm-support-chat__contact-fields {
    display: none;
}

.mbm-support-chat__honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mbm-support-chat__field {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(31, 36, 48, 0.14);
    border-radius: 14px;
    background: var(--mbm-support-chat-field-bg);
    color: var(--mbm-support-chat-text);
    padding: 12px 14px;
    font: inherit;
    line-height: 1.35;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.mbm-support-chat__field:focus {
    border-color: color-mix(in srgb, var(--mbm-support-chat-accent) 72%, white);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mbm-support-chat-accent) 12%, transparent);
}

.mbm-support-chat__message {
    min-height: 72px;
    resize: vertical;
}

.mbm-support-chat__privacy {
    margin: 0;
    color: var(--mbm-support-chat-muted);
    font-size: 12px;
    line-height: 1.45;
}

.mbm-support-chat__submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    border: 0;
    border-radius: 15px;
    background: var(--mbm-support-chat-accent);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
    transition: transform 160ms ease, filter 160ms ease;
}

.mbm-support-chat__submit:hover {
    transform: translateY(-1px);
    filter: brightness(0.96);
}

.mbm-support-chat__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #fff;
    border-radius: 999px;
}

.mbm-support-chat.is-loading .mbm-support-chat__submit {
    cursor: wait;
    pointer-events: none;
}

.mbm-support-chat.is-loading .mbm-support-chat__spinner {
    display: inline-block;
    animation: mbm-support-chat-spin 800ms linear infinite;
}

.mbm-support-chat__status {
    min-height: 18px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.mbm-support-chat__status.is-success {
    color: #16884f;
}

.mbm-support-chat__status.is-error {
    color: #c04444;
}

.mbm-support-chat__whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 22px 22px;
    min-height: 42px;
    border-radius: 14px;
    background: rgba(37, 211, 102, 0.1);
    color: #147a3e;
    font-weight: 800;
    text-decoration: none;
}

.mbm-support-chat__whatsapp:hover,
.mbm-support-chat__whatsapp:focus-visible {
    color: #0f6533;
    background: rgba(37, 211, 102, 0.15);
}

@keyframes mbm-support-chat-pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes mbm-support-chat-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767px) {
    .mbm-support-chat--floating {
        right: 12px;
        bottom: 12px;
        left: 12px;
        justify-items: stretch;
    }

    .mbm-support-chat__trigger {
        justify-self: end;
    }

    .mbm-support-chat__panel {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mbm-support-chat__trigger,
    .mbm-support-chat__submit,
    .mbm-support-chat__panel {
        animation: none !important;
        transition: none !important;
    }
}
