/* ==========================================================================
   THIMSO AI — WIDGET BALDY™
   Fichier CSS complet
   Palette : crème, beige BALDY et or — aucun fond marron
   ========================================================================== */

:root {
    --thimso-cream: #fffdf8;
    --thimso-ivory: #fffaf1;
    --thimso-beige: #f4eddf;
    --thimso-beige-soft: #faf5eb;
    --thimso-beige-deep: #ead9b4;
    --thimso-gold: #d4a437;
    --thimso-gold-dark: #b8860b;
    --thimso-border: #ddc58f;
    --thimso-ink: #2f2925;
    --thimso-muted: #6f655d;
    --thimso-success: #57b87d;
    --thimso-danger: #a2392d;
    --thimso-shadow:
        0 18px 48px rgba(63, 48, 35, .16),
        0 3px 12px rgba(212, 164, 55, .10);
}

/* --------------------------------------------------------------------------
   BASE
   -------------------------------------------------------------------------- */

.thimso-ai-chat,
.thimso-ai-chat * {
    box-sizing: border-box !important;
}

.thimso-ai-chat {
    position: fixed !important;
    right: 16px !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    left: auto !important;
    z-index: 2147483000 !important;
    margin: 0 !important;
    color: var(--thimso-ink) !important;
    font-family: Georgia, "Times New Roman", serif !important;
}

.thimso-ai-chat button,
.thimso-ai-chat textarea,
.thimso-ai-chat input,
.thimso-ai-chat select {
    font: inherit !important;
}

.thimso-ai-chat [hidden],
.thimso-ai-door-scene[hidden],
.thimso-ai-chat__window[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   LAUNCHER — BEIGE BALDY
   -------------------------------------------------------------------------- */

.thimso-ai-chat__launcher {
    width: min(330px, calc(100vw - 24px)) !important;
    min-height: 58px !important;
    padding: 7px 14px 7px 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    overflow: hidden !important;
    border: 1px solid var(--thimso-gold) !important;
    border-radius: 999px !important;
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            var(--thimso-ivory) 38%,
            var(--thimso-beige) 100%
        ) !important;
    color: var(--thimso-ink) !important;
    box-shadow:
        0 13px 34px rgba(63, 48, 35, .14),
        inset 0 1px 0 rgba(255, 255, 255, .96) !important;
    cursor: pointer !important;
    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease !important;
}

.thimso-ai-chat__launcher::before {
    content: "" !important;
    position: absolute !important;
    inset: 1px 22% auto 22% !important;
    height: 1px !important;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(212, 164, 55, .62),
            transparent
        ) !important;
    pointer-events: none !important;
}

.thimso-ai-chat__launcher:hover {
    transform: translateY(-2px) !important;
    border-color: var(--thimso-gold-dark) !important;
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #fbf5e9 45%,
            #ecddc1 100%
        ) !important;
    box-shadow:
        0 17px 40px rgba(63, 48, 35, .17),
        0 0 0 3px rgba(212, 164, 55, .09) !important;
}

.thimso-ai-chat__launcher-mark,
.thimso-ai-chat__brand-emblem,
.thimso-ai-chat__avatar,
.thimso-ai-door-scene__start-logo-box{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thimso-ai-door-scene__start-logo{
    width: 32px !important;
    height: auto !important;
    display: block !important;
}
.thimso-ai-chat__launcher-mark {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
}

.thimso-ai-chat__launcher-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    color: var(--thimso-ink) !important;
}

.thimso-ai-chat__launcher-kicker {
    color: var(--thimso-ink) !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    letter-spacing: .015em !important;
}

.thimso-ai-chat__launcher-label {
    color: var(--thimso-muted) !important;
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
}

.thimso-ai-chat__launcher-status {
    flex: 0 0 auto !important;
    width: 9px !important;
    height: 9px !important;
    margin-inline-start: auto !important;
    border-radius: 50% !important;
    background: var(--thimso-success) !important;
    box-shadow:
        0 0 0 4px rgba(87, 184, 125, .16),
        0 0 12px rgba(87, 184, 125, .42) !important;
}

/* --------------------------------------------------------------------------
   LOGOS
   -------------------------------------------------------------------------- */

.thimso-ai-chat__logo,
.thimso-ai-chat__send-logo,
.thimso-ai-door-scene__start-logo,
.thimso-ai-chat__assistant-logo {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    padding: 2px !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
}

.thimso-ai-chat__logo-fallback {
    color: var(--thimso-gold-dark) !important;
    font-size: 10px !important;
    font-weight: 900 !important;
}

/* --------------------------------------------------------------------------
   FENÊTRE DU CHAT
   -------------------------------------------------------------------------- */

.thimso-ai-chat__window {
    position: absolute !important;
    right: 0 !important;
    bottom: 70px !important;
    left: auto !important;
    width: min(430px, calc(100vw - 28px)) !important;
    height: min(690px, calc(100vh - 92px)) !important;
    min-height: 520px !important;
    max-height: 690px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid var(--thimso-gold) !important;
    border-radius: 22px !important;
    background: var(--thimso-ivory) !important;
    color: var(--thimso-ink) !important;
    box-shadow: var(--thimso-shadow) !important;
}

/* En-tête */

.thimso-ai-chat__header {
    flex: 0 0 auto !important;
    min-height: 68px !important;
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    border-bottom: 1px solid var(--thimso-gold) !important;
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            var(--thimso-ivory) 45%,
            var(--thimso-beige) 100%
        ) !important;
}

.thimso-ai-chat__header::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    right: 18% !important;
    left: 18% !important;
    height: 1px !important;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(212, 164, 55, .72),
            transparent
        ) !important;
    pointer-events: none !important;
}

.thimso-ai-chat__brand {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.thimso-ai-chat__brand-emblem {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
}

.thimso-ai-chat__brand-copy {
    min-width: 0 !important;
}

.thimso-ai-chat__brand-kicker {
    display: none !important;
}

.thimso-ai-chat__brand-title {
    display: block !important;
    color: var(--thimso-ink) !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
}

.thimso-ai-chat__brand-subtitle {
    display: block !important;
    margin-top: 3px !important;
    color: var(--thimso-muted) !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
}

.thimso-ai-chat__close,
.thimso-ai-door-scene__close {
    flex: 0 0 auto !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    border: 1px solid var(--thimso-border) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .82) !important;
    color: var(--thimso-muted) !important;
    cursor: pointer !important;
    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease !important;
}

.thimso-ai-chat__close {
    width: 31px !important;
    height: 31px !important;
}

.thimso-ai-chat__close:hover,
.thimso-ai-door-scene__close:hover {
    transform: rotate(90deg) !important;
    border-color: var(--thimso-gold-dark) !important;
    background: #ffffff !important;
}

/* Bande de confiance */

.thimso-ai-chat__trust-strip {
    flex: 0 0 auto !important;
    min-height: 26px !important;
    padding: 6px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
    border-bottom: 1px solid var(--thimso-beige-deep) !important;
    background: #ffffff !important;
    color: var(--thimso-muted) !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
}

/* --------------------------------------------------------------------------
   ZONE DES MESSAGES
   Les anciens messages restent présents et accessibles par le scroll.
   Le formulaire ne recouvre jamais la conversation.
   -------------------------------------------------------------------------- */

.thimso-ai-chat__messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 14px 14px 28px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    scroll-behavior: smooth !important;
    scroll-padding-top: 14px !important;
    scroll-padding-bottom: 28px !important;
    scrollbar-width: thin !important;
    scrollbar-color:
        var(--thimso-gold)
        var(--thimso-beige) !important;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(212, 164, 55, .07),
            transparent 34%
        ),
        linear-gradient(
            180deg,
            #ffffff 0%,
            var(--thimso-beige-soft) 100%
        ) !important;
    overflow-anchor: auto !important;
}

.thimso-ai-chat__messages::-webkit-scrollbar {
    width: 8px !important;
}

.thimso-ai-chat__messages::-webkit-scrollbar-track {
    background: var(--thimso-beige) !important;
    border-radius: 999px !important;
}

.thimso-ai-chat__messages::-webkit-scrollbar-thumb {
    border: 2px solid var(--thimso-beige) !important;
    border-radius: 999px !important;
    background: var(--thimso-gold) !important;
}

.thimso-ai-chat__messages:focus-visible {
    outline: 2px solid rgba(212, 164, 55, .46) !important;
    outline-offset: -3px !important;
}

/* En RTL : scrollbar physiquement à droite, contenu toujours RTL */
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__messages,
.thimso-ai-chat--arabic .thimso-ai-chat__messages {
    direction: ltr !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__messages > *,
.thimso-ai-chat--arabic .thimso-ai-chat__messages > * {
    direction: rtl !important;
}

/* Messages */

.thimso-ai-chat__message {
    width: 100% !important;
    margin: 0 0 12px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
}

.thimso-ai-chat__avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
}

.thimso-ai-chat__bubble {
    max-width: 88% !important;
    padding: 11px 13px !important;
    border: 1px solid rgba(212, 164, 55, .52) !important;
    border-radius: 16px !important;
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            var(--thimso-ivory) 58%,
            var(--thimso-beige) 100%
        ) !important;
    color: var(--thimso-ink) !important;
    box-shadow: 0 7px 18px rgba(63, 48, 35, .08) !important;
    font-size: 12.5px !important;
    line-height: 1.58 !important;
    white-space: pre-line !important;
    overflow-wrap: anywhere !important;
}

.thimso-ai-chat__message--assistant {
    justify-content: flex-start !important;
}

.thimso-ai-chat__message--user {
    justify-content: flex-end !important;
}

.thimso-ai-chat__message--assistant .thimso-ai-chat__bubble,
.thimso-ai-chat__message--user .thimso-ai-chat__bubble {
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            var(--thimso-ivory) 56%,
            var(--thimso-beige) 100%
        ) !important;
    color: var(--thimso-ink) !important;
}

/* LTR */
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__message,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__bubble {
    direction: ltr !important;
    text-align: left !important;
}

/* RTL */
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__message,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__bubble,
.thimso-ai-chat--arabic .thimso-ai-chat__message,
.thimso-ai-chat--arabic .thimso-ai-chat__bubble {
    direction: rtl !important;
    text-align: right !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__message--assistant,
.thimso-ai-chat--arabic .thimso-ai-chat__message--assistant {
    justify-content: flex-start !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__message--user,
.thimso-ai-chat--arabic .thimso-ai-chat__message--user {
    justify-content: flex-end !important;
}

/* Identité assistant éventuellement incluse dans les bulles */

.thimso-ai-chat__assistant-identity {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin-bottom: 7px !important;
    padding-bottom: 7px !important;
    border-bottom: 1px solid rgba(212, 164, 55, .34) !important;
}

.thimso-ai-chat__assistant-logo {
    width: 34px !important;
    height: 28px !important;
    object-fit: contain !important;
}

/* Écriture en cours */

.thimso-ai-chat__typing {
    flex: 0 0 auto !important;
    padding: 7px 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    border-top: 1px solid var(--thimso-beige-deep) !important;
    background: var(--thimso-beige-soft) !important;
    color: var(--thimso-muted) !important;
    font-size: 10px !important;
}

.thimso-ai-chat__typing-dots {
    display: inline-flex !important;
    gap: 3px !important;
}

.thimso-ai-chat__typing-dots i {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background: var(--thimso-gold) !important;
    animation: thimsoTyping 1.1s infinite ease-in-out !important;
}

.thimso-ai-chat__typing-dots i:nth-child(2) {
    animation-delay: .14s !important;
}

.thimso-ai-chat__typing-dots i:nth-child(3) {
    animation-delay: .28s !important;
}

@keyframes thimsoTyping {
    0%, 70%, 100% { transform: translateY(0); opacity: .45; }
    35% { transform: translateY(-3px); opacity: 1; }
}

/* Erreurs */

.thimso-ai-chat__error {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border-top: 1px solid rgba(162, 57, 45, .25) !important;
    background: #fff3f1 !important;
    color: var(--thimso-danger) !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
}

/* --------------------------------------------------------------------------
   FORMULAIRE — TOUJOURS SOUS LES MESSAGES, JAMAIS EN SUPERPOSITION
   -------------------------------------------------------------------------- */

.thimso-ai-chat__form {
    position: relative !important;
    flex: 0 0 auto !important;
    z-index: 2 !important;
    padding: 10px 11px 8px !important;
    border-top: 1px solid var(--thimso-gold) !important;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            var(--thimso-beige-soft) 100%
        ) !important;
}

.thimso-ai-chat__label {
    display: block !important;
    margin-bottom: 6px !important;
    color: var(--thimso-ink) !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
}

.thimso-ai-chat__composer {
    display: flex !important;
    align-items: stretch !important;
    gap: 8px !important;
}

.thimso-ai-chat__composer textarea {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 84px !important;
    max-height: 130px !important;
    padding: 11px 12px !important;
    resize: vertical !important;
    overflow-y: auto !important;
    border: 1px solid var(--thimso-border) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: var(--thimso-ink) !important;
    box-shadow:
        inset 0 1px 4px rgba(63, 48, 35, .05) !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
}

.thimso-ai-chat__composer textarea:focus {
    outline: none !important;
    border-color: var(--thimso-gold) !important;
    box-shadow:
        0 0 0 3px rgba(212, 164, 55, .11),
        inset 0 1px 4px rgba(63, 48, 35, .05) !important;
}

/* Direction dynamique déjà appliquée par le JS :
   LTR = [champ][Envoyer]
   RTL = [Envoyer][champ] */

.thimso-ai-chat__composer--ltr,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__composer {
    direction: ltr !important;
    flex-direction: row !important;
}

.thimso-ai-chat__composer--ltr textarea,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__composer textarea {
    order: 1 !important;
    direction: ltr !important;
    text-align: left !important;
}

.thimso-ai-chat__composer--ltr .thimso-ai-chat__send,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__send {
    order: 2 !important;
}

.thimso-ai-chat__composer--rtl,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__composer {
    direction: ltr !important;
    flex-direction: row !important;
}

.thimso-ai-chat__composer--rtl .thimso-ai-chat__send,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__send {
    order: 1 !important;
}

.thimso-ai-chat__composer--rtl textarea,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__composer textarea {
    order: 2 !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Bouton Envoyer — beige, logo visible, aucune double flèche */

.thimso-ai-chat__send {
    flex: 0 0 112px !important;
    min-width: 112px !important;
    min-height: 84px !important;
    padding: 8px 9px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    border: 1px solid var(--thimso-gold) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            var(--thimso-beige)
        ) !important;
    color: var(--thimso-ink) !important;
    box-shadow:
        0 6px 16px rgba(63, 48, 35, .09),
        inset 0 1px 0 rgba(255, 255, 255, .96) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition:
        transform .2s ease,
        border-color .2s ease,
        box-shadow .2s ease !important;
}

.thimso-ai-chat__send:hover {
    transform: translateY(-1px) !important;
    border-color: var(--thimso-gold-dark) !important;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            var(--thimso-beige-deep)
        ) !important;
    box-shadow:
        0 9px 20px rgba(63, 48, 35, .12),
        inset 0 1px 0 rgba(255, 255, 255, .96) !important;
}

.thimso-ai-chat__send:active {
    transform: translateY(0) !important;
}

.thimso-ai-chat__send-logo {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.thimso-ai-chat__send-label,
.thimso-ai-chat__send span {
    color: var(--thimso-ink) !important;
    font-size: 10.5px !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
}

/* Supprime toute flèche ajoutée par un ancien CSS */
.thimso-ai-chat__send::before,
.thimso-ai-chat__send::after {
    content: none !important;
    display: none !important;
}

/* Métadonnées */

.thimso-ai-chat__form-meta {
    margin-top: 6px !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 8px !important;
    color: var(--thimso-muted) !important;
    font-size: 8.5px !important;
    line-height: 1.35 !important;
}

/* --------------------------------------------------------------------------
   CTA CONTACT ET PIED
   -------------------------------------------------------------------------- */

.thimso-ai-chat__contact-cta {
    flex: 0 0 auto !important;
    margin: 0 10px 9px !important;
    padding: 9px 11px !important;
    border: 1px solid var(--thimso-border) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            var(--thimso-beige)
        ) !important;
}

.thimso-ai-chat__contact-cta strong {
    display: block !important;
    margin-bottom: 4px !important;
    color: var(--thimso-ink) !important;
    font-size: 10.5px !important;
}

.thimso-ai-chat__contact-link {
    color: var(--thimso-gold-dark) !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

.thimso-ai-chat__footer {
    flex: 0 0 auto !important;
    padding: 7px 10px 9px !important;
    border-top: 1px solid var(--thimso-beige-deep) !important;
    background: var(--thimso-beige-soft) !important;
    color: var(--thimso-muted) !important;
    font-size: 8px !important;
    line-height: 1.35 !important;
}

.thimso-ai-chat__footer-mark {
    color: var(--thimso-gold) !important;
}

/* Alignements globaux */

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__brand-copy,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__launcher-content,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__trust-strip,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__form,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__label,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__form-meta,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__contact-cta,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-chat__footer,
.thimso-ai-chat--arabic .thimso-ai-chat__brand-copy,
.thimso-ai-chat--arabic .thimso-ai-chat__launcher-content {
    direction: rtl !important;
    text-align: right !important;
}

.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__brand-copy,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__launcher-content,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__trust-strip,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__form,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__label,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__form-meta,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__contact-cta,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-chat__footer {
    direction: ltr !important;
    text-align: left !important;
}

/* --------------------------------------------------------------------------
   PETITE CARTE DE BIENVENUE
   -------------------------------------------------------------------------- */

.thimso-ai-door-scene {
    position: absolute !important;
    right: 0 !important;
    bottom: 70px !important;
    z-index: 2147483001 !important;
    width: min(340px, calc(100vw - 28px)) !important;
    height: auto !important;
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(10px) scale(.97) !important;
    transition:
        opacity .28s ease,
        visibility .28s ease,
        transform .28s ease !important;
}

.thimso-ai-door-scene.is-visible,
.thimso-ai-door-scene.is-message-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
}

.thimso-ai-door-scene__frame,
.thimso-ai-door-scene__door,
.thimso-ai-door-scene__handle,
.thimso-ai-door-scene__light {
    display: none !important;
}

.thimso-ai-door-scene__bubble {
    position: relative !important;
    width: 100% !important;
    padding: 17px 17px 15px !important;
    overflow: hidden !important;
    border: 1px solid var(--thimso-gold) !important;
    border-radius: 20px !important;
    background:
        linear-gradient(
            115deg,
            transparent 0 44%,
            rgba(255,255,255,.72) 49%,
            transparent 55%
        ) no-repeat,
        linear-gradient(
            145deg,
            #ffffff 0%,
            var(--thimso-ivory) 55%,
            var(--thimso-beige) 100%
        ) !important;
    background-size: 220% 100%, 100% 100% !important;
    color: var(--thimso-ink) !important;
    box-shadow: var(--thimso-shadow) !important;
    animation: thimsoWelcomeShine 5.5s ease-in-out infinite !important;
}

.thimso-ai-door-scene__bubble::before {
    content: "THIMSO FRANCE" !important;
    display: block !important;
    margin-bottom: 7px !important;
    color: var(--thimso-gold-dark) !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    letter-spacing: .08em !important;
}

.thimso-ai-chat[data-language="ar"] .thimso-ai-door-scene__bubble::before,
.thimso-ai-chat--arabic .thimso-ai-door-scene__bubble::before {
    content: "تمسو فرنسا" !important;
    direction: rtl !important;
    text-align: right !important;
    letter-spacing: 0 !important;
}

.thimso-ai-door-scene__close {
    position: absolute !important;
    top: 10px !important;
    right: 11px !important;
    z-index: 2 !important;
    width: 26px !important;
    height: 26px !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__close,
.thimso-ai-chat--arabic .thimso-ai-door-scene__close {
    right: auto !important;
    left: 11px !important;
}

.thimso-ai-door-scene__title {
    display: block !important;
    margin: 0 30px 7px 0 !important;
    color: var(--thimso-ink) !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    font-weight: 800 !important;
}

.thimso-ai-door-scene__message {
    margin: 0 !important;
    color: var(--thimso-muted) !important;
    font-size: 12px !important;
    line-height: 1.65 !important;
    font-weight: 600 !important;
    white-space: pre-line !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__bubble,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__title,
.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__message,
.thimso-ai-chat--arabic .thimso-ai-door-scene__bubble,
.thimso-ai-chat--arabic .thimso-ai-door-scene__title,
.thimso-ai-chat--arabic .thimso-ai-door-scene__message {
    direction: rtl !important;
    text-align: right !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__title,
.thimso-ai-chat--arabic .thimso-ai-door-scene__title {
    margin: 0 0 7px 30px !important;
}

.thimso-ai-chat[data-direction="ltr"] .thimso-ai-door-scene__bubble,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-door-scene__title,
.thimso-ai-chat[data-direction="ltr"] .thimso-ai-door-scene__message {
    direction: ltr !important;
    text-align: left !important;
}

/* Bouton Commencer */

.thimso-ai-door-scene__start {
    min-width: 148px !important;
    min-height: 50px !important;
    margin-top: 13px !important;
    padding: 6px 15px 6px 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    overflow: hidden !important;
    border: 1px solid var(--thimso-gold) !important;
    border-radius: 999px !important;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            var(--thimso-beige)
        ) !important;
    color: var(--thimso-ink) !important;
    box-shadow:
        0 7px 18px rgba(63, 48, 35, .10),
        inset 0 1px 0 rgba(255,255,255,.96) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition:
        transform .2s ease,
        box-shadow .2s ease !important;
}

.thimso-ai-door-scene__start:hover {
    transform: translateY(-1px) !important;
    box-shadow:
        0 10px 24px rgba(63, 48, 35, .13),
        0 0 0 3px rgba(212, 164, 55, .09) !important;
}

.thimso-ai-door-scene__start-logo-box {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
    border-radius: 50% !important;
}

.thimso-ai-door-scene__start-text {
    color: var(--thimso-ink) !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
}

/* Une seule flèche, générée par CSS */

.thimso-ai-door-scene__start::before {
    content: none !important;
    display: none !important;
}

.thimso-ai-chat[data-direction="ltr"] .thimso-ai-door-scene__start::after {
    content: "→" !important;
    display: inline-block !important;
    color: var(--thimso-ink) !important;
    font-size: 15px !important;
    font-weight: 900 !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__start::after,
.thimso-ai-chat--arabic .thimso-ai-door-scene__start::after {
    content: "←" !important;
    display: inline-block !important;
    color: var(--thimso-ink) !important;
    font-size: 15px !important;
    font-weight: 900 !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__start,
.thimso-ai-chat--arabic .thimso-ai-door-scene__start {
    direction: ltr !important;
    flex-direction: row !important;
    margin-right: auto !important;
    margin-left: 0 !important;
}

.thimso-ai-chat[data-direction="rtl"] .thimso-ai-door-scene__start-text,
.thimso-ai-chat--arabic .thimso-ai-door-scene__start-text {
    direction: rtl !important;
    text-align: right !important;
}

@keyframes thimsoWelcomeShine {
    0%, 65%, 100% { background-position: 180% 0, 0 0; }
    78% { background-position: -80% 0, 0 0; }
}

/* --------------------------------------------------------------------------
   DEVIS — PALETTE BEIGE, SI LE MODULE EST AFFICHÉ
   -------------------------------------------------------------------------- */

.thimso-ai-quote,
.thimso-ai-quote__form,
.thimso-ai-quote__intro,
.thimso-ai-quote__notice {
    color: var(--thimso-ink) !important;
    background: var(--thimso-beige-soft) !important;
}

.thimso-ai-quote__form {
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--thimso-gold) var(--thimso-beige) !important;
}

.thimso-ai-quote__form::-webkit-scrollbar {
    width: 7px !important;
}

.thimso-ai-quote__form::-webkit-scrollbar-track {
    background: var(--thimso-beige) !important;
}

.thimso-ai-quote__form::-webkit-scrollbar-thumb {
    border-radius: 999px !important;
    background: var(--thimso-gold) !important;
}

.thimso-ai-quote__grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
}

.thimso-ai-quote__wide {
    grid-column: 1 / -1 !important;
}

.thimso-ai-quote input,
.thimso-ai-quote select,
.thimso-ai-quote textarea {
    width: 100% !important;
    border: 1px solid var(--thimso-border) !important;
    border-radius: 11px !important;
    background: #ffffff !important;
    color: var(--thimso-ink) !important;
}

.thimso-ai-quote__submit {
    border: 1px solid var(--thimso-gold) !important;
    border-radius: 999px !important;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            var(--thimso-beige)
        ) !important;
    color: var(--thimso-ink) !important;
    font-weight: 800 !important;
}

.thimso-ai-quote__submit:hover {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            var(--thimso-beige-deep)
        ) !important;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .thimso-ai-chat {
        right: 8px !important;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .thimso-ai-chat__launcher {
        width: min(330px, calc(100vw - 16px)) !important;
    }

    .thimso-ai-chat__window {
        position: fixed !important;
        right: 8px !important;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100vw - 16px) !important;
        height: calc(100vh - 92px) !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .thimso-ai-door-scene {
        position: fixed !important;
        right: 8px !important;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        width: min(340px, calc(100vw - 16px)) !important;
    }

    .thimso-ai-chat__messages {
        padding: 12px 11px 24px !important;
    }

    .thimso-ai-chat__composer textarea {
        min-height: 76px !important;
    }

    .thimso-ai-chat__send {
        flex-basis: 102px !important;
        min-width: 102px !important;
    }

    .thimso-ai-quote__grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 390px) {
    .thimso-ai-chat__composer {
        gap: 6px !important;
    }

    .thimso-ai-chat__send {
        flex-basis: 92px !important;
        min-width: 92px !important;
        padding: 7px 6px !important;
    }

    .thimso-ai-chat__send-logo {
        width: 26px !important;
        height: 26px !important;
        flex-basis: 26px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thimso-ai-chat *,
    .thimso-ai-chat *::before,
    .thimso-ai-chat *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
/* SOPHIE FIXE EN BAS À DROITE */

.thimso-ai-chat {
    position: fixed !important;
    right: 16px !important;
    bottom: 14px !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 2147483000 !important;
}

@media (max-width: 600px) {
    .thimso-ai-chat {
        right: 8px !important;
        bottom: 8px !important;
    }
}
/* --------------------------------------------------------------------------
   SOPHIE — INVITATION DISCRÈTE + RACCOURCIS COMMERCIAUX (1.4.2)
   -------------------------------------------------------------------------- */
.thimso-ai-chat__engagement {
    position: absolute !important;
    right: 0 !important;
    bottom: 72px !important;
    width: min(330px, calc(100vw - 24px)) !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 6px !important;
    padding: 8px !important;
    border: 1px solid var(--thimso-gold) !important;
    border-radius: 16px !important;
    background: #fffaf0 !important;
    box-shadow: 0 12px 32px rgba(63,48,35,.16) !important;
}
.thimso-ai-chat__engagement[hidden] { display: none !important; }
.thimso-ai-chat__engagement-main {
    flex: 1 1 auto !important;
    padding: 6px 8px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--thimso-ink) !important;
    text-align: left !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}
.thimso-ai-chat--arabic .thimso-ai-chat__engagement-main { text-align: right !important; }
.thimso-ai-chat__engagement-close {
    flex: 0 0 26px !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    border: 1px solid var(--thimso-border) !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: var(--thimso-muted) !important;
    cursor: pointer !important;
}
.thimso-ai-chat__quick-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 8px 0 2px 46px !important;
}
.thimso-ai-chat--arabic .thimso-ai-chat__quick-actions {
    margin: 8px 46px 2px 0 !important;
}
.thimso-ai-chat__quick-action {
    padding: 6px 9px !important;
    border: 1px solid rgba(184,134,11,.45) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--thimso-ink) !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}
.thimso-ai-chat__quick-action:hover,
.thimso-ai-chat__quick-action:focus-visible {
    border-color: var(--thimso-gold-dark) !important;
    background: var(--thimso-beige) !important;
}
@media (max-width: 600px) {
    .thimso-ai-chat__launcher { width: min(290px, calc(100vw - 20px)) !important; }
    .thimso-ai-chat__engagement { width: min(290px, calc(100vw - 20px)) !important; }
    .thimso-ai-chat__window {
        width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 105px) !important;
        min-height: min(520px, calc(100vh - 105px)) !important;
    }
}

/* ==========================================================
   THIMSO AI 1.4.2 — RELAIS HUMAIN / WHATSAPP
========================================================== */

.thimso-ai-chat__message--human .thimso-ai-chat__bubble{
    border:1px solid rgba(184,134,11,.35);
    background:#fffaf0;
}

.thimso-ai-chat__assistant-identity--human{
    font-weight:700;
    font-size:11px;
    letter-spacing:.04em;
    text-transform:uppercase;
    margin-bottom:6px;
}

.thimso-ai-chat__handoff{
    margin:10px 4px 4px;
    padding:12px;
    border:1px solid rgba(184,134,11,.35);
    border-radius:14px;
    background:#fffaf0;
}

.thimso-ai-chat__handoff-meta{
    margin-bottom:8px;
    font-size:12px;
    font-weight:700;
}

.thimso-ai-chat__handoff-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.thimso-ai-chat__handoff-primary,
.thimso-ai-chat__handoff-secondary{
    appearance:none;
    border-radius:999px;
    padding:8px 12px;
    font:inherit;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
}

.thimso-ai-chat__handoff-primary{
    border:1px solid #b8860b;
    background:#3a1f12;
    color:#fffaf0;
}

.thimso-ai-chat__handoff-secondary{
    border:1px solid rgba(58,31,18,.25);
    background:#fff;
    color:#3a1f12;
}

.thimso-ai-chat__human-unread{
    min-width:20px;
    height:20px;
    padding:0 6px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#3a1f12;
    color:#fff;
    font-size:11px;
    font-weight:700;
    line-height:1;
}

/* THIMSO AI 1.4.3 — invitation Sophie plus humaine */
@keyframes thimso-ai-sophie-attention {
    0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 8px 28px rgba(58,31,18,.16); }
    35% { transform: translateY(-3px) scale(1.025); box-shadow: 0 0 0 6px rgba(212,164,55,.12), 0 10px 32px rgba(58,31,18,.22); }
    70% { transform: translateY(0) scale(1.01); box-shadow: 0 0 0 2px rgba(212,164,55,.18), 0 8px 28px rgba(58,31,18,.18); }
}
.thimso-ai-chat__launcher--attention {
    animation: thimso-ai-sophie-attention .55s ease-in-out 3;
}
.thimso-ai-chat__engagement-main {
    white-space: pre-line;
    text-transform: none !important;
    letter-spacing: normal !important;
}
@media (prefers-reduced-motion: reduce) {
    .thimso-ai-chat__launcher--attention { animation: none !important; }
}
