:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0d0d0d;
  --panel-soft: #111111;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.62);
  --green: #5dff9c;
  --yellow: #ffd35d;
  --red: #ff5d5d;
  --shadow: rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Poppins", segoe ui, arial, sans-serif;
  color: var(--text);
  text-transform: lowercase;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 28%),
    var(--bg);
}

a {
  color: inherit;
}

.history-tooltip {
  position: absolute;
  z-index: 40;
  width: min(270px, calc(100vw - 24px));
  padding: 16px 18px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #f7f7f7;
  color: #171717;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

.history-tooltip.hidden {
  display: none;
}

.tooltip-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

.tooltip-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c7c7c7;
}

.tooltip-dot.operational {
  background: #14b86a;
}

.tooltip-dot.broken {
  background: #d53030;
}

.history-tooltip p {
  margin: 14px 0 12px;
  color: #616161;
  font-size: 14px;
  line-height: 1.5;
}

.tooltip-time {
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: #6d6d6d;
  font-size: 14px;
  text-align: center;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  min-width: 190px;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 70px var(--shadow);
  font-size: 22px;
  font-weight: 800;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.loading-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  animation: dot-grow 900ms ease-in-out infinite;
}

.loading-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.loading-dots i:nth-child(3) {
  animation-delay: 240ms;
}

.shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 44px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
}

.wordmark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: invert(1);
}

.topbar-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.overview,
.status-details,
.system-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 48px var(--shadow);
}

.overview {
  padding: 28px;
}

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.overview-title {
  display: grid;
  gap: 10px;
}

.eyebrow,
.muted,
.detail-row span,
.group-head span,
.system-row span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.status-pill {
  width: fit-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0f0f0f;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.status-pill.operational {
  border-color: rgba(93, 255, 156, 0.45);
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(93, 255, 156, 0.08) inset;
}

.status-pill.offline,
.status-pill.broken {
  border-color: rgba(255, 93, 93, 0.45);
  color: var(--red);
  box-shadow: 0 0 0 1px rgba(255, 93, 93, 0.08) inset;
}

.status-pill.partial {
  border-color: rgba(255, 211, 93, 0.45);
  color: var(--yellow);
  box-shadow: 0 0 0 1px rgba(255, 211, 93, 0.08) inset;
}

.status-pill.checking {
  color: var(--muted);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
  animation: pulse 1.8s ease-in-out infinite;
}

.status-pill.operational .pulse {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(93, 255, 156, 0.14);
}

.status-pill.offline .pulse,
.status-pill.broken .pulse {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 93, 93, 0.14);
}

.status-pill.partial .pulse {
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(255, 211, 93, 0.14);
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.overview-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.status-details {
  margin-top: 16px;
  padding: 0 24px;
}

.detail-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.detail-row strong {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.detail-row em {
  min-width: 96px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0f0f0f;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.detail-row em.operational {
  border-color: rgba(93, 255, 156, 0.45);
  color: var(--green);
}

.detail-row em.broken {
  border-color: rgba(255, 93, 93, 0.45);
  color: var(--red);
}

.system-panel {
  margin-top: 16px;
  padding: 24px;
}

.status-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.summary {
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.summary.operational {
  color: var(--green);
}

.summary.broken {
  color: var(--red);
}

.systems {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.system-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.group-head strong {
  font-size: 18px;
  font-weight: 600;
}

.group-bars {
  display: grid;
  grid-template-columns: repeat(var(--history-count), minmax(2px, 1fr));
  align-items: center;
  gap: 3px;
  padding: 10px 0 10px;
}

.group-bars i {
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  cursor: default;
}

.group-bars i.operational {
  background: rgba(93, 255, 156, 0.85);
}

.group-bars i.broken {
  background: rgba(255, 93, 93, 0.85);
}

.group-bars i.live {
  justify-self: center;
  width: 68%;
  height: 8px;
  border-radius: 999px;
}

.group-scale {
  display: grid;
  grid-template-columns: repeat(var(--history-count), minmax(2px, 1fr));
  gap: 3px;
  padding-bottom: 14px;
}

.group-scale span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.group-items {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.system-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.system-row + .system-row {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.system-row strong {
  font-size: 14px;
  font-weight: 600;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.system-row.operational .dot {
  background: var(--green);
}

.system-row.operational span:last-child {
  color: var(--green);
}

.system-row.broken .dot {
  background: var(--red);
}

.system-row.broken span:last-child {
  color: var(--red);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dot-grow {
  0%,
  100% {
    transform: scale(0.65);
    opacity: 0.42;
  }

  50% {
    transform: scale(1.6);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 18px;
  }

  .topbar,
  .overview-head,
  .status-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .wordmark {
    font-size: 26px;
  }

  .overview,
  .status-details,
  .system-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 0;
  }

  .detail-row em {
    width: fit-content;
  }
}
