:root {
  --bg: #0f1117;
  --card: #181b22;
  --muted: #9ca3af;
  --text: #f3f4f6;
  --accent: #7c3aed;
  --accent-2: #a855f7;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --border: #2a2f3a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:16px 24px; border-bottom:1px solid var(--border); background:#12151d; }
.topbar a { color:var(--text); text-decoration:none; margin-left:16px; }
.brand { font-weight:700; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.card { background: var(--card); border:1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.narrow { max-width: 480px; margin: 48px auto; }
.grid { display:grid; gap:20px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.streamer-layout { grid-template-columns: 2fr 1fr; align-items:start; }
.page-head { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:20px; }
.form-grid { display:grid; gap:14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display:grid; gap:8px; color:var(--muted); }
input, select, textarea { width:100%; border-radius:12px; border:1px solid var(--border); background:#0d1016; color:var(--text); padding:12px; }
button, .button { display:inline-block; padding:12px 16px; border-radius:12px; border:none; background:linear-gradient(135deg, var(--accent), var(--accent-2)); color:white; text-decoration:none; cursor:pointer; }
button.secondary, .button.secondary { background:#232835; }
.actions { display:flex; flex-wrap:wrap; gap:10px; }
.badge { padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.badge.live { background:rgba(16,185,129,.15); color:#34d399; }
.badge.off { background:rgba(239,68,68,.15); color:#f87171; }
.status-row { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.video { width:100%; border-radius:14px; background:#000; min-height:300px; }
.chatframe { width:100%; height:340px; border:1px solid var(--border); border-radius:14px; background:#0d1016; }
.chatframe.tall { height:620px; }
.flash { padding:12px 14px; border-radius:12px; margin-bottom:16px; }
.flash.success { background:rgba(16,185,129,.12); }
.flash.error { background:rgba(239,68,68,.12); }
.small { color:var(--muted); font-size:13px; }
.warn { color: var(--warn); font-weight:700; }
.loglist { max-height:340px; overflow:auto; display:grid; gap:8px; }
.log { padding:10px; background:#11151c; border-radius:10px; border:1px solid var(--border); font-size:14px; }
.stats-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:12px; margin-top:14px; }
.codebox { margin-top:16px; display:grid; gap:10px; }
code { display:block; overflow-wrap:anywhere; padding:10px; background:#0d1016; border-radius:10px; border:1px solid var(--border); color:#d1d5db; }
.check { display:flex; align-items:center; gap:10px; }
@media (max-width: 900px) {
  .streamer-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
.page-header {
.stream-card-head,
.actions-inline,
.stream-actions {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.75rem;
}

.stream-meta,
.kv-list {
  display:grid;
  gap:.4rem;
  margin:1rem 0;
}

.two-col,
.streamer-layout {
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:1rem;
  margin-bottom:1rem;
}

.badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.35rem .75rem;
  border-radius:999px;
  font-weight:700;
}

.badge.live {
  background:#183d27;
  color:#8df0a9;
}

.badge.offline {
  background:#3c1d24;
  color:#ff9db2;
}

.preset {
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:1rem;
  margin-bottom:1rem;
}

.muted {
  opacity:.75;
  font-size:.92rem;
}

input[readonly] {
  width:100%;
  margin:.35rem 0 .85rem;
}

pre {
  white-space:pre-wrap;
  word-break:break-word;
}

@media (max-width: 900px) {
  .two-col,
  .streamer-layout,
  .page-header,
  .stream-card-head,
  .stream-actions,
  .actions-inline {
    grid-template-columns:1fr;
    display:grid;
  }
}
