:root {
  --bg: #000000;
  --panel: #000000;
  --panel-2: #0a0a0a;
  --line: #1e1e1e;
  --line-strong: #2e2e2e;
  --text: #ededed;
  --muted: #8a8a8a;
  --up: #3ddc97;
  --slow: #e0a83e;
  --down: #ef5f5f;
  --unknown: #5a5a5a;
  --radius: 24px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 32px 20px 56px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 980px; margin: 0 auto; display: grid; gap: 16px; }

/* Header ------------------------------------------------------------------ */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 26px; height: 26px; flex: none; object-fit: contain; }
.brand h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 12px; color: var(--muted);
}
.pill__dot { width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; flex: none; }
.pill--live { color: var(--up); }
.pill--live .pill__dot { animation: pulse 2s ease-in-out infinite; }
.pill--polling { color: var(--slow); }
.pill--connecting { color: var(--muted); }
.pill--offline { color: var(--down); }

@keyframes pulse { 50% { opacity: 0.25; } }

/* Simulation banner ------------------------------------------------------- */

.sim {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 11px 16px; font-size: 13px;
}
.sim strong { color: var(--slow); margin-right: 8px; font-weight: 600; }

/* Hero -------------------------------------------------------------------- */

.hero {
  --level: var(--unknown);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-top-color: var(--level);
  border-radius: var(--radius);
  background: var(--panel);
}
.hero[data-level="operational"] { --level: var(--up); }
.hero[data-level="partial"] { --level: var(--slow); }
.hero[data-level="major"] { --level: var(--down); }

.hero__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hero h2 { margin: 0 0 3px; font-size: 17px; font-weight: 600; color: var(--text); }
.hero__note { margin: 0; color: var(--muted); font-size: 13px; max-width: 52ch; }

.hero__countdown { min-width: 176px; text-align: right; }
.countdown__value { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.countdown__unit { font-size: 15px; color: var(--muted); margin-left: 2px; }
.countdown__label {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; margin-top: 6px;
}
.bar { margin-top: 12px; height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--level); transition: width 0.2s linear; }

/* Stats ------------------------------------------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.stat {
  padding: 13px 16px; display: grid; gap: 3px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat__num { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat--up .stat__num { color: var(--up); }
.stat--slow .stat__num { color: var(--slow); }
.stat--down .stat__num { color: var(--down); }
.stat--wide .stat__num { font-size: 15px; }

/* Filters ----------------------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip--on { border-color: var(--line-strong); background: var(--panel-2); color: var(--text); }
.chip:focus-visible { outline: 1px solid var(--line-strong); outline-offset: 2px; }
.chip__n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip--on .chip__n { color: var(--text); }

/* Groups ------------------------------------------------------------------ */

.groups { display: grid; gap: 16px; }
.group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group h3 {
  margin: 0; padding: 11px 16px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.group h3 em { font-style: normal; color: var(--muted); text-transform: none; letter-spacing: 0; }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.group li + li { border-top: 1px solid var(--line); }

.target__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex: none; background: var(--unknown); }
.target--up .target__dot { background: var(--up); }
.target--slow .target__dot { background: var(--slow); }
.target--down .target__dot { background: var(--down); }
.target__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target--down .target__name { color: var(--down); }
.target__http {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 2px 9px; font-variant-numeric: tabular-nums; flex: none;
}
.target__detail { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 7ch; text-align: right; flex: none; }
.target__uptime { color: var(--muted); font-size: 12px; min-width: 6.5ch; text-align: right; flex: none; font-variant-numeric: tabular-nums; }

/* Footer ------------------------------------------------------------------ */

.foot {
  color: var(--muted); font-size: 12px; display: grid; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.foot p { margin: 0; }
.sep { opacity: 0.4; padding: 0 6px; }

/* Small screens ----------------------------------------------------------- */

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat--wide { grid-column: 1 / -1; border-right: 0; }
  .stat:last-child { border-bottom: 0; }
  .hero__countdown { text-align: left; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pill--live .pill__dot { animation: none; }
  .bar__fill { transition: none; }
}
