:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5b6270;
  --border: #e2e5ea;
  --ok: #1f8a4c;
  --ok-soft: #e7f5ec;
  --warn: #b26a00;
  --warn-soft: #fdf3e2;
  --down: #c62f2f;
  --down-soft: #fbe9e9;
  --none: #d5d9e0;
  --focus: #2457d6;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #eceef2;
    --muted: #a3a9b5;
    --border: #2c3039;
    --ok: #3fbf74;
    --ok-soft: #173023;
    --warn: #e0a440;
    --warn-soft: #33281a;
    --down: #ef6464;
    --down-soft: #3a1d1f;
    --none: #3a3f4a;
    --focus: #7ea2ff;
  }
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.site-header {
  padding: 28px 0 8px;
}

.brand {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand span {
  font-weight: 400;
  color: var(--muted);
}

main {
  padding-bottom: 32px;
}

h1 {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.3;
}

h2 {
  margin: 40px 0 12px;
  font-size: 1.0625rem;
}

.overall {
  margin-top: 16px;
  padding: 20px 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left-width: 6px;
  background: var(--surface);
}

.overall p {
  margin: 4px 0 0;
  color: var(--muted);
}

.overall[data-state="operational"] {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.overall[data-state="degraded"] {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.overall[data-state="outage"] {
  border-left-color: var(--down);
  background: var(--down-soft);
}

.notice {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--warn);
  background: var(--warn-soft);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.section-head h2 {
  margin-bottom: 12px;
}

.legend {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.components,
.incidents {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.component,
.incident {
  padding: 16px 20px;
}

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

.component-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.pill[data-status="operational"] {
  color: var(--ok);
}

.pill[data-status="degraded"] {
  color: var(--warn);
}

.pill[data-status="down"] {
  color: var(--down);
}

.bars {
  display: grid;
  grid-template-columns: repeat(var(--days, 90), minmax(0, 1fr));
  gap: 2px;
  height: 32px;
  margin: 12px 0 6px;
}

@media (max-width: 480px) {
  .bars {
    gap: 1px;
  }
}

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

.bar[data-level="ok"] {
  background: var(--ok);
}

.bar[data-level="minor"] {
  background: var(--warn);
}

.bar[data-level="major"] {
  background: var(--down);
}

.bars-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted);
}

.incident-title {
  margin: 0;
  font-weight: 600;
}

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

.incident[data-open="true"] .incident-title {
  color: var(--down);
}

.empty {
  margin: 0;
  padding: 16px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.site-footer {
  padding: 8px 0 40px;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p {
  margin: 4px 0;
}
