/* Way4Kids — assistant (bulle d'aide). Autonome : utilisé sur le site et dans les espaces Filament. */
.w4k-chat { --c-green: #5b9a3f; --c-green-d: #47802f; --c-ink: #2a2520; --c-muted: #74706b; --c-sky: #e6f4fc;
  position: fixed; right: 18px; bottom: 18px; z-index: 70; font-family: inherit; color: var(--c-ink); }
.w4k-chat-bubble { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px;
  background: var(--c-green); color: #fff; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.w4k-chat-bubble:hover { background: var(--c-green-d); }
.w4k-chat-bubble span[aria-hidden] { font-size: 1.25rem; line-height: 1; }
.w4k-chat.is-open .w4k-chat-bubble { display: none; }
.w4k-chat-panel { width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 110px)); display: flex; flex-direction: column;
  background: #fff; border-radius: 20px; box-shadow: 0 18px 50px rgba(0,0,0,.25); overflow: hidden; }
.w4k-chat-panel[hidden] { display: none; }
.w4k-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: linear-gradient(90deg, #a9dcf6, #e6f4fc); }
.w4k-chat-head img { border-radius: 10px; }
.w4k-chat-head div { flex: 1; display: grid; line-height: 1.2; }
.w4k-chat-head small { color: var(--c-muted); font-size: .78rem; }
.w4k-chat-icon { border: 0; background: rgba(255,255,255,.7); width: 32px; height: 32px; border-radius: 10px; font-size: 1.15rem; cursor: pointer; color: var(--c-ink); }
.w4k-chat-icon:hover { background: #fff; }
.w4k-chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fbfaf8; }
.w4k-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: .93rem; line-height: 1.45; overflow-wrap: anywhere; }
.w4k-msg p { margin: 0 0 .5em; } .w4k-msg p:last-child { margin: 0; }
.w4k-msg ul { margin: .3em 0 .5em; padding-left: 1.2em; }
.w4k-msg a { color: #0c6ba8; font-weight: 600; }
.w4k-msg-assistant { align-self: flex-start; background: #fff; border: 1px solid #ece8e2; border-bottom-left-radius: 4px; }
.w4k-msg-user { align-self: flex-end; background: var(--c-green); color: #fff; border-bottom-right-radius: 4px; }
.w4k-msg.is-typing p { letter-spacing: .2em; color: var(--c-muted); animation: w4k-blink 1s infinite; }
@keyframes w4k-blink { 50% { opacity: .35; } }
.w4k-chat-human { padding: 10px 14px; border-top: 1px solid #ece8e2; }
.w4k-chat-human[hidden] { display: none; }
.w4k-chat-check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid #dcd6ce; border-radius: 12px; background: #fff; cursor: pointer; font-weight: 600; font-size: .92rem; }
.w4k-chat-check input { width: 22px; height: 22px; accent-color: var(--c-green); }
.w4k-chat-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #cde8f7; border-top-color: var(--c-green); animation: w4k-spin .8s linear infinite; margin-left: auto; }
.w4k-chat-spin[hidden] { display: none; }
@keyframes w4k-spin { to { transform: rotate(360deg); } }
.w4k-chat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.w4k-chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #ece8e2; background: #fff; }
.w4k-chat-form textarea { flex: 1; resize: none; border: 2px solid #e3ded7; border-radius: 14px; padding: 9px 12px; font: inherit; font-size: .93rem; max-height: 120px; color: var(--c-ink); background: #fff; }
.w4k-chat-form textarea:focus { outline: none; border-color: var(--c-green); }
.w4k-chat-form textarea:disabled { background: #f4f2ef; }
.w4k-chat-form button { border: 0; width: 44px; border-radius: 14px; background: var(--c-green); color: #fff; font-size: 1.1rem; cursor: pointer; }
.w4k-chat-form button:disabled { background: #c9c4bd; cursor: not-allowed; }
.w4k-chat-foot { margin: 0; padding: 0 12px 10px; font-size: .72rem; color: var(--c-muted); background: #fff; text-align: center; }
@media (max-width: 520px) {
  .w4k-chat { right: 12px; bottom: 12px; }
  .w4k-chat.is-open { left: 12px; }
  .w4k-chat-panel { width: 100%; height: calc(100vh - 90px); }
  .w4k-chat-bubble-text { display: none; }
  .w4k-chat-bubble { padding: 14px; }
}
/* Ne pas cacher la bannière d'installation de l'application */
.install-banner:not([hidden]) ~ .w4k-chat { bottom: 96px; }
/* Le bouton « Une question ? » ne doit jamais masquer un bouton de la page (Suivant, Enregistrer…) :
   on réserve de la place en bas de page, et dans les espaces gérant/admin il devient une pastille ronde. */
.fi-body .fi-main { padding-bottom: 96px; }
.fi-body .w4k-chat-bubble { padding: 14px; }
.fi-body .w4k-chat-bubble-text { display: none; }
.fi-body .w4k-chat-bubble:hover .w4k-chat-bubble-text,
.fi-body .w4k-chat-bubble:focus-visible .w4k-chat-bubble-text { display: inline; }
.site-footer { padding-bottom: 84px; }
