/* Assistant ENI — charte : orange #F05723, noir #070707, gris #7A7A7A, nuit #1C1A30 */
.eni-as, .eni-as * { box-sizing: border-box; }
.eni-as { --o: #F05723; --n: #070707; --g: #7A7A7A; --nuit: #1C1A30; --f: #FDF5F1; font-family: inherit; line-height: 1.4; text-align: left; }

/* Neutralise les styles du thème (Gazolin) sur les boutons et la zone de saisie */
.eni-as button { margin: 0 !important; padding: 0 !important; min-width: 0 !important; min-height: 0 !important; text-transform: none !important; letter-spacing: normal !important; text-indent: 0; font-family: inherit; line-height: 1.2 !important; box-shadow: none; overflow: visible; }
.eni-as button::before, .eni-as button::after { content: none !important; display: none !important; }
.eni-as textarea { margin: 0 !important; height: 44px; width: auto; box-shadow: none; text-transform: none; letter-spacing: normal; }

/* Bouton d'ouverture */
/* Marge intérieure de 16px : sur mobile, le bouton coupe ce qui dépasse (ombre, anneau animé). */
.eni-as .eni-as-lanceur { position: fixed; right: 4px; bottom: 80px; z-index: 99990; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 16px !important; cursor: pointer; -webkit-appearance: none; appearance: none; filter: drop-shadow(0 6px 12px rgba(7,7,7,.30)); }
.eni-as-rond { width: 62px; height: 62px; border-radius: 50%; background: var(--nuit); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px rgba(255,255,255,.9); position: relative; transition: transform .25s ease; }
.eni-as-rond img { width: 30px; height: auto; }
.eni-as-rond::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--o); opacity: .7; animation: eniAsOnde 2.6s ease-out infinite; }
.eni-as-lanceur:hover .eni-as-rond, .eni-as-lanceur:focus-visible .eni-as-rond { transform: scale(1.07); }
.eni-as-lanceur:focus-visible { outline: none; }
.eni-as-lanceur:focus-visible .eni-as-rond { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--o); }
.eni-as-bulle { background: #fff; color: var(--n); font-size: 15px; font-weight: 600; line-height: 1.3; padding: 11px 15px; border-radius: 16px 16px 4px 16px; box-shadow: 0 0 0 1px rgba(7,7,7,.08); max-width: 220px; text-align: left; opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.eni-as-bulle.on { opacity: 1; transform: none; }
.eni-as-point { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--o); border: 2px solid var(--nuit); }
@keyframes eniAsOnde { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }

/* Fenêtre */
.eni-as-fen { position: fixed; right: 20px; bottom: 20px; z-index: 99991; width: 380px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 40px); background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(7,7,7,.28); display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.eni-as.ouvert .eni-as-fen { opacity: 1; transform: none; pointer-events: auto; }
.eni-as.ouvert .eni-as-lanceur { opacity: 0; pointer-events: none; }

.eni-as-tete { background: var(--nuit); color: #fff; padding: 16px 16px 16px 18px; display: flex; align-items: center; gap: 12px; }
.eni-as-av { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.eni-as-av img { width: 22px; height: auto; }
.eni-as-tete b { display: block; font-size: 16px; line-height: 1.2; }
.eni-as-tete small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #c9c7d6; margin-top: 3px; }
.eni-as-tete small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; }
.eni-as-fermer { margin-left: auto !important; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 22px; line-height: 1 !important; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.eni-as-fermer:hover, .eni-as-fermer:focus-visible { background: rgba(255,255,255,.24); outline: none; }

.eni-as-fil { flex: 1; overflow-y: auto; padding: 18px 14px 8px; background: var(--f); display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.eni-as-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; }
.eni-as-msg.bot { background: #fff; color: var(--n); border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: 0 2px 8px rgba(7,7,7,.06); }
.eni-as-msg.moi { background: var(--o); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.eni-as-msg a { color: var(--o); font-weight: 600; text-decoration: underline; word-break: break-all; }
.eni-as-msg.moi a { color: #fff; }
.eni-as-msg.erreur { background: #fff4f2; border: 1px solid #f7c9bd; }
.eni-as-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.eni-as-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--g); opacity: .5; animation: eniAsDot 1.2s infinite ease-in-out; }
.eni-as-dots i:nth-child(2) { animation-delay: .15s; } .eni-as-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes eniAsDot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }

.eni-as-puces { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.eni-as .eni-as-puce { border: 1px solid #eadfd6; background: #fff; color: var(--n); border-radius: 30px; padding: 8px 13px !important; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color .2s, color .2s, background .2s; font-family: inherit; line-height: 1.2; }
.eni-as-puce:hover, .eni-as-puce:focus-visible { border-color: var(--o); color: var(--o); outline: none; }
.eni-as-puce.wa { background: #25D366; border-color: #25D366; color: #fff; }
.eni-as-puce.wa:hover, .eni-as-puce.wa:focus-visible { background: #1eb457; color: #fff; }

.eni-as-saisie { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #f0e6df; background: #fff; }
.eni-as .eni-as-saisie textarea { flex: 1 1 auto; min-width: 0; resize: none; border: 1px solid #eadfd6; border-radius: 22px; padding: 11px 16px !important; font: inherit; font-size: 15px; line-height: 20px !important; height: 44px; max-height: 110px; min-height: 44px !important; color: var(--n); background: #fff; overflow-y: auto; }
.eni-as .eni-as-saisie textarea::placeholder { color: #9a9a9a; opacity: 1; }
.eni-as .eni-as-saisie textarea:focus { outline: none; border-color: var(--o); box-shadow: 0 0 0 3px rgba(240,87,35,.15); }
.eni-as .eni-as-saisie textarea:disabled { background: #f6f3f1; color: var(--g); }
.eni-as-envoyer { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: 0; background: var(--o); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.eni-as-envoyer:hover:not(:disabled), .eni-as-envoyer:focus-visible { background: #d9471a; outline: none; }
.eni-as-envoyer:disabled { background: #f5b9a3; cursor: default; }
.eni-as-envoyer svg { display: block; width: 20px; height: 20px; min-width: 20px; fill: #fff; margin-left: 2px; }
.eni-as-pied { font-size: 11.5px; color: var(--g); text-align: center; padding: 0 12px 10px; background: #fff; line-height: 1.4; }
.eni-as-pied a { color: var(--g); }
.eni-as-test { background: #fff4d6; color: #7a5a00; font-size: 12px; text-align: center; padding: 6px; }
.eni-as-piege { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 560px) {
  .eni-as-fen { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; height: 100dvh; max-height: 100%; border-radius: 0; }
  .eni-as-tete { padding-top: max(16px, env(safe-area-inset-top)); }
  .eni-as-pied { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .eni-as .eni-as-saisie textarea { font-size: 16px; } /* évite le zoom automatique d'iOS */
  .eni-as .eni-as-lanceur { right: -2px; bottom: 72px; }
  .eni-as-bulle { max-width: 170px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .eni-as-rond::after, .eni-as-dots i { animation: none; }
  .eni-as-fen, .eni-as-bulle, .eni-as-rond { transition: none; }
}
