:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1b1b1a;
  --muted: #6d6b66;
  --line: #e4e1da;
  --accent: #e8590c;
  --accent-soft: #fff1e6;
  --mark: #ffe58a;
  --live: #1aa35b;
  --paused: #e67700; /* a short gap in captions, usually an ad break */
  --open: #e0b400; /* a user with the site open in a background tab (admin presence) */
  --stale: #b8b5ad;
  --size: 20px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1b1b1a;
    --text: #ecebe7;
    --muted: #96938b;
    --line: #2c2b29;
    --accent: #ff8a3d;
    --accent-soft: #2d1f15;
    --mark: #6b5310;
    --live: #3ccf7f;
    --paused: #ffa94d;
    --open: #ffd43b;
    --stale: #55534e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* beats display rules like .list { display: flex } */
html { scroll-behavior: auto; scrollbar-gutter: stable; } /* the scrollbar's room is kept on short pages too, so the page doesn't jump sideways when it grows past the window */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 56px;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
/* A banner across the top of the header for a big live event (index.html, src/transcripts.ts). */
.event-banner { position: relative; display: flex; align-items: center; justify-content: center; padding: 0 36px; color: #fff; background: linear-gradient(90deg, #1d3f8f, #b3192e); }
.event-banner[hidden], .banner-off-midterms-2026 [data-banner="midterms-2026"] { display: none; } /* one per banner in src/banner.ts */
.event-banner-link { padding: 6px 0; text-align: center; font-size: 14px; line-height: 1.35; color: inherit; text-decoration: none; }
.event-banner-link:hover, .event-banner-link:focus-visible { text-decoration: underline; }
.event-banner-x { position: absolute; right: 6px; top: 50%; translate: 0 -50%; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; line-height: 1; opacity: 0.85; }
.event-banner-x:hover, .event-banner-x:focus-visible { opacity: 1; background: rgb(255 255 255 / 0.18); }
/* One page width for the header, the channel row, the page and the footer, so they all line up.
   Wide pages (Planes) raise --page on body; Watch takes the whole window, edge to edge. The gutter grows with the window. */
body { --page: 1280px; --gutter: clamp(16px, 3vw, 40px); }
.is-planes { --page: 1600px; }
.is-watch { --page: none; --gutter: 10px; }
/* The header keeps the standard width on every page, so the logo, Channels, search and account
   menu sit in the same place whichever page is open. */
.top { --page: 1280px; --gutter: clamp(16px, 3vw, 40px); }
.top-row {
  max-width: var(--page);
  margin: 0 auto;
  padding: 12px var(--gutter) 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo img { flex: none; border-radius: 6px; }
.logo b { color: var(--accent); font-weight: inherit; }
.search { flex: 1; min-width: 0; }
.pill.search-toggle { display: none; } /* phones only */
.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
}
.search input:focus { border-color: var(--accent); }

.channels {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) 10px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.channels::-webkit-scrollbar { display: none; }
/* One row at every width: swipe it, use the arrows (mouse), or open the Channels menu.
   Touch screens get a fade at whichever end has more to swipe to. */
@media not ((hover: hover) and (pointer: fine)) {
  .channels-wrap.more-right .channels { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
  .channels-wrap.more-left .channels { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px); mask-image: linear-gradient(to right, transparent, #000 48px); }
  .channels-wrap.more-left.more-right .channels { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
}
/* Arrows for scrolling the channel row with a mouse (touch screens swipe instead). */
.channels-wrap { position: relative; }
/* Wider screens pick channels from the Channels menu; the row is for phones. */
@media (min-width: 561px) { .channels-wrap { display: none; } }
.chan-scroll { display: none; }
@media (hover: hover) and (pointer: fine) {
  .chan-scroll:not([hidden]) {
    position: absolute;
    top: 0;
    bottom: 10px;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 64px;
    padding: 0 12px;
    border: 0;
    cursor: pointer;
    color: var(--text);
  }
  .chan-scroll.prev { left: max(0px, calc(50% - var(--page) / 2)); justify-content: flex-start; background: linear-gradient(to right, var(--bg) 45%, transparent); }
  .chan-scroll.next { right: max(0px, calc(50% - var(--page) / 2)); justify-content: flex-end; background: linear-gradient(to left, var(--bg) 45%, transparent); }
  .chan-scroll span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 20px;
    line-height: 1;
  }
  .chan-scroll:hover span { border-color: var(--text); }
}
.chan {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.chan-label {
  flex: none;
  align-self: center;
  padding: 0 2px 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chan + .chan-label { margin-left: 10px; }
.chan[aria-current="page"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}
.chan .pip, .chan-item .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--stale); }
.chan.live .pip, .chan-item.live .pip { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.chan.paused .pip, .chan-item.paused .pip { background: var(--paused); box-shadow: 0 0 0 3px color-mix(in srgb, var(--paused) 25%, transparent); }

/* The Channels menu: every channel in a list, with what it's doing. */
.chan-menu { flex: none; }
/* It stands out from the other pills, in the accent colour with a live dot,
   since visitors were typing channel names into the search box instead. */
.chan-menu summary.pill { padding: 6px 13px; font-size: 14px; border-color: var(--accent); background: var(--accent-soft); }
.chan-menu summary .pip { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
/* With a channel being watched, the dot is that channel's, as in the row and the list. */
.chan-menu summary.paused .pip { background: var(--paused); box-shadow: 0 0 0 3px color-mix(in srgb, var(--paused) 25%, transparent); }
.chan-menu summary.stale .pip { background: var(--stale); box-shadow: none; }
.chan-menu summary .caret { font-size: 10px; color: var(--accent); }
.chan-menu-label { display: inline-block; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.chan-menu[open] summary.pill { border-color: var(--text); }
.menu-panel.chan-panel { left: 0; right: auto; }
.chan-panel { min-width: 280px; max-height: min(70vh, 560px); overflow-y: auto; }
.menu-panel a.chan-item {
  display: grid;
  grid-template-columns: 8px 1fr;
  align-items: center;
  gap: 0 10px;
  padding: 7px 10px;
}
.chan-heading {
  margin: 10px 10px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chan-item .chan-name { font-weight: 600; }
.chan-item small { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.3; }
.menu-panel a.chan-item[aria-current] { background: var(--bg); }
.chan-filter {
  position: sticky; top: -6px; z-index: 1; flex: none; /* stays put while the list scrolls under it */
  width: calc(100% + 12px); margin: -6px -6px 4px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 12px 12px 0 0; background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; outline: none; /* 16px: no zoom-on-focus in iOS Safari */
}
.chan-filter::placeholder { color: var(--muted); }
.chan-filter:focus { border-bottom-color: var(--accent); }
.chan-list { display: flex; flex-direction: column; }
.chan-group { display: flex; flex-direction: column; }
.chan-group:first-child .chan-heading { margin-top: 4px; }
.menu-panel a.chan-item.hl { background: var(--accent-soft); }
.chan-none { margin: 0; padding: 10px; color: var(--muted); font-size: 14px; }

/* The word cloud menu: the most-said words of the past 24 hours. */
.words-page { max-width: 820px; padding: 16px 18px 20px; }
.words-head { margin: 0 0 8px; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.words-head span { color: var(--muted); }
.words { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 10px; line-height: 1.15; }
.words a {
  padding: 1px 2px; text-decoration: none; border-radius: 4px; font-weight: 650; letter-spacing: -0.01em; color: var(--text);
}
.words a.hot { color: var(--accent); }
.words a.faint { color: var(--muted); font-weight: 550; }
.words a:hover { background: var(--accent-soft); color: var(--accent); }
.words-note { margin: 4px 0; color: var(--muted); font-size: 14px; }
.words-note a { color: var(--accent); font-weight: 600; padding: 0; }

/* Phones: on caption pages the header slides away while reading down, and back on scrolling up. */
.top, .sections, .tx-bar, .day-break { transition: transform 0.2s ease, top 0.2s ease; }
@media (max-width: 560px) {
  body.chrome-hidden .top { transform: translateY(-100%); }
  /* The programme strip and the transcript bar go with it, so the words have the screen; only the day's name stays. */
  body.chrome-hidden .sections { top: 0; transform: translateY(-100%); }
  body.chrome-hidden .tx-bar:not(.editing) { top: 0; transform: translateY(calc(-100% - 16px)); } /* not while editing: it floats at the bottom */
  body.chrome-hidden .day-break { top: 0; }
}

/* Programme header */
main { max-width: var(--page); margin: 0 auto; padding: 20px var(--gutter) 0; }
.program { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.program-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.program h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin: 4px 0 6px; }
.program p { margin: 0; color: var(--muted); max-width: 70ch; }
.program .program-tip {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  width: fit-content;
}
.program .program-tip[hidden] { display: none; }
/* Planes or boats paused (src/tracking-pause.ts), on the Alerts page's Plane alerts. */
.paused-note { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; }
.program-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.program-links:empty { display: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}
.pill:hover { border-color: var(--accent); }
.pill[aria-current] { border-color: var(--text); background: var(--text); color: var(--bg); }
.day-picker { display: inline-flex; align-items: center; gap: 4px; }
.pill.date { font: inherit; font-size: 13px; font-weight: 600; color: inherit; cursor: pointer; position: relative; }
.pill.date[aria-current] { color: var(--bg); }
.pill.date .cal { font-size: 12px; line-height: 1; }
/* The guide's own calendar, for a channel that's on only some days (Parliament): the days it wasn't are greyed out (public/app.js dayCalendar). */
.day-picker { position: relative; }
.day-cal {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 252px; padding: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}
.day-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 14px; }
.day-cal button { border: 0; background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer; border-radius: 999px; }
.day-cal-head button { width: 28px; height: 28px; font-size: 18px; line-height: 1; }
.day-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.day-cal-dow { font-size: 11px; color: var(--muted); padding: 2px 0; }
.day-cal-grid button { aspect-ratio: 1; font-weight: 600; }
.day-cal button:hover:not(:disabled) { background: var(--line); }
.day-cal button:disabled { color: var(--muted); opacity: 0.4; font-weight: 400; cursor: default; }
.day-cal-grid button[aria-current] { background: var(--text); color: var(--bg); }
/* The native input stays in the pill (so the calendar opens beside it) but out of sight. */
.pill.date input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.pill.step { padding: 5px 9px; }
.program-links .break { flex-basis: 100%; height: 0; }
button.pill { font-family: inherit; color: inherit; cursor: pointer; }
.mode { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; font-size: 11px; }
.mode.live { color: var(--live); }

/* Transcript */
.transcript { font-size: var(--size); line-height: 1.6; }
/* Last visit's lines while the live connection opens (app.js liveSnapshot): greyed, and not for quoting or playing. */
.transcript.snapshot { opacity: 0.5; pointer-events: none; user-select: none; transition: opacity 0.2s; }
.block { display: grid; grid-template-columns: 64px 1fr; gap: 0 14px; margin: 0 0 0.9em; }
/* The left column: the time (when it's moved on) and, where audio is kept, a ▶ for the paragraph. */
.block .gutter {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 1.6em; /* centred on the paragraph's first line */
  user-select: none;
  -webkit-user-select: none;
}
.block .t {
  font: 12px/1 var(--mono);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.block .t:hover { color: var(--accent); }
.block .t:empty::before { content: ""; }
.block p { margin: 0; overflow-wrap: anywhere; }
.block .t { user-select: none; -webkit-user-select: none; } /* copying across lines takes only the words */
/* Speaker change: a small dot in the caption colour, beside the time. */
.spk { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: var(--stale); opacity: 0.85; }
.spk[data-color="white"] { background: #9a978f; }
.spk[data-color="yellow"] { background: #e0a800; }
.spk[data-color="cyan"] { background: #0c9fb8; }
.spk[data-color="green"] { background: #2f9e44; }
.spk[data-color="magenta"] { background: #c2255c; }
.spk[data-color="red"] { background: #e03131; }
.spk[data-color="blue"] { background: #1c7ed6; }
/* An inferred speaker's name at the start of their turn: small, muted, not copied. */
.block .who { margin-right: 0.5em; font: 600 0.62em/1 var(--sans); letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); user-select: none; -webkit-user-select: none; }
/* Aired without captions: transcribed automatically (app.js, mac-capture/src/gap-fill-logic.ts). */
.block.auto p { font-style: italic; }
.block .auto-tag, .row .auto-tag { margin-right: 0.6em; padding: 0.15em 0.4em; border: 1px solid currentColor; border-radius: 3px; font: 600 0.58em/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); vertical-align: 0.15em; user-select: none; -webkit-user-select: none; cursor: help; position: relative; }
/* Its explanation, on hover or focus (a tap), in place of a native title tooltip (app.js autoTag). */
.auto-tag[data-tip]:hover::after, .auto-tag[data-tip]:focus-visible::after, .auto-tag[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 30;
  width: max-content; max-width: min(20rem, calc(100vw - 32px)); padding: 8px 10px; border-radius: 8px;
  background: var(--text); color: var(--bg); font: 400 13px/1.4 var(--sans); letter-spacing: normal; text-transform: none; white-space: normal;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18); pointer-events: none;
}
.auto-tag:focus { outline: none; }
.auto-tag:focus-visible, .tr-auto:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cap { transition: background-color 2s ease; border-radius: 3px; }
.cap.new { animation: arrive 1.2s ease-out; }
@keyframes arrive {
  from { background: var(--accent-soft); color: var(--accent); }
  to { background: transparent; }
}
.cap.hit { background: var(--mark); }
/* A shared quote's own words, where it starts or stops part-way through a line. */
.cap mark.quoted { background: var(--mark); color: inherit; border-radius: 3px; }
.gap { color: var(--muted); }
/* A hole in the recording (Transcript.drawLost): words are missing here, not just a pause. */
.lost { font: 0.72em var(--sans); color: var(--muted); background: var(--line); border-radius: 4px; padding: 0.1em 0.45em; white-space: nowrap; cursor: help; vertical-align: 0.1em; }

.frame { grid-column: 2; margin: 0.3em 0 0.6em; user-select: none; -webkit-user-select: none; } /* stills stay out of copied text */
.frame-note { margin: 0.4em 0 0; max-width: 320px; font-size: 0.8em; color: var(--muted); }
.frame img {
  display: block;
  width: min(320px, 100%);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--line);
}

/* Programme headings inside a transcript, and the strip that jumps between them. */
.prog-break {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  margin: 2em 0 0.9em;
  padding-top: 14px;
  border-top: 2px solid var(--text);
  font-family: var(--sans);
  line-height: 1.3;
  scroll-margin-top: calc(var(--top-h, 64px) + 60px);
  user-select: none;
  -webkit-user-select: none;
}
.transcript > .prog-break:first-child { margin-top: 0; }
.one-section > .prog-break { display: none; } /* one programme: the page header already names it */
.prog-break h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.prog-break .when { color: var(--muted); font: 12px/1.3 var(--mono); }
.prog-break a { margin-left: auto; color: var(--muted); font-size: 13px; }
.prog-break a:hover { color: var(--accent); }

/* The day's name wherever the lines move on to another day. It sticks under
   the top bar, so a backlog that spans days always says which day you're in. */
.day-break {
  position: sticky;
  top: calc(var(--top-h, 64px) + var(--strip-h, 0px) + 8px + var(--tx-h, 0px));
  z-index: 4;
  margin: 1.6em 0 0.9em;
  padding: 2px 0 6px;
  background: var(--bg);
  box-shadow: 0 -8px 0 var(--bg); /* the lines scroll away under it, not through the gap above */
  font: 600 13px/1.3 var(--sans);
  user-select: none;
  -webkit-user-select: none;
}
.day-break span {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 9%, var(--bg));
  color: var(--text);
}
.transcript > .day-break:first-child { margin-top: 0; }
.day-break + .prog-break { margin-top: 0.6em; }

.sections {
  position: sticky;
  top: var(--top-h, 64px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -12px -16px 16px;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sections .chips { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.sections .chips::-webkit-scrollbar { display: none; }
.sections .actions { flex: none; display: flex; gap: 6px; }
.sections .actions:empty { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 260px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chip span { overflow: hidden; text-overflow: ellipsis; }
a.chip { text-decoration: none; color: var(--muted); }
.chip.up { padding: 5px 10px; }
.chip b { font: 500 11px/1 var(--mono); color: var(--muted); }
.chip:hover { border-color: var(--accent); }
.chip[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip[aria-current] b { color: inherit; opacity: 0.7; }
.chip.loading { opacity: 0.55; cursor: progress; }
/* Strip arrows: desktop only; touch screens swipe the strip. */
.chip.arrow { padding: 5px 10px; cursor: pointer; }
.chip.arrow:disabled { opacity: 0.35; cursor: default; border-color: var(--line); }
@media not ((hover: hover) and (pointer: fine)) {
  .chip.arrow { display: none; }
}
/* Wide screens: the programmes become a sidebar down the left of the page, and the rest moves over for it. */
@media (min-width: 1100px) {
  main:has(> .sections:not([hidden])) > :is(.program, .tx-bar, .transcript, .list, .load-more) { margin-left: 248px; }
  /* Editing, the bar floats at the bottom (.tx-bar.editing): centred over the transcript's column, not pushed off it by the margin. */
  main:has(> .sections:not([hidden])) > .tx-bar.editing { margin-left: 0; left: calc(50% + 124px); width: min(720px, calc(100vw - 248px - 64px)); }
  .sections {
    position: fixed;
    top: calc(var(--top-h, 64px) + 20px);
    left: calc(max(0px, 50% - var(--page) / 2) + var(--gutter));
    width: 224px;
    max-height: calc(100vh - var(--top-h, 64px) - var(--status-h, 50px) - 36px);
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
  }
  .sections .chips { flex-direction: column; overflow: hidden auto; padding: 2px; }
  .sections .chip { max-width: none; }
  .sections .chip.up { align-self: flex-start; }
  .sections .chip.arrow { justify-content: center; margin: 0 2px; padding: 2px 10px; font-size: 11px; }
  .sections .actions { padding: 2px; }
  .sections + .transcript .prog-break, .prog-break { scroll-margin-top: calc(var(--top-h, 64px) + 20px); }
}

.empty { color: var(--muted); text-align: center; padding: 48px 0; font-size: 16px; }
.empty.lead { text-align: left; padding: 0 0 12px; margin: 0; } /* a line introducing the list under it, not a whole empty page */
/* An archive range's "Load earlier words" / "Load later words", above and below its lines. */
.load-more {
  display: block;
  margin: 8px 0 16px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.transcript + .load-more { margin: 16px 0 8px; }
.load-more:hover { border-color: var(--accent); color: inherit; }
.load-more:disabled { cursor: progress; opacity: 0.7; }
.load-more[hidden] { display: none; }
.search-progress { display: block; width: min(320px, 80%); height: 4px; margin: 14px auto 0; border-radius: 2px; background: var(--line); overflow: hidden; }
.search-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.1s linear; }
.more { display: block; margin: 0 auto 20px; }

/* Lists: search results, EPG */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
}
.row:hover { border-color: var(--accent); }
.search-tip { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.sounds-like { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.row .when { color: var(--muted); font: 12px/1.5 var(--mono); }
.row .when b { display: block; font: 600 13px/1.4 var(--sans); color: var(--text); }
.row h3 { margin: 0 0 2px; font-size: 16px; }
.row p { margin: 0; color: var(--muted); font-size: 14px; }
.row mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.row.now { border-color: var(--live); }
.row.now .when { color: var(--live); font-weight: 700; }
.row.future { opacity: 0.7; }
/* Guide blurbs stop at two lines, so a day scans quickly. */
.row.guide p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Landing page */
.is-search .top .search { visibility: hidden; }
.program-links .results-search { flex-basis: 100%; margin: 4px 0 8px; max-width: 720px; }
/* The search box the results page reuses (.results-search). The hero restyles its own below. */
.hero-search { display: flex; gap: 8px; }
.hero-search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 17px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.hero-search input:focus { border-color: var(--accent); }
.hero-search button {
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 700;
  background: var(--text);
  color: var(--bg);
}
/* Stand-ins that hold the space of what scripts fill in, so nothing below moves when they do. */
.chan-placeholder { visibility: hidden; }

/* The home page runs edge to edge (its hero's video does); each part keeps the page width itself. No status bar, but for the player (below, with .no-status). */
.is-home { padding-bottom: 0; }
.is-home main { max-width: none; padding: 0; }
.home-wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* The hero: the Watch page's wall of live channels playing behind the words, under a
   dark wash (heavier on the left, where the words are) that fades into the page below. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  /* Just the words and a little room for the fade at the bottom; the cloud sets the height where it shows. */
  padding: clamp(36px, 5vw, 64px) 0 clamp(64px, 8vw, 104px);
  color: #fff;
  background: #0d0d10;
}
.hero-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #0d0d10; }
/* The caption wall (public/hero-wall.js): one tile per channel, its lines rolling up. */
.hero-wall { position: absolute; inset: -8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-rows: 220px; gap: 10px; padding: 10px; }
.wall-tile { overflow: hidden; display: flex; flex-direction: column; padding: 12px 14px; border-radius: 10px; background: #17171c; border: 1px solid #24242b; }
.wall-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); white-space: nowrap; }
.wall-head .pip { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--live); opacity: 0.8; }
.wall-kind { margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, 0.3); }
.wall-lines { position: relative; flex: 1; min-height: 0; margin-top: 8px; overflow: hidden; font: 600 14px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: rgba(255, 255, 255, 0.62); } /* newest at the bottom; the oldest go off the top */
.wall-stack { position: absolute; left: 0; right: 0; bottom: 0; }
.wall-lines p { margin: 0; overflow-wrap: anywhere; } /* no slide-in: lines step up as new ones arrive */
.wall-lines p.old { color: rgba(255, 255, 255, 0.32); }
/* Phones: the words fill the hero, so the wall comes out from behind them as a strip of
   tiles along its top, drifting sideways through the channels (one round of twelve,
   then it loops), with the headline under it. */
@media (max-width: 700px) {
  .hero { padding-top: 0; }
  .hero-media { position: relative; inset: auto; z-index: 0; order: -1; flex: 0 0 100%; height: 200px; margin-bottom: 26px; }
  .hero-wall { inset: 0; padding: 12px 0 12px 12px; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 230px; grid-template-rows: 176px; width: max-content; animation: wall-drift calc(var(--loop, 7) * 7s) linear infinite; }
  /* Nothing sits on the strip, so it can be bright. */
  .wall-head { color: rgba(255, 255, 255, 0.55); }
  .wall-head .pip { opacity: 1; }
  .wall-lines { color: rgba(255, 255, 255, 0.85); }
  .wall-lines p.old { color: rgba(255, 255, 255, 0.4); }
}
@keyframes wall-drift { to { transform: translateX(calc(-1 * var(--loop, 7) * (230px + 10px))); } }
@media (max-width: 700px) and (prefers-reduced-motion: reduce) { .hero-wall { animation: none; } }
.hero-media::before, .hero-media::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* above the wall */
.hero-media::before {
  background: linear-gradient(100deg, rgba(10, 10, 14, 0.9) 0%, rgba(10, 10, 14, 0.8) 45%, rgba(10, 10, 14, 0.5) 100%);
}
.hero-media::after {
  background: linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 50%, transparent) 7%, transparent 20%);
}
/* Phones: the strip of tiles only fades at its sides and into the hero below it. */
@media (max-width: 700px) {
  .hero-media::before { background: linear-gradient(90deg, rgba(13, 13, 16, 0.55), transparent 14%, transparent 86%, rgba(13, 13, 16, 0.55)); }
  .hero-media::after { background: linear-gradient(to top, #0d0d10 0%, transparent 8%); }
}
.hero-inner { width: 100%; }
.hero-inner > * { max-width: 760px; }
.hero-inner > :last-child { margin-bottom: 0; } /* no gap under the lede when it ends the hero (signed in) */
.hero h1 { font-size: clamp(38px, 5.6vw, 68px); line-height: 1; letter-spacing: -0.04em; font-weight: 800; margin: 0 0 20px; text-wrap: balance; }
.hero-lede { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: rgba(255, 255, 255, 0.84); margin: 0 0 28px; max-width: 58ch; }
/* The word cloud on the right of the hero, level with the words: the most-said words of the past 24 hours, all in
   white, sized by how often they were said. It goes on narrower windows, where the words would run into it. */
/* The right-hand column: the word cloud. */
.hero-side {
  position: absolute;
  right: clamp(16px, 4vw, 64px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(300px, 30vw, 460px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero-cloud {
  margin: 0;
  /* A frosted dark panel: the wash is lightest on the right, and the heading and note were lost in the pictures. */
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: rgba(10, 10, 14, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.hero-cloud-head { margin: 0 0 6px; text-align: center; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.hero-cloud-note { margin: 0 0 14px; text-align: center; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, 0.88); }
.hero-cloud-note a { color: #fff; font-weight: 600; }
/* The words are bubbles: each pops in a beat after the one before, bobs gently at its own pace and swells under the pointer.
   The bob moves `translate` and the swell `scale`, so neither undoes the other. */
.hero-cloud .words { gap: 6px; line-height: 1.1; }
.hero-cloud .words a, .hero-cloud .words a.hot, .hero-cloud .words a.faint {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55); /* the wash is lighter on the right */
  transition: scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
  animation:
    hero-bubble-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i, 0) * 45ms) backwards,
    hero-bubble-bob var(--bob, 4s) var(--bob-at, 0s) ease-in-out infinite alternate;
}
.hero-cloud .words a:hover { scale: 1.18; background: rgba(255, 255, 255, 0.28); color: #fff; z-index: 1; position: relative; }
@keyframes hero-bubble-pop { from { scale: 0; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes hero-bubble-bob { from { translate: 0 -3px; } to { translate: 0 3px; } }
@media (prefers-reduced-motion: reduce) {
  .hero-cloud .words a { animation: none; transition: background 0.2s; }
  .hero-cloud .words a:hover { scale: none; }
}
/* Wide enough for the cloud: two columns, the words and the cloud, so the words never run under it, and the hero grows
   to hold the whole cloud rather than cutting it off top and bottom. The words' left edge stays on the page's gutter. */
@media (min-width: 1101px) {
  .hero {
    min-height: 640px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 30vw, 460px);
    column-gap: clamp(28px, 3vw, 56px);
    align-items: center;
    padding-left: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
    padding-right: clamp(16px, 4vw, 64px);
  }
  .hero-inner { max-width: none; margin: 0; padding: 0; }
  .hero-side { position: static; transform: none; width: auto; }
}
/* The words shrink a little as the panel narrows (full size at its widest, 85% at its narrowest), so it doesn't grow
   much taller. --s is the word's size from 0 (least said) to 1 (most said), set in public/app.js. */
.hero-cloud .words { container-type: inline-size; }
.hero-cloud .words a { font-size: calc((13 + var(--s, 0) * 21) * clamp(0.85px, 100cqi / 420, 1px)); }
/* Narrower: no cloud, and the card drops under the search, in the words' column. */
@media (max-width: 1100px) {
  .hero-cloud { display: none; }
  .hero { flex-wrap: wrap; }
  .hero-side { position: static; transform: none; width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
}
.hero-alerts a { color: #fff; font-weight: 600; text-decoration-color: rgba(255, 255, 255, 0.45); text-underline-offset: 3px; }
.hero-alerts { margin: 22px 0 0; font-size: 15px; color: rgba(255, 255, 255, 0.8); max-width: 60ch; }

/* The sections below the hero */
.home-h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 8px; }
.section-lede { margin: 0 0 22px; color: var(--muted); font-size: 16px; max-width: 60ch; }
.worlds { margin-top: 4px; }
.can, .home-chans, .faq { margin-top: clamp(44px, 6vw, 72px); }

/* Questions: the answers people search for, in plain text */
.faq-list { margin: 0; max-width: 720px; }
.faq-list dt { font-weight: 700; font-size: 17px; margin: 18px 0 4px; }
.faq-list dt:first-child { margin-top: 0; }
.faq-list dd { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.faq-list dd a { color: var(--accent); font-weight: 600; }

/* What we bring online: a pictogram for each medium; the ones not yet open are dashed and "Coming soon". */
.world-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) {
  .world-grid { grid-template-columns: repeat(2, 1fr); }
  .world:last-child:nth-child(odd) { grid-column: span 2; } /* no card alone in the last row */
}
.world { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .15s; }
.world-link { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 20px 18px 18px; border-radius: inherit; color: inherit; text-decoration: none; }
.world:has(.world-link:hover) { border-color: var(--accent); box-shadow: 0 6px 18px rgb(0 0 0 / .08); transform: translateY(-2px); }
.world-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.world svg { width: 52px; height: 52px; color: var(--accent); margin-bottom: 4px; }
.world h3 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.world p { margin: 0; flex: 1; color: var(--muted); font-size: 14px; line-height: 1.45; }
.world-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 6px; }
.world-go { color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.world-link:hover .world-go { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .world { transition: none; } .world:has(.world-link:hover) { transform: none; } }
.world-count { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.world.live .world-count::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.world.soon { border-style: dashed; background: transparent; }
.world.soon svg, .world.soon h3 { color: var(--muted); }
.soon-tag { align-self: flex-start; margin-top: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); }

/* What you can do: each with a figure drawn from shapes, a few of them moving. */
.can-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 12px; } /* eight cards: four across at the page width */
.can-item { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.can-fig {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 2.6;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 35%, var(--surface)));
}
.can-fig svg { width: 70%; height: auto; overflow: visible; }
.can-item h3 { margin: 16px 18px 4px; font-size: 17px; letter-spacing: -0.015em; }
.can-item p { margin: 0 18px 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.about-more { margin: 14px 0 0; font-size: 14px; }
.about-more a { color: var(--accent); font-weight: 600; }
/* The figures' parts */
.f-card { fill: var(--surface); stroke: var(--line); }
.f-ink { fill: color-mix(in srgb, var(--text) 22%, transparent); }
.f-acc { fill: var(--accent); }
.f-mark { fill: var(--mark); }
.f-live { fill: var(--live); }
.f-lens { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: var(--accent); stroke-width: 3.5; }
.s-acc { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.s-acc.thin { stroke-width: 2; }
.s-ink { fill: none; stroke: color-mix(in srgb, var(--text) 45%, transparent); stroke-width: 2; stroke-linejoin: round; }
.f-quote { fill: var(--accent); font: 900 64px/1 var(--sans); }
.f-ring { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; }
.f-env { fill: var(--surface); stroke: color-mix(in srgb, var(--text) 45%, transparent); stroke-width: 2; }
.f-screen { fill: #23262d; }
.f-cap { fill: rgba(255, 255, 255, 0.75); }
.f-rec { fill: #e03131; }
.f-clock { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-width: 2.5; }
.s-acc.f-hand { stroke-width: 3; }
@media (prefers-reduced-motion: no-preference) {
  .f-type { transform-box: fill-box; transform-origin: left; animation: f-type 2.6s steps(10) infinite alternate; }
  @keyframes f-type { from { transform: scaleX(0.15); } to { transform: scaleX(1); } }
  .f-ping { transform-box: fill-box; transform-origin: center; animation: f-ping 2s ease-out infinite; }
  @keyframes f-ping { 0% { transform: scale(0.8); opacity: 0.8; } 100% { transform: scale(3); opacity: 0; } }
  .f-bell { transform-box: fill-box; transform-origin: 50% 8%; animation: f-ring-bell 3.2s ease-in-out infinite; }
  @keyframes f-ring-bell { 0%, 40%, 100% { transform: rotate(0); } 8% { transform: rotate(12deg); } 16% { transform: rotate(-10deg); } 24% { transform: rotate(6deg); } 32% { transform: rotate(-3deg); } }
  .f-ring { transform-box: fill-box; transform-origin: center; animation: f-ring 3.2s ease-out infinite; }
  .f-ring2 { animation-delay: 0.5s; }
  @keyframes f-ring { 0%, 100% { transform: scale(0.7); opacity: 0; } 10% { opacity: 0.7; } 60% { transform: scale(1.35); opacity: 0; } }
  .f-rec { animation: f-blink 1.2s steps(2) infinite; }
  .f-hand { transform-box: view-box; transform-origin: 36px 36px; animation: f-rewind 6s linear infinite; }
  @keyframes f-rewind { to { transform: rotate(-360deg); } }
  @keyframes f-blink { to { opacity: 0.2; } }
}

/* Every channel: a wall of them by group, each in its colour, green while its words are coming in. */
.chan-groups { display: grid; gap: 24px; }
.chan-group-home { scroll-margin-top: calc(var(--top-h, 64px) + 20px); border-radius: 14px; }
.chan-group-home.pointed { animation: pointed 1.8s ease-out; } /* come to from a What we bring online card */
@keyframes pointed { 0%, 35% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent); background: color-mix(in srgb, var(--accent) 16%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; background: transparent; } }
.chan-group-home h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 15px; }
.chan-group-home h3 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.chan-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; } /* two across on a phone */
.hchan {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.hchan::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--line)); }
.hchan:hover { border-color: var(--accent); }
.hchan .pip { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--stale); }
.hchan.live .pip { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.hchan.paused .pip { background: var(--paused); box-shadow: 0 0 0 3px color-mix(in srgb, var(--paused) 25%, transparent); }
.hchan span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-fallback { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.chan-fallback b { color: var(--text); }
.chan-fallback a { color: inherit; text-decoration-color: var(--line); }

.credit { margin: clamp(32px, 5vw, 56px) 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.is-home .site-foot { margin-top: 12px; }

@media (max-width: 560px) {
  .hero { padding: 20px 0 52px; }
  .hero h1 { font-size: clamp(32px, 9.5vw, 44px); }
  .hero-alerts { font-size: 14px; }
}


/* Footer status + jump */
.status {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column; /* the audio player, when playing, then the status line */
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  /* On a wide window the player and status line keep to the page's column, as the transcript does, rather
     than the window's far edges. (100% is the window here: the bar is fixed.) */
  padding-inline: max(16px, (100% - var(--page)) / 2 + var(--gutter));
}
.status-line { display: flex; align-items: center; gap: 8px; }
.status .viewers { margin-left: auto; }
.status .listen {
  flex: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.status .listen:hover, .status .listen.on { border-color: var(--accent); color: var(--accent); }
.status .listen[hidden] { display: none; }
@media (max-width: 560px) {
  /* Phones keep the status to one line. */
  .status { padding: 8px 16px; white-space: nowrap; }
  .status #updated { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .status .viewers { flex: none; }
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stale); flex: none; }
.dot.on { background: var(--live); }
.dot.paused { background: var(--paused); }
.dot.err { background: var(--accent); }
.jump {
  position: fixed;
  right: 16px;
  bottom: 56px;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

@media (max-width: 560px) {
  .top-row { flex-wrap: wrap; }
  .logo { font-size: 17px; }
  .search { flex-basis: 100%; }
  .block { grid-template-columns: 1fr; }
  .block .gutter { justify-content: flex-start; height: auto; min-height: 4px; margin-bottom: 4px; }
  .frame { grid-column: 1; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .program h1 { font-size: 22px; }
}

/* Quote and cite popover (shown over a caption text selection) */
.quote-pop {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  width: max-content;
  max-width: calc(100vw - 16px);
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font: 600 14px/1.2 var(--sans);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  user-select: none;
  -webkit-user-select: none;
}
.quote-pop[hidden] { display: none; }
.quote-pop.docked { position: fixed; z-index: 35; } /* touch: pinned to the screen, clear of the OS menu */
.quote-pop button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 9px 12px; /* comfortable touch target */
  border-radius: 8px;
  white-space: nowrap;
}
.quote-pop button:hover, .quote-pop button:focus-visible { background: color-mix(in srgb, var(--bg) 18%, transparent); }
/* Play video is the main thing a selection can do where there's video: it stands out. */
/* On a phone a tap on a word offers this rather than playing (public/app.js, player.cue). */
.cue-pop {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: 600 15px/1 var(--sans);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cue-pop[hidden] { display: none; }
.quote-pop button.quote-primary { background: var(--accent); color: #fff; }
.quote-pop button.quote-primary:hover, .quote-pop button.quote-primary:focus-visible { background: color-mix(in srgb, var(--accent) 85%, #000); }
/* No room on a phone for every button in a row: they go onto a second. */
@media (max-width: 860px) { .quote-pop { flex-wrap: wrap; justify-content: center; } }
.quote-pop button[hidden] { display: none; }
.quote-pop .quote-buttons { display: contents; }
.quote-pop .quote-buttons[hidden] { display: none; }
/* Radio audio for a selected passage (player in public/app.js): part of the page's furniture, a row of the
   bottom status bar above the status line, the full width of the window. */
.player {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
}
.vid {
  position: fixed;
  right: 16px;
  top: var(--vid-top, 76px); /* under the transcript bar, so its Audio/Video buttons stay in reach (videoPanel.open) */
  z-index: 31;
  width: min(440px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.vid[hidden] { display: none; }
/* Dragged by its edge or the picture (videoPanel.initDrag in public/app.js): a touch on it moves or pinches the panel, not the page. */
.vid { padding-top: 14px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
/* Narrow enough on a phone to be moved off the text sideways as well. */
@media (max-width: 600px) { .vid { width: min(440px, 66vw); } }
.vid::before { content: ""; position: absolute; top: 5px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.vid.dragging { cursor: grabbing; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28); }
/* Its bottom-left corner resizes it, as does a pinch: a dark chip with a two-way diagonal arrow over the picture, like the ✕, shows where. */
.vid-size { position: absolute; left: 0; bottom: 0; width: 44px; height: 44px; cursor: nesw-resize; }
.vid-size::after {
  content: ""; position: absolute; left: 12px; bottom: 12px; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 11.5l7-7M7.5 4.5h4v4M4.5 7.5v4h4'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform 0.15s, background-color 0.15s;
}
.vid-size:hover::after, .vid.sizing .vid-size::after { background-color: rgba(0, 0, 0, 0.85); transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .vid-size::after { transition: none; } }
.vid.sizing { cursor: nesw-resize; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28); }
/* The picture alone: its label, scrubber and Close are the player bar's (shared with the audio). A tap plays or pauses. */
.vid video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; cursor: pointer; }
.vid-close {
  position: absolute; top: 20px; right: 14px; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 14px; line-height: 28px; cursor: pointer;
}
.vid-close:hover, .vid-close:focus-visible { background: rgba(0, 0, 0, 0.85); }
/* Over the picture till it plays (videoPanel.loading): a spinner, what it's waiting on, and a bar filling as it loads. */
.vid-loading {
  position: absolute; left: 8px; right: 8px; bottom: 8px; aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border-radius: 8px; background: rgba(0, 0, 0, 0.72); color: #fff; font: 13px/1.3 var(--mono);
  pointer-events: none;
}
.vid-loading[hidden] { display: none; }
.vid-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff;
  animation: vid-spin 0.9s linear infinite;
}
@keyframes vid-spin { to { transform: rotate(360deg); } }
.vid-progress { position: relative; width: 55%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.vid-progress i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: #fff; transition: width 0.4s ease-out; }
/* No telling how long (waiting for it to be saved): a stretch sweeps across instead. */
.vid-loading.unknown .vid-progress i { width: 30% !important; transition: none; animation: vid-sweep 1.4s ease-in-out infinite; }
@keyframes vid-sweep { from { left: -30%; } to { left: 100%; } }
.vid-loading.failed .vid-spinner, .vid-loading.failed .vid-progress { display: none; }
.vid-loading.failed { pointer-events: auto; padding: 0 24px; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .vid-spinner { animation-duration: 3s; }
  .vid-loading.unknown .vid-progress i { animation: none; left: 35%; }
}
/* 📷 over a video: saves the frame showing (public/framegrab.js). Shown while the pointer's on the picture, always on a touch screen. */
.saved-trim-picture { position: relative; }
.frame-grab {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 16px; line-height: 32px; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.frame-grab-box:hover .frame-grab, .frame-grab:focus-visible, .frame-grab[data-error] { opacity: 1; }
.frame-grab:hover, .frame-grab:focus-visible { background: rgba(0, 0, 0, 0.85); }
@media (hover: none) { .frame-grab { opacity: 0.85; } }
.frame-grab[data-error]::after {
  content: attr(data-error); position: absolute; top: calc(100% + 6px); right: 0; padding: 3px 8px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.85); color: #fff; font-size: 12px; line-height: 1.4; white-space: nowrap;
}
.vid .frame-grab { top: 20px; right: 48px; width: 28px; height: 28px; font-size: 14px; line-height: 28px; }
.watch-tile .frame-grab { top: 6px; right: 6px; width: 28px; height: 28px; font-size: 14px; line-height: 28px; }
.player button, .player a { cursor: pointer; }
.player[hidden] { display: none; }
.player-label { flex: 0 1 auto; max-width: 40%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 12px/1.3 var(--mono); color: var(--muted); }
/* Why a moment that's only just aired takes longer to play (player.explain): its own row, the full width. */
.player-note { flex-basis: 100%; order: 3; margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.player-note[hidden] { display: none; }
.player audio { display: none; } /* driven by the transport below */
/* The transport, shared by the audio and the video: play, time, scrubber, mute, speed. */
.player-transport { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 4px; }
.player-transport button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 7px;
  border-radius: 8px;
  line-height: 1;
}
.player-transport button:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.player-play { min-width: 34px; font-size: 15px; }
.player-rate { font: 12px/1 var(--mono); color: var(--muted); }
.player-time { flex: none; min-width: 4ch; font: 12px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); text-align: center; }
.player-seek {
  flex: 1 1 60px;
  min-width: 40px;
  height: 4px;
  margin: 0 4px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), var(--line) var(--p, 0%));
  cursor: pointer;
  touch-action: none;
}
.player-seek:disabled { opacity: 0.4; cursor: default; }
.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}
.player-seek::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line); }
.player-seek::-moz-range-track { height: 4px; background: transparent; }
.player-seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.player-actions { display: flex; align-items: center; gap: 4px; }
.player-actions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.player-back { font-weight: 600; }
.player-back[hidden] { display: none; }
@media (max-width: 560px) {
  /* Phones: a round button that covers less of the text. */
  .jump { width: 44px; height: 44px; padding: 0; font-size: 0; bottom: 52px; }
  .jump::before { content: "↓"; font-size: 20px; line-height: 44px; }
}
body.has-player .jump { bottom: 110px; } /* the status bar is about 100px tall with the player in it */
body.has-player main { padding-bottom: 120px; }
/* Above a transcript: a click on any word plays it (audio or video), and editing it in place. */
.tx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 18px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font: 14px/1.3 var(--sans);
  /* Stays in view (live pages open at the bottom), under the header and the programme strip. */
  position: sticky;
  top: calc(var(--top-h, 64px) + var(--strip-h, 0px) + 8px);
  z-index: 4;
  box-shadow: 0 -9px 0 var(--bg); /* the words scroll away under it, not through the gap above */
}
.tx-bar[hidden], .tx-bar:has(+ .transcript[hidden]) { display: none; }
.tx-hint { flex: 1 1 18em; color: var(--muted); }
@media (max-width: 560px) { .tx-hint .tx-more { display: none; } }
/* Phones get the editing hint in a few words, so it sits on one row with Cancel and Save. */
.tx-hint .tx-less { display: none; }
@media (max-width: 560px) {
  .tx-hint .tx-less { display: inline; }
  .tx-bar.editing { width: calc(100vw - 24px); }
  .tx-bar.editing .tx-hint { flex: 1 1 0; min-width: 0; }
}
.tx-hint b { color: var(--text); }
.tx-status { font-weight: 600; }
.tx-status:empty { display: none; }
.tx-modes { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.tx-modes[hidden], .tx-modes.off, .tx-bar button[hidden] { display: none; }
.tx-modes button { border: 0; background: transparent; color: var(--text); font: 600 14px/1 var(--sans); padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.tx-modes button[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (max-width: 560px) { .tx-modes .tx-word { display: none; } .tx-modes button { padding: 7px 10px; } }
.tx-bar > button { border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 14px/1 var(--sans); padding: 8px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tx-bar > button:hover { border-color: var(--accent); }
.top .size { display: none; } /* until txBar.init moves it into the transcript bar */
/* Normal case for a channel captioned in capitals, before A− A+ (txBar.drawCaseNote). */
.tx-case { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.tx-case[hidden] { display: none; }
.tx-bar:has(.tx-case:not([hidden])) .tx-hint { flex-basis: 10em; } /* room for it on one row */
@media (max-width: 1280px) { .tx-bar:has(.tx-case:not([hidden])) .tx-more { display: none; } }
.tx-case-why { color: var(--muted); font-size: 13px; line-height: 1.25; max-width: 11em; } /* two short lines rather than another row */
.tx-case button { border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 14px/1 var(--sans); padding: 8px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tx-case button:hover { border-color: var(--accent); }
.tx-bar .size { display: inline-flex; gap: 4px; } /* A− A+, moved here from the header (txBar.init) */
.tx-bar.editing .size { display: none; }
.tx-bar .size button { border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 14px/1 var(--sans); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.tx-bar .size button:hover { border-color: var(--accent); }
.tx-bar > button.tx-save { background: var(--accent); border-color: var(--accent); color: #fff; }
.tx-bar > button:disabled { opacity: 0.6; cursor: progress; }
/* Editing: the bar floats at the bottom so Save is always in reach. */
.tx-bar.editing {
  position: fixed;
  z-index: 30;
  top: auto;
  left: 50%;
  bottom: 52px; /* clear of the status bar */
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  margin: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
body.has-player .tx-bar.editing { bottom: 110px; } /* above the audio player too */
body:has(.tx-bar.editing) .jump { display: none; } /* not needed while editing, and it would sit on Save */
.transcript.editing { padding-bottom: 96px; }
/* A paragraph at a time (public/app.js txBar.editable): a speaker's name, gaps and feed lines can't be typed over. */
.transcript.editing .tx-para { cursor: text; border-radius: 4px; }
.transcript.editing .tx-para:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.transcript.editing .tx-para:focus { outline: 2px solid var(--accent); outline-offset: 3px; background: var(--accent-soft); }
/* Phones: the transcript bar folds behind a gear (.tx-aa) at the end of the programme strip (txBar.setOpen), so the
   words have the screen. Opened, it's one row of buttons over the foot of the page, above the player and
   status line: 🔊 ▶, A− A+ and ✎ Edit, their names in their titles. */
.tx-aa { display: none; }
@media (max-width: 560px) {
  .sections:not([hidden]) .tx-aa { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 38px; cursor: pointer; }
  .tx-aa::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M9.68 4.34L9.75 1.74L14.25 1.74L14.32 4.34L15.77 4.94L17.66 3.16L20.84 6.34L19.06 8.23L19.66 9.68L22.26 9.75L22.26 14.25L19.66 14.32L19.06 15.77L20.84 17.66L17.66 20.84L15.77 19.06L14.32 19.66L14.25 22.26L9.75 22.26L9.68 19.66L8.23 19.06L6.34 20.84L3.16 17.66L4.94 15.77L4.34 14.32L1.74 14.25L1.74 9.75L4.34 9.68L4.94 8.23L3.16 6.34L6.34 3.16L8.23 4.94Z M15.4 12a3.4 3.4 0 1 0-6.8 0a3.4 3.4 0 1 0 6.8 0Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M9.68 4.34L9.75 1.74L14.25 1.74L14.32 4.34L15.77 4.94L17.66 3.16L20.84 6.34L19.06 8.23L19.66 9.68L22.26 9.75L22.26 14.25L19.66 14.32L19.06 15.77L20.84 17.66L17.66 20.84L15.77 19.06L14.32 19.66L14.25 22.26L9.75 22.26L9.68 19.66L8.23 19.06L6.34 20.84L3.16 17.66L4.94 15.77L4.34 14.32L1.74 14.25L1.74 9.75L4.34 9.68L4.94 8.23L3.16 6.34L6.34 3.16L8.23 4.94Z M15.4 12a3.4 3.4 0 1 0-6.8 0a3.4 3.4 0 1 0 6.8 0Z'/%3E%3C/svg%3E") center / contain no-repeat; }
  .tx-aa[aria-expanded="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
  .sections:not([hidden]) + .tx-bar:not(.editing) { display: none; }
  .sections:not([hidden]) + .tx-bar:is(.open, .notice):not(.editing, [hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: fixed;
    z-index: 30;
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(var(--status-h, 44px) + 8px);
    margin: 0;
    padding: 8px;
    transform: none;
    border-radius: 14px;
    background: var(--bg);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  }
  .tx-bar.open .tx-hint { display: none; }
  .tx-bar.open .tx-edit .tx-word { display: none; }
  .tx-bar.open :is(.tx-modes button, .size button, .tx-edit) { min-height: 40px; }
  .tx-bar.open .size button { min-width: 44px; }
  .tx-bar.open :is(.tx-case, .tx-status) { flex-basis: 100%; }
  .tx-bar.open .tx-status { order: -1; }
  /* Folded away: a word from it (corrections sent) shows on its own for a few seconds (txBar.say). */
  .tx-bar.notice:not(.open) > :not(.tx-status) { display: none; }
  .tx-bar.editing, body.has-player .tx-bar.editing { bottom: calc(var(--status-h, 44px) + 8px); }
}
.transcript.editing .tx-para [contenteditable="false"] { cursor: default; }
.transcript .tx-para.tx-failed { outline: 2px solid #e03131; outline-offset: 3px; }
/* A correction sent from here, waiting for an admin: dotted, not yet green. */
.cap mark.fixed.pending { background: transparent; box-shadow: none; animation: none; text-decoration: underline dotted var(--accent) 2px; text-underline-offset: 3px; }
.cap mark.fixed.removed.pending { background: var(--accent); }
/* Like Otter: the paragraph and the word under the pointer are marked, so it's plain a click plays from there. */
.block { padding: 2px 8px; margin-inline: -8px; border-radius: 10px; transition: background-color 120ms ease; }
@media (hover: hover) {
  .transcript.playable:not(.editing) .block:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
}
::highlight(hover-word) { background-color: color-mix(in srgb, var(--text) 18%, transparent); }
/* Where the audio is kept, a click on a word plays from it, and the word being heard (only the word) is marked as it goes. */
.transcript.playable .cap { cursor: pointer; }
::highlight(now-word) { background-color: var(--accent); color: var(--bg); }
/* Safari: the box behind the word is drawn as an element (app.js showWordBox), the highlight only colours the letters. */
html.webkit .block { position: relative; isolation: isolate; }
.word-box { position: absolute; z-index: -1; pointer-events: none; }
.word-box.now-word { background: var(--accent); }
.word-box.clicked-word { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.word-box.hover-word { background: color-mix(in srgb, var(--text) 18%, transparent); }
html.webkit ::highlight(now-word), html.webkit ::highlight(clicked-word), html.webkit ::highlight(hover-word) { background-color: transparent; }
/* That box sits under the line's own background, so a quote's yellow (or a correction's green) would hide it and
   leave the word being heard pale on yellow: the line being heard drops it until the audio moves on. */
html.webkit .cap.hit.playing, html.webkit .cap.playing mark.quoted, html.webkit .cap.playing mark.fixed:not(.removed) { background: transparent; box-shadow: none; }
/* The word just clicked, marked until its audio plays, and the player spinning while it loads. */
::highlight(clicked-word) { background-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
.transcript.playable.audio-loading .cap { cursor: progress; }
/* A word the audio playing hasn't placed yet: no hand, as a click on it does nothing (player.canPlayFrom). */
.transcript.playable.not-ready .cap { cursor: default; }
/* On a live page, a line whose audio is still arriving (public/app.js audioKept): greyed out, and a click on it says to wait a moment. */
.transcript .cap.audio-pending { color: var(--muted); }
.transcript.playable .cap.audio-pending { cursor: default; }
/* In Video mode, a line whose video hasn't been saved yet instead (txBar.greyUnsaved): the video brings its own sound. */
.transcript.video-mode .cap.audio-pending:not(.vid-later) { color: inherit; }
.transcript.playable.video-mode .cap.audio-pending:not(.vid-later) { cursor: pointer; }
.transcript .cap.vid-later { color: var(--muted); }
.transcript.playable .cap.vid-later { cursor: default; }
/* While words are being selected (public/app.js), the text cursor, not the hand. */
.transcript.selecting, .transcript.selecting .cap { cursor: text; }
/* Editing, a click puts the caret in the words, so the text cursor there too, over the play rules above (whatever state the audio is in). */
.transcript.editing .tx-para .cap:not([contenteditable="false"]) { cursor: text !important; }
/* Loading audio, or waiting for a moment of video that's still being saved: a spinner before the label. */
.player.loading .player-label::before, .player.waiting .player-label::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  vertical-align: -1px;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: player-spin 0.8s linear infinite;
}
@keyframes player-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .player.loading .player-label::before, .player.waiting .player-label::before { animation-duration: 2.4s; } }

/* Account: header menu, sign-in, alerts, admin (public/account.js) */
.account { display: flex; align-items: center; gap: 6px; flex: none; }
.pill.solid { background: var(--text); border-color: var(--text); color: var(--bg); }
.pill.alert { border-color: var(--accent); color: var(--accent); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 220px;
  display: flex; flex-direction: column; padding: 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgb(0 0 0 / 0.14);
}
.menu-panel a, .menu-panel button {
  text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px;
  font-size: 14px; text-decoration: none; color: var(--text);
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg); }
.menu-who { margin: 0 0 4px; padding: 6px 10px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; font-size: 13px; }
.menu-who span { color: var(--muted); overflow-wrap: anywhere; }
.menu-sep { margin: 4px 10px; border: 0; border-top: 1px solid var(--line); }
/* Admins: how many users are active, open, inactive and signed out, just above "Admin dashboard"
   in the account menu (public/account.js renderHeaderPresence), two by two. */
.menu-presence { display: grid; grid-template-columns: 1fr 1fr; }
.menu-panel .menu-presence .presence-count { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.menu-panel .menu-presence .presence-count:hover { color: var(--text); }
.menu-presence b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.menu-presence .presence-word { white-space: pre; }
@media (pointer: coarse) { .menu-panel .menu-presence .presence-count { min-height: 44px; } }


.toast {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 30;
  max-width: min(520px, calc(100% - 32px)); padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; box-shadow: 0 8px 28px rgb(0 0 0 / 0.2);
}
.toast.err { background: #d63b2f; color: #fff; }

/* An admin viewing the site as another user. */
.view-as {
  position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 8px 16px; background: var(--accent); color: #fff; font-size: 14px;
}
.view-as .btn { background: #fff; color: #1b1b1a; border-color: #fff; }

/* A paid subscriber whose card was declined (account.js renderCardBar). */
.card-failing {
  position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 8px 16px; background: #b45309; color: #fff; font-size: 14px;
}
.card-failing .btn { background: #fff; color: #1b1b1a; border-color: #fff; }

/* A free trial's offer email as it was sent, on the person's card (account.js, Users tab). */
.uc-trial-email { margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; }
.uc-trial-email pre { margin: 6px 0 0; white-space: pre-wrap; font: inherit; line-height: 1.5; }
.passkey-list { list-style: none; margin: 0 0 10px; padding: 0; }
.passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
/* The sign-in form (account.js authPanel): one column, full-width buttons, "or" between two rules. */
.panel.auth { padding: 24px; }
.auth .btn.wide { width: 100%; padding: 10px 16px; font-size: 15px; }
.auth .btn.quiet.wide:hover { border-color: var(--text); }
.auth .msg:empty { margin: 0; min-height: 0; }
.auth .or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.auth .or::before, .auth .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-foot { margin: 22px -24px -24px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
/* Sign up for a new reader: a tinted row of its own, so it isn't lost in the fine print. */
.auth-foot .new-here {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; font-weight: 600;
}
.auth-foot .new-here a { color: var(--accent); text-decoration: none; }
.auth-foot .new-here a:hover { text-decoration: underline; }
.auth-foot .fine { margin: 0; }
.toast[hidden] { display: none; }

.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; }
.panel h2, .panel h3 { margin: 0 0 6px; font-size: 17px; }
.panel > p { margin: 0 0 10px; }
.panel.auth { max-width: 440px; }
.field[hidden] { display: none; }
.panel.nudge { border-color: var(--accent); background: var(--accent-soft); }
.panel.nudge a { color: var(--accent); font-weight: 600; }
.list > form.panel, .list > .panel { margin-bottom: 4px; }
.section { font-size: 17px; margin: 22px 0 4px; }
.muted { color: var(--muted); font-size: 13px; }
.storage-usage { margin: 0 0 12px; }
.storage-usage.is-full { color: var(--accent); }
.fine { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.fine a { color: inherit; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field .label, .field legend { font-weight: 600; font-size: 14px; padding: 0; }
.field small { color: var(--muted); font-size: 13px; }
.input {
  font: inherit; font-size: 16px; padding: 8px 12px; border-radius: 8px; width: 100%; /* 16px: no zoom-on-focus in iOS Safari */
  border: 1px solid var(--line); background: var(--bg); color: var(--text); outline: none;
}
.input:focus { border-color: var(--accent); }
.input:disabled { color: var(--muted); }
.list > .input[type="search"] { margin: 16px 0 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin: 0 0 14px; }
.check input, .chans input { margin: 0; accent-color: var(--accent); }
.chans { display: flex; flex-wrap: wrap; gap: 6px; }
.chans label {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer;
}
.btn {
  border: 1px solid var(--text); background: var(--text); color: var(--bg); border-radius: 999px;
  padding: 7px 16px; font-weight: 600; font-size: 14px;
}
.btn.quiet { border-color: var(--line); background: var(--surface); color: var(--text); padding: 4px 11px; font-size: 13px; }
.btn.quiet:hover { border-color: var(--accent); }
.btn.danger { border-color: #d63b2f; background: #d63b2f; color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }
/* A link dressed as a button (the tveeder page's sign-in): no underline, and the prose link colour doesn't override the button's.
   Its words centred up and down as a <button>'s are, when it's made taller than they are: stretched in a row of
   buttons (the old-recordings dialog's Open Your recordings) or 44px high on a touch screen. */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.prose a.btn { color: var(--bg); }
/* Sign in beside a page's Sign up button (public/signup.js): the quiet button keeps its own colour, at the main
   one's size, and goes under it, in line, where a phone has no room for both. */
.prose a.btn.quiet { color: var(--text); padding: 7px 16px; font-size: 14px; }
.prose p:has(> a.btn.quiet) { display: flex; flex-wrap: wrap; gap: 8px; }
.linkish { border: 0; background: none; padding: 0; text-decoration: underline; font-size: 14px; }
.msg { font-size: 14px; margin: 10px 0 0; min-height: 1.2em; }
.msg.err, .fail { color: #d63b2f; }
.tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 6px 10px 8px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
/* Not a table: a "stack" table is a card per row on phones only (below); as a flex box its
   head and body would size their columns apart and stop lining up. */
.stack:not(table) { display: flex; flex-direction: column; gap: 8px; }
/* /alerts: one line to add an alert, its options folded under it. */
.alert-add-row { display: flex; gap: 8px; align-items: flex-start; }
.alert-add-row > div { flex: 1; min-width: 0; }
.alert-add-row .field { margin-bottom: 10px; }
.alert-add-row > .btn { flex: none; margin-top: 25px; }
.alert-options { border-top: 1px solid var(--line); padding-top: 10px; }
.alert-options > summary { cursor: pointer; font-size: 14px; list-style-position: inside; }
.alert-options[open] > summary { margin-bottom: 14px; }
.alert-options .field:last-child { margin-bottom: 0; }
.alert-add .msg { margin: 8px 0 0; }
.alert-add .msg:empty { display: none; }
@media (max-width: 560px) {
  .alert-add-row { flex-direction: column; align-items: stretch; gap: 0; }
  .alert-add-row > .btn { margin: 0 0 12px; }
}
.rule { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.rule h3 { overflow-wrap: anywhere; }
.rule.editing > form { flex: 1 1 100%; }
.rule .msg { flex-basis: 100%; margin: 0; min-height: 0; }
.rule-ways { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; font-size: 14px; }
.rule-ways .check { margin: 0; font-weight: 400; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Admin Users tab: one card per user, no sideways scrolling. */
.user-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.user-card { display: grid; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.user-card:last-child { border-bottom: 0; }
.user-card.off > * { opacity: 0.55; }
.user-card a { color: inherit; }
.uc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.uc-who { min-width: 0; overflow-wrap: anywhere; }
.uc-who b { font-size: 14px; }
/* Beside the name, Admin / Subscriber / Lapsed are labels, so a bordered tag, not the coloured dot that
   means online or inactive on the right. */
.uc-who .badge { margin-left: 8px; padding: 1px 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; line-height: 16px; vertical-align: 1px; }
.uc-who .badge::before { display: none; }
.uc-who .badge.ok { color: var(--live); }
.uc-who .badge.warn { color: var(--paused); }
.uc-who .badge.off { color: var(--muted); }
.uc-head > .badge { flex: none; }
.uc-meta { overflow-wrap: anywhere; }
.uc-alerts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.uc-chip { max-width: min(22em, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.uc-chip:hover { border-color: var(--accent); }
.uc-chip.paused { color: var(--muted); border-style: dashed; }
.uc-more { color: var(--muted); }
.uc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.uc-access { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.user-features { display: flex; flex-wrap: wrap; gap: 4px 12px; white-space: nowrap; }
.sent { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.sent:hover { border-color: var(--accent); }
.sent q, .table .quote { quotes: "“" "”"; }
.sent mark { background: var(--mark); color: inherit; border-radius: 2px; }

.cost-total { font-size: 32px; letter-spacing: -0.02em; }
.cost-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cost-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cost-save .msg { margin: 0; }
.input.num-input { width: 96px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; container-type: inline-size; }
.stat b { font-size: 24px; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .alert-edit-row td { background: var(--bg); padding: 12px 10px 16px; }
.alert-edit-row .alert-edit { max-width: 640px; font-size: 14px; }
.table tr.off td { opacity: 0.55; }
/* Visits: a person's several visits on one day fold into one row; its button opens them under it. */
.table .visit-count { display: block; margin-top: 2px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; }
.table .visit-count:hover { text-decoration: underline; }
.table .visit-count .caret { display: inline-block; width: 1.1em; font-size: 15px; line-height: 1; }
.table tr.visit-day.open td { background: var(--bg); }
.table tr.visit-sub td { background: var(--bg); font-size: 13px; color: var(--muted); }
.table tr.visit-sub td:first-child { padding-left: 24px; }
/* Each day's heading, sorted by when they started. */
.table tr.visit-date td { padding-top: 14px; padding-bottom: 6px; background: var(--bg); font-size: 13px; }
.table.stack tr.visit-date td::before { content: none; }
/* Set column widths, so opening a day's visits never moves the columns. */
.table.visits { table-layout: fixed; width: 100%; }
.table.visits th:nth-child(1) { width: 15%; }
.table.visits th:nth-child(2) { width: 24%; }
.table.visits th:nth-child(3) { width: 15%; }
.table.visits th:nth-child(4) { width: 13%; }
.table.visits th:nth-child(5) { width: 18%; }
.table.visits th:nth-child(6) { width: 15%; }
.table .quote { display: block; max-width: 340px; text-decoration: none; }
.table .quote:hover { text-decoration: underline; }
/* A "stack" table (account.js table) on a phone: a card per row, each cell under
   its column's name, so nothing runs off the side or wraps a word a line. */
@media (max-width: 560px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr { display: block; }
  .table.stack tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { display: flex; gap: 10px; padding: 3px 0; border: 0; overflow-wrap: anywhere; }
  .table.stack td::before { content: attr(data-label); flex: 0 0 8em; color: var(--muted); font-weight: 600; }
  .table.stack td.blank { display: none; }
}

@media (max-width: 560px) {
  /* Logo and account share the first row; search wraps below. Phones pick a
     channel from the row of channel names under the header (swipe it), so the
     Channels menu isn't shown here. */
  .top-row .chan-menu { display: none; }
  .top-row .account { order: 1; margin-left: auto; }
  /* Room for the logo, channels and account on one line: "Channels" rather than
     the channel being watched. */
  .chan-menu .chan-menu-label, .chan-menu .caret { display: none; }
  .chan-menu summary.pill::after { content: "Channels"; }
  .chan-menu summary.pill { padding: 6px 12px; }
  .menu-panel.chan-panel { position: fixed; left: 16px; right: 16px; top: 60px; min-width: 0; }
  /* The second row: the 🔍, then the search box once it's opened. */
  .top-row .search-toggle { order: 2; }
  .top-row .search { order: 3; }
  .is-search .top .search { display: none; } /* the search page has its own search box */
  .menu-panel { right: 0; }
}
/* Where the 🔍 fits on the first row (most iPhones), it goes before Watch, so the account menu stays at the
   right-hand end, as on a computer; narrower, it wraps to the start of the second row as above. */
@media (min-width: 380px) and (max-width: 560px) {
  .top-row .search-toggle { order: 1; margin-left: auto; }
  .top-row .account { order: 2; margin-left: 0; }
}
/* Signed out on captionator.tv the account is two pills, Sign in and Sign up (public/signup.js), which at a pill's
   usual width would wrap under the logo on a phone. Narrower sides keep them on the logo's row with the 🔍 on a
   390px iPhone, tighter still below that, and beside the logo alone down to 320px. */
@media (max-width: 560px) {
  [data-signup] .top-row .account a:is([href="/signin"], [href="/pricing"]) { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 389px) {
  [data-signup] .top-row .account:has(a[href="/pricing"]) { gap: 4px; }
  [data-signup] .top-row .account a:is([href="/signin"], [href="/pricing"]) { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 346px) {
  [data-signup] .top-row:has(.account a[href="/pricing"]) { column-gap: 8px; }
}

/* Legal pages and site footer (public/pages.js) */
/* /pricing (public/pages.js pricingView): signed out, the Subscribe card beside the page's prose on a wide
   screen and above it on a narrow one; signed in, a line on their plan above the prose. */
.pricing { display: grid; gap: 24px; align-items: start; }
/* Signed out: the card and what you get side by side at one height, the small print under both (pages-content.js pricingSections). */
@media (min-width: 960px) {
  .pricing.with-chooser { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 24px 32px; align-items: stretch; }
  .pricing.with-chooser > .plan { max-width: none; }
}
.prose.pricing-gets { max-width: none; display: flex; flex-direction: column; padding: 24px 28px; }
.prose.pricing-gets h2 { font-size: 22px; letter-spacing: -0.3px; margin: 0 0 6px; }
/* What you get: a row each, its title in a column of its own and a rule between rows. */
.prose.pricing-gets ul { list-style: none; padding: 0; margin: 0; }
.prose.pricing-gets li { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 4px 20px; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.prose.pricing-gets li:last-child { border-bottom: 0; }
.prose.pricing-gets li > b:first-child { font-size: 15px; }
/* Why it costs anything: at the foot of the box, so the box ends where the card does, its words under the rows' sentences. */
.prose.pricing-gets h2 ~ h2 { margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; letter-spacing: 0; }
.prose.pricing-gets h2 ~ p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
/* The small print: its heading under the card and its points under the box beside it, so its edges line up with theirs. */
.prose.pricing-small { grid-column: 1 / -1; max-width: none; background: none; border: 0; border-radius: 0; padding: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.prose.pricing-small h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px; }
.prose.pricing-small ul { margin: 0; padding-left: 18px; }
.prose.pricing-small li { margin: 0 0 4px; }
@media (min-width: 960px) {
  .prose.pricing-small { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); column-gap: 32px; }
  .prose.pricing-small h2 { margin: 2px 0 0; padding-left: 24px; }
  .prose.pricing-small ul { padding-left: 46px; }
}
@media (max-width: 600px) {
  .prose.pricing-gets { padding: 18px; }
  .prose.pricing-gets li { grid-template-columns: minmax(0, 1fr); }
}
.plan.plan-note { padding: 16px 20px; gap: 4px; }
.plan.plan-note h2 { font-size: 16px; letter-spacing: 0; }
.plan.plan-note p { margin: 0; font-size: 15px; }
.plan { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: 720px; box-sizing: border-box; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(0, 0, 0, 0.06); }
.plan h2 { margin: 0; font-size: 22px; letter-spacing: -0.3px; }
.plan > p.muted { font-size: 14px; line-height: 1.5; margin: 0 0 6px; }
.plan .plan-price { margin: 0; font-size: 15px; }
.plan .plan-price b { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.plan .plan-saving { margin: -4px 0 0; }
.plan ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.plan li { margin: 0 0 4px; }
.plan .btn { align-self: flex-start; margin-top: auto; }
.plan form { display: flex; flex-direction: column; margin-top: auto; }
.plan form .field { margin-bottom: 10px; }
.plan .fine { margin-top: 10px; }
.plan .seg { align-self: flex-start; }
/* Subscribe, full width, and what it charges under it (public/pages.js planChooser). */
.plan-chooser .btn.plan-go { align-self: stretch; margin: 2px 0 0; padding: 12px 16px; font-size: 15px; text-align: center; }
.plan-charge-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; }
.plan-chooser .msg:empty { display: none; }
.plan-chooser ul { list-style: none; padding: 0; margin: 2px 0 16px; display: grid; gap: 6px; font-size: 14px; }
.plan-chooser li { position: relative; padding-left: 22px; margin: 0; }
.plan-chooser li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }

.prose { max-width: 720px; font-size: 16px; line-height: 1.6; }
.prose h2 { font-size: 18px; margin: 22px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 15px; margin: 16px 0 4px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin: 0 0 6px; }
.prose a, .credit a { color: var(--accent); }
/* /blog: the index lists each post as a heading, a date line and its blurb; a post opens with its byline (public/blog-posts.js). */
.prose h2 a { color: inherit; text-decoration: none; }
.prose h2 a:hover { text-decoration: underline; }
.prose .post-meta { display: block; margin: 0 0 14px; }
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }
/* The rule along the top spans the text, not the gutters, so it lines up with the page above. */
.site-foot {
  max-width: var(--page); margin: 40px auto 0; padding: 16px var(--gutter);
  background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.site-foot span { flex-basis: 100%; }
textarea.input { resize: vertical; font: inherit; font-size: 16px; }
select.input { appearance: auto; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.table .message { white-space: pre-wrap; max-width: 460px; }
.table .user-agent { max-width: 260px; font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* A table that fits the page rather than scrolling sideways: long cells wrap, and nothing is cut short. */
.table.fit td { overflow-wrap: anywhere; }
.table.fit .user-agent { max-width: none; display: block; overflow: visible; -webkit-line-clamp: unset; }
/* The sign-in log's browser: the whole user agent on a computer, "Chrome 158 on Windows" on a phone. */
.table .browser-name { display: none; }
@media (max-width: 560px) {
  .table.stack .user-agent { display: none; }
  .table.stack .browser-name { display: block; }
  .table.fit.stack td::before { flex-basis: 6.5em; }
  /* Room between each line of a card, and between a value's own lines (an address and "+3 other users"). */
  .table.fit.stack tr { padding: 14px; }
  .table.fit.stack td { padding: 6px 0; line-height: 1.4; }
  .table.fit.stack td > div > div + div { margin-top: 3px; }
  /* Activity, Last sign-in, Sign-in log and Visits across the top in one row; the count under them. */
  .section-tools:has(> .machine-tabs) { flex-wrap: wrap; }
  .section-tools > .machine-tabs:not(.presence-tabs, .delivery-tabs) { order: -1; flex: 1 1 100%; flex-wrap: nowrap; }
  .section-tools > .machine-tabs:not(.presence-tabs, .delivery-tabs) button { flex: 1 1 auto; justify-content: center; padding: 6px 4px; font-size: 13px; white-space: nowrap; }
  .section-tools > .machine-tabs ~ .btn:last-child { margin-left: auto; }
}

/* Advanced search */
.adv { margin-bottom: 12px; }
/* Advanced search, Reset and the archive's start, just under the search box. */
.program-links .search-extras { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -4px 0 6px; }
.archive-note { font-size: 13px; color: var(--muted); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.adv-filters { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .adv-filters { grid-template-columns: 1fr 1fr; } .adv-filters > :first-child { grid-column: 1 / -1; } }
.adv-section { border-top: 1px solid var(--line); padding-top: 14px; }
.adv-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.adv-foot .fine { margin: 0; flex: 1 1 260px; }
.adv .msg:empty { display: none; }
.row-program { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
/* The same line on the network's other channels (src/search-sisters.ts). */
.row-also { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.row-also-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); cursor: pointer; }
.row-also-link:hover, .row-also-link:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
.center { text-align: center; }

/* Channel picker (alerts, advanced search) */
.chan-picker { display: flex; flex-direction: column; gap: 6px; }
/* A market alert's company list (public/alert-kinds.js). */
.company-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; margin-top: 6px; }
.chans label.all { border-color: var(--text); }
.chans label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.pick-summary { color: var(--muted); font-size: 13px; }
.pick-summary.err { color: #d63b2f; }

/* Search filters: a summary pill that opens the channel and date pills. */
.filters { flex-basis: 100%; }
.filters summary { list-style: none; cursor: pointer; width: fit-content; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary small { font-weight: 500; color: var(--muted); }
.filters summary::after, .pill.fold::after { content: "▾"; font-size: 10px; color: var(--muted); }
.filters[open] summary::after, .pill.fold[aria-expanded="true"]::after { content: "▴"; }
/* The channel chips (filter pills, picker ticks) fold behind a Choose channels
   pill beside All channels: all channels is the default. */
.filter-pills .chan-pills { flex-basis: 100%; margin: 0; }
.filter-pills .chan-pills[hidden] { display: none; }
.chans[hidden] { display: none; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.filter-pills .break { flex-basis: 100%; height: 0; }

/* Search by meaning checkbox, beside the search box on the results page. */
.meaning-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.meaning-toggle input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* Touch screens: buttons big enough for a thumb. */
@media (pointer: coarse) {
  .pill, .btn, .btn.quiet, .chan-menu summary.pill { min-height: 44px; padding-left: 14px; padding-right: 14px; }
  .chan, .chip { min-height: 38px; }
  .chip { align-items: center; }
  .avatar { width: 40px; height: 40px; }
  .chans label { min-height: 40px; }
}

/* Account and information pages (and the home page) have nothing to report in the status bar. */
.no-status { padding-bottom: 0; }
.no-status .status:not(:has(.player:not([hidden]))), .is-home .status:not(:has(.player:not([hidden]))) { display: none; }
/* …but audio or video played there still gets its row, on its own, with its ✕. */
.no-status .status > :not(.player), .is-home .status > :not(.player) { display: none; }
.no-status .status .player, .is-home .status .player { padding-bottom: 0; border-bottom: 0; }

/* Phones, caption pages: room to read. The sticky header and programme strip
   are cut to the essentials, and the programme header and player made compact. */
.phone-only { display: none; }
@media (max-width: 560px) {
  .phone-only { display: inline-flex; }
  .search input { font-size: 16px; } /* under 16px, iOS Safari zooms in on focus and stays zoomed */
  /* Every page folds the header search behind a 🔍 at the start of the second row, so the first row
     (logo, Channels, Watch, account) is the same on every page. */
  .top-row .search-toggle { display: inline-flex; padding: 6px 12px; }
  .top-row .search-toggle[aria-expanded="true"] { border-color: var(--text); }
  body:not(.search-open) .top-row .search { display: none; }
  .search-open .top .search { display: block; visibility: visible; }
  .top-row { padding: 8px 16px 6px; row-gap: 8px; }
  .channels { padding-bottom: 8px; }
  /* The strip: just the programmes. The header comes back on scrolling up, and
     the transcript download is in the programme links. */
  .sections { padding: 6px 16px; margin-bottom: 12px; }
  .sections .chip.up, .sections .actions { display: none; }
  .program { margin-bottom: 16px; padding-bottom: 12px; }
  .program p { font-size: 15px; }
  .program .program-tip { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; }
  .program-links { gap: 6px; margin-top: 10px; }
  /* The player on one row: the label only when it says more than what's playing (loading, an error,
     player.plain), and no status line under it while it's up. */
  .player { gap: 4px 8px; padding-bottom: 0; border-bottom: 0; }
  .player-label { flex: 1 1 100%; max-width: none; }
  .player-label.plain { display: none; }
  .player-transport { flex: 1 1 0; }
  .player-note { white-space: normal; } /* the status bar's nowrap would cut it off at the edge */
  .player-actions:has(.player-back:not([hidden])) { flex-basis: 100%; justify-content: flex-end; }
  body.has-player .status-line { display: none; }
  body.has-player main { padding-bottom: 16px; }
  body.has-player .jump { bottom: calc(var(--status-h, 60px) + 12px); }
  .player-transport button { padding: 8px 7px; }
  .player-actions button { padding: 4px 9px; font-size: 15px; line-height: 1.2; }
}
@media (max-width: 560px) and (pointer: coarse) {
  .program-links .pill { min-height: 36px; padding-left: 12px; padding-right: 12px; }
  .sections .chip { min-height: 34px; }
}
/* Touch: while the quote bar is up, the "jump to live" button stands aside so the
   bar can sit low, just above the player or status bar. */
@media (pointer: coarse) { body.quoting .jump { display: none; } }

/* Admin: suggested corrections */
.fix-line { min-width: 18em; max-width: 40em; line-height: 1.6; }
.fix-line del { color: var(--muted); opacity: 0.7; }
.fix-line ins { text-decoration: none; font-weight: 600; }
/* The suggested words: a box to type over, with a pencil so it reads as one. */
.fix-line .fix-input {
  width: auto; min-width: 6ch; max-width: 100%; padding: 2px 24px 2px 6px; font: inherit; font-weight: 600;
  border: 1px dashed var(--accent); background: var(--surface) no-repeat right 6px center / 12px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23999' stroke-width='1.6'%3E%3Cpath d='M11 2.5l2.5 2.5L5 13.5H2.5V11z'/%3E%3C/svg%3E");
  cursor: text;
}
.fix-line .fix-input:focus { border-style: solid; }
.fix-line .fix-input.changed { border-style: solid; box-shadow: 0 0 0 1px var(--accent); }
.fix-line .fix-diff ins { color: var(--accent); }
.fix-words-label { display: grid; gap: 4px; margin-top: 8px; font-size: 0.85em; color: var(--muted); }
.fix-line textarea.fix-words { width: 100%; resize: vertical; font-size: 15px; padding-right: 6px; background-image: none; color: var(--text); }
/* Its audio, under the line: a bar the width of the cell to scrub along, the
   line and its changed words marked on it, and the buttons under the bar. */
.line-player { margin-top: 10px; max-width: 40em; }
.line-player-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line-player-row .btn { padding: 4px 10px; font-size: 13px; }
.line-player-row .line-play { min-width: 2.8em; }
.line-scrub { position: relative; flex: 1 0 100%; height: 28px; }
.line-scrub::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 3px; background: var(--line); }
.line-scrub-line, .line-scrub-words { position: absolute; top: 11px; height: 6px; border-radius: 3px; pointer-events: none; }
.line-scrub-line { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.line-scrub-words { background: var(--accent); }
.line-scrub-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.line-scrub-range::-webkit-slider-runnable-track { height: 28px; background: none; }
.line-scrub-range::-moz-range-track { height: 28px; background: none; }
.line-scrub-range::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: 24px; margin-top: 2px; border-radius: 2px; background: var(--text); }
.line-scrub-range::-moz-range-thumb { width: 4px; height: 24px; border: 0; border-radius: 2px; background: var(--text); }
.line-scrub-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.line-scrub-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; padding: 0 4px; }
.line-scrub-note { margin: 6px 0 0; font-size: 0.9em; }

/* Words corrected while the page was open (an approved reader correction) */
.cap mark.fixed {
  background: color-mix(in srgb, var(--live) 22%, transparent);
  color: inherit;
  border-radius: 3px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--live) 22%, transparent);
  animation: fixed-in 1.2s ease-out;
}
.cap mark.fixed.removed {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin: 0 2px;
  vertical-align: -0.1em;
  background: var(--live);
  box-shadow: none;
}
@keyframes fixed-in { from { background: color-mix(in srgb, var(--live) 60%, transparent); } }
@media (prefers-reduced-motion: reduce) { .cap mark.fixed { animation: none; } }

/* Admin dashboard (public/account.js adminView): tabs, overview, Capture tab, charts */
.admin, .admin-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.admin-tabs { overflow-x: auto; overflow-y: hidden; margin: 0; scrollbar-width: none; } /* the tabs' underline pokes 1px below: no scrolling up and down */
/* Wide screens: the tabs run down the left, the section fills the rest. Phones keep the row along the top. */
@media (min-width: 761px) {
  .admin { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 24px; align-items: start; }
  .admin-tabs {
    flex-direction: column; gap: 2px; position: sticky; top: 12px;
    border-bottom: 0; border-right: 1px solid var(--line); overflow: visible;
  }
  .admin-tabs button {
    justify-content: space-between; padding: 7px 12px 7px 10px; margin: 0 -1px 0 0; text-align: left;
    border-bottom: 0; border-right: 2px solid transparent;
  }
  .admin-tabs button.on { border-right-color: var(--accent); }
  .admin-tabs button:hover { color: var(--text); }
}
.admin-tabs button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.admin-tabs .count {
  font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 999px;
  background: var(--line); color: var(--text); font-variant-numeric: tabular-nums;
}
.admin-tabs .count.warn { background: var(--accent); color: #fff; }
.admin-tools { display: flex; gap: 8px; align-items: center; }
.admin-tools .input { flex: 1; min-width: 0; }
.admin-section .section { margin-top: 8px; }
.email-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.email-item { border-bottom: 1px solid var(--line); }
.email-item > summary { display: grid; grid-template-columns: 11em minmax(0, 14em) minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 4px; cursor: pointer; }
.email-item > summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.email-subject { font-weight: 600; }
.email-body { padding: 0 4px 12px; }
.email-frame { display: block; width: 100%; min-height: 200px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.checkin-draft .email-subject .badge { margin-right: 4px; }
.checkin-text { width: 100%; font: 14px/1.5 var(--sans); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.checkin-actions-admin { margin-top: 10px; }
.email-text { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 640px) {
  .email-item > summary { grid-template-columns: 1fr auto; gap: 2px 8px; }
  .email-subject { grid-column: 1 / -1; white-space: normal; }
}
.section-tools { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin: 0 0 8px; }
/* Users: the presence tabs sit on the left, the buttons stay on the right. */
.section-tools .presence-tabs, .section-tools .delivery-tabs { margin-right: auto; }
.section-tools:has(.presence-tabs, .delivery-tabs) { flex-wrap: wrap; }
.admin-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; }
.admin-grid h2, .machine h2 { font-size: 17px; margin: 0 0 8px; }
.attention ul, .machine .issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attention li, .machine .issues li { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
/* Dismiss / Restore at the end of a warning (public/account.js dismissButton) */
.btn.dismiss { padding: 2px 10px; font-size: 12px; min-height: 0; }
.attention li .dismiss, .machine .issues li .dismiss, .dismissed-list li .dismiss { margin-left: auto; flex: none; }
.btn.dismiss.close { padding: 0 8px; font-size: 16px; line-height: 1.4; border-color: transparent; color: var(--muted); }
.btn.dismiss.close:hover { color: var(--text); border-color: var(--line); }
.table td .dismiss { margin-top: 4px; }
.table td .status-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.table td .status-cell .dismiss { margin-top: 0; }
.attention-text { min-width: 0; }
.attention-text .muted { font-size: 12px; margin-top: 2px; }
/* Where a Needs attention link lands (public/account.js goTab's focus): a brief glow. */
[data-focus] { scroll-margin-top: 80px; }
.flash { animation: flash 2.4s ease-out; border-radius: 8px; }
tr.flash > td { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 35% { background-color: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .flash, tr.flash > td { animation: none; outline: 2px solid var(--accent); } }
.dismissed-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.dismissed-list p { margin: 0; font-size: 13px; }
.dismissed-list .linkish { font-size: 13px; color: var(--muted); }
.dismissed-list ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dismissed-list li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.attention a { color: var(--text); }
.capture-summary p { margin: 0 0 8px; font-size: 14px; }
.machine-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.more { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.stat small { color: var(--muted); font-size: 12px; margin-top: 2px; }
/* Overview: who's on the site now. Each tile is a button to the Users tab, with its presence dot in the corner. */
.presence-stats .stat { position: relative; cursor: pointer; }
.presence-stats .stat:hover, .presence-stats .stat:focus-visible { border-color: var(--accent); }
.presence-stats .stat .badge { position: absolute; top: 14px; right: 14px; }
.stat.warn { border-color: var(--paused); }

/* A status: a coloured dot and a word. */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stale); }
.badge.ok::before { background: var(--live); }
.badge.warn::before { background: var(--paused); }
.badge.open::before { background: var(--open); }
.badge.bad::before { background: #d63b2f; }
.badge.bad { color: #d63b2f; }

.machine { display: flex; flex-direction: column; gap: 12px; }
.machine-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.machine-head p { margin: 0; }
.machine-status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.machine h3 { font-size: 15px; margin: 4px 0 0; }
.machine-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.machine .stat { background: var(--bg); }
.admin .table td.error { min-width: 180px; max-width: 320px; overflow-wrap: anywhere; }
.admin .stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.machine .stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.machine .stat b { font-size: min(20px, 16cqi); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--bg); }
.seg button { border: 0; background: none; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.chart { margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px 6px; min-width: 0; }
.chart figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.chart figcaption b { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; }
.machine-tabs { align-self: flex-start; flex-wrap: wrap; border-radius: 14px; }
.machine-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 14px; }
.chart-tabs { display: flex; flex-wrap: wrap; border-radius: 14px; margin-bottom: 6px; }
.chart-tabs button { padding: 3px 9px; font-size: 12px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { stroke: var(--muted); stroke-width: 1; opacity: 0.5; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart-svg .bar { fill: var(--accent); }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill: var(--accent); opacity: 0.08; }
.chart-svg .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-tip {
  position: absolute; top: -4px; transform: translateX(-50%); pointer-events: none;
  background: var(--text); color: var(--bg); border-radius: 8px; padding: 4px 8px; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; white-space: nowrap;
}
.chart-tip .muted { color: inherit; opacity: 0.75; font-size: 11px; }

@media (max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .machine-status { align-items: flex-start; }
}

/* ---------- /watch: a grid of live players (public/watch.js) ---------- */
/* The chips open under the header, from its Choose channels pill. */
/* Links to the caption page of each channel on the wall, over the feeds (watchView in public/watch.js). */
.watch-read { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 8px; font-size: 13px; }
.watch-read[hidden] { display: none; }
.watch-read-head { font-weight: 600; margin-right: 2px; }
.watch-read-link { padding: 2px 8px 2px 6px; border: 1px solid var(--line); border-left: 3px solid var(--chan); border-radius: 4px; text-decoration: none; white-space: nowrap; }
.watch-read-link:hover, .watch-read-link:focus-visible { text-decoration: underline; }
.watch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.watch-chips[hidden] { display: none; }
.watch-chip { cursor: pointer; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; }
.watch-chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
/* A control room's wall of monitors: the grid takes the whole window, square-cornered, with thin gaps. */
.watch { container-type: inline-size; }
/*
 * Every row is as tall as a single tile (its label, then a 16:9 picture as
 * wide as a column), so a tile spanning n columns and n rows is n tiles wide
 * and n tall, and the others pack in around it (dense) wherever there's room.
 * On a wider screen fit() in public/watch.js sets --row, the height that fits
 * the whole wall in the window, and the grid's width to match, centred;
 * on a phone a column is the .watch container's width (cqw) over --c.
 */
.watch-grid {
  --c: var(--cols, 3); --g: 4px;
  display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); gap: var(--g); grid-auto-flow: dense;
  grid-auto-rows: var(--row, calc((100cqw - (var(--c) - 1) * var(--g)) / var(--c) * 9 / 16 + 21px));
  max-width: 100%; margin-inline: auto;
}
.watch-grid > [data-span="2"] { grid-column: span 2; grid-row: span 2; }
.watch-grid > [data-span="3"] { grid-column: span 3; grid-row: span 3; }
.watch-grid > [data-span="4"] { grid-column: span 4; grid-row: span 4; }
.watch-tile { position: relative; margin: 0; display: flex; flex-direction: column; min-height: 0; outline: 3px solid transparent; outline-offset: -3px; }
/* The name: a black bar joined to the top of the picture, like the monitor's own edge, in the channel's colour at the left. */
.watch-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: #fff; background: #000; border-left: 3px solid var(--chan); padding: 2px 8px 2px 6px; line-height: 17px; flex: none; text-decoration: none; }
.watch-label:hover { text-decoration: underline; }
/*
 * The picture, with the controls laid over its foot (figcaption sits in the
 * tile, so it's placed against the tile's bottom, which is the screen's). It
 * fills the rest of the row (exactly 16:9 for a single tile; a spanning one
 * gets the gaps and labels it covers too, as thin bars round the picture).
 */
.watch-screen { position: relative; aspect-ratio: 16 / 9; flex: 1 1 auto; min-height: 0; background: #000; overflow: hidden; }
/* The one you're hearing, name and picture: ringed in the live green (dark mode's brighter one, on any theme, to stand out on the picture) with a glow, like a live pip's. */
.watch-tile.has-sound { z-index: 1; outline-color: #3ccf7f; box-shadow: 0 0 0 3px color-mix(in srgb, #3ccf7f 40%, transparent), 0 0 14px color-mix(in srgb, #3ccf7f 55%, transparent); }
.watch-tile video { display: block; width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.watch-tile figcaption {
  position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.75)); color: #fff; font-size: 13px;
  opacity: 0; transition: opacity 0.15s;
}
.watch-tile:hover figcaption, .watch-tile:focus-within figcaption, .watch-tile.has-sound figcaption { opacity: 1; }
@media (hover: none) { .watch-tile figcaption { opacity: 1; } }
.watch-btn { border: 0; background: rgb(255 255 255 / 0.12); color: #fff; border-radius: 3px; min-width: 30px; height: 28px; font-size: 14px; cursor: pointer; }
.watch-btn:hover { background: rgb(255 255 255 / 0.25); }
/* CC, lit while the tile's captions show. */
.watch-cc { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.watch-cc[aria-pressed="true"] { background: #fff; color: #000; }
.watch-cc[aria-pressed="true"]:hover { background: rgb(255 255 255 / 0.8); }
/* A small tile (a big wall on a small screen) gets small controls: no full screen (a double-click does it). */
.watch-tile figcaption { overflow: hidden; }
@container (max-width: 260px) {
  .watch-tile figcaption { gap: 2px; padding: 14px 4px 4px; justify-content: flex-end; }
  .watch-btn { min-width: 24px; height: 24px; font-size: 12px; padding: 0; }
  .watch-cc { font-size: 10px; }
}
@container (max-width: 160px) { .watch-full { display: none; } .watch-btn { min-width: 21px; } }
/* The resize grip, at the tile's bottom-right corner: drag it out to grow the tile, a column at a time. */
.watch-size { cursor: nwse-resize; touch-action: none; }
.watch-tile:fullscreen { background: #000; gap: 0; }
.watch-tile:fullscreen .watch-size { display: none; }
.watch-tile:fullscreen .watch-screen { flex: 1; aspect-ratio: auto; }
.watch-note { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #ddd; font-size: 14px; text-align: center; padding: 16px; pointer-events: none; }
.watch-about .watch-foot { font-size: 13px; margin-top: 10px; max-width: 90ch; }
.watch-howto { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; max-width: 90ch; }
.watch-howto > div { display: flex; gap: 4px; }
.watch-howto dt { font-weight: 600; }
.watch-howto dd { margin: 0; color: var(--muted); }
/* The header is just its pills, tight above the wall; the heading and how-to open from How to use. */
.is-watch .program { margin-bottom: 10px; padding-bottom: 0; border-bottom: 0; }
.is-watch .program-meta, .is-watch .program h1:empty, .is-watch .program-links:empty { display: none; }
.is-watch .program-links { margin-top: 0; }
.watch-about { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.watch-about[hidden] { display: none; }
.watch-about h1 { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 6px; }
.watch-about p { margin: 0; color: var(--muted); max-width: 70ch; }
.watch-pause[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.watch-held .watch-note { color: #fff; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; }
/* Fewer columns on a narrow screen, and no tile wider than the grid: on a phone's single column every tile is the one size, and its grip is gone. */
@media (max-width: 700px) {
  .watch-grid { --c: min(var(--cols, 3), 2); }
  .watch-grid > [data-span="3"], .watch-grid > [data-span="4"] { grid-column: span 2; grid-row: span 2; }
}
@media (max-width: 460px) {
  .watch-grid { --c: 1; }
  .watch-grid > [data-span] { grid-column: auto; grid-row: auto; }
  .watch-size { display: none; }
}
.watch-all { font-weight: 600; }
/* Dragging a tile to move it (sortable() in public/watch.js) */
.watch-tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.watch-tile.is-dragging { position: fixed; z-index: 50; margin: 0; cursor: grabbing; scale: 1.03; pointer-events: none; transition: scale 0.15s; }
.watch-tile.is-dragging { box-shadow: 0 18px 40px rgb(0 0 0 / 0.45); outline-color: var(--accent); }
.watch-tile.is-dragging figcaption { opacity: 1; }
.watch-gap { aspect-ratio: 16 / 9; border: 2px dashed var(--chan, var(--accent)); background: var(--accent-soft); }
.watch-dragging, .watch-dragging * { cursor: grabbing !important; }
@media (prefers-reduced-motion: reduce) { .watch-tile.is-dragging { scale: none; transition: none; } }

/* ---------- recording on /watch (public/watch.js) ---------- */
.watch-rec { color: #ff5a4f; }
.watch-tile.is-recording { outline-color: #e5372b; }
.watch-tile.is-recording figcaption { opacity: 1; }
.watch-rec-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; max-width: calc(100% - 16px);
  padding: 2px 8px; border-radius: 3px; background: rgb(0 0 0 / 0.7); color: #fff;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.watch-rec-badge[href]:hover { text-decoration: underline; }
.watch-rec-badge.is-recording { color: #ff6b61; }
.watch-rec-badge.is-recording::first-letter { animation: rec-blink 1.2s steps(2, start) infinite; }
.watch-rec-badge.is-failed { background: rgb(150 20 10 / 0.85); white-space: normal; }
@keyframes rec-blink { to { visibility: hidden; } }
/* A spinner in the middle of a page, or a part of one, that's still loading. */
.page-loading { display: flex; justify-content: center; align-items: center; min-height: 160px; }
.panel .page-loading, li > .page-loading { min-height: 72px; }
#list > .page-loading, #transcript > .page-loading { min-height: 40vh; }
.page-loading .spinner {
  box-sizing: border-box; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: rec-mp4-spin 0.8s linear infinite;
}
.admin-main > .page-loading:only-child, .admin-main > .admin-tools + .page-loading:last-child { min-height: 40vh; }
/* Admin → Video archive: each channel with a status pill, a red pulsing dot while it records. */
.archive-table { border-collapse: collapse; margin-top: 4px; display: block; max-width: 100%; overflow-x: auto; } /* scrolls in its panel, not the page */
.archive-table td { padding: 7px 20px 7px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.archive-table tr:last-child td { border-bottom: 0; }
.archive-table td:empty { display: none; }
@media (max-width: 560px) { .archive-table td { padding-right: 12px; } .archive-table td:first-child { white-space: normal; } }
.archive-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.archive-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px 2px 8px; border-radius: 999px;
  font-size: 0.85em; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent);
}
.archive-status.is-recording { color: #e03131; background: color-mix(in srgb, #e03131 11%, transparent); }
.archive-dot { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; opacity: 0.5; }
.archive-status.is-recording .archive-dot { opacity: 1; }
.archive-status.is-recording .archive-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor;
  animation: archive-pulse 1.6s ease-out infinite;
}
@keyframes archive-pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .archive-status.is-recording .archive-dot::after { animation: none; } }
/* Captions over the picture, above the tile's controls. */
.watch-captions, .rec-overlay {
  position: absolute; left: 0; right: 0; bottom: 44px; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0 6%; pointer-events: none; text-align: center;
}
.watch-captions span, .rec-overlay span {
  background: rgb(0 0 0 / 0.78); color: #fff; padding: 1px 8px; border-radius: 3px;
  font-size: clamp(12px, 2.2cqw, 22px); line-height: 1.35; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.watch-tile { container-type: inline-size; }
.watch-tile:fullscreen .watch-captions span { font-size: 2.4vw; }

/* ---------- /recordings (public/recordings.js) ---------- */
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rec-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 12px; border-left: 4px solid var(--chan); }
/* The poster frame: the channel's colour, with ▶, until the recorder has grabbed one. */
.rec-thumb {
  position: relative; flex: none; width: 128px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden;
  background: color-mix(in srgb, var(--chan) 55%, #000); display: grid; place-items: center; text-decoration: none;
}
.rec-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-thumb-mark { color: rgba(255, 255, 255, 0.85); font-size: 22px; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.rec-thumb img ~ .rec-thumb-mark { display: none; }
.rec-item.is-active .rec-thumb-mark { color: #ff5a4d; font-size: 16px; animation: rec-blink 1.4s ease-in-out infinite; }
.rec-thumb-time {
  position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.75); color: #fff;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4;
}
.rec-item-delete { flex: none; padding: 4px 8px; font-size: 15px; line-height: 1.2; }
.rec-item-delete:hover { border-color: #d63b2f; color: #d63b2f; }
/* The tick boxes for Delete selected, and the bar above the list. */
.rec-pick { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
span.rec-pick { cursor: default; }
.rec-bulk { display: flex; align-items: center; gap: 12px; min-height: 32px; margin: 0 0 8px; padding: 0 16px; font-size: 14px; }
.rec-bulk label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.rec-bulk .rec-item-delete { margin-left: auto; font-size: 14px; }
@keyframes rec-blink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .rec-item.is-active .rec-thumb-mark { animation: none; } }
@media (max-width: 600px) {
  .rec-thumb { width: 96px; }
  .rec-item { gap: 10px; padding-right: 8px; }
  /* The picture and its name on one row, the tags, Move to… and Delete under them. */
  .rec-list .rec-item { flex-wrap: wrap; }
  .rec-list .rec-link { flex-basis: calc(100% - 106px); }
  .rec-list .folder-move { margin-left: auto; }
}
.rec-link { flex: 1; min-width: 0; display: grid; gap: 2px; text-decoration: none; }
.rec-link:hover .rec-chan { text-decoration: underline; }
.rec-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta { font-variant-numeric: tabular-nums; }
.rec-status { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rec-status.is-recording, .rec-status.is-pending { color: #e5372b; }
.rec-status.is-failed { color: #d63b2f; }

.rec-view { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.rec-stage { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; container-type: inline-size; }
.rec-stage video { display: block; width: 100%; height: 100%; object-fit: contain; }
.rec-stage:fullscreen { border-radius: 0; }
.rec-stage:fullscreen .rec-overlay { bottom: 72px; }
.rec-overlay { bottom: 56px; }
.rec-overlay span { font-size: clamp(14px, 2.6cqw, 30px); }
.rec-controls, .rec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rec-controls .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.rec-downloads { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.rec-downloads-head { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.rec-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rec-file {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); text-decoration: none; line-height: 1.25;
}
.rec-file:hover { border-color: var(--accent); }
.rec-file b { display: block; font-size: 14px; }
.rec-file small { display: block; color: var(--muted); font-size: 12px; }
.rec-file-icon { font-size: 16px; color: var(--accent); }
.rec-file[aria-disabled] { opacity: 0.5; pointer-events: none; }
.rec-delete { margin-left: auto; }
.rec-shared-note { font-size: 13px; }
.rec-shared-tag { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.rec-delete:hover { border-color: #d63b2f; color: #d63b2f; }
.rec-transcript { display: flex; flex-direction: column; gap: 8px; padding: 10px; max-height: calc(100vh - 140px); position: sticky; top: 80px; }
.rec-find { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.rec-none { margin: 4px 2px; }
.rec-lines { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 120px; }
.rec-line {
  display: grid; grid-template-columns: 56px 1fr; gap: 6px; width: 100%; padding: 5px 6px; border: 0; border-radius: 6px;
  background: none; text-align: left; font-size: 14px; line-height: 1.4;
}
.rec-line:hover { background: var(--accent-soft); }
.rec-line time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 2px; }
.is-now .rec-line { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
/* Fixing a line: ✎ beside each line for whoever may manage the recording, then an editor in its place. */
.rec-row { display: flex; align-items: flex-start; gap: 2px; }
.rec-row .rec-line { flex: 1; min-width: 0; }
.rec-line-edit {
  flex: none; width: 28px; height: 28px; margin-top: 2px; padding: 0; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font-size: 14px; cursor: pointer; opacity: 0;
}
.rec-row:hover .rec-line-edit, .rec-row:focus-within .rec-line-edit, .is-now .rec-line-edit { opacity: 1; }
.rec-line-edit:hover, .rec-line-edit:focus-visible { background: var(--accent-soft); color: var(--text); opacity: 1; }
@media (hover: none) { .rec-line-edit { opacity: 0.7; } }
.rec-edit-hint { margin: -2px 2px 0; font-size: 12px; }
.rec-row.is-editing { display: grid; grid-template-columns: 56px 1fr; gap: 6px; padding: 5px 6px; border-radius: 6px; background: var(--accent-soft); }
.rec-edit-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 8px; }
.rec-editor { width: 100%; min-height: 3.2em; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; line-height: 1.4; resize: vertical; }
.rec-edit-actions { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rec-edit-actions .btn { padding: 4px 10px; font-size: 13px; }
.rec-edit-actions .rec-delete { margin-left: auto; }
.rec-edit-error { flex-basis: 100%; font-size: 13px; color: #d63b2f; }
/* Editing the whole transcript: every line a box of its own, saved together. */
.rec-edit-all { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.rec-bulk-bar { display: flex; flex-direction: column; gap: 6px; }
.rec-bulk-bar .rec-edit-actions .btn { padding: 4px 10px; font-size: 13px; }
.rec-bulk-count { font-size: 13px; }
.rec-row.is-bulk { padding: 2px 6px; background: none; }
.rec-row.is-bulk.is-now { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.is-bulk .rec-edit-time { padding: 7px 0 0; border: 0; background: none; text-align: left; cursor: pointer; }
.is-bulk .rec-edit-time:hover { color: var(--text); }
.is-bulk .rec-editor { min-height: 0; padding: 4px 7px; field-sizing: content; resize: none; }
.is-bulk .rec-editor:placeholder-shown { border-style: dashed; }
/* Trim and Embed panels under a recording's player. */
.rec-trim, .rec-embed { margin-top: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.rec-trim-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.rec-trim-head b { font-size: 15px; }
.rec-trim-range { color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-trim-range time { color: var(--text); font-weight: 600; }
.rec-trim-editor, .rec-trim-progress { display: grid; gap: 10px; }
.rec-trim-bar { position: relative; height: 36px; margin: 4px 8px 0; }
.rec-trim-track { position: absolute; left: 0; right: 0; top: 14px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rec-trim-keep { position: absolute; top: 0; bottom: 0; background: var(--accent); opacity: 0.85; }
.rec-trim-playhead { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text); }
.rec-trim-bar input[type="range"] {
  position: absolute; left: -8px; right: -8px; top: 0; width: calc(100% + 16px); height: 36px; margin: 0; padding: 0;
  -webkit-appearance: none; appearance: none; background: none; pointer-events: none; outline: none;
}
.rec-trim-bar input[type="range"]::-webkit-slider-runnable-track { background: none; }
.rec-trim-bar input[type="range"]::-moz-range-track { background: none; }
.rec-trim-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; width: 16px; height: 28px; margin-top: 4px; border-radius: 5px;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); cursor: ew-resize;
}
.rec-trim-bar input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 16px; height: 28px; border-radius: 5px;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); cursor: ew-resize;
}
.rec-trim-bar input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-trim-bar input[type="range"]:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-trim-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rec-trim-spacer { flex: 1; }
.rec-trim-note { margin: 0; font-size: 12px; }
.rec-trim-error { margin: 0; font-size: 13px; color: #d63b2f; }
.rec-trim-progress { grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rec-trim-progress-track { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rec-trim-progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.4s; }
.rec-embed-code { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 12px/1.5 var(--mono); resize: vertical; }
@media (max-width: 640px) {
  .rec-trim-progress { grid-template-columns: 1fr; }
  .rec-trim-spacer { display: none; }
}
@media (max-width: 860px) {
  .rec-view { grid-template-columns: 1fr; }
  .rec-transcript { position: static; max-height: 60vh; }
}
@media (max-width: 560px) {
  .rec-delete { margin-left: 0; }
}
/* Until a new recording can play: a countdown ring (public/recordings.js). */
.rec-wait { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 16px; color: #fff; text-align: center; background: #000; }
.rec-ring { position: relative; width: 72px; height: 72px; }
.rec-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rec-ring circle { fill: none; stroke-width: 5; }
.rec-ring-track { stroke: rgb(255 255 255 / 0.15); }
.rec-ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.25s linear; }
.rec-wait-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-wait-text { margin: 0; font-size: 14px; color: #ddd; max-width: 34ch; }
/* Past the estimate: a spinning arc instead of a count. */
.rec-wait.is-late .rec-ring-fill { stroke-dashoffset: 75; transition: none; transform-origin: 32px 32px; animation: rec-spin 1s linear infinite; }
@keyframes rec-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rec-wait.is-late .rec-ring-fill { animation-duration: 3s; } }
/* Admin: where recordings are kept (public/account.js recordingsPanel). */
.rec-setting { margin-bottom: 16px; }
.rec-setting h2 { margin: 0 0 10px; font-size: 16px; }
.rec-setting .check { align-items: flex-start; font-weight: 400; }
.rec-setting .check input { margin-top: 4px; }
.rec-setting p { margin: 4px 0; }
/* The MP4 download: made on the Mac mini when asked, with a progress bar. */
.rec-mp4.is-busy { cursor: progress; border-color: var(--accent); }
.rec-mp4.is-unavailable { cursor: default; opacity: 0.6; }
.rec-mp4 > span:last-child { flex: 1; min-width: 0; }
.rec-mp4 small { overflow: hidden; text-overflow: ellipsis; }
.rec-mp4.is-busy .rec-file-icon { box-sizing: border-box; width: 16px; height: 16px; flex: none; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rec-mp4-spin 0.8s linear infinite; }
@keyframes rec-mp4-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rec-mp4.is-busy .rec-file-icon { animation-duration: 2.4s; } }
/* /planes: aircraft around Sydney (public/planes.js). */
.planes-status { margin: 0 0 10px; font-size: 14px; }
.tabs a { padding: 6px 10px 8px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.planes-today-head { margin: 0 0 12px; font-size: 20px; }
.planes-today-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.planes-today-grid > .panel:only-child, .planes-today-grid > [hidden] + .panel { grid-column: 1 / -1; }
.planes-today h2 { margin: 0 0 8px; font-size: 16px; }
.planes-today h3 { margin: 12px 0 6px; font-size: 14px; }
.planes-today-counts { margin: 0 0 8px; }
.planes-today-moves { margin: 4px 0 2px; padding: 0; list-style: none; }
.planes-today-moves time { color: var(--muted); font-variant-numeric: tabular-nums; }
.planes-today-rest summary { cursor: pointer; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.planes-today-feed .linkish { text-decoration: none; }
.planes-today-more { margin-top: 8px; }
@media (max-width: 760px) { .planes-today-grid { grid-template-columns: 1fr; } }
.planes-status.warn { color: var(--paused); font-weight: 600; }
.planes-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.planes-map { height: min(84vh, 1100px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); z-index: 0; }
.planes-side { display: flex; flex-direction: column; gap: 12px; max-height: min(84vh, 1100px); overflow: auto; }
.planes-side h2 { margin: 0 0 8px; font-size: 16px; }
.planes-side h3 { margin: 12px 0 6px; font-size: 14px; }
.planes-detail { position: relative; }
/* The Watchlist's tabs and its Find box on one line, the box at the right; on a narrow screen the box drops under the tabs. */
.planes-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.planes-bar .tabs { flex: 1 1 auto; margin: 0; border-bottom: 0; }
.planes-bar .planes-find { flex: 0 1 340px; margin: 0 0 6px; }
.planes-bar .planes-find-input { padding-top: 6px; padding-bottom: 6px; }
.planes-find { position: relative; max-width: 520px; margin: 0 0 10px; }
.planes-find-input { width: 100%; }
.planes-find-list { position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); max-height: 50vh; overflow: auto; }
.planes-find-list li { padding: 8px 12px; cursor: pointer; overflow-wrap: anywhere; }
.planes-find-list li.on, .planes-find-list li[role="option"]:hover { background: var(--line); }
.planes-stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.planes-close { position: absolute; top: 10px; right: 10px; }
.planes-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 8px 0; }
.planes-facts dt { font-size: 12px; color: var(--muted); }
.planes-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.planes-facts.db { padding-top: 8px; border-top: 1px dashed var(--line); }
.planes-watched { margin: 0; color: var(--accent); font-weight: 600; }
.planes-emergency { margin: 0; color: #e03131; font-weight: 700; }
.planes-history ol, .planes-feed { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.planes-history li { padding: 2px 0; }
.planes-filters { margin-bottom: 6px; flex-wrap: wrap; }
.planes-event { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); column-gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.planes-event time { grid-row: span 2; color: var(--muted); font-variant-numeric: tabular-nums; }
.planes-event-day { display: block; font-size: 0.8em; }
.planes-event .linkish { text-align: left; text-decoration: none; font-size: inherit; overflow-wrap: anywhere; }
.planes-event.watched b { color: var(--accent); }
.planes-event.squawk span { color: #e03131; font-weight: 600; }
.planes-banner { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.planes-banner-item { text-align: left; padding: 10px 14px; border: 1px solid #e03131; border-radius: 10px; background: color-mix(in srgb, #e03131 12%, var(--surface)); }
.planes-icon { color: var(--text); }
.planes-icon span { display: block; width: 22px; height: 22px; }
.planes-icon svg { width: 100%; height: 100%; fill: currentColor; stroke: var(--surface); stroke-width: 1; }
.planes-icon.ground { opacity: 0.5; }
.planes-icon.vehicle { color: #f59f00; }
.planes-icon.vehicle span { width: 16px; height: 16px; margin: 3px; }
.planes-icon.vehicle.ground { opacity: 0.9; }
.planes-icon.watched, .planes-icon.selected { color: var(--accent); }
.planes-icon.emergency { color: #e03131; }
.planes-icon.emergency span { animation: planes-pulse 1s ease-in-out infinite alternate; }
@keyframes planes-pulse { to { filter: drop-shadow(0 0 6px #e03131); } }
@media (prefers-reduced-motion: reduce) { .planes-icon.emergency span { animation: none; } }
.planes-trail { stroke: var(--accent); }
.planes-tracked-list, .planes-flights ol { margin: 0; padding: 0; list-style: none; }
.planes-tracked-list li, .planes-flights li { padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; }
.planes-tracked-list li.on b, .planes-flights li.on b { color: var(--accent); }
.planes-tracked-list .linkish, .planes-flight { text-align: left; text-decoration: none; font-size: inherit; overflow-wrap: anywhere; }
.planes-where { display: block; }
.planes-where.here { color: var(--accent); }
.planes-route { stroke: var(--accent); stroke-opacity: 0.85; }
.planes-route-end, .planes-lastseen { stroke: var(--accent); fill: var(--surface); fill-opacity: 1; }
@media (prefers-color-scheme: dark) {
  .planes-map .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.5); }
  .planes-map.leaflet-container { background: #262624; } /* shows through the seams between inverted tiles */
}
.planes-airport { stroke: var(--text); fill: var(--surface); fill-opacity: 1; }
.planes-map .leaflet-tooltip.planes-tip { padding: 1px 5px; font: 600 12px/1.4 var(--sans); }
.planes-map.leaflet-container { font: 12px/1.4 var(--sans); }
/* /boats (public/boats.js) reuses the /planes layout; vessels are coloured by kind. */
.boats-icon span { width: 18px; height: 18px; }
.boats-icon.yacht { color: #7048e8; }
.boats-icon.passenger { color: #1c7ed6; }
.boats-icon.cargo { color: #2b8a3e; }
.boats-icon.tanker { color: #c92a2a; }
.boats-icon.service { color: #e67700; }
.boats-icon.fishing { color: #0c8599; }
.boats-icon.other { color: var(--muted); }
.boats-icon.still span { opacity: 0.7; }
.boats-icon.watched, .boats-icon.selected { color: var(--accent); }
.boats-icon.watched span, .boats-icon.selected span { opacity: 1; }
/* The Watchlist tab: every watched aircraft or vessel on one map, a list of what each did last, and one's full story on a click. */
.planes-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; border: 1.5px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.planes-watch-list li { padding: 7px 0; }
.planes-watch-line { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.planes-watch-line.flying, .planes-watch-now.flying { color: var(--accent); }
.planes-watch-now { margin: 6px 0 2px; font-weight: 600; }
.planes-watch-now.flying { font-weight: 700; }
.planes-watch-detail h2 { display: flex; align-items: center; gap: 2px; }
.planes-watch-icon.ground { opacity: 1; }
.planes-watch-icon.dim { opacity: 0.3; }
.planes-watch-icon svg { stroke-width: 1.5; }
.planes-map .leaflet-tooltip.planes-tip.dim { opacity: 0.45; }
.planes-map .leaflet-tooltip.planes-tip.led::before { display: none; } /* moved off its marker: a line leads back instead */
.planes-events { margin-top: 12px; }
.planes-events h4 { margin: 10px 0 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.planes-events ol { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.planes-events li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); column-gap: 8px; padding: 3px 0; }
.planes-events li.squawk span { color: #e03131; font-weight: 600; }
.planes-events time { color: var(--muted); font-variant-numeric: tabular-nums; }
.planes-events .btn { margin-top: 8px; }
@media (max-width: 760px) {
  .planes-grid { grid-template-columns: 1fr; }
  .planes-map { height: min(70vh, 640px); }
  .planes-side { max-height: none; overflow: visible; }
}
/* /boats People shares the /planes People cards, faces and person page (below: .person-layout, its passages as .flight rows); only the admin rows are its own. */
.people-grid > .page-loading { grid-column: 1 / -1; }
.boats-whose { width: auto; padding: 3px 8px; font-size: 13px; }
.boats-person { display: flex; gap: 10px; align-items: flex-start; }
.boats-person-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.boats-person-acts { margin-top: 4px; }
.planes-watch-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.planes-watch-form .input { flex: 1 1 160px; width: auto; }
.planes-admin ul { list-style: none; margin: 0; padding: 0; }
.planes-admin li { padding: 4px 0; overflow-wrap: anywhere; }
.plane-alerts ul { list-style: none; margin: 0; padding: 0; }
.plane-alerts li { padding: 6px 0; overflow-wrap: anywhere; }
.plane-alerts .inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.plane-alert-kinds { margin-top: 4px; }
.plane-alert-kinds summary { cursor: pointer; color: var(--muted); font-size: 0.9em; }
.plane-alert-kinds .check { margin-left: 16px; }
.planes-admin .inline-form, .rec-setting .inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.planes-admin .inline-form .input, .rec-setting .inline-form .input { flex: 1 1 260px; width: auto; }
/* Add a user's free-trial offer (public/account.js signInLinkPanel): which email, its subject and its words, a row of their own under the address. */
.rec-setting .trial-offer { flex: 1 1 100%; display: grid; gap: 8px; }
.rec-setting .trial-offer[hidden] { display: none; }
.rec-setting .trial-offer select.input { flex: 0 1 190px; }
.rec-setting .trial-offer p { margin: 0; font-size: 13px; }
/* Who to offer a free trial, under Add a user: an address and why on the left, its button on the right. */
.trial-suggest { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.trial-suggest[hidden], .trial-suggest-list[hidden] { display: none; }
.trial-suggest h3 { margin: 0 0 4px; font-size: 15px; }
.trial-suggest-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 2px; }
.trial-suggest-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
/* Where their try came from and which email they would get, beside the address. */
.trial-where { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.trial-where.au { border-color: var(--accent); color: var(--accent); }
.trial-suggest-list li > div { min-width: 0; overflow-wrap: anywhere; }
.trial-suggest-list li .muted { font-size: 13px; }
.trial-suggest-list li .btn { flex: none; }
@media (max-width: 860px) {
  .planes-grid { grid-template-columns: 1fr; }
  .planes-map { height: 72vh; }
  .planes-side { max-height: none; }
}

/* ---------- guided tours (public/tour.js) ---------- */
/* The page greys out around a spotlight; clicks don't reach the page meanwhile. */
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour-hole {
  position: fixed; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgb(0 0 0 / 0.62), 0 0 0 3px var(--accent);
  transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s;
}
.tour-card {
  position: fixed; width: min(360px, calc(100vw - 32px)); padding: 16px 16px 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.35);
}
.tour-card.centre { left: 50%; top: 50%; translate: -50% -50%; }
.tour-count { font-size: 12px; color: var(--muted); }
.tour-title { margin: 2px 0 6px; font-size: 17px; }
.tour-text { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-nav { display: flex; gap: 6px; }
/* One size and one line each: Next (quiet beside Play it) was smaller than it, and "Skip tour" and "Loading… Skip" broke in two. */
.tour-actions button { white-space: nowrap; flex: none; }
.tour-nav .btn, .tour-nav .btn.quiet { padding: 6px 13px; font-size: 13px; line-height: 1.3; }
.tour-skip { border: 0; background: none; padding: 6px 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.tour-skip:hover { color: var(--text); }
/* Controls that normally show on hover stay up while the tour points at them. */
.tour-on .watch-tile figcaption { opacity: 1; }
@media (max-width: 560px) {
  .tour-card:not(.centre) { left: 16px; right: 16px; width: auto; bottom: 16px; top: auto; }
  .tour-card.at-top:not(.centre) { top: 16px; bottom: auto; }
}
@media (prefers-reduced-motion: reduce) { .tour-hole { transition: none; } }
.foot-tour { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }


/* Feedback (public/feedback.js): a tab on the right edge for signed-in users;
   phones use the account menu or the footer instead. */
.feedback-tab {
  position: fixed; right: 0; top: 50%; z-index: 20; transform: translateY(-50%);
  border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; padding: 12px 6px;
  background: var(--surface); color: var(--muted); font: 600 12px var(--sans); letter-spacing: 0.03em; cursor: pointer;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.08);
}
/* Only the words turn to read upwards; the tab itself isn't rotated, so its open side stays against the edge. */
.feedback-tab span { display: block; writing-mode: vertical-rl; transform: rotate(180deg); }
.feedback-tab:hover, .feedback-tab:focus-visible { color: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) { .feedback-tab { display: none; } }
.feedback-dialog {
  width: min(34em, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: 15px/1.45 var(--sans);
}
.feedback-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.feedback-dialog form { padding: 20px 24px; }
.feedback-dialog h2 { margin: 0 0 4px; font-size: 20px; }
.feedback-dialog > form > .muted { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.feedback-close { float: right; }
.feedback-kinds { flex-wrap: wrap; margin: 0 0 10px; }
.feedback-dialog textarea { width: 100%; resize: vertical; min-height: 7em; font: inherit; }
.feedback-attached { margin: 10px 0 14px; font-size: 13px; color: var(--muted); }
.feedback-attached summary { cursor: pointer; }
.feedback-attached ul { list-style: none; margin: 8px 0 0; padding: 0; }
.feedback-attached li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--line); }
.feedback-attached li > span { flex: none; width: 5.5em; }
.feedback-attached b { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.feedback-attached q { color: var(--text); flex: 1; overflow-wrap: anywhere; }
.feedback-drop { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.feedback-drop:hover { color: var(--accent); }
.feedback-actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 560px) { .feedback-dialog form { padding: 16px; } }
.rec-delete-dialog {
  width: min(26em, calc(100vw - 32px)); padding: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: 15px/1.45 var(--sans);
}
.rec-delete-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.rec-delete-dialog form { padding: 20px 24px; }
.rec-delete-dialog h2 { margin: 0 0 4px; font-size: 20px; }
.rec-delete-dialog .muted { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.rec-delete-dialog label { display: block; font-size: 14px; }
.rec-delete-names { margin: -6px 0 14px; padding-left: 20px; max-height: 10em; overflow-y: auto; font-size: 14px; }
.rec-delete-word { display: block; width: 100%; margin-top: 6px; font: inherit; }
.rec-delete-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 560px) { .rec-delete-dialog form { padding: 16px; } }
.rec-old-dialog { width: min(560px, calc(100vw - 32px)); }
.rec-old-list { list-style: none; margin: 0 0 14px; padding: 0; max-height: 40vh; overflow-y: auto; border-top: 1px solid var(--line); }
.rec-old-list li { border-bottom: 1px solid var(--line); }
.rec-old-dialog .rec-old-list label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 2px; cursor: pointer; }
.rec-old-list input { margin-top: 3px; flex: none; }
.rec-old-list span { display: flex; flex-direction: column; min-width: 0; }
.rec-old-list b { font-weight: 600; overflow-wrap: anywhere; }
.rec-old-list small { font-size: 13px; }
.rec-old-dialog .rec-delete-actions { flex-wrap: wrap; }
.rec-old-open { margin-right: auto; }
.feedback-facts { margin-top: 6px; font-size: 12px; display: grid; gap: 2px; }
.feedback-facts > div { overflow-wrap: anywhere; }

/* ---------- /collections (public/collections.js) ---------- */
.col { display: flex; flex-direction: column; gap: 12px; }
.col-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.col-search input[type=search] { flex: 1 1 260px; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.col-search label { font-size: 14px; white-space: nowrap; }
.col-frame { display: block; width: 100%; min-height: 70vh; border: 0; border-radius: 12px; background: var(--surface); } /* a page collection's document, sized to it by collections.js */
.col-years { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.col-threads { display: flex; flex-direction: column; gap: 10px; }
.col-thread { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.col-tw { min-width: 0; }
.col-tw img, .col-tw video { display: block; max-width: 100%; max-height: 520px; border-radius: 10px; margin: 6px 0; }
.col-ctx { background: var(--bg); border-left: 3px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 15px; }
.col-own { border-left: 3px solid var(--accent); padding-left: 10px; }
.col-quote { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.col-tw.gone { color: var(--muted); font-style: italic; }
.col-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 14px; }
.col-av { width: 26px; height: 26px; border-radius: 50%; }
.col-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.col-stats, .col-foot { font-size: 13px; }
.col-flag { font-size: 14px; border-radius: 8px; padding: 6px 10px; background: var(--accent-soft); }
.col-flag.sev3, .col-lead.sev3 { border-left: 4px solid #c92a2a; }
.col-flag.sev2, .col-lead.sev2 { border-left: 4px solid var(--paused); }
.col-flag.sev1, .col-lead.sev1 { border-left: 4px solid var(--stale); }
.col-hit, .col-lead { padding: 12px 14px; }
.col-hit mark { background: var(--mark); color: inherit; }
.col-kind { font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); align-self: start; justify-self: start; }
.col-kind.own { border-color: var(--accent); color: var(--accent); }
.col-lead blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line); }
.col-lead textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--bg); color: var(--text); }
.col-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.col-members { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.col-members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.col-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.col-add input { flex: 1 1 220px; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.col-combo { position: relative; flex: 1 1 260px; min-width: 0; display: flex; }
.col-combo input { flex: 1; }
.col-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); }
.col-suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.col-suggest li.on { background: var(--accent-soft); }
.col-suggest li.off { cursor: default; opacity: 0.55; }
.col-invite { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--accent-soft); }
.col-link { display: flex; gap: 8px; flex-wrap: wrap; }
.col-public { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.col-public input { margin-top: 4px; }
.col-link input { flex: 1 1 260px; min-width: 0; font: 13px var(--mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.col-members .actions { display: flex; gap: 6px; }
.col-members .col-kind { margin-left: 6px; }
/* Admin tables: click a heading to sort (public/account.js) */
.table th.sortable { padding: 0; }
.table th.sortable button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.table th.sortable button:hover, .table th[aria-sort="ascending"] button, .table th[aria-sort="descending"] button { color: var(--text); }
.table th.sortable button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.sort-mark { font-size: 10px; }
/* Capture tab: a ring that empties until a machine's next report is due (public/account.js reportRing) */
.machine-status .reported { display: inline-flex; align-items: center; gap: 6px; }
.report-ring { width: 14px; height: 14px; transform: rotate(-90deg); flex: none; }
.report-ring circle { fill: none; stroke-width: 3; }
.report-ring .track { stroke: var(--line); }
.report-ring .fill {
  stroke: var(--live); stroke-dasharray: 100; stroke-dashoffset: 0;
  animation: report-drain var(--period) linear var(--elapsed) forwards, report-late 1.4s ease-in-out var(--left) infinite;
}
@keyframes report-drain { to { stroke-dashoffset: 100; } }
@keyframes report-late { 0%, 100% { stroke-dashoffset: 0; opacity: 0.25; } 50% { stroke-dashoffset: 0; opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) { .report-ring .fill { animation: report-drain var(--period) linear var(--elapsed) forwards; } }
.chart-tab-rows { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 6px; }
.chart-tab-rows .chart-tabs { margin-bottom: 0; }
.core-tabs button { min-width: 30px; padding: 2px 5px; font-size: 11px; font-variant-numeric: tabular-nums; }

/* ---------- /planes People: the people whose aircraft are watched (public/planes-people.js) ---------- */
.person-face { display: inline-grid; place-items: center; width: var(--size, 64px); height: var(--size, 64px); border-radius: 50%; overflow: hidden; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: calc(var(--size, 64px) * 0.36); flex: none; letter-spacing: 0.02em; }
.person-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--live); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); animation: person-pulse 1.6s ease-in-out infinite alternate; }
@keyframes person-pulse { to { box-shadow: 0 0 0 6px color-mix(in srgb, var(--live) 8%, transparent); } }
@media (prefers-reduced-motion: reduce) { .person-dot { animation: none; } }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.person-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
.person-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.person-card.flying { border-color: color-mix(in srgb, var(--live) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--live) 35%, transparent); }
.person-card .person-face { margin-bottom: 6px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.person-card.flying .person-face { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--live); }
.person-name { font-weight: 700; font-size: 18px; line-height: 1.25; }
.person-blurb { color: var(--muted); font-size: 13px; line-height: 1.4; }
.person-now { font-size: 14px; line-height: 1.4; margin-top: 4px; }
.person-now.flying { color: var(--live); font-weight: 600; }
.person-aircraft { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.person-stats { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; width: 100%; }
/* A person's page */
.planes-person { max-width: 1000px; }
.person-head { display: flex; align-items: center; gap: 22px; margin: 4px 0 18px; }
.person-head h1 { margin: 0; font-size: 30px; line-height: 1.15; }
.person-head .person-blurb { font-size: 16px; margin: 4px 0 6px; }
.person-head .person-face { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.person-head-text { min-width: 0; }
.person-head-text p { margin: 0; }
.person-kicker { font-size: 13px; margin-bottom: 4px !important; }
.person-kicker a { color: var(--muted); text-decoration: none; }
.person-kicker a:hover { color: var(--text); text-decoration: underline; }
.planes-person .panel { margin-bottom: 14px; }
.planes-person .panel h2, .person-stats-box h2 { font-size: 20px; margin: 0 0 8px; }
.person-where { margin: 10px 0 0; font-size: 15px; line-height: 1.5; }
.person-where.flying { color: var(--live); }
.person-where.flying b { color: var(--text); }
.person-where .small { font-size: 13px; color: var(--muted); }
.person-stats-box { margin-bottom: 14px; }
.person-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.person-tile { padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.person-tile b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.person-tile span { font-size: 13px; font-weight: 600; }
.person-tile small { font-size: 12px; color: var(--muted); }
.person-map-wrap { margin-bottom: 14px; }
.planes-map.person-map { height: 380px; }
.person-map-note { margin: 6px 0 0; }
.person-flights { margin: 0; padding: 0; list-style: none; }
.flight { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; grid-template-areas: "when route co2" "when facts co2" "when src src"; column-gap: 16px; row-gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.flight.on { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.flight.flying .flight-route { color: var(--live); }
.flight-when { grid-area: when; display: flex; flex-direction: column; color: var(--muted); font-variant-numeric: tabular-nums; }
.flight-when time { color: var(--text); font-weight: 600; }
.flight-who { display: inline-flex; align-items: center; margin-top: 4px; }
.flight-route { grid-area: route; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 16px; }
.flight-end { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.flight-end b { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.flight-end.unknown { color: var(--muted); font-style: italic; }
.flight-end small { color: var(--muted); font-size: 12px; }
.flight-arrow { color: var(--muted); }
.flight-facts { grid-area: facts; color: var(--muted); }
.flight-co2 { grid-area: co2; text-align: right; white-space: nowrap; }
.flight-co2 b { font-size: 17px; font-variant-numeric: tabular-nums; }
.flight-co2 small { display: block; color: var(--muted); font-size: 12px; }
.flight-src { grid-area: src; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; margin-top: 4px; }
.flight-links { display: inline-flex; flex-wrap: wrap; gap: 10px; }
.flight-links a, .flight-links .linkish { font-size: 13px; }
.flight-links .linkish:disabled { text-decoration: none; color: var(--muted); cursor: default; }
.person-aircraft-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.person-aircraft-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.person-aircraft-card h3 { margin: 0 0 2px; font-size: 18px; display: flex; align-items: center; }
.person-aircraft-type { margin: 0 0 6px; font-size: 14px; }
.person-aircraft-links { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; margin: 8px 0 0; }
.person-method p { font-size: 14px; }
@media (max-width: 700px) {
  .person-head { gap: 14px; }
  .person-head .person-face { --size: 84px !important; }
  .person-head h1 { font-size: 24px; }
  .flight { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when co2" "route route" "facts facts" "src src"; }
  .flight-when { flex-direction: row; flex-wrap: wrap; gap: 0 8px; }
  .planes-map.person-map { height: 300px; }
}
/* The Alerts page: people and whose aircraft each is (public/planes.js planeAlerts). */
.plane-people-admin .plane-person-row { display: flex; align-items: center; gap: 12px; }
.plane-person-text { flex: 1; min-width: 0; }
.plane-person-tools { display: inline-flex; gap: 6px; flex: none; }
.plane-person-edit { margin: 8px 0 4px; }
.plane-whose { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 14px; }
.plane-whose label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.plane-whose .input, .input.input-short { padding: 4px 8px; font-size: 13px; }
.input.input-short { width: 7em; flex: 0 0 auto !important; }
/* A person's page on a wide screen: the profile column (who, where now, the numbers, the aircraft) beside the map and the flights. */
.planes-person { max-width: none; }
.person-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.person-side { position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow: auto; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.person-side > * { margin: 0 !important; }
.person-side .person-head { margin: 4px 0 0 !important; gap: 14px; align-items: flex-start; }
.person-side .person-head h1 { font-size: 24px; }
.person-side .person-head .person-blurb { font-size: 14px; }
.person-side .panel h2, .person-side .person-stats-box h2 { font-size: 16px; }
.person-side .person-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.person-side .person-tile { padding: 10px 12px 8px; }
.person-side .person-tile b { font-size: 22px; }
.person-side .person-aircraft-cards { grid-template-columns: 1fr; }
.person-side .person-where { font-size: 14px; }
.person-method summary { cursor: pointer; font-weight: 700; font-size: 16px; }
.person-method[open] summary { margin-bottom: 6px; }
.person-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.person-main .panel { margin: 0; }
.person-map-wrap { margin: 0; }
.person-main .planes-map.person-map { height: min(56vh, 620px); }
.person-map-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 6px; }
.person-map-bar .person-map-note { margin: 0; }
/* The jet itself, where it is right now: pulses in its colour. */
.planes-icon.person-live-icon span { width: 26px; height: 26px; }
.planes-icon.person-live-icon svg { stroke-width: 1.5; filter: drop-shadow(0 0 2px currentColor); animation: person-live 1.4s ease-in-out infinite alternate; }
@keyframes person-live { from { filter: drop-shadow(0 0 1px currentColor); transform: scale(1); } to { filter: drop-shadow(0 0 9px currentColor); transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .planes-icon.person-live-icon svg { animation: none; } }
@media (max-width: 1100px) {
  .person-layout { grid-template-columns: 1fr; }
  .person-side { position: static; max-height: none; overflow: visible; }
  .person-side .person-head { align-items: center; }
  .person-side .person-tiles { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .person-main .planes-map.person-map { height: 380px; }
}
@media (max-width: 700px) { .person-main .planes-map.person-map { height: 300px; } }

/* /saved: saved posts (public/saved.js). The form, then a list like the recordings' with a square picture. */
.saved-form { margin: 16px 0; display: grid; gap: 8px; }
.saved-form-label { font-weight: 600; font-size: 14px; }
.saved-form-row { display: flex; gap: 8px; align-items: center; }
.saved-form-row .input { flex: 1; min-width: 0; }
.saved-form-row .btn { flex: none; white-space: nowrap; }
.saved-keep { margin: 4px 0 0; align-items: flex-start; font-weight: 600; }
.saved-keep input { margin-top: 3px; }
.saved-keep small { font-weight: 400; }
.saved-form .msg { margin: 0; }
/* What the Save to Captionator bookmark handed over (save-bookmarklet.js), to confirm: a strip of its files. */
.saved-handoff { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--accent); border-radius: 10px; }
.saved-handoff-head, .saved-handoff-facts { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.saved-handoff-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.saved-handoff-strip img, .saved-handoff-strip span { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.saved-handoff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
/* The bookmark and how to install it, folded away under the form. */
.saved-bookmark { font-size: 14px; }
.saved-bookmark summary { cursor: pointer; font-weight: 600; }
.saved-bookmark p { margin: 8px 0; font-size: 13px; }
.saved-bookmark ol { margin: 8px 0 0 18px; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.saved-bookmark-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saved-bookmark-link { cursor: grab; }
.saved-bookmark .saved-bookmark-head { margin: 14px 0 0; font-size: 13px; font-weight: 600; }
/* The bookmark's demo (saved.js bookmarkDemo): a browser drawn in CSS, every part on one 12s loop.
   Positions are percentages of the stage, so it scales with the width. The plain styles are the
   still shown with reduced motion: the bookmark in the bar. */
.bm-demo { margin: 12px 0 4px; max-width: 480px; container-type: inline-size; }
.bm-stage {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 2.6cqw; line-height: 1.2;
}
.bm-stage > * { position: absolute; }
.bm-chrome { inset: 0 0 auto; height: 12%; display: flex; align-items: center; gap: 3%; padding: 0 3%; background: var(--bg); }
.bm-dots { display: flex; gap: 0.5em; }
.bm-dots i { width: 0.8em; height: 0.8em; border-radius: 50%; background: var(--stale); }
.bm-url { position: relative; flex: 1; height: 62%; border-radius: 1em; background: var(--surface); color: var(--muted); }
.bm-url > span { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 1em; white-space: nowrap; overflow: hidden; }
.bm-url-b { opacity: 0; }
.bm-bar { inset: 12% 0 auto; height: 12%; display: flex; align-items: center; padding: 0 3%; border-bottom: 1px solid var(--line); background: var(--bg); outline: 2px solid transparent; outline-offset: -3px; }
.bm-bar-hint { color: var(--stale); margin-left: auto; }
.bm-chip { position: absolute; left: 3%; top: 16%; height: 68%; display: flex; align-items: center; padding: 0 0.8em; border-radius: 0.4em; background: var(--surface); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.bm-chip::before { content: "🔖"; margin-right: 0.4em; }
.bm-scene { inset: 30% 5% 6%; display: flex; flex-direction: column; gap: 0.7em; opacity: 0; }
.bm-scene-a { opacity: 1; }
.bm-scene-a i { display: block; height: 0.7em; border-radius: 0.35em; background: var(--line); }
.bm-scene-a i:last-child { width: 70%; }
.bm-btn, .bm-ghost, .bm-save {
  display: flex; align-items: center; justify-content: center; border-radius: 2em; white-space: nowrap;
  background: var(--text); color: var(--surface); font-weight: 600;
}
.bm-btn, .bm-ghost { left: 6%; top: 62%; width: 32%; height: 12%; }
.bm-ghost { opacity: 0; box-shadow: 0 0.4em 1.2em rgb(0 0 0 / 0.25); }
.bm-scene-b { flex-direction: row; align-items: center; gap: 4%; }
.bm-avatar { flex: none; width: 5em; height: 5em; border-radius: 50%; background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); }
.bm-grid { margin-left: auto; display: grid; grid-template-columns: repeat(3, 4.4em); gap: 0.3em; }
.bm-grid i, .bm-thumbs i { display: block; aspect-ratio: 1; border-radius: 0.3em; background: linear-gradient(160deg, var(--accent-soft), var(--accent)); }
.bm-grid i:nth-child(even), .bm-thumbs i:nth-child(2) { background: linear-gradient(160deg, var(--line), var(--muted)); }
.bm-scene-c { padding: 3%; border: 1px solid var(--line); border-radius: 0.6em; background: var(--bg); }
.bm-thumbs { display: flex; gap: 0.4em; }
.bm-thumbs i { width: 3.6em; }
.bm-save { align-self: flex-start; padding: 0.5em 1.2em; }
.bm-cursor { left: 19%; top: 18%; width: 1.4em; transform-origin: 0 0; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.3)); }
.bm-cursor path { fill: #111; stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; }
.bm-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bm-caps { flex: 1; display: grid; font-size: 13px; font-weight: 600; }
.bm-cap { grid-area: 1 / 1; opacity: 0; }
.bm-cap-1 { opacity: 1; }
.bm-foot .bm-pause { padding: 4px 10px; font-size: 12px; min-height: 0; }
@media (prefers-reduced-motion: no-preference) {
  .bm-stage *, .bm-cap { animation: 12s linear infinite; }
  .bm-demo.paused .bm-stage *, .bm-demo.paused .bm-cap { animation-play-state: paused; }
  .bm-cursor { animation-name: bm-cursor; animation-timing-function: ease-in-out; }
  .bm-ghost { animation-name: bm-ghost; animation-timing-function: ease-in-out; }
  .bm-chip { animation-name: bm-chip; }
  .bm-bar { animation-name: bm-bar; }
  .bm-scene-a, .bm-btn { animation-name: bm-scene-a; }
  .bm-scene-b, .bm-url-b { animation-name: bm-scene-b; }
  .bm-url-a { animation-name: bm-url-a; }
  .bm-scene-c { animation-name: bm-scene-c; }
  .bm-cap-1 { animation-name: bm-scene-a; }
  .bm-cap-2 { animation-name: bm-scene-b; }
  .bm-cap-3 { animation-name: bm-scene-c; }
}
@media (prefers-reduced-motion: reduce) { .bm-pause { display: none; } }
@keyframes bm-cursor {
  0%, 8% { left: 80%; top: 90%; transform: scale(1); }
  20% { left: 22%; top: 68%; transform: scale(1); }
  21%, 23% { left: 22%; top: 68%; transform: scale(0.85); }
  40%, 43% { left: 19%; top: 18%; transform: scale(0.85); }
  45%, 52% { left: 19%; top: 18%; transform: scale(1); }
  60% { left: 15%; top: 18%; transform: scale(1); }
  62% { left: 15%; top: 18%; transform: scale(0.85); }
  64% { left: 15%; top: 18%; transform: scale(1); }
  76% { left: 66%; top: 62%; transform: scale(1); }
  100% { left: 80%; top: 90%; transform: scale(1); }
}
@keyframes bm-ghost {
  0%, 22% { left: 6%; top: 62%; opacity: 0; }
  23% { left: 6%; top: 62%; opacity: 0.92; }
  40% { left: 3%; top: 12%; opacity: 0.92; }
  43%, 100% { left: 3%; top: 12%; opacity: 0; }
}
@keyframes bm-chip {
  0%, 41% { opacity: 0; transform: scale(0.9); background: var(--surface); }
  43% { opacity: 1; transform: scale(1); }
  61% { background: var(--surface); }
  62%, 64% { background: var(--accent-soft); }
  66%, 95% { opacity: 1; background: var(--surface); }
  98%, 100% { opacity: 0; }
}
@keyframes bm-bar {
  0%, 30% { outline-color: transparent; }
  34%, 41% { outline-color: var(--accent); }
  44%, 100% { outline-color: transparent; }
}
@keyframes bm-scene-a {
  0%, 47% { opacity: 1; }
  49%, 97% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes bm-scene-b {
  0%, 47% { opacity: 0; }
  49%, 66% { opacity: 1; }
  68%, 100% { opacity: 0; }
}
@keyframes bm-url-a {
  0%, 47% { opacity: 1; }
  49%, 66% { opacity: 0; }
  68%, 100% { opacity: 1; }
}
@keyframes bm-scene-c {
  0%, 66% { opacity: 0; }
  68%, 95% { opacity: 1; }
  98%, 100% { opacity: 0; }
}
/* The sites it downloads from, under the address box: each mark and its name. */
.saved-sites { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; }
.saved-site { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.saved-site-mark { display: inline-flex; }
.saved-site-mark svg { display: block; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.saved-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; }
.saved-thumb {
  position: relative; flex: none; width: 112px; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: color-mix(in srgb, var(--muted) 35%, var(--bg)); display: grid; place-items: center; text-decoration: none;
}
.saved-thumb img, .saved-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.saved-thumb-mark { color: rgba(255, 255, 255, 0.9); font-size: 24px; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.saved-thumb img ~ .saved-thumb-mark, .saved-thumb video ~ .saved-thumb-mark { display: none; }
.saved-item.is-active .saved-thumb-mark { animation: rec-blink 1.4s ease-in-out infinite; }
.saved-item.is-failed .saved-thumb { background: color-mix(in srgb, #d63b2f 55%, var(--bg)); }
.saved-body { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.saved-head { display: flex; align-items: center; gap: 8px; }
.saved-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.saved-facts, .saved-meta, .saved-status { margin: 0; font-size: 13px; }
.saved-desc { margin: 0; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.saved-desc-wrap { display: grid; justify-items: start; gap: 4px; }
.saved-desc-more { font-size: 13px; color: var(--muted); text-decoration: none; cursor: pointer; }
.saved-desc-more:hover { color: var(--text); text-decoration: underline; }
.saved-status.is-failed { color: #d63b2f; }
.saved-progress { grid-template-columns: 1fr auto; margin: 2px 0; }
.saved-ready { display: grid; gap: 6px; }
.saved-files { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
/* Topping and tailing a video or sound (trim.js): the player over the handles. */
/* A download's clips (several, each named or shown by its times), under its files. */
.saved-clips { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.saved-clip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.saved-clip > .inline-ask { flex-basis: 100%; padding-left: 26px; }
/* While a clip is being renamed or asked about, its own buttons step aside. */
.saved-clip:has(> .inline-ask) .saved-clip-buttons, .saved-clip:has(.inline-edit) .saved-clip-buttons { display: none; }
.saved-clip-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.saved-clip-name { font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-clip-name:hover { text-decoration: underline; }
.saved-clip-text small { font-size: 12px; }
.saved-clip-buttons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.saved-clip-buttons .btn { font-size: 13px; padding: 4px 10px; }
@media (max-width: 600px) { .saved-clip { flex-wrap: wrap; } .saved-clip-buttons { width: 100%; } }
.rec-trim-name { width: 100%; margin-top: 8px; font-size: 14px; }
.saved-clip-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.saved-clip-actions .btn { font-size: 13px; padding: 4px 10px; }
.saved-trim { display: grid; gap: 8px; }
/* Sharing a download (saved.js): the Share form under it, who it's shared with, and what's shared with you above the list. */
.saved-share { display: grid; gap: 8px; }
.saved-share-form { display: grid; gap: 8px; }
.saved-share-form textarea { resize: vertical; min-height: 2.6em; }
.saved-share-form .muted { margin: 0; font-size: 13px; }
.saved-shared-with { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.saved-shared-with li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saved-shared-with .btn { font-size: 12px; padding: 2px 8px; }
.saved-invites { display: grid; gap: 8px; margin-bottom: 16px; }
.saved-invites-head { margin: 0; font-size: 15px; }
.saved-invite { border: 1px solid var(--accent); }
.saved-invite-from { margin: 0; font-size: 13px; }
.saved-invite-note { margin: 0; white-space: pre-wrap; padding: 8px 12px; border-radius: 8px; background: var(--panel-2, rgba(127, 127, 127, 0.08)); }
.saved-invite-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.saved-trim .rec-trim { margin: 0; }
.saved-trim-media { width: 100%; border-radius: 8px; }
video.saved-trim-media { max-height: 360px; background: #000; }
@media (max-width: 600px) {
  .saved-item { gap: 10px; padding: 10px; }
  .saved-thumb { width: 80px; }
  .saved-form-row { flex-wrap: wrap; }
  .saved-form-row .btn { width: 100%; }
}
/* Folders: the tree beside the downloader's downloads (its stashes) and Your recordings (public/folders.js). */
/* One grid laid out by area: the tree down the left beside the form (the downloader's), heading and list; on a phone, stacked in that order. */
.folder-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "tree head" "tree list";
  column-gap: 16px; row-gap: 8px; align-items: start; margin-top: 16px;
}
.folder-layout.has-form { grid-template-areas: "tree form" "tree head" "tree list"; }
.folder-layout > .saved-form { grid-area: form; margin: 0; }
.folder-layout > .folder-tree { grid-area: tree; }
.folder-layout > .folder-heading-row { grid-area: head; }
.folder-layout > .folder-items { grid-area: list; min-width: 0; }
.folder-tree { padding: 10px; position: sticky; top: 80px; }
.folder-tree-head { margin: 2px 6px 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.folder-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.folder-node {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 1px solid transparent; background: none; color: var(--text);
  border-radius: 8px; padding: 6px 8px 6px calc(8px + var(--depth, 0) * 14px); font: inherit; font-size: 14px; cursor: pointer;
}
.folder-node:hover { background: var(--bg); }
.folder-node.is-selected { background: var(--accent-soft); font-weight: 600; }
.folder-node.is-over { border-color: var(--accent); background: var(--accent-soft); }
.folder-node-icon { flex: none; width: 14px; color: var(--muted); font-size: 12px; text-align: center; }
.folder-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-node-count { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.folder-new { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.folder-new-row { display: flex; gap: 8px; align-items: center; }
.folder-new-row .input { flex: 1; min-width: 0; font-size: 14px; padding: 6px 10px; }
.folder-new-row .btn { flex: none; white-space: nowrap; }
.saved-stash-row { align-items: center; }
.saved-stash-row .saved-form-label { flex: none; }
.saved-stash-pick { width: auto; min-width: 200px; font-size: 14px; padding: 6px 10px; }
/* Tall enough for Rename and Delete, so the list doesn't shift when a folder is opened. */
.folder-heading-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; }
.folder-heading-row > .inline-ask { flex-basis: 100%; }
.folder-heading-row:has(> .inline-ask, > .inline-edit) .folder-heading-actions { display: none; }
.folder-heading { margin: 0; flex: 1; min-width: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-heading-actions { display: flex; gap: 6px; }
/* The grip down a card's left edge that drags it onto a folder (folders.js draggable): only it drags, so the card's text can be selected. Two columns of dots; not shown to touch, which moves with "Move to…". */
.folder-grip { display: none; }
@media (pointer: fine) {
  .folder-items li.has-grip { position: relative; padding-left: 28px; }
  .folder-grip {
    display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 22px; cursor: grab; border-radius: 8px 0 0 8px;
    background:
      radial-gradient(circle, var(--muted) 1.3px, transparent 1.8px) 6px 50% / 5px 5px repeat-y,
      radial-gradient(circle, var(--muted) 1.3px, transparent 1.8px) 11px 50% / 5px 5px repeat-y;
    background-clip: content-box; padding: 12px 0; opacity: 0.5;
  }
  .folder-grip:hover { opacity: 1; background-color: var(--accent-soft); }
  .folder-grip:active { cursor: grabbing; }
}
.folder-items li.is-dragging { opacity: 0.45; transition: opacity 0.2s; }
/* The chip that follows the pointer while something is dragged onto a folder (folders.js setDragImage): rendered off screen, copied by the browser. */
.folder-drag-ghost {
  position: fixed; top: 0; left: -9999px; display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 10px;
  border: 1px solid var(--accent); border-radius: 10px; background: var(--surface); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font-size: 13px; font-weight: 600; pointer-events: none;
}
.folder-drag-ghost img { flex: none; width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.folder-drag-ghost span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-move { width: auto; max-width: 160px; font-size: 12px; padding: 3px 6px; flex: none; }
.folder-tag { cursor: pointer; background: none; font: inherit; font-size: 12px; font-weight: 600; }
.folder-tag:hover { color: var(--accent); }
@media (max-width: 760px) {
  .folder-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tree" "head" "list"; }
  .folder-layout.has-form { grid-template-areas: "form" "tree" "head" "list"; }
  .folder-tree { position: static; }
}

/* Podcasts (public/podcasts.js): shows, episodes, and an episode's transcript under its player. */
.pod-shows, .pod-episodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pod-shows { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.pod-show { display: flex; gap: 14px; align-items: center; color: inherit; text-decoration: none; }
.pod-show:hover, .pod-episode:hover { border-color: var(--accent); }
.pod-show-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pod-art { width: 72px; height: 72px; flex: none; border-radius: 8px; object-fit: cover; background: var(--accent-soft); }
.pod-art.big { width: 120px; height: 120px; }
.pod-art-none { display: grid; place-items: center; font-size: 28px; }
.pod-about { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.pod-about p { margin: 0 0 8px; }
.pod-episode { display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none; padding: 12px 16px; }
.pod-ep-when { font-size: 13px; }
.pod-add, .pod-manage { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.pod-add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pod-add-row input[type="url"] { flex: 1 1 320px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.pod-why { flex: 1 1 200px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.pod-suggestions { margin-top: 18px; }
.pod-suggestion { display: flex; gap: 14px; align-items: flex-start; }
.pod-suggestion .pod-show-text small:not(.err) { overflow-wrap: anywhere; }
.pod-suggestion .pod-add-row { margin-top: 6px; }
.pod-keep { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.pod-view { max-width: 820px; display: flex; flex-direction: column; gap: 12px; }
.pod-head { display: flex; gap: 14px; align-items: center; }
.pod-head .pod-art { width: 64px; height: 64px; }
/* The episode's player: a row of the bottom status bar, like the radio's (.player). */
.pod-bar .player-label { max-width: 30%; }
.pod-bar.in-ad .player-label { font-size: 0; }
.pod-bar.in-ad .player-label::after { content: "Ad break: the words carry on after it"; font-size: 12px; }
.pod-desc summary { cursor: pointer; color: var(--muted); }
.pod-desc p { margin: 6px 0; }
.pod-source { margin: 0; font-size: 13px; }
.pod-transcript { font-size: var(--size, 20px); line-height: 1.55; }
.pod-para { margin: 0 0 12px; }
.pod-para.turn { margin-top: 20px; }
.pod-stamp { margin-right: 6px; padding: 0 4px; border: 0; border-radius: 4px; background: none; color: var(--muted); font: 12px var(--mono, monospace); cursor: pointer; vertical-align: 1px; }
.pod-stamp:hover { background: var(--accent-soft); color: var(--text); }
.pod-speaker { margin-right: 4px; font-size: 14px; }
.pod-line { cursor: pointer; border-radius: 3px; }
.pod-line:hover { background: var(--accent-soft); }
.pod-line.is-found { background: var(--accent-soft); outline: 1px solid var(--accent); }
.pod-line.is-now { background: var(--accent-soft); box-shadow: 0 2px 0 var(--accent); }
/* Search: channels the search names, to watch live (public/channel-match.js). */
.watch-hits { flex-basis: 100%; margin-bottom: 6px; }
.watch-hits-title { margin: 0 0 8px; font-size: 16px; }
.watch-hits-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.watch-hit { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); text-decoration: none; color: inherit; }
.watch-hit:hover { background: var(--surface); }
.watch-hit > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.watch-hit small { color: var(--muted); font-size: 12px; }
.watch-hit-go { color: var(--accent); font-weight: 700; }
.watch-hit .pip { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--stale); }
.watch-hit.live .pip { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.watch-hit.paused .pip { background: var(--paused); }
/* Search: shows the search names, with their episodes (GET /api/programs). */
.show-hits { flex-basis: 100%; display: grid; gap: 10px; margin-bottom: 6px; }
.show-hits[hidden] { display: none; }
.show-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.show-card .watch-hits-title small { font-weight: 400; color: var(--muted); font-size: 14px; }
.show-next { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.show-eps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.show-ep b { margin-right: 6px; }
.show-ep { display: inline-block; white-space: nowrap; padding: 5px 11px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft); font-size: 13px; text-decoration: none; color: inherit; }
.show-ep[hidden] { display: none; }
.show-ep:hover { background: var(--bg); }
button.show-ep.more { font: inherit; font-size: 13px; cursor: pointer; border-color: var(--line); background: none; }
.show-guide { display: inline-block; margin-top: 10px; font-size: 13px; }
.pod-hits { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.pod-hits-title { display: flex; gap: 12px; align-items: baseline; margin: 0; font-size: 16px; }
.pod-hits-title a { font-size: 14px; font-weight: 400; }
@media (max-width: 560px) {
  .pod-head .pod-art { width: 44px; height: 44px; }
  .pod-bar .player-label { max-width: none; }
  .pod-about { flex-direction: column; }
}

/* /events: the AFR events calendar (public/events.js) */
.events { max-width: 860px; }
.events-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 10px; }
.events-bar input[type="search"] { flex: 1 1 220px; width: auto; }
.events-city { width: auto; flex: 0 1 180px; }
.events-past { margin: 0; }
.events-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.events-count { margin: 10px 0 0; }
.events-month { margin: 26px 0 6px; }
.events-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 10px; }
.events-row:hover { background: var(--surface); }
.events-row.is-on { background: var(--accent-soft); }
.events-date { flex: none; width: 48px; display: grid; justify-items: center; line-height: 1.1; padding-top: 2px; }
.events-date b { font-size: 22px; font-weight: 700; }
.events-date span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.events-text { display: grid; gap: 3px; min-width: 0; flex: 1; }
.events-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.events-cat { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--cat, var(--accent)); }
.events-now { font-weight: 700; color: var(--live); }
.events-title { font-size: 17px; font-weight: 650; line-height: 1.3; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
a.events-title:hover { text-decoration: underline; }
.events-where { font-size: 14px; color: var(--muted); }
.events-notes { font-size: 14px; line-height: 1.45; }
.events-actions { flex: none; display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.events-row:hover .events-actions, .events-row:focus-within .events-actions { opacity: 1; }
.cat-economy { --cat: #1c7ed6; }
.cat-politics { --cat: #7048e8; }
.cat-markets { --cat: #2b8a3e; }
.cat-conferences { --cat: var(--accent); }
.cat-international { --cat: #c2255c; }
@media (prefers-color-scheme: dark) {
  .cat-economy { --cat: #4dabf7; }
  .cat-politics { --cat: #9775fa; }
  .cat-markets { --cat: #51cf66; }
  .cat-international { --cat: #f06595; }
}
.events-chip:not([aria-current]) span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cat, transparent); margin-right: 6px; vertical-align: 1px; }
.events-chip.cat-all span::before { display: none; }
.events-form { margin: 12px 0; }
.events-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.events-wide { grid-column: 1 / -1; }
.events-form-actions { display: flex; gap: 8px; }
.events-source { font-size: 12px; color: var(--muted); }
.events-source a { color: inherit; }
.events-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.events-swept { flex: 1 1 320px; margin: 0; font-size: 13px; }
/* The calendar view */
.cal-bar { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; }
.cal-title { margin: 0 6px; min-width: 9.5em; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 0 4px 2px; }
.cal-day {
  display: flex; flex-direction: column; gap: 2px; align-items: stretch; min-height: 92px; min-width: 0; padding: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.cal-day:hover { background: var(--surface); }
.cal-day b { font-size: 13px; font-weight: 650; padding: 0 2px; }
.cal-day.is-past { opacity: 0.6; }
.cal-day.is-today b { color: var(--live); }
.cal-day.is-today { border-color: var(--live); }
.cal-day[aria-current] { box-shadow: 0 0 0 2px var(--accent); }
.cal-chip {
  display: block; font-size: 11px; line-height: 1.3; padding: 1px 4px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: color-mix(in srgb, var(--cat, var(--accent)) 14%, transparent); border-left: 3px solid var(--cat, var(--accent));
}
.cal-more { font-size: 11px; color: var(--muted); padding: 0 4px; }
.cal-detail { margin-top: 6px; }
@media (max-width: 560px) {
  .cal-grid { gap: 2px; }
  .cal-day { min-height: 54px; padding: 3px 2px; align-items: center; }
  .cal-chip { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--cat, var(--accent)); display: inline-block; }
  .cal-more { font-size: 10px; padding: 0; }
  .cal-head { padding: 0; text-align: center; }
}
@media (max-width: 560px) {
  .events-row { padding: 10px 0; gap: 10px; }
  .events-date { width: 40px; }
  .events-title { font-size: 15px; }
  .events-row { flex-wrap: wrap; }
  .events-actions { opacity: 1; flex-basis: 100%; padding-left: 50px; }
  .events-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: none) {
  .events-row { flex-wrap: wrap; }
  .events-actions { opacity: 1; flex-basis: 100%; padding-left: 62px; }
}

/* The staging copy of the site says so across the top (src/staging.ts). */
.staging-banner { position: sticky; top: 0; z-index: 10000; padding: 4px 12px; background: #fde68a; color: #1b1b1a; font: 600 13px/1.4 system-ui, sans-serif; text-align: center; }


/* Questions, names and errors asked on the page instead of in browser pop-ups (inline-ask.js). */
.inline-ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inline-ask-text { font-size: 13px; }
.inline-ask-text.is-error { color: #d63b2f; }
.inline-ask .btn, .inline-edit .btn { font-size: 13px; padding: 4px 10px; }
.inline-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; min-width: 0; margin: 0; }
.inline-edit .input { flex: 1; min-width: 160px; font-size: 14px; padding: 4px 8px; }
.inline-flash { display: block; margin-top: 4px; }
/* Trim's "trim the rest?" takes the place of the panel's buttons while it asks. */
.rec-trim-actions > .inline-ask { flex: 1; }
.rec-trim-actions:has(> .inline-ask) > :not(.inline-ask) { display: none; }

/* The account page's API section (public/account.js apiPanel). */
.api-panel h4 { margin: 18px 0 6px; font-size: 15px; }
.api-keys { list-style: none; margin: 0 0 10px; padding: 0; }
.api-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.api-key > span:first-child { flex: 1 1 auto; }
.api-key code, .api-code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-new-key .input { flex: 1 1 220px; }
.api-made { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.api-made .input { flex: 1 1 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-docs { margin-top: 16px; }
.api-docs summary { cursor: pointer; font-weight: 600; }
.api-code { margin: 6px 0 10px; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; line-height: 1.45; white-space: pre; }

/* The admin dashboard's API tab (public/account.js apiTab). */
.admin-api-keys { display: flex; flex-direction: column; gap: 6px; }
.admin-api-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.admin-api-key code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* /api-docs (public/account.js apiDocsView). */
.api-doc h2 { margin-top: 28px; scroll-margin-top: 90px; }
.api-doc h3 { margin: 18px 0 6px; }
.api-contents { margin: 12px 0 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.api-contents ul { margin: 6px 0 0; padding-left: 18px; columns: 2; }
.api-params { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 14px; }
.api-params th, .api-params td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.api-params td:first-child { white-space: nowrap; }
.api-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
@media (max-width: 560px) { .api-contents ul { columns: 1; } }
.admin-api-allowed { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }

/* A stat tile that opens another admin tab (the Subscribers tab's API tile). */
.stat-link { color: inherit; text-decoration: none; }
.stat-link:hover { border-color: var(--accent); }
.webhook-secret code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
