:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-soft: #191d23;
  --border: #2a2f36;
  --text: #f1f3f5;
  --muted: #9aa3ad;
  --muted-strong: #c0c7cf;
  --healthy: #37d67a;
  --warning: #f4b942;
  --critical: #ff5b63;
  --track: #242932;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 30rem), var(--bg);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(40px, env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  margin-bottom: 28px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--healthy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  overflow-wrap: anywhere;
  font-size: clamp(2.05rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.subtitle {
  max-width: 680px;
  margin-top: 14px;
  color: var(--muted-strong);
  font-size: 1.08rem;
  line-height: 1.5;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
  max-width: 100%;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(21, 24, 29, 0.78);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.pill-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--healthy);
  box-shadow: 0 0 0 4px rgba(55, 214, 122, 0.12);
}

.dot-muted {
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(154, 163, 173, 0.12);
}

.dot-warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.14);
}

.dot-critical {
  background: var(--critical);
  box-shadow: 0 0 0 4px rgba(255, 91, 99, 0.14);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 91, 99, 0.35);
  border-radius: 8px;
  color: #ffd9dc;
  background: rgba(255, 91, 99, 0.1);
}

.hidden {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.card {
  min-width: 0;
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  min-height: 32px;
  margin-bottom: 22px;
}

.card h2 {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0;
}

.status-card {
  grid-column: span 6;
}

.metric-card,
.split-card {
  grid-column: span 4;
}

.wide {
  grid-column: span 4;
}

.badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: #07130c;
  background: var(--healthy);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-warning {
  color: #1b1200;
  background: var(--warning);
}

.badge-critical {
  color: #210508;
  background: var(--critical);
}

.badge-muted {
  color: var(--text);
  background: #333a44;
}

.status-value,
.large-value {
  overflow-wrap: anywhere;
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.05;
}

.metric-value {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 1.72rem;
  font-weight: 800;
  transition: color 180ms ease;
}

.muted {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bar {
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--healthy);
  transition: width 180ms ease-out, background-color 180ms ease-out;
}

.bar span.warning {
  background: var(--warning);
}

.bar span.critical {
  background: var(--critical);
}

.split-values,
.load-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.split-values {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.load-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.split-values strong,
.load-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.15rem, 4vw, 2rem);
  line-height: 1.1;
}

@media (max-width: 860px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: 14ch;
  }

  .status-card,
  .metric-card,
  .split-card,
  .wide {
    grid-column: span 6;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 22px, 1120px);
    padding-top: max(24px, env(safe-area-inset-top));
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2rem, 11vw, 2.75rem);
  }

  .subtitle {
    font-size: 1rem;
  }

  .live-pill {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 12px;
    font-size: 0.92rem;
  }

  #last-updated {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .grid {
    gap: 12px;
  }

  .status-card,
  .metric-card,
  .split-card,
  .wide {
    grid-column: 1 / -1;
  }

  .card {
    min-height: 146px;
    padding: 17px;
  }

  .card-header {
    margin-bottom: 18px;
  }

  .metric-value {
    font-size: 1.45rem;
  }
}

@media (max-width: 380px) {
  .page-shell {
    width: min(100% - 18px, 1120px);
  }

  .live-pill {
    font-size: 0.86rem;
  }

  .split-values {
    grid-template-columns: 1fr;
  }
}
