:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #171b1f;
  --panel-2: #1d2328;
  --line: #2c343b;
  --text: #eef2f5;
  --muted: #95a2ad;
  --green: #32d583;
  --green-soft: rgba(50, 213, 131, 0.14);
  --amber: #ffb020;
  --amber-soft: rgba(255, 176, 32, 0.16);
  --red: #ff5c67;
  --red-soft: rgba(255, 92, 103, 0.16);
  --blue: #6ea8fe;
  --blue-soft: rgba(110, 168, 254, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 280px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.brand-mark span {
  border-radius: 3px;
  background: var(--blue);
}

.brand-mark span:nth-child(2) {
  background: var(--green);
}

.brand-mark span:nth-child(3) {
  background: var(--amber);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.04;
  font-weight: 760;
}

.brand p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  height: 42px;
  min-width: 168px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px var(--blue-soft);
}

.status-pill.operational {
  color: var(--green);
  border-color: rgba(50, 213, 131, 0.35);
  background: var(--green-soft);
}

.status-pill.operational .pulse {
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.status-pill.degraded {
  color: var(--amber);
  border-color: rgba(255, 176, 32, 0.4);
  background: var(--amber-soft);
}

.status-pill.degraded .pulse {
  background: var(--amber);
  box-shadow: 0 0 0 5px var(--amber-soft);
}

.status-pill.outage,
.status-pill.unknown {
  color: var(--red);
  border-color: rgba(255, 92, 103, 0.4);
  background: var(--red-soft);
}

.status-pill.outage .pulse,
.status-pill.unknown .pulse {
  background: var(--red);
  box-shadow: 0 0 0 5px var(--red-soft);
}

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

.summary-tile,
.component,
.events {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-tile {
  min-height: 96px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tile-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 640;
}

.summary-tile strong {
  font-size: 28px;
  line-height: 1;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.incidents-head {
  margin-top: 30px;
}

h2 {
  font-size: 17px;
  font-weight: 720;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

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

.component {
  min-height: 178px;
  padding: 16px;
}

.component-top,
.component-meta,
.component-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.component-title {
  min-width: 0;
}

.component-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.25;
}

.target {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 460px;
}

.badge {
  height: 28px;
  min-width: 84px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.up {
  color: var(--green);
  background: var(--green-soft);
}

.badge.slow {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.down,
.badge.unknown {
  color: var(--red);
  background: var(--red-soft);
}

.component-stats {
  margin: 18px 0 14px;
  justify-content: flex-start;
}

.stat {
  min-width: 104px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.stat strong {
  font-size: 20px;
  line-height: 1;
}

.sparkline {
  height: 34px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 2px;
  overflow: hidden;
  padding-top: 3px;
}

.sparkline span {
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--line);
}

.sparkline span.up {
  background: var(--green);
}

.sparkline span.slow {
  background: var(--amber);
}

.sparkline span.down,
.sparkline span.unknown {
  background: var(--red);
}

.component-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.events {
  overflow: hidden;
}

.event-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 96px 104px;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.event-row:first-child {
  border-top: 0;
}

.event-time,
.event-message {
  color: var(--muted);
}

.event-message,
.event-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-pill {
    width: 100%;
  }

  .summary-grid,
  .components {
    grid-template-columns: 1fr;
  }

  .summary-tile {
    min-height: 84px;
  }

  .event-row {
    grid-template-columns: 1fr 84px;
    min-height: 68px;
    padding: 10px 14px;
  }

  .event-time,
  .event-message {
    grid-column: 1 / -1;
  }
}
