:root {
  --bg: #f5f6f8; --surface: #ffffff; --text: #14181f; --muted: #556070; --border: #dde2e8;
  --ok-fg: #0b6b2e; --ok-bg: #e6f4ea;
  --deg-fg: #7a4b00; --deg-bg: #fff3d6;
  --part-fg: #8a3a00; --part-bg: #ffe8d6;
  --maj-fg: #a1081c; --maj-bg: #fde7ea;
  --maint-fg: #0a4f96; --maint-bg: #e3effb;
  --unk-fg: #48515e; --unk-bg: #eceff3;
  --link: #0a55a8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1318; --surface: #181d24; --text: #e8ecf1; --muted: #9aa5b3; --border: #2a313b;
    --ok-fg: #6fd08c; --ok-bg: #12301d;
    --deg-fg: #f5c451; --deg-bg: #3a2c08;
    --part-fg: #ff9d5c; --part-bg: #3d2210;
    --maj-fg: #ff8a95; --maj-bg: #401318;
    --maint-fg: #7db8f5; --maint-bg: #10294a;
    --unk-fg: #b3bcc8; --unk-bg: #262c35;
    --link: #7db8f5;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1318; --surface: #181d24; --text: #e8ecf1; --muted: #9aa5b3; --border: #2a313b;
  --ok-fg: #6fd08c; --ok-bg: #12301d;
  --deg-fg: #f5c451; --deg-bg: #3a2c08;
  --part-fg: #ff9d5c; --part-bg: #3d2210;
  --maj-fg: #ff8a95; --maj-bg: #401318;
  --maint-fg: #7db8f5; --maint-bg: #10294a;
  --unk-fg: #b3bcc8; --unk-bg: #262c35;
  --link: #7db8f5;
}
* { box-sizing: border-box; }
/* Zooming is switched off (see the viewport line in each page), including by double tap. */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

  font: inherit; color: #fff; background: transparent; border: 1px solid #5a6472;
  border-radius: 999px; padding: 4px 12px; cursor: pointer; min-height: 32px;
}

header.site { background: var(--surface); }
header.site .wrap { display: flex; align-items: center; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.logo { height: 52px; width: auto; flex: none; color: var(--text); display: block; }
.site-title { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.2; }
.updated { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.ribbon { height: 4px; background: linear-gradient(90deg, #098E3A 0 25%, #C8011F 25% 50%, #FCB102 50% 75%, #0065C1 75% 100%); }

/* Solid fill by level (same in light and dark). Sits at the top of the page and scrolls away with it. */
.broadcast { background: #0065C1; color: #fff; }
/* The whole stack takes the colour of its most serious message; a line divides messages. */
.broadcast + .broadcast { border-top: 2px solid var(--bc-divider, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bc-divider: #000; } }
:root[data-theme="dark"] { --bc-divider: #000; }
.broadcast .main { flex: 1; min-width: 0; }
.broadcast details { margin-top: 8px; }
.broadcast summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 14px; font-weight: 650; border: 1.5px solid currentColor; border-radius: 999px; padding: 2px 12px 2px 6px; min-height: 32px; }
.broadcast summary::-webkit-details-marker { display: none; }
.broadcast summary:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.broadcast summary .icon { width: 16px; height: 16px; margin: 0; transition: transform .15s; }
.broadcast details[open] summary .icon { transform: rotate(90deg); }
.broadcast details .less, .broadcast details[open] .more { display: none; }
.broadcast details[open] .less { display: inline; }
.broadcast .detail { margin-top: 10px; font-size: 15px; max-width: 64ch; }
.broadcast .detail p + p { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .broadcast summary .icon { transition: none; } }
.broadcast.b-warning { background: #FCB102; color: #14181f; }
.broadcast.b-critical { background: #C8011F; color: #fff; }
.broadcast .label, .broadcast .when { opacity: 1 !important; }
.broadcast .wrap { display: flex; gap: 12px; align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.broadcast .icon { width: 22px; height: 22px; margin-top: 2px; }
.broadcast p { margin: 0; }
.broadcast .label { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.broadcast .text { font-size: 17px; font-weight: 600; line-height: 1.35; }
.broadcast .when { font-size: 13px; opacity: .8; margin-top: 2px; }

main.wrap { padding-top: 24px; padding-bottom: 32px; }
h2 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 32px 0 10px; font-weight: 650; }

.s-operational { --fg: var(--ok-fg); --tint: var(--ok-bg); }
.s-degraded { --fg: var(--deg-fg); --tint: var(--deg-bg); }
.s-partial { --fg: var(--part-fg); --tint: var(--part-bg); }
.s-major { --fg: var(--maj-fg); --tint: var(--maj-bg); }
.s-maintenance { --fg: var(--maint-fg); --tint: var(--maint-bg); }
.s-unknown { --fg: var(--unk-fg); --tint: var(--unk-bg); }
.l-info { --fg: var(--maint-fg); --tint: var(--maint-bg); }
.l-warning { --fg: var(--deg-fg); --tint: var(--deg-bg); }
.l-critical { --fg: var(--maj-fg); --tint: var(--maj-bg); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--tint); color: var(--fg); border: 1px solid var(--fg);
  border-radius: 12px; padding: 18px 20px;
}
.banner .icon { width: 30px; height: 30px; margin-top: 1px; }
.banner p { margin: 0; }
.banner .headline { font-size: 21px; font-weight: 650; line-height: 1.25; }
.banner .sub { color: var(--text); margin-top: 4px; font-size: 15px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.card + .card { margin-top: 10px; }

.meta { color: var(--muted); font-size: 14px; }

.incident summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; border-radius: 12px; }
.incident summary::-webkit-details-marker { display: none; }
.incident summary:focus-visible { outline: 3px solid #fcb102; outline-offset: -3px; }
.incident summary:hover h3 { text-decoration: underline; }
.incident .chev { color: var(--muted); width: 18px; height: 18px; margin-top: 4px; transition: transform .15s; }
.incident details[open] .chev { transform: rotate(90deg); }
.incident h3 { margin: 0; font-size: 17px; }
.incident .state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.incident .body { padding: 0 18px 16px 46px; }
.incident .timeline { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .incident .chev { transition: none; } }
@media (max-width: 480px) { .incident .body { padding-left: 24px; } }
.timeline { list-style: none; margin: 14px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 4px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li:first-child::before { background: var(--text); border-color: var(--text); }
.timeline .when { font-size: 14px; color: var(--muted); }
.timeline .what { margin: 0; }
.timeline strong { font-weight: 650; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--tint); color: var(--fg); border-radius: 999px;
  padding: 3px 11px 3px 8px; font-size: 14px; font-weight: 650;
}
.systems { list-style: none; margin: 0; padding: 0; }
.systems { border-radius: 12px; overflow: hidden; }
.system + .system { border-top: 1px solid var(--border); }
.system summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 18px; min-height: 48px; }
.system summary::-webkit-details-marker { display: none; }
.system summary:focus-visible { outline: 3px solid #fcb102; outline-offset: -3px; }
.system summary:hover .name { text-decoration: underline; }
.system .chev { color: var(--muted); width: 18px; height: 18px; transition: transform .15s; }
.system > details[open] > summary .chev { transform: rotate(90deg); }
.system .title { flex: 1; min-width: 0; }
.system .name { font-weight: 650; font-size: 16px; }
.system .body { padding: 0 18px 14px 46px; }
.systems-tools { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.systems-tools button { font: inherit; font-size: 14px; color: var(--link); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .system .chev { transition: none; } }
@media (max-width: 480px) { .system .body { padding-left: 18px; } }
.system .group { font-size: 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; margin-left: 8px; font-weight: 500; white-space: nowrap; }
.system .desc { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.relay { margin: 10px 0 0; padding: 10px 14px; background: var(--bg); border-radius: 8px; font-size: 15px; }
.relay p { margin: 0; }
.relay .src { color: var(--muted); font-size: 13px; margin-top: 6px; }
.system.has-issue { background: linear-gradient(90deg, var(--tint), transparent 60%); }
.system.has-issue:first-child { border-radius: 12px 12px 0 0; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 14px; padding: 10px 18px; font-size: 15px; }
.history li + li { border-top: 1px solid var(--border); }
.history time { color: var(--muted); flex: none; width: 104px; font-variant-numeric: tabular-nums; }
.empty { padding: 14px 18px; color: var(--muted); margin: 0; }

footer.wrap { color: var(--muted); font-size: 14px; padding-bottom: 40px; }
footer p { margin: 0 0 6px; }

@media (max-width: 480px) {
  .logo { height: 40px; }
  .site-title { font-size: 18px; }
  .banner .headline { font-size: 19px; }
  .history li { flex-direction: column; gap: 0; }
  .history time { width: auto; }
}

/* ---- Added for the live page ---- */
a:focus-visible, button:focus-visible { outline: 3px solid #fcb102; outline-offset: 2px; }
[hidden] { display: none !important; }
.previewbar { background: #14181f; color: #fff; text-align: center; font-size: 14px; font-weight: 650; padding: 8px 16px; }
.refresh-note { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--unk-bg); color: var(--unk-fg); border: 1px solid var(--unk-fg); font-size: 15px; }
.updated .sep { margin: 0 2px; }
/* Systems grouped under one heading */
.system .group-body { padding-right: 0; padding-bottom: 6px; }
.system .group-body > .relay { margin: 0 18px 10px 0; }
.systems.sub { border-radius: 0; border-top: 1px solid var(--border); margin: 0; padding: 0; list-style: none; }
.systems.sub .system summary { padding-left: 0; min-height: 44px; }
.systems.sub .system .name { font-size: 15px; }
.systems.sub .system .body { padding-left: 28px; }
.systems.sub .system.has-issue { background: none; }
@media (max-width: 480px) { .system .group-body { padding-left: 18px; } .systems.sub .system .body { padding-left: 0; } }
.relay details.more { margin-top: 8px; }
.relay details.more > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 14px; font-weight: 650; color: var(--link); min-height: 32px; }
.relay details.more > summary::-webkit-details-marker { display: none; }
.relay details.more > summary:focus-visible { outline: 3px solid #fcb102; outline-offset: 2px; }
.relay details.more > summary .icon { width: 16px; height: 16px; transition: transform .15s; }
.relay details.more[open] > summary .icon { transform: rotate(90deg); }
.relay details.more .less, .relay details.more[open] > summary .more { display: none; }
.relay details.more[open] > summary .less { display: inline; }
.relay .more-body { margin-top: 6px; }
.relay .more-label { font-weight: 650; }
@media (prefers-reduced-motion: reduce) { .relay details.more > summary .icon { transition: none; } }
.pill.stage { background: var(--unk-bg); color: var(--unk-fg); padding-left: 11px; }
.relay p + p { margin-top: 8px; }
.relay .src { margin-top: 6px !important; }

/* ---- 14-day history: one pip per day for each system ---- */
:root { --pip-ok: #1a8a45; --pip-deg: #e0a100; --pip-part: #e06a00; --pip-maj: #c8011f; --pip-maint: #0065c1; --pip-unk: #7b8794; }
.uptime-card { padding: 6px 0 12px; }
.uptime { list-style: none; margin: 0; padding: 0; }
.uptime-row { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 10px 18px; flex-wrap: wrap; }
.uptime-row + .uptime-row { border-top: 1px solid var(--border); }
.uptime-name { font-weight: 650; font-size: 15px; }
.days { position: relative; display: flex; gap: 4px; }
.day { display: inline-block; width: 16px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: var(--pip-unk); cursor: pointer; flex: none; }
.day.d-operational { background: var(--pip-ok); }
.day.d-degraded { background: var(--pip-deg); }
.day.d-partial { background: var(--pip-part); }
.day.d-major { background: var(--pip-maj); }
.day.d-maintenance { background: var(--pip-maint); }
.day.d-unknown { background: var(--pip-unk); }
.day.d-none { background: transparent; box-shadow: inset 0 0 0 2px var(--border); }
.day:hover, .day:focus-visible { outline: 3px solid var(--text); outline-offset: 1px; }
.tip { display: none; position: absolute; top: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(320px, 86vw);
  background: var(--text); color: var(--bg); border-radius: 8px; padding: 10px 12px; text-align: left; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.3); cursor: default; }
.tip.tip-left { left: 0; }
.tip.tip-right { right: 0; }
.day:hover .tip, .day:focus .tip { display: block; }
.tip-head { display: block; font-weight: 650; }
.tip-event { display: block; margin-top: 4px; }
.tip-time { font-variant-numeric: tabular-nums; opacity: .85; }
.legend { margin: 10px 18px 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend .day { width: 10px; height: 14px; border-radius: 3px; cursor: default; outline: none; }
details.events { margin-top: 10px; }
details.events > summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 15px; min-height: 32px; }
details.events > .card { margin-top: 8px; }
@media (max-width: 480px) {
  .uptime-row { flex-direction: column; align-items: flex-start; }
  .day { width: 17px; height: 30px; }
}
.day { font: inherit; }
.tip { font-weight: 400; }
.uptime-toggle { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin-left: -4px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 32px; }
.uptime-toggle .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.uptime-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.uptime-toggle:hover .uptime-name { text-decoration: underline; }
.uptime-row.sub { padding-left: 40px; background: var(--bg); }
.uptime-row.sub .uptime-name { font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .uptime-toggle .chev { transition: none; } }
@media (max-width: 480px) { .uptime-row.sub { padding-left: 30px; } }
.incident.plain { padding: 14px 18px 14px 46px; }
.incident .body p { margin: 0; }
.incident .body p + p { margin-top: 8px; }
@media (max-width: 480px) { .incident.plain { padding-left: 18px; } }
