/* Easy Solutions — Assistant IA commercial V71 */
.es-ai-chat{position:fixed;right:20px;bottom:88px;z-index:90;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#16243f}
.es-ai-chat *{box-sizing:border-box}
.es-ai-launcher{width:58px;height:58px;border:0;border-radius:50%;background:#16243f;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 14px 36px rgba(11,20,37,.28);transition:transform .2s ease,background .2s ease}
.es-ai-launcher:hover{transform:translateY(-2px);background:#c41e2a}.es-ai-launcher svg{width:25px;height:25px}.es-ai-launcher .es-ai-close{display:none}.es-ai-chat.is-open .es-ai-launcher .es-ai-open{display:none}.es-ai-chat.is-open .es-ai-launcher .es-ai-close{display:block}
.es-ai-badge{position:absolute;right:68px;bottom:8px;background:#fff;color:#16243f;border:1px solid #e4e9f2;border-radius:999px;padding:8px 12px;white-space:nowrap;font-size:12px;font-weight:700;box-shadow:0 8px 26px rgba(11,20,37,.12);transition:opacity .2s ease,transform .2s ease}.es-ai-chat.is-open .es-ai-badge{opacity:0;pointer-events:none;transform:translateX(8px)}
.es-ai-panel{position:absolute;right:0;bottom:72px;width:min(388px,calc(100vw - 32px));height:min(620px,calc(100vh - 150px));background:#fff;border:1px solid #e4e9f2;border-radius:20px;box-shadow:0 24px 70px rgba(11,20,37,.24);overflow:hidden;display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translateY(10px) scale(.98);transform-origin:bottom right;transition:opacity .2s ease,transform .2s ease,visibility .2s}
.es-ai-chat.is-open .es-ai-panel{opacity:1;visibility:visible;transform:none}
.es-ai-head{background:#0b1425;color:#fff;padding:16px 17px 14px;display:flex;align-items:center;gap:11px;min-height:72px}.es-ai-mark{width:36px;height:36px;border-radius:10px;background:#c41e2a;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:14px;flex:0 0 auto}.es-ai-head-copy{min-width:0}.es-ai-head strong{display:block;font-size:14px;line-height:1.2}.es-ai-head span{display:block;font-size:11px;color:rgba(255,255,255,.68);margin-top:4px}.es-ai-status{display:inline-flex!important;align-items:center;gap:5px}.es-ai-status:before{content:"";width:6px;height:6px;border-radius:50%;background:#6fe49b;display:inline-block}
.es-ai-messages{flex:1;overflow:auto;padding:16px 14px 8px;background:#f7f9fc;scroll-behavior:smooth}.es-ai-msg{display:flex;margin:0 0 10px}.es-ai-msg.user{justify-content:flex-end}.es-ai-bubble{max-width:86%;padding:10px 12px;border-radius:14px;font-size:13.5px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.es-ai-msg.bot .es-ai-bubble{background:#fff;border:1px solid #e5eaf2;border-bottom-left-radius:5px}.es-ai-msg.user .es-ai-bubble{background:#16243f;color:#fff;border-bottom-right-radius:5px}.es-ai-msg.error .es-ai-bubble{background:#fff5f5;border-color:#f1c5c9;color:#79242c}.es-ai-typing .es-ai-bubble{display:flex;gap:4px;align-items:center;padding:13px 14px}.es-ai-typing i{width:5px;height:5px;background:#8c99b0;border-radius:50%;animation:esAiDot 1s infinite ease-in-out}.es-ai-typing i:nth-child(2){animation-delay:.15s}.es-ai-typing i:nth-child(3){animation-delay:.3s}@keyframes esAiDot{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}
.es-ai-quick{padding:0 14px 10px;background:#f7f9fc;display:flex;gap:7px;overflow-x:auto;scrollbar-width:none}.es-ai-quick::-webkit-scrollbar{display:none}.es-ai-chip{border:1px solid #dce3ed;background:#fff;color:#263a5d;border-radius:999px;padding:7px 10px;font:600 11px/1.2 Inter,system-ui,sans-serif;cursor:pointer;white-space:nowrap}.es-ai-chip:hover{border-color:#c41e2a;color:#a5121d}
.es-ai-actions{padding:0 14px 11px;background:#f7f9fc}.es-ai-lead-btn{width:100%;border:0;border-radius:10px;background:#c41e2a;color:#fff;padding:10px 12px;font:700 12px/1.2 Inter,system-ui,sans-serif;cursor:pointer}.es-ai-lead-btn:hover{background:#a5121d}
.es-ai-compose{border-top:1px solid #e5eaf2;background:#fff;padding:10px}.es-ai-compose-row{display:flex;gap:8px;align-items:flex-end}.es-ai-input{flex:1;resize:none;max-height:92px;min-height:40px;border:1px solid #dce3ed;border-radius:10px;padding:10px 11px;font:13px/1.35 Inter,system-ui,sans-serif;color:#16243f;outline:none}.es-ai-input:focus{border-color:#8090a9;box-shadow:0 0 0 3px rgba(22,36,63,.07)}.es-ai-send{width:40px;height:40px;border:0;border-radius:10px;background:#16243f;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto}.es-ai-send:disabled{opacity:.45;cursor:not-allowed}.es-ai-send svg{width:17px;height:17px}.es-ai-note{font-size:9.5px;line-height:1.35;color:#7b8799;margin:7px 2px 0}.es-ai-note a{color:#54627e;text-decoration:underline}
.es-ai-lead{position:absolute;inset:72px 0 0;background:#fff;z-index:4;display:none;flex-direction:column}.es-ai-lead.is-visible{display:flex}.es-ai-lead-head{padding:16px 17px 10px;border-bottom:1px solid #eef1f5}.es-ai-lead-head strong{font-size:16px}.es-ai-lead-head p{font-size:12px;color:#647087;margin:5px 0 0;line-height:1.45}.es-ai-lead-body{padding:14px 17px;overflow:auto}.es-ai-field{margin-bottom:10px}.es-ai-field label{display:block;font-size:10.5px;font-weight:700;color:#526079;margin-bottom:5px}.es-ai-field input,.es-ai-field textarea{width:100%;border:1px solid #dce3ed;border-radius:9px;padding:9px 10px;font:13px/1.4 Inter,system-ui,sans-serif;outline:none}.es-ai-field textarea{min-height:74px;resize:vertical}.es-ai-field input:focus,.es-ai-field textarea:focus{border-color:#8090a9;box-shadow:0 0 0 3px rgba(22,36,63,.07)}.es-ai-lead-actions{display:flex;gap:8px;margin-top:12px}.es-ai-secondary,.es-ai-primary{border:0;border-radius:9px;padding:10px 12px;font:700 12px/1 Inter,system-ui,sans-serif;cursor:pointer}.es-ai-secondary{background:#eef1f5;color:#263a5d}.es-ai-primary{flex:1;background:#c41e2a;color:#fff}.es-ai-primary:disabled{opacity:.55;cursor:not-allowed}.es-ai-consent{font-size:9.5px;color:#7b8799;line-height:1.4;margin-top:8px}.es-ai-success{padding:28px 18px;text-align:center}.es-ai-success strong{display:block;font-size:17px;margin-bottom:7px}.es-ai-success p{font-size:12px;color:#647087;line-height:1.5}
@media(max-width:560px){.es-ai-chat{right:14px;bottom:82px}.es-ai-panel{position:fixed;right:10px;left:10px;bottom:148px;width:auto;height:min(610px,calc(100dvh - 170px));border-radius:17px}.es-ai-badge{display:none}.es-ai-launcher{width:54px;height:54px}.es-ai-bubble{max-width:90%}}
@media(prefers-reduced-motion:reduce){.es-ai-panel,.es-ai-launcher,.es-ai-badge{transition:none!important}.es-ai-typing i{animation:none!important}}

/* V72 — apparition proactive + identité robot */
.es-ai-launcher .es-ai-robot{width:31px;height:31px;color:#fff;filter:drop-shadow(0 1px 0 rgba(255,255,255,.08))}
.es-ai-mark svg{width:25px;height:25px;color:#fff}
.es-ai-launcher:before{content:"";position:absolute;inset:-5px;border-radius:50%;border:1px solid rgba(196,30,42,.34);opacity:0;transform:scale(.9);animation:esAiPulse 3.2s ease-out 1.5s infinite;pointer-events:none}
.es-ai-chat.is-open .es-ai-launcher:before{animation:none;opacity:0}
.es-ai-chat.is-auto-open .es-ai-panel{animation:esAiHello .62s cubic-bezier(.16,1,.3,1) both}
@keyframes esAiPulse{0%{opacity:0;transform:scale(.88)}15%{opacity:.85}75%,100%{opacity:0;transform:scale(1.32)}}
@keyframes esAiHello{0%{opacity:0;transform:translateY(18px) scale(.94)}100%{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.es-ai-launcher:before,.es-ai-chat.is-auto-open .es-ai-panel{animation:none!important}}

/* V75 — Cloudflare Turnstile, rendu uniquement si une interaction anti-robot est nécessaire. */
.es-ai-security{min-height:0;margin:2px 0 0}
.es-ai-turnstile{max-width:100%;min-height:0;overflow:visible}
.es-ai-security-status{display:none;margin:8px 0 0;font-size:12px;line-height:1.45;color:#667085}
.es-ai-security-status.is-visible{display:block}
.es-ai-security-status.is-error{color:#b42318}
.es-ai-security-status.is-ok{color:#027a48}
.es-ai-primary[disabled]{cursor:wait;opacity:.68}
@media(max-width:420px){.es-ai-turnstile{transform-origin:left top}}

.es-ai-chat{right:20px!important;bottom:22px!important;transition:opacity .35s ease,transform .45s ease!important}.es-ai-chat.es-ai-hidden{opacity:0!important;transform:translateY(22px) scale(.94)!important;pointer-events:none!important}.es-ai-chat.is-ready{opacity:1!important;transform:none!important;pointer-events:auto!important}.es-ai-launcher{position:relative!important;width:74px!important;height:74px!important;padding:0!important;border:3px solid #fff!important;border-radius:50%!important;background:#eef4fb!important;overflow:hidden!important}.es-ai-character-avatar{width:100%!important;height:100%!important;object-fit:cover!important;object-position:50% 22%!important}.es-ai-online-dot{position:absolute!important;right:2px!important;bottom:5px!important;width:14px!important;height:14px!important;border-radius:50%!important;background:#25c56a!important;border:3px solid #fff!important}.es-ai-launcher:before{display:none!important}.es-ai-badge{right:84px!important;bottom:13px!important;max-width:190px!important;white-space:normal!important;border-radius:16px 16px 4px 16px!important}.es-ai-panel{bottom:88px!important;width:min(360px,calc(100vw - 28px))!important;height:min(520px,calc(100vh - 150px))!important}@media(max-width:560px){.es-ai-launcher{width:64px!important;height:64px!important}.es-ai-badge{display:block!important;right:72px!important;max-width:155px!important}.es-ai-panel{right:8px!important;left:8px!important;bottom:150px!important;width:auto!important;height:min(540px,calc(100vh - 165px))!important}}


/* V103 — personnage validé + panneau non intrusif */
@media (min-width: 761px){
  .es-ai-panel{right:116px!important;bottom:88px!important;width:min(360px,calc(100vw - 300px))!important;height:min(520px,calc(100vh - 150px))!important}
  .es-ai-character-figure{position:absolute;right:-8px;bottom:88px;width:158px;height:auto;max-height:470px;object-fit:cover;object-position:center top;border-radius:0 0 22px 22px;z-index:3;opacity:0;visibility:hidden;transform:translateY(18px) scale(.96);transition:opacity .28s ease,transform .38s cubic-bezier(.16,1,.3,1),visibility .28s;pointer-events:none;filter:drop-shadow(0 18px 28px rgba(11,20,37,.22))}
  .es-ai-chat.is-open .es-ai-character-figure{opacity:1;visibility:visible;transform:none}
}
@media (max-width:760px){.es-ai-character-figure{display:none!important}}
#header.header .burger#burger,
#header.header .burger#burger:hover,
#header.header .burger#burger:focus,
#header.header .burger#burger:active{background:transparent!important;background-image:none!important;border:0!important;outline:0!important;box-shadow:none!important;border-radius:0!important}
#header.header .burger#burger .es-menu-label{background:transparent!important;background-image:none!important;border:0!important;outline:0!important;box-shadow:none!important;border-radius:0!important}

/* V103.2 — affinage visuel validé */
.es-ai-badge{width:176px!important;max-width:176px!important;text-align:center!important;line-height:1.28!important}
.es-ai-mark{overflow:hidden!important;background:#eef4fb!important;border:2px solid rgba(255,255,255,.7)!important;border-radius:50%!important}
.es-ai-mark img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
@media (min-width:761px){
  .es-ai-panel{right:180px!important}
  .es-ai-character-figure{right:0!important;width:164px!important}
}

/* =========================================================
   V105 — responsive/cross-browser hardening
   Chromium / Firefox / Safari + desktop / tablet / mobile
   ========================================================= */
:root{
  --es-ai-safe-right:max(16px, env(safe-area-inset-right, 0px));
  --es-ai-safe-bottom:max(16px, env(safe-area-inset-bottom, 0px));
  --es-ai-vh:100vh;
  --es-ai-vw:100vw;
}

.es-ai-chat{
  right:var(--es-ai-safe-right)!important;
  bottom:var(--es-ai-safe-bottom)!important;
  max-width:100vw!important;
  max-width:100dvw!important;
  isolation:isolate;
}

.es-ai-panel{
  position:fixed!important;
  right:calc(var(--es-ai-safe-right) + 154px)!important;
  bottom:calc(var(--es-ai-safe-bottom) + 82px)!important;
  width:348px!important;
  max-width:calc(100vw - 210px)!important;
  max-width:calc(100dvw - 210px)!important;
  height:488px!important;
  max-height:calc(var(--es-ai-vh) - 118px)!important;
  border-radius:18px!important;
  contain:layout paint;
  -webkit-overflow-scrolling:touch;
}

.es-ai-character-figure{
  position:fixed!important;
  right:var(--es-ai-safe-right)!important;
  bottom:calc(var(--es-ai-safe-bottom) + 82px)!important;
  width:138px!important;
  height:372px!important;
  max-height:calc(var(--es-ai-vh) - 132px)!important;
  object-fit:cover!important;
  object-position:center top!important;
  border-radius:18px!important;
  overflow:hidden!important;
}

.es-ai-launcher{
  width:66px!important;
  height:66px!important;
  min-width:66px!important;
  min-height:66px!important;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.es-ai-badge{
  right:76px!important;
  bottom:10px!important;
  width:auto!important;
  max-width:168px!important;
  padding:8px 11px!important;
  font-size:11px!important;
}

.es-ai-messages{
  min-height:0!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.es-ai-bubble{
  word-break:break-word;
  overflow-wrap:break-word;
  overflow-wrap:anywhere;
}
.es-ai-input{
  appearance:none;
  -webkit-appearance:none;
  font-size:16px!important; /* prevents iOS zoom on focus */
}
.es-ai-chip,.es-ai-lead-btn,.es-ai-send,.es-ai-secondary,.es-ai-primary,.es-ai-launcher{
  appearance:none;
  -webkit-appearance:none;
}

/* Laptop / small desktop: no separate character, keep chat compact. */
@media (max-width:1439px){
  .es-ai-character-figure{display:none!important}
  .es-ai-panel{
    right:var(--es-ai-safe-right)!important;
    width:340px!important;
    max-width:calc(100vw - 32px)!important;
    max-width:calc(100dvw - 32px)!important;
  }
}

/* Tablet portrait + landscape */
@media (max-width:900px){
  .es-ai-chat{
    right:max(14px, env(safe-area-inset-right, 0px))!important;
    bottom:max(14px, env(safe-area-inset-bottom, 0px))!important;
  }
  .es-ai-launcher{width:60px!important;height:60px!important;min-width:60px!important;min-height:60px!important}
  .es-ai-panel{
    right:max(14px, env(safe-area-inset-right, 0px))!important;
    bottom:calc(max(14px, env(safe-area-inset-bottom, 0px)) + 74px)!important;
    width:336px!important;
    max-width:calc(100vw - 28px)!important;
    max-width:calc(100dvw - 28px)!important;
    height:470px!important;
    max-height:calc(var(--es-ai-vh) - 110px)!important;
    border-radius:16px!important;
  }
  .es-ai-badge{display:none!important}
}

/* Mobile: panel occupies available viewport without covering browser UI. */
@media (max-width:600px){
  .es-ai-panel{
    left:max(10px, env(safe-area-inset-left, 0px))!important;
    right:max(10px, env(safe-area-inset-right, 0px))!important;
    bottom:calc(max(10px, env(safe-area-inset-bottom, 0px)) + 70px)!important;
    width:auto!important;
    max-width:none!important;
    height:min(500px, calc(var(--es-ai-vh) - 100px))!important;
    max-height:calc(var(--es-ai-vh) - 100px)!important;
    border-radius:15px!important;
  }
  .es-ai-launcher{width:56px!important;height:56px!important;min-width:56px!important;min-height:56px!important}
  .es-ai-head{min-height:62px!important;padding:12px 13px!important}
  .es-ai-mark{width:34px!important;height:34px!important}
  .es-ai-messages{padding:12px 11px 6px!important}
  .es-ai-quick{padding:0 11px 8px!important}
  .es-ai-actions{padding:0 11px 9px!important}
  .es-ai-compose{padding:8px!important}
  .es-ai-bubble{max-width:92%!important;font-size:13px!important}
  .es-ai-note{font-size:9px!important}
  .es-ai-lead{inset:62px 0 0!important}
  .es-ai-lead-body{padding:12px 13px!important}
}

/* Short screens / landscape phones / browser toolbars expanded. */
@media (max-height:620px){
  .es-ai-panel{
    height:calc(var(--es-ai-vh) - 92px)!important;
    max-height:calc(var(--es-ai-vh) - 92px)!important;
    bottom:calc(max(8px, env(safe-area-inset-bottom, 0px)) + 66px)!important;
  }
  .es-ai-head{min-height:58px!important;padding:10px 12px!important}
  .es-ai-messages{padding-top:10px!important}
  .es-ai-lead{inset:58px 0 0!important}
}

/* When the virtual keyboard leaves very little height, prioritize input. */
.es-ai-chat.es-ai-compact-height .es-ai-panel{
  height:calc(var(--es-ai-vh) - 82px)!important;
  max-height:calc(var(--es-ai-vh) - 82px)!important;
  bottom:72px!important;
}
.es-ai-chat.es-ai-compact-height .es-ai-character-figure{display:none!important}

@supports (height:100dvh){
  :root{--es-ai-vh:100dvh;--es-ai-vw:100dvw}
}

@media (prefers-reduced-motion:reduce){
  .es-ai-panel,.es-ai-character-figure,.es-ai-launcher{transition:none!important;animation:none!important}
}

/* =========================================================
   V106 — final desktop visual refinement
   Keep V105 responsive behavior; reduce visual dominance on wide screens.
   ========================================================= */
@media (min-width:1440px){
  .es-ai-character-figure{
    right:max(8px, env(safe-area-inset-right, 0px))!important;
    width:118px!important;
    height:330px!important;
    bottom:calc(var(--es-ai-safe-bottom) + 78px)!important;
    border-radius:16px!important;
  }
  .es-ai-panel{
    right:calc(var(--es-ai-safe-right) + 126px)!important;
    bottom:calc(var(--es-ai-safe-bottom) + 78px)!important;
    width:336px!important;
    height:472px!important;
  }
  .es-ai-launcher{
    width:62px!important;
    height:62px!important;
    min-width:62px!important;
    min-height:62px!important;
  }
  .es-ai-badge{
    right:72px!important;
    max-width:158px!important;
  }
}
