:root {
  --bg: #0c0f14;
  --panel: #141a22;
  --border: #243044;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --ok: #3dd68c;
  --warn: #f5c542;
  --bad: #f07178;
  --accent: #6cb6ff;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 1.35rem;
  font-weight: 650;
  margin: 0;
}

.sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

button, .btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button.primary { background: #1a3a5c; border-color: #2d5f9a; }
button.primary:hover { background: #224b78; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin-bottom: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.card h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.section { margin-bottom: 1.25rem; }

.section > h2 {
  font-size: 1rem;
  margin: 0 0 0.65rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge.ok { background: #143528; color: var(--ok); border-color: #2a6b4a; }
.badge.warn { background: #3a3014; color: var(--warn); border-color: #6b5620; }
.badge.bad { background: #3a1c20; color: var(--bad); border-color: #6b3038; }
.badge.neutral { background: #1c2430; color: var(--muted); border-color: var(--border); }

.metric {
  font-size: 1.1rem;
  font-weight: 650;
}

.metric small {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.15rem;
}

.actions-list { list-style: none; padding: 0; margin: 0; }

.actions-list li {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  background: #10151c;
}

.actions-list h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.actions-list p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.link-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.link-row a {
  color: var(--accent);
  font-size: 0.82rem;
  text-decoration: none;
}

.link-row a:hover { text-decoration: underline; }

.kv {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.86rem;
}

.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }

pre.raw {
  background: #090c10;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  overflow: auto;
  font-size: 0.72rem;
  line-height: 1.35;
  max-height: 24rem;
}

.status-bar {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.status-bar.loading { background: #1a2430; color: var(--muted); }
.status-bar.error { background: #3a1c20; color: var(--bad); }
.status-bar.ok { background: #143528; color: var(--ok); }

.hidden { display: none !important; }

footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

footer a { color: var(--accent); }

@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; }
}
