:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text: #111827;
  --text-soft: #374151;
  --text-muted: #6b7280;
  --line: #d9dee7;
  --line-soft: #edf0f4;
  --green: #16a36d;
  --green-bg: #edfdf5;
  --amber: #c97914;
  --amber-bg: #fff7e8;
  --red: #dc3b3f;
  --red-bg: #fff0f0;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  color-scheme: light;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.status-shell {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  padding: 1.35rem 0 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 0 1.15rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 7.75rem;
  max-width: 44vw;
  height: auto;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 650;
  white-space: nowrap;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--text);
  outline: none;
}

.status-main {
  display: grid;
  gap: 0.9rem;
  padding-top: 1rem;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.subscribe-menu {
  position: relative;
}

.subscribe-button {
  display: inline-flex;
  min-height: 2.18rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.85rem;
  border: 1px solid #111827;
  border-radius: 6px;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 680;
  letter-spacing: 0;
}

.subscribe-button:hover,
.subscribe-button:focus-visible {
  background: #242b38;
  outline: none;
}

.subscribe-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 20;
  display: grid;
  width: min(17.5rem, calc(100vw - 2rem));
  padding: 0.36rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.12);
}

.subscribe-popover[hidden] {
  display: none;
}

.subscribe-popover a,
.subscribe-popover button {
  display: grid;
  gap: 0.12rem;
  width: 100%;
  padding: 0.62rem 0.66rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.subscribe-popover a:hover,
.subscribe-popover a:focus-visible,
.subscribe-popover button:hover,
.subscribe-popover button:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.subscribe-popover strong {
  font-size: 0.84rem;
  line-height: 1.15;
}

.subscribe-popover span {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.systems-section,
.status-grid {
  display: grid;
  gap: 0.9rem;
}

.status-card {
  min-width: 0;
  padding: 1rem;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.section-header--compact {
  margin-bottom: 0.65rem;
}

.section-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: 0;
}

.section-header p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0 0.58rem;
  border: 1px solid rgba(22, 163, 109, 0.22);
  border-radius: 999px;
  background: var(--green-bg);
  color: #08734d;
  font-size: 0.73rem;
  font-weight: 720;
  white-space: nowrap;
}

.summary-pill[data-tone="degraded"] {
  border-color: rgba(201, 121, 20, 0.24);
  background: var(--amber-bg);
  color: #8d520b;
}

.summary-pill[data-tone="outage"] {
  border-color: rgba(220, 59, 63, 0.24);
  background: var(--red-bg);
  color: #a92025;
}

.component-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem 7.5rem;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.component-table-head span:last-child {
  text-align: right;
}

.component-groups {
  display: grid;
}

.component-row {
  display: block;
  border-top: 1px solid var(--line-soft);
}

.component-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.45rem;
  padding: 0.72rem 0.7rem;
  cursor: pointer;
  list-style: none;
}

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

.component-dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 109, 0.12);
}

.component-dot[data-tone="degraded"] {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(201, 121, 20, 0.12);
}

.component-dot[data-tone="outage"] {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 59, 63, 0.11);
}

.component-name {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.component-name strong {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 680;
  line-height: 1.2;
}

.component-state {
  display: inline-flex;
  justify-self: start;
  color: #08734d;
  font-size: 0.76rem;
  font-weight: 720;
  white-space: nowrap;
}

.component-state[data-tone="degraded"] {
  color: #8d520b;
}

.component-state[data-tone="outage"] {
  color: #a92025;
}

.component-row--loading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 3.45rem;
  padding: 0.72rem 0.7rem;
}

.component-history {
  display: inline-grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 0.1rem;
  width: min(100%, 18rem);
  justify-content: end;
}

.component-history__bar {
  display: block;
  width: 100%;
  min-width: 0.12rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--green);
}

.component-history__bar[data-tone="degraded"] {
  background: var(--amber);
}

.component-history__bar[data-tone="outage"] {
  background: var(--red);
}

.component-chevron {
  width: 0.46rem;
  height: 0.46rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 160ms ease;
}

.component-row[open] .component-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.component-detail {
  display: grid;
  gap: 0.62rem;
  padding: 0 0.7rem 0.78rem 2.08rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.component-detail__top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
}

.component-detail p {
  flex: 1 1 16rem;
  margin: 0;
}

.component-history-panel {
  display: grid;
  grid-template-columns: auto minmax(10rem, 18rem);
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.58rem;
  border-top: 1px solid var(--line-soft);
}

.component-history-panel > span:first-child {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 680;
  white-space: nowrap;
}

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

.status-card--quiet {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.55rem;
}

.timeline-list {
  display: grid;
  gap: 0.55rem;
}

.timeline-list--compact {
  gap: 0.42rem;
}

.timeline-item,
.empty-state {
  display: grid;
  gap: 0.32rem;
  padding: 0.78rem;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.timeline-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.timeline-item strong,
.empty-state strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 680;
  line-height: 1.25;
}

.timeline-item--compact {
  padding: 0.66rem;
}

.timeline-item p,
.empty-state p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.36;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.58rem;
  min-height: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
}

.timeline-meta:empty {
  display: none;
}

.timeline-meta span,
.timeline-meta time {
  display: inline-flex;
}

.timeline-state {
  display: inline-flex;
  min-height: 1.35rem;
  align-items: center;
  padding: 0 0.48rem;
  border-radius: 999px;
  background: var(--green-bg);
  color: #08734d;
  font-size: 0.68rem;
  font-weight: 760;
  white-space: nowrap;
}

.timeline-state[data-tone="degraded"] {
  background: var(--amber-bg);
  color: #8d520b;
}

.timeline-state[data-tone="outage"] {
  background: var(--red-bg);
  color: #a92025;
}

.event-updates {
  display: grid;
  gap: 0.48rem;
  margin-top: 0.18rem;
  padding-top: 0.48rem;
  border-top: 1px solid var(--line);
}

.event-update {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
}

.event-update__dot {
  width: 0.48rem;
  height: 0.48rem;
  margin-top: 0.22rem;
  border-radius: 50%;
  background: var(--green);
}

.event-update__dot[data-tone="degraded"] {
  background: var(--amber);
}

.event-update__dot[data-tone="outage"] {
  background: var(--red);
}

.event-update strong {
  display: block;
  margin: 0 0 0.12rem;
  font-size: 0.78rem;
}

.event-update p {
  margin: 0;
}

.event-update time {
  display: block;
  margin-top: 0.14rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.past-incidents {
  min-width: 0;
}

.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.subsection-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 720;
  line-height: 1.1;
}

.subsection-header span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-footer {
  display: grid;
  justify-items: center;
  gap: 0.34rem;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 560;
  line-height: 1.4;
  text-align: center;
}

.status-footer a {
  color: var(--text-soft);
  font-weight: 700;
}

.status-footer a:hover,
.status-footer a:focus-visible {
  color: var(--text);
  outline: none;
}

.status-footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .status-shell {
    width: min(100% - 1rem, 960px);
    padding-top: 0.8rem;
  }

  .topbar {
    align-items: flex-start;
    gap: 0.9rem;
  }

  .topnav {
    overflow: visible;
    justify-content: flex-start;
    max-width: 58vw;
    gap: 0.8rem;
  }

  .subscribe-popover {
    right: 0;
    left: auto;
  }

  .component-table-head {
    display: none;
  }

  .component-history {
    gap: 0.06rem;
  }

  .component-history__bar {
    height: 1.8rem;
  }

  .status-grid--lower,
  .status-card--quiet {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand-logo {
    width: 7rem;
    max-width: 42vw;
  }

  .topnav {
    max-width: 70vw;
  }

  .status-card {
    border-radius: 7px;
  }

  .section-header {
    display: grid;
  }

  .summary-pill {
    justify-self: start;
  }

  .component-row {
    align-items: start;
  }

  .component-summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.62rem;
  }

  .component-detail {
    padding-left: 1.9rem;
  }

  .component-history-panel {
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }

  .component-history {
    gap: 0.045rem;
    width: 100%;
    margin-top: 0;
  }

  .component-history__bar {
    height: 1.62rem;
  }
}
