/* Partner — bulle de clavardage « Amélia » (siège client).
   100 % première partie : aucun tiers, aucun traqueur, aucun témoin
   publicitaire. La conversation qu'un visiteur ouvre lui-même est
   conservée par Lachance Patrimoine inc. pour lui répondre.
   Design assorti à la vitrine « niveau international » de la boutique :
   fond clair, encre foncée, filet fin, bouton noir sobre — les mêmes
   jetons que les pages (generer_site.py). */
.bulle { --noir: #0B0B0C; --texte: #111113; --texte-2: #3C3C41; --doux: #6E6E73; --filet: #E3E3E6; --fond-alt: #F5F5F7; }
.bulle-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Bouton flottant ---------- */
.bulle-bouton {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 62px; height: 62px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--noir);
  box-shadow: 0 14px 34px rgba(11, 11, 12, 0.32), 0 3px 8px rgba(11, 11, 12, 0.16);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bulle-bouton:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(11, 11, 12, 0.42), 0 4px 10px rgba(11, 11, 12, 0.18); }
.bulle-bouton:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--noir); }
.bulle-bouton svg { width: 30px; height: 30px; display: block; }
.bulle-point {
  position: absolute; top: 2px; right: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--noir); border: 2.5px solid #fff;
}

/* ---------- Amorce discrète (fermable, ne couvre pas le contenu) ---------- */
.bulle-amorce {
  position: fixed; right: 22px; bottom: 96px; z-index: 89;
  display: flex; align-items: center; gap: 10px;
  max-width: min(300px, calc(100vw - 110px));
  background: #fff; border: 1px solid var(--filet); border-radius: 16px;
  box-shadow: 0 14px 34px rgba(11, 11, 12, 0.14);
  padding: 12px 8px 12px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.bulle-amorce[hidden] { display: none; }
.bulle-amorce-texte {
  font-size: 14px; line-height: 1.4; color: var(--texte);
  background: none; border: none; font: inherit; text-align: left; cursor: pointer; padding: 0;
}
.bulle-amorce-fermer {
  flex: none; border: none; background: rgba(11, 11, 12, 0.05);
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 15px; line-height: 1; color: var(--doux); cursor: pointer;
}
.bulle-amorce-fermer:hover { background: rgba(11, 11, 12, 0.1); color: var(--texte); }

/* ---------- Panneau ---------- */
.bulle-panneau {
  position: fixed; right: 22px; bottom: 96px; z-index: 91;
  width: min(392px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 130px));
  background: #fff; border: 1px solid var(--filet); border-radius: 26px;
  box-shadow: 0 30px 70px rgba(11, 11, 12, 0.22), 0 6px 18px rgba(11, 11, 12, 0.09);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texte);
}
.bulle-panneau[hidden] { display: none; }
.bulle-entete {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--filet);
}
.bulle-avatar {
  flex: none; width: 36px; height: 36px; border-radius: 9px;
  background: var(--noir); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Liberation Sans', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 800; font-size: 17px; letter-spacing: -.018em;
}
.bulle-identite { line-height: 1.25; }
.bulle-nom { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.bulle-role { font-size: 12.5px; color: var(--doux); }
.bulle-fermer {
  margin-left: auto; border: none; background: rgba(11, 11, 12, 0.05);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 19px; line-height: 1; color: var(--doux); cursor: pointer;
}
.bulle-fermer:hover { background: rgba(11, 11, 12, 0.1); color: var(--texte); }

/* ---------- Messages ---------- */
.bulle-messages {
  flex: 1; overflow-y: auto; padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, var(--fond-alt), #fff 120px);
}
.bulle-msg { max-width: 85%; padding: 11px 15px; border-radius: 19px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: break-word; }
.bulle-msg.amelia { align-self: flex-start; background: #F0F0F3; color: var(--texte); border-bottom-left-radius: 6px; }
.bulle-msg.moi { align-self: flex-end; background: var(--noir); color: #fff; border-bottom-right-radius: 6px; }
.bulle-msg.systeme { align-self: center; background: transparent; color: var(--doux); font-size: 13px; text-align: center; max-width: 95%; }
.bulle-attente { align-self: flex-start; color: var(--doux); font-size: 13.5px; padding: 2px 6px; }

/* ---------- Saisie ---------- */
.bulle-saisie {
  display: flex; gap: 9px; align-items: flex-end;
  padding: 11px 14px 6px; border-top: 1px solid var(--filet);
}
.bulle-saisie textarea {
  flex: 1; font: inherit; font-size: 15px; line-height: 1.4;
  border: 1.5px solid var(--filet); border-radius: 19px;
  padding: 10px 15px; resize: none; max-height: 96px;
  background: var(--fond-alt); color: var(--texte);
}
.bulle-saisie textarea:focus { outline: none; border-color: var(--noir); background: #fff; }
.bulle-envoyer {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--noir); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bulle-envoyer:hover { background: #1C1C1F; }
.bulle-envoyer svg { width: 19px; height: 19px; display: block; }
.bulle-mention {
  padding: 5px 18px 13px; font-size: 11.5px; line-height: 1.45; color: var(--doux); text-align: center;
}

/* ---------- Mobile : le panneau devient une feuille pleine ---------- */
@media (max-width: 560px) {
  .bulle-bouton { right: 16px; bottom: 16px; width: 58px; height: 58px; }
  .bulle-amorce { right: 16px; bottom: 86px; }
  .bulle-panneau {
    right: 0; bottom: 0; width: 100vw; height: 100dvh;
    border-radius: 0; border: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bulle-bouton { transition: none; }
}

/* ---------- Notifications de réponse ---------- */
.bulle-notif {
  margin: 4px 14px 10px; padding: 11px 13px;
  border: 1px solid var(--filet); border-radius: 14px;
  background: var(--fond-alt); font-size: 13.5px; line-height: 1.45; color: var(--texte);
}
.bulle-notif p { margin: 0 0 9px; }
.bulle-notif p:last-child { margin-bottom: 0; }
.bulle-notif-oui {
  font: inherit; font-size: 13.5px; font-weight: 600;
  background: var(--noir); color: #fff; border: none; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; margin-right: 8px;
}
.bulle-notif-oui:hover { background: #1C1C1F; }
.bulle-notif-non, .bulle-notif-fermer {
  font: inherit; font-size: 13px; color: var(--doux);
  background: none; border: none; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px;
}
