.afc-root{--afc-primary:#002541;--afc-accent:#147A46;--afc-bottom:84px;--afc-side:20px;--afc-bg:#fff;--afc-soft:#f1f3ff;--afc-soft2:#e8eeff;--afc-text:#141c2b;--afc-muted:#5b6270;--afc-border:#E2E8F0;
font-family:"Public Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;color:var(--afc-text);-webkit-font-smoothing:antialiased}
.afc-root *,.afc-root *::before,.afc-root *::after{box-sizing:border-box}
.afc-root button{font:inherit;margin:0;border:0;background:none;color:inherit;cursor:pointer;text-transform:none;letter-spacing:normal;box-shadow:none;line-height:1.3;border-radius:0;padding:0;min-height:0;width:auto}
.afc-root img{max-width:none;border:0;box-shadow:none;border-radius:0}
.afc-root [hidden]{display:none!important}
.afc-root :focus-visible{outline:3px solid #6eb1ff;outline-offset:2px}
.afc-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}

/* Bouton flottant */
.afc-root.afc-floating{position:fixed;right:var(--afc-side);bottom:var(--afc-bottom);z-index:2147483000}
/* Ouvert : au-dessus des autres boutons flottants (accessibilité, etc.). */
.afc-root.afc-floating.is-open{z-index:2147483647}
.afc-root .afc-toggle{position:relative;width:60px;height:60px;border-radius:50%;background:#fff;box-shadow:0 6px 20px rgba(0,37,65,.28),0 0 0 3px var(--afc-accent);display:flex;align-items:center;justify-content:center;transition:transform .2s ease,box-shadow .2s ease}
.afc-root .afc-toggle:hover{transform:scale(1.06);background:#fff}
.afc-root .afc-toggle::after{content:"";position:absolute;top:2px;right:2px;width:13px;height:13px;border-radius:50%;background:var(--afc-accent);border:2px solid #fff}
.afc-root.is-open .afc-toggle::after{display:none}
.afc-root .afc-toggle__img{width:44px;height:44px;object-fit:contain;transition:opacity .2s,transform .2s}
.afc-root .afc-toggle__close{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;background:var(--afc-primary);border-radius:50%;opacity:0;transform:rotate(-90deg);transition:opacity .2s,transform .2s}
.afc-root.is-open .afc-toggle__close{opacity:1;transform:none}
.afc-root.is-open .afc-toggle__img{opacity:0;transform:scale(.6)}

/* Bulle d'invitation */
.afc-root .afc-teaser{position:absolute;right:70px;bottom:10px;width:max-content;max-width:230px;background:#fff;color:var(--afc-text);padding:10px 30px 10px 14px;border-radius:14px 14px 4px 14px;box-shadow:0 8px 24px rgba(0,37,65,.18);font-size:13px;font-weight:600;cursor:pointer;animation:afcPop .35s ease}
.afc-root .afc-teaser__close{position:absolute;top:4px;right:8px;font-size:16px;color:var(--afc-muted)}
@keyframes afcPop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* Panneau */
.afc-root .afc-panel{background:var(--afc-bg);border-radius:18px;box-shadow:0 20px 50px -10px rgba(0,37,65,.35);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--afc-border)}
.afc-root.afc-floating .afc-panel{position:absolute;right:0;bottom:74px;width:370px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - var(--afc-bottom) - 100px);transform-origin:bottom right;animation:afcOpen .22s ease}
@keyframes afcOpen{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.afc-root .afc-panel,.afc-root .afc-teaser{animation:none}}

.afc-root .afc-head{background:var(--afc-primary);color:#fff}
.afc-root .afc-flag{display:flex;height:4px}.afc-root .afc-flag span{flex:1}.afc-root .afc-flag span:nth-child(1){background:#147A46}.afc-root .afc-flag span:nth-child(2){background:#F59E0B}.afc-root .afc-flag span:nth-child(3){background:#DC2626}
.afc-root .afc-head__in{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 14px}
.afc-root .afc-head__logo{width:42px;height:42px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.afc-root .afc-head__logo img{width:34px;height:34px;object-fit:contain}
.afc-root .afc-head__txt{display:flex;flex-direction:column;min-width:0;flex:1}
.afc-root .afc-head__txt strong{font-size:15px;font-weight:700;color:#fff;line-height:1.25}
.afc-root .afc-head__txt small{display:flex;align-items:center;gap:6px;font-size:11.5px;color:#c9dcf3;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.afc-root .afc-online{width:7px;height:7px;border-radius:50%;background:#4ade80;flex-shrink:0}
.afc-root .afc-head__btn{width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#fff;opacity:.85;flex-shrink:0}
.afc-root .afc-head__btn:hover{background:rgba(255,255,255,.12);opacity:1;color:#fff}

/* Messages */
.afc-root .afc-messages{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:10px;background:linear-gradient(#f9f9ff,#f4f6fd);overscroll-behavior:contain}
.afc-root .afc-row{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.afc-root .afc-msg{max-width:88%;padding:10px 13px;border-radius:14px;font-size:14px;line-height:1.5;word-wrap:break-word;overflow-wrap:anywhere}
.afc-root .afc-msg--user{align-self:flex-end;background:var(--afc-primary);color:#fff;border-bottom-right-radius:4px;white-space:pre-wrap}
.afc-root .afc-msg--bot{align-self:flex-start;background:#fff;color:var(--afc-text);border-bottom-left-radius:4px;box-shadow:0 1px 2px rgba(0,37,65,.08);border:1px solid var(--afc-border)}
.afc-root .afc-answer p{margin:0}
.afc-root .afc-answer p+p{margin-top:8px}
.afc-root .afc-answer ul,.afc-root .afc-answer ol{margin:6px 0 0;padding-left:18px}
.afc-root .afc-answer a{color:#0061a7;text-decoration:underline;font-weight:600}
.afc-root .afc-answer strong{font-weight:700}
.afc-root .afc-link{display:inline-flex;align-items:center;gap:6px;margin-top:10px;padding:8px 12px;border-radius:8px;background:var(--afc-soft2);color:var(--afc-primary)!important;font-size:13px;font-weight:700;text-decoration:none!important;transition:background-color .2s}
.afc-root .afc-link::after{content:"→"}
.afc-root .afc-link:hover{background:var(--afc-primary);color:#fff!important}
.afc-root .afc-debug{margin-top:8px;padding-top:6px;border-top:1px dashed var(--afc-border);font-size:11.5px;color:#8a5a00}

.afc-root .afc-typing{display:inline-flex;gap:4px;padding:3px 0}
.afc-root .afc-typing i{width:7px;height:7px;border-radius:50%;background:#9aa3b2;animation:afcDot 1s infinite ease-in-out}
.afc-root .afc-typing i:nth-child(2){animation-delay:.15s}.afc-root .afc-typing i:nth-child(3){animation-delay:.3s}
@keyframes afcDot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

/* Suggestions */
.afc-root .afc-chips{display:flex;flex-wrap:wrap;gap:6px;max-width:100%}
.afc-root .afc-chips__label{width:100%;font-size:11.5px;font-weight:700;color:var(--afc-muted)}
.afc-root .afc-chip{background:#fff;border:1px solid var(--afc-primary);color:var(--afc-primary);border-radius:999px;padding:7px 12px;font-size:12.5px;font-weight:600;line-height:1.3;text-align:left;transition:background-color .15s,color .15s}
.afc-root .afc-chip:hover:not(:disabled){background:var(--afc-primary);color:#fff}
.afc-root .afc-chip:disabled{opacity:.45;cursor:default}

/* Saisie */
.afc-root .afc-form{display:flex;align-items:center;gap:8px;padding:10px;border-top:1px solid var(--afc-border);background:#fff}
.afc-root .afc-form input{flex:1;min-width:0;height:42px;border:1px solid var(--afc-border);border-radius:10px;padding:0 12px;font:inherit;font-size:14px;color:var(--afc-text);background:#f8fafc;box-shadow:none;margin:0}
.afc-root .afc-form input:focus{outline:none;border-color:var(--afc-primary);background:#fff;box-shadow:0 0 0 3px rgba(0,97,167,.15)}
.afc-root .afc-form button{width:42px;height:42px;border-radius:10px;background:var(--afc-accent);color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:filter .2s}
.afc-root .afc-form button:hover{filter:brightness(1.1);background:var(--afc-accent);color:#fff}

/* Mobile : panneau plein écran */
@media (max-width:480px){
	.afc-root.afc-floating .afc-panel{position:fixed;inset:auto 0 0 0;width:100%;max-width:none;height:min(88vh,640px);max-height:none;border-radius:18px 18px 0 0}
	.afc-root.afc-floating.is-open .afc-toggle{opacity:0;pointer-events:none}
	.afc-root .afc-teaser{max-width:190px}
}

/* Version intégrée (page de test de l'administration) */
.afc-root.afc-inline .afc-panel{height:600px;max-width:420px}
