:root {
  --bg: #0f1419;
  --card: #1a222c;
  --text: #eef3f8;
  --muted: #8b9aab;
  --line: #2a3644;
  --acc: #3d9cf0;
  --ok: #3cb371;
  --warn: #e2a336;
  --danger: #e35d5d;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.top { display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px; position: sticky; top: 0;
  background: rgba(15,20,25,.92); backdrop-filter: blur(10px); z-index: 5; }
.brand { font-weight: 700; font-size: 1.15rem; }
.top-actions { display: flex; gap: 8px; }
main { padding: 0 16px 32px; max-width: 860px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0; }
h1, h2 { margin: 0 0 10px; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: .9rem; }
.err { color: var(--danger); }
.grid.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.15rem; margin-top: 2px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge.live { background: #1d3b2a; color: #7ee0a8; }
.badge.pause { background: #3b3218; color: #f0c878; }
.badge.dead { background: #3b1d1d; color: #f0a0a0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
button, .ghost { appearance: none; border: 0; border-radius: 10px; padding: 10px 14px;
  font: inherit; font-weight: 600; background: #2a3b50; color: var(--text); cursor: pointer; text-decoration: none; }
button.ok { background: #215c3a; }
button.warn { background: #5c4a1f; }
button.danger { background: #6b2a2a; }
button.ghost, a.ghost { background: transparent; border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); }
.login-card input { width: 100%; margin: 6px 0 14px; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #11181f; color: var(--text); font: inherit; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td.pos { color: var(--ok); } td.neg { color: var(--danger); }
.log { max-height: 280px; overflow: auto; background: #11181f; border-radius: 8px;
  padding: 10px; font-size: .75rem; white-space: pre-wrap; word-break: break-word; }
.hint { margin-top: 18px; }
@media (max-width: 520px) {
  .grid.stats { grid-template-columns: 1fr 1fr; }
  button { flex: 1 1 calc(50% - 8px); }
}
