:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #21262d;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --badge-bg: #1f6feb33;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.15rem; margin: 0; }

.live-dot {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.container { max-width: 1500px; margin: 0 auto; padding: 1.5rem 2rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.card h2 { font-size: 0.95rem; margin: 0 0 0.75rem; color: var(--text); }

.stat { text-align: center; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--accent); }
.stat-value.small { font-size: 0.95rem; font-weight: 600; }

.columns { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; white-space: nowrap; }
.muted { color: var(--text-dim); }

.badge {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--accent);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

code, .payload, .feed-json {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.payload, .feed-json {
  display: block;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-scroll { max-height: 560px; overflow-y: auto; }

.feed-list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }
.feed-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.feed-list .feed-json { flex: 1; }

.footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .container { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .columns { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 1rem; }
}
