/* ── AI help button + panel (owner pick C, 2026-10-30, js/help-bot.js,
   docs/specs/aide-ia.md). Round button above the tab bar, bottom right;
   panel slides up from the bottom like the other sheets. ── */
.hb-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h, 0px) + 16px);
  z-index: 850;                 /* under modals (1000) and sheets, over the page */
  width: 58px;
  height: 58px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--z-green);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
  cursor: pointer;
}
.hb-fab:focus-visible { outline: 2px solid var(--z-gold); outline-offset: 3px; }
.hb-fab-av { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: #fff; font-family: Georgia, serif; font-size: 24px; }
.hb-fab-av img { width: 100%; height: 100%; object-fit: cover; }
.hb-fab-tag { position: absolute; right: -6px; top: -7px; padding: 2px 7px; border-radius: 10px; background: var(--z-gold); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.3; }
body.hb-open .hb-fab { visibility: hidden; }
/* Map page: the slot cards sit above the tab bar, the button goes above them. */
body[data-tabbar="search"] .hb-fab { bottom: calc(var(--tabbar-h, 0px) + 170px); }

.hb-wrap { position: fixed; inset: 0; z-index: 3400; }   /* above the tab bar (2500) and sheets (2700) */
.hb-wrap.hidden { display: none; }
.hb-dim { position: absolute; inset: 0; background: rgba(40, 40, 40, .35); }
.hb-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  height: min(86vh, 700px);
  max-height: calc(var(--hb-vh, 100vh) - 70px);   /* room for the peeking picture above */
  display: flex;
  flex-direction: column;
  background: var(--z-cream);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
  outline: none;
  color: var(--z-ink);
}
.hb-grab { width: 40px; height: 4px; border-radius: 2px; background: #d8d2c3; margin: 10px auto 4px; flex: none; }
.hb-head { display: flex; align-items: center; gap: 12px; padding: 8px 16px 12px; border-bottom: 1px solid #ebe6dc; flex: none; }
.hb-av { width: 46px; height: 46px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--z-green); color: #fff; font-family: Georgia, serif; font-size: 20px; }
.hb-av img { width: 100%; height: 100%; object-fit: cover; }
.hb-who { min-width: 0; }
.hb-who h2 { margin: 0; font-family: Georgia, serif; font-weight: 400; font-size: 19px; line-height: 1.2; }
.hb-who small { display: block; margin-top: 2px; font-size: 13px; color: #6b6f72; }
.hb-x { margin-left: auto; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; display: grid; place-items: center; cursor: pointer; }
.hb-x svg { width: 16px; height: 16px; fill: none; stroke: #5f6467; stroke-width: 2.2; stroke-linecap: round; }
.hb-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.hb-b { max-width: 82%; padding: 10px 13px; border-radius: 16px; background: #fff; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.hb-me { align-self: flex-end; background: var(--z-green); color: #fff; }
.hb-link { display: inline-block; margin-top: 8px; padding: 6px 12px; border: 1.5px solid var(--z-gold); border-radius: 999px; color: #7a5f2b; font-size: 14px; font-weight: 600; text-decoration: none; }
.hb-mail { align-self: flex-start; padding: 9px 14px; border-radius: 999px; background: var(--z-green); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.hb-b[data-typing] { display: flex; gap: 5px; align-items: center; }
.hb-b[data-typing] i { width: 7px; height: 7px; border-radius: 50%; background: #b9b4a8; animation: hb-dot 1.2s infinite ease-in-out; }
.hb-b[data-typing] i:nth-child(2) { animation-delay: .15s; }
.hb-b[data-typing] i:nth-child(3) { animation-delay: .3s; }
@keyframes hb-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .hb-b[data-typing] i { animation: none; } }
.hb-sug { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 8px; flex: none; }
.hb-sug:empty { display: none; }
.hb-sug button { border: 1px solid #ddd6c6; background: #fff; border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 14px; color: var(--z-ink); cursor: pointer; }
.hb-foot { flex: none; margin: 0; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #ebe6dc; }
.hb-count { margin: 0 0 8px; text-align: center; color: #7a5f2b; font-size: 13px; font-weight: 600; }
.hb-count:empty { display: none; }
.hb-row { display: flex; gap: 10px; }
.hb-input { flex: 1; min-width: 0; border: 1px solid #ddd6c6; background: #fff; border-radius: 999px; padding: 11px 15px; font: inherit; font-size: 16px; color: var(--z-ink); }
.hb-input:focus { outline: 2px solid var(--z-green); outline-offset: 1px; }
.hb-send { flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--z-green); display: grid; place-items: center; cursor: pointer; }
.hb-send:disabled { opacity: .45; cursor: default; }
.hb-send svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hb-dis { margin: 8px 0 0; text-align: center; font-size: 11.5px; line-height: 1.35; color: #77797b; }

/* /aide: « Une question ? » card on top of the FAQ. */
.hb-ask { margin: 4px 0 22px; padding: 16px; border-radius: 20px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.hb-ask-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hb-ask h2 { margin: 0; font-family: Georgia, serif; font-weight: 400; font-size: 18px; }
.hb-ask small { display: block; color: #6b6f72; font-size: 13px; }
/* Signed out (owner pick B): « Connectez-vous » instead of the input. */
.hb-row.hidden, .hb-signin.hidden { display: none; }
.hb-signin { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hb-signin-txt { margin: 0; font-size: 15px; line-height: 1.4; }
.hb-signin .hb-mail { align-self: center; }
/* Messenger header (owner pick B, 2026-10-30): the companion peeks over
   the top edge of the panel, « en ligne », and signs each of its messages. */
.hb-head { position: static; flex-direction: column; gap: 0; padding: 50px 56px 12px; text-align: center; }
.hb-av-lg { position: absolute; left: 50%; top: -58px; transform: translateX(-50%); width: 116px; height: 116px; border: 5px solid var(--z-cream); font-size: 44px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.hb-head .hb-who h2 { font-size: 24px; }
.hb-head .hb-x { position: absolute; right: 14px; top: 14px; }
.hb-on { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #5fae7b; vertical-align: 1px; }
.hb-ai { display: inline-block; margin-left: 2px; padding: 0 6px; border: 1px solid currentColor; border-radius: 8px; font-size: 11px; font-weight: 700; line-height: 1.5; vertical-align: 1px; }
.hb-line { display: flex; align-items: flex-end; gap: 8px; max-width: 90%; }
.hb-line .hb-b { max-width: none; }
.hb-mini { width: 30px; height: 30px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--z-green); color: #fff; font-family: Georgia, serif; font-size: 14px; }
.hb-mini img { width: 100%; height: 100%; object-fit: cover; }
.hb-line + .hb-mail { margin-left: 38px; }
.hb-grab { visibility: hidden; }
/* Keyboard open (iPhone): smaller picture, no suggestions, so the thread
   keeps some room between the header and the input. */
.hb-kb .hb-av-lg { top: -32px; width: 64px; height: 64px; border-width: 3px; }
.hb-kb .hb-head { padding-top: 34px; padding-bottom: 8px; }
.hb-kb .hb-sheet { max-height: calc(var(--hb-vh, 100vh) - 40px); }
.hb-kb .hb-sug, .hb-kb .hb-count { display: none; }
.hb-kb .hb-foot { padding-bottom: 10px; }
/* Idea 8 (2026-11-02): the companion shows its « pensif » pose while the AI answers. */
.hb-av-img.is-think img { animation: hb-think-in .35s ease-out; }
@keyframes hb-think-in { from { opacity: .3; transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) { .hb-av-img.is-think img { animation: none; } }

/* Free questions used up: topics menu answered in advance (owner pick B, 2026-11-02). */
.hb-sug.hb-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 10px; }
.hb-sug .hb-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; border: 1px solid #e3dccb; background: #fffdf8; border-radius: 14px; padding: 10px 6px; font: inherit; font-size: 13px; line-height: 1.25; text-align: center; color: var(--z-ink); text-decoration: none; cursor: pointer; }
.hb-sug .hb-tile svg { width: 22px; height: 22px; fill: none; stroke: var(--z-gold, #b89a5a); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hb-sug .hb-quick-back { border-color: transparent; background: none; color: #7a5f2b; font-weight: 600; padding-left: 4px; }
.hb-sug .hb-quick-back::before { content: '‹ '; }
