:root {
  --accent: #111827;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5f6672;
  --border: #e3e5e9;
  --ok: #1f9d55;
  --warn: #c98a04;
  --bad: #d23434;
  --info: #2f6fd6;
  --none: #d9dce1;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #181a1f;
    --text: #eceef2;
    --muted: #9aa1ad;
    --border: #2a2d34;
    --ok: #34b36b;
    --warn: #e0a520;
    --bad: #ec5a5a;
    --info: #5b93ee;
    --none: #33363e;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: grid;
  gap: 24px;
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 12px;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.masthead-label {
  color: var(--muted);
  font-size: 1.1rem;
}

.summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--none);
}

.summary[data-status='operational'] { border-left-color: var(--ok); }
.summary[data-status='degraded'] { border-left-color: var(--warn); }
.summary[data-status='down'] { border-left-color: var(--bad); }

.summary .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  background: var(--none);
}

.summary[data-status='operational'] .dot { background: var(--ok); }
.summary[data-status='degraded'] .dot { background: var(--warn); }
.summary[data-status='down'] .dot { background: var(--bad); }

.summary-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.section-title {
  margin: 8px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.notices,
.recent {
  display: grid;
  gap: 12px;
}

.notice {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--info);
}

.notice[data-severity='maintenance'] { border-left-color: var(--info); }
.notice[data-severity='degraded'] { border-left-color: var(--warn); }
.notice[data-severity='outage'] { border-left-color: var(--bad); }

.recent .notice {
  border-left-color: var(--none);
}

.notice-kind {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.notice-title {
  margin: 2px 0 6px;
  font-size: 1.1rem;
}

.notice-body {
  margin: 0 0 8px;
  white-space: pre-line;
}

.notice-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.875rem;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.row {
  display: block;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

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

.row-link:hover .row-name {
  text-decoration: underline;
}

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

.row-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.row-description {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.pill {
  flex: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.pill[data-status='operational'] { color: var(--ok); }
.pill[data-status='degraded'] { color: var(--warn); }
.pill[data-status='down'] { color: var(--bad); }

.bars {
  display: flex;
  gap: 2px;
  height: 32px;
  margin-top: 12px;
}

.bar {
  flex: 1;
  border-radius: 2px;
  background: var(--none);
}

.bar[data-status='operational'] { background: var(--ok); }
.bar[data-status='degraded'] { background: var(--warn); }
.bar[data-status='down'] { background: var(--bad); }

.bars-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.only-narrow {
  display: none;
}

@media (max-width: 600px) {
  .bar:nth-child(-n + 60) {
    display: none;
  }
  .only-wide {
    display: none;
  }
  .only-narrow {
    display: inline;
  }
  .row,
  .summary {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.footer {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer .stale {
  color: var(--bad);
  font-weight: 600;
}
