:root {
  color-scheme: dark;
  --bg: #0d0b12;
  --surface: #14111b;
  --surface-raised: #191520;
  --border: #2b2534;
  --border-soft: #221d2a;
  --text: #f3eff8;
  --muted: #948ba0;
  --dim: #6d6576;
  --purple: #9a6aff;
  --purple-soft: #b995ff;
  --purple-muted: #2b203e;
  --green: #62d49b;
  --green-muted: #162b24;
  --amber: #e6b867;
  --amber-muted: #302719;
  --red: #f07484;
  --red-muted: #321a20;
  --unknown: #8d8497;
  --radius: 16px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #704eb1;
  border-radius: 9px;
  background: var(--purple-muted);
  color: var(--purple-soft);
  font-size: 14px;
  font-weight: 850;
}

.brand-divider {
  width: 1px;
  height: 18px;
  margin-left: 2px;
  background: var(--border);
}

.brand-section {
  color: var(--muted);
  font-weight: 580;
}

.updated {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--unknown);
  box-shadow: 0 0 0 4px #24202a;
}

.updated.is-live .live-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-muted);
}

main {
  padding: 62px 0 32px;
}

.hero {
  display: flex;
  min-height: 176px;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 0 4px 40px;
}

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

.eyebrow {
  margin: 0 0 10px;
  color: var(--purple-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 13px;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.hero-description {
  max-width: 630px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.status-symbol {
  position: relative;
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.status-symbol::before,
.status-symbol::after,
.status-symbol span {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.status-symbol::before {
  inset: 14px;
  border: 1px solid currentColor;
  opacity: 0.22;
}

.status-symbol::after {
  inset: 27px;
  background: currentColor;
  box-shadow: 0 0 24px currentColor;
}

.status-symbol span {
  inset: 5px;
  border: 1px solid currentColor;
  opacity: 0.1;
}

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

.status-degraded {
  color: var(--amber);
}

.status-critical {
  color: var(--red);
}

.status-unknown {
  color: var(--unknown);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  background: var(--surface);
}

.metric-card {
  min-height: 142px;
  padding: 22px;
  border-radius: var(--radius);
}

.metric-label {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.metric-value {
  margin-bottom: 8px;
  font-size: 27px;
  font-weight: 720;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.metric-note {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.4;
}

.panel {
  border-radius: var(--radius);
}

.chart-panel {
  margin-bottom: 12px;
  padding: 26px 26px 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.panel-heading.compact {
  margin-bottom: 20px;
}

.chart-legend {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 16px;
  height: 2px;
  display: block;
  border-radius: 2px;
}

.legend-speed {
  background: var(--purple);
}

.legend-response {
  background: var(--green);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}

#performance-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.85fr);
  gap: 12px;
}

.components-panel {
  padding: 26px;
}

.panel-hint {
  color: var(--muted);
  font-size: 10px;
}

.component-list {
  border-top: 1px solid var(--border-soft);
}

.component-item {
  border-bottom: 1px solid var(--border-soft);
}

.component-item:last-child {
  border-bottom: 0;
}

.component-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 110px 112px 118px;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 66px;
  padding: 0;
  font-size: 12px;
}

.component-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-weight: 620;
}

.component-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--unknown);
}

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

.component-dot.degraded {
  background: var(--amber);
}

.component-dot.critical {
  background: var(--red);
}

.component-stat {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.component-stat strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
}

.component-stat span {
  color: var(--dim);
  font-size: 10px;
}

.state-pill {
  justify-self: end;
  min-width: 94px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--unknown);
  font-size: 10px;
  font-weight: 670;
  text-align: center;
}

.state-pill.operational {
  border-color: #284c3d;
  background: var(--green-muted);
  color: var(--green);
}

.state-pill.degraded {
  border-color: #574725;
  background: var(--amber-muted);
  color: var(--amber);
}

.state-pill.critical {
  border-color: #5d2c36;
  background: var(--red-muted);
  color: var(--red);
}

.speed-timeline {
  display: grid;
  grid-template-columns: repeat(24, minmax(5px, 1fr));
  gap: 5px;
  padding: 1px 0 17px 18px;
}

.speed-point {
  position: relative;
  justify-self: center;
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: var(--unknown);
  opacity: 0.42;
}

.speed-point.operational {
  background: var(--green);
  opacity: 0.9;
}

.speed-point.degraded {
  background: var(--amber);
  opacity: 0.95;
}

.speed-point.offline {
  background: var(--red);
  opacity: 1;
}

.speed-point:focus-visible {
  outline: 2px solid var(--purple-soft);
  outline-offset: 3px;
}

.speed-point::after {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 9px);
  min-width: max-content;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #211b29;
  color: var(--text);
  content: attr(data-tooltip);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.speed-point:hover::after,
.speed-point:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

.side-stack .panel {
  padding: 24px;
}

.issues {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.issue-item {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--border-soft);
}

.issue-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.issue-icon {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.issue-item.critical .issue-icon {
  background: var(--red);
}

.issue-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 640;
}

.all-clear {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 4px 0;
}

.all-clear .issue-icon {
  background: var(--green);
}

.all-clear strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 640;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.skeleton-row {
  height: 66px;
  border-bottom: 1px solid var(--border-soft);
  background: #18141f;
  animation: loading 1.4s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes loading {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.8; }
}

footer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 94px;
  border-top: 1px solid var(--border-soft);
  color: var(--dim);
  font-size: 11px;
}

.footer-separator {
  color: var(--border);
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  font: 13px/1.5 var(--font);
}

@media (max-width: 920px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 660px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    height: 70px;
  }

  .brand-divider,
  .brand-section {
    display: none;
  }

  .updated {
    max-width: 148px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  main {
    padding-top: 38px;
  }

  .hero {
    align-items: flex-start;
    padding: 0 2px 32px;
  }

  h1 {
    font-size: 38px;
  }

  .hero-description {
    font-size: 14px;
  }

  .status-symbol {
    display: none;
  }

  .metrics,
  .side-stack {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 126px;
  }

  .chart-panel,
  .components-panel,
  .side-stack .panel {
    padding: 20px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .chart-legend {
    display: none;
  }

  .chart-wrap {
    height: 220px;
  }

  .component-row {
    grid-template-columns: minmax(130px, 1fr) 96px 88px;
    gap: 10px;
  }

  .speed-timeline {
    gap: 3px;
    padding-left: 10px;
  }

  .component-response {
    display: none;
  }

  footer {
    flex-wrap: wrap;
    padding: 24px 0;
  }

  .footer-spacer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
