:root{
  --bg:#0b0f17;
  --panel:#111827;
  --panel2:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:#1f2937;
  --accent:#60a5fa;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 600px at 20% 0%, #111a33, var(--bg));
  color:var(--text);
}

.topbar{
  position:sticky; top:0;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}

.brand{font-weight:700; letter-spacing:.2px}
.status{color:var(--muted); font-size:14px}

.wrap{max-width:920px; margin:0 auto; padding:16px}
.chat{
  min-height:60vh;
  padding:16px;
  background: rgba(17, 24, 39, 0.75);
  border:1px solid var(--border);
  border-radius:16px;
}

.msg{
  display:flex; gap:10px;
  padding:10px 0;
  border-bottom:1px dashed rgba(31,41,55,.5);
}
.msg:last-child{border-bottom:none}

.avatar{
  width:34px; height:34px; border-radius:10px;
  display:grid; place-items:center;
  background: rgba(96,165,250,.12);
  border:1px solid rgba(96,165,250,.25);
  flex:0 0 auto;
}

.bubble{flex:1}
.role{font-size:12px; color:var(--muted); margin-bottom:4px}
.content{white-space:pre-wrap; line-height:1.35}

.composer{
  margin-top:14px;
  padding:14px;
  background: rgba(15, 23, 42, 0.6);
  border:1px solid var(--border);
  border-radius:16px;
}

.tools{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:10px; gap:10px; flex-wrap:wrap;
}

.toggle{display:flex; gap:10px; align-items:center; color:var(--muted); font-size:14px}

.row{display:flex; gap:10px}
.input{
  flex:1;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(17,24,39,.8);
  color:var(--text);
  outline:none;
}
.input:focus{border-color: rgba(96,165,250,.55); box-shadow:0 0 0 3px rgba(96,165,250,.12)}

.btn{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(96,165,250,.35);
  background: rgba(96,165,250,.18);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{background: rgba(96,165,250,.25)}
.btn.ghost{
  border-color: var(--border);
  background: rgba(17,24,39,.45);
  color:var(--muted);
}
.btn.ghost:hover{background: rgba(17,24,39,.7); color:var(--text)}

.hint{margin:10px 2px 0; color:var(--muted); font-size:12px}
code{background: rgba(0,0,0,.25); padding:2px 6px; border-radius:8px}