.bfc-widget, .bfc-widget * { box-sizing: border-box; }
.bfc-widget [hidden] { display: none !important; }
.bfc-widget { position: fixed; z-index: 2147482990; direction: rtl; font-family: inherit; }
.bfc-launcher { position: fixed; bottom: var(--bfc-desktop-bottom); left: var(--bfc-desktop-side); width: var(--bfc-launcher-size); height: var(--bfc-launcher-size); border: 0; border-radius: 999px; background: var(--bfc-launcher-color); color: var(--bfc-launcher-icon-color); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 18px 38px rgba(15,23,42,.24); z-index: 2147483000; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.bfc-launcher:hover { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(15,23,42,.28); }
.bfc-desktop-right .bfc-launcher { left: auto; right: var(--bfc-desktop-side); }
.bfc-launcher svg { width: var(--bfc-launcher-icon-size); height: var(--bfc-launcher-icon-size); fill: currentColor; }
.bfc-launcher-close-icon { display: none; }
.bfc-widget.is-open .bfc-launcher-chat-icon { display: none; }
.bfc-widget.is-open .bfc-launcher-close-icon { display: block; }
.bfc-launcher span { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; border: 2px solid #fff; }
.bfc-overlay { position: fixed; inset: 0; background: transparent !important; z-index: 2147482991; backdrop-filter: none !important; pointer-events: none !important; }
.bfc-panel { position: fixed; bottom: calc(var(--bfc-desktop-bottom) + var(--bfc-launcher-size) + 14px); left: var(--bfc-desktop-side); width: min(410px, calc(100vw - 28px)); height: min(650px, calc(100vh - 140px)); border-radius: 24px; overflow: hidden; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.28); z-index: 2147482992; display: grid; grid-template-rows: auto auto auto 1fr auto auto; border: 1px solid rgba(15,23,42,.08); }
.bfc-desktop-right .bfc-panel { left: auto; right: var(--bfc-desktop-side); }
.bfc-panel-header { padding: 18px 18px 16px; background: linear-gradient(135deg, var(--bfc-launcher-color), #064d4a); color: #fff; display: flex; justify-content: space-between; gap: 12px; }
.bfc-panel-title { min-width: 0; }
.bfc-panel-header strong { display:block; font-size: 17px; line-height: 1.4; }
.bfc-panel-header p { margin: 5px 0 0; color: rgba(255,255,255,.88); font-size: 13px; line-height: 1.65; }
.bfc-close { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); border-radius: 12px; color: #fff; cursor: pointer; font-size: 23px; line-height: 1; }
.bfc-status-bar { display: flex; align-items: center; gap: 8px; padding: 9px 16px; color: #475569; background: #f8fafc; border-bottom: 1px solid #e5e7eb; font-size: 12px; font-weight: 700; }
.bfc-status-dot { width: 8px; height: 8px; border-radius: 999px; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.12); }
.bfc-widget.is-offline .bfc-status-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.14); }
.bfc-widget.is-closed .bfc-status-dot { background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.14); }
.bfc-visitor-form { padding: 16px; display: grid; gap: 10px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.bfc-visitor-form input, .bfc-composer textarea { width: 100%; border: 1px solid #dbe3ee; border-radius: 14px; background: #fff; color: #0f172a; padding: 12px 13px; font-size: 14px; outline: none; line-height: 1.6; }
.bfc-visitor-form input:focus, .bfc-composer textarea:focus { border-color: var(--bfc-launcher-color); box-shadow: 0 0 0 3px rgba(8,101,98,.12); }
.bfc-visitor-form button, .bfc-composer button, .bfc-closed-notice button { border: 0; border-radius: 14px; background: var(--bfc-launcher-color); color: #fff; padding: 12px 16px; font-weight: 800; cursor: pointer; }
.bfc-visitor-form button:disabled, .bfc-composer button:disabled { opacity: .65; cursor: wait; }
.bfc-messages-shell { position: relative; min-height: 0; overflow: hidden; background: linear-gradient(180deg,#f8fafc,#eef3f7); }
.bfc-empty-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 28px; text-align: center; color: #64748b; font-size: 13px; line-height: 1.8; pointer-events: none; }
.bfc-messages { height: 100%; padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.bfc-message { max-width: 86%; display: flex; flex-direction: column; gap: 4px; animation: bfc-message-in .16s ease both; }
@keyframes bfc-message-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.bfc-message.is-visitor { align-self: flex-start; }
.bfc-message.is-admin, .bfc-message.is-system { align-self: flex-end; }
.bfc-message-body { padding: 11px 13px; border-radius: 16px; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 5px 16px rgba(15,23,42,.06); }
.bfc-message.is-visitor .bfc-message-body { background: #fff; color: #0f172a; border: 1px solid #e5e7eb; border-bottom-right-radius: 7px; }
.bfc-message.is-admin .bfc-message-body, .bfc-message.is-system .bfc-message-body { background: var(--bfc-launcher-color); color: #fff; border-bottom-left-radius: 7px; }
.bfc-message.is-system .bfc-message-body { background: #0f766e; }
.bfc-message-body a { color: inherit; text-decoration: underline; font-weight: 800; }
.bfc-message-time { color: #64748b; font-size: 11px; padding: 0 4px; }
.bfc-closed-notice { padding: 12px 14px; background: #fff7ed; border-top: 1px solid #fed7aa; color: #9a3412; display: grid; gap: 10px; font-size: 13px; line-height: 1.7; }
.bfc-closed-notice button { background: #9a3412; justify-self: start; padding: 9px 12px; }
.bfc-composer { padding: 12px; border-top: 1px solid #e5e7eb; background: #fff; display: grid; gap: 8px; }
.bfc-composer textarea { resize: none; height: 72px; min-height: 72px; max-height: 132px; }
.bfc-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bfc-counter { color: #64748b; font-size: 11px; font-weight: 700; }
.bfc-counter.is-danger { color: #b91c1c; }
.bfc-composer button { min-width: 92px; }
.bfc-error { padding: 10px 14px; color: #b91c1c; background: #fef2f2; border-top: 1px solid #fecaca; font-size: 13px; line-height: 1.6; }
body.bfc-widget-open { overflow: hidden; touch-action: none; }
@media (max-width: 600px) {
  .bfc-launcher { bottom: calc(var(--bfc-mobile-bottom) + env(safe-area-inset-bottom, 0px)); left: var(--bfc-mobile-side); width: var(--bfc-launcher-size); height: var(--bfc-launcher-size); }
  .bfc-mobile-right .bfc-launcher { left: auto; right: var(--bfc-mobile-side); }
  .bfc-panel { left: 10px !important; right: 10px !important; bottom: calc(var(--bfc-mobile-bottom) + var(--bfc-launcher-size) + 16px + env(safe-area-inset-bottom, 0px)); width: auto; height: min(78vh, 640px); border-radius: 22px; }
  .bfc-panel-header { padding: 15px; }
  .bfc-messages { padding: 14px; }
  .bfc-message { max-width: 92%; }
  .bfc-composer-footer { align-items: stretch; }
  .bfc-composer button { min-width: 104px; }
  .bfc-composer textarea { height: 64px; min-height: 64px; }
}
@media (max-width: 380px) {
  .bfc-panel { left: 8px !important; right: 8px !important; height: min(80vh, 620px); }
  .bfc-message { max-width: 96%; }
}

/* v1.0.0-alpha.4 privacy notice */
.bfc-privacy-notice {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}


/* v1.0.0-beta.1 sender labels */
.bfc-message-label { color:#64748b; font-size:11px; font-weight:800; padding:0 4px; }
.bfc-message.is-admin .bfc-message-label,
.bfc-message.is-system .bfc-message-label { text-align:left; }


/* v1.0.0-rc.1 privacy consent control */
.bfc-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(8, 101, 98, .16);
    border-radius: 12px;
    background: rgba(8, 101, 98, .06);
    color: #0f172a;
    font-size: 12px;
    line-height: 1.7;
    cursor: pointer;
}
.bfc-consent input {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    flex: 0 0 auto;
}


/* v1.0.3 launcher visibility hardening: protect the launcher from theme sticky toolbars and global button/svg rules. */
.bfc-launcher { visibility: visible; opacity: 1; pointer-events: auto; line-height: 1; text-decoration: none; appearance: none; -webkit-appearance: none; }
.bfc-launcher svg { display: block; flex: 0 0 auto; max-width: none; }
.bfc-launcher:before, .bfc-launcher:after { content: none !important; }


/* v1.0.4 launcher icon state correction: keep theme hardening without showing both SVG states. */
.bfc-launcher { gap: 0 !important; overflow: visible !important; }
.bfc-launcher .bfc-launcher-chat-icon { display: block !important; }
.bfc-launcher .bfc-launcher-close-icon { display: none !important; }
.bfc-widget.is-open .bfc-launcher .bfc-launcher-chat-icon { display: none !important; }
.bfc-widget.is-open .bfc-launcher .bfc-launcher-close-icon { display: block !important; }
.bfc-launcher:focus { outline: none; }
.bfc-launcher:focus-visible { outline: 3px solid rgba(8,101,98,.24); outline-offset: 4px; }


/* v1.0.6 launcher hidden badge leak fix: never show the external circle unless there is an actual unread count. */
.bfc-launcher [data-bfc-unread][hidden] { display: none !important; }
.bfc-launcher [data-bfc-unread]:empty { display: none !important; }


/* v1.0.7 composer default height reduction: keep auto-resize, but start from a lower, more compact composer height. */


/* v1.0.10 hard composer height fix: override theme textarea rules and keep compact default height. */
.bfc-widget .bfc-composer textarea[data-bfc-input] {
    height: 68px !important;
    min-height: 68px !important;
    max-height: 128px !important;
    overflow-y: auto !important;
}
@media (max-width: 600px) {
    .bfc-widget .bfc-composer textarea[data-bfc-input] {
        height: 62px !important;
        min-height: 62px !important;
        max-height: 112px !important;
    }
}


/* v1.0.10 frontend close/overlay stabilization.
   The floating chat must not darken or lock the page, and every close control must stay clickable above theme layers. */
.bfc-overlay,
.bfc-widget.is-open .bfc-overlay {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none !important;
}
body.bfc-widget-open {
    overflow: auto !important;
    touch-action: auto !important;
}
.bfc-panel {
    isolation: isolate;
}
.bfc-close,
.bfc-panel .bfc-close,
button.bfc-close {
    position: relative !important;
    z-index: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,.46) !important;
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}
.bfc-close:hover,
.bfc-panel .bfc-close:hover,
button.bfc-close:hover {
    background: rgba(255,255,255,.22) !important;
    color: #fff !important;
}
.bfc-launcher {
    z-index: 2147483001 !important;
}
.bfc-panel {
    z-index: 2147483000 !important;
}


/* v1.0.11 unread badge placement fix: keep the badge fully outside the launcher circle and show it only for actual unread replies. */
.bfc-launcher [data-bfc-unread] {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    min-width: 22px !important;
    height: 22px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;
    background: #ef4444 !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .18) !important;
    z-index: 2 !important;
    transform: translate(28%, -28%) !important;
    pointer-events: none !important;
}
.bfc-launcher [data-bfc-unread][hidden],
.bfc-launcher [data-bfc-unread]:empty {
    display: none !important;
}


/* v1.1.0 launcher and unread badge controls: all values are controlled from the External Launcher tab. */
.bfc-launcher {
    width: var(--bfc-launcher-size) !important;
    height: var(--bfc-launcher-size) !important;
    overflow: visible !important;
}
.bfc-launcher svg {
    width: var(--bfc-launcher-icon-size) !important;
    height: var(--bfc-launcher-icon-size) !important;
}
.bfc-launcher [data-bfc-unread] {
    position: absolute !important;
    top: calc(-1 * (var(--bfc-badge-size) - var(--bfc-badge-overlap)) + var(--bfc-badge-offset-y)) !important;
    right: calc(-1 * (var(--bfc-badge-size) - var(--bfc-badge-overlap)) + var(--bfc-badge-offset-x)) !important;
    min-width: var(--bfc-badge-size) !important;
    width: auto !important;
    height: var(--bfc-badge-size) !important;
    padding: 0 6px !important;
    border-radius: 999px !important;
    background: var(--bfc-badge-bg) !important;
    color: var(--bfc-badge-text) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: var(--bfc-badge-font-size) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .18) !important;
    z-index: 2 !important;
    transform: none !important;
    pointer-events: none !important;
}
.bfc-launcher [data-bfc-unread][hidden],
.bfc-launcher [data-bfc-unread]:empty {
    display: none !important;
}

/* v1.4.0 Premium SaaS chat widget redesign.
   This block intentionally overrides older visual rules while keeping all existing data attributes and JS behavior. */
.bfc-widget {
    --bfc-brand-blue: var(--bfc-launcher-color, #2563eb);
    --bfc-brand-teal: var(--bfc-launcher-color, #0f8f86);
    --bfc-panel-bg: #ffffff;
    --bfc-panel-border: rgba(148, 163, 184, .24);
    --bfc-text-main: #0f172a;
    --bfc-text-muted: #64748b;
    --bfc-surface-soft: #f8fafc;
    --bfc-user-bubble: #f1f6ff;
    --bfc-team-bubble: #effdfa;
    direction: inherit !important;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}
.bfc-widget[dir="rtl"] { direction: rtl !important; }
.bfc-widget[dir="ltr"] { direction: ltr !important; }

.bfc-panel,
.bfc-widget .bfc-panel {
    width: min(720px, calc(100vw - 48px)) !important;
    height: min(650px, calc(100vh - 120px)) !important;
    border-radius: 28px !important;
    overflow: hidden !important;
    background: var(--bfc-panel-bg) !important;
    border: 1px solid var(--bfc-panel-border) !important;
    box-shadow: 0 30px 90px rgba(15, 23, 42, .22), 0 8px 24px rgba(15, 23, 42, .10) !important;
    display: grid !important;
    grid-template-rows: auto auto auto 1fr auto auto !important;
}

.bfc-panel-header,
.bfc-widget .bfc-panel-header {
    min-height: 132px !important;
    padding: 28px 34px !important;
    background: linear-gradient(135deg, var(--bfc-launcher-color), var(--bfc-launcher-color)) !important;
    color: #fff !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 22px !important;
    border: 0 !important;
}
.bfc-panel-brand {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    min-width: 0 !important;
}
.bfc-panel-icon {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .16) !important;
    border: 1px solid rgba(255, 255, 255, .30) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.20) !important;
}
.bfc-panel-icon svg { width: 34px !important; height: 34px !important; fill: currentColor !important; display: block !important; }
.bfc-panel-title,
.bfc-widget .bfc-panel-title { min-width: 0 !important; text-align: inherit !important; }
.bfc-panel-header strong,
.bfc-widget .bfc-panel-header strong {
    color: #fff !important;
    display: block !important;
    font-size: 30px !important;
    line-height: 1.12 !important;
    letter-spacing: -.025em !important;
    font-weight: 850 !important;
    margin: 0 !important;
}
.bfc-panel-header p,
.bfc-widget .bfc-panel-header p {
    color: rgba(255, 255, 255, .92) !important;
    margin: 10px 0 0 !important;
    font-size: 16px !important;
    line-height: 1.55 !important;
    font-weight: 500 !important;
}
.bfc-close,
.bfc-panel .bfc-close,
button.bfc-close {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    border-radius: 999px !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 34px !important;
    font-weight: 300 !important;
    line-height: .9 !important;
    opacity: .95 !important;
    transition: background .18s ease, transform .18s ease, opacity .18s ease !important;
}
.bfc-close:hover,
.bfc-panel .bfc-close:hover,
button.bfc-close:hover {
    background: rgba(255,255,255,.14) !important;
    transform: scale(1.04) !important;
    opacity: 1 !important;
}

.bfc-status-bar,
.bfc-widget .bfc-status-bar {
    min-height: 68px !important;
    padding: 0 34px !important;
    gap: 14px !important;
    color: #475569 !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(226, 232, 240, .95) !important;
    font-size: 18px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
}
.bfc-status-dot,
.bfc-widget .bfc-status-dot {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    background: #10b981 !important;
    box-shadow: 0 0 0 7px rgba(16,185,129,.13) !important;
}

.bfc-visitor-form,
.bfc-widget .bfc-visitor-form {
    padding: 26px 34px !important;
    gap: 14px !important;
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%) !important;
}
.bfc-visitor-form input,
.bfc-widget input[data-bfc-name],
.bfc-widget input[data-bfc-email] {
    min-height: 52px !important;
    border-radius: 16px !important;
    border: 1px solid #dbe4ef !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
    padding: 0 16px !important;
    font-size: 15px !important;
    color: var(--bfc-text-main) !important;
}
.bfc-visitor-form button,
.bfc-widget [data-bfc-start] {
    min-height: 52px !important;
    border-radius: 16px !important;
    background: var(--bfc-launcher-color) !important;
    box-shadow: 0 12px 26px rgba(15,23,42,.18) !important;
    color: #fff !important;
    font-weight: 800 !important;
    border: 0 !important;
}

.bfc-messages-shell,
.bfc-widget .bfc-messages-shell {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    border-top: 0 !important;
    min-height: 0 !important;
}
.bfc-messages,
.bfc-widget .bfc-messages {
    direction: ltr !important;
    padding: 44px 34px 34px !important;
    gap: 26px !important;
    height: 100% !important;
    background: transparent !important;
}
.bfc-empty-state,
.bfc-widget .bfc-empty-state {
    color: #94a3b8 !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
}
.bfc-message,
.bfc-widget .bfc-message {
    max-width: min(72%, 520px) !important;
    gap: 8px !important;
}
.bfc-message.is-visitor,
.bfc-widget .bfc-message.is-visitor {
    align-self: flex-end !important;
    align-items: flex-end !important;
}
.bfc-message.is-admin,
.bfc-message.is-system,
.bfc-widget .bfc-message.is-admin,
.bfc-widget .bfc-message.is-system {
    align-self: flex-start !important;
    align-items: flex-start !important;
    margin-inline-start: 78px !important;
    position: relative !important;
}
.bfc-message.is-admin::before,
.bfc-message.is-system::before,
.bfc-widget .bfc-message.is-admin::before,
.bfc-widget .bfc-message.is-system::before {
    content: "" !important;
    position: absolute !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 999px !important;
    left: -78px !important;
    top: 4px !important;
    background: #ecfdf5 !important;
    border: 1px solid rgba(16,185,129,.18) !important;
    box-shadow: inset 0 0 0 10px rgba(16,185,129,.05), 0 8px 20px rgba(15,23,42,.08) !important;
}
.bfc-message.is-admin::after,
.bfc-message.is-system::after,
.bfc-widget .bfc-message.is-admin::after,
.bfc-widget .bfc-message.is-system::after {
    content: "" !important;
    position: absolute !important;
    left: -58px !important;
    top: 22px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    border: 3px solid #10b981 !important;
    border-bottom-color: transparent !important;
    box-shadow: 0 7px 0 -3px #10b981, 0 -7px 0 -3px #10b981 !important;
}
.bfc-message-body,
.bfc-widget .bfc-message-body {
    padding: 18px 22px !important;
    border-radius: 22px !important;
    font-size: 17px !important;
    line-height: 1.6 !important;
    color: var(--bfc-text-main) !important;
    background: #fff !important;
    border: 1px solid rgba(203, 213, 225, .95) !important;
    box-shadow: 0 10px 26px rgba(15,23,42,.06) !important;
    overflow-wrap: anywhere !important;
    unicode-bidi: plaintext !important;
    text-align: start !important;
}
.bfc-message.is-visitor .bfc-message-body,
.bfc-widget .bfc-message.is-visitor .bfc-message-body {
    background: var(--bfc-user-bubble) !important;
    border-color: #d7e3f8 !important;
    border-bottom-right-radius: 10px !important;
}
.bfc-message.is-admin .bfc-message-body,
.bfc-message.is-system .bfc-message-body,
.bfc-widget .bfc-message.is-admin .bfc-message-body,
.bfc-widget .bfc-message.is-system .bfc-message-body {
    background: var(--bfc-team-bubble) !important;
    border-color: rgba(16,185,129,.20) !important;
    color: var(--bfc-text-main) !important;
    border-bottom-left-radius: 10px !important;
}
.bfc-message-time,
.bfc-widget .bfc-message-time {
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    font-weight: 500 !important;
    padding: 0 6px !important;
    direction: ltr !important;
}
.bfc-message-label,
.bfc-widget .bfc-message-label {
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    padding: 0 6px !important;
}

.bfc-composer,
.bfc-widget .bfc-composer {
    padding: 26px 34px 28px !important;
    border-top: 1px solid rgba(226, 232, 240, .95) !important;
    background: #fff !important;
    display: grid !important;
    gap: 16px !important;
}
.bfc-composer-row,
.bfc-widget .bfc-composer-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: stretch !important;
    gap: 18px !important;
}
.bfc-input-wrap,
.bfc-widget .bfc-input-wrap {
    position: relative !important;
    min-height: 74px !important;
    display: flex !important;
    align-items: center !important;
}
.bfc-widget .bfc-composer textarea[data-bfc-input],
.bfc-input-wrap textarea[data-bfc-input] {
    width: 100% !important;
    height: 74px !important;
    min-height: 74px !important;
    max-height: 128px !important;
    resize: none !important;
    overflow-y: auto !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 20px !important;
    background: #fff !important;
    color: var(--bfc-text-main) !important;
    box-shadow: 0 1px 3px rgba(15,23,42,.05), inset 0 0 0 1px rgba(255,255,255,.5) !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    padding: 24px 96px 18px 22px !important;
    outline: none !important;
    transition: border-color .18s ease, box-shadow .18s ease !important;
    unicode-bidi: plaintext !important;
}
.bfc-widget[dir="rtl"] .bfc-composer textarea[data-bfc-input] {
    padding-right: 22px !important;
    padding-left: 96px !important;
    text-align: right !important;
}
.bfc-widget .bfc-composer textarea[data-bfc-input]:focus {
    border-color: rgba(37,99,235,.55) !important;
    box-shadow: 0 0 0 4px rgba(37,99,235,.10), 0 1px 3px rgba(15,23,42,.05) !important;
}
.bfc-input-tool,
.bfc-widget .bfc-input-tool {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    opacity: .95 !important;
    pointer-events: none !important;
}
.bfc-input-tool svg { width: 23px !important; height: 23px !important; fill: currentColor !important; display: block !important; }
.bfc-input-attach { right: 56px !important; }
.bfc-input-send-hint { right: 18px !important; color: #1d4ed8 !important; }
.bfc-widget[dir="rtl"] .bfc-input-attach { right: auto !important; left: 56px !important; }
.bfc-widget[dir="rtl"] .bfc-input-send-hint { right: auto !important; left: 18px !important; }
.bfc-send-button,
.bfc-composer button[data-bfc-send],
.bfc-widget .bfc-composer button[data-bfc-send] {
    min-width: 118px !important;
    height: 74px !important;
    padding: 0 26px !important;
    border: 0 !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(37,99,235,.25) !important;
    font-size: 17px !important;
    line-height: 1 !important;
    font-weight: 850 !important;
    cursor: pointer !important;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease !important;
}
.bfc-send-button:hover,
.bfc-composer button[data-bfc-send]:hover,
.bfc-widget .bfc-composer button[data-bfc-send]:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 18px 36px rgba(37,99,235,.30) !important;
}
.bfc-composer button[data-bfc-send]:disabled {
    opacity: .68 !important;
    cursor: wait !important;
    transform: none !important;
}
.bfc-composer-meta,
.bfc-widget .bfc-composer-meta {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 18px !important;
}
.bfc-privacy-notice,
.bfc-widget .bfc-privacy-notice {
    margin: 0 !important;
    max-width: 68% !important;
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
}
.bfc-privacy-lock,
.bfc-widget .bfc-privacy-lock {
    color: #64748b !important;
    min-width: 18px !important;
    width: 18px !important;
    height: 18px !important;
    margin-top: 1px !important;
    display: inline-flex !important;
}
.bfc-privacy-lock svg { width: 18px !important; height: 18px !important; fill: currentColor !important; }
.bfc-counter,
.bfc-widget .bfc-counter {
    color: #64748b !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.55 !important;
    white-space: nowrap !important;
    direction: ltr !important;
    text-align: end !important;
}

.bfc-error,
.bfc-widget .bfc-error {
    margin: 0 34px 18px !important;
    padding: 12px 16px !important;
    border: 1px solid #fecaca !important;
    border-radius: 16px !important;
    background: #fef2f2 !important;
    color: #b91c1c !important;
    font-size: 13px !important;
}
.bfc-closed-notice,
.bfc-widget .bfc-closed-notice {
    padding: 18px 34px !important;
    background: #fff7ed !important;
    border-top: 1px solid #fed7aa !important;
    color: #9a3412 !important;
    font-size: 14px !important;
}
.bfc-closed-notice button,
.bfc-widget .bfc-closed-notice button {
    border-radius: 14px !important;
    background: #9a3412 !important;
    color: #fff !important;
    border: 0 !important;
    padding: 10px 14px !important;
}

.bfc-launcher,
.bfc-widget .bfc-launcher {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 58%, #0f8f86 100%) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 24px 52px rgba(37,99,235,.28), 0 8px 18px rgba(15,23,42,.16) !important;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}
.bfc-launcher:hover,
.bfc-widget .bfc-launcher:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 28px 64px rgba(37,99,235,.34), 0 10px 20px rgba(15,23,42,.18) !important;
}
.bfc-launcher::after,
.bfc-widget .bfc-launcher::after {
    content: "" !important;
    position: absolute !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 999px !important;
    right: 2px !important;
    bottom: 2px !important;
    background: #10b981 !important;
    border: 4px solid #fff !important;
    box-shadow: 0 6px 14px rgba(15,23,42,.20) !important;
}
.bfc-widget.is-open .bfc-launcher::after { display: none !important; }
.bfc-launcher svg,
.bfc-widget .bfc-launcher svg {
    filter: drop-shadow(0 1px 0 rgba(0,0,0,.08)) !important;
}

@media (max-width: 760px) {
    .bfc-panel,
    .bfc-widget .bfc-panel {
        left: 12px !important;
        right: 12px !important;
        bottom: calc(var(--bfc-mobile-bottom) + var(--bfc-launcher-size) + 14px + env(safe-area-inset-bottom, 0px)) !important;
        width: auto !important;
        height: min(78vh, 680px) !important;
        border-radius: 24px !important;
    }
    .bfc-panel-header,
    .bfc-widget .bfc-panel-header {
        min-height: 112px !important;
        padding: 20px 22px !important;
    }
    .bfc-panel-brand { gap: 14px !important; }
    .bfc-panel-icon {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
    }
    .bfc-panel-icon svg { width: 28px !important; height: 28px !important; }
    .bfc-panel-header strong,
    .bfc-widget .bfc-panel-header strong { font-size: 23px !important; }
    .bfc-panel-header p,
    .bfc-widget .bfc-panel-header p { font-size: 14px !important; }
    .bfc-status-bar,
    .bfc-widget .bfc-status-bar { min-height: 56px !important; padding: 0 22px !important; font-size: 15px !important; }
    .bfc-messages,
    .bfc-widget .bfc-messages { padding: 24px 18px 22px !important; gap: 18px !important; }
    .bfc-message,
    .bfc-widget .bfc-message { max-width: 84% !important; }
    .bfc-message.is-admin,
    .bfc-message.is-system,
    .bfc-widget .bfc-message.is-admin,
    .bfc-widget .bfc-message.is-system { margin-inline-start: 0 !important; }
    .bfc-message.is-admin::before,
    .bfc-message.is-system::before,
    .bfc-message.is-admin::after,
    .bfc-message.is-system::after { display: none !important; }
    .bfc-message-body,
    .bfc-widget .bfc-message-body { font-size: 15px !important; padding: 14px 16px !important; border-radius: 18px !important; }
    .bfc-message-time,
    .bfc-widget .bfc-message-time { font-size: 12px !important; }
    .bfc-composer,
    .bfc-widget .bfc-composer { padding: 18px !important; gap: 12px !important; }
    .bfc-composer-row,
    .bfc-widget .bfc-composer-row { grid-template-columns: 1fr !important; gap: 12px !important; }
    .bfc-input-wrap,
    .bfc-widget .bfc-input-wrap { min-height: 64px !important; }
    .bfc-widget .bfc-composer textarea[data-bfc-input] {
        height: 64px !important;
        min-height: 64px !important;
        font-size: 15px !important;
        padding-top: 20px !important;
        padding-bottom: 14px !important;
    }
    .bfc-composer button[data-bfc-send],
    .bfc-widget .bfc-composer button[data-bfc-send] {
        height: 56px !important;
        min-width: 100% !important;
        border-radius: 18px !important;
    }
    .bfc-composer-meta,
    .bfc-widget .bfc-composer-meta { flex-direction: column !important; gap: 8px !important; }
    .bfc-privacy-notice,
    .bfc-widget .bfc-privacy-notice { max-width: 100% !important; font-size: 12px !important; }
    .bfc-counter,
    .bfc-widget .bfc-counter { align-self: flex-end !important; font-size: 12px !important; }
}

/* v1.4.1 Compact premium widget stabilization.
   Fixes oversized panel, clickable close, draggable desktop header, cleaner copy spacing. */
.bfc-panel,
.bfc-widget .bfc-panel {
    width: min(440px, calc(100vw - 32px)) !important;
    height: min(560px, calc(100vh - 108px)) !important;
    border-radius: 22px !important;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto !important;
    box-shadow: 0 24px 62px rgba(15,23,42,.22), 0 8px 20px rgba(15,23,42,.10) !important;
    pointer-events: auto !important;
}
.bfc-panel.is-dragging,
.bfc-widget .bfc-panel.is-dragging {
    transition: none !important;
    user-select: none !important;
}
.bfc-panel.is-positioned,
.bfc-widget .bfc-panel.is-positioned {
    bottom: auto !important;
    right: auto !important;
}
.bfc-panel-header,
.bfc-widget .bfc-panel-header {
    min-height: 94px !important;
    padding: 17px 18px !important;
    align-items: center !important;
    cursor: move !important;
    gap: 12px !important;
}
.bfc-panel-icon,
.bfc-widget .bfc-panel-icon {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
}
.bfc-panel-icon svg,
.bfc-widget .bfc-panel-icon svg {
    width: 25px !important;
    height: 25px !important;
}
.bfc-panel-header strong,
.bfc-widget .bfc-panel-header strong {
    font-size: 21px !important;
    line-height: 1.18 !important;
}
.bfc-panel-header p,
.bfc-widget .bfc-panel-header p {
    margin-top: 5px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}
.bfc-close,
.bfc-panel .bfc-close,
button.bfc-close {
    z-index: 50 !important;
    pointer-events: auto !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    font-size: 22px !important;
    cursor: pointer !important;
}
.bfc-status-bar,
.bfc-widget .bfc-status-bar {
    min-height: 44px !important;
    padding: 0 18px !important;
    font-size: 13px !important;
}
.bfc-messages,
.bfc-widget .bfc-messages {
    padding: 18px !important;
    gap: 14px !important;
}
.bfc-message,
.bfc-widget .bfc-message {
    max-width: 84% !important;
}
.bfc-message.is-admin,
.bfc-message.is-system,
.bfc-widget .bfc-message.is-admin,
.bfc-widget .bfc-message.is-system {
    margin-inline-start: 0 !important;
}
.bfc-message.is-admin::before,
.bfc-message.is-system::before,
.bfc-message.is-admin::after,
.bfc-message.is-system::after,
.bfc-widget .bfc-message.is-admin::before,
.bfc-widget .bfc-message.is-system::before,
.bfc-widget .bfc-message.is-admin::after,
.bfc-widget .bfc-message.is-system::after {
    display: none !important;
}
.bfc-message-body,
.bfc-widget .bfc-message-body {
    padding: 12px 15px !important;
    border-radius: 17px !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
}
.bfc-message-time,
.bfc-widget .bfc-message-time {
    font-size: 11px !important;
}
.bfc-composer,
.bfc-widget .bfc-composer {
    padding: 14px 16px 16px !important;
    gap: 10px !important;
}
.bfc-composer-row,
.bfc-widget .bfc-composer-row {
    gap: 10px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
}
.bfc-input-wrap,
.bfc-widget .bfc-input-wrap {
    min-height: 54px !important;
}
.bfc-widget .bfc-composer textarea[data-bfc-input],
.bfc-input-wrap textarea[data-bfc-input] {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 108px !important;
    border-radius: 16px !important;
    font-size: 14px !important;
    padding: 16px 74px 12px 16px !important;
}
.bfc-widget[dir="rtl"] .bfc-composer textarea[data-bfc-input] {
    padding-right: 16px !important;
    padding-left: 74px !important;
}
.bfc-input-tool,
.bfc-widget .bfc-input-tool {
    width: 28px !important;
    height: 28px !important;
}
.bfc-input-tool svg,
.bfc-widget .bfc-input-tool svg {
    width: 19px !important;
    height: 19px !important;
}
.bfc-input-attach { right: 42px !important; }
.bfc-input-send-hint { right: 12px !important; }
.bfc-widget[dir="rtl"] .bfc-input-attach { right: auto !important; left: 42px !important; }
.bfc-widget[dir="rtl"] .bfc-input-send-hint { right: auto !important; left: 12px !important; }
.bfc-send-button,
.bfc-composer button[data-bfc-send],
.bfc-widget .bfc-composer button[data-bfc-send] {
    min-width: 88px !important;
    height: 54px !important;
    padding: 0 18px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
}
.bfc-composer-meta,
.bfc-widget .bfc-composer-meta {
    gap: 10px !important;
}
.bfc-privacy-notice,
.bfc-widget .bfc-privacy-notice {
    max-width: 72% !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
}
.bfc-counter,
.bfc-widget .bfc-counter {
    font-size: 11px !important;
    font-weight: 700 !important;
}
.bfc-launcher,
.bfc-widget .bfc-launcher {
    z-index: 2147483002 !important;
}
.bfc-overlay,
.bfc-widget .bfc-overlay {
    pointer-events: none !important;
}
@media (max-width: 760px) {
    .bfc-panel,
    .bfc-widget .bfc-panel {
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: calc(var(--bfc-mobile-bottom) + var(--bfc-launcher-size) + 12px + env(safe-area-inset-bottom, 0px)) !important;
        width: auto !important;
        height: min(72vh, 560px) !important;
        border-radius: 20px !important;
    }
    .bfc-panel-header,
    .bfc-widget .bfc-panel-header {
        min-height: 78px !important;
        padding: 14px 16px !important;
        cursor: default !important;
    }
    .bfc-panel-icon,
    .bfc-widget .bfc-panel-icon {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
    }
    .bfc-panel-header strong,
    .bfc-widget .bfc-panel-header strong { font-size: 18px !important; }
    .bfc-panel-header p,
    .bfc-widget .bfc-panel-header p { font-size: 12px !important; }
    .bfc-composer-row,
    .bfc-widget .bfc-composer-row {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .bfc-composer button[data-bfc-send],
    .bfc-widget .bfc-composer button[data-bfc-send] {
        min-width: 100% !important;
        height: 50px !important;
    }
    .bfc-composer-meta,
    .bfc-widget .bfc-composer-meta {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .bfc-privacy-notice,
    .bfc-widget .bfc-privacy-notice {
        max-width: 100% !important;
    }
    .bfc-counter,
    .bfc-widget .bfc-counter {
        align-self: flex-end !important;
    }
}

/* v1.4.2 Popup UX hardening and mobile dimensions.
   Final override block: fixes hidden-state close failures caused by later display rules,
   keeps desktop panel compact, and defines predictable mobile dimensions. */
.bfc-widget [hidden],
.bfc-widget .bfc-panel[hidden],
.bfc-widget .bfc-overlay[hidden],
.bfc-widget .bfc-visitor-form[hidden],
.bfc-widget .bfc-messages-shell[hidden],
.bfc-widget .bfc-closed-notice[hidden],
.bfc-widget .bfc-composer[hidden],
.bfc-widget .bfc-error[hidden] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.bfc-widget,
.bfc-widget * {
    box-sizing: border-box !important;
}

.bfc-widget .bfc-panel {
    width: min(390px, calc(100vw - 32px)) !important;
    max-width: 390px !important;
    height: min(585px, calc(100dvh - 118px)) !important;
    max-height: calc(100dvh - 118px) !important;
    min-height: 430px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto !important;
    box-shadow: 0 22px 56px rgba(15,23,42,.20), 0 7px 18px rgba(15,23,42,.10) !important;
    background: #fff !important;
}

.bfc-widget .bfc-panel.is-positioned {
    bottom: auto !important;
    right: auto !important;
}

.bfc-widget .bfc-panel-header {
    min-height: 82px !important;
    padding: 14px 16px !important;
    cursor: move !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    align-items: center !important;
    gap: 10px !important;
}
.bfc-widget .bfc-panel-brand {
    gap: 12px !important;
    min-width: 0 !important;
}
.bfc-widget .bfc-panel-icon {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
}
.bfc-widget .bfc-panel-icon svg {
    width: 22px !important;
    height: 22px !important;
}
.bfc-widget .bfc-panel-header strong {
    font-size: 18px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.bfc-widget .bfc-panel-header p {
    margin-top: 3px !important;
    font-size: 11.5px !important;
    line-height: 1.35 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.bfc-widget .bfc-close,
.bfc-widget button.bfc-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    position: relative !important;
    z-index: 2147483004 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.14) !important;
    border: 1px solid rgba(255,255,255,.32) !important;
    font-size: 22px !important;
    line-height: 1 !important;
}
.bfc-widget .bfc-status-bar {
    min-height: 40px !important;
    padding: 0 16px !important;
    font-size: 12px !important;
    gap: 10px !important;
}
.bfc-widget .bfc-status-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    box-shadow: 0 0 0 5px rgba(16,185,129,.12) !important;
}
.bfc-widget .bfc-messages-shell {
    min-height: 0 !important;
    overflow: hidden !important;
}
.bfc-widget .bfc-messages {
    padding: 14px 15px 16px !important;
    gap: 11px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
}
.bfc-widget .bfc-message {
    max-width: 86% !important;
}
.bfc-widget .bfc-message-body {
    padding: 10px 13px !important;
    border-radius: 15px !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
}
.bfc-widget .bfc-message-body a {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 2px !important;
}
.bfc-widget .bfc-message-time {
    font-size: 10.5px !important;
    color: #64748b !important;
}
.bfc-widget .bfc-composer {
    padding: 12px 14px 13px !important;
    gap: 8px !important;
}
.bfc-widget .bfc-composer-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 78px !important;
    align-items: stretch !important;
    gap: 9px !important;
}
.bfc-widget .bfc-input-wrap {
    min-height: 48px !important;
}
.bfc-widget .bfc-composer textarea[data-bfc-input] {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 92px !important;
    border-radius: 14px !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
    padding: 14px 66px 10px 13px !important;
}
.bfc-widget[dir="rtl"] .bfc-composer textarea[data-bfc-input] {
    padding-right: 13px !important;
    padding-left: 66px !important;
}
.bfc-widget .bfc-input-tool {
    width: 24px !important;
    height: 24px !important;
}
.bfc-widget .bfc-input-tool svg {
    width: 17px !important;
    height: 17px !important;
}
.bfc-widget .bfc-input-attach { right: 36px !important; }
.bfc-widget .bfc-input-send-hint { right: 10px !important; }
.bfc-widget[dir="rtl"] .bfc-input-attach { right: auto !important; left: 36px !important; }
.bfc-widget[dir="rtl"] .bfc-input-send-hint { right: auto !important; left: 10px !important; }
.bfc-widget .bfc-composer button[data-bfc-send] {
    width: 78px !important;
    min-width: 78px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
    font-size: 13.5px !important;
}
.bfc-widget .bfc-composer-meta {
    align-items: flex-start !important;
    gap: 8px !important;
}
.bfc-widget .bfc-privacy-notice {
    max-width: calc(100% - 94px) !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    gap: 7px !important;
}
.bfc-widget .bfc-privacy-lock,
.bfc-widget .bfc-privacy-lock svg {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
}
.bfc-widget .bfc-counter {
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    max-width: 94px !important;
    white-space: normal !important;
}
.bfc-widget .bfc-launcher {
    width: clamp(50px, var(--bfc-launcher-size), 62px) !important;
    height: clamp(50px, var(--bfc-launcher-size), 62px) !important;
    min-width: 50px !important;
    min-height: 50px !important;
    z-index: 2147483005 !important;
}
.bfc-widget .bfc-launcher svg {
    width: min(var(--bfc-launcher-icon-size), 30px) !important;
    height: min(var(--bfc-launcher-icon-size), 30px) !important;
}
.bfc-widget.is-open .bfc-launcher {
    transform: none !important;
}

@media (max-width: 760px) {
    .bfc-widget .bfc-panel {
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: calc(var(--bfc-mobile-bottom) + var(--bfc-launcher-size) + 10px + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100dvw - 20px) !important;
        max-width: none !important;
        height: min(70dvh, calc(100dvh - 112px)) !important;
        max-height: calc(100dvh - 112px) !important;
        min-height: 380px !important;
        border-radius: 18px !important;
    }
    .bfc-widget .bfc-panel.is-positioned {
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: calc(var(--bfc-mobile-bottom) + var(--bfc-launcher-size) + 10px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .bfc-widget .bfc-panel-header {
        min-height: 68px !important;
        padding: 11px 13px !important;
        cursor: default !important;
    }
    .bfc-widget .bfc-panel-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }
    .bfc-widget .bfc-panel-icon svg {
        width: 19px !important;
        height: 19px !important;
    }
    .bfc-widget .bfc-panel-header strong {
        font-size: 16px !important;
    }
    .bfc-widget .bfc-panel-header p {
        font-size: 10.5px !important;
        -webkit-line-clamp: 1 !important;
    }
    .bfc-widget .bfc-close,
    .bfc-widget button.bfc-close {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        font-size: 20px !important;
    }
    .bfc-widget .bfc-status-bar {
        min-height: 34px !important;
        padding: 0 13px !important;
        font-size: 11px !important;
    }
    .bfc-widget .bfc-messages {
        padding: 11px 12px 12px !important;
        gap: 9px !important;
    }
    .bfc-widget .bfc-message {
        max-width: 88% !important;
    }
    .bfc-widget .bfc-message-body {
        font-size: 12.5px !important;
        line-height: 1.48 !important;
        padding: 9px 11px !important;
        border-radius: 14px !important;
    }
    .bfc-widget .bfc-composer {
        padding: 10px 11px 11px !important;
        gap: 7px !important;
    }
    .bfc-widget .bfc-composer-row {
        grid-template-columns: minmax(0, 1fr) 62px !important;
        gap: 7px !important;
    }
    .bfc-widget .bfc-input-wrap {
        min-height: 44px !important;
    }
    .bfc-widget .bfc-composer textarea[data-bfc-input] {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 84px !important;
        font-size: 12.5px !important;
        padding-top: 12px !important;
        padding-bottom: 8px !important;
    }
    .bfc-widget .bfc-composer button[data-bfc-send] {
        width: 62px !important;
        min-width: 62px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-radius: 13px !important;
        padding: 0 8px !important;
        font-size: 12.5px !important;
    }
    .bfc-widget .bfc-composer-meta {
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
    }
    .bfc-widget .bfc-privacy-notice {
        max-width: calc(100% - 76px) !important;
        font-size: 9.8px !important;
    }
    .bfc-widget .bfc-counter {
        font-size: 9.8px !important;
        max-width: 74px !important;
        text-align: end !important;
    }
    .bfc-widget .bfc-launcher {
        width: clamp(48px, var(--bfc-launcher-size), 56px) !important;
        height: clamp(48px, var(--bfc-launcher-size), 56px) !important;
    }
}

@media (max-width: 420px) {
    .bfc-widget .bfc-panel {
        left: 8px !important;
        right: 8px !important;
        width: calc(100dvw - 16px) !important;
        height: min(72dvh, calc(100dvh - 102px)) !important;
        max-height: calc(100dvh - 102px) !important;
        min-height: 350px !important;
        border-radius: 16px !important;
    }
    .bfc-widget .bfc-message { max-width: 92% !important; }
    .bfc-widget .bfc-panel-brand { gap: 9px !important; }
    .bfc-widget .bfc-composer-row { grid-template-columns: minmax(0, 1fr) 56px !important; }
    .bfc-widget .bfc-composer button[data-bfc-send] { width: 56px !important; min-width: 56px !important; font-size: 12px !important; }
    .bfc-widget .bfc-privacy-notice span:last-child {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}

@media (max-height: 620px) {
    .bfc-widget .bfc-panel {
        height: calc(100dvh - 90px) !important;
        max-height: calc(100dvh - 90px) !important;
    }
    .bfc-widget .bfc-panel-header { min-height: 62px !important; padding-top: 9px !important; padding-bottom: 9px !important; }
    .bfc-widget .bfc-status-bar { min-height: 32px !important; }
    .bfc-widget .bfc-composer { padding-top: 8px !important; padding-bottom: 8px !important; }
}

/* v1.4.3 fast-submit and thinking-state UX */
.bfc-message.is-pending .bfc-message-body,
.bfc-widget .bfc-message.is-pending .bfc-message-body {
    opacity: .88 !important;
}
.bfc-message.is-pending .bfc-message-time,
.bfc-widget .bfc-message.is-pending .bfc-message-time {
    color: #2563eb !important;
    font-weight: 750 !important;
}
.bfc-message.is-typing,
.bfc-widget .bfc-message.is-typing {
    max-width: min(76%, 360px) !important;
}
.bfc-message.is-typing .bfc-message-body,
.bfc-widget .bfc-message.is-typing .bfc-message-body {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 16px !important;
    min-height: 42px !important;
    color: #334155 !important;
    background: #f8fafc !important;
    border-color: #dbeafe !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}
.bfc-typing-dots,
.bfc-widget .bfc-typing-dots {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}
.bfc-typing-dots i,
.bfc-widget .bfc-typing-dots i {
    width: 5px !important;
    height: 5px !important;
    border-radius: 999px !important;
    background: #2563eb !important;
    opacity: .35 !important;
    animation: bfc-typing-dot 1.05s infinite ease-in-out !important;
}
.bfc-typing-dots i:nth-child(2) { animation-delay: .14s !important; }
.bfc-typing-dots i:nth-child(3) { animation-delay: .28s !important; }
@keyframes bfc-typing-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: .32; }
    40% { transform: translateY(-3px); opacity: 1; }
}
.bfc-widget .bfc-composer textarea[data-bfc-input]:placeholder-shown {
    direction: ltr !important;
}
@media (max-width: 760px) {
    .bfc-message.is-typing,
    .bfc-widget .bfc-message.is-typing {
        max-width: 86% !important;
    }
    .bfc-message.is-typing .bfc-message-body,
    .bfc-widget .bfc-message.is-typing .bfc-message-body {
        font-size: 12px !important;
        padding: 10px 13px !important;
    }
}

/* v1.4.4 Header visibility and duplicate-send state hardening.
   The header must never reopen above the visible viewport, and optimistic/poll states
   must not leave a second copy of the same visitor message on screen. */
.bfc-widget .bfc-panel {
    transform: none !important;
}
.bfc-widget .bfc-panel-header {
    position: relative !important;
    z-index: 3 !important;
    flex-shrink: 0 !important;
}
.bfc-widget .bfc-status-bar {
    position: relative !important;
    z-index: 2 !important;
    flex-shrink: 0 !important;
}
.bfc-widget .bfc-messages-shell {
    min-height: 0 !important;
}
.bfc-widget .bfc-message.is-pending + .bfc-message.is-visitor .bfc-message-body {
    box-shadow: none !important;
}
.bfc-widget .bfc-composer button[data-bfc-send]:disabled {
    opacity: .72 !important;
    cursor: progress !important;
}
@media (max-width: 760px) {
    .bfc-widget .bfc-panel {
        top: auto !important;
        transform: none !important;
    }
}

/* v1.4.6 Popup layout lock and mobile composer stabilization.
   This is the final, high-specificity layout layer: the panel becomes a real
   column layout, messages own the flexible middle area, and the composer is
   pinned to the bottom for both new and existing conversations. */
.bfc-widget .bfc-panel:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
    width: min(390px, calc(100vw - 32px)) !important;
    max-width: 390px !important;
    height: min(540px, calc(100dvh - 116px)) !important;
    max-height: calc(100dvh - 116px) !important;
    min-height: 410px !important;
    overflow: hidden !important;
}
.bfc-widget .bfc-panel[hidden] {
    display: none !important;
}
.bfc-widget .bfc-panel-header,
.bfc-widget .bfc-status-bar,
.bfc-widget .bfc-visitor-form,
.bfc-widget .bfc-composer,
.bfc-widget .bfc-closed-notice,
.bfc-widget .bfc-error {
    flex: 0 0 auto !important;
}
.bfc-widget .bfc-panel-header {
    min-height: 76px !important;
    padding: 13px 15px !important;
}
.bfc-widget .bfc-status-bar {
    min-height: 38px !important;
    padding: 0 15px !important;
}
.bfc-widget .bfc-messages-shell:not([hidden]) {
    display: block !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    position: relative !important;
}
.bfc-widget .bfc-messages {
    min-height: 100% !important;
    height: 100% !important;
    padding: 13px 15px 14px !important;
    gap: 10px !important;
}
.bfc-widget .bfc-empty-state {
    inset: 0 !important;
    padding: 18px !important;
    font-size: 13px !important;
}
.bfc-widget .bfc-composer:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 11px 13px 11px !important;
    gap: 7px !important;
    margin: 0 !important;
    min-height: 0 !important;
    position: relative !important;
    z-index: 4 !important;
    border-top: 1px solid rgba(226,232,240,.95) !important;
}
.bfc-widget .bfc-composer-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 46px !important;
}
.bfc-widget .bfc-input-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 46px !important;
    height: auto !important;
    display: flex !important;
    align-items: stretch !important;
}
.bfc-widget .bfc-composer textarea[data-bfc-input] {
    min-height: 46px !important;
    height: 46px !important;
    max-height: 86px !important;
    padding-top: 12px !important;
    padding-bottom: 8px !important;
}
.bfc-widget .bfc-composer button[data-bfc-send] {
    flex: 0 0 74px !important;
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    border-radius: 14px !important;
    align-self: stretch !important;
}
.bfc-widget .bfc-composer-meta {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 0 !important;
}
.bfc-widget .bfc-privacy-notice {
    max-width: calc(100% - 82px) !important;
    font-size: 10px !important;
    line-height: 1.32 !important;
    margin: 0 !important;
}
.bfc-widget .bfc-counter {
    max-width: 80px !important;
    font-size: 10px !important;
    line-height: 1.32 !important;
    white-space: normal !important;
    text-align: end !important;
}
.bfc-widget .bfc-message-body {
    font-size: 13px !important;
    line-height: 1.5 !important;
}
.bfc-widget .bfc-message-time {
    font-size: 10px !important;
}

@media (max-width: 760px) {
    .bfc-widget .bfc-panel:not([hidden]) {
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        bottom: calc(var(--bfc-mobile-bottom) + var(--bfc-launcher-size) + 10px + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100dvw - 16px) !important;
        max-width: none !important;
        height: min(62dvh, 520px) !important;
        max-height: calc(100dvh - 108px) !important;
        min-height: 360px !important;
        border-radius: 17px !important;
    }
    .bfc-widget .bfc-panel.is-positioned {
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        bottom: calc(var(--bfc-mobile-bottom) + var(--bfc-launcher-size) + 10px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .bfc-widget .bfc-panel-header {
        min-height: 64px !important;
        padding: 10px 12px !important;
    }
    .bfc-widget .bfc-panel-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
    }
    .bfc-widget .bfc-panel-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
    .bfc-widget .bfc-panel-header strong {
        font-size: 15px !important;
    }
    .bfc-widget .bfc-panel-header p {
        font-size: 10px !important;
        line-height: 1.25 !important;
        -webkit-line-clamp: 1 !important;
    }
    .bfc-widget .bfc-status-bar {
        min-height: 32px !important;
        padding: 0 12px !important;
        font-size: 10.5px !important;
    }
    .bfc-widget .bfc-messages {
        padding: 10px 11px 11px !important;
        gap: 8px !important;
    }
    .bfc-widget .bfc-message {
        max-width: 90% !important;
    }
    .bfc-widget .bfc-message-body {
        font-size: 12px !important;
        line-height: 1.45 !important;
        padding: 8px 10px !important;
    }
    .bfc-widget .bfc-composer:not([hidden]) {
        padding: 9px 10px 10px !important;
        gap: 6px !important;
    }
    .bfc-widget .bfc-composer-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 7px !important;
        min-height: 42px !important;
    }
    .bfc-widget .bfc-input-wrap {
        min-height: 42px !important;
    }
    .bfc-widget .bfc-composer textarea[data-bfc-input] {
        height: 42px !important;
        min-height: 42px !important;
        max-height: 74px !important;
        font-size: 12px !important;
        padding-top: 11px !important;
        padding-bottom: 7px !important;
    }
    .bfc-widget .bfc-composer button[data-bfc-send] {
        flex: 0 0 58px !important;
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        height: 42px !important;
        min-height: 42px !important;
        font-size: 11.5px !important;
        border-radius: 12px !important;
    }
    .bfc-widget .bfc-composer-meta {
        flex-direction: row !important;
        align-items: flex-start !important;
    }
    .bfc-widget .bfc-privacy-notice {
        max-width: calc(100% - 70px) !important;
        font-size: 9.3px !important;
        line-height: 1.28 !important;
    }
    .bfc-widget .bfc-counter {
        max-width: 68px !important;
        font-size: 9.3px !important;
        line-height: 1.28 !important;
    }
}

@media (max-width: 420px) {
    .bfc-widget .bfc-panel:not([hidden]) {
        height: min(64dvh, 500px) !important;
        min-height: 340px !important;
    }
    .bfc-widget .bfc-panel-header { min-height: 60px !important; }
    .bfc-widget .bfc-status-bar { min-height: 30px !important; }
    .bfc-widget .bfc-composer button[data-bfc-send] {
        flex-basis: 54px !important;
        width: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
    }
}

@media (max-height: 620px) {
    .bfc-widget .bfc-panel:not([hidden]) {
        height: calc(100dvh - 88px) !important;
        min-height: 330px !important;
    }
    .bfc-widget .bfc-panel-header { min-height: 56px !important; }
    .bfc-widget .bfc-status-bar { min-height: 28px !important; }
}

/* v1.5.45: attachments are hidden until the full secure upload pipeline exists. */
.bfc-input-attach { display: none !important; }
