/* Chat web des sites (illico-4c, 31/10/2026). Couleurs réglables par le site : --cw-accent, --cw-accent-texte, --cw-fond,
   --cw-carte, --cw-texte, --cw-doux, --cw-moi, --cw-bot. Aucune ressource externe ; propriétés logiques (arabe à gauche). */
.cw {
  --cw-accent: #128c7e; --cw-accent-texte: #fff; --cw-fond: #f4f6f8; --cw-carte: #fff; --cw-texte: #1d2330; --cw-doux: #667085;
  --cw-moi: var(--cw-accent); --cw-moi-texte: #fff; --cw-bot: #fff; --cw-ligne: #e4e7ec;
  position: fixed; z-index: 1000; inset-block-end: 96px; right: 22px; left: auto;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cw-fond); color: var(--cw-texte); border: 1px solid var(--cw-ligne); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .28), 0 4px 12px rgba(16, 24, 40, .12);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cw[hidden] { display: none; }
/* La fenêtre s'ouvre du côté de son bouton (même en arabe, où les boutons des sites restent à droite). */
.cw.cw--gauche { right: auto; left: 22px; }
@media (prefers-color-scheme: dark) {
  .cw { --cw-fond: #12161d; --cw-carte: #1b2029; --cw-texte: #e6e8ee; --cw-doux: #98a2b3; --cw-bot: #232a35; --cw-ligne: #2c3340; }
}
.cw__tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px;
  background: var(--cw-accent); color: var(--cw-accent-texte); }
.cw__qui { display: flex; flex-direction: column; min-width: 0; }
.cw__qui strong { font-size: 16px; }
.cw__qui span { font-size: 12px; opacity: .9; }
.cw__fermer { background: transparent; border: 0; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.cw__fermer:focus-visible, .cw__envoyer:focus-visible, .cw__bouton:focus-visible, .cw__wa:focus-visible { outline: 3px solid var(--cw-accent); outline-offset: 2px; }
.cw__fermer:focus-visible { outline-color: currentColor; }   /* sur l'en-tête de couleur, le liseré d'accent serait invisible */
.cw__liste { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cw__msg { max-width: 84%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cw__msg--bot { align-self: flex-start; background: var(--cw-bot); border: 1px solid var(--cw-ligne); border-start-start-radius: 4px; }
.cw__msg--moi { align-self: flex-end; background: var(--cw-moi); color: var(--cw-moi-texte); border-start-end-radius: 4px; }
.cw__msg a { color: inherit; text-decoration: underline; }
.cw__ecrit { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--cw-bot); border: 1px solid var(--cw-ligne); border-radius: 14px; }
.cw__ecrit i { width: 7px; height: 7px; border-radius: 50%; background: var(--cw-doux); animation: cw-point 1s infinite ease-in-out; }
.cw__ecrit i:nth-child(2) { animation-delay: .15s; } .cw__ecrit i:nth-child(3) { animation-delay: .3s; }
@keyframes cw-point { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.cw__choix { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.cw__choix:empty { display: none; }
.cw__bouton { border: 1px solid var(--cw-accent); color: var(--cw-accent); background: var(--cw-carte); border-radius: 999px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 14px; }
.cw__forme { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-block-start: 1px solid var(--cw-ligne); background: var(--cw-carte); }
.cw__zone { flex: 1; resize: none; border: 1px solid var(--cw-ligne); border-radius: 12px; padding: 9px 11px; font: inherit; color: var(--cw-texte); background: var(--cw-fond); max-height: 120px; }
.cw__envoyer { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--cw-accent); color: var(--cw-accent-texte); font-size: 18px; cursor: pointer; }
.cw[dir="rtl"] .cw__envoyer { transform: scaleX(-1); }
.cw__envoyer:disabled { opacity: .5; cursor: wait; }
.cw__pied { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 10px; background: var(--cw-carte); text-align: center; }
.cw__pied small { color: var(--cw-doux); font-size: 11px; }
.cw__wa { color: var(--cw-accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.cw__wa--msg { align-self: flex-start; border: 1px solid var(--cw-accent); border-radius: 999px; padding: 6px 12px; background: var(--cw-carte); }
@media (max-width: 640px) {
  .cw, .cw.cw--gauche { left: 8px; right: 8px; inset-block-end: 8px; width: auto; height: min(78vh, calc(100vh - 16px)); border-radius: 16px; }
  body.cw-ouvert .cw-lanceur { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .cw__ecrit i { animation: none; } }
