/* Geist (SIL Open Font License 1.1, github.com/vercel/geist-font), latin subset, variable weight */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("geist-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --bg: #ffffff; --card: #ffffff; --border: #e6e6e3; --divider: #f0f0ed;
  --text: #18181b; --muted: #66666d; --faint: #a3a3a8; --btn: #f2f2f0; --none: #e8e8e5;

  --ok-icon: #1fa874;       --ok-bg: #e4f7ef;       --ok-border: #58c99c;       --ok-text: #11704c;       --ok-bar: #2dbe85;
  --degraded-icon: #e3a21a; --degraded-bg: #fdf2d3; --degraded-border: #efc250; --degraded-text: #7a4e00; --degraded-bar: #f2b53a;
  --partial-icon: #ea7a1f;  --partial-bg: #fdebdc;  --partial-border: #f2a160;  --partial-text: #8a3f05;
  --major-icon: #dc4a3a;    --major-bg: #fce5e2;    --major-border: #ee8f84;    --major-text: #9b2214;    --major-bar: #e5604d;
  --unknown-icon: #a3a3a8;  --unknown-bg: #f2f2f0;  --unknown-border: #e6e6e3;  --unknown-text: #66666d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11; --card: #151518; --border: #2a2a2f; --divider: #212126;
    --text: #ededef; --muted: #a1a1aa; --faint: #6e6e78; --btn: #222227; --none: #2a2a30;

    --ok-icon: #2dbe85;       --ok-bg: #0e2e23;       --ok-border: #1c6b4c;       --ok-text: #7fe0b5;
    --degraded-icon: #e3a21a; --degraded-bg: #33280c; --degraded-border: #7a5d12; --degraded-text: #f5cd6e;
    --partial-icon: #ea7a1f;  --partial-bg: #3a220e;  --partial-border: #8a4a16;  --partial-text: #f8b27a;
    --major-icon: #e5604d;    --major-bg: #3b1512;    --major-border: #8c2f25;    --major-text: #f7a59b;
    --unknown-icon: #6e6e78;  --unknown-bg: #1c1c20;  --unknown-border: #2a2a2f;  --unknown-text: #a1a1aa;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.4 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.page { max-width: 712px; margin: 0 auto; padding: 40px 16px 56px; display: flex; flex-direction: column; gap: 24px; }
main { display: flex; flex-direction: column; gap: 24px; }

/* header */
.top { padding: 4px 0 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; letter-spacing: -0.02em; }
.brand-logo, .footer-brand svg { fill: currentColor; flex: none; }
.brand-name { font-weight: 600; }
.brand-rule { width: 1px; height: 18px; background: var(--border); }
.brand-sub { color: var(--muted); }

/* cards */
.card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--divider); font-size: 14px; }
.card-head h2 { font-size: 16px; font-weight: 500; }

/* status icons: a filled circle with a white glyph; the tone class sets the circle colour */
.icon { flex: none; }
.icon circle { fill: var(--tone-icon, var(--unknown-icon)); }
.icon path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ok { --tone-icon: var(--ok-icon); --tone-bg: var(--ok-bg); --tone-border: var(--ok-border); --tone-text: var(--ok-text); }
.degraded { --tone-icon: var(--degraded-icon); --tone-bg: var(--degraded-bg); --tone-border: var(--degraded-border); --tone-text: var(--degraded-text); }
.partial { --tone-icon: var(--partial-icon); --tone-bg: var(--partial-bg); --tone-border: var(--partial-border); --tone-text: var(--partial-text); }
.major { --tone-icon: var(--major-icon); --tone-bg: var(--major-bg); --tone-border: var(--major-border); --tone-text: var(--major-text); }
.unknown { --tone-icon: var(--unknown-icon); --tone-bg: var(--unknown-bg); --tone-border: var(--unknown-border); --tone-text: var(--unknown-text); }

/* banner */
.banner { border-color: var(--tone-border); }
.banner-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; background: var(--tone-bg); }
.banner-head h1 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.banner-quiet { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; padding: 16px 20px; }
.banner-quiet p { font-size: 15px; line-height: 1.5; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--divider); }
.chip { font-size: 14px; font-weight: 500; color: var(--tone-text); background: var(--tone-bg); border-radius: 6px; padding: 5px 10px; }

/* incidents (active ones in the banner, past ones in the history card) */
.incident { display: flex; gap: 12px; padding: 18px 20px; border-top: 1px solid var(--divider); scroll-margin-top: 16px; }
#active-list .incident:first-child, .day .incident:first-of-type { border-top: 0; }
.incident .icon { margin-top: 2px; }
.incident-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.incident h3 { font-size: 15px; font-weight: 500; }
.incident-text { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.incident-meta { font-size: 13px; color: var(--muted); }
.updates { list-style: none; margin: 10px 0 0; padding: 0 0 0 16px; display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--border); }
.updates li { display: flex; flex-direction: column; gap: 3px; }
.updates .when { font-size: 13px; color: var(--muted); }
.updates .when b { font-weight: 500; color: var(--text); }
.updates .text { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

.notice { margin-top: -12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 1.5; background: var(--degraded-bg); color: var(--degraded-text); border: 1px solid var(--degraded-border); }

/* components */
.components { list-style: none; margin: 0; padding: 0; }
.component { display: flex; flex-direction: column; gap: 12px; padding: 18px 24px; border-top: 1px solid var(--divider); }
.component:first-child { border-top: 0; }
.comp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comp-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.comp-name > span { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info { width: 24px; height: 24px; flex: none; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 6px; color: var(--faint); cursor: help; padding: 0; }
.info:hover, .info:focus-visible { color: var(--muted); background: var(--btn); }
.comp-state { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.comp-state.issue { font-weight: 500; color: var(--tone-text); }

.comp-name > span.group-name { font-weight: 600; overflow: visible; flex: none; }
.group-toggle { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: 2px; padding: 3px 6px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.group-toggle:hover, .group-toggle:focus-visible { background: var(--btn); color: var(--text); }
.group-toggle svg { transition: transform .4s cubic-bezier(.45, 0, .2, 1); }
.group.open .group-toggle svg { transform: rotate(180deg); }
.group-toggle:focus-visible { outline: 2px solid var(--ok-bar); outline-offset: 2px; }
.group-children { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
/* expand/collapse: height via grid rows (0fr ↔ 1fr), plus a short fade */
.pane { display: grid; grid-template-rows: 1fr; opacity: 1;
  transition: grid-template-rows .5s cubic-bezier(.45, 0, .2, 1), opacity .4s ease-in-out, margin-top .5s cubic-bezier(.45, 0, .2, 1); }
.pane > div { min-height: 0; overflow: hidden; }
.group .pane-list { grid-template-rows: 0fr; opacity: 0; margin-top: -12px; }
.group.open .pane-list { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.group.open .pane-bars { grid-template-rows: 0fr; opacity: 0; margin-top: -12px; }
.group-state { transition: opacity .35s ease-in-out; }
.group.open .group-state { opacity: 0; visibility: hidden; transition: opacity .35s ease-in-out, visibility 0s .35s; }
.group .pane-list .group-children { padding-bottom: 2px; }
.group-children .component { padding: 14px 0 0; border-top: 0; gap: 10px; }
.group-children .comp-name > span { font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .group-toggle svg, .pane, .group-state { transition: none !important; } }
.bars { display: flex; gap: 2px; height: 28px; }
.bars i { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--none); }
.bars i.ok, .legend i.ok { background: var(--ok-bar); }
.bars i.degraded, .legend i.degraded { background: var(--degraded-bar); }
.bars i.outage, .legend i.outage { background: var(--major-bar); }
.legend i.none { background: var(--none); }

.legend-row { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: -8px; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }

@media (max-width: 560px) {
  .bars { gap: 3px; }
  .bars i:nth-child(-n+60) { display: none; }
  .range-long { display: none; }
  .component, .card-head { padding-left: 20px; padding-right: 20px; }
  .wide-only, .group > .comp-row .uptime-word { display: none; }
  .group > .comp-row .info { display: none; }   /* the description is a nice-to-have; the name must fit */
}
@media (min-width: 561px) { .range-short { display: none; } }

/* history */
.history-toggle { display: flex; justify-content: center; padding-top: 8px; }
.btn { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 8px; height: 44px; padding: 0 18px; cursor: pointer; }
.btn:hover { background: var(--btn); }
.btn:focus-visible, .info:focus-visible, a:focus-visible { outline: 2px solid var(--ok-bar); outline-offset: 2px; }
.day + .day { border-top: 1px solid var(--divider); }
.day > h3 { font-size: 13px; font-weight: 500; color: var(--muted); padding: 16px 20px 0; }
.empty { padding: 18px 20px; color: var(--muted); font-size: 15px; }

/* footer */
.footer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 40px; text-align: center; font-size: 13px; line-height: 1.5; }
.footer p { max-width: 460px; }
.footer a { color: var(--muted); }
.footer .footer-brand { display: flex; align-items: center; gap: 8px; color: var(--text); opacity: 0.42; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
