:root{
  --bg:#071022; --bg2:#070b14; --card:rgba(16,26,47,.95);
  --line:rgba(255,255,255,.08); --text:#e9eef8; --muted:#b8c4de;
  --ok:#1fbf75; --bad:#ff4d4f;
  --radius:16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
*{box-sizing:border-box}
body{
  margin:0; font-family:var(--sans);
  background:linear-gradient(180deg,var(--bg) 0%, var(--bg2) 100%);
  color:var(--text);
}
.wrap{max-width:1100px; margin:0 auto; padding:18px 14px 40px;}
.top{display:flex; align-items:center; justify-content:space-between; gap:12px;}
h1{margin:6px 0 4px; font-size:20px; font-weight:800; letter-spacing:.2px;}
.sub{color:var(--muted); font-size:13px;}
.badge{
  padding:8px 10px; border:1px solid var(--line); border-radius:999px;
  font-size:12px; background:rgba(255,255,255,.04);
}
.card{
  background:linear-gradient(180deg, rgba(16,26,47,.95), rgba(15,23,42,.92));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 10px 30px rgba(0,0,0,.35);
  padding:14px;
  margin-top:12px;
}
.row{display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:10px;}
label{color:var(--muted); font-size:12px;}
input{
  flex:1; min-width:180px;
  padding:10px 12px; border-radius:12px; border:1px solid var(--line);
  background:rgba(0,0,0,.25); color:var(--text);
}
button{
  padding:10px 12px; border-radius:12px; border:1px solid var(--line);
  background:rgba(255,255,255,.06); color:var(--text);
  cursor:pointer; font-weight:700;
}
button.primary{background:rgba(31,191,117,.18); border-color:rgba(31,191,117,.35);}
button.ghost{background:transparent;}
button:disabled{opacity:.5; cursor:not-allowed;}
.hint{color:var(--muted); font-size:12px;}
.status{
  margin-top:10px; padding:10px 12px; border-radius:12px;
  border:1px dashed var(--line); color:var(--muted); font-size:13px;
}
.grid{display:grid; grid-template-columns:1.1fr .9fr; gap:12px;}
@media (max-width: 980px){ .grid{grid-template-columns:1fr;} }
video{
  width:100%; max-height:420px; border-radius:14px;
  background:rgba(0,0,0,.35); border:1px solid var(--line);
}
.remoteGrid{
  display:grid; gap:10px;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
}
.remoteCard{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:rgba(0,0,0,.22);
}
.remoteName{font-size:12px; color:var(--muted); margin:0 0 6px;}
.debug pre{
  margin:0;
  font-family:var(--mono);
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:240px;
  overflow:auto;
}
