:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --brand: #0b3d91;
  --link: #0550ae;
  --operational: #1a7f37;
  --maintenance: #0969da;
  --degraded: #9a6700;
  --degraded-bar: #d4a72c;
  --partial_outage: #bc4c00;
  --major_outage: #cf222e;
  --none: #d1d9e0;
  --tint: 8%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --text: #e6edf3;
    --muted: #9198a1;
    --border: #30363d;
    --brand: #4c8dff;
    --link: #58a6ff;
    --operational: #3fb950;
    --maintenance: #58a6ff;
    --degraded: #d29922;
    --degraded-bar: #d29922;
    --partial_outage: #f0883e;
    --major_outage: #f85149;
    --none: #30363d;
    --tint: 14%;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

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

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

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

h1, h2, h3 { line-height: 1.25; }

h2 { font-size: 1.05rem; margin: 32px 0 12px; }

/* Header and footer */

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }

.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.1rem; }

.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { stroke: #fff; }

.feed-link { font-size: 0.9rem; }

.site-footer { color: var(--muted); font-size: 0.85rem; padding: 24px 0 40px; }
.site-footer p { margin: 4px 0; }

/* Overall banner */

.overall {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0 8px; padding: 18px 20px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface);
}
.overall h1 { font-size: 1.3rem; margin: 0; }
.overall p { margin: 2px 0 0; font-size: 0.9rem; }
.overall-icon { width: 36px; height: 36px; flex: none; }
.overall-icon svg { width: 100%; height: 100%; }

.overall.lvl-operational { border-color: var(--operational); background: color-mix(in srgb, var(--operational) var(--tint), var(--surface)); }
.overall.lvl-maintenance { border-color: var(--maintenance); background: color-mix(in srgb, var(--maintenance) var(--tint), var(--surface)); }
.overall.lvl-degraded { border-color: var(--degraded); background: color-mix(in srgb, var(--degraded) var(--tint), var(--surface)); }
.overall.lvl-partial_outage { border-color: var(--partial_outage); background: color-mix(in srgb, var(--partial_outage) var(--tint), var(--surface)); }
.overall.lvl-major_outage { border-color: var(--major_outage); background: color-mix(in srgb, var(--major_outage) var(--tint), var(--surface)); }

.stale {
  margin: 20px 0 0; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--degraded); background: color-mix(in srgb, var(--degraded) var(--tint), var(--surface));
  font-size: 0.9rem;
}

/* Level colours and labels */

.lvl-text { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.lvl-text svg { width: 16px; height: 16px; flex: none; }
.c-operational { color: var(--operational); }
.c-maintenance { color: var(--maintenance); }
.c-degraded { color: var(--degraded); }
.c-partial_outage { color: var(--partial_outage); }
.c-major_outage { color: var(--major_outage); }

/* Groups and components */

.group { margin-top: 28px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }

.component { padding: 16px 20px; }
.component + .component { border-top: 1px solid var(--border); }

.component-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.component-name { font-weight: 600; margin: 0; font-size: 1rem; }
.component-desc { margin: 2px 0 0; font-size: 0.85rem; }
.component-message { margin: 8px 0 0; font-size: 0.9rem; }

.bars { display: flex; gap: 2px; height: 32px; margin-top: 12px; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--none); }
.bar.lvl-operational { background: var(--operational); }
.bar.lvl-maintenance { background: var(--maintenance); }
.bar.lvl-degraded { background: var(--degraded-bar); }
.bar.lvl-partial_outage { background: var(--partial_outage); }
.bar.lvl-major_outage { background: var(--major_outage); }

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

/* Notices */

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

.notice-card { background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; padding: 14px 18px; }
.notice-card.lvl-maintenance { border-left-color: var(--maintenance); }
.notice-card.lvl-degraded { border-left-color: var(--degraded); }
.notice-card.lvl-partial_outage { border-left-color: var(--partial_outage); }
.notice-card.lvl-major_outage { border-left-color: var(--major_outage); }
.notice-card.ended { border-left-color: var(--border); }

.notice-title { margin: 0; font-size: 1rem; }
.notice-meta { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; margin-right: 6px; }

.updates { list-style: none; margin: 10px 0 0; padding: 0; }
.updates li { margin: 0; padding: 8px 0 0; }
.updates li + li { border-top: 1px dashed var(--border); margin-top: 8px; }
.update-status { font-weight: 600; text-transform: capitalize; }
.update-time { color: var(--muted); font-size: 0.82rem; }
.update-message { margin: 2px 0 0; white-space: pre-line; }

details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--link); font-size: 0.85rem; }

.empty { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 600px) {
  .bar.older { display: none; }
  .legend-long { display: none; }
  .legend-short { display: inline; }
  .component { padding: 14px 16px; }
  .overall { padding: 16px; }
}
