/* ─────────────────────────────────────────────────────────────────────────────
   The status page — the whole stylesheet

   It holds no colour, no radius, no space and no font of its own. Every value
   resolves through tokens.css, which is GENERATED from frontend/src/index.css
   by scripts/build-tokens.py — the same file the app and the wiki read. Change
   a token there, run the script, and all three surfaces move together.

   The laws this page was rebuilt against (design-system/.../MASTER.md):
     · elevation is luminance — surfaces come from the neutral ramp, never a tint
     · orange is the CTA, the active state, the key figure and the focus ring,
       and nothing else: not a border, not a card fill, not a hover, not a glow
     · a signal colour (green / amber / red) means a state, and only a state
     · prose is IBM Plex Sans; mono is for figures, timestamps and units;
       Chakra Petch is the display face and stops at the two headline levels
     · the grid texture belongs on dense trading surfaces. This page is prose
       and three numbers, so it does not carry one.
───────────────────────────────────────────────────────────────────────────── */

/* ── Self-hosted faces ────────────────────────────────────────────────────
   Same @fontsource files the app bundles and the wiki serves. This is the one
   page people open when everything else is down: it must not need a third
   party to render. Each subset declares its unicode-range, so a Latin reader
   downloads the Latin file only — and, unlike a range-less set, a Cyrillic
   file can never win the match and leave Latin text on the system face. */
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/chakra-petch-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/chakra-petch-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/chakra-petch-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/chakra-petch-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-sans-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/ibm-plex-sans-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-sans-cyrillic-600-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }

/* Arabic is the one locale with its own cut of the prose face; it is reached
   through --font-intl in the family stack, exactly as in the app and the wiki.
   CJK has no self-hosted cut there either and falls through to the platform
   face. */
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }

@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ── The names this stylesheet was written against ─────────────────────────
   Aliases, never values. --bg, --border, --accent and the signal colours
   already mean the right thing in tokens.css and are used directly. */
:root {
  --nav-h: 56px;      /* the floating bar, matching the app and the wiki */
  --edge: var(--space-6);
  --bar-h: 30px;      /* one day of the uptime strip */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* A state is one decision — ink, fill and edge together. A component takes the
   class and reads the three variables; nothing picks a green of its own. */
.state-operational { --state: var(--positive); --state-bg: var(--positive-bg); --state-bd: var(--positive-border); }
.state-degraded    { --state: var(--warning);  --state-bg: var(--warning-bg);  --state-bd: var(--warning-border); }
.state-outage      { --state: var(--negative); --state-bg: var(--negative-bg); --state-bd: var(--negative-border); }
.state-checking    { --state: var(--text-muted); --state-bg: var(--neutral-wash); --state-bd: var(--border-strong); }

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--ts-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--accent-subtle-bg); color: var(--text-primary); }

:focus-visible {
  outline: 2px solid var(--accent-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-disabled); }

.wrap {
  width: 100%;
  max-width: calc(var(--container-body) + var(--edge) * 2);
  margin-inline: auto;
  padding-inline: var(--edge);
}

.skip {
  position: fixed; inset-block-start: var(--space-2); inset-inline-start: var(--space-2);
  z-index: 100;
  transform: translateY(-200%);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-4); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-size: var(--ts-body-sm); font-weight: 600;
}
.skip:focus { transform: none; }

/* ── The fetch indicator ──────────────────────────────────────────────────
   Two pixels of accent at the top edge, the page's only permanent orange: a
   refresh in flight is an active state. It never blocks anything, so it never
   becomes a spinner. */
.progress {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 90;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.3s;
}
.progress.is-busy { transform: scaleX(0.9); opacity: 1; }
.progress.is-done { transform: scaleX(1); opacity: 0; transition: transform 0.2s, opacity 0.45s 0.15s; }

/* ── Navigation ───────────────────────────────────────────────────────────
   The floating bar the app and the wiki both carry — the page is a room in the
   same building. It is transparent over the hero and only earns its glass once
   the page has moved, so nothing sits between the reader and the headline. */
.nav {
  position: fixed; inset-block-start: 10px; inset-inline: 12px; z-index: 60;
  height: var(--nav-h);
  border: 1px solid transparent; border-radius: 14px;
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.nav.is-stuck {
  background: var(--surface-1);
  background: color-mix(in srgb, var(--surface-1) 82%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-color: var(--border);
  box-shadow: var(--shadow-2);
}
.nav-in {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  height: 100%;
  max-width: calc(var(--container-body) + var(--edge) * 2);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.brand { display: inline-flex; align-items: center; gap: var(--space-3); min-width: 0; }
.brand-mark {
  height: 26px; width: auto;
  object-fit: contain;
  transition: opacity 0.2s;
}
.brand:hover .brand-mark { opacity: 0.82; }
.brand-mark.sm { height: 22px; }
.brand-rule { width: 1px; height: 18px; background: var(--border-strong); }
.brand-tag {
  font-size: var(--ts-label); font-weight: 600; line-height: 1;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); white-space: nowrap;
}

.nav-right { display: flex; align-items: center; gap: var(--space-3); }

.nav-state {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px 12px;
  background: var(--state-bg); border: 1px solid var(--state-bd);
  border-radius: var(--radius-full);
  font-size: var(--ts-label); font-weight: 600; line-height: 1;
  color: var(--state);
  white-space: nowrap;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.dot {
  width: 7px; height: 7px; border-radius: var(--radius-full);
  background: var(--state, var(--text-muted)); flex-shrink: 0;
}

/* The language control. A native <select> — it is the one control on this page
   a phone, a screen reader and a keyboard all already know how to drive. */
.lang { position: relative; display: inline-flex; align-items: center; color: var(--text-muted); }
.lang:hover { color: var(--text-secondary); }
.lang-icon { position: absolute; inset-inline-start: 10px; width: 14px; height: 14px; pointer-events: none; }
.lang-caret { position: absolute; inset-inline-end: 10px; width: 10px; height: 10px; pointer-events: none; }
.lang select {
  appearance: none; -webkit-appearance: none;
  height: var(--control-md);
  padding-inline: 30px 26px;
  background: transparent; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--ts-body-sm); font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lang select:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.lang select option { background: var(--surface-4); color: var(--text-primary); }

/* ── Hero ─────────────────────────────────────────────────────────────────
   One sentence, three figures. The radial wash behind it is the brand moment
   tokens.css sanctions for a page headline — behind words, never behind data. */
.hero { position: relative; padding-block: calc(var(--nav-h) + var(--space-16)) var(--space-16); }
.hero-glow {
  position: absolute; inset-block-start: 0; inset-inline: 0; height: 560px;
  background: var(--glow-hero);
  pointer-events: none;
}
.hero > .wrap { position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-m);
  font-size: var(--ts-label); font-weight: 500; line-height: 1;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
}
.pulse {
  position: relative;
  width: 7px; height: 7px; border-radius: var(--radius-full);
  background: var(--state, var(--text-muted));
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%        { box-shadow: 0 0 0 0 var(--state-bd); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

.hero-title {
  margin-block: var(--space-4) var(--space-3);
  font-family: var(--font-h); font-weight: 700;
  font-size: var(--ts-display); line-height: var(--lh-display); letter-spacing: var(--tr-display);
  color: var(--text-primary);
  max-width: 17ch;
  text-wrap: balance;
}
.hero-sub {
  font-size: var(--ts-subheading); line-height: var(--lh-subheading);
  color: var(--text-secondary);
  max-width: 54ch;
}

/* ── The three figures ────────────────────────────────────────────────────
   Hairlines, not boxes: the 1px grid gap IS the divider, so the block reads as
   one object at a glance and as three at a pause. */
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: var(--space-12);
  background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat { background: var(--surface-1); padding: var(--space-6); }
.stat dt {
  font-size: var(--ts-label); font-weight: 600; line-height: var(--lh-label);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
}
.stat-v {
  margin-top: var(--space-3);
  font-family: var(--font-h); font-weight: 700;
  font-size: var(--ts-metric); line-height: var(--lh-metric); letter-spacing: var(--tr-metric);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.stat-note {
  margin-top: var(--space-2);
  font-size: var(--ts-body-sm); line-height: var(--lh-body-sm);
  color: var(--text-muted);
}

/* ── Scheduled maintenance ────────────────────────────────────────────────
   Announced, not alarming: amber is the warning signal, and the countdown is
   the only number on the page that changes every second. */
.sched {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-8);
  padding: var(--space-3) var(--space-4);
  background: var(--warning-bg); border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
}
.sched-dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--warning); flex-shrink: 0; }
.sched-title { font-weight: 600; font-size: var(--ts-body-sm); color: var(--warning); }
.sched-count {
  font-family: var(--font-m); font-size: var(--ts-body-sm); font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--warning);
}
.sched-note { font-size: var(--ts-body-sm); color: var(--text-muted); }

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { padding-block: var(--space-16); }
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  margin-bottom: var(--space-8);
}
.sec-title {
  font-family: var(--font-h); font-weight: 700;
  font-size: var(--ts-title); line-height: var(--lh-title); letter-spacing: var(--tr-title);
  color: var(--text-primary);
}
.sec-sub { margin-top: var(--space-2); font-size: var(--ts-body-sm); color: var(--text-muted); max-width: 52ch; }

.legend { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.legend li {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--ts-label); color: var(--text-muted);
}
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--state, var(--surface-3)); }
.legend .swatch.is-none { background: var(--surface-3); }

/* ── Service groups ───────────────────────────────────────────────────── */
.group + .group { margin-top: var(--space-8); }
.group-title {
  margin-bottom: var(--space-3);
  font-size: var(--ts-label); font-weight: 600; line-height: var(--lh-label);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
}
.card {
  background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}

.svc { padding: var(--space-6); transition: background 0.2s; }
.svc + .svc { border-top: 1px solid var(--border); }
.svc:hover { background: var(--surface-hover); }

.svc-head { display: flex; align-items: center; gap: var(--space-4); }
.svc-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 38px; height: 38px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}
.svc:hover .svc-icon { color: var(--text-secondary); border-color: var(--border-strong); }
.svc-icon svg { width: 17px; height: 17px; }
.svc-id { flex: 1; min-width: 0; }
.svc-name {
  font-size: var(--ts-subheading); font-weight: 600; line-height: var(--lh-subheading);
  color: var(--text-primary);
}
.svc-desc { font-size: var(--ts-body-sm); line-height: var(--lh-body-sm); color: var(--text-muted); }

.svc-live { display: flex; align-items: center; gap: var(--space-4); flex-shrink: 0; }
.latency {
  font-family: var(--font-m); font-size: var(--ts-body-sm); font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary); white-space: nowrap;
}
.latency .unit { color: var(--text-muted); margin-inline-start: 2px; }
.latency.is-slow { color: var(--warning); }

.pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px 12px 6px 10px;
  background: var(--state-bg); border: 1px solid var(--state-bd);
  border-radius: var(--radius-full);
  font-size: var(--ts-label); font-weight: 600; line-height: 1;
  color: var(--state); white-space: nowrap;
}

/* ── The 90-day strip ─────────────────────────────────────────────────────
   One column per day, oldest first. Time runs left to right whatever the
   writing direction — a timeline that mirrors itself is a timeline that lies.
   A day with no record is not an outage: it is the neutral surface step. */
.strip { margin-top: var(--space-4); direction: ltr; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: var(--bar-h); }
.bar {
  /* No record for that day. It is drawn as a baseline stub rather than a full
     column: a page that is five days old should not show 85 days of grey wall,
     and "not measured" must never look like a measurement. */
  flex: 1 1 0; min-width: 0; height: 28%;
  background: var(--surface-3);
  border-radius: 2px;
  transform-origin: bottom;
  transition: transform 0.18s var(--ease), opacity 0.18s, height 0.18s;
}
.bar.is-up, .bar.is-warn, .bar.is-down { height: 100%; }
.bar.is-up   { background: var(--positive); opacity: 0.72; }
.bar.is-warn { background: var(--warning);  opacity: 0.85; }
.bar.is-down { background: var(--negative); opacity: 0.9; }
.bar:hover { opacity: 1; transform: scaleY(1.18); }

.axis {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--ts-micro); letter-spacing: var(--tr-micro); text-transform: uppercase;
  color: var(--text-disabled);
}
.axis-pct {
  font-family: var(--font-m); font-size: var(--ts-body-sm); font-weight: 500;
  letter-spacing: 0; text-transform: none;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.axis-note { color: var(--text-disabled); }

/* ── Incidents ───────────────────────────────────────────────────────────
   A rail with a dot per event. Everything closed states how long it lasted;
   anything open says so in the present tense. */
.inc-day {
  padding: var(--space-3) var(--space-6);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-m); font-size: var(--ts-label); font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.inc-day:not(:first-child) { border-top: 1px solid var(--border); }
.inc {
  position: relative;
  display: flex; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
}
.inc + .inc { border-top: 1px solid var(--border); }
.inc-dot {
  width: 9px; height: 9px; margin-top: 6px; flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--state); box-shadow: 0 0 0 4px var(--state-bg);
}
.inc-body { min-width: 0; flex: 1; }
.inc-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2);
  font-size: var(--ts-body-sm); font-weight: 600; color: var(--text-primary);
}
.inc-more {
  padding: 2px 6px;
  background: var(--surface-3); border-radius: var(--radius-sm);
  font-family: var(--font-m); font-size: var(--ts-micro); font-weight: 500;
  color: var(--text-muted);
}
.inc-tag {
  padding: 2px 8px;
  background: var(--state-bg); border: 1px solid var(--state-bd); border-radius: var(--radius-full);
  font-size: var(--ts-micro); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--state);
}
.inc-meta {
  margin-top: 2px;
  font-family: var(--font-m); font-size: var(--ts-body-sm);
  color: var(--text-muted);
}

.empty {
  display: grid; justify-items: center; gap: var(--space-3);
  padding: var(--space-16) var(--space-6);
  text-align: center;
}
.empty-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: var(--positive-bg); border: 1px solid var(--positive-border);
  border-radius: var(--radius-full);
  color: var(--positive);
}
.empty-mark svg { width: 20px; height: 20px; }
.empty-title { font-size: var(--ts-subheading); font-weight: 600; color: var(--text-primary); }
.empty-note { font-size: var(--ts-body-sm); color: var(--text-muted); }

/* ── Loading ──────────────────────────────────────────────────────────── */
.sk { background: var(--surface-3); border-radius: var(--radius-sm); animation: sk 1.6s ease-in-out infinite; }
.sk-line { height: 11px; width: 38%; }
.sk-mark { width: 38px; height: 38px; border-radius: var(--radius-md); }
.sk-strip { height: var(--bar-h); margin-top: var(--space-4); border-radius: var(--radius-sm); }
@keyframes sk { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.8; } }

/* ── Footer ──────────────────────────────────────────────────────────── */
.foot { margin-top: var(--space-8); border-top: 1px solid var(--border); padding-block: var(--space-12); }
.foot-in {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
}
.foot-links { display: flex; align-items: center; gap: var(--space-6); }
.foot-links a {
  font-size: var(--ts-body-sm); color: var(--text-muted);
  transition: color 0.18s;
}
.foot-links a:hover { color: var(--text-primary); }
.foot-note {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  font-size: var(--ts-body-sm); color: var(--text-disabled);
}
.foot-dot { color: var(--border-strong); }

/* ── Tooltip ─────────────────────────────────────────────────────────── */
.tip {
  position: fixed; z-index: 80; pointer-events: none;
  padding: 6px 10px;
  background: var(--chart-tooltip-bg); border: 1px solid var(--chart-tooltip-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  font-family: var(--font-m); font-size: var(--ts-body-sm); line-height: 1.35;
  color: var(--text-primary); white-space: nowrap;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
}
.tip.is-on { opacity: 1; transform: none; }

/* ── Entrance ────────────────────────────────────────────────────────────
   Gated on .js, which app.js sets the moment it runs. A section that fades in
   must never be a section that stays invisible because a script did not. */
.js .reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  :root { --edge: var(--space-8); }
}

@media (max-width: 860px) {
  .hero { padding-block: calc(var(--nav-h) + var(--space-12)) var(--space-12); }
  .section { padding-block: var(--space-12); }
  .stats { grid-template-columns: 1fr; margin-top: var(--space-8); }
  .stat { padding: var(--space-4) var(--space-6); }
  .stat-v { margin-top: var(--space-1); }
}

@media (max-width: 720px) {
  :root { --bar-h: 26px; }
  .svc { padding: var(--space-4); }
  .svc-icon { width: 34px; height: 34px; }
  /* Two rows instead of one: the mark and the name, then the figure and the
     state. A grid rather than wrapping, so the pill lands on the outer edge
     instead of wherever the name happened to end. */
  .svc-head {
    display: grid; align-items: center;
    grid-template-columns: auto 1fr;
    grid-template-areas: 'icon id' 'live state';
    gap: var(--space-2) var(--space-3);
  }
  .svc-icon { grid-area: icon; }
  .svc-id { grid-area: id; }
  .svc-live { grid-area: live; justify-self: start; }
  .pill { grid-area: state; justify-self: end; }
  .inc, .inc-day { padding-inline: var(--space-4); }
  .foot-in { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .nav { inset-inline: 8px; }
  .nav-in { padding-inline: var(--space-3); }
  .nav-state-label { display: none; }
  .nav-state { padding: 8px; }
  .brand-rule, .brand-tag { display: none; }
  .legend { gap: var(--space-3); }
}

/* The only width where "· Last 90 days" no longer fits beside the two dates.
   The strip's own aria-label still carries the window for a screen reader. */
@media (max-width: 400px) {
  .axis-note { display: none; }
}

/* ── Motion, opted out ───────────────────────────────────────────────────
   Everything above degrades to a static page: nothing here carries meaning
   that only the movement expresses. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .progress { display: none; }
}
