:root {
  color-scheme: dark;

  --md-color-bg: #0f1722;
  --md-color-bg-soft: #17202d;
  --md-color-surface: rgb(22 31 43 / 94%);
  --md-color-surface-strong: rgb(18 26 37 / 97%);
  --md-color-border: rgb(120 144 170 / 20%);
  --md-color-border-strong: rgb(141 167 196 / 30%);
  --md-color-text-primary: #e8eef5;
  --md-color-text-secondary: #afbccb;
  --md-color-text-muted: #7d8b9d;
  --md-color-success: #53b39a;
  --md-color-success-soft: rgb(83 179 154 / 10%);
  --md-color-danger: #d06e5f;
  --md-color-danger-soft: rgb(208 110 95 / 10%);
  --md-color-action: #dbe6f2;
  --md-color-action-bg: rgb(219 230 242 / 8%);
  --md-color-action-bg-hover: rgb(219 230 242 / 13%);
  --md-gradient-bg:
    radial-gradient(circle at top left, rgb(88 126 168 / 12%) 0%, transparent 30%),
    linear-gradient(180deg, #0f1722 0%, #131c28 100%);
  --md-shadow-md: 0 18px 36px rgb(3 8 16 / 24%);
  --md-radius-sm: 10px;
  --md-radius-md: 14px;
  --md-radius-lg: 18px;
  --md-radius-xl: 22px;
  --md-radius-pill: 999px;
  --md-space-xs: 4px;
  --md-space-sm: 8px;
  --md-space-md: 12px;
  --md-space-lg: 16px;
  --md-space-xl: 24px;
  --md-space-2xl: 32px;
  --md-space-3xl: 40px;
  --md-font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --md-font-sans: "Aptos", "Segoe UI", "SF Pro Text", "Helvetica Neue", sans-serif;
  --md-text-xs: 11px;
  --md-text-sm: 12px;
  --md-text-md: 13px;
  --md-text-lg: 15px;
  --md-text-xl: 18px;
  --md-text-display: clamp(3rem, 5.8vw, 4.9rem);
  --md-text-banner: clamp(1.6rem, 2.6vw, 2.35rem);
  --md-line-tight: 1.2;
  --md-line-normal: 1.55;
  --md-tracking-title: 0.04em;
  --md-tracking-eyebrow: 0.22em;
  --md-motion-med: 180ms;
  --md-ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--md-color-text-primary);
  background: var(--md-gradient-bg);
  background-attachment: fixed;
  font-family: var(--md-font-sans);
  font-size: var(--md-text-lg);
  line-height: var(--md-line-normal);
}

button,
input,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid rgb(141 167 196 / 68%);
  outline-offset: 2px;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--md-space-2xl) 20px 56px;
}

.status-overview,
.page-error,
.components-empty {
  position: relative;
  border: 1px solid var(--md-color-border);
  border-radius: var(--md-radius-xl);
  background: var(--md-color-surface);
  box-shadow: var(--md-shadow-md);
}

.page-header {
  display: flex;
  justify-content: flex-start;
  gap: var(--md-space-xl);
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 var(--md-space-sm);
  color: var(--md-color-text-muted);
  font-size: var(--md-text-xs);
  font-weight: 700;
  letter-spacing: var(--md-tracking-eyebrow);
  text-transform: uppercase;
}

h1,
h2,
h3,
.banner-title {
  margin: 0;
  color: var(--md-color-text-primary);
  line-height: var(--md-line-tight);
}

h1 {
  font-family: var(--md-font-display);
  font-size: var(--md-text-display);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

h2 {
  font-family: var(--md-font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

h3,
.banner-title {
  letter-spacing: -0.025em;
}

.banner-title {
  font-family: var(--md-font-display);
  font-size: var(--md-text-banner);
  font-weight: 700;
  line-height: 1;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
}

.page-intro,
.banner-copy,
.error-copy,
.component-summary,
.section-heading p,
.last-updated {
  color: var(--md-color-text-secondary);
}

.page-intro {
  max-width: 36rem;
  margin: 10px 0 0;
  font-size: 0.98rem;
}

.refresh-button,
.retry-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid var(--md-color-border-strong);
  border-radius: var(--md-radius-pill);
  color: var(--md-color-action);
  background: var(--md-color-action-bg);
  font-size: var(--md-text-md);
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color var(--md-motion-med) var(--md-ease-standard),
    background-color var(--md-motion-med) var(--md-ease-standard);
}

.refresh-inline {
  min-height: 32px;
  padding: 5px 10px;
  font-size: var(--md-text-sm);
  font-weight: 450;
  color: rgb(203 215 231 / 88%);
  background: rgb(219 230 242 / 5%);
  border-color: rgb(141 167 196 / 24%);
}

.refresh-button:hover,
.retry-button:hover {
  border-color: rgb(141 167 196 / 42%);
  background: var(--md-color-action-bg-hover);
}

.status-overview,
.page-error {
  padding: 24px;
}

.status-overview {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-block: 28px;
}

.status-overview.operational {
  background:
    linear-gradient(90deg, var(--md-color-success-soft), transparent 22%),
    var(--md-color-surface-strong);
}

.status-overview.outage,
.page-error {
  background:
    linear-gradient(90deg, var(--md-color-danger-soft), transparent 22%),
    var(--md-color-surface-strong);
}

.overview-main {
  max-width: 44rem;
}

.overview-main .eyebrow {
  margin-bottom: 10px;
}

.overview-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.banner-copy {
  max-width: 32rem;
  margin-top: 10px;
  font-size: 0.96rem;
}

.overview-meta {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 10px;
  min-width: 212px;
  max-width: 228px;
  padding-top: 8px;
}

.overview-label,
.cell-label {
  display: block;
  color: var(--md-color-text-muted);
  font-size: var(--md-text-xs);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.overview-meta strong,
.component-cell strong {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.component-cell strong {
  font-size: var(--md-text-md);
  font-weight: 500;
  color: rgb(189 202 219 / 88%);
}

.overview-note,
.overview-timestamp {
  margin: 0;
  color: var(--md-color-text-secondary);
  text-align: left;
}

.overview-note {
  font-size: 0.94rem;
  line-height: 1.3;
}

.overview-timestamp {
  font-size: 0.85rem;
  color: var(--md-color-text-muted);
}

.overview-utility {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--md-space-sm);
  padding: 8px 14px;
  border: 1px solid var(--md-color-border-strong);
  border-radius: var(--md-radius-pill);
  background: rgb(15 22 31 / 86%);
  font-size: var(--md-text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill.operational {
  color: var(--md-color-success);
}

.status-pill.outage {
  color: var(--md-color-danger);
}

.components-section {
  margin-top: 28px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading p {
  margin: 6px 0 0;
  max-width: 42rem;
  font-size: var(--md-text-md);
}

.components-grid {
  display: block;
}

.components-list {
  display: grid;
  gap: 0;
  border-top: 1px solid rgb(141 167 196 / 12%);
}

.components-list-head,
.component-row {
  display: grid;
  grid-template-columns: minmax(0, 2.9fr) minmax(128px, 0.85fr) minmax(80px, 0.5fr) minmax(92px, 0.58fr) minmax(168px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.components-list-head {
  padding: 8px 0 14px;
  color: rgb(160 180 204 / 90%);
  font-size: var(--md-text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid rgb(141 167 196 / 20%);
}

.component-row {
  padding: 18px 0 16px;
  border-top: 1px solid rgb(141 167 196 / 10%);
  background: transparent;
  box-shadow: none;
}

.component-row:first-of-type {
  border-top: 0;
}

.component-row:nth-child(2n) {
  padding-top: 22px;
  padding-bottom: 18px;
}

.component-primary {
  padding-right: 18px;
  position: relative;
}

.component-primary .eyebrow {
  margin-bottom: 6px;
  color: rgb(125 140 158 / 84%);
}

.component-primary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: linear-gradient(180deg, rgb(141 167 196 / 0%), rgb(141 167 196 / 12%), rgb(141 167 196 / 0%));
}

.component-primary h3 {
  font-family: var(--md-font-display);
  font-size: 1.06rem;
  margin-bottom: 4px;
  padding-left: 12px;
  font-weight: 700;
  line-height: 1.05;
}

.component-cell {
  padding-top: 4px;
  border-left: 1px solid rgb(141 167 196 / 08%);
  padding-left: 14px;
}

.component-cell strong {
  color: rgb(196 208 223 / 90%);
}

.component-cell:last-child strong {
  color: rgb(182 197 216 / 88%);
}

.component-status {
  align-self: start;
  padding-top: 0;
  border-left: 0;
  padding-left: 0;
}

.component-summary {
  margin: 5px 0 0;
  padding-left: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 28rem;
}

.overview-note {
  font-family: var(--md-font-display);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.component-row.outage .component-primary h3 {
  color: rgb(236 199 192 / 96%);
}

.component-row.outage .component-summary {
  color: rgb(211 154 145 / 92%);
}

.component-cell:last-child strong {
  font-size: var(--md-text-sm);
  letter-spacing: 0.01em;
  color: rgb(173 189 209 / 84%);
}

.loading-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
}

.loading-line {
  height: 14px;
  margin-top: 4px;
  border-radius: var(--md-radius-pill);
  background: rgb(126 148 176 / 14%);
}

.loading-line.short {
  width: 38%;
}

.loading-line.medium {
  width: 58%;
}

.loading-line.long {
  width: 88%;
}

.components-empty {
  padding: 20px;
  background: rgb(24 33 46 / 94%);
}

.components-empty p:last-child {
  margin: 0;
  color: var(--md-color-text-secondary);
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding-top: 20px;
  }

  .page-header,
  .status-overview {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .overview-meta {
    width: 100%;
    justify-items: start;
    padding-top: 0;
  }

  .refresh-button,
  .retry-button {
    width: 100%;
  }

  .refresh-inline {
    width: auto;
  }

  .components-list-head {
    display: none;
  }

  .component-row {
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
    padding: 16px 0;
  }

  .component-row:nth-child(2n) {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .component-primary {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  .component-primary::before {
    display: none;
  }

  .component-status {
    justify-self: start;
  }

  .component-cell {
    padding-top: 0;
    padding-left: 0;
    border-left: 0;
  }

  .overview-note,
  .overview-timestamp {
    text-align: left;
  }

  .overview-utility {
    align-items: flex-start;
  }
}
