:root{
  --bg:#0b0f14;
  --panel:#111823;
  --panel2:#0f1520;
  --text:#e8eef7;
  --muted:#94a3b8;
  --ok:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --line:#1f2a3a;
  --btn:#1f2a3a;
  --btn2:#24344a;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(59,130,246,.15), transparent 60%),
              radial-gradient(900px 600px at 80% 30%, rgba(34,197,94,.10), transparent 55%),
              var(--bg);
  color:var(--text);
  font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a{color:#93c5fd; text-decoration:none}
a:hover{text-decoration:underline}
.wrap{
  max-width:980px;
  margin:0 auto;
  padding:24px 16px 60px;
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:700; letter-spacing:.2px;
}
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  color:var(--muted);
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow: var(--shadow);
}
.grid{display:grid; gap:14px}
.grid.two{grid-template-columns: 1fr 1fr}
@media (max-width: 820px){ .grid.two{grid-template-columns:1fr} }
h1,h2,h3{margin:0 0 10px}
h1{font-size:22px}
h2{font-size:18px}
p{margin:10px 0; color:var(--muted)}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
.input:focus{border-color: rgba(147,197,253,.8); box-shadow:0 0 0 3px rgba(59,130,246,.18)}
.row{display:flex; gap:10px}
.row > *{flex:1}
.btn{
  appearance:none;
  border:1px solid var(--line);
  background:linear-gradient(180deg, var(--btn2), var(--btn));
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{filter:brightness(1.08)}
.btn:disabled{opacity:.5; cursor:not-allowed}
.btn.red{background:linear-gradient(180deg, rgba(239,68,68,.28), rgba(239,68,68,.16)); border-color: rgba(239,68,68,.35)}
.btn.green{background:linear-gradient(180deg, rgba(34,197,94,.26), rgba(34,197,94,.14)); border-color: rgba(34,197,94,.35)}
.btn.ghost{background:rgba(255,255,255,.03)}
.small{font-size:13px}
.list{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.02);
}
.name{display:flex; flex-direction:column; gap:2px}
.meta{font-size:12px; color:var(--muted)}
.dot{display:inline-block; width:8px; height:8px; border-radius:999px; margin-right:8px}
.dot.online{background:var(--ok)}
.dot.offline{background:#64748b}
.dot.busy{background:var(--warn)}
.hr{height:1px; background:var(--line); margin:14px 0}
.toast{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
}
.toast.ok{border-color:rgba(34,197,94,.35); color:#bbf7d0}
.toast.bad{border-color:rgba(239,68,68,.35); color:#fecaca}
.modal-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.modal{
  width:min(520px, 100%);
  background:rgba(15,21,32,.98);
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  box-shadow: var(--shadow);
}
.modal h3{margin-bottom:6px}
.modal .actions{display:flex; gap:10px; justify-content:flex-end; margin-top:12px}
.kv{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px dashed rgba(255,255,255,.08)}
.kv:last-child{border-bottom:none}
label{display:block; margin:10px 0 6px; color:var(--muted); font-size:13px}
.gain-scale-simple{
  display:flex;
  justify-content:space-between;
  margin-top:6px;
  font-size:12px;
  opacity:.65;
  font-variant-numeric: tabular-nums;
  user-select:none;
}