:root {
  --bg: #050505;
  --panel: #121212;
  --panel-2: #171717;
  --line: #2a2a2a;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.16);
  --warn: #eab308;
  --warn-soft: rgba(234, 179, 8, 0.16);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.16);
  --none: #3f3f46;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand img {
  border-radius: 7px;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
  background: #0c0c0c;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.tab.is-active {
  background: #1f1f1f;
  color: var(--ink);
}

.site-link {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-link:hover {
  color: var(--ink);
}

main {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  flex: 1;
}

.panel[hidden] {
  display: none;
}

.hero {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}

.hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
}

.hero-icon svg {
  width: 32px;
  height: 32px;
  display: none;
}

.hero[data-health="operational"] .icon-ok,
.hero[data-health="degraded"] .icon-warn,
.hero[data-health="outage"] .icon-bad {
  display: block;
}

.hero[data-health="operational"] {
  color: inherit;
}
.hero[data-health="operational"] .hero-icon {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: rgba(34, 197, 94, 0.35);
}
.hero[data-health="degraded"] .hero-icon {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(234, 179, 8, 0.35);
}
.hero[data-health="outage"] .hero-icon {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: rgba(239, 68, 68, 0.35);
}

.icon-load {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.hero[data-health="loading"] .icon-load {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.03em;
}

.checked {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.groups {
  display: grid;
  gap: 1rem;
}

.group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.group-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.component {
  padding: 0.95rem 1rem 1.05rem;
  border-bottom: 1px solid var(--line);
}

.component:last-child {
  border-bottom: 0;
}

.component-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--none);
  flex: 0 0 auto;
}

.dot.is-up {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.dot.is-down {
  background: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-soft);
}
.dot.is-partial {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.component-name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.uptime {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  height: 28px;
  align-items: stretch;
}

.seg {
  border-radius: 2px;
  background: var(--none);
  min-width: 0;
}

.seg.up {
  background: var(--ok);
}
.seg.partial {
  background: var(--warn);
}
.seg.down {
  background: var(--bad);
}
.seg.none {
  background: #27272a;
}

.seg:hover {
  filter: brightness(1.15);
}

.empty-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.empty-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.empty-card p {
  margin: 0;
  color: var(--muted);
}

.history-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.history-list li {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
}

.history-list strong {
  display: block;
  margin-bottom: 0.25rem;
}

.history-list span {
  color: var(--muted);
  font-size: 0.9rem;
}

.foot {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.foot a {
  margin-right: 0.85rem;
}

.foot a:hover {
  color: var(--ink);
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
  }
  .site-link {
    margin-left: 0;
  }
  .tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .bar {
    height: 22px;
    gap: 1px;
  }
}
