:root{
  --bg:#0b1220;
  --panel:#0f1930;
  --panel2:#111f3b;
  --text:#e6eefc;
  --muted:#9fb3d6;
  --primary:#2196F3;
  --border:rgba(255,255,255,.08);
  --shadow:0 10px 30px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,#070b14 0%, #0b1220 55%, #0b1220 100%);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
.app{min-height:100%; display:flex; flex-direction:column}
.topbar{
  position:sticky; top:0; z-index:10;
  padding:14px 14px calc(14px + env(safe-area-inset-top));
  background:rgba(11,18,32,.78);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.topbar__title{font-weight:700; letter-spacing:.2px}
.icon-btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
}
.main{flex:1; padding:14px; padding-bottom:86px}
.card{
  max-width:560px;
  margin:0 auto;
  background:rgba(17,31,59,.65);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
}
.card__body{padding:14px}
.h1{font-size:18px; margin:0 0 10px 0}
.p{margin:0 0 12px 0; color:var(--muted); line-height:1.35}
.form{display:flex; flex-direction:column; gap:10px}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  outline:none;
}
.btn{
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(33,150,243,.45);
  background:linear-gradient(180deg, rgba(33,150,243,.95) 0%, rgba(33,150,243,.75) 100%);
  color:#fff;
  font-weight:700;
}
.btn:disabled{opacity:.65}
.err{color:#ff9aa2; font-size:13px}

.list{display:flex; flex-direction:column}
.item{
  display:flex; gap:10px;
  padding:12px 14px;
  border-top:1px solid var(--border);
  text-decoration:none;
  color:inherit;
}
.item:first-child{border-top:none}
.avatar{
  width:40px; height:40px;
  border-radius:14px;
  background:rgba(33,150,243,.18);
  border:1px solid rgba(33,150,243,.28);
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
  color:#cfe7ff;
  flex:0 0 auto;
}
.item__main{flex:1; min-width:0}
.item__title{font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.item__subtitle{color:var(--muted); font-size:13px; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.item__meta{color:var(--muted); font-size:12px; flex:0 0 auto}

.chat{
  max-width:720px; margin:0 auto;
  display:flex; flex-direction:column; gap:10px;
}
.bubble{
  max-width:86%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  word-wrap:break-word;
  white-space:pre-wrap;
}
.bubble--me{
  margin-left:auto;
  background:rgba(33,150,243,.22);
  border-color:rgba(33,150,243,.35);
}
.bubble__meta{margin-top:6px; font-size:11px; color:rgba(230,238,252,.7)}

.composer{
  position:fixed;
  left:0; right:0;
  bottom:0;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(11,18,32,.78);
  backdrop-filter: blur(14px);
  border-top:1px solid var(--border);
}
.composer__inner{max-width:720px; margin:0 auto; display:flex; gap:10px}
.composer__input{flex:1}
.composer__send{width:92px}

.bottomnav{
  position:fixed; left:0; right:0;
  bottom:0;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(11,18,32,.78);
  backdrop-filter: blur(14px);
  border-top:1px solid var(--border);
  display:flex; gap:10px; justify-content:center;
}
.tab{
  flex:1;
  max-width:220px;
  text-align:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  text-decoration:none;
}

.skeleton{opacity:.8; animation:pulse 1.2s infinite ease-in-out}
@keyframes pulse{0%,100%{opacity:.55}50%{opacity:1}}
.net{
  width:10px; height:10px; border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  margin-right:10px;
  box-shadow:0 0 0 3px rgba(255,255,255,.04);
}
.net--ok{ background: #24d18a; }
.net--warn{ background: #f7c948; }
.net--bad{ background: #ff6b6b; }