/* ---------- Assistant IA (démonstration) — mascotte visuel 06 ---------- */
.mascot { position: relative; overflow: hidden; border-radius: 50%; aspect-ratio: 1; background: #fff; flex: none; }
.mascot img { position: absolute; max-width: none; height: auto; width: calc(1672 / 382 * 100%); left: calc(998 / 382 * -100%); top: calc(22 / 382 * -100%); }
.mascot-face { position: relative; overflow: hidden; aspect-ratio: 1; flex: none; }
.mascot-face img { position: absolute; max-width: none; height: auto; width: calc(1672 / 560 * 100%); left: calc(226 / 560 * -100%); top: calc(28 / 560 * -100%); mix-blend-mode: multiply; }

.ai-launch { position: fixed; right: max(var(--margin), env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; cursor: pointer; }
.ai-launch .mascot { width: 64px; box-shadow: 0 8px 24px rgba(15,14,13,.22); animation: hover-bob 4s ease-in-out infinite; transition: transform 300ms cubic-bezier(.2,.7,.2,1); }
.ai-launch:hover .mascot { transform: scale(1.08) rotate(-4deg); animation-play-state: paused; }
@keyframes hover-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.ai-launch__bubble { background: var(--ink); color: var(--paper); font: 600 15px/1 var(--font-title); padding: 12px 16px; border-radius: 18px 18px 4px 18px;
  opacity: 0; transform: translateX(8px); transition: opacity 400ms ease-out, transform 400ms ease-out; pointer-events: none; white-space: nowrap; }
.ai-launch.is-hint .ai-launch__bubble, .ai-launch:hover .ai-launch__bubble, .ai-launch:focus-visible .ai-launch__bubble { opacity: 1; transform: none; }
.ai-launch:focus-visible { outline: none; }
.ai-launch:focus-visible .mascot { outline: 2px solid var(--accent); outline-offset: 3px; }

dialog.ai { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); max-width: 100vw; border: 0; padding: 0; background: var(--paper); color: var(--ink);
  display: none; flex-direction: column; box-shadow: -20px 0 60px rgba(15,14,13,.25); }
dialog.ai[open] { display: flex; animation: ai-in 420ms cubic-bezier(.2,.7,.2,1); }
@keyframes ai-in { from { transform: translateX(40px); opacity: 0; } }
dialog.ai::backdrop { background: rgba(15,14,13,.45); backdrop-filter: blur(2px); }
.ai__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.ai__head .mascot { width: 44px; border: 0; }
.ai__head strong { font: 600 17px/1.2 var(--font-title); display: block; }
.ai__status { font-family: var(--font-data); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ai__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ai__head .icon-btn { margin-left: auto; }
.ai__log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.ai__hello { display: grid; justify-items: start; gap: 10px; margin-bottom: 8px; }
.ai__hello .mascot-face { width: 112px; animation: hover-bob 4s ease-in-out infinite; }
.ai__hello h2 { font-size: 28px; letter-spacing: -0.04em; }
.ai__hello p { color: var(--muted); font-size: 15px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 14px; font-size: 15px; line-height: 1.5; animation: msg-in 300ms ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg--bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg--me { background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg a { font-weight: 600; }
.msg .src { display: block; margin-top: 8px; font-family: var(--font-data); font-size: 11px; color: var(--muted); }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.chip { border: 1px solid var(--ink); background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 40px; font: 500 14px/1.2 var(--font-body); cursor: pointer; color: var(--ink);
  transition: background-color var(--motion), color var(--motion); }
.chip:hover { background: var(--ink); color: var(--paper); }
.ai__form { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--paper); }
.ai__form .input { flex: 1; font-size: 16px; }
.ai__send { width: 48px; min-height: 48px; border-radius: var(--radius-control); border: 0; background: var(--accent); color: var(--ink); font: 600 20px/1 var(--font-title); cursor: pointer; }
.ai__legal { font-family: var(--font-data); font-size: 11px; color: var(--muted); padding: 0 20px 10px; }
@media (max-width: 767px) {
  dialog.ai { width: 100vw; height: 92dvh; margin: auto 0 0 0; border-radius: 16px 16px 0 0; }
  @keyframes ai-in { from { transform: translateY(40px); opacity: 0; } }
  .ai-launch .mascot { width: 56px; }
  .ai-launch__bubble { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ai-launch .mascot, .ai__hello .mascot-face { animation: none; } }
