:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --line: #e4e8ec;
  --up: #3fc77a;
  --down: #dc3545;
  --warn: #f5a623;
  --empty: #dfe3e7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e13;
    --card: #161b22;
    --text: #e6edf3;
    --muted: #8b949e;
    --line: #262d36;
    --up: #5cdd8b;
    --empty: #2a313b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.head { background: #004a6f; padding: 22px 16px; text-align: center; }
.logo { display: block; height: 36px; width: auto; max-width: 100%; margin: 0 auto; }

.wrap { max-width: 880px; margin: 0 auto; padding: 32px 16px 48px; }

.banner {
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
  color: #fff;
}
.banner-up { background: var(--up); color: #06260f; }
.banner-down { background: var(--down); }
.banner-warn { background: var(--warn); color: #3a2600; }
.banner-loading { background: var(--empty); color: var(--muted); }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.card h2 { margin: 0 0 14px; font-size: 1.05rem; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.subscribe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--empty);
}
.subscribe:hover { text-decoration: underline; }

.muted { color: var(--muted); }

.monitor { padding: 14px 0; border-top: 1px solid var(--line); }
.monitor:first-child { border-top: 0; padding-top: 0; }
.monitor:last-child { padding-bottom: 0; }

.monitor-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.monitor-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--empty); flex: none; }
.dot-up { background: var(--up); }
.dot-down { background: var(--down); }

.badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  font-size: .8rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--empty);
  color: var(--text);
}
.badge-up { background: var(--up); color: #06260f; }
.badge-down { background: var(--down); color: #fff; }

.beats { display: flex; gap: 3px; height: 32px; }
.beat { flex: 1; min-width: 0; border-radius: 3px; background: var(--empty); }
.beat-up { background: var(--up); }
.beat-down { background: var(--down); }

.beats-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: .75rem; color: var(--muted); }

.incident { padding: 12px 0; border-top: 1px solid var(--line); }
.incident:first-child { border-top: 0; padding-top: 0; }
.incident-title { font-weight: 600; }
.incident-meta { font-size: .8rem; color: var(--muted); }
.incident-update { margin: 6px 0 0; font-size: .9rem; }

.foot { text-align: center; font-size: .8rem; color: var(--muted); }
.foot p { margin: 0; }
.foot-copy { margin-top: 16px; }
.foot a { color: inherit; text-decoration: underline; }

@media (max-width: 520px) {
  .monitor-top { flex-direction: column; align-items: flex-start; }
  .badges { justify-content: flex-start; }
}
