:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6f6f6a;
  --faint: #9b9b95;
  --line: #e3e3de;
  --ok: #1f7a4c;
  --warn: #a86400;
  --bad: #b42318;
  --none: #deded8;
  --accent: #1f7a4c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1011;
    --surface: #151617;
    --text: #ececea;
    --muted: #a0a09a;
    --faint: #6e6e68;
    --line: #2a2b2d;
    --ok: #4cc38a;
    --warn: #d9a441;
    --bad: #f16a5a;
    --none: #2a2c2e;
    --accent: #4cc38a;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 44px 24px 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.16em;
}

.toplink {
  font-size: 12px;
  color: var(--muted);
}

.intro { padding: 44px 0 30px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--faint);
}

h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.overall {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.overall-text { font-size: 15px; font-weight: 550; }

.overall-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.none { background: var(--none); }

.section { margin-top: 40px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head span {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.loading {
  padding: 22px 0;
  color: var(--faint);
  font-size: 13px;
}

.component {
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}

.component-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 550;
}

.state {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.component-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 12px;
}

.metric span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.metric b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.metric b.muted { color: var(--faint); font-weight: 400; }

.bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 2px;
  height: 18px;
  margin-top: 16px;
}

.bar {
  min-width: 2px;
  background: var(--none);
  border-radius: 1px;
}

.bar.ok { background: var(--ok); opacity: 0.86; }
.bar.warn { background: var(--warn); opacity: 0.9; }
.bar.bad { background: var(--bad); opacity: 0.9; }
.bar.none { background: var(--none); opacity: 0.55; }

.bars-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--faint);
}

.checked {
  margin-top: 10px;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.checked .stale { color: var(--warn); }

.incidents { padding-top: 4px; }

.incident {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.incident time {
  min-width: 132px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.incident .incident-name { font-weight: 500; }

.incident .tag {
  margin-left: auto;
  font-size: 11px;
  color: var(--bad);
}

.empty {
  margin: 0;
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.error {
  padding: 20px 0;
  color: var(--bad);
  font-size: 13px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--faint);
}

.footer span:last-child { text-align: right; }

@media (max-width: 640px) {
  .page { padding: 30px 18px 48px; }
  h1 { font-size: 27px; }
  .intro { padding: 34px 0 24px; }
  .component-meta { gap: 18px; }
  .bars { gap: 1px; height: 16px; }
  .overall-note { display: none; }
  .incident { flex-wrap: wrap; gap: 6px 14px; }
  .incident time { min-width: 100%; }
  .footer { flex-direction: column; gap: 6px; }
  .footer span:last-child { text-align: left; }
}
