.octo-float{
 position:fixed;right:clamp(1rem,3vw,2rem);bottom:clamp(1rem,3vw,2rem);z-index:30;
 display:grid;place-items:center;width:72px;height:72px;border-radius:50%;
 background:transparent;text-decoration:none;filter:drop-shadow(0 10px 18px rgba(11,10,12,.2));
 transition:transform var(--t-normal) var(--ease-smooth),filter var(--t-normal) var(--ease-smooth)
}
.octo-float:hover,.octo-float:focus-visible{transform:translateY(-4px) scale(1.04);filter:drop-shadow(0 14px 24px rgba(108,60,170,.28))}
.octo-float:focus-visible{outline:2px solid var(--accent);outline-offset:5px}
.octo-float img{width:72px;height:72px;object-fit:contain}
.octo-float__notice{
 position:absolute;top:-2px;right:-2px;display:grid;place-items:center;min-width:21px;height:21px;padding:0 5px;
 border:2px solid var(--paper);border-radius:999px;background:#e5484d;color:#fff;font-size:.72rem;font-weight:700;
 line-height:1;box-shadow:0 3px 10px rgba(229,72,77,.3);animation:octo-notice 2.4s ease-in-out infinite
}
@keyframes octo-notice{0%,100%{transform:scale(1)}50%{transform:scale(1.1)}}
@media (max-width:600px){
 .octo-float{right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}
 .octo-float,.octo-float img{width:56px;height:56px}
 .octo-float__notice{min-width:19px;height:19px;font-size:.66rem}
}
body.octo-near-footer .octo-float,
body.octo-near-footer .octo__teaser{opacity:0;pointer-events:none;transition:opacity var(--t-normal) var(--ease-smooth)}
@media (prefers-reduced-motion:reduce){.octo-float{transition:none}.octo-float__notice{animation:none}}
button.octo-float{border:0;padding:0;cursor:pointer}
html:has(.octo[open]){overflow:hidden}

/* Fenetre de conversation. Sur ordinateur : panneau flottant. Sur telephone :
   plein ecran, chaque pixel vertical va d'abord au fil de la conversation. */
.octo{
 --octo-violet:#6c04f1;--octo-violet-deep:#5103b4;--octo-muted:#61556e;--octo-line:#eee8f5;--octo-soft:#faf7ff;
 position:fixed;inset:auto 24px 24px auto;margin:0;width:min(450px,calc(100vw - 32px));height:min(730px,calc(100dvh - 48px));
 max-height:none;max-width:none;padding:0;border:2px solid var(--accent,#6c3caa);border-radius:24px;background:#fff;color:var(--ink);
 box-shadow:0 24px 90px #21103830,0 0 0 4px rgba(108,60,170,.08);font:16px/1.5 'General Sans',sans-serif;overflow:hidden
}
.octo[open]{display:flex;flex-direction:column}
.octo::backdrop{background:#170b2426}
.octo button{-webkit-tap-highlight-color:transparent}

.octo__head{display:flex;align-items:center;gap:10px;padding:14px 10px 14px 16px;border-bottom:1px solid var(--octo-line);flex:none;background:var(--octo-soft)}
.octo__head img{flex:none;width:44px;height:44px}
.octo__id{min-width:0;flex:1}
.octo__head h2{font-size:19px;line-height:1.15;margin:0;letter-spacing:-.02em}
.octo__head p{font-size:12px;line-height:1.35;color:var(--octo-muted);margin:2px 0 0}
.octo__progress{display:flex;align-items:center;gap:7px;margin-top:5px;font-size:11px;line-height:1.2;color:var(--octo-violet)}
.octo__steps{display:flex;gap:3px;flex:none}
.octo__steps i{width:14px;height:4px;border-radius:2px;background:#e3d5f2}
.octo__steps i:first-child,
.octo__progress[data-step="2"] .octo__steps i:nth-child(2),
.octo__progress[data-step="3"] .octo__steps i{background:var(--octo-violet)}
.octo__progress-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.octo__icon{display:grid;place-items:center;flex:none;width:44px;height:44px;padding:0;border:0;border-radius:12px;background:none;color:var(--ink);cursor:pointer}
.octo__icon:hover{background:#efe8f8}
.octo__icon svg{width:20px;height:20px}
.octo__close{font-size:28px;line-height:1}

/* Zone qui defile : messages, cartes et suggestions avancent ensemble. */
.octo__body:focus{outline:none}
.octo__body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 16px 6px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.octo__message{max-width:92%;width:fit-content;padding:11px 14px;margin:0 0 10px;border-radius:18px;font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.octo__message--assistant{background:#f5f2f8;border-bottom-left-radius:5px}
.octo__message--user{margin-left:auto;background:var(--octo-violet);color:#fff;border-bottom-right-radius:5px}
.octo__message--user+.octo__message--assistant,.octo__message--assistant+.octo__message--user{margin-top:14px}
.octo__typing{display:flex;gap:4px;width:fit-content;margin:4px 0 10px;padding:13px 15px;border-radius:18px;border-bottom-left-radius:5px;background:#f5f2f8}
.octo__typing[hidden]{display:none}
.octo__typing i{width:7px;height:7px;border-radius:50%;background:#9b86b6;animation:octo-dot 1.1s ease-in-out infinite}
.octo__typing i:nth-child(2){animation-delay:.15s}
.octo__typing i:nth-child(3){animation-delay:.3s}
@keyframes octo-dot{0%,60%,100%{transform:none;opacity:.45}30%{transform:translateY(-3px);opacity:1}}
.octo__suggestions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;margin:2px 0 8px}
.octo__suggestions:empty{display:none}
.octo__suggestions button{font:inherit;font-size:13px;line-height:1.3;text-align:left;border:1px solid #d9c9ee;border-radius:18px;background:#fff;color:var(--octo-violet-deep);padding:8px 13px;cursor:pointer;min-height:38px}
.octo__suggestions button:hover{background:var(--octo-soft);border-color:var(--octo-violet)}

.octo__status{margin:0 16px 6px;font-size:12px;line-height:1.4;color:var(--octo-muted);flex:none}
/* Vide : sans hauteur mais toujours present, pour que l'annonce soit lue. */
.octo__status:empty{margin:0}
.octo__form{display:flex;align-items:flex-end;gap:8px;margin:6px 14px 0;border:1px solid #d8cce6;border-radius:22px;padding:5px 5px 5px 8px;background:#fff;flex:none}
.octo__form:focus-within{border-color:var(--octo-violet);box-shadow:0 0 0 3px rgba(108,4,241,.14)}
.octo textarea{display:block;border:0;resize:none;min-width:0;flex:1;max-height:132px;padding:8px 6px;font:inherit;font-size:16px;line-height:1.4;outline:none;background:transparent;color:#0b0a0c}
.octo textarea::placeholder{color:#857a90}
.octo__form button{display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:var(--octo-violet);color:#fff;cursor:pointer;flex:none}
.octo__form button svg{width:20px;height:20px}
.octo button:disabled{opacity:.5;cursor:wait}
.octo button:focus-visible,.octo summary:focus-visible{outline:2px solid var(--octo-violet);outline-offset:3px}

/* Pied compact : une seule ligne pour la mention IA et le contact humain. */
.octo__foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0 12px;padding:4px 16px 10px;flex:none}
.octo__human{margin-left:auto;border:0;background:none;padding:8px 0;color:var(--octo-violet-deep);font:inherit;font-size:12px;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
.octo__privacy{font-size:11px;color:#65596f;min-width:0}
.octo__privacy summary{cursor:pointer;padding:8px 0;list-style-position:inside}
.octo__privacy[open]{order:2;flex-basis:100%;max-height:120px;overflow:auto}
.octo__privacy p{margin:0 0 6px;line-height:1.5}

.octo__offer{margin:0 0 10px;border:1px solid #e5d9f4;border-radius:16px;padding:12px 14px;background:#fdfbff}
.octo__offer h3{font-size:15px;line-height:1.3;margin:0}
.octo__offer strong{display:block;margin-top:2px;color:var(--octo-violet-deep);font-size:16px;line-height:1.35}
.octo__offer p{font-size:13px;line-height:1.5;margin:6px 0}
.octo__offer small{font-size:11px;line-height:1.4;color:#65596f;display:block}
.octo__action{width:100%;padding:12px;border:0;border-radius:14px;background:var(--octo-violet);color:#fff;font:inherit;font-size:14px;font-weight:600;cursor:pointer;margin:0 0 12px}
.octo__nudge{display:flex;flex-direction:column;gap:6px;margin:0 0 12px;padding:12px 14px;border:1px solid #e3d5f2;border-radius:16px;background:var(--octo-soft);font-size:12px;line-height:1.45}
.octo__nudge strong{font-size:13px;color:var(--octo-violet-deep)}
.octo__nudge span{color:#51475a}
.octo__nudge button{align-self:flex-start;border:0;border-radius:999px;padding:8px 12px;background:var(--octo-violet);color:#fff;font:inherit;font-size:12px;cursor:pointer}

.octo__teaser{position:fixed;right:24px;bottom:104px;z-index:29;width:min(246px,calc(100vw - 48px));padding:10px 12px;border:1px solid rgba(108,60,170,.38);border-radius:14px;background:#fff;box-shadow:0 12px 32px #21103820;opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .25s ease,transform .25s ease}
.octo__teaser.is-visible{opacity:1;transform:none;pointer-events:auto}
.octo__teaser p{margin:0 20px 7px 0;font-size:11px;line-height:1.35}
.octo__teaser p strong,.octo__teaser p span{display:block}
.octo__teaser p strong{font-size:12px;color:#211038}
.octo__teaser p span{margin-top:3px;color:#61556e}
.octo__teaser-open{border:0;border-radius:999px;padding:7px 10px;background:var(--accent,#6c3caa);color:#fff;font:inherit;font-size:11px;font-weight:650;cursor:pointer}
.octo__teaser-close{position:absolute;top:8px;right:10px;border:0;background:none;color:#61556e;font-size:18px;cursor:pointer}
.octo__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

@media (max-width:600px){
 /* Plein ecran. --octo-vh et --octo-top suivent la zone reellement visible
    (clavier ouvert compris), mises a jour par octomask.js via visualViewport. */
 .octo{inset:var(--octo-top,0px) 0 auto 0;width:100%;height:var(--octo-vh,100dvh);border:0;border-radius:0;box-shadow:none}
 .octo::backdrop{background:#fff}
 .octo__head{gap:8px;padding:8px 4px 8px 12px;padding-top:max(8px,env(safe-area-inset-top,0px))}
 .octo__head img{width:36px;height:36px}
 .octo__head h2{font-size:16px}
 .octo__head p{display:none}
 .octo__progress{margin-top:3px}
 /* Les trois traits disent deja l'etape : le numero reste pour les lecteurs d'ecran. */
 .octo__progress-num{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .octo__icon{width:42px;height:42px}
 .octo__body{padding:14px 12px 4px}
 .octo__message{font-size:15px;line-height:1.5;max-width:88%}
 .octo__message--assistant{max-width:94%}
 .octo__suggestions{gap:6px}
 .octo__suggestions button{font-size:14px;min-height:40px}
 .octo__status{margin:0 12px 4px}
 .octo__form{margin:4px 10px 0}
 .octo__foot{padding:0 14px max(6px,env(safe-area-inset-bottom,0px))}
 /* Clavier ouvert : on rend la place au fil, la mention revient a la fermeture. */
 .octo.is-typing .octo__foot{display:none}
 .octo.is-typing .octo__form{margin-bottom:6px}
 .octo__teaser{right:12px;bottom:calc(76px + env(safe-area-inset-bottom,0px));width:min(204px,calc(100vw - 32px));padding:9px 10px}
 .octo__teaser p{margin-bottom:6px}
 .octo__teaser p span{display:none}
 .octo__teaser-open{padding:6px 9px}
}
@media (prefers-reduced-motion:reduce){.octo__teaser{transition:none}.octo__typing i{animation:none;opacity:.7}}
