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

.bfc-widget {
    position: fixed;
    bottom: var(--bfc-desktop-offset-y, 18px);
    z-index: 2147483000;
    font-family: inherit;
}

.bfc-widget.is-bottom-right {
    right: var(--bfc-desktop-offset-x, 18px);
}

.bfc-widget.is-bottom-left {
    left: var(--bfc-desktop-offset-x, 18px);
}

/* Bookfaire Chat launcher shape source: this block is the only source for the public icon shape. */
/* Bookfaire Chat launcher icon color is intentionally forced to white from this file. */
.bfc-widget .bfc-launcher.bfc-launcher--bare-icon,
.bfc-widget button.bfc-launcher.bfc-launcher--bare-icon,
.bfc-widget [data-bfc-launcher].bfc-launcher--bare-icon {
    -webkit-appearance: none !important;
    appearance: none !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    height: 82px !important;
    min-height: 82px !important;
    max-height: 82px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    cursor: pointer !important;
    font: inherit !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-shadow: none !important;
    overflow: visible !important;
    transform: none;
    transition: transform .18s ease, opacity .18s ease !important;
}

.bfc-widget .bfc-launcher.bfc-launcher--bare-icon::before,
.bfc-widget .bfc-launcher.bfc-launcher--bare-icon::after,
.bfc-widget button.bfc-launcher.bfc-launcher--bare-icon::before,
.bfc-widget button.bfc-launcher.bfc-launcher--bare-icon::after {
    content: none !important;
    display: none !important;
}

.bfc-widget .bfc-launcher.bfc-launcher--bare-icon:hover,
.bfc-widget .bfc-launcher.bfc-launcher--bare-icon:focus,
.bfc-widget .bfc-launcher.bfc-launcher--bare-icon:focus-visible,
.bfc-widget .bfc-launcher.bfc-launcher--bare-icon:active {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    opacity: .94;
    transform: translateY(-1px) scale(1.03) !important;
}

.bfc-widget.is-open .bfc-launcher.bfc-launcher--bare-icon {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.bfc-widget .bfc-launcher-icon {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: inherit !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    line-height: 1 !important;
    transition: opacity .16s ease, transform .16s ease !important;
}

.bfc-widget .bfc-launcher-icon svg {
    width: 50px !important;
    height: 50px !important;
    display: block !important;
    color: currentColor !important;
    fill: currentColor !important;
    stroke: none !important;
    overflow: visible !important;
}

.bfc-widget .bfc-launcher-icon svg *,
.bfc-widget .bfc-launcher-icon svg path {
    fill: currentColor !important;
    stroke: none !important;
}

.bfc-widget .bfc-launcher-icon-close {
    opacity: 0;
    transform: scale(.82) rotate(-14deg);
}

.bfc-widget.is-open .bfc-launcher-icon-chat {
    opacity: 0;
    transform: scale(.85) rotate(10deg);
}

.bfc-widget.is-open .bfc-launcher-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.bfc-launcher-label,
.screen-reader-text.bfc-launcher-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.bfc-launcher-tooltip {
    display: none !important;
}

.bfc-launcher-badge {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(220, 38, 38, .28);
}

.bfc-panel {
    position: absolute;
    bottom: 82px;
    width: min(370px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .30);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .26);
    z-index: 2147483003;
}

.is-bottom-right .bfc-panel {
    right: 0;
}

.is-bottom-left .bfc-panel {
    left: 0;
}

.bfc-panel-header {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

.bfc-panel-header strong {
    display: block;
    color: #111827;
    font-size: 16px;
    line-height: 1.4;
}

.bfc-panel-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.bfc-panel-close {
    border: 1px solid #dbe2ea;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.bfc-identity {
    display: grid;
    gap: 8px;
    padding: 12px 14px 0;
}

.bfc-identity.is-collapsed {
    display: none;
}

.bfc-identity input,
.bfc-form textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
}

.bfc-identity input:focus,
.bfc-form textarea:focus {
    border-color: var(--bfc-theme-color, #1f2937);
    outline: 2px solid rgba(31, 41, 55, .12);
}

.bfc-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 280px;
    overflow: auto;
    padding: 14px;
    scroll-behavior: smooth;
}

.bfc-message {
    max-width: 84%;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.bfc-message-admin {
    align-self: flex-start;
    background: #f1f5f9;
    color: #111827;
}

.bfc-message-visitor {
    align-self: flex-end;
    background: var(--bfc-theme-color, #1f2937);
    color: #fff;
}

.bfc-form {
    display: grid;
    gap: 10px;
    padding: 12px 14px 14px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.bfc-form textarea {
    resize: none;
    min-height: 54px;
    max-height: 120px;
}

.bfc-form button {
    border: 0;
    border-radius: 12px;
    background: var(--bfc-theme-color, #1f2937);
    color: #fff;
    padding: 11px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bfc-form button:disabled {
    opacity: .65;
    cursor: progress;
}

.bfc-status {
    min-height: 18px;
    padding: 0 14px 12px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.bfc-status.is-error {
    color: #b91c1c;
}

.bfc-availability {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .07);
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.bfc-availability::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex: 0 0 auto;
}

.bfc-availability.is-offline::before {
    background: #f59e0b;
}

@media (max-width: 480px) {
    .bfc-widget {
        right: 10px;
        bottom: 10px;
    }

    .bfc-widget.is-bottom-left {
        left: 10px;
        right: auto;
    }

    .bfc-widget .bfc-launcher.bfc-launcher--bare-icon,
    .bfc-widget button.bfc-launcher.bfc-launcher--bare-icon,
    .bfc-widget [data-bfc-launcher].bfc-launcher--bare-icon {
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        height: 72px !important;
        min-height: 72px !important;
        max-height: 72px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .bfc-widget .bfc-launcher-icon svg {
        width: 44px !important;
        height: 44px !important;
    }

    .bfc-launcher-tooltip {
        display: none;
    }

    .bfc-panel {
        bottom: 74px;
        width: calc(100vw - 24px);
    }

    .is-bottom-right .bfc-panel {
        right: -2px;
    }

    .is-bottom-left .bfc-panel {
        left: -2px;
    }

    .bfc-messages {
        height: 260px;
    }
}


/* v0.13.0 mobile overlay, background lock, and per-device launcher placement */
html.bfc-chat-lock,
body.bfc-chat-lock {
    overflow: hidden !important;
    overscroll-behavior: contain !important;
    touch-action: none !important;
}

.bfc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
}

.bfc-backdrop[hidden] {
    display: none !important;
}

.bfc-widget.is-open .bfc-launcher.bfc-launcher--bare-icon {
    z-index: 2147483004;
}

@media (max-width: 782px) {
    .bfc-widget {
        right: auto;
        left: auto;
        bottom: var(--bfc-mobile-offset-y, 14px) !important;
        z-index: 2147483000;
    }

    .bfc-widget.is-mobile-bottom-right {
        right: var(--bfc-mobile-offset-x, 14px) !important;
        left: auto !important;
    }

    .bfc-widget.is-mobile-bottom-left {
        left: var(--bfc-mobile-offset-x, 14px) !important;
        right: auto !important;
    }

    .bfc-widget.is-open .bfc-panel {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: calc(var(--bfc-mobile-offset-y, 14px) + 78px) !important;
        width: auto !important;
        max-width: none !important;
        max-height: min(78vh, 680px) !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 22px !important;
        overflow: hidden !important;
        z-index: 2147483003 !important;
        box-shadow: 0 28px 70px rgba(15, 23, 42, .38) !important;
    }

    .bfc-widget.is-open .bfc-panel-header {
        flex: 0 0 auto;
        padding: 14px 16px;
    }

    .bfc-widget.is-open .bfc-identity,
    .bfc-widget.is-open .bfc-form,
    .bfc-widget.is-open .bfc-status {
        flex: 0 0 auto;
    }

    .bfc-widget.is-open .bfc-messages {
        flex: 1 1 auto;
        height: auto !important;
        min-height: 190px;
        max-height: calc(78vh - 270px) !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .bfc-widget.is-open .bfc-form textarea {
        min-height: 60px;
    }

    .bfc-widget.is-open .bfc-launcher.bfc-launcher--bare-icon {
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        height: 72px !important;
        min-height: 72px !important;
        max-height: 72px !important;
    }
}
