/* Le bot à l'orange du site, arrondi comme le menu et les boutons.
   Deux touches pixel seulement : la fenêtre se découvre en pixels à l'ouverture, un curseur orange suit la réponse. */
#tb-bulle, #tb-fenetre { --tb-petrole: #0E3A44; --tb-orange: #FF5C29; --tb-creme: #F5F2EC; }

/* Bouton « Une question ? » : orange, pour se voir sur les fonds sombres comme sur les clairs */
#tb-bulle { background: var(--tb-orange); box-shadow: 0 10px 28px rgba(7, 28, 34, .3); }
#tb-bulle:hover { transform: translateY(-2px); }

/* Bulle d'accueil, au-dessus du bouton */
#tb-accroche {
    position: fixed; right: 24px; bottom: 140px; z-index: 999; max-width: 270px;
    background: #fff; color: #15171a; border-radius: 16px 16px 4px 16px;
    box-shadow: 0 14px 36px rgba(7, 28, 34, .22); animation: tb-accroche-entre .45s cubic-bezier(.2,.8,.2,1);
}
#tb-accroche[hidden] { display: none; }
.tb-accroche-texte {
    display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
    padding: 14px 40px 14px 16px; font: 500 14px/1.45 'Inter', system-ui, sans-serif; color: inherit;
}
.tb-accroche-fermer {
    position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%;
    background: transparent; color: #6b7078; font-size: 18px; line-height: 1; cursor: pointer;
}
.tb-accroche-fermer:hover { background: #f3f0ea; }
@keyframes tb-accroche-entre { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* Fenêtre : l'orange du site (couleur principale, comme en ligne), bulle du bot en crème */
#tb-fenetre { box-shadow: 0 24px 60px rgba(7, 28, 34, .25); }
.tb-msg-bot { background: var(--tb-creme); }
.tb-msg-bot a { color: #c2410c; }
#tb-texte:focus { outline: none; box-shadow: none !important; border-color: var(--tb-orange); }

/* Pendant que la réponse s'écrit, un petit curseur orange la suit */
.tb-msg-bot.tb-ecrit::after {
    content: ''; display: inline-block; width: 7px; height: 13px; margin-left: 3px; vertical-align: -2px;
    border-radius: 1px; background: var(--tb-orange); animation: tb-clignote .7s steps(1) infinite;
}
@keyframes tb-clignote { 50% { opacity: 0; } }

/* Ouverture : la fenêtre se découvre en pixels (canvas posé par la couche commune du site) */
.tb-px-ouverture { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }

/* Téléphone : la fenêtre occupe l'écran bord à bord (100vw comptait la barre de défilement et la décalait à gauche). */
@media (max-width: 768px) {
    #tb-accroche { right: 16px; bottom: 136px; max-width: calc(100vw - 32px); }
    #tb-fenetre { left: 0; right: 0; width: auto; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tb-msg-bot.tb-ecrit::after { animation: none; }
    #tb-accroche { animation: none; }
}
