/* ── Root & z-index ── */
#poco-chat-root{position:fixed;bottom:84px;right:24px;z-index:99999;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;}

#poco-chat-nudge{
  position:absolute;right:0;bottom:72px;
  min-width:188px;max-width:240px;padding:12px 16px;
  border:0;border-radius:16px 16px 6px 16px;
  background:#fff;color:#111;cursor:pointer;
  font-size:15px;font-weight:600;line-height:1.45;letter-spacing:.01em;text-align:left;
  text-transform:none;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  opacity:0;transform:translateY(10px) scale(.96);pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}
#poco-chat-nudge::after{
  content:"";
  position:absolute;right:20px;bottom:-8px;
  width:16px;height:16px;background:#fff;
  transform:rotate(45deg);border-radius:3px;
}
#poco-chat-nudge.poco-show{
  opacity:1;transform:translateY(0) scale(1);pointer-events:auto;
}
#poco-chat-nudge[hidden]{display:none!important;}

/* ── Trigger button ── */
#poco-chat-btn{
  width:58px;height:58px;border-radius:50%;background:#111;color:#fff;
  border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 18px rgba(0,0,0,.35);transition:transform .15s,box-shadow .15s;
  position:relative;
}
#poco-chat-btn:hover{transform:scale(1.07);box-shadow:0 6px 24px rgba(0,0,0,.45);}
#poco-chat-btn:active{transform:scale(.96);}

/* ── Jenn animated avatar ── */
.maya-anim-wrap{
  width:38px;height:38px;border-radius:50%;overflow:hidden;
  flex-shrink:0;background:#f5e6d3;
}
.maya-anim-wrap img{
  width:100%;height:100%;
  object-fit:cover;
  object-position:50% 22%;
  border-radius:50%;
  display:block;
}
#poco-chat-btn .maya-anim-wrap{animation:maya-float 3.2s ease-in-out infinite;}
@keyframes maya-float{
  0%,100%{transform:translateY(0) scale(1);}
  50%{transform:translateY(-4px) scale(1.04);}
}
#poco-chat-btn::before{
  content:'👋';
  position:absolute;top:-6px;right:-8px;
  font-size:19px;line-height:1;
  transform-origin:bottom left;
  opacity:0;
  animation:maya-wave-hi 7s ease-in-out infinite;
  pointer-events:none;
  text-transform:none;
  letter-spacing:0;
}
@keyframes maya-wave-hi{
  0%,55%,100%{opacity:0;transform:scale(0) rotate(0deg);}
  60%{opacity:1;transform:scale(1.1) rotate(-22deg);}
  65%{transform:scale(1) rotate(18deg);}
  70%{transform:scale(1) rotate(-14deg);}
  75%{transform:scale(1) rotate(16deg);}
  82%{opacity:1;transform:scale(1) rotate(0deg);}
  92%{opacity:0;transform:scale(0.7) rotate(0deg);}
}
#poco-chat-btn::after{
  content:'✨';
  position:absolute;bottom:-4px;left:-4px;
  font-size:15px;line-height:1;
  opacity:0;
  animation:maya-sparkle 7s ease-in-out infinite 3.5s;
  pointer-events:none;
}
@keyframes maya-sparkle{
  0%,60%,100%{opacity:0;transform:scale(0) rotate(-20deg);}
  65%{opacity:1;transform:scale(1.3) rotate(10deg);}
  78%{opacity:1;transform:scale(1) rotate(0deg);}
  90%{opacity:0;transform:scale(0.5);}
}

/* ── Chat panel ── */
#poco-chat-panel{
  position:absolute;bottom:70px;right:0;
  width:360px;max-height:520px;
  background:#fff;border-radius:18px;
  box-shadow:0 8px 40px rgba(0,0,0,.22);
  display:flex;flex-direction:column;overflow:hidden;
  transform:scale(.92) translateY(12px);opacity:0;pointer-events:none;
  transition:transform .2s cubic-bezier(.34,1.56,.64,1),opacity .18s ease;
  transform-origin:bottom right;
}
#poco-chat-panel.poco-open{transform:scale(1) translateY(0);opacity:1;pointer-events:all;}

/* ── Header ── */
#poco-chat-header{
  display:flex;align-items:center;gap:10px;
  padding:14px 54px 14px 16px;background:#111;color:#fff;flex-shrink:0;
  position:relative;
}
#poco-chat-avatar{
  width:38px;height:38px;border-radius:50%;background:#fff;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;overflow:hidden;
}
#poco-chat-header-text{flex:1;min-width:0;}
#poco-chat-name{font-weight:700;font-size:15px;line-height:1.2;}
#poco-chat-status{font-size:11px;opacity:.65;margin-top:1px;}
#poco-chat-close{
  position:absolute;top:10px;right:10px;z-index:4;
  width:34px;height:34px;border-radius:999px;
  background:rgba(255,255,255,.08);border:none;color:#fff;font-size:24px;line-height:1;
  cursor:pointer;padding:0;opacity:.92;transition:opacity .12s,background .12s;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
#poco-chat-close:hover{opacity:1;background:rgba(255,255,255,.16);}

/* ── Messages ── */
#poco-chat-messages{
  flex:1;overflow-y:auto;padding:14px 14px 8px;
  display:flex;flex-direction:column;gap:10px;
  scroll-behavior:smooth;
}
.poco-msg{display:flex;max-width:88%;}
.poco-msg-ai{align-self:flex-start;}
.poco-msg-user{align-self:flex-end;flex-direction:row-reverse;}
.poco-msg-bubble{
  padding:9px 13px;border-radius:16px;font-size:13.5px;line-height:1.5;
  white-space:pre-wrap;word-break:break-word;
}
.poco-msg-ai .poco-msg-bubble{background:#f1f1f1;color:#111;border-bottom-left-radius:4px;}
.poco-msg-user .poco-msg-bubble{background:#111;color:#fff;border-bottom-right-radius:4px;}
.poco-msg-bubble .poco-link{color:#111;font-weight:700;text-decoration:underline;text-underline-offset:2px;}
.poco-msg-bubble .poco-link:hover{opacity:.75;}
.poco-msg-bubble .poco-bullet{font-size:11px;margin-right:2px;}

/* ── Suggestion chips ── */
#poco-chat-chips{display:flex;flex-wrap:wrap;gap:6px;padding:4px 0 2px;}
.poco-chip{
  background:#f4f4f4;border:1px solid #e0e0e0;color:#333;
  border-radius:999px;padding:5px 11px;font-size:12px;cursor:pointer;
  transition:background .12s,border-color .12s;line-height:1.3;
}
.poco-chip:hover{background:#ebebeb;border-color:#ccc;}

/* ── Typing indicator ── */
#poco-chat-typing{padding:8px 16px;display:flex;align-items:center;gap:4px;flex-shrink:0;}
#poco-chat-typing[hidden]{display:none!important;}
#poco-chat-typing span{width:7px;height:7px;border-radius:50%;background:#bbb;animation:poco-bounce .9s infinite;}
#poco-chat-typing span:nth-child(2){animation-delay:.18s;}
#poco-chat-typing span:nth-child(3){animation-delay:.36s;}
@keyframes poco-bounce{0%,60%,100%{transform:translateY(0);}30%{transform:translateY(-5px);}}

/* ── Input bar ── */
#poco-chat-input-bar{
  display:flex;align-items:center;gap:8px;
  padding:10px 12px;border-top:1px solid #f0f0f0;flex-shrink:0;background:#fff;
}
#poco-chat-input{
  flex:1;border:1px solid #e0e0e0;border-radius:999px;
  padding:8px 14px;font-size:13.5px;outline:none;background:#f8f8f8;color:#111;
  transition:border-color .15s,box-shadow .15s;
}
#poco-chat-input:focus{border-color:#999;box-shadow:0 0 0 3px rgba(0,0,0,.06);background:#fff;}
#poco-chat-input::placeholder{color:#aaa;}
#poco-chat-send{
  width:36px;height:36px;border-radius:50%;background:#111;color:#fff;
  border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:background .12s,transform .12s;flex-shrink:0;
}
#poco-chat-send:disabled{background:#ccc;cursor:default;}
#poco-chat-send:not(:disabled):hover{background:#333;transform:scale(1.07);}

/* ── Mobile ── */
@media(max-width:480px){
  #poco-chat-panel{width:calc(100vw - 24px);right:-12px;bottom:64px;max-height:calc(100dvh - 290px);border-radius:14px;}
  #poco-chat-root{bottom:102px;right:16px;}
  #poco-chat-nudge{min-width:176px;max-width:220px;bottom:74px;padding:11px 15px;font-size:14.5px;line-height:1.4;}
  #poco-chat-close{top:9px;right:9px;}
}
