:root{
  --primary:#0066ff;
  --bg:#f4f6fb;
  --card:#ffffff;
  --muted:#65748b;
  --radius:14px;
  --maxw:360px;
}

*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;}
.chat-root{
  width:100%;
  max-width:var(--maxw);
  height:100vh;
  max-height:640px;
  display:flex;flex-direction:column;
  background:linear-gradient(180deg,var(--bg),#fff 60%);
  padding:12px;
  gap:10px;
}

/* Header */
.chat-header{
  display:flex;align-items:center;justify-content:space-between;
  background:var(--card);padding:10px;border-radius:12px;box-shadow:0 6px 20px rgba(12,18,25,0.06);
}
.brand{display:flex;gap:10px;align-items:center}
.logo{width:44px;height:44px;border-radius:8px;background:linear-gradient(45deg,var(--primary),#2db8ff)}
.brand-text .title{font-weight:600}
.brand-text .subtitle{font-size:12px;color:var(--muted)}

/* Messages */
.messages{flex:1;overflow:auto;padding:10px;display:flex;flex-direction:column;gap:8px}
.msg{max-width:86%;padding:10px 12px;border-radius:12px;line-height:1.35;box-shadow:0 4px 10px rgba(12,18,25,0.04)}
.msg.bot{align-self:flex-start;background:var(--card);border-top-left-radius:6px}
.msg.user{align-self:flex-end;background:linear-gradient(90deg,var(--primary),#2db8ff);color:white;border-top-right-radius:6px}
.msg .meta{font-size:11px;color:var(--muted);margin-bottom:6px}

/* quick replies */
.quick-replies{display:flex;gap:8px;padding:6px 2px;flex-wrap:wrap}
.quick-btn{background:#eef4ff;border-radius:999px;padding:6px 10px;font-size:13px;cursor:pointer;border:none}

/* composer */
.composer{display:flex;flex-direction:column;gap:8px}
.chat-form{display:flex;gap:8px;align-items:center}
.chat-form input{flex:1;padding:10px;border-radius:999px;border:1px solid #e6ecff;background:white;outline:none}
.chat-form button{background:var(--primary);color:white;border:none;padding:10px 12px;border-radius:999px;cursor:pointer;font-size:16px}

/* typing indicator */
.typing{height:18px;display:flex;gap:6px;align-items:center}
.typing span{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--muted);opacity:0.2;animation:blink 1s infinite}
.typing span:nth-child(2){animation-delay:.15s}
.typing span:nth-child(3){animation-delay:.3s}
@keyframes blink{50%{opacity:1;transform:translateY(-4px)}}

/* small screens adjust */
@media (max-width:420px){
  :root{--maxw:100%}
  .chat-root{padding:8px}
}
