/* Le tchat d'aide des pages publiques (aide-tchat.js) : un bouton en bas à droite,
   une fenêtre non bloquante au-dessus, plein écran sur téléphone. Couleurs du site. */
/* L'encre sur l'accent : en thème sombre l'accent est clair, et le blanc n'y lisait qu'à 2,1:1
   (bouton « Aide » de /aide, 17/10). Une encre sombre, comme dans la fenêtre des liens. */
:root { --aide-encre: var(--button-ink, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --aide-encre: #101b2b; } }
:root[data-theme="dark"] { --aide-encre: #101b2b; }
.aide-bouton {
  position: fixed; z-index: 60;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: var(--accent, #2f55d4); color: var(--aide-encre);
  font: inherit; font-weight: 600;
  box-shadow: var(--shadow, 0 6px 20px rgba(15, 23, 42, .18));
  cursor: pointer;
}
.aide-bouton:focus-visible, .aide-fenetre button:focus-visible, .aide-fenetre a:focus-visible {
  outline: 3px solid var(--accent, #2f55d4); outline-offset: 2px;
}
.aide-ouverte .aide-bouton { display: none; }

.aide-fenetre {
  position: fixed; z-index: 61; inset: auto;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 32px));
  margin: 0; padding: 0;
  border: 1px solid var(--line, #dde1e8); border-radius: 14px;
  background: var(--panel, #fff); color: var(--ink, #1b2230);
  box-shadow: var(--shadow, 0 12px 40px rgba(15, 23, 42, .22));
  flex-direction: column; overflow: hidden;
}
.aide-fenetre[open] { display: flex; }
.aide-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 0 16px; }
.aide-tete h2 { margin: 0; font-size: 1.05rem; }
.aide-fermer {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted, #5b6578); cursor: pointer;
}
.aide-fermer:hover { background: var(--accent-soft, rgba(47, 85, 212, .1)); color: var(--ink, #1b2230); }
.aide-mention { margin: 2px 16px 8px; color: var(--muted, #5b6578); font-size: .8rem; }
.aide-fil {
  list-style: none; margin: 0; padding: 8px 16px; flex: 1 1 auto; min-height: 120px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; border-block: 1px solid var(--line, #dde1e8);
}
.aide-fil li { max-width: 88%; padding: 8px 12px; border-radius: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.aide-assistant, .aide-attente { align-self: flex-start; background: var(--accent-soft, rgba(47, 85, 212, .1)); }
.aide-moi { align-self: flex-end; background: var(--bg, #f5f6f8); border: 1px solid var(--line, #dde1e8); }
.aide-erreur { align-self: stretch; max-width: none; color: var(--err, #b42318); background: transparent; padding-inline: 0; }
.aide-attente { letter-spacing: .2em; }
.aide-fil a { color: var(--accent, #2f55d4); }
.aide-saisie { display: grid; gap: 6px; padding: 10px 16px 14px; }
.aide-saisie label { font-size: .85rem; font-weight: 600; }
.aide-saisie textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px; max-height: 140px;
  padding: 8px 10px; border: 1px solid var(--line, #dde1e8); border-radius: 10px;
  background: var(--bg, #f5f6f8); color: var(--ink, #1b2230); font: inherit;
}
.aide-conseil { margin: 0; color: var(--muted, #5b6578); font-size: .78rem; }
.aide-actions { display: flex; justify-content: flex-end; gap: 8px; }
.aide-actions button {
  min-height: 40px; padding: 0 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--accent, #2f55d4);
}
.aide-envoyer { background: var(--accent, #2f55d4); color: var(--aide-encre); }
.aide-envoyer:disabled { opacity: .55; cursor: default; }
.aide-nouvelle { background: transparent; color: var(--accent, #2f55d4); }

@media (max-width: 600px) {
  .aide-fenetre {
    inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  .aide-actions button { min-height: 44px; }
}
@media print { .aide-bouton, .aide-fenetre { display: none !important; } }

/* Un bouton cité par l'assistant (tâche 50) : l'icône de l'interface puis son libellé exact. */
/* En ligne, pas en bloc : un long libellé passe à la ligne dans une bulle étroite. */
.aide-bouton-cite .icone { width: 1.1em; height: 1.1em; margin-inline-end: .3em; vertical-align: -.2em; fill: none; stroke: currentColor; }
.aide-bouton-cite strong { font-weight: 650; }
.aide-bouton-cite.danger { color: var(--err, #b42318); }

/* La vidéo d'un geste cité (point 187) : un bouton sous la réponse, puis la vidéo dans la bulle. */
.aide-video { white-space: normal; margin-top: 8px; display: grid; gap: 8px; }
.aide-video-voir {
  justify-self: start; display: inline-flex; align-items: center; gap: .4em; min-height: 32px; padding: 4px 10px;
  border: 0; border-radius: 8px; background: var(--panel, #fff); color: var(--accent, #2f55d4);
  font: inherit; font-size: .9rem; font-weight: 600; text-align: start; cursor: pointer;
}
.aide-video-voir svg { width: .85em; height: .85em; flex: none; fill: currentColor; }
.aide-video-voir:focus-visible { outline: 2px solid var(--accent, #2f55d4); outline-offset: 2px; }
.aide-video video { display: block; width: 100%; max-width: 100%; aspect-ratio: 1280 / 760; border-radius: 8px; background: #0b1220; }
@media (max-width: 600px) { .aide-video-voir { min-height: 44px; } }

/* Ce qui suit une réponse (tâche 157) : l'avis, puis la transmission au support sur un clic. */
.aide-suite { white-space: normal; margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; }
.aide-suite-bouton {
  min-height: 32px; padding: 4px 10px; border: 1px solid var(--line, #dde1e8); border-radius: 8px;
  background: var(--panel, #fff); color: var(--accent, #2f55d4); font: inherit; font-weight: 600; cursor: pointer;
}
.aide-suite-bouton:focus-visible { outline: 2px solid var(--accent, #2f55d4); outline-offset: 2px; }
.aide-suite-bouton:disabled { opacity: .55; cursor: default; }
.aide-suite-principal { background: var(--accent, #2f55d4); border-color: var(--accent, #2f55d4); color: var(--aide-encre); }
.aide-suite-fait { margin: 0; flex-basis: 100%; }
.aide-encadre { flex-basis: 100%; display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--line, #dde1e8); border-radius: 10px; background: var(--panel, #fff); }
.aide-encadre p { margin: 0; }
.aide-encadre label { display: grid; gap: 4px; font-weight: 600; }
.aide-encadre input {
  min-height: 36px; padding: 4px 8px; border: 1px solid var(--line, #dde1e8); border-radius: 8px;
  background: var(--bg, #f5f6f8); color: var(--ink, #1b2230); font: inherit; font-weight: 400;
}
.aide-encadre-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.aide-encadre-etat:empty { display: none; }
.aide-encadre-etat { color: var(--err, #b42318); }
@media (max-width: 600px) { .aide-suite-bouton, .aide-encadre input { min-height: 44px; } }
