/* AI chat widget — site-wide, injected via includes/footer.php.
   Stacked above .whatsapp-fab (bottom:24px, 56px, z-index:900). */

.eb-chat-fab{
  position:fixed; bottom:96px; right:24px; z-index:950; width:56px; height:56px; border-radius:50%;
  background:var(--gradient-accent); color:#fff; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-lg);
  transition:transform .2s var(--ease);
}
.eb-chat-fab:hover{ transform:scale(1.06); }
.eb-chat-fab svg{ width:26px; height:26px; }

.eb-chat-panel{
  position:fixed; bottom:96px; right:24px; z-index:960; width:360px; max-width:calc(100vw - 32px);
  height:520px; max-height:calc(100vh - 140px); background:var(--paper); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-deep); display:flex; flex-direction:column; overflow:hidden;
  font-family:var(--font-body);
}
.eb-chat-panel[hidden]{ display:none; }

.eb-chat-panel__head{
  background:var(--gradient-deep); color:var(--on-deep); padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between; flex:0 0 auto;
}
.eb-chat-panel__title{ font-weight:600; font-size:15px; }
.eb-chat-panel__subtitle{ font-size:12px; color:var(--on-deep-muted); margin-top:2px; }
.eb-chat-panel__actions{ display:flex; gap:8px; }
.eb-chat-panel__actions button{
  background:transparent; border:none; color:var(--on-deep-muted); cursor:pointer; padding:4px;
  display:flex; align-items:center;
}
.eb-chat-panel__actions button:hover{ color:var(--on-deep); }
.eb-chat-panel__actions svg{ width:18px; height:18px; }

.eb-chat-panel__body{
  flex:1 1 auto; overflow-y:auto; padding:14px 12px; display:flex; flex-direction:column; gap:10px;
  background:var(--paper-soft);
}

.eb-chat-msg{ max-width:85%; padding:9px 12px; border-radius:var(--radius-md); font-size:13.5px; line-height:1.55; white-space:pre-wrap; word-break:break-word; }
.eb-chat-msg--user{ align-self:flex-end; background:var(--blue); color:#fff; border-bottom-right-radius:4px; }
.eb-chat-msg--assistant{ align-self:flex-start; background:var(--surface); color:var(--ink); border:1px solid var(--line); border-bottom-left-radius:4px; }
.eb-chat-msg--error{ align-self:flex-start; background:#fdecea; color:#7a2320; border:1px solid #f3c6c2; }

.eb-chat-typing{ align-self:flex-start; display:flex; gap:4px; padding:10px 12px; }
.eb-chat-typing span{ width:6px; height:6px; border-radius:50%; background:var(--text-faint); animation:eb-chat-bounce 1.2s infinite ease-in-out; }
.eb-chat-typing span:nth-child(2){ animation-delay:.15s; }
.eb-chat-typing span:nth-child(3){ animation-delay:.3s; }
@keyframes eb-chat-bounce{ 0%,80%,100%{ transform:translateY(0); opacity:.4; } 40%{ transform:translateY(-4px); opacity:1; } }

.eb-chat-panel__foot{ flex:0 0 auto; border-top:1px solid var(--line); padding:10px; display:flex; gap:8px; background:var(--paper); }
.eb-chat-panel__input{
  flex:1 1 auto; border:1px solid var(--line); border-radius:var(--radius-pill); padding:9px 14px;
  font-size:13.5px; font-family:var(--font-body); resize:none; max-height:80px; outline:none;
}
.eb-chat-panel__input:focus{ border-color:var(--blue); }
.eb-chat-panel__send{
  flex:0 0 auto; width:38px; height:38px; border-radius:50%; border:none; background:var(--blue); color:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.eb-chat-panel__send:disabled{ opacity:.5; cursor:default; }
.eb-chat-panel__send svg{ width:17px; height:17px; }

@media (max-width:480px){
  .eb-chat-panel{ right:16px; left:16px; width:auto; bottom:16px; height:calc(100vh - 96px); }
  /* .whatsapp-fab (theme.css) never got this same right:16px shift, so
     the two stacked buttons sat 8px out of line with each other on
     small screens — keep them on the same vertical axis. */
  .eb-chat-fab, .whatsapp-fab{ right:16px; }
}
