:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5d5d58;
  --border: #deded8;
  --operational: #1f7a3f;
  --degraded: #9a6200;
  --partial_outage: #b84a00;
  --major_outage: #b3261e;
  --maintenance: #2f5fa7;
  --unknown: #5d5d58;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1f1f1d;
    --text: #ececea;
    --muted: #a6a6a0;
    --border: #3a3a36;
    --operational: #5cc27f;
    --degraded: #e0a73a;
    --partial_outage: #f0874a;
    --major_outage: #f2766d;
    --maintenance: #7da6e8;
    --unknown: #a6a6a0;
  }
}

* { box-sizing: border-box; }

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

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--border); background: var(--surface); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 32px 0 12px; }

.lang {
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.muted { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }

.banner {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--state, var(--unknown));
  background: var(--surface);
}
.banner p:first-child { margin: 0; font-weight: 600; font-size: 1.1rem; }

.components, .external { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.components li, .external li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.components li:first-child, .external li:first-child { border-top: 0; }
.components li.child { padding-left: 36px; font-size: 0.95rem; }

.state { display: inline-flex; align-items: center; gap: 8px; color: var(--state); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--state); }

[data-state="operational"] { --state: var(--operational); }
[data-state="degraded"] { --state: var(--degraded); }
[data-state="partial_outage"] { --state: var(--partial_outage); }
[data-state="major_outage"] { --state: var(--major_outage); }
[data-state="maintenance"] { --state: var(--maintenance); }
[data-state="unknown"] { --state: var(--unknown); }

.incident { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 12px; border-left: 6px solid var(--state, var(--border)); }
.incident h3 { margin: 0 0 4px; font-size: 1rem; }
.incident ol { list-style: none; margin: 12px 0 0; padding: 0; }
.incident li { padding: 8px 0; border-top: 1px solid var(--border); }
.incident li p { margin: 2px 0 0; }
.incident .when { color: var(--muted); font-size: 0.85rem; }
.incident .next { font-weight: 600; }

a { color: inherit; }
.footer { padding-top: 32px; padding-bottom: 48px; color: var(--muted); font-size: 0.9rem; }
