.barla-chatbot-widget {
    position: fixed;
    right: calc(20px + env(safe-area-inset-right, 0px));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    max-width: calc(100vw - 24px);
}
.barla-chatbot-widget .barla-chatbot-popover[hidden] {
    display: none !important;
}
.barla-chatbot-popover {
    position: relative;
    max-width: min(290px, calc(100vw - 32px));
    background: #fff;
    color: #204f79;
    border: 1px solid #d5e4f0;
    border-radius: 15px;
    box-shadow: 0 6px 24px rgba(15, 40, 65, .18);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}
.barla-chatbot-popover::after {
    content: '';
    position: absolute;
    right: 32px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-right: 1px solid #d5e4f0;
    border-bottom: 1px solid #d5e4f0;
    transform: rotate(45deg);
}
.barla-chatbot-message {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 17px;
    color: #204f79 !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
}
.barla-chatbot-message:hover,
.barla-chatbot-message:focus-visible {
    color: #156f9f !important;
    text-decoration: none !important;
}
.barla-chatbot-arrow {
    flex: none;
    font-size: 21px;
    line-height: 1;
}
.barla-chatbot-button {
    display: block;
    width: var(--barla-chatbot-desktop-size, 86px);
    height: var(--barla-chatbot-desktop-size, 86px);
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    line-height: 0;
    transition: transform 150ms ease;
}
.barla-chatbot-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
}
.barla-chatbot-button:hover { transform: scale(1.06); }
.barla-chatbot-button:focus-visible,
.barla-chatbot-message:focus-visible {
    outline: 3px solid #195889;
    outline-offset: 3px;
}
@media (max-width: 767px) {
    .barla-chatbot-widget {
        right: calc(12px + env(safe-area-inset-right, 0px));
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 10px;
    }
    /* Avoid mobile-specific theme rules hiding floating buttons. */
    body .barla-chatbot-widget {
        position: fixed !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 2147483000 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
    body .barla-chatbot-widget .barla-chatbot-button {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 66px;
        height: 66px;
        min-width: 66px;
        min-height: 66px;
    }
    body .barla-chatbot-widget .barla-chatbot-button img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .barla-chatbot-popover::after { right: 24px; }
    .barla-chatbot-message { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .barla-chatbot-button { transition: none; }
}

/* Neutralise le soulignement, le fond survolé et le flash tactile imposés par le thème. */
body .barla-chatbot-widget a.barla-chatbot-message,
body .barla-chatbot-widget a.barla-chatbot-message:link,
body .barla-chatbot-widget a.barla-chatbot-message:visited,
body .barla-chatbot-widget a.barla-chatbot-message:hover,
body .barla-chatbot-widget a.barla-chatbot-message:focus,
body .barla-chatbot-widget a.barla-chatbot-message:active {
    text-decoration: none !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}
body .barla-chatbot-widget a.barla-chatbot-message:focus-visible {
    outline: 3px solid #195889;
    outline-offset: 3px;
}


/* Desktop scaling preserves mobile size independently. */
@media (min-width: 768px) {
    .barla-chatbot-widget .barla-chatbot-button {
        width: var(--barla-chatbot-desktop-size, 86px);
        height: var(--barla-chatbot-desktop-size, 86px);
        flex: 0 0 auto;
    }
}
.barla-chatbot-popover { max-height: min(50vh, 280px); overflow-wrap: anywhere; }
