/* Engine SEO Agent — Chatbot */
#esa-chat-launcher{position:fixed;bottom:20px;right:20px;z-index:99998;display:flex;align-items:center;gap:8px;background:linear-gradient(180deg,#16a34a,#15803d);color:#fff;font-weight:700;padding:12px 18px;border-radius:50px;cursor:pointer;box-shadow:0 6px 18px rgba(21,128,61,.4);font-family:inherit;transition:transform .16s cubic-bezier(.23,1,.32,1),box-shadow .16s ease}
#esa-chat-launcher:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(21,128,61,.5)}
#esa-chat-launcher:active{transform:scale(.97)}
.esa-chat-ico{font-size:1.2em}

/* Panneau : masqué par défaut, affiché via la classe .esa-open (robuste face aux thèmes) */
#esa-chat-panel{display:none}
#esa-chat-panel.esa-open{display:flex}
#esa-chat-panel[hidden]{display:none !important}
#esa-chat-panel{position:fixed;bottom:20px;right:20px;z-index:99999;width:360px;max-width:calc(100vw - 32px);height:520px;max-height:calc(100vh - 40px);background:#fff;border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.25);flex-direction:column;overflow:hidden;font-family:inherit;animation:esa-pop .2s cubic-bezier(.23,1,.32,1)}
@keyframes esa-pop{from{opacity:0;transform:scale(.96) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}
.esa-chat-header{background:linear-gradient(180deg,#16a34a,#15803d);color:#fff;padding:14px 16px;font-weight:700;display:flex;justify-content:space-between;align-items:center}
#esa-chat-close{background:rgba(255,255,255,.15);border:none;color:#fff;font-size:1.4em;line-height:1;cursor:pointer;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:0 0 auto;transition:background .16s ease}
#esa-chat-close:hover{background:rgba(255,255,255,.28)}
#esa-chat-close:active{transform:scale(.92)}
#esa-chat-body{flex:1;overflow-y:auto;padding:16px;background:#f8fafc;display:flex;flex-direction:column;gap:10px}
.esa-msg{max-width:85%;padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.45}
.esa-msg.bot{background:#fff;border:1px solid #e2e8f0;align-self:flex-start;border-bottom-left-radius:4px}
.esa-msg.user{background:#15803d;color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.esa-result{display:block;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px;margin-top:6px;text-decoration:none;color:#0f172a;transition:border-color .16s ease,box-shadow .16s ease}
.esa-result:hover{border-color:#16a34a;box-shadow:0 2px 10px rgba(21,128,61,.15)}
.esa-result strong{display:block;font-size:13.5px;color:#0f172a}
.esa-result .esa-meta{font-size:12px;color:#64748b;margin-top:2px}
.esa-result .esa-price{color:#15803d;font-weight:700}
#esa-chat-form{display:flex;gap:8px;padding:12px;border-top:1px solid #e2e8f0;background:#fff}
#esa-chat-input{flex:1;border:1px solid #cbd5e1;border-radius:10px;padding:10px 12px;font-size:16px;outline:none;font-family:inherit;min-width:0}
#esa-chat-input:focus{border-color:#16a34a;box-shadow:0 0 0 3px rgba(22,163,74,.15)}
#esa-chat-form button{background:linear-gradient(180deg,#16a34a,#15803d);color:#fff;border:none;border-radius:10px;padding:10px 16px;font-weight:700;cursor:pointer;font-family:inherit;transition:transform .16s ease;flex:0 0 auto}
#esa-chat-form button:active{transform:scale(.97)}
.esa-typing{font-style:italic;color:#94a3b8;font-size:13px}

/* --- Mobile : panneau compact ancré en bas, ne prend plus tout l'écran --- */
@media (max-width:600px){
  #esa-chat-launcher{bottom:16px;right:16px;padding:10px 16px}
  #esa-chat-panel{
    left:10px;right:10px;bottom:10px;top:auto;
    width:auto;max-width:none;
    height:auto;max-height:60vh;          /* encore plus compact : 60% de l'écran max */
    border-radius:16px;
  }
  #esa-chat-body{
    min-height:90px;                     /* hauteur mini réduite */
    max-height:calc(60vh - 120px);       /* le corps s'adapte au contenu */
    flex:0 1 auto;
    padding:12px;
  }
  .esa-chat-header{padding:11px 14px}   /* en-tête plus fin */
  #esa-chat-form{padding:10px}
  #esa-chat-close{width:38px;height:38px;font-size:1.5em} /* zone tactile plus large */
}
