:root {
  --page: #0a0c0e;
  --surface: #13171a;
  --surface-2: #1b2024;
  --border: #252b30;
  --text: #eef1f2;
  --text-2: #b8c0c4;
  --muted: #7d878c;
  --accent: #53d8f0;
  --series: #3987e5;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --nodata: #2b3237;
  --glow: 0 0 24px rgba(83, 216, 240, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.muted { color: var(--muted); font-weight: 400; }
a { color: inherit; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: 0.32em; font-weight: 600; }
.brand .sub { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.core {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--accent); box-shadow: var(--glow), inset var(--glow);
  position: relative; flex: none;
}
.core::after {
  content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--accent);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.85); } }
@media (prefers-reduced-motion: reduce) { .core::after { animation: none; } }

.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.overall {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; background: var(--surface-2);
  font-weight: 500;
}
.btn {
  font: inherit; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.6; cursor: progress; }

main { padding: 8px clamp(16px, 4vw, 40px) 48px; max-width: 1280px; margin: 0 auto; }
section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

.banner {
  margin-top: 20px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--critical); background: color-mix(in srgb, var(--critical) 10%, var(--surface));
}

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; min-width: 0;
}
.card.is-down { border-color: var(--critical); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card .url { color: var(--muted); font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.card .url:hover { color: var(--text-2); text-decoration: underline; }

.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.state svg { flex: none; }
.state.up { color: var(--text); }
.state.down { color: var(--critical); }
.state.pending { color: var(--muted); }

.since { margin: 6px 0 0; color: var(--text-2); font-size: 12px; }
.err { color: var(--critical); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 12px; }
.stat { min-width: 0; }
.stat .k { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .v { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 14px; font-weight: 500; }

.bars { display: flex; gap: 2px; height: 26px; align-items: stretch; }
.bars span { flex: 1; border-radius: 2px; background: var(--nodata); min-width: 2px; }
.bars span.g { background: var(--good); }
.bars span.w { background: var(--warning); }
.bars span.c { background: var(--critical); }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }

.spark { margin-top: 12px; }
.spark-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
svg.chart { display: block; width: 100%; overflow: visible; }
svg.chart .grid-line { stroke: var(--border); stroke-width: 1; }
svg.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .bar { fill: var(--series); }
svg.chart .bar.hot, svg.chart .bar:hover { opacity: 0.8; }
svg.chart .axis { fill: var(--muted); font-size: 10px; font-family: Inter, system-ui, sans-serif; }
svg.chart .cross { stroke: var(--muted); stroke-width: 1; }
svg.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }

.hero { display: flex; gap: 20px; flex-wrap: wrap; margin: 10px 0 12px; }
.hero .num { font-size: 26px; font-weight: 600; line-height: 1.1; font-family: "JetBrains Mono", ui-monospace, monospace; }
.hero .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.delta { font-size: 12px; font-weight: 500; color: var(--text-2); }

details { margin-top: 10px; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
th, td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; }
td { font-family: "JetBrains Mono", ui-monospace, monospace; }

.empty {
  background: var(--surface); border: 1px dashed var(--border); border-radius: 12px;
  padding: 20px; color: var(--text-2);
}
.empty code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.inc-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.inc-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.inc-list li:last-child { border-bottom: 0; }

.tip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--text); color: var(--page);
  padding: 6px 9px; border-radius: 6px; font-size: 12px; line-height: 1.4;
  max-width: 240px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.tip b { font-weight: 600; }

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero .num { font-size: 22px; }
}
