:root {
  color-scheme: light dark;
  --ds-ash: #1a1905;
  --ds-neutral: #f9f9f5;
  --ds-chartreuse: #e5df00;
  --bg: var(--ds-neutral);
  --surface: #ffffff;
  --surface-muted: #f1f1ec;
  --text: var(--ds-ash);
  --muted: #686754;
  --border: #dedecf;
  --accent: var(--ds-chartreuse);
  --accent-ink: #302f05;
  --green: #376f3b;
  --green-bg: #edf5e7;
  --yellow: #8b5e00;
  --yellow-bg: #fff1cb;
  --red: #b04439;
  --red-bg: #f9e3df;
  --gray: #636254;
  --gray-bg: #eeeee5;
  --shadow: 0 18px 60px rgba(26, 25, 5, 0.08);
  --tooltip-bg: var(--text);
  --tooltip-text: #ffffff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11110c;
    --surface: #1c1b14;
    --surface-muted: #26251c;
    --text: #f5f3e8;
    --muted: #b7b39f;
    --border: #343226;
    --accent-ink: #f5f3e8;
    --green: #9ccc80;
    --green-bg: #203520;
    --yellow: #f1d36a;
    --yellow-bg: #3b3015;
    --red: #ff9a8a;
    --red-bg: #3c211e;
    --gray: #c3beab;
    --gray-bg: #2d2b22;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
    --tooltip-bg: #f5f3e8;
    --tooltip-text: #11110c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

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

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 30px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: block;
}

.brand-wordmark {
  display: block;
  width: 150px;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  .brand-wordmark {
    filter: invert(1);
  }
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 10px;
  font-size: clamp(34px, 5.5vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.summary {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

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

.status-badge.degraded {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.status-badge.partial_outage {
  color: var(--red);
  background: var(--red-bg);
}

.status-badge.unknown {
  color: var(--gray);
  background: var(--gray-bg);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 16px;
}

.window-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
}

button {
  min-width: 56px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.selected {
  background: var(--ds-ash);
  color: var(--ds-neutral);
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 30px;
  border-radius: 8px;
}

.overview > div {
  padding: 18px 20px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 34px rgba(26, 25, 5, 0.05);
}

.overview span,
.component-metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.overview small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.overview strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.system-status {
  margin-top: 4px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 20px;
}

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

.components {
  display: grid;
  gap: 12px;
}

.category {
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(26, 25, 5, 0.04);
}

.category-summary {
  display: grid;
  grid-template-columns: 18px minmax(170px, 1fr) 118px 130px 112px;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.category-summary::-webkit-details-marker {
  display: none;
}

.category-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.category[open] .category-chevron {
  transform: rotate(45deg);
}

.category-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.category-count,
.category-uptime {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.category-summary .status-badge {
  justify-self: end;
}

.category-components {
  border-top: 1px solid var(--border);
}

.component {
  padding: 12px 16px;
}

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

.component-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.component h3 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.3;
}

.component-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.component-metrics strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 15px;
}

.sparkline {
  display: grid;
  grid-template-columns: repeat(96, minmax(2px, 1fr));
  gap: 2px;
  margin-top: 10px;
  min-height: 16px;
  overflow: visible;
}

.sparkline span {
  position: relative;
  min-height: 16px;
  border-radius: 2px;
  background: var(--gray-bg);
  outline: none;
}

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

.sparkline .degraded {
  background: var(--yellow);
}

.sparkline .partial_outage {
  background: var(--red);
}

.sparkline span::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 5;
  width: max-content;
  max-width: 220px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  white-space: nowrap;
}

.sparkline span::before {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  z-index: 5;
  width: 8px;
  height: 8px;
  background: var(--tooltip-bg);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) rotate(45deg);
  transition: opacity 120ms ease;
}

.sparkline span:hover::after,
.sparkline span:focus-visible::after,
.sparkline span:hover::before,
.sparkline span:focus-visible::before {
  opacity: 1;
}

.sparkline span:hover::after,
.sparkline span:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 24px 0;
  }

  .header,
  .toolbar,
  .component-main {
    flex-direction: column;
    align-items: stretch;
  }

  .header {
    padding: 22px;
  }

  .brand {
    margin-bottom: 22px;
  }

  .overview,
  .component-metrics {
    grid-template-columns: 1fr;
  }

  .category-summary {
    grid-template-columns: 18px 1fr;
  }

  .category-summary .status-badge,
  .category-count,
  .category-uptime {
    grid-column: 2 / -1;
    justify-self: start;
    text-align: left;
  }

  .status-badge {
    width: fit-content;
  }
}
