/* Chat Kite Styles - match the provided blue theme, responsive */
:root{
  --blue:#1da1f2;
  --blue-dark:#0b8dd6;
  --bg:#f1f7fb;
  --bubble:#eaeff3;
  --white:#fff;
  --green:#21c55d;
  --red:#ef4444;
  --text:#0f172a;
  --muted:#64748b;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,'Noto Sans',sans-serif;background:var(--bg);color:var(--text)}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; background:var(--blue); color:white;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.topbar .brand{display:flex; align-items:center; gap:12px}
.avatar-circle{width:36px;height:36px;border-radius:999px;background:rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;font-weight:700}
.peer .name{font-weight:700;line-height:1}
.presence{display:flex;align-items:center;gap:6px;font-size:12px;color:#e6f6ff}
.dot{width:10px;height:10px;border-radius:999px;display:inline-block;background:var(--red)}
.dot.online{background:var(--green)}
.dot.offline{background:var(--red)}
.pill{background:#fff;color:var(--blue);border:none;border-radius:999px;padding:6px 12px;font-weight:600;cursor:pointer}
.pill-outline{background:transparent;border:1.5px solid #fff;color:#fff}

/* Login page */
.login-page .topbar{justify-content:center}
.login-card{max-width:520px;margin:28px auto;background:#fff;border-radius:16px;padding:24px 20px;box-shadow:0 10px 20px rgba(2,6,23,.08)}
.login-card h1{font-size:32px;margin:0 0 16px}
.form{display:flex;flex-direction:column;gap:10px}
.form label{font-size:14px;color:var(--muted)}
.form input{padding:12px 14px;border-radius:10px;border:1px solid #dbe3eb;outline:none}
.btn-primary{margin-top:8px;background:var(--blue);border:none;border-radius:12px;color:#fff;padding:12px 14px;font-weight:700;cursor:pointer}
.alert{background:#fee2e2;color:#991b1b;padding:10px;border-radius:8px;margin-bottom:10px}
.hint{margin-top:12px;color:var(--muted);font-size:14px}

/* Chat area */
.chat-wrap{height:calc(100vh - 56px);display:flex;flex-direction:column}
.messages{flex:1;overflow-y:auto;padding:16px 12px 90px;display:flex;flex-direction:column;gap:8px}
.msg{max-width:78%;padding:10px 12px;border-radius:16px;box-shadow:0 2px 4px rgba(2,6,23,.04);display:inline-block;position:relative}
.msg .meta{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin-top:6px;justify-content:flex-end}
.msg.me{align-self:flex-end;background:var(--blue);color:#fff;border-bottom-right-radius:6px}
.msg.you{align-self:flex-start;background:#fff;border-bottom-left-radius:6px}
.tick{font-weight:900;letter-spacing:-1px}
.tick.double::after{content:'✓✓'}
.tick.single::after{content:'✓'}

/* Date separator */
.sep{align-self:center;background:#e9f5ff;color:#0369a1;padding:4px 10px;border-radius:999px;font-size:12px;margin:12px 0}

/* Composer */
.composer{position:fixed;left:0;right:0;bottom:0;background:#fff;padding:10px 10px;display:flex;gap:8px;align-items:center;border-top:1px solid #e5e7eb}
#msg-input{flex:1;padding:12px;border-radius:999px;border:1px solid #dbe3eb;outline:none}
.send-btn{background:var(--blue);border:none;color:#fff;font-weight:900;border-radius:999px;width:44px;height:44px;cursor:pointer}
.emoji-btn{background:#fff;border:1px solid #dbe3eb;border-radius:999px;width:40px;height:40px;cursor:pointer}

/* Emoji Panel */
.emoji-panel{position:fixed;bottom:70px;left:10px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:8px;display:grid;grid-template-columns:repeat(8, 1fr);gap:4px;box-shadow:0 8px 24px rgba(0,0,0,.08)}
.emoji-panel.hidden{display:none}
.emoji-item{font-size:20px;background:#fff;border:none;cursor:pointer;padding:6px;border-radius:8px}
.emoji-item:hover{background:#f1f5f9}

/* Responsive */
@media (max-width:640px){
  .msg{max-width:88%}
}

