:root {
  color-scheme: dark;
  --bg: #11110f;
  --panel: #191915;
  --panel-2: #23231c;
  --line: #3b382c;
  --text: #f4f1e6;
  --muted: #aaa38e;
  --gold: #d9ad45;
  --ok: #55d17a;
  --warn: #e8b84d;
  --fail: #ff5c5c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(217, 173, 69, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(217, 173, 69, 0.06) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
}

.health-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.health-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  line-height: 0.88;
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
  text-transform: uppercase;
}

.health-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.health-btn {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #151512;
  color: var(--text);
  text-decoration: none;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  border-radius: 4px;
}

.health-btn:hover {
  border-color: var(--gold);
}

.health-btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17130a;
  font-weight: 800;
}

.status-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1px;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.status-strip > div {
  background: rgba(25, 25, 21, 0.96);
  padding: 16px;
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.check-card {
  min-height: 134px;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.check-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.check-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 12px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.check-card[data-status="ok"] .dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(85, 209, 122, 0.14);
}

.check-card[data-status="warn"] .dot {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(232, 184, 77, 0.14);
}

.check-card[data-status="fail"] .dot {
  background: var(--fail);
  box-shadow: 0 0 0 4px rgba(255, 92, 92, 0.14);
}

.health-log {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #0d0d0b;
  border-radius: 6px;
}

.health-log__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

#health-latency {
  color: var(--muted);
}

pre {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  color: #d8d2bf;
  font: 0.9rem/1.55 "Cascadia Mono", Consolas, monospace;
}

@media (max-width: 820px) {
  .health-header {
    align-items: stretch;
    flex-direction: column;
  }

  .health-actions,
  .status-strip,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .health-actions {
    justify-content: stretch;
  }

  .health-btn {
    flex: 1 1 132px;
  }
}
