/* Bulle de l'assistant et page « Questions fréquentes » (facturation/assistant, docs/modules/assistant.md).
   Charte « Vert confiance » : vert #15803d (texte blanc 5,0:1), encre #111827 / #4b5563, traits #e5e7eb, fond #f6f8f7,
   police Inter, rayons 12 px (boutons 10 px). Les couleurs de la marque du site (--brand-700…) priment si la page
   les définit. Aucune règle hors de .asst / .asst-page : la bulle ne change rien à la page qui l'accueille. */
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url("../polices/inter/inter-latin-wght-normal.260c81a4759b.woff2") format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url("../polices/inter/inter-latin-ext-wght-normal.1ad231aac0a8.woff2") format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}

.asst, .asst-page {
  --asst-vert: var(--brand-700, #15803d);
  --asst-vert-fonce: var(--brand-800, #166534);
  --asst-vert-clair: var(--brand-50, #f0fdf4);
  --asst-encre: var(--ink, #111827);
  --asst-encre-2: var(--ink-2, #4b5563);
  --asst-trait: #e5e7eb;
  --asst-fond: #f6f8f7;
  --asst-rouge: #b91c1c;
  --asst-police: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
.asst { --asst-bas: 16px; --asst-droite: 16px; font-family: var(--asst-police); color: var(--asst-encre);
  font-size: 15px; line-height: 1.5; }
.asst *, .asst *::before, .asst *::after { box-sizing: border-box; }
.asst [hidden] { display: none !important; }

/* ── bouton rond ── */
.asst-bouton, .asst-sans-js { position: fixed; right: var(--asst-droite); bottom: calc(var(--asst-bas) + env(safe-area-inset-bottom, 0px));
  z-index: 1000; }
.asst-bouton { width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--asst-vert); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(17, 24, 39, .22); transition: transform .15s ease, background-color .15s ease; }
.asst-bouton:hover { background: var(--asst-vert-fonce); transform: translateY(-1px); }
.asst-bouton:focus-visible, .asst button:focus-visible, .asst a:focus-visible, .asst-champ:focus-visible {
  outline: 3px solid var(--asst-vert); outline-offset: 2px; }
.asst-bouton:focus-visible { outline-color: var(--asst-encre); }
.asst-ouverte .asst-bouton { display: none; }
.asst-sans-js { padding: 10px 16px; border-radius: 10px; background: var(--asst-vert); color: #fff; font-weight: 600;
  text-decoration: none; box-shadow: 0 6px 20px rgba(17, 24, 39, .22); }

/* ── fenêtre ── */
.asst-fenetre { position: fixed; right: var(--asst-droite); bottom: calc(var(--asst-bas) + env(safe-area-inset-bottom, 0px));
  z-index: 1001; width: 380px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--asst-trait); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(17, 24, 39, .25); overflow: hidden; }
.asst-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 16px;
  background: var(--asst-vert); color: #fff; }
.asst-titre { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; color: #fff; }
.asst-fermer { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.asst-fermer:hover { background: rgba(255, 255, 255, .16); }
.asst-fermer:focus-visible { outline-color: #fff; }

.asst-fil { flex: 1 1 auto; overflow-y: auto; padding: 16px; background: var(--asst-fond); display: flex;
  flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.asst-fil:focus { outline: none; }
.asst-msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; word-wrap: break-word; overflow-wrap: anywhere; }
.asst-msg p { margin: 0; }
.asst-msg p + p, .asst-msg p + ul, .asst-msg ul + p { margin-top: 8px; }
.asst-msg-assistant { align-self: flex-start; background: #fff; border: 1px solid var(--asst-trait); }
.asst-msg-vous { align-self: flex-end; background: var(--asst-vert); color: #fff; }
.asst-msg-titre { font-weight: 700; }
.asst-texte { white-space: pre-line; }
.asst-auteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.asst-attente { color: var(--asst-encre-2); font-style: italic; }
.asst-msg-ia { font-size: 12px; color: var(--asst-encre-2); margin-top: 8px !important; }

.asst-petit { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--asst-encre-2); }
.asst-puces, .asst-liens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.asst-puce { font: inherit; font-size: 14px; text-align: left; line-height: 1.35; padding: 8px 12px; min-height: 40px;
  border-radius: 10px; border: 1px solid var(--asst-vert); background: #fff; color: var(--asst-vert-fonce);
  cursor: pointer; }
.asst-puce:hover { background: var(--asst-vert-clair); }
.asst-puce:disabled { opacity: .6; cursor: default; }
.asst-liens a { display: inline-block; padding: 6px 0; color: var(--asst-vert-fonce); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; }
.asst-liens li + li a { margin-left: 4px; }

/* ── saisie ── */
.asst-saisie { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--asst-trait);
  background: #fff; }
.asst-champ { flex: 1 1 auto; min-height: 44px; max-height: 120px; resize: none; font: inherit; font-size: 16px;
  /* 16 px : pas de zoom automatique de Safari sur iPhone */
  color: var(--asst-encre); padding: 10px 12px; border: 1px solid #9ca3af; border-radius: 10px; background: #fff; }
.asst-champ::placeholder { color: #6b7280; }
.asst-envoyer { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--asst-vert);
  color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.asst-envoyer:hover { background: var(--asst-vert-fonce); }
.asst-envoyer:disabled { opacity: .6; cursor: default; }
.asst-erreur { margin: 0; padding: 8px 12px 0; font-size: 13px; color: var(--asst-rouge); background: #fff; }
.asst-erreur::before { content: '⚠ '; }
.asst-avis { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 12px 2px; font-size: 12px;
  color: var(--asst-encre-2); background: #fff; }
.asst-avis svg { flex: none; margin-top: 1px; }
.asst-source { margin: 0; padding: 0 12px 10px 34px; font-size: 12px; color: var(--asst-encre-2); background: #fff; }
.asst-invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── téléphone : plein écran ── */
@media (max-width: 640px) {
  .asst-fenetre { inset: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 100%; max-height: none;
    border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  @supports (height: 100dvh) { .asst-fenetre { height: 100dvh; } }
  html.asst-page-ouverte, html.asst-page-ouverte body { overflow: hidden; }
  .asst-msg { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .asst-bouton { transition: none; } .asst-bouton:hover { transform: none; } }
@media print { .asst { display: none !important; } }

/* ── page « Questions fréquentes » (sans JavaScript) ── */
.asst-page { margin: 0; font-family: var(--asst-police); color: var(--asst-encre); background: #fff; font-size: 16px;
  line-height: 1.55; }
.asst-faq { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.asst-faq h1 { font-size: 28px; line-height: 1.2; margin: 16px 0 8px; }
.asst-faq h2 { font-size: 18px; margin: 0 0 8px; }
.asst-faq h3 { font-size: 16px; margin: 0 0 6px; }
.asst-faq a { color: var(--asst-vert-fonce); }
.asst-faq-haut { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 14px; }
.asst-faq-recherche { margin: 20px 0; padding: 16px; background: var(--asst-fond); border: 1px solid var(--asst-trait);
  border-radius: 12px; }
.asst-faq-recherche label { display: block; font-weight: 600; margin-bottom: 6px; }
.asst-faq-ligne { display: flex; gap: 8px; }
.asst-faq-ligne input { flex: 1 1 auto; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid #9ca3af;
  border-radius: 10px; }
.asst-faq-bouton { font: inherit; font-weight: 600; padding: 10px 16px; border: 0; border-radius: 10px;
  background: var(--asst-vert); color: #fff; cursor: pointer; }
.asst-faq .asst-avis { background: transparent; padding: 8px 0 0; }
.asst-faq-alerte { padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: var(--asst-rouge); }
.asst-faq-alerte::before { content: '⚠ '; }
.asst-faq-reponse { margin: 0 0 24px; padding: 16px; border: 2px solid var(--asst-vert); border-radius: 12px; }
.asst-faq-texte p { margin: 0 0 8px; }
.asst-faq-fiche { border-bottom: 1px solid var(--asst-trait); }
.asst-faq-fiche summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.asst-faq-fiche[open] summary { color: var(--asst-vert-fonce); }
.asst-faq-fiche > div, .asst-faq-fiche > ul { padding-bottom: 12px; }
.asst-page a:focus-visible, .asst-page button:focus-visible, .asst-page input:focus-visible,
.asst-page summary:focus-visible { outline: 3px solid var(--asst-vert); outline-offset: 2px; }
