:root {
  --brand: #039d55;
  --brand-ink: #027a42;
  --brand-dark: #212e28;
  --brand-mint: #69e7a3;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --ink: #17201c;
  --muted: #5b6b63;
  --line: #e1e7e3;
  --ok: #0b8a4a;      --ok-bg: #e7f6ee;
  --warn: #a15c00;    --warn-bg: #fff4e0;
  --orange: #c2410c;  --orange-bg: #ffede3;
  --bad: #c0262d;     --bad-bg: #fdeaea;
  --info: #1d5fc4;    --info-bg: #e8f0fd;
  --none: #6b7280;    --none-bg: #eef0f2;
  --nodata: #d6dcd9;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 20 / 6%), 0 4px 16px rgb(16 24 20 / 4%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #19221d; --ink: #e8efe9; --muted: #9db0a4; --line: #2a3630;
    --brand-ink: #69e7a3;
    --ok: #4ade80; --ok-bg: #143322; --warn: #fbbf24; --warn-bg: #3a2d10; --orange: #fb923c; --orange-bg: #3d2112;
    --bad: #f87171; --bad-bg: #3d1719; --info: #7aa7ff; --info-bg: #17284a; --none: #a3aab5; --none-bg: #262d29; --nodata: #34413a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #19221d; --ink: #e8efe9; --muted: #9db0a4; --line: #2a3630;
  --brand-ink: #69e7a3;
  --ok: #4ade80; --ok-bg: #143322; --warn: #fbbf24; --warn-bg: #3a2d10; --orange: #fb923c; --orange-bg: #3d2112;
  --bad: #f87171; --bad-bg: #3d1719; --info: #7aa7ff; --info-bg: #17284a; --none: #a3aab5; --none-bg: #262d29; --nodata: #34413a;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand-ink); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { background: var(--brand-dark); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.logo .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.logo small { font-weight: 500; color: var(--brand-mint); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { color: #d3ddd6; text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .95rem; }
.tabs a[aria-current="page"], .tabs a:hover { background: #ffffff1a; color: #fff; }

main.wrap { padding-top: 24px; padding-bottom: 48px; }
section { margin-top: 28px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Overall banner */
.banner { display: flex; gap: 14px; align-items: center; padding: 20px; border-radius: var(--radius); border: 1px solid transparent; }
.banner .icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.banner h1 { font-size: 1.35rem; }
.banner p { margin: 2px 0 0; }
.s-operational { --c: var(--ok); --cb: var(--ok-bg); }
.s-degraded { --c: var(--warn); --cb: var(--warn-bg); }
.s-partial_outage { --c: var(--orange); --cb: var(--orange-bg); }
.s-major_outage, .s-disruption { --c: var(--bad); --cb: var(--bad-bg); }
.s-maintenance { --c: var(--info); --cb: var(--info-bg); }
.s-unavailable, .s-partly_unavailable, .s-unmonitored { --c: var(--none); --cb: var(--none-bg); }
.banner { background: var(--cb); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.banner .icon { background: var(--c); }
:root[data-theme="dark"] .banner .icon, .banner .icon { color: var(--surface); }

/* Status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--c); white-space: nowrap; }
.pill svg { flex: none; }

/* Incidents */
.incident { padding: 16px 18px; border-left: 5px solid var(--c); }
.incident + .incident { margin-top: 12px; }
.incident h3 { font-size: 1.05rem; }
.incident h3 a { color: inherit; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: .875rem; color: var(--muted); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--none-bg); color: var(--ink); font-size: .8rem; }
.update { margin-top: 10px; }
.update .msg { white-space: pre-line; margin: 4px 0 0; }
.stage { font-weight: 700; text-transform: capitalize; }
.next { margin-top: 10px; font-size: .9rem; font-weight: 600; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 14px 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }

/* Components */
.comp { padding: 16px 18px; }
.comp + .comp { border-top: 1px solid var(--line); }
.comp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.comp-name { font-weight: 650; }
.comp-desc { font-size: .875rem; color: var(--muted); }
.mon { font-size: .8rem; color: var(--muted); margin-top: 6px; }
details.checks summary { cursor: pointer; font-size: .8rem; color: var(--muted); margin-top: 6px; }
details.checks ul { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 30px; margin-top: 12px; }
.bars span { border-radius: 2px; background: var(--nodata); min-width: 0; }
.bars .u-full { background: var(--ok); }
.bars .u-high { background: #7fcf9f; }
.bars .u-mid { background: var(--warn); }
.bars .u-low { background: var(--orange); }
.bars .u-bad { background: var(--bad); }
.bars-legend { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 4px; gap: 8px; }
.key { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); margin-top: 10px; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 560px) {
  .bars { grid-template-columns: repeat(30, 1fr); }
  .bars span:nth-child(-n+60) { display: none; }
  .d90 { display: none; } .d30 { display: inline; }
}
@media (min-width: 561px) { .d30 { display: none; } }

.empty { padding: 16px 18px; color: var(--muted); }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--none-bg); font-size: .9rem; margin-top: 12px; }

/* Changelog & roadmap */
.entry { padding: 16px 18px; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry h3 { font-size: 1rem; }
.entry .body { white-space: pre-line; margin: 6px 0 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .02em; }
.tag-new { background: var(--ok-bg); color: var(--ok); }
.tag-improved { background: var(--info-bg); color: var(--info); }
.tag-fixed { background: var(--warn-bg); color: var(--warn); }
.tag-audience { background: var(--none-bg); color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.lane h3 { font-size: .95rem; padding: 12px 14px 0; }
.lane ul { list-style: none; margin: 0; padding: 8px 14px 14px; }
.lane li { padding: 10px 0; border-top: 1px solid var(--line); }
.lane li:first-child { border-top: 0; }
.lane .t { font-weight: 600; }
.lane .d { font-size: .875rem; color: var(--muted); margin-top: 2px; white-space: pre-line; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filters button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 5px 12px; border-radius: 999px; font: inherit; font-size: .875rem; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

footer.site { border-top: 1px solid var(--line); padding: 20px 0 32px; font-size: .875rem; color: var(--muted); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
[hidden] { display: none !important; }

/* ---- Detailed view ---- */
.summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.summary b { color: var(--ink); }
h3.grp { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
h3.grp:first-child { margin-top: 0; }
h3.comp-name { font-size: 1rem; }
.comp .mon { margin: 6px 0 0; }
details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--brand-ink); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.stats div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.stats dt { font-size: .72rem; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chart { margin: 14px 0 0; }
.hbars { position: relative; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: 72px; padding: 14px 4px 0; background: var(--bg); border-radius: 8px; background-image: linear-gradient(var(--line), var(--line)); background-size: 100% 1px; background-position: 0 calc(14px + (100% - 14px) / 2); background-repeat: no-repeat; }
.hb { position: relative; display: flex; align-items: flex-end; height: 100%; border-radius: 2px; }
.hb i { display: block; width: 100%; background: var(--brand); border-radius: 2px 2px 0 0; min-height: 0; }
.hb.fail { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.hb.fail i { background: var(--warn); }
.hb.fail.full i { background: var(--bad); }
.hb.none i { background: transparent; }
.hb:hover { outline: 2px solid var(--line); }
.ax { position: absolute; left: 6px; font-size: .68rem; color: var(--muted); line-height: 1; pointer-events: none; }
.ax-top { top: 2px; }
.ax-mid { top: calc(14px + (100% - 14px) / 2 - 11px); }
.chart figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.lg-ok, .lg-fail { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 8px; vertical-align: -1px; border-radius: 2px; }
.lg-ok { background: var(--brand); }
.lg-fail { background: var(--bad); opacity: .3; }
.cklist { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.ck { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ck:last-child { border-bottom: 0; }
.ck-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--cb); color: var(--c); }
.ck-label { font-weight: 600; font-size: .92rem; }
.ck-detail { font-size: .82rem; color: var(--muted); }
.ck-problem { font-size: .82rem; font-weight: 600; color: var(--c); margin-top: 2px; }
.ck-stats { display: flex; gap: 14px; margin: 0; font-size: .8rem; text-align: right; }
.ck-stats dt { color: var(--muted); font-size: .7rem; }
.ck-stats dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ck.pending .ck-label { color: var(--muted); font-weight: 500; }
@media (max-width: 560px) {
  .ck { grid-template-columns: 22px minmax(0, 1fr); }
  .ck-stats { grid-column: 2; justify-content: flex-start; text-align: left; }
}
.bars .has-inc { box-shadow: inset 0 -4px 0 var(--info); }
.tablewrap { overflow-x: auto; }
table.det { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.det th, table.det td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.det th { border-top: 0; color: var(--muted); font-weight: 600; font-size: .8rem; }
@media (max-width: 640px) {
  table.det thead { display: none; }
  table.det tr { display: block; padding: 10px 14px; border-top: 1px solid var(--line); }
  table.det td { display: block; padding: 2px 0; border: 0; }
}
.how { padding: 16px 18px; font-size: .92rem; }
.how p { margin: 0 0 10px; }
.how ul { margin: 0 0 10px; padding-left: 18px; }
.how li { margin: 4px 0; }
