/* Pikett console design system.
 *
 * Ground: paper, not a substation yard. A warm off-white with near-black text, and
 * one electric yellow spent as a marker pen rather than as a fill. The yellow is the
 * product's own — it says Pikett and nothing else.
 *
 * That last sentence is a constraint rather than a flourish. Priority is a scale and
 * is drawn as one, P1 hottest to P5 coolest, and the ramp runs red to cool grey so it
 * never lands anywhere near the brand yellow. An earlier cut of this palette put P2
 * at #ffa445 and P3 at #cbb173, which sat right on top of the marker: a responder
 * would have had to tell "Pikett highlighted this" apart from "this is a P2", at 3am,
 * by hue alone. Severity now runs red→grey, which is unambiguous against yellow and
 * survives the common colour-vision deficiencies that orange-versus-yellow does not.
 *
 * Colour is otherwise spent on state alone: a client is named typographically and
 * never coloured. With twenty clients on one board, colour-coding collapses into
 * confetti and steals the only signal that has to survive being read at 3am.
 */

/* Imported rather than linked from each page, so the one stylesheet every page already
 * asks for is what pulls the faces in. It costs a round trip before the face requests
 * start; font-display: swap means that delays the swap, not the text.
 * The version is fonts.css's own content hash, pinned by hand because the CDN caches the
 * import like any other url; TestTheFacesImportCarriesTheirVersion says when to bump it. */
@import url("fonts.css?v=6399453fcc69");

/* ── type ──────────────────────────────────────────────────────────────────
 * Faces are self-hosted from the binary; see fonts.css. IBM Plex Mono carries
 * identifiers and timestamps, where its origin in technical documentation is the point.
 * There is no display face: headings, figures and buttons are the reading face, set heavy.
 *
 * Reading text is the machine's own face first: on a Mac that is SF, which is what makes the
 * console sit on the desk as an app rather than as a web page; everywhere else it is Plex Sans.
 * Michroma is the wayfinding face (the wordmark, a screen's name, a section's label), set only
 * in wide tracked capitals of a few words, the way a building signs its doors.
 */
:root {
  --body: -apple-system, BlinkMacSystemFont, "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --label: "Michroma", "Eurostile", ui-sans-serif, system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0:  0.9375rem;
  --step-1:  1.125rem;
  --step-2:  1.5rem;
  --step-3:  2.25rem;
  --step-4:  3.5rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 14px;
  --space-4: 22px;
  --space-5: 34px;
  --space-6: 56px;

  /* Cards are softened and buttons more so. The old 3px read as a control
   * panel; this reads as an app somebody chose to install. */
  --radius:     12px;
  --radius-btn: 8px;
  --shell: 1280px;
  /* The desk's sidebar. Below the phone breakpoint the nav becomes a bottom tab bar instead. */
  --sidebar: 220px;
  /* The alert list's pane beside the chosen alert, on a screen wide enough for both. */
  --list-pane: 400px;
}

/* ── paper: the ground everything is read on ───────────────────────────────
 * A warm off-white rather than a blue-grey, white cards standing on it, and
 * near-black ink. The warmth matters: a neutral #f0f0f0 reads as unpainted,
 * and the yellow below turns sour against a cold ground.
 *
 * --mark is the brand yellow and is deliberately NOT --accent-as-fill. It is
 * spent in three places and no others: a full-bleed ground, the panel showing
 * a secret that can never be read again, and small badges. Yellow demands
 * black on top of it — it has no usable contrast with white — so --on-mark is
 * ink rather than paper, always.
 */
:root {
  --ground:   #f2f1ed;
  --deck:     #ffffff;
  --raised:   #f8f7f4;
  --line:     #e4e2db;
  --line-2:   #cdc9bf;
  --paper:    #14140f;
  --haze:     #5f5c55;
  --haze-dim: #8b877e;

  --mark:    #f2f200;
  --on-mark: #14140f;
  /* The selection: the sidebar's current screen, washed rather than solid, so the brand yellow
   * stays the loud thing it is everywhere else. */
  --mark-soft: #f7f3a6;

  /* Severity, red-hot to cool grey. It runs nowhere near --mark on purpose:
   * see the note at the top of this file. Lightness falls monotonically with
   * the hue shift, so the ramp still reads as a ramp in greyscale and to a
   * reader who cannot separate red from green. */
  --p1: #d0021b;
  --p2: #b03a2e;
  --p3: #7e5c5c;
  --p4: #5b6670;
  --p5: #8b9198;

  --ack:  #0f7a4f;
  --fail: #d0021b;

  /* The primary action is ink, not yellow. Yellow is the product; black is
   * "press this". Keeping them apart is what stops an Acknowledge button and a
   * brand flourish looking like the same object. */
  --accent:    #14140f;
  --on-accent: #ffffff;
}

/* ── lights out: the same world for somebody reading a phone in bed ───────
 * Not an inversion. The ground goes to near-black, cards lift off it, and the
 * severity ramp is re-cut brighter so P1 still outranks P2 — a naive lightness
 * flip would compress the top of the scale into one indistinguishable red.
 * --mark barely moves: a brand colour that changed with the theme would stop
 * being recognisable as the brand.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --ground:   #121210;
    --deck:     #1b1b18;
    --raised:   #232320;
    --line:     #2f2f2b;
    --line-2:   #42423c;
    --paper:    #f0efe9;
    --haze:     #9b978d;
    --haze-dim: #6d6a63;

    --mark:    #f2f200;
    --on-mark: #14140f;
    --mark-soft: rgb(242 242 0 / 0.16);

    --p1: #ff4b3e;
    --p2: #e8705c;
    --p3: #bd8a86;
    --p4: #8d99a8;
    --p5: #69737f;

    --ack:  #43c98a;
    --fail: #ff4b3e;

    /* On a dark ground an ink button is invisible, so the primary action
     * inverts to paper. It is still not yellow. */
    --accent:    #f0efe9;
    --on-accent: #14140f;
  }
}

/* The viewer's own toggle wins over the OS preference, in both directions. */
:root[data-theme="light"] {
  --ground: #f2f1ed; --deck: #ffffff; --raised: #f8f7f4;
  --line: #e4e2db; --line-2: #cdc9bf;
  --paper: #14140f; --haze: #5f5c55; --haze-dim: #8b877e;
  --mark: #f2f200; --on-mark: #14140f; --mark-soft: #f7f3a6;
  --p1: #d0021b; --p2: #b03a2e; --p3: #7e5c5c; --p4: #5b6670; --p5: #8b9198;
  --ack: #0f7a4f; --fail: #d0021b;
  --accent: #14140f; --on-accent: #ffffff;
}
:root[data-theme="dark"] {
  --ground: #121210; --deck: #1b1b18; --raised: #232320;
  --line: #2f2f2b; --line-2: #42423c;
  --paper: #f0efe9; --haze: #9b978d; --haze-dim: #6d6a63;
  --mark: #f2f200; --on-mark: #14140f; --mark-soft: rgb(242 242 0 / 0.16);
  --p1: #ff4b3e; --p2: #e8705c; --p3: #bd8a86; --p4: #8d99a8; --p5: #69737f;
  --ack: #43c98a; --fail: #ff4b3e;
  --accent: #f0efe9; --on-accent: #14140f;
}

/* ── base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--ground);
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Headings are heavy and set tight. The reference this is drawn from sets its
 * headlines at three lines of near-solid leading, and the weight is what makes
 * that read as confident rather than cramped. */
h1, h2, h3 {
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-3); line-height: 1.06; }
h2 { font-size: var(--step-2); line-height: 1.12; }

/* A lede is the sentence under a title that says what the screen is for. */
.lede {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--haze);
  max-width: 62ch;
  margin: var(--space-3) 0 0;
}

/* Links read as links: underlined, in ink rather than in a colour that would
 * compete with severity. */
:where(a) { color: var(--paper); text-underline-offset: 0.18em; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.shell { max-width: var(--shell); margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-6); }

/* A label labels. Uppercase mono at this size needs the tracking to stay readable. */
/* ── nav ───────────────────────────────────────────────────────────────────
 * One row, shared by every signed-in screen: the wordmark, then the 3am tier,
 * then the Tuesday-afternoon tier behind a hairline. Deliberately quiet — it
 * is how somebody gets between screens, never what they look at first — and
 * the current screen is marked the way this system marks anything: with the
 * one yellow bar it is allowed.
 */
.nav {
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.nav-tier { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.nav-bar { display: contents; }
.nav-more { display: none; }
.nav-label { display: none; }
/* The setup tier stands apart on spacing alone. A hairline seam was tried and
 * wrapped into an orphaned tick at narrow widths; the wider gap between tiers
 * survives every wrap. */
.nav-setup { margin-left: var(--space-3); }
.nav a {
  color: var(--haze);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 500;
  padding: 2px 0 4px;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--paper); }
.nav a[aria-current="page"] {
  color: var(--paper);
  font-weight: 700;
  border-bottom-color: var(--mark);
}
/* The way out sits at the far end, dressed as the quiet text it is. */
.nav-out { margin-left: auto; }
.nav-out button {
  font: inherit;
  font-size: var(--step--1);
  color: var(--haze-dim);
  background: none;
  border: 0;
  padding: 2px 0 4px;
  cursor: pointer;
}
.nav-out button:hover { color: var(--paper); }

/* A label labels: Michroma capitals of a few words, on every page, signed in or not. */
.kicker {
  font-family: var(--label);
  font-size: 0.5625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--haze-dim);
}

/* A line of facts about the thing above it (its state, its impact, how long it has run): small
 * uppercase mono, read rather than signposted. */
.facts {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--haze);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* A command somebody copies: as written, in mono, on a quiet ground, never re-cased. */
.snippet {
  margin: var(--space-2) 0 0;
  padding: 6px 10px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

/* ── priority ──────────────────────────────────────────────────────────── */
.pri {
  font-family: var(--body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 0.84;
}
.pri-1 { color: var(--p1); }
.pri-2 { color: var(--p2); }
.pri-3 { color: var(--p3); }
.pri-4 { color: var(--p4); }
.pri-5 { color: var(--p5); }

/* ── the ladder ────────────────────────────────────────────────────────────
 * The signature element. Vertical distance between rungs is the real delay,
 * so five minutes is five times taller than one and a responder sees their
 * runway before reading a number. The gap height is set inline by the server
 * from run_at, because only the server knows the actual schedule; --ladder-scale
 * is the px-per-minute it uses, kept here so the two cannot drift.
 */
.ladder {
  --ladder-scale: 11px;
  --ladder-gap-min: 26px;
  --ladder-gap-max: 220px;
  position: relative;
  padding-left: var(--space-5);
}
.ladder::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 10px;
  width: 1px;
  background: linear-gradient(var(--line-2) 60%, transparent);
}

.rung { position: relative; }
.rung-dot {
  position: absolute;
  left: calc(var(--space-5) * -1);
  top: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--deck);
}
.rung-row { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.rung-at { font-family: var(--mono); font-size: var(--step--1); color: var(--haze); font-variant-numeric: tabular-nums; min-width: 52px; }
.rung-who { font-weight: 500; }
.rung-via {
  font-family: var(--mono);
  font-size: 0.65625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--haze);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 1px 6px;
}
.rung-outcome { font-family: var(--mono); font-size: var(--step--1); margin-left: auto; }

.rung-done .rung-dot { background: var(--haze-dim); border-color: var(--haze-dim); }
.rung-done .rung-outcome { color: var(--haze-dim); }

.rung-failed .rung-dot { background: var(--fail); border-color: var(--fail); }
.rung-failed .rung-outcome { color: var(--fail); }

.rung-live .rung-dot { background: var(--p1); border-color: var(--p1); }
.rung-live .rung-outcome { color: var(--p1); }
.rung-live .rung-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--p1);
  animation: beacon 2.4s ease-out infinite;
}

.rung-next .rung-dot { background: var(--deck); }
.rung-next .rung-who,
.rung-next .rung-at { color: var(--haze); }
.rung-next .rung-outcome { color: var(--haze); }

@keyframes beacon {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

.ladder-gap { position: relative; }
.ladder-gap .tick {
  position: absolute;
  left: calc(var(--space-5) * -1 + 3px);
  width: 9px; height: 1px;
  background: var(--line);
}
.ladder-gap .span {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.65625rem;
  letter-spacing: 0.06em;
  color: var(--haze-dim);
}
/* A rung reached early because delivery failed. The colour says the wait was
 * cut short by a failure rather than by the schedule. */
.ladder-gap-accelerated .span { color: var(--fail); }

/* ── actions ───────────────────────────────────────────────────────────────
 * Sized for a thumb on a phone held by someone who was asleep a minute ago.
 * The keycaps are not decoration: they are the same digits the voice call
 * asks for, so the screen and the phone tree teach each other.
 */
.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
/* The primary action is a solid ink slab with paper lettering — the shape the
 * reference uses for every commit-to-this control. It is deliberately not the
 * brand yellow: yellow says "Pikett", ink says "press this", and a button that
 * said both would be a flourish somebody has to decide about at 3am. */
.btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { opacity: 0.86; }
.btn:active { transform: translateY(1px); }
.btn-ack { background: var(--accent); color: var(--on-accent); }
/* The triage row is the one place a button is big: it is pressed half awake, by thumb. */
.actions .btn { flex: 1 1 0; min-height: 52px; font-size: var(--step-1); }
/* Resolve is outlined rather than solid: acknowledging is what a woken
 * responder does first, and two solid slabs would make them equal. */
.btn-resolve {
  background: transparent;
  border-color: var(--paper);
  color: var(--paper);
}
/* Snooze is the quiet one of the three on purpose: it is the only action that
 * expires, and a button as loud as Acknowledge would be pressed instead of it. */
.btn-snooze { background: transparent; border-color: var(--line); color: var(--haze); }
.btn .key {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.7;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 5px;
}

/* ── state ─────────────────────────────────────────────────────────────── */
.state-climbing { color: var(--p1); }
.state-acked    { color: var(--ack); }
.state-quiet    { color: var(--haze-dim); }
/* Something that will not work: a rung that failed, or a responder on the rota
 * with no address for a page to arrive at. The same colour, because they are the
 * same fact one step apart. */
.state-failed   { color: var(--fail); }

/* ── lists ──────────────────────────────────────────────────────────────
 * The bare list reset the alert list and the roster share. Both are lists of
 * things rather than prose, and a bullet in front of an incident is decoration
 * on a screen that has none anywhere else.
 */
.rows { list-style: none; margin: var(--space-4) 0 0; padding: 0; }

/* One alert, one row: priority; what broke with where it is from under it; and the runway -
 * how much of the ladder is spent, and in words who is next or who has it. The whole row is
 * the link, because a woken thumb does not hunt for the hot part. The message owns the width;
 * everything else is sized to what it says. */
.row { border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row > a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(140px, 180px);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  text-decoration: none;
  color: var(--paper);
  border-radius: var(--radius-btn);
}
.row > a:hover { background: var(--deck); }
.row .pri { font-size: var(--step-0); font-weight: 700; }
.row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row .what { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.row-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--haze);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-state { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row .status {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* The runway bar. Red while somebody is about to be woken, green once somebody has it, grey
 * when nothing climbs. The fill is the share of the ladder already spent. */
.runway {
  display: block;
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.runway > span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.runway-climbing > span { background: var(--p1); }
.runway-held > span { background: var(--ack); }
.runway-quiet > span { background: var(--haze-dim); }
/* The client heading above a group of rows, for the MSP board: typographic,
 * never coloured, so twenty clients cannot turn into confetti. */
.client-group {
  font-family: var(--label);
  font-size: 0.5625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--haze-dim);
  margin: var(--space-4) 0 0;
}

@media (max-width: 620px) {
  .row > a { grid-template-columns: 30px minmax(0, 1fr); row-gap: var(--space-2); }
  .row-state { grid-column: 2; flex-direction: row-reverse; align-items: center; gap: var(--space-3); }
  .row-state .runway { flex: 1 1 auto; }
  .row .status { text-align: left; flex: 0 1 auto; }
}

/* ── the roster ────────────────────────────────────────────────────────────
 * Read at two in the afternoon by somebody adding a colleague, not at 3am — so
 * it is denser than the alert view and spends no colour at all except on the one
 * line that says somebody cannot be paged.
 */
.notice {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-3);
  margin: var(--space-4) 0;
}

.invite {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--deck);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  max-width: 480px;
}
.invite label, .rotation-form label, .rung-form label { display: block; margin-bottom: var(--space-1); }
.invite input, .invite select, .invite textarea { width: 100%; }
.invite .btn, .rotation-form .btn, .rung-form .btn {
  flex: 0 0 auto; width: auto; min-height: 44px;
  font-size: var(--step-0); padding: 0 var(--space-5);
}

.person {
  border-top: 1px solid var(--line);
  padding: var(--space-3) 0;
}
.person-who { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; margin: 0; }
.person-who .what { font-weight: 600; }
/* An incident's reference stays in one piece beside its title, however long the title runs. */
.incident-ref { white-space: nowrap; }
/* A removed seat stays on the roster because it is still named by the alerts it
 * acknowledged. It is dimmed rather than hidden, so "where did Lee go" has an
 * answer on the screen instead of in the database. */
.person-removed { opacity: 0.55; }
.person-admin { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }

.addresses { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.address {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-1) 0;
}
.address-add { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }

/* Every form on this screen is a row of controls rather than a page of them, so
 * the inputs sit on the line they belong to. */
:where(input, select) {
  font: inherit;
  color: var(--paper);
  background: var(--deck);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-btn);
  min-height: 44px;
  padding: 0 var(--space-3);
}
:where(textarea) {
  font: inherit;
  color: var(--paper);
  background: var(--deck);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-btn);
  padding: var(--space-2) var(--space-3);
  line-height: 1.5;
  resize: vertical;
}
:where(input, select, textarea):focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 1px;
}
:where(label) { font-size: var(--step--1); font-weight: 600; color: var(--haze); }

/* The quiet button: the same control as .btn, sized for a line of a list rather
 * than for a thumb on a phone. Removing an address is not a thing anybody does
 * half-awake, and a 58px target for it would shout over the page. */
.btn-quiet {
  flex: 0 0 auto;
  min-height: 0;
  padding: var(--space-1) var(--space-3);
  font-size: var(--step--1);
  background: transparent;
  border-color: var(--line-2);
  color: var(--haze);
}
.btn-quiet:hover { color: var(--paper); }

/* ── live region ───────────────────────────────────────────────────────────
 * The ladder updates from the server over SSE. A rung changing under a
 * responder's eyes must be announced, not just repainted.
 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── the rota ──────────────────────────────────────────────────────────────
 * Read at two in the afternoon by somebody arranging cover for tomorrow, and at
 * 03:00 by somebody checking whether tonight is theirs. The current shift is the
 * only thing on it that has to survive being read half-awake, so it is the only
 * thing given weight; everything below it recedes.
 */
.shifts { margin: var(--space-3) 0 var(--space-5); }
.shift {
  border-top: 1px solid var(--line);
  padding: var(--space-2) 0;
}
.shift .rung-row { margin: 0; }
/* The shift running now, which is the answer to the only question most people
 * open this page with. */
.shift-now {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-3);
  border-top: 0;
}
.shift-now .rung-who { font-family: var(--body); font-size: var(--step-2); font-weight: 600; }
/* Everything past "next" is planning rather than answering, and reads as such. */
.shift-later { opacity: 0.7; }

/* ── on call ───────────────────────────────────────────────────────────────
 * One line per rota, read at a glance: the name of whoever the pager reaches
 * this second, sized like the headline it is, and when it leaves them.
 */
.oncall-now {
  display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap;
  margin: var(--space-1) 0;
}
.oncall-now .rung-who { font-family: var(--body); font-size: var(--step-1); font-weight: 600; }

/* A rotation's form is a form of rows, and the rows are the rota. */
.rotation-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--deck);
  padding: var(--space-3);
  margin-top: var(--space-3);
}
/* One control per position, because a multi-select cannot express an order. The
 * number in front is the position in the cycle, so the column reads as the rota
 * rather than as a list of people who happen to be on it. */
.rota-slot { display: flex; align-items: baseline; gap: var(--space-2); margin: var(--space-1) 0; }
.rota-slot label {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--haze-dim);
  min-width: 1.5em;
  text-align: right;
}
.restriction-row { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }

/* A rung's form. The same card as a rotation's, because the two screens are read by the same
 * person doing the same job — deciding who a page reaches — and a second visual language for
 * the second half of that would only make the pair harder to hold in the head. */
.rung-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--deck);
  padding: var(--space-3);
  margin-top: var(--space-3);
}
.rung-line { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-2) 0; }
/* The channels are tick boxes rather than a multi-select: which of five ways somebody is
 * reached is a set, and a set of five is small enough to show whole. */
.rung-form .channel-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 var(--space-2) 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--paper);
}
/* A tick box is its own size, never a text field's. */
:where(input[type="checkbox"], input[type="radio"]) { min-height: 0; padding: 0; margin: 0; }

/* ── the wordmark ──────────────────────────────────────────────────────────
 * The name is Pikett, set plain. It is the way back to the alert list from
 * every screen.
 */
.nav .wordmark {
  font-family: var(--label);
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 0;
  padding: 0;
}

/* ── the service catalogue ─────────────────────────────────────────────────
 * What a client runs, and how each thing reaches Pikett. Cards on paper, in the
 * shape the rest of this system now uses: white deck, hairline rule, soft
 * corner, and no colour except where colour means something.
 */
.service {
  background: var(--deck);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-top: var(--space-4);
}
.service-head {
  display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.service-head .slug {
  font-family: var(--mono); font-size: var(--step--1); color: var(--haze-dim);
}

/* A service nothing can reach. Drawn as a warning rather than as an absence:
 * it is configured, it routes to a policy, and no alert can arrive about it —
 * which looks exactly like working ingestion until the first outage. */
.unreachable {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--p1);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px var(--space-2);
}

.integrations { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.integration {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}
.integration-name { font-weight: 600; }
.via {
  font-family: var(--mono); font-size: 0.65625rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--haze);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 1px var(--space-2);
}
.heard { font-family: var(--mono); font-size: var(--step--1); color: var(--haze); margin-left: auto; }
/* Nothing has ever arrived on this key. Usually it was set up and never wired
 * to anything, which is worth saying differently from "quiet since Tuesday". */
.heard-silent { color: var(--p3); }

/* ── a team as a row ──────────────────────────────────────────────────────
 * What it owns sits on the right at desk width and wraps under the name on a
 * phone. The controls are a disclosure so N teams is N rows, not 3N forms. */
.team { display: flex; align-items: flex-start; flex-wrap: wrap; gap: var(--space-3);
        padding: var(--space-3) var(--space-2); }
/* Its own layout rather than .row-state's. That class is the state column of an
 * alert row and turns row-reverse under 620px, which read the ownership list
 * backwards and crammed it against the right edge on every phone. */
.team-owns {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px; margin-left: auto; min-width: 0;
}
.owned { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--step--1); }
.team-edit { flex: 1 0 100%; margin-top: var(--space-3); }
.team-edit > summary {
  cursor: pointer; color: var(--haze); font-size: var(--step--1); padding: var(--space-2) 0;
}
.team-edit > summary:hover { color: var(--paper); }
/* Last, alone, and separated by a rule: it is the one thing here that cannot be
 * undone, and it used to sit at the same weight as "Add". */
.team-delete {
  margin-top: var(--space-4); padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
}
@media (max-width: 34rem) {
  /* Under the name rather than beside it: at 390px there is no room for two
   * columns, and right-aligning a list nobody is scanning from the right just
   * pushes it against the edge. */
  .team-owns { align-items: flex-start; margin-left: 0; flex: 1 0 100%; }
}

/* ── the stretch ahead on a rota ───────────────────────────────────────────
 * Four slots in a row, so "is next weekend covered" is a glance rather than a
 * page each. It wraps rather than scrolls: a hidden slot is an uncovered
 * Saturday nobody saw, which is the failure this strip exists to prevent. */
.shift-strip {
  list-style: none; margin: var(--space-2) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--space-2);
}
.shift-slot {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--deck);
}
/* A stretch somebody took by hand. It reads differently from the rotation on
 * purpose: whoever arranged it needs to see that it took. */
.shift-cover { border-color: var(--mark); }
.shift-slot .rung-at { font-size: var(--step--1); color: var(--haze); }
.oncall-cover { margin-left: auto; }

/* ── where an alert came from ──────────────────────────────────────────────
 * Who sent it reads as a sentence, because it is one. The body it arrived in
 * is folded away: it answers a question asked about one alert in ten, and
 * unfolded it would push the ladder — the thing you were woken for — under
 * the fold. */
.provenance { color: var(--haze); font-size: var(--step--1); margin: var(--space-2) 0 0; }
.provenance strong { color: var(--paper); font-weight: 600; }
.payload { margin-top: var(--space-3); }
.payload > summary {
  cursor: pointer; color: var(--haze); font-size: var(--step--1);
  padding: var(--space-2) 0;
}
.payload > summary:hover { color: var(--paper); }
.payload pre {
  margin: 0;
  padding: var(--space-3);
  background: var(--deck);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  overflow-x: auto;
  font-size: var(--step--1);
  line-height: 1.5;
}

/* Where a connector's alerts go. Its own row inside the integration line — the
 * flex basis is what puts it there — because it is a sentence being completed
 * ("this endpoint pages…") rather than another button beside the two that act. */
.routing {
  flex: 1 0 100%;
  display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap;
  padding-top: var(--space-2);
}
.routing label { font-size: var(--step--1); color: var(--haze); flex: 0 0 auto; }
.routing select {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-btn);
  background: var(--deck);
  color: var(--paper);
  font: inherit;
}
.routing .btn { flex: 0 0 auto; min-height: 44px; font-size: var(--step-0); padding: 0 var(--space-4); }

/* ── the panel a secret is shown on, once ──────────────────────────────────
 * The one screen in Pikett that is full-bleed brand yellow, and it earns it: the
 * row stores sha256 of this key and never the key, so this is the only moment
 * it exists anywhere a person can read it. Everything about it should say
 * "act now" — which is what the yellow is for.
 */
.minted {
  background: var(--mark);
  color: var(--on-mark);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-top: var(--space-4);
}
.minted .kicker { color: var(--on-mark); opacity: 0.72; }
.minted h2 { margin-bottom: var(--space-2); }
.minted p { max-width: 62ch; }
.secret {
  width: 100%;
  font-family: var(--mono);
  font-size: var(--step-0);
  padding: var(--space-3);
  margin-top: var(--space-3);
  border: 1px solid var(--on-mark);
  border-radius: var(--radius-btn);
  background: var(--deck);
  color: var(--paper);
}
.minted .hint { color: var(--on-mark); opacity: 0.72; }

.hint { font-size: var(--step--1); line-height: 1.5; color: var(--haze); max-width: 62ch; margin: var(--space-2) 0 0; }
span.hint { display: block; }

/* ── forms on this screen ──────────────────────────────────────────────── */
.add-integration, .add-service form {
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center;
}
.add-integration label, .add-service label {
  font-size: var(--step--1); color: var(--haze); flex: 0 0 auto;
}
.add-integration input, .add-service input {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-btn);
  background: var(--deck);
  color: var(--paper);
  font: inherit;
}
/* The forms' buttons do not stretch the way the 3am action slabs do: these are
 * pressed on a Tuesday afternoon with both hands free. */
.add-integration .btn, .add-service .btn, .delete-service .btn {
  flex: 0 0 auto; min-height: 44px; font-size: var(--step-0);
  padding: 0 var(--space-4);
}
.add-service { margin-top: var(--space-5); }
.delete-service { margin-top: var(--space-3); }

/* ── the sentence a screen says after a change ─────────────────────────── */
.said {
  background: var(--raised);
  border-left: 3px solid var(--mark);
  border-radius: var(--radius-btn);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0 0;
  max-width: 72ch;
}

/* An empty screen is an invitation to act, not a report that there is nothing. */
.empty {
  color: var(--haze);
  font-size: var(--step-1);
  max-width: 62ch;
  margin-top: var(--space-5);
}

/* ── the overview ──────────────────────────────────────────────────────────
 * The dashboard answers "what needs me right now, and who is on it" without being read line by
 * line: a status line, then the things that need somebody and what just happened on the left,
 * and on the right, as an inspector would, who holds the pager, the week, and what needs fixing.
 */
.status-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-4);
  margin: var(--space-3) 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.status-headline { margin: 0; font-size: 1.125rem; font-weight: 600; }
.status-oncall { margin: 0; color: var(--haze); }
.overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); max-width: 1200px; }
@media (min-width: 1000px) {
  .overview { grid-template-columns: minmax(0, 1fr) 300px; }
}
.overview-main, .overview-side { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.overview-panel > .kicker { margin: 0 0 var(--space-2); }
.overview-side .overview-panel {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: var(--space-3);
}
.overview-empty { margin: 0; color: var(--haze); }
.overview-more { display: inline-block; margin-top: var(--space-2); font-size: 0.8125rem; }

.attention { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.attention li { border-bottom: 1px solid var(--line); }
.attention a {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: baseline;
  gap: var(--space-3);
  padding: 10px var(--space-2);
  color: var(--paper);
  text-decoration: none;
}
.attention a:hover { background: var(--raised); }
.attention-ref { font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.attention-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attention-what { font-weight: 600; }
.attention-meta { font-size: 0.75rem; color: var(--haze); }
.attention-state { font-size: 0.75rem; white-space: nowrap; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li {
  display: grid; grid-template-columns: 44px auto minmax(0, 1fr); align-items: baseline;
  gap: var(--space-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
}
.activity-at { font-size: 0.75rem; color: var(--haze-dim); }
.activity-said { white-space: nowrap; }
.activity-what { color: var(--haze); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-what:hover { color: var(--paper); text-decoration: underline; }

.pager { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.pager li { display: flex; flex-direction: column; gap: 1px; }
.pager-rota, .pager-next { font-size: 0.75rem; color: var(--haze); }
.pager-now { font-weight: 600; }

.week-figures { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.week-figures div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.week-figures dt { font-size: 0.8125rem; color: var(--haze); }
.week-figures dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.problems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.problems a { color: var(--fail); font-size: 0.8125rem; }

/* ── the front door ────────────────────────────────────────────────────────
 * Registration and sign-in read at phone width wherever they are opened, so
 * their shell narrows: a 1180px line under a three-field form is a form lost
 * on its own page.
 */
.shell-narrow { max-width: 480px; padding-top: 9vh; }
/* The brand line a signed-out page opens with: the wordmark, standing alone. */
.brand {
  font-family: var(--label);
  font-size: var(--step-2);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--paper);
  margin: 0 0 var(--space-2);
}
/* The front door's form is a card, and everything in it is full width: one
 * column, one direction, nothing to hunt for. The reference's forms are the
 * same shape at phone width, which is where a paged person actually is. */
.shell-narrow form {
  background: var(--deck);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-top: var(--space-4);
}
.shell-narrow form p { margin: 0 0 var(--space-3); }
.shell-narrow form p:last-child { margin-bottom: 0; }
.shell-narrow input { width: 100%; }
.shell-narrow .btn { width: 100%; }

/* The reference's list bullet: a brand-yellow disc with an ink check drawn in
 * it. Content, not an image, so it needs no asset and inherits the theme. It
 * is for the short list of what somebody gets — never for prose.
 */
.checks { list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.checks li {
  position: relative;
  padding-left: 34px;
  margin: var(--space-2) 0;
}
.checks li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--mark);
  color: var(--on-mark);
  font-weight: 700;
  font-size: 0.8125rem;
  display: flex; align-items: center; justify-content: center;
}

/* ── the alert's history ───────────────────────────────────────────────────
 * The chronology under the ladder: how the alert got here, oldest first. It
 * recedes on purpose — it is the record, not the alarm — and the one entry
 * allowed to be loud is the ladder having run out with nobody answering.
 */
.history { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.history-entry {
  display: flex; align-items: baseline; gap: var(--space-3);
  padding: var(--space-1) 0;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--haze);
}
.history-at { flex: 0 0 auto; color: var(--haze-dim); font-variant-numeric: tabular-nums; }
.history-alarming .history-said { color: var(--p1); font-weight: 600; }
/* On an incident's story: the incident's own entries read in ink, and each alert entry names
 * the alert it is about, quietly, after what happened. */
.history-own .history-said { color: var(--paper); }
.history-about { color: var(--haze-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ── the setup path ────────────────────────────────────────────────────────
 * The checks device carrying state: a done step keeps its yellow tick, an
 * open one is a hollow ring - the same mark before and after, filled by
 * doing. Shown only while a step is open.
 */
.setup {
  background: var(--deck);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-top: var(--space-4);
  max-width: 680px;
}
.setup-steps li a { font-weight: 600; }
.setup-steps li .hint { display: block; margin-top: 2px; }
.setup-steps li.step-open::before {
  content: "";
  background: transparent;
  border: 2px solid var(--line-2);
}
.setup-steps li.step-done { opacity: 0.62; }
.setup-steps li.step-done a { text-decoration: none; }

/* ── setup (/welcome) ──────────────────────────────────────────────────────
 * Two tracks side by side on a desk: your part and, for an owner, the org's. Each step is the
 * checks device carrying state, and an open step carries its form or its door beneath it.
 */
.setup-progress { display: flex; align-items: center; gap: var(--space-3); max-width: 760px; margin-bottom: var(--space-4); }
.setup-progress .runway { flex: 1 1 auto; max-width: 320px; }
.setup-count { margin: 0; font-weight: 600; white-space: nowrap; }
.setup-tracks { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); max-width: 1200px; }
@media (min-width: 1000px) {
  .setup-tracks:has(> :nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.setup-track .checks { margin-top: var(--space-2); }
.setup-track .checks li { padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.step-label { display: block; font-weight: 600; }
.setup-steps li .step-label .hint { display: inline; margin: 0 0 0 6px; font-weight: 400; }
.setup-steps li .hint { display: block; margin-top: 2px; }
.step-go { display: inline-block; margin-top: var(--space-2); font-size: 0.8125rem; font-weight: 600; }
.setup-line { margin: 0 0 var(--space-4); font-size: 0.8125rem; }
.setup-line a { color: var(--haze); }

/* ── the postmortem ────────────────────────────────────────────────────────
 * A document being written, then a document that was sent. The editor is a
 * plain generous textarea in the mono face - it is markdown, and pretending
 * otherwise helps nobody - and the rendered account below it reads in the
 * body face at a book's measure.
 */
.pm-editor textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.6;
  background: var(--deck);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: var(--space-3);
  resize: vertical;
}
.pm-editor .actions { margin-top: var(--space-3); }
.pm-body {
  max-width: 68ch;
  background: var(--deck);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-3);
}
.pm-body h2 { margin-top: var(--space-3); }
.pm-body h3, .pm-body h4 { margin-top: var(--space-3); }
.pm-body blockquote {
  border-left: 3px solid var(--mark);
  margin: var(--space-3) 0;
  padding-left: var(--space-3);
  color: var(--haze);
}
.pm-body pre {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: var(--space-3);
  overflow-x: auto;
}
.pm-actions { margin-top: var(--space-5); max-width: 680px; }
.pm-done { text-decoration: line-through; color: var(--haze-dim); }


/* ── the phone ─────────────────────────────────────────────────────────────
 * Under 700px the nav stops wrapping into a third of the screen and becomes
 * a strip that scrolls sideways - the app pattern thumbs already know - with
 * the wordmark pinned first and the way out reachable at the strip's end.
 * Under 480px the paddings drop to phone scale, the 3am actions stack full
 * width in press order, and a rung's outcome takes its own line under its
 * name instead of orphaning at a wrap's mercy.
 */


@media (max-width: 480px) {
  .shell { padding: var(--space-3) var(--space-3) var(--space-6); }
  .service, .setup, .invite, .pm-body,
  .rotation-form, .rung-form { padding: var(--space-3); }
  .pm-body { padding: var(--space-3) var(--space-4); }

  /* The 3am actions stack whole, in press order: acknowledge first, under
   * the thumb, each the full width of the phone that woke its holder. */

  /* A rung's outcome gets its own line, aligned under the name it reports
   * on, rather than being pushed wherever the wrap left room. */
  .rung-outcome {
    flex-basis: 100%;
    margin-left: calc(52px + var(--space-3));
  }
  .history-at { min-width: 88px; }
  .history-said { min-width: 0; overflow-wrap: anywhere; }

  /* Long identifiers and pasted urls break rather than push. */
  .mono, .alert-facts, .heard { overflow-wrap: anywhere; }
}

/* ── the ingest contract ───────────────────────────────────────────────────
 * Folded away by default: it is reference, read once while configuring a
 * sender and never again, and an open block of JSON above the services would
 * bury the screen's actual job.
 */
.contract {
  background: var(--deck);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  max-width: 680px;
}
.contract summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--step--1);
}
.contract pre {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: var(--space-3);
  overflow-x: auto;
  font-size: var(--step--1);
  margin: var(--space-2) 0;
}
.contract code { font-family: var(--mono); }
.contract .kicker { margin-top: var(--space-3); }

/* ── the report ────────────────────────────────────────────────────────────
 * A client's month. Two headline figures, one chart, one ranked list - and
 * no colour spent on identity anywhere: a service is named typographically,
 * the same rule the alert board follows, because twenty clients' services
 * colour-coded is confetti.
 */
.periods { display: flex; gap: var(--space-3); margin-top: var(--space-3); }
.periods a { font-size: var(--step--1); color: var(--haze); }

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
  max-width: 680px;
}
.figure {
  background: var(--deck);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
}
/* The figure itself: large and heavy, in ink. Not a severity colour -
 * a duration is not a severity, and colouring it would invent a scale. */
.figure-n {
  font-family: var(--body);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1;
  margin: var(--space-2) 0 0;
  font-variant-numeric: tabular-nums;
}
.figure-tail { font-size: var(--step--1); color: var(--haze-dim); margin: var(--space-2) 0 0; }
.figure-of { font-size: var(--step--1); color: var(--haze-dim); margin: var(--space-1) 0 0; }
.figure-missing { color: var(--haze); margin: var(--space-2) 0 0; }

/* The chart. One series, one hue: quiet days recede in a muted neutral and the
 * busiest is ink, so the darkest bar is the tallest story. Data-ends are
 * rounded and anchored to the baseline; the 2px gap is surface between bars,
 * never a border on them. */
.chart-block { margin-top: var(--space-5); max-width: 680px; }
.chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  margin-top: var(--space-3);
  padding-top: var(--space-4);
  border-bottom: 1px solid var(--line-2);
}
.bar-slot {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.bar {
  width: 100%;
  min-height: 2px;
  background: var(--line-2);
  border-radius: 4px 4px 0 0;
  transition: background 0.12s ease;
}
.bar-slot:hover .bar { background: var(--haze); }
.bar-peak { background: var(--paper); }
.bar-label {
  position: absolute;
  top: calc(var(--space-4) * -1);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--paper);
}

/* The ranked list: a share bar behind each row rather than beside it, so the
 * name stays the thing being read and the magnitude is felt rather than
 * counted. */
.noisiest { margin-top: var(--space-5); max-width: 680px; }
.noisy {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid var(--line);
}
.noisy:last-child { border-bottom: 1px solid var(--line); }
.noisy-share {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--raised);
  border-radius: var(--radius-btn);
}
.noisy-name, .noisy-count, .noisy-typical { position: relative; }
.noisy-name { font-weight: 600; }
.noisy-count { color: var(--haze); font-size: var(--step--1); margin-left: auto; }
.noisy-typical { color: var(--haze-dim); font-size: var(--step--1); }

@media (max-width: 480px) {
  .chart { height: 90px; }
  .noisy { flex-wrap: wrap; gap: var(--space-2); }
  .noisy-count { margin-left: 0; }
}

/* ── the board's tabs ──────────────────────────────────────────────────────
 * Four questions, one row. The current one carries the same yellow bar the nav
 * uses for the current screen, because it is the same fact one level down.
 */
.tabs { display: flex; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-3) 0 0; }
.page-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.page-head .kicker { margin: 0; }
.tabs a {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--haze);
  text-decoration: none;
  padding: 2px 0 4px;
  border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--paper); }
.tabs a[aria-current="page"] {
  color: var(--paper);
  font-weight: 700;
  border-bottom-color: var(--mark);
}
.older { margin-top: var(--space-4); font-size: var(--step--1); }

/* The board's search: a toolbar field, grey and borderless like a Mac search field, at the end
 * of the title row. On a phone it takes its own line, full width, at thumb height. */
.search { margin-left: auto; flex: 0 1 180px; min-width: 110px; }
.search input[type="search"] {
  width: 100%;
  min-height: 0; height: 28px;
  padding: 0 var(--space-2) 0 26px;
  border: 0;
  border-radius: 6px;
  background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b877e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 8px center / 13px;
  font-size: 0.8125rem;
}
@media (max-width: 700px) {
  .search { flex-basis: 100%; margin-left: 0; }
  .search input[type="search"] { width: 100%; height: 40px; font-size: 1rem; }
}

/* ── a sender's own labels ─────────────────────────────────────────────────
 * Quiet by construction: they are the sender's vocabulary rather than this
 * system's, so they carry no colour and no state - reading them must never
 * compete with the priority beside them.
 */
.tags { display: inline-flex; gap: var(--space-1); flex-wrap: wrap; }
.tag {
  font-family: var(--mono);
  font-size: 0.65625rem;
  letter-spacing: 0.04em;
  color: var(--haze-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px var(--space-2);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .row > a .tags { grid-column: 1 / -1; }
}

/* A note is written under the history it joins, full width, with the button beneath. */
.note-form { display: flex; flex-direction: column; gap: var(--space-2); max-width: 680px; margin-top: var(--space-4); }
.note-form textarea { width: 100%; min-height: 88px; }
.note-form .btn { align-self: flex-start; min-height: 44px; padding: 0 var(--space-5); font-size: var(--step-0); }

/* ── the alert page: a log and a rail ──────────────────────────────────────
 * What happened reads down the left; what to do now stays in view on the right, so a desk's
 * width is spent instead of the right half standing empty. On a phone the rail comes first:
 * the state, the three actions and the ladder, then the log. #incident is the live section the
 * stream swaps, and display: contents lets its two halves sit in the page's own grid.
 */
.alert-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-4);
}
#incident { display: contents; }
.incident-rail, .incident-log, .open-incident { min-width: 0; }
.incident-rail { display: flex; flex-direction: column; gap: var(--space-3); }
.incident-rail .actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.incident-rail .btn-ack { grid-column: 1 / -1; }
.incident-log > .kicker { margin: 0 0 var(--space-1); }
.state-line {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  margin: 0;
}
.open-incident { max-width: none; margin: 0; }

/* The detail decides its columns by its own width, not the screen's: full width on the alert's
 * page it is a log and a rail; lifted into the board's narrower pane it stacks, rail first. */
.alert-detail { container-type: inline-size; }
@container (min-width: 880px) {
  .alert-body {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    grid-template-areas: "log rail" "log open";
    column-gap: var(--space-6);
    row-gap: var(--space-4);
    align-items: start;
  }
  .incident-log { grid-area: log; grid-row: 1 / span 2; }
  .incident-rail {
    grid-area: rail;
    position: sticky;
    top: var(--space-4);
    background: var(--deck);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
  }
  .open-incident { grid-area: open; }
}

/* ── the phone's tab bar ────────────────────────────────────────────────────
 * Below 700px the responding tier becomes a bar along the bottom edge, where a thumb is, and
 * the setup tier folds into one Setup menu that opens upward from it.
 */
@media (max-width: 700px) {
  body { padding-bottom: 76px; }
  .nav { gap: var(--space-3); }
  .nav-setup { display: none; }
  .nav-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--deck);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-bar .nav-respond { display: contents; }
  .nav-bar a, .nav-more summary {
    display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center;
    min-height: 56px;
    padding: 0 var(--space-1);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--haze);
    text-align: center;
    border-bottom: 0;
    border-top: 3px solid transparent;
  }
  .nav-bar a[aria-current="page"], .nav-more-current summary {
    color: var(--paper);
    border-top-color: var(--mark);
  }
  .nav-more { display: block; position: relative; }
  .nav-more summary { list-style: none; cursor: pointer; }
  .nav-more summary::-webkit-details-marker { display: none; }
  .nav-more-list {
    position: absolute; right: var(--space-2); bottom: calc(100% + var(--space-2));
    display: flex; flex-direction: column;
    min-width: 200px;
    background: var(--deck);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    padding: var(--space-2);
    box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
  }
  .nav-bar .nav-icon { width: 20px; height: 20px; }
  .nav-more-list a {
    flex-direction: row; gap: var(--space-2);
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 var(--space-3);
    font-size: var(--step-0);
    border-top: 0;
    border-radius: var(--radius-btn);
  }
  .nav-more-list a[aria-current="page"] { background: var(--raised); }
}

/* ── Direction C: the console as a Mac app ─────────────────────────────────
 * On a desk the nav is a source list: the wordmark, the responding tier, the setup tier, and who
 * is signed in at the foot, each screen with its icon, the current one washed in yellow. It is
 * fixed, so the list being read never scrolls it away. The content is white paper beside it.
 * Names of screens and sections are Michroma capitals; what is read is the machine's own face.
 */
.nav-icon {
  width: 15px; height: 15px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

@media (min-width: 701px) {
  body:has(> .shell > .nav) { background: var(--deck); }
  .shell:has(> .nav) {
    max-width: none;
    margin: 0;
    padding: var(--space-4) var(--space-5) var(--space-6) calc(var(--sidebar) + var(--space-5));
  }
  .nav {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 5;
    width: var(--sidebar);
    flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    gap: var(--space-4);
    margin: 0;
    padding: var(--space-3) 10px 10px;
    background: var(--ground);
    border-bottom: 0;
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .nav .wordmark { padding: 2px var(--space-2) 0; font-size: 0.9375rem; }
  .nav-tier { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 1px; }
  .nav-setup { margin-left: 0; }
  .nav-label {
    display: block;
    font-family: var(--label);
    font-size: 0.53125rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--haze-dim);
    padding: 0 var(--space-2) 6px;
  }
  .nav a {
    display: flex; align-items: center; gap: var(--space-2);
    min-height: 28px;
    padding: 0 var(--space-2);
    border-bottom: 0;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--paper);
  }
  .nav-setup a { color: var(--haze); }
  .nav a .nav-icon { color: var(--haze-dim); }
  .nav a:hover { background: var(--raised); color: var(--paper); }
  .nav a[aria-current="page"] {
    background: var(--mark-soft);
    color: var(--paper);
    font-weight: 600;
  }
  .nav a[aria-current="page"] .nav-icon { color: var(--paper); }
  .nav-seat { margin-top: auto; padding: var(--space-2); border-radius: 8px; }
  .nav-out { margin: 0; }
  .nav-out button { min-height: 28px; padding: 0 var(--space-2); }

  /* Segmented tabs: the answer being read is a filled pill, the way a Mac toolbar marks it. */
  .tabs { gap: 2px; }
  .tabs a { padding: 3px 10px; border-bottom: 0; border-radius: 6px; font-size: 0.8125rem; }
  .tabs a:hover { background: var(--raised); }
  .tabs a[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
}

/* A screen's name is a sign on its door; what an alert or an incident says is read, and stays in
 * the reading face. Section labels are the same sign, smaller. */
.screen-title,
.shell:has(> .nav) .screen-title {
  font-family: var(--label);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}
.shell:has(> .nav) > .page-head { margin-bottom: var(--space-3); }
/* A reading width. A screen that is not the three-pane board is read down, not across, and a
 * row stretched over a 2000px monitor puts its outcome a head-turn away from its name. */
.shell:has(> .nav):not(:has(.board)) > * { max-width: 1040px; }
/* Sections breathe: each one's title starts a new group, the way a Mac settings pane does. */
.shell:has(> .nav) > section + section,
.shell:has(> .nav) > section:not(:first-of-type) { margin-top: var(--space-5); }
.shell:has(> .nav) > h2, .shell:has(> .nav) > section > h2 { margin-bottom: var(--space-2); }
.shell:has(> .nav) > h2:not(:first-child) { margin-top: var(--space-5); }

/* An edit form folded under its row: the row is read far more often than it is changed. */
.edit-fold { margin-top: var(--space-2); }
.edit-fold > summary, .team-edit > summary {
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; list-style: none;
  font-size: 0.8125rem; font-weight: 500; color: var(--haze);
}
.edit-fold > summary::-webkit-details-marker, .team-edit > summary::-webkit-details-marker { display: none; }
.edit-fold > summary::before, .team-edit > summary::before { content: "›"; display: inline-block; transition: transform 0.12s ease; }
.edit-fold[open] > summary::before, .team-edit[open] > summary::before { transform: rotate(90deg); }
.edit-fold > summary:hover { color: var(--paper); }
.edit-fold > form { margin-top: var(--space-2); }
.shell:has(> .nav) :is(h1, h2, h3) { font-family: var(--body); letter-spacing: -0.01em; }
.shell:has(> .nav) h1 { font-size: 1.375rem; line-height: 1.25; }
.shell:has(> .nav) h2 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.shell:has(> .nav) .lede { font-size: var(--step--1); margin-top: var(--space-2); }

/* ── the board ─────────────────────────────────────────────────────────────
 * On a screen wide enough for both, the list keeps its place and the chosen alert opens in a
 * pane beside it - a responder working down a list never loses it. Narrower, the pane is not
 * drawn and a row is a plain link to the alert's own page.
 */
.board-detail { display: none; }
.row > a[aria-current] { background: var(--deck); box-shadow: inset 3px 0 0 var(--paper); }
.board-empty { color: var(--haze); margin: var(--space-6) auto; max-width: 32ch; text-align: center; }

/* Wide enough for both, the alerts screen is three panes like a mail client: the sidebar, the
 * list with its title and tabs over it, and the chosen alert filling the rest, full height. Each
 * pane scrolls on its own; the page itself does not. */
@media (min-width: 1200px) {
  body:has(.board) { overflow: hidden; }
  .shell:has(> .nav):has(.board) {
    display: grid;
    grid-template-columns: var(--list-pane) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100vh;
    padding: 0 0 0 var(--sidebar);
  }
  .shell:has(.board) > .page-head {
    grid-column: 1; grid-row: 1;
    margin: 0;
    min-height: 52px;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .shell:has(.board) > .tabs {
    grid-column: 1; grid-row: 2;
    margin: 0;
    padding: var(--space-2) 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .board { display: contents; }
  .board-list {
    grid-column: 1; grid-row: 3;
    overflow-y: auto;
    border-right: 1px solid var(--line);
  }
  .shell:has(.board) > .page-head .kicker { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .board-list > .kicker { padding: var(--space-3) var(--space-3) 0; margin: 0; }
  .board-list > .state-quiet, .board-list > .older { padding: 0 var(--space-3); }
  .board .rows { margin-top: 0; }
  /* In the list pane a row is the phone's row: the message owns the width, and the runway runs
   * under it with its sentence beside it. */
  .board-list .row > a {
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: start;
    gap: 6px var(--space-2);
    padding: 11px 14px 11px 12px;
    border-radius: 0;
  }
  .board-list .row:first-child { border-top: 0; }
  .board-list .row > a:hover { background: var(--raised); }
  .board-list .row > a[aria-current] { background: var(--raised); box-shadow: inset 3px 0 0 var(--paper); }
  .board-list .row .pri { font-size: 0.8125rem; padding-top: 1px; }
  .board-list .row-meta { font-family: var(--body); font-size: 0.75rem; }
  .board-list .row-state { grid-column: 2; flex-direction: row-reverse; align-items: center; gap: var(--space-2); }
  .board-list .row-state .runway { flex: 1 1 auto; height: 4px; }
  .board-list .row .status { text-align: left; flex: 0 1 auto; font-size: 0.6875rem; }
  .board-detail {
    display: block;
    grid-column: 2; grid-row: 1 / -1;
    overflow-y: auto;
    padding: var(--space-4) 28px;
  }
  .board-detail .alert-body { margin-top: var(--space-3); }
}

/* ── the runway in the rail ────────────────────────────────────────────────
 * The ladder as one sentence over a bar laid out in time: every rung sits at the moment it runs,
 * the spent part is filled, and a hairline marks now. Red while somebody is about to be woken,
 * green once somebody has it. The rung-by-rung ladder follows it for whoever needs the detail.
 */
.incident-rail .actions .btn:only-child { grid-column: 1 / -1; }
.runway-line { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.runway-headline { margin: 0; font-weight: 600; font-size: var(--step-0); }
.runway-track { position: relative; height: 18px; margin: 0 7px; }
.runway-track::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 7px; height: 4px;
  border-radius: 999px;
  background: var(--line);
}
.runway-spent { position: absolute; left: 0; top: 7px; height: 4px; border-radius: 999px; background: var(--p1); }
.runway-spent.state-acked { background: var(--ack); }
.runway-spent.state-quiet { background: var(--haze-dim); }
.runway-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--paper); }
.runway-stop {
  position: absolute; top: 3px;
  width: 12px; height: 12px; margin-left: -6px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--deck);
  border: 2px solid var(--line-2);
}
.runway-stop.stop-fired { background: var(--p1); border-color: var(--p1); }
.runway-stop.stop-next { border: 3px solid var(--paper); }
.runway-stop.stop-cancelled { opacity: 0.4; }
.runway-stops {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 2px var(--space-3);
  font-size: 0.8125rem; color: var(--haze);
}
.runway-stops strong { color: var(--paper); font-weight: 600; }
.runway-stops .stop-next { color: var(--paper); }
.runway-stops .stop-cancelled { text-decoration: line-through; opacity: 0.6; }

/* ── the rota grid ─────────────────────────────────────────────────────────
 * The next two weeks, a lane per person, shifts laid out in time. Ink for a shift, the marker for
 * cover somebody arranged (their arrangement, visibly taken), and hatched red where nobody holds
 * the pager - the one thing this grid exists to make impossible to miss. A phone keeps the list.
 */
.rota-grid { display: none; }
@media (min-width: 701px) {
  .rota-grid {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    row-gap: 6px;
    margin: var(--space-3) 0;
  }
  .rota-grid ~ .shift-strip { display: none; }
  .grid-days {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    font-family: var(--mono);
    font-size: 0.6875rem;
    color: var(--haze-dim);
  }
  .grid-days span { padding-left: 4px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
  .grid-days .grid-today { color: var(--paper); font-weight: 600; }
  .grid-lane { display: contents; }
  .grid-who { align-self: center; font-size: 0.8125rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .grid-track {
    position: relative;
    height: 26px;
    border-radius: 6px;
    background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 14 - 1px), var(--line) calc(100% / 14 - 1px) calc(100% / 14));
  }
  .grid-block {
    position: absolute; top: 3px; bottom: 3px;
    display: flex; align-items: center;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 4px;
    font-size: 0.6875rem; font-weight: 600;
    white-space: nowrap; overflow: hidden;
  }
  .grid-shift { background: var(--paper); color: var(--ground); }
  .grid-cover { background: var(--mark); color: var(--on-mark); border: 1px solid var(--paper); }
  .grid-gap { background: repeating-linear-gradient(135deg, var(--fail) 0 4px, transparent 4px 8px); }
}

/* ── thumbs ────────────────────────────────────────────────────────────────
 * Everything a finger has to hit, given the room to hit it. Measured at 390px
 * and 375px: .btn already carried a 44px floor and .btn-quiet explicitly set
 * min-height: 0 to stay dense on a desk, which made every quiet control on
 * every screen a 24-30px target — "Send a test alert", "Revoke", "Take off
 * the team", "Arrange cover". The filter tabs were 29px, disclosures 20px.
 *
 * Keyed on (pointer: coarse) rather than a width, because the condition is
 * the input device and not the screen: a tablet and a touch laptop have the
 * same thumb as a phone, and a narrow desktop window does not. Desktop
 * density is left exactly as it was.
 *
 * 44px is the Apple HIG floor and the one this product is judged against:
 * these controls are pressed one-handed, half-awake, by somebody a page just
 * woke up. */
@media (pointer: coarse) {
  .btn-quiet { min-height: 44px; }

  /* Filter tabs and the report periods. Padding rather than a min-height, so
   * the underline marking the current tab stays where it sits. It is padded
   * sideways too: "All" is three characters, which was a 16px-wide target. */
  .tabs a { padding: 12px var(--space-2) 14px; }
  .periods a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--space-2); }

  /* A bare link in a paragraph, which is how the incident list names an
   * incident and the on-call screen names a rota. */
  .person-who > a { display: inline-block; padding-block: 10px; }

  /* Disclosures — "Setup" in the nav, the payload fold, a team's controls. */
  summary { min-height: 44px; display: flex; align-items: center; }

  /* The way out, and the way home. Both sit in the nav on every screen. */
  .nav-out button { min-height: 44px; padding-inline: var(--space-3); }
  .wordmark { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ── the seat chip ─────────────────────────────────────────────────────────
 * Who is signed in, and the one sentence about the pager: on call until when (green), next on
 * when, or not on call. It links to On call, which answers the same question for everybody.
 */
.nav .nav-seat {
  display: flex; flex-direction: row; align-items: center; gap: 9px;
  min-height: 0;
  text-decoration: none;
  color: var(--paper);
  background: none;
  box-shadow: none;
}
/* ── the system panel ──────────────────────────────────────────────────────
 * /admin: inspector panels of readings, a label and its value on each line, red only where
 * something is wrong.
 */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.admin-grid .overview-panel {
  background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: var(--space-3);
}
.setting-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-2); }
.setting-row .row-main { flex: 1 1 320px; }
.setting-row input[type="text"] { flex: 0 1 280px; }
.readings { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.readings div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.readings dt { font-size: 0.8125rem; color: var(--haze); }
.readings dd { margin: 0; font-size: 0.8125rem; font-weight: 500; }

/* The maintenance banner set on /admin: the brand's yellow ground, the one place a message to
 * everybody is allowed to be loud. */
.system-banner {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  background: var(--mark);
  color: var(--on-mark);
  font-weight: 600;
  font-size: 0.8125rem;
}

/* ── the status page ───────────────────────────────────────────────────────
 * Public, for somebody who cannot sign in because something is down: one sentence for the
 * whole system, then a line per component with a dot in the colour of its state.
 */
.status-page { max-width: 560px; }
.status-overall {
  margin: var(--space-3) 0 var(--space-4);
  padding: var(--space-3);
  border-radius: 10px;
  font-weight: 600;
}
.status-overall.status-operational { background: color-mix(in srgb, var(--ack) 14%, transparent); color: var(--ack); }
.status-overall.status-degraded { background: color-mix(in srgb, var(--p2) 14%, transparent); color: var(--p2); }
.status-overall.status-down { background: color-mix(in srgb, var(--p1) 14%, transparent); color: var(--p1); }
.status-components { list-style: none; margin: 0 0 var(--space-4); padding: 0; border-top: 1px solid var(--line); }
.status-components li {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-1);
  border-bottom: 1px solid var(--line);
}
.status-name { font-weight: 500; }
.status-state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-state.status-operational { color: var(--ack); }
.status-state.status-degraded { color: var(--p2); }
.status-state.status-down { color: var(--p1); }

/* ── appearance ────────────────────────────────────────────────────────────
 * Auto, Day and Night as one segmented control, the way a Mac settings pane offers it. The
 * pressed segment is a raised chip; the others are quiet text.
 */
.theme-switch {
  display: flex; gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: var(--line);
}
.theme-switch button {
  flex: 1 1 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 24px; padding: 0 6px;
  border: 0; border-radius: 5px;
  background: transparent;
  color: var(--haze);
  font: 500 0.6875rem var(--body);
  cursor: pointer;
}
.theme-switch button .nav-icon { width: 12px; height: 12px; }
.theme-switch button:hover { color: var(--paper); }
.theme-switch button[aria-pressed="true"] {
  background: var(--deck);
  color: var(--paper);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}
.nav > .theme-switch { margin: 0 var(--space-2); }
.nav-more-list .theme-switch { margin-top: var(--space-2); }
.nav-more-list .theme-switch button { min-height: 36px; font-size: 0.8125rem; }
@media (max-width: 700px) {
  .nav > .theme-switch { display: none; }
}

/* ── the nav's counts ──────────────────────────────────────────────────────
 * How many are live beside Alerts and Incidents, the way a mail app counts unread: grey, and red
 * while some of it is still waking somebody. Empty when there is nothing. On a phone the count is
 * a badge on the tab's icon.
 */
.nav-count { margin-left: auto; font-size: 0.6875rem; color: var(--haze-dim); font-variant-numeric: tabular-nums; }
.nav-count-hot { color: var(--p1); font-weight: 600; }
@media (max-width: 700px) {
  .nav-bar a { position: relative; }
  .nav-bar .nav-count { position: absolute; top: 6px; left: calc(50% + 5px); margin: 0; }
  .nav-bar .nav-count:not(:empty) {
    min-width: 16px; height: 16px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--haze-dim); color: var(--deck);
    font-size: 0.625rem; font-weight: 700;
  }
  .nav-bar .nav-count-hot:not(:empty) { background: var(--p1); color: #ffffff; }
}

.seat-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; }
.seat-avatar {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em;
}
.seat-name { font-weight: 600; font-size: 0.8125rem; }
.seat-state { font-size: 0.75rem; color: var(--haze); }
.seat-state.state-acked { color: var(--ack); }
/* On a phone the top row is the wordmark, the chip and the way out, on one line: the chip
 * gives way (its sentence truncates) rather than pushing Sign out onto a line of its own. */
@media (max-width: 700px) {
  .nav { flex-wrap: nowrap; }
  .nav .nav-seat { margin-left: auto; min-width: 0; flex: 0 1 auto; text-align: right; }
  .seat-who { align-items: flex-end; }
  .seat-avatar { display: none; }
  .seat-name, .seat-state { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-out { margin-left: var(--space-2); flex-shrink: 0; }
}

/* ── settings ──────────────────────────────────────────────────────────────
 * /me and /org: sections of one heading, one sentence of help, then the thing itself. A key is a
 * row with its facts on the left and its one action on the right.
 */
.settings-section { margin-top: var(--space-5); max-width: 760px; }
.settings-section > h2 { margin-bottom: var(--space-1); }
.key-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
}
.key-row form { flex-shrink: 0; }
.key-form { margin-top: var(--space-4); }
/* One field and its button on one line: a name, a search, anything a sentence of help explains. */
.inline-form { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.inline-form input { flex: 0 1 320px; min-width: 0; }
.key-form select { width: 100%; }

/* A settings form, the way a Mac settings pane lays one out: the label right-aligned in a
 * column, the field beside it sized to what it holds, the hint after it. A phone stacks them. */
.settings-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.settings-form fieldset:disabled input { background: var(--raised); color: var(--haze); }
.settings-row {
  display: grid; grid-template-columns: 180px minmax(0, 240px) minmax(0, 1fr);
  align-items: center; gap: var(--space-2) var(--space-3);
  margin: var(--space-2) 0;
}
.settings-row > label { text-align: right; font-weight: 500; color: var(--paper); }
.settings-row > .hint { margin: 0; }
.settings-save { margin: var(--space-4) 0 0 calc(180px + var(--space-3)); }
@media (max-width: 700px) {
  .settings-row { grid-template-columns: 1fr; gap: var(--space-1); }
  .settings-row > label { text-align: left; }
  .settings-save { margin-left: 0; }
}

/* An endpoint's url, on a line of its own under the endpoint, with its one action beside it. */
.integration-url { flex-basis: 100%; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.integration-url .secret { flex: 1 1 320px; margin-top: 0; font-size: var(--step--1); padding: var(--space-2); }

/* ── Mac-sized controls ────────────────────────────────────────────────────
 * The forms were built phone-first: every input grew to fill its row at a 44px thumb height,
 * and every button was a slab. On a desk with a mouse that is a 1200px field under a 600px
 * sentence. Here, with a fine pointer and a desk's width, controls are the size a Mac app's are:
 * 30px tall, inputs sized to what they hold, buttons sized to their label. A phone, a tablet
 * and a touch laptop keep the thumb sizes above. Last in the file so it wins on source order.
 */
@media (min-width: 701px) and (pointer: fine) {
  .shell :is(input:not([type="checkbox"]):not([type="radio"]):not([type="search"]), select) {
    min-height: 0; height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
  }
  .shell textarea { border-radius: 6px; font-size: 0.8125rem; }
  /* Sized to what they hold rather than to the row: a name is a few words. */
  .shell :is(.add-integration, .add-service, .routing, .address-add, .restriction-row) input {
    flex: 0 1 320px;
  }
  .shell :is(.add-integration, .add-service, .routing, .address-add, .restriction-row, .person-admin) select {
    flex: 0 0 auto; width: auto;
  }
  .shell :is(.invite, .rotation-form, .rung-form, .key-form) { max-width: 520px; }
  .shell .integration-url { flex-wrap: nowrap; }
  .shell .integration-url .secret { flex: 1 1 auto; max-width: 640px; min-width: 0; }
  .shell .btn {
    min-height: 30px;
    padding: 0 14px;
    border-radius: 6px;
    font-family: var(--body);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
  }
  .shell .search-form input[type="search"] { min-height: 0; height: 30px; padding: 0 10px; border-radius: 6px; font-size: 0.8125rem; flex: 0 1 320px; }
  .shell .btn-quiet { min-height: 26px; padding: 0 10px; font-size: 0.75rem; font-weight: 500; }
  /* The triage row is a toolbar on a desk, as in the chosen alert's pane: acknowledge first. */
  .shell .actions .btn { flex: 0 0 auto; min-height: 30px; font-size: 0.8125rem; }
  .shell .actions { gap: 6px; }
  .shell .incident-rail .actions { display: flex; flex-wrap: wrap; }
}
