:root {
    --rbj-chat-red: #e31741;
    --rbj-chat-red-dark: #8f102c;
    --rbj-chat-panel: #0d0e11;
    --rbj-chat-surface: #17191e;
    --rbj-chat-surface-2: #202329;
    --rbj-chat-line: rgba(255, 255, 255, .1);
    --rbj-chat-text: #f7f7f8;
    --rbj-chat-muted: #9a9da6;
    --rbj-chat-success: #35c875;
    --rbj-chat-warning: #f1aa39;
    --rbj-floating-right: 18px;
    --rbj-floating-bottom: 18px;
    --rbj-floating-control-size: 50px;
    --rbj-floating-control-radius: 18px;
    --rbj-floating-control-icon-size: 1.35rem;
    --rbj-panel-bottom: 86px;
    --rbj-chat-panel-max-height: calc(100dvh - 124px);
}

html[data-theme="light"] {
    --rbj-chat-panel: #fffaf9;
    --rbj-chat-surface: #fff2f2;
    --rbj-chat-surface-2: #ffffff;
    --rbj-chat-line: rgba(96, 39, 47, .16);
    --rbj-chat-text: #311915;
    --rbj-chat-muted: #725551;
    --rbj-chat-success: #168450;
    --rbj-chat-warning: #a46708;
}

.rbj-floating-stack {
    position: fixed;
    right: var(--rbj-floating-right);
    bottom: var(--rbj-floating-bottom);
    z-index: 1190;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.rbj-floating-stack > button {
    pointer-events: auto;
}

body .rbj-chat-launcher,
body .rbj-customer-scroll-top {
    position: relative;
    width: var(--rbj-floating-control-size);
    height: var(--rbj-floating-control-size);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--rbj-floating-control-radius);
    cursor: pointer;
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease;
}

body .rbj-chat-launcher {
    border: 1px solid rgba(255, 255, 255, .18);
    background: linear-gradient(145deg, #ef1748, #a60d2f);
    color: #fff;
    box-shadow: 0 18px 44px rgba(114, 5, 33, .42), inset 0 1px rgba(255, 255, 255, .18);
}

body .rbj-chat-launcher.is-hidden-by-panel {
    display: none;
}

body .rbj-chat-launcher i,
body .rbj-customer-scroll-top i {
    font-size: var(--rbj-floating-control-icon-size);
    line-height: 1;
}

body .rbj-chat-launcher:hover {
    transform: translateY(-3px) rotate(-2deg);
}

body .rbj-chat-launcher::after {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 5px;
    width: 11px;
    height: 11px;
    border: 3px solid #15161a;
    border-radius: 50%;
    background: var(--rbj-chat-success);
}

body .rbj-chat-launcher[data-state="away"]::after,
body .rbj-chat-launcher[data-state="automation"]::after,
body .rbj-chat-launcher[data-state="waiting"]::after { background: var(--rbj-chat-warning); }
body .rbj-chat-launcher[data-state="offline"]::after,
body .rbj-chat-launcher[data-state="disconnected"]::after { background: #777b84; }

body .rbj-chat-badge {
    position: absolute;
    display: none;
    align-items: center;
    justify-content: center;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 3px solid #101115;
    background: #fff;
    color: #9d0d2d;
    font-size: 10px;
    font-weight: 900;
}

body .rbj-customer-scroll-top {
    border: 1px solid rgba(255, 255, 255, .16);
    background: linear-gradient(145deg, #e31741, #900d2b);
    color: #fff;
    box-shadow: 0 18px 42px rgba(114, 5, 33, .34), inset 0 1px rgba(255, 255, 255, .18);
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
}

body .rbj-customer-scroll-top.is-visible {
    display: inline-grid;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body .rbj-chat-launcher:focus-visible,
body .rbj-customer-scroll-top:focus-visible {
    outline: 3px solid rgba(255, 92, 125, .42);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    body .rbj-chat-launcher,
    body .rbj-customer-scroll-top {
        transition: none;
    }

    body .rbj-chat-launcher:hover {
        transform: none;
    }
}

body .rbj-chat-panel {
    position: fixed;
    width: min(400px, calc(100vw - 28px));
    height: min(540px, var(--rbj-chat-panel-max-height));
    min-height: min(320px, var(--rbj-chat-panel-max-height));
    max-height: var(--rbj-chat-panel-max-height);
    right: var(--rbj-floating-right);
    bottom: var(--rbj-panel-bottom);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 24px;
    background:
        radial-gradient(circle at 95% 0, rgba(227, 23, 65, .18), transparent 31%),
        var(--rbj-chat-panel);
    color: var(--rbj-chat-text);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .58), 0 0 0 1px rgba(0, 0, 0, .4);
    z-index: 1200;
}

body .rbj-chat-panel.show {
    display: flex;
    animation: rbj-chat-enter .24s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes rbj-chat-enter {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

body .rbj-chat-head {
    min-height: 72px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border-bottom: 1px solid var(--rbj-chat-line);
    background: rgba(13, 14, 17, .88);
    backdrop-filter: blur(18px);
}

body .rbj-chat-brand-avatar {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

body .rbj-chat-brand-avatar img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

body .rbj-chat-head .title-wrap {
    min-width: 0;
    display: grid;
    gap: 4px;
}

body .rbj-chat-head .title-wrap strong {
    overflow: hidden;
    color: var(--rbj-chat-text);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .rbj-chat-head .title-wrap strong.rbj-chat-brand-title {
    font-family: var(--rbj-brand-font);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: var(--rbj-brand-letter-spacing);
    text-transform: uppercase;
}

body .rbj-chat-head .title-wrap span {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    color: var(--rbj-chat-muted);
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .rbj-chat-head .title-wrap span i {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #747780;
}

body .rbj-chat-head .title-wrap span[data-state="available"] i,
body .rbj-chat-head .title-wrap span[data-state="online"] i { background: var(--rbj-chat-success); }
body .rbj-chat-head .title-wrap span[data-state="away"] i,
body .rbj-chat-head .title-wrap span[data-state="automation"] i,
body .rbj-chat-head .title-wrap span[data-state="waiting"] i { background: var(--rbj-chat-warning); }
body .rbj-chat-head .title-wrap span[data-state="offline"] i,
body .rbj-chat-head .title-wrap span[data-state="disconnected"] i { background: #777b84; }

body .rbj-chat-head-actions {
    display: flex;
    gap: 5px;
}

body .rbj-chat-head-actions button,
body .rbj-chat-head-actions a {
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #d9dae0;
    font-size: 19px;
    text-decoration: none;
}

body .rbj-chat-head-actions button:hover,
body .rbj-chat-head-actions a:hover {
    border-color: var(--rbj-chat-line);
    background: rgba(255, 255, 255, .06);
}

body .rbj-chat-connection {
    position: absolute;
    top: 74px;
    left: 50%;
    z-index: 4;
    max-width: calc(100% - 32px);
    padding: 5px 10px;
    border: 1px solid var(--rbj-chat-line);
    border-radius: 999px;
    background: rgba(25, 27, 32, .94);
    color: var(--rbj-chat-muted);
    font-size: 9px;
    font-weight: 800;
    transform: translateX(-50%);
    transition: opacity .2s ease;
}

body .rbj-chat-connection[data-state="connected"] { opacity: 0; pointer-events: none; }
body .rbj-chat-connection[data-state="reconnecting"] { color: #ffd58b; }
body .rbj-chat-connection[data-state="offline"] { color: #ff9aae; }

body .rbj-chat-body {
    flex: 0 0 auto;
    display: grid;
    gap: 6px;
    padding: 0 12px;
}

body .rbj-chat-body:empty { display: none; }

body .rbj-chat-retry-load {
    justify-self: center;
    padding: 6px 12px;
    border: 1px solid rgba(227, 23, 65, .45);
    border-radius: 999px;
    background: rgba(227, 23, 65, .1);
    color: #ffc4d0;
    font-size: 10px;
    font-weight: 800;
}

body .rbj-chat-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body .rbj-chat-feed {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 11px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 13px 22px;
    overscroll-behavior: contain;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
    scrollbar-width: thin;
}

body .rbj-chat-feed::-webkit-scrollbar { width: 6px; }
body .rbj-chat-feed::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255, 255, 255, .2); }

body .rbj-chat-empty,
body .rbj-chat-loading {
    min-height: 100%;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    padding: 32px;
    color: var(--rbj-chat-muted);
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
}

body .rbj-chat-empty strong { color: var(--rbj-chat-text); font-size: 15px; }

body .rbj-chat-empty__mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: 3px;
    border: 1px solid rgba(227, 23, 65, .3);
    border-radius: 18px;
    background: rgba(227, 23, 65, .1);
    color: #ff6b89;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .08em;
}

body .rbj-chat-loading i { color: #ff5375; font-size: 25px; }

body .rbj-chat-msg {
    width: fit-content;
    max-width: 82%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    animation: rbj-message-enter .18s ease both;
}

@keyframes rbj-message-enter {
    from { opacity: 0; transform: translateY(5px); }
}

body .rbj-chat-msg.customer { align-self: flex-end; align-items: flex-end; }
body .rbj-chat-msg.staff,
body .rbj-chat-msg.automation { align-self: flex-start; }
body .rbj-chat-msg.system { align-self: center; max-width: 92%; align-items: center; }
body .rbj-chat-msg.is-grouped { margin-top: -6px; }

body .rbj-chat-identity {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 5px;
    color: #d9dbe1;
    font-size: 9.5px;
    font-weight: 850;
}

body .rbj-chat-identity__avatar {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #2b2e35;
    color: #fff;
    font-size: 8px;
}

body .rbj-chat-msg.automation .rbj-chat-identity__avatar {
    background: linear-gradient(145deg, #b10e33, #4c0a1b);
}

body .rbj-chat-identity small {
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(227, 23, 65, .14);
    color: #ffb7c6;
    font-size: 7px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

body .rbj-chat-bubble {
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 17px 17px 17px 5px;
    background: var(--rbj-chat-surface-2);
    color: var(--rbj-chat-text);
    box-shadow: 0 4px 15px rgba(0, 0, 0, .16);
}

body .rbj-chat-msg.customer .rbj-chat-bubble {
    border-color: rgba(255, 91, 124, .28);
    border-radius: 17px 17px 5px 17px;
    background: linear-gradient(145deg, #a41031, #6d0b23);
    color: #fff;
}

body .rbj-chat-msg.automation .rbj-chat-bubble {
    border-color: rgba(227, 23, 65, .22);
    background: linear-gradient(145deg, #282126, #202126);
}

body .rbj-chat-msg.system .rbj-chat-bubble {
    padding: 7px 11px;
    border-style: dashed;
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
    color: #c3c5cc;
    text-align: center;
    box-shadow: none;
}

body .rbj-chat-msg-text {
    overflow-wrap: anywhere;
    font-size: 12.5px;
    line-height: 1.5;
    white-space: pre-wrap;
}

body .rbj-chat-meta {
    min-height: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 5px;
    color: #7f828b;
    font-size: 8px;
}

body .rbj-chat-meta .status { color: #b7bac2; font-weight: 800; }
body .rbj-chat-meta[hidden],
body .rbj-chat-meta .time[hidden] { display: none; }
body .rbj-chat-msg.is-failed .rbj-chat-meta .status { color: #ff829a; }

body .rbj-chat-retry-message {
    padding: 1px 0;
    border: 0;
    background: transparent;
    color: #ff8ca3;
    font-size: 8px;
    font-weight: 900;
    text-decoration: underline;
}

body .rbj-chat-date-separator,
body .rbj-chat-unread-divider {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #777a82;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body .rbj-chat-date-separator::before,
body .rbj-chat-date-separator::after,
body .rbj-chat-unread-divider::before,
body .rbj-chat-unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, .07);
}

body .rbj-chat-unread-divider { color: #ff708d; }

body .rbj-chat-attachment {
    display: grid;
    gap: 6px;
    min-width: 140px;
}

body .rbj-chat-attachment img {
    width: min(230px, 100%);
    max-height: 210px;
    display: block;
    border-radius: 12px;
    object-fit: cover;
}

body .rbj-chat-attachment a,
body .rbj-chat-attachment span {
    color: inherit;
    font-size: 9px;
    overflow-wrap: anywhere;
}

body .rbj-chat-presence {
    position: absolute;
    left: 14px;
    bottom: 7px;
    z-index: 2;
    padding: 5px 9px;
    border: 1px solid var(--rbj-chat-line);
    border-radius: 999px;
    background: rgba(23, 25, 30, .94);
    color: #b8bbc3;
    font-size: 9px;
}

body .rbj-chat-typing-dots { display: inline-flex; gap: 3px; margin-right: 5px; }
body .rbj-chat-typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: #ff6685; animation: rbj-dot 1s infinite alternate; }
body .rbj-chat-typing-dots i:nth-child(2) { animation-delay: .18s; }
body .rbj-chat-typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes rbj-dot { to { opacity: .25; transform: translateY(-2px); } }

body .rbj-chat-jump-latest {
    position: absolute;
    right: 14px;
    bottom: 10px;
    z-index: 3;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(27, 29, 34, .96);
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
    font-size: 9px;
    font-weight: 850;
}

body .rbj-chat-jump-latest[hidden],
body .rbj-chat-presence[hidden],
body .rbj-chat-attachment-card[hidden] { display: none; }

body .rbj-chat-jump-latest i { color: #ff587a; font-size: 17px; }

body .rbj-chat-waiting {
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    margin: 0 12px 7px;
    padding: 7px 10px;
    border: 1px solid rgba(241, 170, 57, .18);
    border-radius: 11px;
    background: rgba(241, 170, 57, .07);
    color: #d5c096;
    font-size: 9px;
    font-weight: 750;
}

body .rbj-chat-waiting[hidden],
body .rbj-chat-quick-replies[hidden] { display: none; }
body .rbj-chat-waiting:not([hidden]) { display: flex; }
body .rbj-chat-waiting i { width: 7px; height: 7px; border-radius: 50%; background: #f1aa39; }

body .rbj-chat-quick-replies {
    flex: 0 0 auto;
    max-height: 106px;
    overflow-y: auto;
    padding: 0 12px 9px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

body .rbj-chat-quick-reply {
    min-height: 31px;
    padding: 6px 10px;
    border: 1px solid rgba(227, 23, 65, .48);
    border-radius: 999px;
    background: rgba(227, 23, 65, .07);
    color: #ffd7df;
    font-size: 9px;
    font-weight: 800;
}

body .rbj-chat-quick-reply:hover,
body .rbj-chat-quick-reply:focus-visible { background: rgba(227, 23, 65, .18); outline: none; }
body .rbj-chat-quick-reply:disabled { opacity: .45; cursor: wait; }

body .rbj-chat-form {
    flex: 0 0 auto;
    display: grid;
    gap: 7px;
    padding: 9px 10px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--rbj-chat-line);
    background: rgba(13, 14, 17, .96);
}

body .rbj-chat-form-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 38px;
    align-items: end;
    gap: 7px;
}

body .rbj-chat-attach,
body #rbjChatSend {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--rbj-chat-line);
    border-radius: 13px;
    background: var(--rbj-chat-surface);
    color: #d4d6dc;
    font-size: 21px;
    cursor: pointer;
}

body .rbj-chat-attach input { display: none; }

body .rbj-chat-attach:hover,
body .rbj-chat-attach:focus-within,
body #rbjChatSend:not(:disabled):hover,
body #rbjChatSend:focus-visible,
body .rbj-chat-head-actions button:focus-visible,
body .rbj-chat-head-actions a:focus-visible {
    border-color: rgba(227, 23, 65, .48);
    box-shadow: 0 0 0 3px rgba(227, 23, 65, .16);
    outline: none;
}

body #rbjChatInput {
    width: 100%;
    min-height: 38px;
    max-height: 106px;
    resize: none;
    overflow-y: auto;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 17px;
    outline: none;
    background: var(--rbj-chat-surface);
    color: var(--rbj-chat-text);
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
}

body #rbjChatInput:focus { border-color: rgba(227, 23, 65, .58); box-shadow: 0 0 0 3px rgba(227, 23, 65, .08); }
body #rbjChatInput::placeholder { color: #777a83; }

body #rbjChatSend {
    width: 38px;
    height: 38px;
    border: 0;
    background: linear-gradient(145deg, #f11a4b, #a70c30);
    color: #fff;
    box-shadow: 0 8px 18px rgba(148, 8, 41, .3);
}

body #rbjChatSend:disabled { background: #292c32; color: #676a73; box-shadow: none; cursor: default; }

body .rbj-chat-composer-hint {
    padding-left: 43px;
    color: #8d9099;
    font-size: 9px;
}

body .rbj-chat-attachment-card {
    align-items: center;
    grid-template-columns: 38px minmax(0, 1fr) 28px;
    gap: 8px;
    padding: 7px;
    border: 1px solid var(--rbj-chat-line);
    border-radius: 13px;
    background: var(--rbj-chat-surface);
}

body .rbj-chat-attachment-card:not([hidden]) { display: grid; }

body .rbj-chat-attachment-thumb {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: #2b2e35;
    color: #ff6685;
}

body .rbj-chat-attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
body .rbj-chat-attachment-meta { min-width: 0; }
body .rbj-chat-attachment-name { overflow: hidden; color: #e5e6e9; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
body .rbj-chat-attachment-type { color: var(--rbj-chat-muted); font-size: 8px; }

body .rbj-chat-attach-clear {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #aeb0b7;
    font-size: 17px;
}

body .rbj-chat-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(3, 4, 7, .78);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

body .rbj-chat-lightbox.show {
    display: flex;
    pointer-events: auto;
}

body .rbj-chat-lightbox-inner {
    position: relative;
    max-width: min(860px, 100%);
    max-height: min(720px, 100%);
    display: grid;
    gap: 10px;
    justify-items: center;
}

body .rbj-chat-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 13px;
    background: #17191e;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .36);
}

body .rbj-chat-lightbox-close:focus-visible {
    outline: 3px solid rgba(255, 92, 125, .42);
    outline-offset: 3px;
}

body .rbj-chat-lightbox img {
    max-width: 100%;
    max-height: min(70dvh, 620px);
    display: block;
    border-radius: 18px;
    object-fit: contain;
    background: #111217;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
}

body .rbj-chat-lightbox img[hidden] {
    display: none;
}

body .rbj-chat-lightbox-caption {
    max-width: min(720px, 100%);
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(17, 18, 23, .82);
    color: rgba(255, 255, 255, .78);
    font-size: 11px;
    font-weight: 750;
    text-align: center;
}

body .rbj-ai-chat-panel {
    position: fixed;
    right: var(--rbj-floating-right);
    bottom: var(--rbj-panel-bottom);
    z-index: 1200;
    width: min(380px, calc(100vw - 28px));
    max-height: min(560px, var(--rbj-chat-panel-max-height));
    display: none;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 24px;
    background:
        radial-gradient(circle at 95% 0, rgba(227, 23, 65, .2), transparent 32%),
        var(--rbj-chat-panel);
    color: var(--rbj-chat-text);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .58), 0 0 0 1px rgba(0, 0, 0, .38);
}

body .rbj-ai-chat-panel.show {
    display: grid;
    animation: rbj-chat-enter .24s cubic-bezier(.2, .8, .2, 1) both;
}

body .rbj-ai-chat-headbar {
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--rbj-chat-line);
    background: rgba(13, 14, 17, .9);
    backdrop-filter: blur(18px);
}

body .rbj-ai-chat-headbar .title-wrap {
    min-width: 0;
    display: grid;
    gap: 4px;
}

body .rbj-ai-chat-headbar strong {
    color: var(--rbj-chat-text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
}

body .rbj-ai-chat-headbar span {
    overflow: hidden;
    color: var(--rbj-chat-muted);
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .rbj-ai-chat-headbar button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #d9dae0;
    font-size: 20px;
}

body .rbj-ai-chat-headbar button:hover,
body .rbj-ai-chat-headbar button:focus-visible {
    border-color: var(--rbj-chat-line);
    background: rgba(255, 255, 255, .06);
    outline: none;
}

body .rbj-ai-chat-helper {
    padding: 10px 15px;
    border-bottom: 1px solid var(--rbj-chat-line);
    color: var(--rbj-chat-muted);
    font-size: 10px;
    line-height: 1.45;
}

body .rbj-ai-chat-quick {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 10px 15px;
    border-bottom: 1px solid var(--rbj-chat-line);
    scrollbar-width: thin;
}

body .rbj-ai-chat-quick button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(227, 23, 65, .42);
    border-radius: 999px;
    background: rgba(227, 23, 65, .08);
    color: #ffd7df;
    font-size: 9px;
    font-weight: 850;
}

body .rbj-ai-chat-quick button:hover,
body .rbj-ai-chat-quick button:focus-visible {
    background: rgba(227, 23, 65, .18);
    outline: none;
}

body .rbj-ai-chat-quick button:disabled {
    opacity: .45;
    cursor: wait;
}

body .rbj-ai-chat-feed {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 15px;
    overscroll-behavior: contain;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
    scrollbar-width: thin;
}

body .rbj-ai-chat-empty {
    margin: auto;
    max-width: 28ch;
    color: var(--rbj-chat-muted);
    text-align: center;
    font-size: 11px;
    line-height: 1.55;
}

body .rbj-ai-chat-msg {
    width: fit-content;
    max-width: 86%;
    display: flex;
    animation: rbj-message-enter .18s ease both;
}

body .rbj-ai-chat-msg.user {
    align-self: flex-end;
}

body .rbj-ai-chat-msg.assistant {
    align-self: flex-start;
}

body .rbj-ai-chat-bubble {
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 17px 17px 17px 5px;
    background: var(--rbj-chat-surface-2);
    color: var(--rbj-chat-text);
    box-shadow: 0 4px 15px rgba(0, 0, 0, .16);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body .rbj-ai-chat-msg.user .rbj-ai-chat-bubble {
    border-color: rgba(255, 91, 124, .28);
    border-radius: 17px 17px 5px 17px;
    background: linear-gradient(145deg, #a41031, #6d0b23);
    color: #fff;
}

body .rbj-ai-chat-form {
    display: grid;
    gap: 7px;
    padding: 10px;
    border-top: 1px solid var(--rbj-chat-line);
    background: rgba(13, 14, 17, .96);
}

body .rbj-ai-chat-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: end;
    gap: 7px;
}

body #rbjAiChatInput {
    width: 100%;
    min-height: 38px;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 17px;
    outline: none;
    background: var(--rbj-chat-surface);
    color: var(--rbj-chat-text);
    font: inherit;
    font-size: 11px;
}

body #rbjAiChatInput:focus {
    border-color: rgba(227, 23, 65, .58);
    box-shadow: 0 0 0 3px rgba(227, 23, 65, .08);
}

body #rbjAiChatInput::placeholder {
    color: #777a83;
}

body #rbjAiChatSendBtn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(145deg, #f11a4b, #a70c30);
    color: #fff;
    box-shadow: 0 8px 18px rgba(148, 8, 41, .3);
}

body #rbjAiChatSendBtn:disabled {
    background: #292c32;
    color: #676a73;
    box-shadow: none;
    cursor: default;
}

body .rbj-ai-chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #686b74;
    font-size: 9px;
}

body .rbj-ai-chat-actions button {
    border: 0;
    background: transparent;
    color: #ff8ca3;
    font-size: 9px;
    font-weight: 900;
}

html[data-theme="light"] body .rbj-chat-launcher::after {
    border-color: #fffaf9;
}

html[data-theme="light"] body .rbj-chat-badge {
    border-color: #fffaf9;
    background: #9d0d2d;
    color: #fff;
}

html[data-theme="light"] body .rbj-customer-scroll-top {
    border-color: rgba(96, 39, 47, .14);
    background: linear-gradient(145deg, #e31741, #9d0d2d);
    box-shadow: 0 18px 36px rgba(82, 32, 38, .18), inset 0 1px rgba(255, 255, 255, .2);
}

html[data-theme="light"] body .rbj-chat-panel,
html[data-theme="light"] body .rbj-ai-chat-panel {
    border-color: rgba(96, 39, 47, .18);
    background:
        radial-gradient(circle at 95% 0, rgba(227, 23, 65, .12), transparent 31%),
        var(--rbj-chat-panel);
    box-shadow: 0 28px 70px rgba(82, 32, 38, .22), 0 0 0 1px rgba(96, 39, 47, .08);
}

html[data-theme="light"] body .rbj-chat-head,
html[data-theme="light"] body .rbj-chat-form,
html[data-theme="light"] body .rbj-ai-chat-headbar,
html[data-theme="light"] body .rbj-ai-chat-form {
    background: rgba(255, 250, 249, .96);
}

html[data-theme="light"] body .rbj-chat-head-actions button,
html[data-theme="light"] body .rbj-chat-head-actions a,
html[data-theme="light"] body .rbj-ai-chat-headbar button {
    color: #513632;
}

html[data-theme="light"] body .rbj-chat-head-actions button:hover,
html[data-theme="light"] body .rbj-chat-head-actions a:hover,
html[data-theme="light"] body .rbj-ai-chat-headbar button:hover,
html[data-theme="light"] body .rbj-ai-chat-headbar button:focus-visible {
    background: rgba(217, 4, 41, .08);
}

html[data-theme="light"] body .rbj-chat-connection,
html[data-theme="light"] body .rbj-chat-presence,
html[data-theme="light"] body .rbj-chat-jump-latest {
    background: rgba(255, 255, 255, .96);
    color: #6b4b47;
}

html[data-theme="light"] body .rbj-chat-empty,
html[data-theme="light"] body .rbj-chat-loading,
html[data-theme="light"] body .rbj-ai-chat-empty,
html[data-theme="light"] body .rbj-ai-chat-helper,
html[data-theme="light"] body .rbj-ai-chat-actions {
    color: var(--rbj-chat-muted);
}

html[data-theme="light"] body .rbj-chat-empty strong {
    color: var(--rbj-chat-text);
}

html[data-theme="light"] body .rbj-chat-identity {
    color: #5f4541;
}

html[data-theme="light"] body .rbj-chat-identity__avatar {
    background: #f0dadd;
    color: #7a211b;
}

html[data-theme="light"] body .rbj-chat-identity small {
    background: rgba(217, 4, 41, .08);
    color: #8a3844;
}

html[data-theme="light"] body .rbj-chat-bubble,
html[data-theme="light"] body .rbj-ai-chat-bubble {
    border-color: rgba(96, 39, 47, .12);
    background: #fff;
    color: var(--rbj-chat-text);
    box-shadow: 0 8px 22px rgba(82, 32, 38, .08);
}

html[data-theme="light"] body .rbj-chat-msg.customer .rbj-chat-bubble,
html[data-theme="light"] body .rbj-ai-chat-msg.user .rbj-ai-chat-bubble {
    border-color: rgba(174, 12, 48, .22);
    background: linear-gradient(145deg, #c70e39, #8e102e);
    color: #fff;
}

html[data-theme="light"] body .rbj-chat-msg.automation .rbj-chat-bubble,
html[data-theme="light"] body .rbj-chat-msg.staff .rbj-chat-bubble {
    background: #ffffff;
    color: var(--rbj-chat-text);
}

html[data-theme="light"] body .rbj-chat-msg.system .rbj-chat-bubble {
    border-color: rgba(217, 4, 41, .16);
    background: rgba(217, 4, 41, .045);
    color: #6b3635;
}

html[data-theme="light"] body .rbj-chat-meta,
html[data-theme="light"] body .rbj-chat-date-separator {
    color: #806965;
}

html[data-theme="light"] body .rbj-chat-meta .status,
html[data-theme="light"] body .rbj-chat-unread-divider {
    color: #9d0d2d;
}

html[data-theme="light"] body .rbj-chat-date-separator::before,
html[data-theme="light"] body .rbj-chat-date-separator::after,
html[data-theme="light"] body .rbj-chat-unread-divider::before,
html[data-theme="light"] body .rbj-chat-unread-divider::after {
    background: rgba(96, 39, 47, .14);
}

html[data-theme="light"] body .rbj-chat-waiting {
    border-color: rgba(164, 103, 8, .22);
    background: rgba(164, 103, 8, .08);
    color: #795012;
}

html[data-theme="light"] body .rbj-chat-quick-reply,
html[data-theme="light"] body .rbj-ai-chat-quick button {
    background: rgba(217, 4, 41, .06);
    color: #8f102c;
}

html[data-theme="light"] body .rbj-chat-attach,
html[data-theme="light"] body #rbjChatSend:disabled,
html[data-theme="light"] body .rbj-chat-attachment-card {
    background: var(--rbj-chat-surface);
    color: #6b4b47;
}

html[data-theme="light"] body #rbjChatInput,
html[data-theme="light"] body #rbjAiChatInput {
    border-color: rgba(96, 39, 47, .18);
    background: #fff;
    color: var(--rbj-chat-text);
}

html[data-theme="light"] body #rbjChatInput::placeholder,
html[data-theme="light"] body #rbjAiChatInput::placeholder {
    color: #8d716d;
}

html[data-theme="light"] body .rbj-chat-attachment-thumb {
    background: #f3e0e2;
}

html[data-theme="light"] body .rbj-chat-lightbox {
    background: rgba(255, 246, 247, .82);
}

html[data-theme="light"] body .rbj-chat-lightbox-close {
    border-color: rgba(96, 39, 47, .18);
    background: #fff;
    color: #4b2622;
}

html[data-theme="light"] body .rbj-chat-lightbox img {
    background: #fff;
    box-shadow: 0 28px 70px rgba(82, 32, 38, .22);
}

html[data-theme="light"] body .rbj-chat-lightbox-caption {
    background: rgba(255, 255, 255, .9);
    color: #6b4b47;
}

html[data-theme="light"] body .rbj-chat-attachment-name {
    color: var(--rbj-chat-text);
}

html[data-theme="light"] body .rbj-chat-composer-hint,
html[data-theme="light"] body .rbj-chat-attachment-type {
    color: var(--rbj-chat-muted);
}

@media (max-width: 720px) {
    body .rbj-chat-panel,
    body .rbj-ai-chat-panel,
    html[data-theme="light"] body .rbj-chat-panel,
    html[data-theme="light"] body .rbj-ai-chat-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: var(--storefront-viewport-height, 100dvh);
        max-height: var(--storefront-viewport-height, 100dvh);
        min-height: 0;
        border: 0;
        border-radius: 0;
    }

    .rbj-floating-stack {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
    }

    .rbj-floating-stack.is-suspended {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    body .rbj-chat-head,
    body .rbj-ai-chat-headbar {
        min-height: 66px;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    body .rbj-chat-feed { padding-inline: 12px; }
    body .rbj-ai-chat-feed { min-height: 0; }
    body .rbj-chat-msg { max-width: 88%; }
    body #rbjChatInput,
    body #rbjAiChatInput { font-size: 16px; }
    body .rbj-chat-composer-hint { display: none; }
    body .rbj-chat-form,
    body .rbj-ai-chat-form { padding-bottom: max(9px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    body .rbj-chat-panel.show,
    body .rbj-ai-chat-panel.show,
    body .rbj-chat-msg,
    body .rbj-ai-chat-msg,
    body .rbj-chat-typing-dots i {
        animation: none;
        transition: none;
    }
}
