:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16191d;
  --muted: #5d6673;
  --border: #dde1e6;
  --operational: #1f9d55;
  --degraded: #d9a400;
  --partial_outage: #e07020;
  --major_outage: #d03535;
  --unknown: #7a8491;
  --nodata: #d3d8de;
  --accent: #c47f00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1215;
    --surface: #181c21;
    --text: #e8ebee;
    --muted: #98a2ae;
    --border: #2a3038;
    --operational: #35b56c;
    --degraded: #e3b520;
    --partial_outage: #ee8438;
    --major_outage: #e85555;
    --unknown: #8a94a0;
    --nodata: #333a43;
    --accent: #f0b429;
  }
}

* { 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;
}

.site-header, main, .site-footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 28px;
  padding-bottom: 20px;
}

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

.brand-sub { color: var(--muted); font-size: 1.05rem; }

h1 { margin: 0; font-size: 1.3rem; line-height: 1.3; }
h2 { margin: 36px 0 12px; font-size: 1.05rem; }

a { color: var(--accent); }

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--unknown);
}

.banner-detail { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.banner-detail:empty { display: none; }

.banner.s-operational { border-left-color: var(--operational); }
.banner.s-degraded { border-left-color: var(--degraded); }
.banner.s-partial_outage { border-left-color: var(--partial_outage); }
.banner.s-major_outage { border-left-color: var(--major_outage); }

/* Status is carried by icon shape and text as well as colour. */
.icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  background: var(--unknown);
}

.icon.s-operational { background: var(--operational); }
.icon.s-degraded { background: var(--degraded); color: #1b1b1b; }
.icon.s-partial_outage { background: var(--partial_outage); }
.icon.s-major_outage { background: var(--major_outage); }

.component {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

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

.component-name { font-weight: 600; }

.component-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.bar {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  height: 34px;
}

.seg {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--nodata);
  cursor: pointer;
}

.seg.s-operational { background: var(--operational); }
.seg.s-degraded { background: var(--degraded); }
.seg.s-partial_outage { background: var(--partial_outage); }
.seg.s-major_outage { background: var(--major_outage); }

.seg:hover, .seg:focus-visible, .seg.is-selected {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.bar-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.day-detail { min-height: 1.4em; margin: 6px 0 0; font-size: 0.9rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.legend li { display: inline-flex; align-items: center; gap: 6px; }

.swatch { width: 12px; height: 12px; border-radius: 2px; background: var(--nodata); }
.swatch.s-operational { background: var(--operational); }
.swatch.s-degraded { background: var(--degraded); }
.swatch.s-partial_outage { background: var(--partial_outage); }
.swatch.s-major_outage { background: var(--major_outage); }

.incident {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.incident-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.incident-times { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

.empty { color: var(--muted); }

.site-footer {
  margin-top: 40px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.noscript { max-width: 820px; margin: 0 auto; padding: 0 16px 24px; }

@media (max-width: 520px) {
  .bar { gap: 1px; height: 28px; }
  .seg { border-radius: 1px; }
}
