:root {
  --bg: #060912;
  --bg-soft: #0b1220;
  --surface: rgba(14, 21, 34, 0.9);
  --surface-strong: rgba(17, 25, 39, 0.98);
  --edge: rgba(120, 151, 189, 0.18);
  --text: #f6f8fc;
  --muted: #99abc5;
  --muted-strong: #bfd0e6;
  --good: #22df8a;
  --warn: #f0bf74;
  --bad: #ff6e7a;
  --maint: #7db2ff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(48, 104, 180, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(18, 116, 83, 0.11), transparent 28%),
    linear-gradient(180deg, #04070d 0%, #070c15 100%);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(18px);
}
.brand-wrap {
  width: min(1040px, calc(100vw - 28px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
}
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
}
.brand-name {
  font-family: "Outfit", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 0.84rem;
}

.page-shell {
  width: min(1040px, calc(100vw - 28px));
  margin: 22px auto 42px;
  display: grid;
  gap: 18px;
}

.hero-card,
.section-block,
.service-card,
.incident-card,
.maintenance-card,
.recent-card {
  background: linear-gradient(180deg, rgba(19, 29, 45, 0.96), rgba(11, 17, 27, 0.98));
  border: 1px solid var(--edge);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 0;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.hero-card h1 {
  margin: 0 0 6px;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.hero-card p {
  margin: 0 0 8px;
  color: var(--muted-strong);
  font-size: 0.96rem;
}
.hero-updated { color: var(--muted); font-size: 0.84rem; }
.hero-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  border: 2px solid currentColor;
  flex: 0 0 auto;
}
.hero-operational { color: var(--good); background: rgba(10, 69, 45, 0.28); }
.hero-degraded { color: var(--warn); background: rgba(96, 63, 19, 0.24); }
.hero-down { color: var(--bad); background: rgba(98, 29, 39, 0.24); }

.section-block { padding: 14px; }
.section-accent { border-color: rgba(240, 191, 116, 0.28); }
.section-heading { margin-bottom: 10px; }
.compact-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}
.section-heading h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.24rem;
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 7px;
}
.legend-up { background: var(--good); }
.legend-degraded { background: var(--warn); }
.legend-down { background: var(--bad); }
.legend-maintenance { background: var(--maint); }

.group-block + .group-block { margin-top: 12px; }
.group-label {
  margin-bottom: 8px;
  color: #8ca2c5;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
}
.service-list { display: grid; gap: 10px; }
.service-card { padding: 10px 12px; }
.service-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.service-copy { flex: 1 1 auto; }
.service-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}
.service-title-row h3 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.02rem;
}
.service-note {
  margin-top: 8px;
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-size: 0.82rem;
}
.service-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: capitalize;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}
.service-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
}
.status-operational { color: var(--good); }
.status-degraded { color: var(--warn); }
.status-down { color: var(--bad); }
.status-maintenance { color: var(--maint); }
.status-unknown { color: #d5dceb; }
.status-unknown::before { background: currentColor; }

.service-uptime-box {
  flex: 0 0 120px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 11px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  text-align: right;
}
.uptime-label {
  display: block;
  color: #8ca2c5;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.62rem;
  margin-bottom: 4px;
}
.service-uptime-box strong {
  font-family: "Outfit", sans-serif;
  font-size: 1.2rem;
}

.history-strip {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 3px;
  margin: 7px 0 4px;
}
.history-day {
  position: relative;
  display: block;
  height: 19px;
  border-radius: 7px;
  background: rgba(255,255,255,0.08);
  cursor: default;
}
.history-up, .history-operational { background: linear-gradient(180deg, #2bf0a4, #18c67a); }
.history-minor,
.history-degraded { background: linear-gradient(180deg, #ffd690, #e7a64b); }
.history-down { background: linear-gradient(180deg, #ff8a94, #de4f62); }
.history-maintenance { background: linear-gradient(180deg, #98c6ff, #5d8ce0); }
.history-unknown { background: rgba(255,255,255,0.08); }
.history-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  min-width: 170px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(6, 10, 17, 0.96);
  box-shadow: 0 20px 40px rgba(0,0,0,0.34);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 3;
}
.history-tooltip strong,
.history-tooltip span,
.history-tooltip em {
  display: block;
}
.history-tooltip strong { font-size: 0.88rem; margin-bottom: 3px; }
.history-tooltip span { color: var(--muted-strong); font-size: 0.8rem; }
.history-tooltip em { color: var(--muted); font-style: normal; font-size: 0.76rem; margin-top: 4px; }
.history-day:hover .history-tooltip,
.history-day:focus-visible .history-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.history-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
}

.maintenance-hero {
  border-color: rgba(125, 178, 255, 0.42);
  background: linear-gradient(180deg, rgba(24, 39, 61, 0.96), rgba(12, 20, 34, 0.98));
}
.maintenance-hero .hero-icon {
  color: var(--maint);
  background: rgba(46, 98, 184, 0.24);
  border-color: rgba(125, 178, 255, 0.75);
}
.maintenance-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.maintenance-hero h1 {
  margin-bottom: 5px;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}
.maintenance-hero p {
  margin-bottom: 10px;
  color: #c7d8ef;
  font-size: 0.9rem;
}
.maintenance-hero-list {
  display: inline-grid;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
}
.maintenance-hero-item {
  border: 1px solid rgba(125, 178, 255, 0.28);
  border-radius: 12px;
  padding: 7px 10px;
  background: rgba(125, 178, 255, 0.08);
  display: grid;
  gap: 3px;
}
.maintenance-hero-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.maintenance-hero-item strong {
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
}
.maintenance-hero-item span {
  color: #c7d8ef;
  font-size: 0.76rem;
  white-space: nowrap;
}
.maintenance-hero-item p {
  margin: 0;
  color: #b9cde7;
  font-size: 0.76rem;
}

.status-overview {
  padding: 18px;
}
.status-overview .section-heading {
  margin-bottom: 14px;
}
.status-overview .section-heading h2 {
  font-size: 1.36rem;
}
.status-overview .group-block + .group-block {
  margin-top: 16px;
}
.status-overview .group-label {
  margin-bottom: 10px;
}
.status-overview .service-list {
  gap: 12px;
}
.status-overview .service-card {
  padding: 16px 18px;
}
.status-overview .service-main {
  gap: 18px;
}
.status-overview .service-title-row {
  margin-bottom: 5px;
}
.status-overview .service-title-row h3 {
  font-size: 1.12rem;
}
.status-overview .service-subtitle {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.2;
}
.status-overview .service-uptime-box {
  flex: 0 0 124px;
  width: 124px;
  min-width: 124px;
  border-radius: 12px;
  padding: 7px 9px 8px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
}
.status-overview .uptime-label {
  font-size: 0.56rem;
  margin: 0;
  letter-spacing: 0.16em;
  line-height: 1;
  white-space: nowrap;
}
.status-overview .service-uptime-box strong {
  font-size: 1.22rem;
  line-height: 1;
}
.status-overview .history-strip {
  gap: 4px;
  margin: 12px 0 8px;
}
.status-overview .history-day {
  height: 28px;
  border-radius: 10px;
}
.status-overview .history-caption {
  font-size: 0.8rem;
}

.incident-grid, .maintenance-list, .recent-list { display: grid; gap: 10px; }
.incident-card, .maintenance-card, .recent-card { padding: 10px 12px; }
.incident-header, .recent-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.incident-header h3, .maintenance-card h3, .recent-head h3 {
  margin: 0 0 2px;
  font-family: "Outfit", sans-serif;
  font-size: 0.96rem;
}
.incident-header p, .maintenance-card p, .recent-card p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.incident-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid currentColor;
}
.incident-badge-investigating { color: var(--warn); }
.incident-badge-identified { color: #87c1ff; }
.incident-badge-monitoring { color: var(--good); }
.incident-meta, .maintenance-meta, .recent-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #b8c7da;
  font-size: 0.78rem;
}
.impact-partial_outage, .impact-degraded { border-color: rgba(240, 191, 116, 0.35); }
.impact-major_outage { border-color: rgba(255, 110, 122, 0.35); }
.compact-block { height: 100%; }
.compact-recent-meta { margin-top: 0; }
.recent-card { min-height: 0; }
.recent-list {
  gap: 7px;
  max-height: min(52vh, 500px);
  overflow-y: auto;
  padding-right: 2px;
}
.recent-list .recent-card {
  padding: 9px 10px;
}
.recent-head { margin-bottom: 2px; }
.recent-head h3 {
  margin-bottom: 0;
  max-width: 100%;
  font-size: 0.9rem;
}
.recent-duration {
  color: var(--muted-strong);
  font-size: 0.7rem;
  white-space: nowrap;
}
.recent-meta-vertical {
  margin-top: 0;
  display: grid;
  gap: 2px;
  font-size: 0.74rem;
}
.recent-meta-vertical strong {
  color: var(--muted-strong);
  margin-right: 4px;
}
.recent-list::-webkit-scrollbar {
  width: 8px;
}
.recent-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.recent-list::-webkit-scrollbar-thumb {
  background: rgba(125, 178, 255, 0.35);
  border-radius: 999px;
}

@media (max-width: 940px) {
  .compact-heading,
  .service-main,
  .service-title-row,
  .incident-header,
  .recent-head,
  .hero-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
  .service-uptime-box {
    width: 100%;
    text-align: left;
  }
  .history-caption {
    flex-direction: column;
  }
  .recent-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .maintenance-hero-item-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .maintenance-hero-item-head span {
    white-space: normal;
  }
}
