/* ═══════════════════════════════════════════════════════════
   Chat MyFitRace — widget visiteur (fusion avec le Setter IA de David le 2026-10-05 :
   bulle fermée « Une question ? » et en-tête « Gaspar · MyFitRace » repris de lui).
   Design validé le 2026-10-04 (planche choix-design/) : en-tête de la proposition 3 SANS
   l'avatar IA, corps de la proposition 4, codes WhatsApp (heure + coches DANS la bulle,
   pointe sur la 1re bulle d'une série, horloge pendant l'envoi).
   ⚠️ Aucune mention d'IA nulle part — décision explicite.
   Tout est préfixé par #mfrChat : le widget se pose sur n'importe quelle page.
   ═══════════════════════════════════════════════════════════ */

#mfrChat {
  --c-ink: #000025;
  --c-abyss: #00000f;
  --c-panel: #03062a;
  --c-glass: rgba(255, 255, 255, .04);
  --c-line: rgba(255, 255, 255, .09);
  --c-paper: #eef1f8;
  --c-muted: #a3aacb;
  --c-muted-2: #6f789f;
  --c-cyan: #1fb0f5;
  --c-blue: #2f6bff;
  --c-violet: #8f7bff;
  --c-green: #3ddc84;
  --c-red: #ff4757;
  --c-tick: #4fc3ff;
  --c-neon: linear-gradient(160deg, #5fd2ff 0%, #2f6bff 45%, #8f7bff 100%);
  font-family: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--c-paper);
  -webkit-font-smoothing: antialiased;
}
#mfrChat *, #mfrChat *::before, #mfrChat *::after { box-sizing: border-box; margin: 0; padding: 0; }
#mfrChat button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#mfrChat svg { display: block; }

/* ─── Bulle fermée : « Une question ? » (version A, validée le 2026-10-05) ───
   Idée de David (photo + point vert + « Une question ? »), aux codes du chat : verre marine,
   contour néon en dégradé, halo, onde lumineuse toutes les 3 s, point vert qui respire. */
#mfrChat .mc-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 2147483000; padding: 0; transition: transform .25s, opacity .25s; }
/* Entrée de la bulle au chargement (2026-10-05) : elle n'apparaît qu'une fois la photo chargée,
   en un seul mouvement doux. Avant, elle surgissait d'un coup puis la photo arrivait dans un rond
   vide — l'effet « saccadé ». `is-pret` est posé par widget.js. */
#mfrChat:not(.is-pret) .mc-launcher { opacity: 0; transform: translateY(14px) scale(.94); pointer-events: none; }
#mfrChat.is-pret .mc-launcher { transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .45s ease; }
@media (prefers-reduced-motion: reduce) { #mfrChat:not(.is-pret) .mc-launcher { transform: none; } }
#mfrChat .mc-pil {
  position: relative; display: flex; align-items: center; gap: 11px; height: 58px; padding: 6px 22px 6px 6px; border-radius: 30px;
  background: radial-gradient(120% 140% at 15% 0%, rgba(47, 107, 255, .32), transparent 60%), rgba(5, 10, 51, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 0 22px rgba(47, 107, 255, .45), 0 14px 34px rgba(0, 0, 0, .55), inset 0 0 16px rgba(47, 107, 255, .18);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s;
}
#mfrChat .mc-pil::before {   /* contour néon (même technique que le panneau) */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: var(--c-neon); pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
#mfrChat .mc-pil::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; animation: mcAnneau 2.8s ease-out 1s infinite; pointer-events: none; }
@keyframes mcAnneau { 0% { box-shadow: 0 0 0 0 rgba(95, 210, 255, .55); } 75%, 100% { box-shadow: 0 0 0 16px rgba(95, 210, 255, 0); } }
#mfrChat .mc-launcher:hover .mc-pil { transform: translateY(-2px); box-shadow: 0 0 30px rgba(47, 107, 255, .65), 0 16px 38px rgba(0, 0, 0, .55), inset 0 0 16px rgba(47, 107, 255, .25); }
#mfrChat .mc-lav { width: 46px; height: 46px; }
/* Bulle FERMÉE : la photo sans son cercle néon — le contour de la pilule suffit (retour du
   2026-10-05). Fenêtre ouverte, la pilule s'efface et le cercle de la photo revient : un seul rond. */
#mfrChat:not(.is-open) .mc-lav { padding: 0; background: none; box-shadow: none; }
#mfrChat:not(.is-open) .mc-lav img { border: 0; }
#mfrChat .mc-lbl { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; color: #fff; }
#mfrChat .mc-badge {
  position: absolute; top: -6px; left: 36px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px;
  background: var(--c-red); color: #fff; font-size: 11.5px; font-weight: 700;
  display: none; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--c-abyss), 0 0 12px rgba(255, 71, 87, .7);
}
#mfrChat .mc-badge.on { display: flex; }
/* Fenêtre ouverte : la bulle RESTE, réduite à la photo ronde (comme le chat de David), et
   un clic dessus referme la fenêtre (demande du 2026-10-05). Le panneau remonte au-dessus. */
#mfrChat .mc-lbl { transition: opacity .2s, max-width .3s; max-width: 160px; overflow: hidden; }
#mfrChat .mc-pil { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s, padding .3s; }
/* Un seul rond : le contour, le fond et le halo de la pilule disparaissent, seul reste le
   cercle néon de la photo (retour du 2026-10-05 : « pas de double rond »). */
#mfrChat.is-open .mc-pil { padding: 0; gap: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#mfrChat.is-open .mc-pil::before { display: none; }
#mfrChat.is-open .mc-launcher:hover .mc-pil { box-shadow: none; }
#mfrChat.is-open .mc-lbl { opacity: 0; max-width: 0; }
#mfrChat.is-open .mc-pil::after { animation: none; }

/* Point vert « en ligne », posé sur la photo. Il ne respire que sur la bulle fermée ;
   dans l'en-tête il reste fixe (demande du 2026-10-05). */
#mfrChat .mc-point {
  position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--c-green); border: 2.5px solid #050a33; box-shadow: 0 0 8px rgba(61, 220, 132, .8);
}
#mfrChat .mc-point-pulse { animation: mcPoint 1.6s ease-in-out infinite; }
@keyframes mcPoint { 0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .6), 0 0 8px var(--c-green); } 50% { box-shadow: 0 0 0 5px rgba(61, 220, 132, 0), 0 0 3px var(--c-green); opacity: .55; } }
#mfrChat.hors-ligne .mc-point { background: var(--c-muted-2); box-shadow: none; animation: none; }

/* ─── Panneau ─── */
#mfrChat .mc-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 2147483001;
  width: 384px; height: min(680px, calc(100vh - 124px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(90% 40% at 100% 0%, rgba(47, 107, 255, .22), transparent 70%),
    radial-gradient(70% 35% at 0% 100%, rgba(143, 123, 255, .14), transparent 70%),
    var(--c-panel);
  box-shadow: 0 0 0 1px rgba(95, 210, 255, .18), 0 0 40px rgba(47, 107, 255, .28), 0 30px 80px rgba(0, 0, 0, .7);
  transform: translateY(16px) scale(.96); transform-origin: bottom right; opacity: 0; pointer-events: none;
  transition: transform .35s cubic-bezier(.2, .7, .1, 1), opacity .25s;
}
#mfrChat .mc-panel::before {   /* contour néon en dégradé */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 3;
  background: var(--c-neon); opacity: .85;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
#mfrChat.is-open .mc-panel { transform: none; opacity: 1; pointer-events: auto; }

/* ─── En-tête : codes de David (validé le 2026-10-05) ───
   Photo dans le cercle néon de notre design, « Gaspar · MyFitRace », « En ligne » en
   dessous, point vert FIXE sur la photo, croix de fermeture. Un seul coach pour l'instant. */
#mfrChat .mc-head {
  position: relative; flex-shrink: 0; display: flex; align-items: center; gap: 13px; padding: 16px 16px 14px 18px;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.2px); background-size: 14px 14px;
  border-bottom: 1px solid var(--c-line);
}
#mfrChat .mc-head-av { width: 48px; height: 48px; }
#mfrChat .mc-head-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
#mfrChat .mc-head-nom { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mfrChat .mc-status { margin-top: 2px; font-size: 13px; color: var(--c-muted); }
/* Boutons de l'en-tête (son · réduire · fermer), regroupés dans un cadre de verre comme
   avant la fusion — remis le 2026-10-05. */
#mfrChat .mc-head-actions { display: flex; gap: 2px; flex-shrink: 0; border: 1px solid var(--c-line); border-radius: 12px; background: rgba(255, 255, 255, .03); padding: 2px; }
#mfrChat .mc-head-actions button { width: 34px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--c-paper); transition: background .2s; }
#mfrChat .mc-head-actions button:hover { background: rgba(255, 255, 255, .08); }
#mfrChat .mc-head-actions svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
#mfrChat .mc-head-actions .mc-son svg { width: 18px; height: 18px; }
#mfrChat .mc-head-actions .mc-son.off { color: var(--c-muted-2); }

/* Avatar rond à contour néon (en-tête, bulle fermée, réponses) */
#mfrChat .mc-av {
  position: relative; display: block; flex-shrink: 0; border-radius: 50%; padding: 2px;
  background: var(--c-neon); box-shadow: 0 0 14px rgba(47, 107, 255, .55);
}
#mfrChat .mc-av img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid var(--c-panel); background: #0c1550;
}

/* ─── Fil (proposition 4, façon WhatsApp) ─── */
#mfrChat .mc-thread {
  flex: 1; overflow-y: auto; padding: 14px 16px 8px; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent;
}
#mfrChat .mc-thread::-webkit-scrollbar { width: 5px; }
#mfrChat .mc-thread::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

#mfrChat .mc-day { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; font-size: 12.5px; color: var(--c-muted-2); }
#mfrChat .mc-day::before, #mfrChat .mc-day::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }

#mfrChat .mc-row { display: flex; align-items: flex-end; gap: 9px; margin-top: 3px; animation: mcIn .28s cubic-bezier(.2, .7, .1, 1); }
#mfrChat .mc-row.first { margin-top: 12px; }
#mfrChat .mc-row.me { justify-content: flex-end; }
@keyframes mcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#mfrChat .mc-row .mc-av { width: 36px; height: 36px; align-self: flex-start; }
#mfrChat .mc-row .mc-av span { font-size: 13px; }
#mfrChat .mc-row .mc-av-gap { width: 36px; flex-shrink: 0; }

#mfrChat .mc-col { display: flex; flex-direction: column; max-width: 78%; min-width: 0; }
#mfrChat .mc-name { font-size: 12px; font-weight: 600; color: var(--c-cyan); margin: 0 0 4px 12px; }

#mfrChat .mc-bubble {
  position: relative; padding: 9px 12px 8px; border-radius: 16px; font-size: 15px; line-height: 1.42;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
/* Les messages du COACH ressortent (bleu néon), ceux du visiteur restent en verre sombre :
   inversé le 2026-10-05, « comme le chat de gauche, mais avec notre design ».
   Puis (2026-10-05) : bleu PLUS CLAIR, plein, SANS bordure ni halo néon — demande explicite. */
#mfrChat .mc-row.them .mc-bubble {
  background: #4a90e2; border: 1px solid transparent; color: #fff;
  box-shadow: none;
}
#mfrChat .mc-row.me .mc-bubble {
  background: linear-gradient(180deg, #151a4d, #0e1240); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
#mfrChat .mc-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
#mfrChat .mc-row.them .mc-meta { color: rgba(255, 255, 255, .7); }
/* Pointe WhatsApp, seulement sur la 1re bulle d'une série */
#mfrChat .mc-row.them.first .mc-bubble { border-top-left-radius: 5px; }
#mfrChat .mc-row.me.first .mc-bubble { border-top-right-radius: 5px; }

/* Heure + coches DANS la bulle, en bas à droite (place réservée par un espaceur flottant) */
#mfrChat .mc-meta {
  float: right; display: inline-flex; align-items: center; gap: 4px;
  margin: 6px 0 0 12px; font-size: 11px; line-height: 1; color: rgba(238, 241, 248, .55);
  white-space: nowrap; position: relative; top: 2px;
}
/* La bulle CONTIENT l'heure flottante : sans ça, quand l'heure passe à la ligne sous le texte,
   elle collait au bord bas de la bulle (retour du 2026-10-05, « il manque un padding en bas »). */
#mfrChat .mc-bubble { display: flow-root; }
#mfrChat .mc-meta svg { width: 16px; height: 11px; }
#mfrChat .mc-tick { color: rgba(238, 241, 248, .55); }
#mfrChat .mc-tick { display: inline-flex; }
#mfrChat .mc-tick.read { color: var(--c-tick); filter: drop-shadow(0 0 4px rgba(79, 195, 255, .6)); }
#mfrChat .mc-vu { display: none; color: var(--c-tick); font-weight: 600; margin-left: 1px; }
#mfrChat .mc-row.vu .mc-vu { display: inline; animation: mcFade .3s ease; }
@keyframes mcFade { from { opacity: 0; } to { opacity: 1; } }
#mfrChat .mc-row.failed .mc-bubble { border-color: var(--c-red); box-shadow: 0 0 12px rgba(255, 71, 87, .35); }
#mfrChat .mc-retry { align-self: flex-end; margin-top: 4px; font-size: 12px; color: #ff8a95; text-decoration: underline; }

/* « en train d'écrire » — style de la carte coach du hero (points lavande + italique) */
#mfrChat .mc-typing { display: none; align-items: center; gap: 9px; margin-top: 12px; font-size: 13.5px; font-style: italic; color: #a9b0ff; }
#mfrChat .mc-typing.on { display: flex; animation: mcIn .28s cubic-bezier(.2, .7, .1, 1); }
#mfrChat .mc-typing .mc-av { width: 36px; height: 36px; margin-right: 2px; }
#mfrChat .mc-dots { display: flex; gap: 4px; }
#mfrChat .mc-dots i { width: 7px; height: 7px; border-radius: 50%; background: #8f9bff; box-shadow: 0 0 6px rgba(143, 155, 255, .7); animation: mcDot 1.2s infinite ease-in-out; }
#mfrChat .mc-dots i:nth-child(2) { animation-delay: .15s; }
#mfrChat .mc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes mcDot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ─── Saisie ─── */
#mfrChat .mc-compose { flex-shrink: 0; padding: 10px 16px 12px; position: relative; }
#mfrChat .mc-compose-row { display: flex; gap: 10px; align-items: flex-end; }
#mfrChat .mc-field {
  flex: 1; display: flex; align-items: flex-end; gap: 6px; min-height: 54px; padding: 6px 8px 6px 16px;
  border-radius: 16px; background: rgba(10, 16, 60, .7);
  border: 1px solid rgba(79, 160, 255, .45);
  box-shadow: 0 0 14px rgba(47, 107, 255, .2), inset 0 0 10px rgba(47, 107, 255, .08);
  transition: border-color .2s, box-shadow .2s;
}
#mfrChat .mc-field:focus-within { border-color: rgba(95, 210, 255, .85); box-shadow: 0 0 20px rgba(47, 107, 255, .4), inset 0 0 10px rgba(47, 107, 255, .1); }
#mfrChat .mc-field.err { border-color: var(--c-red); box-shadow: 0 0 14px rgba(255, 71, 87, .35); }
#mfrChat .mc-input {
  flex: 1; min-width: 0; align-self: center; background: none; border: 0; outline: none; resize: none;
  color: var(--c-paper); font: inherit; font-size: 15.5px; line-height: 1.4; max-height: 110px; padding: 9px 0;
}
#mfrChat .mc-input::placeholder { color: var(--c-muted-2); }
#mfrChat .mc-emoji-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--c-muted); flex-shrink: 0; transition: color .2s, background .2s; }
#mfrChat .mc-emoji-btn:hover, #mfrChat .mc-emoji-btn.on { color: #fff; background: rgba(255, 255, 255, .07); }
#mfrChat .mc-emoji-btn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; }
#mfrChat .mc-send {
  width: 56px; height: 54px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3c8bff 0%, #2f6bff 45%, #6b5cff 100%);
  box-shadow: 0 0 0 1px rgba(150, 200, 255, .45), 0 0 22px rgba(47, 107, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
#mfrChat .mc-send:hover { transform: scale(1.05); }
#mfrChat .mc-send:active { transform: scale(.95); }
#mfrChat .mc-send.is-off { opacity: .45; }
#mfrChat .mc-send svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }

/* ─── Vocal : barre d'enregistrement ─── */
#mfrChat .mc-rec {
  flex: 1; display: none; align-items: center; gap: 10px; min-height: 54px; padding: 6px 14px 6px 6px;
  border-radius: 16px; background: rgba(10, 16, 60, .7); border: 1px solid rgba(255, 71, 87, .55);
  box-shadow: 0 0 16px rgba(255, 71, 87, .22), inset 0 0 10px rgba(255, 71, 87, .06);
}
#mfrChat .mc-compose.rec .mc-rec { display: flex; }
#mfrChat .mc-compose.rec .mc-field { display: none; }
#mfrChat .mc-rec-del { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--c-muted); flex-shrink: 0; }
#mfrChat .mc-rec-del:hover { color: #ff8a95; background: rgba(255, 71, 87, .1); }
#mfrChat .mc-rec-del svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#mfrChat .mc-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-red); box-shadow: 0 0 10px var(--c-red); animation: mcRec 1s ease-in-out infinite; flex-shrink: 0; }
@keyframes mcRec { 50% { opacity: .25; } }
#mfrChat .mc-rec-time { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--c-paper); min-width: 36px; }
#mfrChat .mc-rec-wave { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
#mfrChat .mc-rec-wave i { flex: 1; min-width: 2px; height: 8%; border-radius: 2px; background: linear-gradient(180deg, #ff8a95, var(--c-red)); transition: height .07s linear; }

/* Bouton micro (champ vide) */
#mfrChat .mc-send.mic svg { stroke-width: 1.8; }

/* ─── Vocal : lecteur dans la bulle ─── */
#mfrChat .mc-bubble.mc-audio { width: 252px; max-width: 100%; padding-top: 8px; }
#mfrChat .mc-player { display: flex; align-items: center; gap: 10px; }
#mfrChat .mc-play {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #3c8bff, #6b5cff); box-shadow: 0 0 12px rgba(47, 107, 255, .5);
}
#mfrChat .mc-row.them .mc-play { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
#mfrChat .mc-play svg { width: 18px; height: 18px; }
#mfrChat .mc-play.charge { animation: mcRec .8s ease-in-out infinite; }
#mfrChat .mc-wave { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 1.5px; cursor: pointer; overflow: hidden; }
#mfrChat .mc-wave i { flex: 1; min-width: 1px; min-height: 3px; border-radius: 2px; background: rgba(238, 241, 248, .32); transition: background .12s; }
#mfrChat .mc-wave i.joue { background: var(--c-cyan); box-shadow: 0 0 4px rgba(31, 176, 245, .6); }
#mfrChat .mc-row.them .mc-wave i { background: rgba(255, 255, 255, .4); }
#mfrChat .mc-row.them .mc-wave i.joue { background: #fff; box-shadow: 0 0 4px rgba(255, 255, 255, .7); }
#mfrChat .mc-dur { font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(238, 241, 248, .7); min-width: 30px; text-align: right; }
#mfrChat .mc-audio .mc-meta { margin-top: 2px; }

#mfrChat .mc-error { display: none; margin: 8px 4px 0; font-size: 12.5px; color: #ff8a95; }
#mfrChat .mc-error.on { display: block; }

/* Sélecteur d'emojis maison (aucun composant natif) */
#mfrChat .mc-emojis {
  position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); display: none;
  grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 10px;
  border-radius: 16px; background: #0a0f45; border: 1px solid rgba(79, 160, 255, .35);
  box-shadow: 0 0 24px rgba(47, 107, 255, .3), 0 16px 40px rgba(0, 0, 0, .55);
}
#mfrChat .mc-emojis.on { display: grid; }
#mfrChat .mc-emojis button { height: 36px; border-radius: 9px; font-size: 21px; line-height: 1; }
#mfrChat .mc-emojis button:hover { background: rgba(255, 255, 255, .08); }

/* ─── Mobile : plein écran, comme une app de messagerie ─── */
@media (max-width: 520px) {
  #mfrChat .mc-launcher { right: 14px; bottom: 14px; }
  #mfrChat .mc-pil { height: 52px; padding-right: 16px; }
  #mfrChat .mc-lav { width: 40px; height: 40px; }
  #mfrChat .mc-lbl { font-size: 14.5px; }
  #mfrChat .mc-badge { left: 30px; }
  #mfrChat .mc-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  #mfrChat.is-open .mc-launcher { opacity: 0; pointer-events: none; }   /* plein écran : la croix de l'en-tête ferme */
  #mfrChat .mc-panel::before { display: none; }
  #mfrChat .mc-head { padding: max(14px, env(safe-area-inset-top)) 14px 12px 16px; }
  #mfrChat .mc-compose { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  #mfrChat .mc-input { font-size: 16px; }   /* < 16 px : iOS zoome sur le champ */
}

/* Bulle FERMÉE en noir — réglage « Bulle noire » de l'admin (Tunnel › Chat), éteint par défaut
   (2026-10-05). Fond noir mat, contour fin discret, sans halo bleu. Fenêtre ouverte : rien ne change. */
#mfrChat.bulle-noire:not(.is-open) .mc-pil { background: #05060d; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 12px 30px rgba(0, 0, 0, .55); }
#mfrChat.bulle-noire:not(.is-open) .mc-pil::before { background: rgba(120, 150, 255, .28); padding: 1px; }
#mfrChat.bulle-noire:not(.is-open) .mc-pil::after { animation: none; }
#mfrChat.bulle-noire:not(.is-open) .mc-launcher:hover .mc-pil { box-shadow: 0 16px 36px rgba(0, 0, 0, .6); }

/* ═══ Version A du test A/B : formulaire d'opt-in à l'ouverture (2026-10-06) ═══ */
#mfrChat.is-optin .mc-compose { display: none; }
#mfrChat .mc-optin { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; border-top: 1px solid var(--c-line); background: var(--c-panel); }
#mfrChat .mc-optin-t { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--c-paper); letter-spacing: -.01em; }
#mfrChat .mc-optin-s { margin: -4px 0 4px; font-size: 13px; line-height: 1.45; color: var(--c-muted); }
#mfrChat .mc-optin-f { display: flex; flex-direction: column; gap: 4px; }
#mfrChat .mc-optin-f input { width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--c-line); background: var(--c-glass); color: var(--c-paper); font: 500 15px 'Inter Tight', system-ui, sans-serif; outline: none; transition: border-color .15s, box-shadow .15s; }
#mfrChat .mc-optin-f input::placeholder { color: var(--c-muted); opacity: .75; }
#mfrChat .mc-optin-f input:focus { border-color: rgba(31, 176, 245, .6); box-shadow: 0 0 0 3px rgba(31, 176, 245, .15); }
#mfrChat .mc-optin-f input.is-err { border-color: rgba(255, 71, 87, .75); }
#mfrChat .mc-optin-e { min-height: 0; margin: 0; font-size: 12px; color: #ff8a95; }
#mfrChat .mc-optin-e:empty { display: none; }
#mfrChat .mc-optin-go { margin-top: 4px; height: 46px; border: 0; border-radius: 12px; background: var(--c-neon); color: #fff; font: 600 15px 'Inter Tight', system-ui, sans-serif; cursor: pointer; box-shadow: 0 8px 22px rgba(47, 107, 255, .35); }
#mfrChat .mc-optin-go:disabled { opacity: .7; cursor: wait; }
#mfrChat .mc-optin-l { margin: 2px 0 0; font-size: 11.5px; color: var(--c-muted); opacity: .8; text-align: center; }

/* ─── Bulle FERMÉE au design Tidio (07/10, réglage « bulleDesign » de l'admin) ───
   Copie mesurée sur le vrai widget Tidio du compte (code.tidio.co/hsah6…) : bouton rond 56 px #0494DB,
   icône bulle blanche 24 px, étiquette blanche « Chat with us 👋 » à 12 px à gauche, à 24 px du bord
   droit et 52 px du bas, Inter 16 px. Fenêtre ouverte : notre chat, inchangé. */
@font-face { font-family: 'MfrTidioInter'; src: url('fonts/inter-tidio.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
#mfrChat .mc-tidio { display: none; }
/* Notre pilule est neutralisée SANS display: none, pour garder sa pastille de messages non lus. */
#mfrChat.bulle-tidio:not(.is-open) .mc-pil { position: absolute; top: 0; right: 0; width: 0; height: 0; padding: 0; gap: 0; background: none; box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; z-index: 2; }
#mfrChat.bulle-tidio:not(.is-open) .mc-pil::before, #mfrChat.bulle-tidio:not(.is-open) .mc-pil::after { content: none; display: none; }
#mfrChat.bulle-tidio:not(.is-open) .mc-pil > :not(.mc-badge) { display: none; }
#mfrChat.bulle-tidio:not(.is-open) .mc-launcher { right: 24px; bottom: 52px; background: none; border: 0; }
#mfrChat.bulle-tidio:not(.is-open) .mc-tidio { display: flex; align-items: center; gap: 12px; position: relative; }
#mfrChat .mc-tidio-lbl {
  display: inline-block; height: 42px; box-sizing: border-box; padding: 12px 16px; border-radius: 12px;
  background: #fff; color: #080f1a; font: 400 16px/20px MfrTidioInter, Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(8, 15, 26, .08), 0 2px 2px rgba(8, 15, 26, .12);
}
#mfrChat .mc-tidio-emo { display: inline; width: 20px; height: 20px; margin: 0 2px -5px; vertical-align: baseline; }   /* Twemoji, comme Tidio */
#mfrChat .mc-tidio-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 28px; flex: none;
  background: #0494db; box-shadow: 0 2px 8px rgba(8, 15, 26, .08), 0 2px 2px rgba(8, 15, 26, .12); transition: transform .2s;
}
#mfrChat .mc-tidio-btn svg { display: block; }
#mfrChat.bulle-tidio:not(.is-open) .mc-launcher:hover .mc-tidio-btn { transform: scale(1.06); }
#mfrChat.bulle-tidio:not(.is-open) .mc-badge { position: absolute; top: -4px; right: -4px; left: auto; bottom: auto; }
/* Mobile : mesuré sur le vrai Tidio avec un profil iPhone (07/10) — bouton seul, 14 px du bord et du bas. */
@media (max-width: 520px) { #mfrChat.bulle-tidio:not(.is-open) .mc-launcher { right: 14px; bottom: 14px; } }
/* 07/10 : étiquette « Chat with us 👋 » RETIRÉE (refusée par Gaspar) — seul le bouton rond reste. */
#mfrChat.bulle-tidio:not(.is-open) .mc-tidio-lbl { display: none; }
