/* ============================================================
   ASSISTANT D'AIDE : fenêtre de discussion ancrée en bas à droite
   (plein écran sur téléphone).
============================================================ */
.help-dock { position: fixed; z-index: var(--z-drawer); right: var(--space-5); bottom: var(--space-5); pointer-events: none; }
.help-panel { pointer-events: auto; display: flex; flex-direction: column; width: min(400px, calc(100vw - 2 * var(--space-4))); height: min(600px, calc(var(--vh-full) - var(--topbar-height) - 2 * var(--space-5))); border-radius: var(--radius-xl); background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--shadow-xl); overflow: hidden; animation: modal-in var(--slow) var(--ease-out); }
.help-panel.hidden { display: none; }
.help-head { flex: none; display: flex; align-items: center; gap: var(--space-3); padding: 12px 10px 12px var(--space-4); border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); color: #fff; }
.help-head-logo { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.96); }
.help-head-text { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.3; }
.help-head-text strong { font-size: var(--text-base); font-weight: 600; }
.help-head-text small { font-size: var(--text-xs); opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-head .btn-icon { color: rgba(255, 255, 255, 0.85); }
.help-head .btn-icon:hover { background: rgba(255, 255, 255, 0.16) !important; color: #fff !important; }

.help-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: var(--space-4); background: var(--thread-bg); }
.help-msg { max-width: 88%; padding: 9px 12px; border-radius: 16px; font-size: var(--text-sm); line-height: 1.5; overflow-wrap: anywhere; }
.help-msg p + p, .help-msg p + ul, .help-msg p + ol, .help-msg ul + p, .help-msg ol + p { margin-top: 6px; }
.help-msg ul, .help-msg ol { padding-left: 18px; display: grid; gap: 3px; }
.help-msg ul { list-style: disc; }
.help-msg ol { list-style: decimal; }
.help-msg.bot { align-self: flex-start; background: var(--bubble-in); border: 1px solid var(--border); color: var(--text); border-top-left-radius: 6px; box-shadow: var(--shadow-xs); }
.help-msg.mine { align-self: flex-end; background: var(--bubble-human); color: var(--bubble-human-text); border-top-right-radius: 6px; }
.help-msg.error { border-color: var(--warning-border); background: var(--warning-soft); }
.help-msg.typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.help-msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); animation: typing 1.2s ease-in-out infinite; }
.help-msg.typing i:nth-child(2) { animation-delay: 0.15s; }
.help-msg.typing i:nth-child(3) { animation-delay: 0.3s; }
.help-open { display: inline-flex; align-items: center; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-size: var(--text-xs); font-weight: 600; transition: var(--transition); }
.help-open:hover { background: var(--primary-soft-2); }

.help-chips { flex: none; display: flex; gap: 6px; flex-wrap: wrap; padding: 0 var(--space-4) var(--space-3); background: var(--thread-bg); }
.help-chips.hidden { display: none; }
.help-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--text-xs); font-weight: 500; text-align: left; transition: var(--transition); }
.help-chip:hover { border-color: var(--primary-border); color: var(--primary-text); background: var(--primary-soft); }
.help-form { flex: none; display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-3) 6px var(--space-4); border-top: 1px solid var(--border); background: var(--surface-raised); }
.help-form textarea { flex: 1 1 auto; min-height: 38px !important; max-height: 110px; resize: none; border-radius: 19px !important; padding: 8px 14px !important; line-height: 1.4; }
.help-send { width: 38px; height: 38px; border-radius: 50%; }
.help-foot { flex: none; padding: 0 var(--space-4) calc(var(--space-3) + var(--safe-bottom)); color: var(--text-3); font-size: var(--text-2xs); text-align: center; background: var(--surface-raised); }
.help-foot a { color: var(--primary-text); font-weight: 600; }

@media (max-width: 767px) {
  .help-dock { inset: 0; }
  .help-dock:has(.help-panel.hidden) { display: none; }
  .help-panel { width: 100%; height: var(--vh-full); border-radius: 0; border: 0; animation-name: sheet-in; }
  .help-msg { font-size: var(--text-base); }
  .help-form textarea { font-size: 1rem !important; }
}
