:root{
  --bg:#070707; --panel:#0f0f10; --host-bubble:#3b0f0f; --guest-bubble:#141414;
  --accent:#e03b3b; --muted:#9b9b9b; --text:#eee; --glass:rgba(255,255,255,0.03);
  --radius:14px; --max-width:980px; --font:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial;
}
*{box-sizing:border-box} html,body{height:100%}
body{
  margin:0; background:linear-gradient(180deg,#000,#070707 60%); color:var(--text);
  font-family:var(--font); display:flex; align-items:center; justify-content:center; padding:18px;
  min-height:100vh;
}
.app{
  width:100%; max-width:var(--max-width); height:calc(100vh - 36px);
  display:flex; flex-direction:column; background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:12px; box-shadow:0 12px 40px rgba(0,0,0,0.7); overflow:hidden; border:1px solid rgba(255,255,255,0.03);
}
.topbar{
  display:flex; align-items:center; justify-content:space-between; padding:12px 16px; gap:12px;
  border-bottom:1px solid rgba(255,255,255,0.02);
}
.topbar-left{display:flex;align-items:center;gap:12px}
.avatar-wrap{width:48px;height:48px;border-radius:50%;overflow:hidden;border:2px solid rgba(224,59,59,0.14)}
.avatar-wrap img{width:100%;height:100%;object-fit:cover;display:block}
.title{font-weight:800;font-size:16px;color:var(--text)}
.subtitle{font-size:12px;color:var(--muted)}
.loc{font-size:13px;color:var(--muted);background:var(--glass);padding:6px 10px;border-radius:999px}

/* chooser */
.chooser{padding:14px}
.chooser-intro h2{margin:0 0 6px 0;font-size:18px}
.emoji{margin-left:8px}
.muted{color:var(--muted);font-size:13px}

/* horizontal row */
.agents-row{
  display:flex; gap:12px; overflow-x:auto; padding:12px 6px; scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}
.agent{
  flex:0 0 46%; max-width:240px; min-width:160px;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.01));
  border-radius:12px; padding:10px; border:1px solid rgba(255,255,255,0.02); cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease; scroll-snap-align:center; display:flex; flex-direction:column; gap:8px;
}
.agent.disabled{filter:blur(6px) grayscale(.25);opacity:.75; pointer-events:none}
.agent:hover{transform:translateY(-6px);box-shadow:0 12px 32px rgba(224,59,59,0.06)}
.agent .thumb{width:100%;height:160px;border-radius:10px;overflow:hidden;background:#111}
.agent .thumb img{width:100%;height:100%;object-fit:cover}
.agent .meta{margin-top:6px;display:flex;align-items:center;justify-content:space-between}
.agent .name{font-weight:900;color:#fff;font-size:18px}
.agent .dist{font-weight:800;color:var(--accent);font-size:14px}
.agent.more{text-align:center;align-items:center;justify-content:center}

/* chat */
.chat-wrap{flex:1;display:flex;flex-direction:column;padding:12px 16px;gap:10px;min-height:0}
.messages{flex:1;overflow:auto;padding-right:8px;display:flex;flex-direction:column;gap:10px}
.message{max-width:78%;padding:10px 12px;border-radius:12px;position:relative;box-shadow:0 6px 18px rgba(0,0,0,0.6)}
.message .time{display:block;font-size:11px;color:var(--muted);margin-top:8px;text-align:right}
.left{align-self:flex-start;background:var(--host-bubble);color:#ffefef;border-top-left-radius:6px}
.right{align-self:flex-end;background:var(--guest-bubble);color:var(--text);border-top-right-radius:6px}
.img-msg img{max-width:420px;border-radius:10px;display:block}
.vid-msg video{max-width:420px;border-radius:10px;display:block}

/* typing */
.typing{width:72px;height:40px;border-radius:20px;background:rgba(0,0,0,0.08);display:flex;align-items:center;gap:6px;padding:6px 10px;}
.dot{width:8px;height:8px;border-radius:50%;background:var(--accent);opacity:0;animation:blip 1s infinite}
.dot:nth-child(2){animation-delay:.15s}
.dot:nth-child(3){animation-delay:.30s}
@keyframes blip{0%{transform:translateY(0);opacity:0}40%{opacity:1;transform:translateY(-6px)}to{opacity:0;transform:translateY(0)}}

/* input row & quick chips */
.input-row{display:flex;gap:8px;padding:8px 0}
.input-row input{flex:1;padding:10px;border-radius:10px;border:1px solid rgba(255,255,255,0.04);background:rgba(255,255,255,0.02);color:var(--text);font-weight:700}
.quick-chips{display:flex;gap:8px;margin-top:8px}
.chip{padding:8px 12px;border-radius:999px;background:rgba(255,255,255,0.02);border:1px solid rgba(255,255,255,0.03);cursor:pointer;font-weight:800}

/* buttons */
.btn{padding:8px 12px;border-radius:10px;border:none;cursor:pointer;font-weight:800}
.btn.primary{background:var(--accent);color:#fff}
.btn.ghost{background:transparent;color:var(--muted);border:1px solid rgba(255,255,255,0.02)}

/* footer */
.footer{padding:10px 16px;border-top:1px solid rgba(255,255,255,0.02);display:flex;align-items:center;justify-content:space-between;gap:12px}
.hint{font-size:13px;color:var(--muted)}

@media (max-width:640px){
  .agent{flex:0 0 72%}
  .agent .thumb{height:200px}
  .agent .name{font-size:20px}
}
.hidden{display:none}
