.fbw-container {
    position: fixed;
    right: 20px;
    bottom: 70px;
    z-index: 2147483000;
}

/* Mini closed-state panel with welcome and quick suggestions */
.fbw-closed {
    position: absolute;
    right: 72px;
    /* sit to the left of the toggle button */
    bottom: -50px;
    max-width: 280px;
    background: var(--fbw-white);
    border: 1px solid var(--fbw-border);
    border-radius: 14px;
    box-shadow: var(--fbw-panel-shadow);
    padding: 10px 12px;
    color: var(--fbw-gray-900);
    display: none;
    /* hidden by default, shown when container is closed */
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
}

.fbw-container.fbw-hidden .fbw-closed {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.fbw-closed .fbw-closed-welcome {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Reusable chips */
.fbw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fbw-chip {
    background: var(--fbw-gray-100);
    border: 1px solid var(--fbw-border);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--fbw-text);

}

.fbw-chip:hover {
    background: var(--fbw-gray-200);
}

/* Help panel for onboarding */
.fbw-help {
    margin: 6px 10px 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--fbw-gray-700);
    background: var(--fbw-gray-50);
    border: 1px dashed var(--fbw-gray-300);
    border-radius: 8px;
}

/* Suggestions popup overlay at top of chat body */
.fbw-suggest-popup {
    position: sticky;
    left: 8px;
    right: 8px;
    background: var(--fbw-white);
    border: 1px solid var(--fbw-border);
    border-radius: 12px;
    box-shadow: var(--fbw-panel-shadow);
    padding: 8px;
    display: none;
    z-index: 3;
    bottom: 0;
    animation: appear .5s;
}

.fbw-suggest-popup.open {
    display: block;
}

.fbw-suggest-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fbw-suggest-headrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fbw-suggest-header {
    font-weight: 600;
    font-size: 12px;
    color: var(--fbw-text);
}

.fbw-suggest-close {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--fbw-text-muted);
}

.fbw-suggest-popup .fbw-chips {
    gap: 8px;
}

/* Deprecated: old suggestions bar inside chat body */
.fbw-suggestions {
    display: none !important;
}

.fbw-container.fbw-hidden .fbw-panel {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
    margin-bottom: 0;
}

.fbw-toggle {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: none;
    background: var(--fbw-accent);
    color: var(--fbw-white);
    box-shadow: var(--fbw-panel-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: absolute;
    right: 0;
    bottom: -60px;
    z-index: 2;
    transition: transform .24s ease, box-shadow .2s ease;
    animation: appear 1s;
}

.fbw-panel {
    width: 420px;
    max-height: 70vh;
    background: var(--fbw-bg-gradient);
    border-radius: var(--fbw-bot-panel-radius);
    box-shadow: var(--fbw-panel-shadow);
    overflow: hidden;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: bottom right;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .22s ease, transform .24s ease, max-height .24s ease, margin-bottom .24s ease, visibility 0s linear 0s;
    will-change: opacity, transform, max-height, margin-bottom;
    border: var(--fbw-bot-panel-border-size) solid var(--fbw-border-color);
}

.fbw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 12px 14px;
    background: transparent;
}

.fbw-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 8px;
}

.fbw-name {
    font-weight: 600;
    color: var(--fbw-text);
}

.fbw-desc {
    font-size: 12px;
    color: var(--fbw-text-muted);
}

.fbw-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--fbw-text-muted);
}

.fbw-body {
    flex: 1;
    padding: 12px;
    max-height: 600px;
    position: relative;
    /* for in-body absolute controls */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--fbw-accent-light) transparent;
}

.fbw-footer {
    padding: 10px;
}

/* Powered by area in footer */
.fbw-powered {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;

}

.fbw-powered-label {
    font-size: 8px;
    color: var(--fbw-bot-footer-text);
}

.fbw-powered img {
    height: 16px;
    width: auto;
    display: block;
    opacity: 0.8;
    transition: opacity .2s ease;
}

.fbw-powered:hover img {
    opacity: 1;
}

/* Top toolbar above the input */
.fbw-tools {
    display: flex;
    align-items: center;
    margin: 0 4px 8px 4px;
}

.fbw-tool-btn {
    background: transparent;
    border: none;
    color: var(--fbw-text-muted);
    height: 32px;
    border-radius: 8px;
    column-gap: 6px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fbw-tool-btn span {
    font-size: 12px;
}

.fbw-tool-btn:hover,
.fbw-tool-btn:focus {
    color: var(--fbw-accent);
    background: var(--fbw-blue-utility-8);
    outline: none;
}

.fbw-tool-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Mic recording state */
.fbw-tool-btn.recording {
    color: var(--fbw-white);
    background: var(--fbw-danger);
}

.fbw-tool-btn.recording::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fbw-white);
    margin-left: 6px;
}

.fbw-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fbw-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fbw-label {
    font-size: 12px;
    color: var(--fbw-text-muted);
}

.fbw-input {
    border-radius: 30px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    resize: none;
    height: 24px;
    overflow: hidden;
    border: 4px solid var(--fbw-border-color);
}

.fbw-input-message {
    height: 60px;

}

.fbw-input:focus {
    border-color: var(--fbw-accent);
    box-shadow: 0 0 0 3px var(--fbw-blue-utility-15);
}

.fbw-privacy {
    font-size: 12px;
    color: var(--fbw-text-muted);
}

.fbw-privacy a {
    color: var(--fbw-accent);
    text-decoration: none;
}

.fbw-btn {
    border: none;
    right: 12px;
    top: 10px;
    padding: 12px 12px;
    cursor: pointer;
}

.fbw-btn-primary {
    background: var(--fbw-accent);
    color: var(--fbw-white);
    border-radius: 18px;
}

.fbw-btn-send {
    background: var(--fbw-accent) !important;
    color: var(--fbw-white) !important;
    margin-left: 8px !important;
    border-radius: 50% !important;
    position: absolute !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
}

/* Size the send icon */
.fbw-btn-send svg {
    width: 20px;
    height: 20px;
    display: block;
}

.fbw-transcript {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fbw-msg {
    max-width: 80%;
}

.fbw-msg .fbw-msg-text {
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 10px;


}

/* Timestamp/meta under each message */
.fbw-msg .fbw-msg-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--fbw-text-muted);
}

.fbw-msg-user {
    align-self: flex-end;
}

.fbw-msg-user .fbw-msg-text {
    background: var(--fbw-bg-user);
    color: var(--fbw-user-text);
    position: relative;

}

.fbw-msg-user:after {
    content: '';
    position: absolute;
    z-index: -1;
    right: -4px;
    background: var(--fbw-bg-user);
    transform: rotate(45deg);
    width: 20px;
    height: 20px;
    border-radius: 3px;
    top: 7px;

}

.fbw-msg-bot:after {
    content: '';
    z-index: -1;
    position: absolute;
    left: -4px;
    background: var(--fbw-bg-bot);
    transform: rotate(45deg);
    width: 20px;
    height: 20px;
    border-radius: 3px;
    top: 8px;
}

.fbw-msg-bot {
    align-self: flex-start;
}

.fbw-msg-bot .fbw-msg-text {
    background: var(--fbw-bg-bot);
    position: relative;
    padding-left: 8px;

}

/* Bot message small header: avatar + name */
.fbw-msg-bot .fbw-msg-head {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.fbw-msg-bot .fbw-msg-avatar {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    object-fit: cover;
    display: inline-block;
}

.fbw-msg-bot .fbw-msg-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--fbw-bot-header-text);
}

.fbw-msg-bot .fbw-msg-body {
    font-size: 14px;
    color: var(--fbw-bot-text);
}

.fbw-msg-bot .fbw-msg-body a {
    word-break: break-all;
}

.fbw-msg-system {
    align-self: center;
}

.fbw-msg-system .fbw-msg-text {
    background: var(--fbw-green-50);
    border-color: var(--fbw-green-100);
    color: var(--fbw-green-700);
}

/* Bubble appearance animation */
.fbw-msg-appear {
    opacity: 0;
    transform: none;
    animation: fbw-msg-in 1s ease forwards;
}

.fbw-msg-appear.from-right {
    transform: translate(8px, 6px);

}

.fbw-msg-appear.from-left {
    transform: translate(-8px, 6px);
}

@keyframes fbw-msg-in {
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

.fbw-chat-input {
    display: flex;
    position: relative;
}

.fbw-chat-input .fbw-input {
    flex: 1;
}

/* Animations for show/hide */
.fbw-toggle {
    transition: transform .24s ease, box-shadow .24s ease;
}

.fbw-toggle:active {
    transform: scale(0.96);
}

/* .fbw-container.fbw-open .fbw-toggle {
    transform: rotate(15deg) scale(1.05);
} */

@media (prefers-reduced-motion: reduce) {

    .fbw-panel,
    .fbw-toggle {
        transition: none !important;
    }
}

/* Icon sizing inside toggle */
.fbw-toggle .fbw-toggle-icon {
    width: 44px;
    display: block;
    scale: var(--fbw-bot-avatar-scale);
}

/* Typography: Arimo */
html,
body {
    font-family: "Arimo", Arial, Helvetica, sans-serif;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure form controls and widget elements use the same font */
.fbw-panel,
.fbw-toggle,
.fbw-input,
.fbw-btn,
.fbw-header,
.fbw-body,
.fbw-footer {
    font-family: inherit;
}

/* Typing indicator (spinner/dots) */
.fbw-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fbw-typing .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fbw-bot-text);
    /* muted grey fits bot bubble */
    animation: fbw-bounce 1.2s infinite ease-in-out;
}

.fbw-typing .dot:nth-child(2) {
    animation-delay: .15s;
}

.fbw-typing .dot:nth-child(3) {
    animation-delay: .30s;
}

@keyframes fbw-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.4);
        opacity: .6;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Absolute-position the tools bar above the input area */
.fbw-chat-input {
    position: relative;
    /* Reserve space at the top for the absolute toolbar */
    padding-top: 44px;
}

.fbw-chat-input .fbw-tools {
    position: absolute;
    top: 6px;
    right: 8px;
    margin: 0;
    /* override previous margin */
    z-index: 1;
}

/* Ensure the message input fills the width and doesn't sit under the send button */
.fbw-chat-input .fbw-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding-right: 56px;
    /* room for the send button */
}

/* Anchor the Send button to the bottom-right of the input area */
.fbw-btn-send {
    top: auto;
    /* override absolute top from .fbw-btn */
    bottom: 10px;
    right: 12px;
}

/* Header icon next to title */
.fbw-header-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fbw-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    scale: var(--fbw-bot-logo-header-scale);
    color: var(--fbw-accent);
}

.fbw-header-icon svg,
.fbw-header-icon img {
    max-width: 100%;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

/* Header actions: options ellipsis and close */
.fbw-header {
    position: relative;
}

.fbw-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fbw-opts-btn {
    background: transparent;
    border: none;
    color: var(--fbw-text-muted);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fbw-opts-btn:hover,
.fbw-opts-btn:focus {
    color: var(--fbw-white);
    background: var(--fbw-white-12);
    outline: none;
}

.fbw-opts-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.fbw-opts-menu {
    position: absolute;
    top: 46px;
    right: 12px;
    min-width: 160px;
    background: var(--fbw-white);
    color: var(--fbw-gray-900);
    border: 1px solid var(--fbw-border);
    border-radius: 10px;
    box-shadow: var(--fbw-panel-shadow);
    padding: 6px;
    display: none;
    z-index: 5;
}

.fbw-opts-menu.open {
    display: block;
}

.fbw-opts-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
}

.fbw-opts-item:hover {
    background: var(--fbw-blue-utility-8);
}

.fbw-opts-item.fbw-opts-finalize {
    color: var(--fbw-red-700);
}

/* Expanded panel width */
.fbw-container.fbw-expanded .fbw-panel {
    width: 520px;
}

.fbw-container.a {
    padding: 1px;
    border-radius: 5px;
}

.fbw-container .fbw-not-visible {
    display: none !important;
}

.fbw-file-img a,
.fbw-file a,
.fbw-file-doc a,
.fbw-file-pdf a,
.fbw-file-audio a {
    color: var(--fbw-link-color) !important;
}

.fbw-force-position-relative {
    position: relative !important;
    z-index: 11;
}

.fbw-force-position-absolute {
    position: absolute !important;
}

.fbw-terms {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.fbw-terms-link {
    text-decoration: underline;
    color: var(--fbw-accent-light) !important;
    font-size: 11px;
}


.fbw-btn-accept-terms {
    background: var(--fbw-accent-light);
    color: var(--fbw-white);
    border-radius: 14px;
    font-size: 11px;
}

.fbw-bot-response-link {
    text-decoration: underline;
    color: var(--fbw-accent);
    cursor: pointer;
}

#bot-body .h-screen {
    height: 100vh;
}

#bot-body .w-full {
    width: 100%;
}

#bot-body.flex {
    display: flex;
}

#bot-body .items-center {
    align-items: center;
}

#bot-body .justify-center {
    justify-content: center;
}

#bot-body .flex-col {
    flex-direction: column;
}

@font-face {
    font-family: 'Inter';
    src: url('https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400;0,600;1,400&display=swap') format('arimo');
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}

#bot-body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


#bot-body img[alt='ff'] {
    margin-top: -4px;
    margin-bottom: -4px;
}

@media (max-width: 453px) {
    .fbw-container .fbw-panel {
        width: 100%;
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border: 2px solid var(--fbw-border-color);
        border-radius: 10px 10px 0 0;
        border-bottom: 0;
        border-right: 0;
        border-left: 0;
    }

    :has(.fbw-open) .fbw-container {
        bottom: -11px;
        right: 0;
    }

    .fbw-body {
        max-height: 100% !important;
    }

    .fbw-opts-expand {
        display: none;
    }

}

@keyframes appear {
    0% {
        scale: 0.1;
    }

    50% {
        scale: 1.1;
    }

    100% {
        scale: 1;
    }
}

.fbw-msg-head svg {
    fill: var(--fbw-bot-icon-header-msg) !important;
}

/* --- Overrides merged from requested snippet --- */


/* Larger bubble tails */

.fbw-msg-user:after {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    top: 8px;
}

.fbw-msg-user .fbw-msg-meta {
    text-align: right;
}


.fbw-msg-user .fbw-msg-meta {
    text-align: right;
}

.fbw-body-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}


.fbw-loading {
    opacity: 0.5;
    cursor: progress;
}

.fbw-closed-welcome {
    margin-bottom: 0 !important;
    font-size: 12px !important;
}

.fbw-msg-body img:not([class]) {
    border-radius: 10px;
}

.fbw-msg-body a:not([class]) {
    text-decoration: underline;
    color: var(--fbw-accent);
}

.fbw-roles-panel {
    background: var(--fbw-white);
    border-radius: 12px;
    padding: 8px;
    margin: 8px 0 0 0;
    animation: fbwFadeIn .25s ease-out;
}

.fbw-roles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px
}

.fbw-roles-left {
    display: flex;
    align-items: center;
    gap: 8px
}

.fbw-roles-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover
}

.fbw-roles-title {
    font-size: 13px;
    color: #111
}

.fbw-roles-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    color: #555;
    padding: 4px;
    border-radius: 6px
}

.fbw-roles-close:hover {
    background: #f3f4f6
}

.fbw-roles-message {
    color: var(--fbw-bot-text);
    margin: 0 0 10px
}

.fbw-roles-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.fbw-visible {
    display: none;
}

.fbw-role-btn {
    background: #f3f4f6;
    color: #111;
    border: none;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px
}

.fbw-role-btn:hover {
    background: #e5e7eb
}


@keyframes fbwFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

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


.fbw-roles-panel:after {
    position: absolute;
    content: "";
    bottom: 10px;
    left: -4px;
    width: 20px;
    height: 20px;
    background: var(--fbw-white);
    transform: rotate(45deg);
    border-radius: 2px;
    z-index: -1;
}

.fbw-preload-image {
    margin: 4px 0 4px 0;
    transition: transform 0.3s;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    border-top: 3px solid var(--fbw-accent);
    border-left: 3px solid var(--fbw-accent);
    border-right: 3px solid var(--fbw-white);
    border-bottom: 3px solid var(--fbw-white);
    animation: fbw-rotate 1s infinite linear;
}

.fbw-img-text-rendered {
    width: 100%;
    height: auto;
    border-radius: 10px;
    animation: appear 0.5s;
    margin-bottom: 14px;
}

.fbw-rotate-180 {
    transform: rotate(45deg);
}

.fbw-rotate-360 {
    transform: rotate(90deg);
}

@keyframes fbw-rotate {

    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fbw-btn-send-hidden {
    display: none !important;
}