/* Downwatch prototype styles.
   Concept: a departure board for the internet: a dark board, signal yellow, calm type.
   Schibsted Grotesk sets all text; Fragment Mono is reserved for times, durations,
   percentages and endpoints. Status is always colour + shape + word. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-var.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/fragment-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- tokens ---------- */
/* Tokens resolve per element via light-dark(), so the board can force a dark
   scheme locally while the page follows the chosen theme. */
:root {
  color-scheme: light dark;

  --font-sans: "Schibsted Grotesk", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* type scale */
  --fs-xs: 12.5px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 30px;
  --fs-2xl: 48px;
  --fs-3xl: 64px;
  --fs-num: 112px;

  --bg: light-dark(#F1EDE2, #0B0B0A);
  --bg-2: light-dark(#E8E3D4, #11110F);
  --surface: light-dark(#FBF9F3, #151512);
  --surface-2: light-dark(#F3EFE4, #1B1B18);
  --line: light-dark(#D8D1BE, #26261F);
  --line-strong: light-dark(#ACA58E, #3B3B33);
  --text: light-dark(#15140F, #F2EEE3);
  --muted: light-dark(#5C584B, #A39E90);
  --faint: light-dark(#7E7968, #7A7666);

  --accent: #FFD23F;
  --accent-ink: #15140F;
  --accent-text: light-dark(#6E5300, #FFD23F);
  --focus: light-dark(#15140F, #FFD23F);

  /* status: text-safe colours */
  --up: light-dark(#11743F, #46D483);
  --degraded: light-dark(#9A4D00, #FFA328);
  --down: light-dark(#BA1E12, #FF5A4B);
  --maint: light-dark(#1A5BB8, #6AB2FF);
  /* status: bar fills */
  --up-bar: light-dark(#5DAF7E, #2F8F57);
  --degraded-bar: light-dark(#E58A12, #FFA328);
  --down-bar: light-dark(#D7301F, #FF5A4B);
  --maint-bar: light-dark(#2D74D6, #6AB2FF);
  --none-bar: light-dark(#D3CCB8, #2A2A24);

  --board-bg: #121210;
  --board-line: #2A2A24;

  --radius: 10px;
  --wrap: 1320px;
  --gutter: 32px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { display: block; }
button, input { font: inherit; color: inherit; }
/* Focus ring: ink on paper, signal yellow on dark (yellow alone is too faint on the light theme). */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { top: 8px; }

/* Numbers: mono for times/durations/percentages, tabular figures everywhere. */
.num { font-family: var(--font-mono); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.label { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }

/* ---------- status signals: shape + colour + word ---------- */
/* Glyphs share one optical size and sit on the x-height so they line up with text. */
.sig {
  display: inline-block; flex: none;
  width: .7em; height: .7em;
  background: currentColor;
}
.sig--operational { color: var(--up); border-radius: 50%; transform: scale(.92); }
.sig--degraded { color: var(--degraded); clip-path: polygon(50% 4%, 100% 92%, 0 92%); transform: scale(1.12); }
.sig--down {
  color: var(--down);
  clip-path: polygon(18% 0, 50% 32%, 82% 0, 100% 18%, 68% 50%, 100% 82%, 82% 100%, 50% 68%, 18% 100%, 0 82%, 32% 50%, 0 18%);
}
.sig--maintenance { color: var(--maint); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transform: scale(1.1); }

.status { display: inline-flex; align-items: center; gap: .45em; font-weight: 600; white-space: nowrap; }
.status--operational { color: var(--up); }
.status--degraded { color: var(--degraded); }
.status--down { color: var(--down); }
.status--maintenance { color: var(--maint); }

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar__inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand__mark { width: 34px; height: 34px; }
.brand__word { height: 21px; width: auto; fill: currentColor; }
.topbar__meta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.live time { color: var(--text); }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in oklab, var(--up) 25%, transparent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border: 1.5px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--text); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; color: var(--faint); border-style: dashed; background: transparent; }
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { border-color: var(--line-strong); }
/* Toggle buttons (Watch): pressed = signal yellow with a filled bell. */
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[aria-pressed="true"]:hover { border-color: var(--text); }
.btn[aria-pressed="true"] svg { fill: currentColor; }
.btn[aria-busy="true"], .watch[aria-busy="true"] { cursor: progress; opacity: .7; }
.btn--alerts { position: relative; }
.alerts-count {
  min-width: 20px; padding: 3px 5px; border-radius: 10px; text-align: center;
  font-size: 12px; line-height: 1; background: var(--accent); color: var(--accent-ink);
}
.alerts-count[hidden] { display: none; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer;
}
.icon-btn:hover { border-color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* Sponsor: a quiet button; the heart carries the GitHub Sponsors pink. */
.btn--sponsor svg, .footer__sponsor svg { color: light-dark(#BF3989, #DB61A2); }
.btn--sponsor:hover svg { fill: currentColor; }

/* prototype note: visible, but quiet */
.proto-note { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.proto-note__inner { display: flex; align-items: center; gap: 12px; min-height: 36px; padding-block: 6px; font-size: 13.5px; color: var(--muted); }
.proto-note__tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text);
  padding: 3px 7px 3px 18px; border-radius: 3px; position: relative; border: 1px solid var(--line-strong);
}
.proto-note__tag::before {
  content: ""; position: absolute; left: 5px; top: 50%; width: 8px; height: 8px; translate: 0 -50%;
  background: repeating-linear-gradient(135deg, var(--accent) 0 2px, var(--accent-ink) 2px 4px);
  border-radius: 1px;
}
.proto-note__switch { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.proto-note__switch a { color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 4px; }
.proto-note__switch a[aria-current="true"] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- hero board ---------- */
.hero { padding-block: 28px 12px; }
.board {
  color-scheme: dark; /* the board is a physical object: always dark */
  background: var(--board-bg);
  color: var(--text);
  border: 1px solid var(--board-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 18px 40px -24px rgb(0 0 0 / .55);
}
.board__head {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--board-line);
  background: #0E0E0C;
}
.board__label { font-size: 15px; font-weight: 650; color: var(--accent); }
.lamps { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; max-width: 60%; justify-content: flex-end; font-size: 12px; }
.lamps .sig--operational { opacity: .55; }
.board__clock { font-size: 15px; color: var(--accent); }
.board__clock span { color: var(--muted); }

.board__headline {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 0 32px;
  padding: 30px 28px 26px;
}
.board__count {
  font-size: var(--fs-num); font-weight: 700; line-height: .8; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums lining-nums;
  color: #FF5A4B;
}
.board__headline h1 {
  margin: 0; padding-bottom: 2px;
  font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -.025em;
}
.board__headline h1 span { display: block; color: var(--muted); font-weight: 500; }
.board__headline h1 .hero-now { display: inline; }
/* The summary sits in the column beside the headline instead of under it, so the board has no empty right half. */
.board__sub { grid-column: 3; align-self: center; margin: 0; padding-left: 28px; border-left: 1px solid var(--board-line); color: var(--muted); font-size: var(--fs-md); line-height: 1.5; }
.board__sub b { color: var(--text); font-weight: 600; }
.board--calm .board__headline { grid-template-columns: auto minmax(0, 1fr); }
.board--calm .board__sub { grid-column: 2; }
.board--calm .board__headline h1 { font-size: var(--fs-3xl); }
.board--calm .board__headline h1 em { font-style: normal; color: #46D483; }

/* Split-flap tiles: hero board only. Letters are Schibsted Grotesk bold, centred in
   fixed-width tiles, so the column keeps a board rhythm without a third font. */
.flaps { display: inline-flex; gap: .12em; }
.flap {
  position: relative;
  display: inline-grid; place-items: center;
  width: .96em; height: 1.32em;
  font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  color: #F2EEE3;
  background: linear-gradient(#2A2A25 0 50%, #20201C 50% 100%);
  border-radius: .14em;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 1px 0 rgb(0 0 0 / .5);
  overflow: hidden;
}
.flap::after { content: ""; position: absolute; inset: 50% 0 auto; height: 1px; background: rgb(0 0 0 / .85); }
.flap .sig { font-size: .78em; }
.flaps--down .flap { color: #FF5A4B; }
.flaps--degraded .flap { color: #FFA328; }
.flaps--maintenance .flap { color: #6AB2FF; }
.board__count.flaps--count { font-size: calc(var(--fs-num) * .64); line-height: 1; letter-spacing: 0; gap: .1em; }
.flaps--count .flap { color: #FF5A4B; border-radius: .1em; }

.brows__wrap { padding: 0 28px 8px; }
.brows { list-style: none; margin: 0; padding: 0; }
.brows li { border-bottom: 1px solid var(--board-line); }
.brows li:last-child { border-bottom: 0; }
.brow, .brows__head {
  display: grid;
  grid-template-columns: 190px minmax(140px, 180px) 1fr 116px 168px;
  align-items: center; gap: 20px;
}
.brows__head { padding: 0 0 10px; border-bottom: 1px solid var(--board-line); font-size: 13px; font-weight: 500; color: var(--faint); }
.brow { padding: 16px 0; text-decoration: none; color: inherit; font-size: var(--fs-base); }
/* Hover: a soft row tint and the name shifts to signal yellow (no underline). */
.brow { margin-inline: -12px; padding-inline: 12px; border-radius: 8px; transition: background-color .12s; }
.brow:hover { background: rgb(255 255 255 / .045); }
.brow:hover .brow__svc, .brow:focus-visible .brow__svc { color: var(--accent); }
.brow:focus-visible { outline-offset: 0; }
.brow .flaps { font-size: 19px; }
.brow__svc { font-size: var(--fs-lg); font-weight: 650; line-height: 1.1; letter-spacing: -.01em; }
.brow__title { color: #DAD5C8; line-height: 1.4; }
.brow__stage { font-size: var(--fs-sm); color: var(--muted); }
.brow__since { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.brow__since .num { color: var(--text); }
.brow--maintenance .brow__title { color: var(--muted); }

.board__foot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 26px;
  padding: 14px 28px; border-top: 1px solid var(--board-line); background: #0E0E0C;
  font-size: var(--fs-sm); color: var(--muted);
}
.board__foot .board__label { font-size: var(--fs-sm); }
.board__foot a { color: var(--text); text-decoration: none; font-weight: 600; }
.board__foot a:hover { color: var(--accent); }
.resolved { display: inline-flex; align-items: baseline; gap: 7px; }
.resolved .sig { font-size: 12px; }

/* ---------- controls ---------- */
.controls { padding-block: 28px 8px; display: grid; gap: 16px; }
.controls__row { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.tally { display: flex; border: 1.5px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tally button {
  display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline;
  padding: 9px 18px 10px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left;
}
.tally button:last-child { border-right: 0; }
.tally .sig, .tally .tally__all { font-size: 13px; }
.tally .tally__all { width: .7em; height: .7em; border: 2px solid currentColor; border-radius: 2px; color: var(--muted); display: inline-block; }
.tally b { font-size: var(--fs-lg); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tally small { grid-column: 1 / -1; font-size: 13px; font-weight: 500; color: var(--muted); }
.tally button:hover { background: var(--surface-2); }
.tally button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.tally button[aria-pressed="true"] small, .tally button[aria-pressed="true"] .tally__all { color: inherit; opacity: .8; }

.search { position: relative; flex: 1; min-width: 260px; display: flex; }
.search svg { position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 100%; min-height: 50px; padding: 0 48px 0 44px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  font-size: var(--fs-base);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--accent); }
.search kbd {
  position: absolute; right: 12px; top: 50%; translate: 0 -50%;
  font: 400 13px/1 var(--font-mono); color: var(--muted);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 4px 7px;
}
.sort { display: flex; align-items: center; gap: 8px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 17px; background: transparent; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 500; color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip em { font-style: normal; color: var(--faint); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip[aria-pressed="true"] em { color: var(--accent-ink); opacity: .65; }
.chip .sig { font-size: 11px; }

/* ---------- service list ---------- */
.list { padding-block: 14px 40px; }
.list__meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.list__meta h2 { margin: 0; font-size: var(--fs-xl); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.list__grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto repeat(var(--rows, 24), auto); grid-auto-flow: column; column-gap: 40px; }
.list__head { grid-row: 1; }
.list__head--2 { grid-column: 2; }
.list__head, .svc {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 104px 150px 62px 32px;
  align-items: center; gap: 14px;
}
.list__head { padding: 12px 10px 8px; border-bottom: 2px solid var(--text); font-size: 13px; font-weight: 500; color: var(--muted); }
.list__head span:nth-child(5) { text-align: right; }
.svc-list { list-style: none; margin: 0; padding: 0; display: contents; }
.svc { position: relative; min-height: 58px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.svc[hidden] { display: none; }
.svc__link { position: absolute; inset: 0; z-index: 0; }
.svc__link:focus-visible { outline-offset: -3px; }
.svc > :not(.svc__link) { position: relative; z-index: 1; pointer-events: none; }
.svc > .watch, .svc > .bars { pointer-events: auto; }
.svc:hover { background: var(--surface); }
.svc:hover .svc__name b, .svc:focus-within .svc__name b { color: var(--accent-text); }
.svc:focus-within { background: var(--surface); }
.svc > .sig { font-size: 14px; }
.svc__name { display: flex; flex-direction: column; min-width: 0; }
.svc__name b { font-size: 16.5px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc__name small { font-size: 13px; line-height: 1.3; color: var(--faint); }
.svc .state { font-size: var(--fs-sm); font-weight: 600; }
.svc .state--operational { font-weight: 400; color: var(--muted); }
.state--degraded { color: var(--degraded); }
.state--down { color: var(--down); }
.state--maintenance { color: var(--maint); }
.svc__uptime { font-size: 13.5px; text-align: right; color: var(--muted); }
.svc[data-status="degraded"], .svc[data-status="down"], .svc[data-status="maintenance"] {
  background: color-mix(in oklab, var(--tint) 9%, transparent);
  box-shadow: inset 3px 0 0 var(--tint);
}
.svc[data-status="degraded"] { --tint: var(--degraded); }
.svc[data-status="down"] { --tint: var(--down); }
.svc[data-status="maintenance"] { --tint: var(--maint); }

.watch {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer;
}
.watch:hover { border-color: var(--line-strong); color: var(--text); }
.watch svg { width: 16px; height: 16px; }
.watch[aria-pressed="true"] { color: var(--accent-text); }
.watch[aria-pressed="true"] svg { fill: currentColor; }

.empty { padding: 40px 10px; text-align: center; color: var(--muted); }

/* ---------- uptime bars ---------- */
/* Encoding: operational = plain bar, degraded = hatched, down = solid + taller spike,
   maintenance = hollow. Works in greyscale. */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.bars i { flex: 1; height: 20px; border-radius: 1.5px; background: var(--up-bar); min-width: 0; }
.bars i[data-s="none"] { background: var(--none-bar); }
.bars i[data-s="degraded"] {
  background: repeating-linear-gradient(135deg, var(--degraded-bar) 0 2px, color-mix(in oklab, var(--degraded-bar) 35%, transparent) 2px 4px);
  box-shadow: inset 0 0 0 1px var(--degraded-bar);
}
.bars i[data-s="down"] { background: var(--down-bar); height: 26px; }
.bars i[data-s="maintenance"] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--maint-bar); }
.bars--lg { height: 44px; gap: 3px; }
.bars--lg i { height: 36px; border-radius: 2px; }
.bars--lg i[data-s="down"] { height: 44px; }
.bars--md { height: 30px; }
.bars--md i { height: 24px; }
.bars--md i[data-s="down"] { height: 30px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .bars { height: 16px; width: 10px; }
.legend .bars i { height: 12px; }
.legend .bars i[data-s="down"] { height: 16px; }

/* ---------- watchlist teaser ---------- */
.teaser {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  padding: 22px 26px; margin-top: 34px;
  border: 1.5px solid var(--line-strong); border-radius: 14px;
  background: var(--surface);
}
.teaser__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.teaser__icon svg { width: 24px; height: 24px; }
.teaser h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.teaser p { margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--bg-2); }
.footer__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px 40px; padding-block: 32px 36px; }
.footer__about { display: grid; gap: 10px; justify-items: start; }
.footer__logo .brand__mark { width: 26px; height: 26px; }
.footer__logo .brand__word { height: 15px; }
.footer__tagline { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: var(--fs-sm); font-weight: 600; }
.footer__links a { display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; }
.footer__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__links svg { width: 15px; height: 15px; }
.footer__fine { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--faint); }
/* Two halves across the full width: data provenance left, disclaimer right. */
.footer__fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 32px; }
.footer__fine time { color: var(--muted); }

/* ---------- service page ---------- */
.crumbs { display: flex; gap: 8px; padding-top: 26px; font-size: var(--fs-sm); color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.svc-head { display: grid; grid-template-columns: 1fr auto; gap: 18px 32px; align-items: end; padding-block: 12px 26px; border-bottom: 2px solid var(--text); }
.svc-head h1 { margin: 0; font-size: 80px; font-weight: 700; line-height: .95; letter-spacing: -.035em; }
.svc-head__status { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.svc-head__status .status { font-size: var(--fs-lg); }
.svc-head__status p { margin: 0; color: var(--muted); font-size: var(--fs-md); }
.svc-head__status p b { color: var(--text); font-weight: 600; }
.svc-head__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.svc-head__actions .row { display: flex; gap: 10px; }
.svc-head__meta { margin: 0; font-size: var(--fs-sm); color: var(--muted); text-align: right; }
.svc-head__meta time { color: var(--text); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-block: 30px 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; }
.section-title h2 { margin: 0; font-size: var(--fs-xl); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }

/* active incident (board style) */
.incident-board { margin-bottom: 40px; }
.incident-board .board__head { justify-content: space-between; }
.incident-board .board__head .started { font-size: var(--fs-sm); color: var(--muted); }
.incident-board__body { padding: 22px 28px 8px; }
.incident-board h3 { margin: 0 0 10px; font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.incident-board .meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 18px; font-size: var(--fs-sm); color: var(--muted); }
.incident-board .meta b { color: var(--text); font-weight: 600; }
.updates { list-style: none; margin: 0; padding: 0 0 12px; }
.updates li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--board-line); }
.updates li > div { display: flex; flex-direction: column; gap: 2px; }
.updates time { font-size: var(--fs-sm); color: var(--text); }
.updates .stage { font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
.updates p { margin: 0; color: #D6D1C4; }

/* components with 90-day bars */
.uptime { border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); overflow: hidden; }
.uptime__overall { padding: 20px 22px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.uptime__overall-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; }
.uptime__overall-top b { font-size: var(--fs-md); font-weight: 650; }
.uptime__pct { font-size: var(--fs-sm); color: var(--muted); }
.uptime__pct .num { font-size: var(--fs-base); color: var(--text); }
.axis { display: flex; justify-content: space-between; margin-top: 7px; font-size: var(--fs-xs); color: var(--faint); }
.axis .narrow { display: none; }
.comp { display: grid; grid-template-columns: 180px 128px minmax(0, 1fr) 64px; gap: 18px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.comp:last-child { border-bottom: 0; }
.comp__name { font-size: 15.5px; font-weight: 500; }
.comp .status { font-size: var(--fs-sm); }
.comp .status--operational { font-weight: 400; color: var(--muted); }
.comp .status--operational .sig { color: var(--up); }
.comp__pct { text-align: right; font-size: 13.5px; color: var(--muted); }
.comp[data-status="degraded"] { background: color-mix(in oklab, var(--degraded) 8%, transparent); box-shadow: inset 3px 0 0 var(--degraded); }

/* incident history timeline */
.history { margin-top: 44px; }
.month { margin: 26px 0 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.month::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: grid; grid-template-columns: 64px 28px minmax(0, 1fr); gap: 0 14px; }
.tl__date { padding-top: 16px; font-size: var(--fs-sm); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.tl__date small { display: block; font-weight: 400; color: var(--faint); font-size: 13px; }
.tl__rail { position: relative; display: flex; justify-content: center; }
.tl__rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; translate: -50% 0; background: var(--line); }
.tl__node { position: relative; margin-top: 15px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: var(--bg); border: 1.5px solid var(--line-strong); font-size: 13px; }
.tl__body { padding: 14px 0 18px; border-bottom: 1px solid var(--line); }
.tl:last-child .tl__body { border-bottom: 0; }
.tl__body h3 { margin: 0 0 6px; font-size: var(--fs-md); font-weight: 600; line-height: 1.3; letter-spacing: -.005em; }
.tl__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: var(--fs-sm); color: var(--muted); }
.tl__meta .state { font-weight: 600; }
.tl__meta > span { white-space: nowrap; }
.tl__body p { margin: 8px 0 0; color: var(--muted); }
.tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.tags span { padding: 2px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tl--ongoing .tl__node { border-color: var(--degraded); box-shadow: 0 0 0 4px color-mix(in oklab, var(--degraded) 20%, transparent); }

/* aside */
.aside { display: grid; gap: 16px; align-content: start; }
.card { border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); padding: 18px 20px; }
.card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: var(--fs-base); font-weight: 650; color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; margin: 0; }
.stats div { display: flex; flex-direction: column; gap: 4px; }
.stats dt { order: 2; font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.kv { margin: 0; display: grid; gap: 12px; font-size: var(--fs-sm); }
.kv div { display: grid; gap: 1px; }
.kv dt { color: var(--faint); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd.num { font-size: 13px; overflow-wrap: normal; }
.watch-card p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.watch-card .btn { width: 100%; justify-content: center; }
.watch-card .watch-card__on { margin: 12px 0 0; font-size: var(--fs-sm); }

/* ---------- alerts panel (popover) and toasts ---------- */
.alerts {
  position: fixed; inset: 76px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) auto auto;
  width: min(380px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 96px); margin: 0; overflow: auto;
  padding: 18px 20px 20px; border: 1.5px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: 0 16px 40px rgb(0 0 0 / .22);
}
.alerts::backdrop { background: transparent; }
/* Without popover support the panel stays hidden (the bells still work). */
[popover].alerts { display: none; }
.alerts:popover-open { display: block; }
.alerts__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.alerts__head h2 { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.alerts__head h2:focus { outline: none; }
.alerts__head .icon-btn { width: 32px; height: 32px; }
.alerts__head .icon-btn svg { width: 16px; height: 16px; }
.alerts__note { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.alerts__list { list-style: none; margin: 0; padding: 0; }
.alerts__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.alerts__list a { font-weight: 600; text-decoration: none; color: var(--text); }
.alerts__list a:hover { color: var(--accent-text); }
.alerts__list .chip { height: 30px; padding: 0 12px; }
.alerts__empty { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.alerts__off { margin-top: 14px; }
.alerts__fine { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--faint); }
.toasts { position: fixed; left: 50%; bottom: 20px; translate: -50% 0; z-index: 20; width: min(440px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 16px;
  border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: 0 10px 30px rgb(0 0 0 / .25);
  font-size: var(--fs-sm); line-height: 1.45;
}
.toast p { margin: 0; flex: 1; padding-top: 4px; }
.toast button { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.toast button:hover { border-color: currentColor; }
.toast button svg { width: 14px; height: 14px; }
.toast :focus-visible { outline-color: var(--accent); }

/* ---------- v1 additions ---------- */
/* "No data": a grey question mark instead of a shape, plus the label. */
.sig--unknown { color: var(--faint); background: none; width: auto; height: auto; font-style: normal; font-weight: 700; line-height: 1; }
.sig--unknown::before { content: "?"; font-size: 1.15em; }
.status--unknown, .state--unknown { color: var(--faint); }
.flaps--unknown .flap { color: #A39E90; }
.lamps .sig--unknown { font-size: 11px; }
.bars i[data-s="unknown"] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.svc[data-status="unknown"] { --tint: var(--faint); background: color-mix(in oklab, var(--tint) 8%, transparent); box-shadow: inset 3px 0 0 var(--tint); }
.svc .state--unknown { font-weight: 600; }

.comp--nobars { grid-template-columns: minmax(0, 1fr) auto; }
.incident-board > .board + .board { margin-top: 16px; }
.incident-board h3 a, .tl__body h3 a { color: inherit; text-decoration: none; }
.incident-board h3 a:hover, .tl__body h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.empty-note { margin: 0; padding: 18px 20px; border: 1.5px dashed var(--line-strong); border-radius: 14px; color: var(--muted); }

/* 404: message left, a small board with ways back in on the right. */
.notfound { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 48px; align-items: center; padding-block: 64px 80px; }
.notfound__text h1 { margin: 6px 0 12px; font-size: var(--fs-2xl); letter-spacing: -.02em; line-height: 1.05; }
.notfound__text p { color: var(--muted); }
.notfound__tiles { padding: 28px 28px 8px; font-size: 64px; }
.flaps--accent .flap { color: #FFD23F; }
.notfound__links { padding: 18px 28px 26px; }
.notfound__links p { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-sm); }
.notfound__links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.notfound__links a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--board-line); border-radius: 17px; color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.notfound__links a:hover { border-color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .board__headline, .board--calm .board__headline { grid-template-columns: auto minmax(0, 1fr); }
  .board__sub, .board--calm .board__sub { grid-column: 1 / -1; margin-top: 22px; padding-left: 0; border-left: 0; }
  .notfound { grid-template-columns: 1fr; }
  .list__grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .list__head--2 { display: none; }
  .brow, .brows__head { grid-template-columns: 190px 170px 1fr 120px; }
  .brow__since, .brows__head .h-since { display: none; }
  .layout { grid-template-columns: 1fr; }
  .aside { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-row: 1; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --fs-num: 72px; --fs-2xl: 30px; --fs-3xl: 40px; --fs-xl: 24px; }
  body { font-size: 15px; }
  .topbar__inner { height: 58px; gap: 12px; }
  .live__label { display: none; }
  .btn--sponsor, .btn--alerts { width: 38px; padding: 0; justify-content: center; }
  .btn--sponsor .btn__text, .live .sec { display: none; }
  .btn--alerts .btn__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .alerts-count { position: absolute; top: -7px; right: -7px; min-width: 18px; padding: 3px 4px; font-size: 11px; }
  .alerts { inset: 66px var(--gutter) auto auto; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__word { height: 15px; }
  .topbar__meta { gap: 8px; }
  .live { font-size: 13px; }
  .proto-note__inner { flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
  .proto-note__switch { margin-left: 0; }

  .hero { padding-top: 16px; }
  .board { border-radius: 12px; }
  .board__head { padding: 12px 16px; flex-wrap: wrap; }
  .lamps { order: 3; max-width: none; width: 100%; justify-content: flex-start; margin: 0; gap: 4px; font-size: 10px; }
  .board__clock { margin-left: auto; font-size: 14px; }
  .board__headline { padding: 20px 16px 18px; gap: 0 14px; }
  .board__count.flaps--count { font-size: 40px; }
  .board--alert .board__headline h1 { font-size: 30px; }
  .board__headline h1 .hero-now { display: none; }
  .board__sub { font-size: 15.5px; margin-top: 16px; }
  .brows__wrap { padding: 0 16px 4px; }
  .brows__head { display: none; }
  .brow { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 12px; }
  .brow .flaps { grid-column: 1; font-size: 15px; }
  .brow__svc { grid-column: 1 / -1; grid-row: 2; font-size: 20px; margin-top: 2px; }
  .brow__title { grid-column: 1 / -1; grid-row: 3; font-size: 15px; }
  .brow__stage { grid-column: 1 / -1; grid-row: 4; font-size: 13.5px; }
  .brow__since { display: block; grid-column: 2; grid-row: 1; font-size: 13px; text-align: right; }
  .brow__since br { display: none; }
  .brow__since .dur { display: none; }
  .board__foot { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }

  .controls { padding-top: 20px; gap: 12px; }
  .controls__row { gap: 10px; }
  .tally { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); }
  .tally button { grid-template-columns: auto; justify-items: center; padding: 9px 2px; row-gap: 2px; }
  .tally .sig, .tally .tally__all { font-size: 11px; }
  .tally b { font-size: 20px; }
  .tally small { font-size: 11.5px; }
  .search { min-width: 0; flex-basis: 100%; }
  .search input { min-height: 46px; font-size: 16px; }
  .search kbd { display: none; }
  .sort { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .chip { flex: none; }

  .list__head { display: none; }
  .list__head, .svc { grid-template-columns: 14px minmax(0, 1fr) auto 32px; gap: 12px; }
  .svc { min-height: 56px; padding: 6px 4px 6px 10px; }
  .svc .bars, .svc__uptime { display: none; }

  .footer__inner { grid-template-columns: 1fr; gap: 18px; padding-block: 26px 30px; }
  .notfound { padding-block: 32px 48px; }
  .notfound__tiles { padding: 20px 16px 4px; font-size: 52px; }
  .notfound__links { padding: 16px 16px 20px; }
  .footer__links { gap: 10px 22px; }
  .teaser { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .teaser .btn { justify-self: start; }

  .svc-head { grid-template-columns: 1fr; padding-bottom: 20px; }
  .svc-head h1 { font-size: 56px; }
  .svc-head__status .status { font-size: var(--fs-md); }
  .svc-head__status p { font-size: 15.5px; }
  .svc-head__actions { align-items: stretch; }
  .svc-head__actions .row { flex-wrap: wrap; }
  .svc-head__actions .row .btn { flex: 1; justify-content: center; }
  .svc-head__meta { text-align: left; }
  .layout { padding-top: 22px; gap: 28px; }
  .aside { grid-template-columns: 1fr; grid-row: auto; }
  .incident-board .board__head { flex-wrap: wrap; gap: 2px 12px; }
  .incident-board .board__head .started { flex-basis: 100%; }
  .incident-board__body { padding: 18px 16px 4px; }
  .incident-board h3 { font-size: 23px; }
  .updates li { grid-template-columns: 1fr; gap: 4px; }
  .updates li > div { flex-direction: row; gap: 12px; }
  .uptime__overall { padding: 16px; }
  /* 90 bars are unreadable on a phone: show the last 30 days only. */
  .bars--90 > i:nth-child(-n+60) { display: none; }
  .axis .wide, .uptime__pct .wide { display: none; }
  .axis .narrow { display: inline; }
  .bars--lg { height: 36px; gap: 2px; }
  .bars--lg i { height: 30px; }
  .bars--lg i[data-s="down"] { height: 36px; }
  .comp { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 16px; }
  .comp .bars { grid-column: 1 / -1; gap: 2px; }
  .comp__pct { display: none; }
  .tl { grid-template-columns: 50px 24px minmax(0, 1fr); gap: 0 10px; }
  .tl__node { width: 22px; height: 22px; font-size: 11px; }
  .tl__body h3 { font-size: 16.5px; }
}

/* Small phones: Alerts takes the header slot; Sponsor stays in the footer. */
@media (max-width: 440px) {
  .topbar .btn--sponsor { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .live__dot { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--up) 0%, transparent); } }
}

.updates__more { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--muted); }
.updates__more a { color: var(--text); }
