/* Live composer in the homepage demo box (Meow Bot #general only) */

/* The static .chatbox is position:absolute inside the scrolling message list, so it
   anchors to the bottom of the *content*, not the visible frame: it drifts away as
   messages are added and new rows slide underneath it. Sticky pins it to the bottom
   edge of the scroll area instead, which is how a real chat composer behaves. */
.messages:has(.live-composer){padding-bottom:16px;overflow-anchor:none}
.chatbox.live-composer{
  position:sticky;left:auto;right:auto;bottom:0;margin-top:12px;
  display:flex;align-items:center;gap:8px;cursor:text
}
.chatbox.live-composer input{
  flex:1;min-width:0;border:0;background:transparent;outline:none;
  color:#eef0fa;font:inherit;font-size:.68rem;padding:0
}
.chatbox.live-composer input::placeholder{color:#747991}
.chatbox.live-composer:focus-within{
  border-color:rgba(112,180,255,.45);box-shadow:0 0 0 3px rgba(70,228,255,.08)
}

/* Send button, so a tap works on phones whose keyboard has no go key */
.demo-send{
  flex:none;width:24px;height:24px;padding:0;border:0;border-radius:50%;
  background:#5869e9;color:#fff;cursor:pointer;display:grid;place-items:center;
  transition:transform .15s, background .15s
}
.demo-send:hover{background:#6a79f0;transform:scale(1.08)}
.demo-send:focus-visible{outline:2px solid #46e4ff;outline-offset:2px}
.demo-send svg{width:12px;height:12px;fill:currentColor}

/* Running total, sits in the hint line under the messages */
#demo-total{color:#9aa0bb;white-space:pre-wrap}

/* Bot typing dots */
.demo-dots{display:flex;gap:4px;align-items:center;height:18px;margin-top:3px}
.demo-dots i{
  width:5px;height:5px;border-radius:50%;background:#8f93ab;
  animation:demo-bounce 1.1s infinite ease-in-out
}
.demo-dots i:nth-child(2){animation-delay:.15s}
.demo-dots i:nth-child(3){animation-delay:.3s}
@keyframes demo-bounce{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* The count gets a small pop when it lands */
.count-pop{display:inline-block;animation:demo-pop .45s ease-out}
@keyframes demo-pop{0%{transform:scale(1);color:#fff}35%{transform:scale(1.25);color:#7ef0c0}100%{transform:scale(1)}}

@media(prefers-reduced-motion:reduce){
  .demo-dots i,.count-pop{animation:none}
  .demo-send{transition:none}
  .demo-send:hover{transform:none}
}

/* iOS zooms the page when a focused input is under 16px, so bump it on small screens */
@media(max-width:600px){
  .chatbox.live-composer{bottom:0;margin-top:10px}
  .chatbox.live-composer input{font-size:16px}
  .demo-send{width:28px;height:28px}
  .demo-send svg{width:14px;height:14px}
}
