/* FORMEL — Sophia sur les pages commerciales (dock). Bulle discrète, panneau léger ; le composant .fsp garde son propre style. */
.fsd { --fsd-navy: #04273E; --fsd-green: #08734D; --fsd-green-deep: #14532D; --fsd-gold: #F5B301; font-family: inherit; }
.fsd *, .fsd *::before, .fsd *::after { box-sizing: border-box; }
.fsd-launch {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 99990;
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 18px 8px 8px; margin: 0;
  border: 0 !important; border-radius: 999px !important; cursor: pointer;
  background: linear-gradient(135deg, var(--fsd-green-deep), var(--fsd-navy)) !important; color: #fff !important;
  box-shadow: 0 10px 30px rgba(4, 39, 62, .28); font: 600 15px/1.2 inherit !important; text-transform: none !important; letter-spacing: normal !important;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}
.fsd-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(4, 39, 62, .34); }
.fsd-launch:focus-visible { outline: 3px solid var(--fsd-gold); outline-offset: 3px; }
.fsd-orb {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff6d6 0, var(--fsd-gold) 40%, #b07f00 100%);
  box-shadow: 0 0 0 4px rgba(245, 179, 1, .18), 0 0 18px rgba(245, 179, 1, .35);
}
/* Une seule respiration lente, interrompue dès que le visiteur interagit ; rien si mouvement réduit. */
.fsd:not(.is-touched) .fsd-orb::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(245, 179, 1, .5); animation: fsd-hello 2.4s ease-out 1.2s 2 both; }
@keyframes fsd-hello { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.fsd.is-open .fsd-launch, .fsd.is-hidden .fsd-launch { opacity: 0; pointer-events: none; transform: translateY(12px); }
.fsd-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 99991; width: 410px; height: min(660px, calc(100vh - 40px));
  display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(4, 39, 62, .30); border: 1px solid #DADFE4; animation: fsd-open .22s ease-out;
}
.fsd-panel[hidden] { display: none !important; }
@keyframes fsd-open { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.fsd-close {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 44px; height: 44px; padding: 0 !important; margin: 0;
  border: 0 !important; border-radius: 50% !important; background: rgba(255, 255, 255, .14) !important; color: #fff !important;
  font: 400 28px/44px Arial, sans-serif !important; cursor: pointer; text-align: center;
}
.fsd-close:hover, .fsd-close:focus-visible { background: rgba(255, 255, 255, .28) !important; outline: none; }
.fsd-body { flex: 1 1 auto; min-height: 0; display: flex; }
.fsd-loading { margin: auto; color: #5F6B76; font-size: 15px; }
/* Le composant Sophia en version panneau : en-tête compact, conversation, saisie. */
.fsd .fsp { display: flex; flex-direction: column; width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.fsd .fsp-side { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; text-align: left; gap: 4px 12px; padding: 12px 64px 12px 14px; }
.fsd .fsp-orb, .fsd .fsp .fsp-orb[data-canvas="ready"] { width: 52px; height: 52px; margin: 0; flex: 0 0 auto; }
.fsd .fsp-name { font-size: 18px; }
.fsd .fsp-tag { font-size: 12.5px; }
.fsd .fsp-state { margin: 0; font-size: 12px; }
.fsd .fsp-side > .fsp-name, .fsd .fsp-side > .fsp-tag, .fsd .fsp-side > .fsp-state { display: none; }
.fsd .fsd-id { display: flex; flex-direction: column; min-width: 0; }
.fsd .fsd-id b { font-size: 17px; line-height: 1.2; }
.fsd .fsd-id small { font-size: 12.5px; opacity: .85; }
.fsd .fsd-id i { font-style: normal; font-size: 12px; color: var(--fsd-gold); min-height: 1.2em; }
.fsd .fsp-human { margin: 0 0 0 auto; width: auto; border: 0; padding: 0; }
.fsd .fsp-human p, .fsd .fsp-phone { display: none; }
.fsd .fsp .fsp-human .fsp-wa { min-height: 40px; padding: 8px 14px; font-size: 13.5px; }
.fsd .fsp-main { flex: 1 1 auto; min-height: 0; }
.fsd .fsp-log { flex: 1 1 auto; height: auto; min-height: 0; padding: 16px 14px 8px; }
.fsd .fsp-msg { max-width: 92%; }
.fsd .fsp-bubble { font-size: 15px; padding: 12px 14px; }
.fsd .fsp-chips { padding: 0 14px 10px; gap: 6px; }
.fsd .fsp .fsp-chips .fsp-chip { font-size: 14px !important; min-height: 40px !important; padding: 8px 13px !important; }
.fsd .fsp-form { padding: 10px 12px; }
.fsd .fsp-foot { padding: 6px 14px 10px; font-size: 11.5px; flex-direction: column; align-items: flex-start; gap: 4px; }
@media (max-width: 600px) {
  .fsd-launch { padding: 7px; min-height: 54px; }
  .fsd-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fsd[data-context="form"] .fsd-launch { min-height: 46px; padding: 5px; }
  .fsd[data-context="form"] .fsd-orb { width: 34px; height: 34px; }
  /* Plein écran sur téléphone : la saisie reste visible au-dessus du clavier. */
  .fsd-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .fsd .fsp-foot p { display: none; }
  body.fsd-on { padding-bottom: 76px; }
  body.fsd-lock { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .fsd *, .fsd *::before, .fsd *::after { animation: none !important; transition: none !important; }
}

.fsd #sophia{width:100%;height:100%}
.fsd .fsd-close{color:#eef5f1 !important}
/* Le bouton « Retour en haut » du site se place au-dessus de la bulle, et disparaît quand la conversation est ouverte. */
body.fsd-on #back-to-top{bottom:96px!important}
body.fsd-lock #back-to-top,body:has(.fsd.is-open) #back-to-top{display:none!important}
