/* Bites Console — server-rendered, no framework.
   Spacing floors (SPACING-CONTRACT.md): 32px between cards, 32/24px card
   padding, 16px title-to-content, 16px between label/value rows, 12px
   icon/control-to-text, 20px grid gaps. Mobile keeps every floor and only
   drops horizontal card padding to 20px. */

:root {
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --ink: #16181d;
  --ink-muted: #5c6270;
  --line: #dfe3ea;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  --accent: #1c6ee0;
  --accent-soft: #eaf2fd;
  --danger: #b3261e;
  --warn-line: #d9a441;
  --warn-soft: #fdf4e3;
  --warn-ink: #8a5a00;
  --radius: 12px;

  /* Retention tiers. Each pair clears WCAG AA (>=4.5:1) on its own background,
     and the chip always carries the number too — colour is reinforcement, never
     the only thing saying "this one is worth your time". */
  --hot-soft: #dff3e4;   /* #14532d on #dff3e4 = 9.1:1 */
  --hot-ink: #14532d;
  --hot-line: #7cc496;
  --solid-soft: #fdf1d8; /* #7a4f04 on #fdf1d8 = 6.4:1 */
  --solid-ink: #7a4f04;
  --solid-line: #e0b768;
  --meh-soft: #eceff4;   /* #4a5160 on #eceff4 = 7.2:1 */
  --meh-ink: #4a5160;
  --meh-line: #c9cfda;
  --done-soft: #e6f0fb;
  --done-ink: #12447f;
  --done-line: #8ab4e8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f6;
    --ink-muted: #a2aab9;
    --line: #2c313b;
    --surface: #191c22;
    --canvas: #101318;
    --accent: #6ea8fe;
    --accent-soft: #1d2733;
    --danger: #f2867e;
    --warn-line: #7a5c1f;
    --warn-soft: #2a2113;
    --warn-ink: #f0c46a;

    --hot-soft: #12301d;   /* #7fe0a3 on #12301d = 8.6:1 */
    --hot-ink: #7fe0a3;
    --hot-line: #2f6b45;
    --solid-soft: #2e2411; /* #f0c46a on #2e2411 = 8.8:1 */
    --solid-ink: #f0c46a;
    --solid-line: #6b5320;
    --meh-soft: #222730;   /* #b3bcca on #222730 = 7.4:1 */
    --meh-ink: #b3bcca;
    --meh-line: #39404d;
    --done-soft: #16283d;
    --done-ink: #9dc7ff;
    --done-line: #34537d;
  }
}

* { box-sizing: border-box; }

/* The browser's own `[hidden] { display: none }` is a low-specificity rule, so
   any `.clip { display: flex }` quietly beats it and a "hidden" card keeps
   rendering. The live filter relies on this working, so state it outright. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-8);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.topbar__nav a { color: var(--accent); text-decoration: none; }
.topbar__nav a:hover { text-decoration: underline; }
.topbar__who { color: var(--ink-muted); }

/* ------------------------------------------------------------------ page */

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-8); /* 32px between every card */
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-6);
}

.card--narrow { max-width: 560px; }
.card--highlight { border-color: var(--accent); background: var(--accent-soft); }

.card__title {
  margin: 0 0 var(--space-4); /* 16px title-to-content */
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* A qualifier that rides on a heading without competing with it. */
.card__sub {
  margin-left: var(--space-3);
  font-size: 15px;
  font-weight: 550;
  color: var(--ink-muted);
}

.prose { margin: 0 0 var(--space-4); }
.prose:last-child { margin-bottom: 0; }
/* A section's explainer gets 24px before the content it introduces. */
.card__title + .prose { margin-bottom: var(--space-6); }
.muted { color: var(--ink-muted); }

.notice {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.onetime {
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--canvas);
  overflow-x: auto;
}

.onetime code { font-size: 14px; word-break: break-all; }

/* ------------------------------------------------------------------ rows */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px between label/value rows */
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3); /* 12px label-to-value / icon-to-text */
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.row:last-child { padding-bottom: 0; border-bottom: none; }
.row__label { flex: 1 1 240px; font-weight: 550; color: var(--ink); }
.row__value { color: var(--ink); }

.chip {
  display: inline-block;
  padding: 4px var(--space-3);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.chip--off { background: transparent; color: var(--ink-muted); border: 1px solid var(--line); }
.chip--soft { background: var(--canvas); color: var(--ink-muted); }
.chip--projected { background: transparent; color: var(--ink-muted); border: 1px dashed var(--ink-muted); }
.chip--link { text-decoration: none; }
.chip--link:hover { text-decoration: underline; }

/* "Approved — syncing…" and "👍 in Slack by Lara" both mean the same thing to a
   reader: it is done here, it has not come back from the Mac yet. */
.chip--syncing,
.chip--slack {
  background: var(--warn-soft);
  color: var(--warn-ink);
  border: 1px solid var(--warn-line);
}

/* "Rejected — benched 60 days": it already happened, and it is still takeable back. */
.chip--done {
  background: var(--done-soft);
  color: var(--done-ink);
  border: 1px solid var(--done-line);
}

/* ------------------------------------------------------------- score chips */

.chip--score {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.chip--score-hot { background: var(--hot-soft); color: var(--hot-ink); border-color: var(--hot-line); }
.chip--score-solid { background: var(--solid-soft); color: var(--solid-ink); border-color: var(--solid-line); }
.chip--score-meh { background: var(--meh-soft); color: var(--meh-ink); border-color: var(--meh-line); }

/* ----------------------------------------------------------------- table */

.table { width: 100%; border-collapse: separate; border-spacing: 0; }

.table th,
.table td {
  text-align: left;
  padding: var(--space-4) var(--space-5) var(--space-4) 0; /* 16px vertical, 20px column gap */
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); white-space: nowrap; }

/* Timestamps stay on one line — the table scrolls sideways instead of
   shredding a date into five stacked words on a phone. */
.table .cell-when { white-space: nowrap; }
.table .cell-problem { min-width: 260px; }
.table tr:last-child td { border-bottom: none; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.actions form { margin: 0; }

/* ----------------------------------------------------------------- forms */

.stack { display: flex; flex-direction: column; gap: var(--space-5); align-items: flex-start; }

.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 280px; }
.field__label { font-weight: 550; }

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

input[type="text"],
input[type="datetime-local"] {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

button {
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.06); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }

/* The dark palette's accent is a LIGHT blue, so white-on-accent lands at about
   2.3:1. Filled controls take the canvas colour instead (~8.7:1). */
@media (prefers-color-scheme: dark) {
  button:not(.danger):not(.btn-quiet),
  .toggle--on { color: var(--canvas); }
}

textarea {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  width: 100%;
  resize: vertical;
}

input[type="file"] { font: inherit; color: var(--ink); max-width: 100%; }

select {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

/* Ad slots: position + time side by side, 20px between the pair and between rows. */
/* 24px from the Current row to the form; 24px between slots on desktop, 32px on
   a phone where each slot stacks into two fields 16px apart, so a pair reads as
   one unit. Select and input share one height so their labels line up. */
.ad-slots { margin-top: var(--space-6); gap: var(--space-6); }
.ad-slot { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: flex-start; }
.ad-slot .field { min-width: 200px; }
.ad-slot select, .ad-slot input[type="text"] { height: 48px; box-sizing: border-box; }

/* -------------------------------------------------------------- banners */

.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3); /* 12px icon-to-text */
  margin: 0;
  padding: var(--space-5) var(--space-6); /* 20px / 24px */
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--ink);
}

.banner__icon { font-size: 18px; line-height: 1.45; }

/* ----------------------------------------------------------------- login */

/* The sign-in card is one short column, so every pair gets its own floor:
   8px label-to-input from `.field`, 20px input-to-helper and helper-to-button
   from `.stack`, and 24px around an error banner. Declared after `.banner` so
   its own `margin: 0` cannot win on source order. */
.login-error { margin: var(--space-6) 0; }
.login-hint { margin: 0; max-width: 46ch; }
.card--narrow .stack { width: 100%; }
.card--narrow input[type="text"] { width: 100%; box-sizing: border-box; }

.crumb { margin: 0 0 var(--space-5); } /* 20px above the page title */
.crumb a { color: var(--accent); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.count {
  margin-left: var(--space-3);
  padding: 2px var(--space-3);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
}

/* -------------------------------------------------- publish schedule lane */

/* Day columns: 32px apart, never closer. */
.plan {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8); /* 32px between days */
}

.plan__date {
  margin: 0 0 var(--space-5); /* 20px heading-to-first-slot */
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px between go-lives */
}

.slot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5); /* 20px clock-to-body */
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-4);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

/* A projection is a guess: dashed edge, quieter rail, explicit chip. */
.slot--projected {
  border-style: dashed;
  border-left-color: var(--ink-muted);
  background: transparent;
}

.slot__clock {
  flex: 0 0 auto;
  min-width: 88px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.slot__body {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3); /* 12px title-to-chips-to-meta */
  min-width: 0;
}

.slot__title { color: var(--ink); font-weight: 600; text-decoration: none; }
.slot__title:hover { color: var(--accent); text-decoration: underline; }

.slot__chips { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.slot__meta { color: var(--ink-muted); font-size: 15px; }

/* ------------------------------------------------------- next-7-days strip */

.strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8); /* 32px between days */
}

.strip__day { min-width: 240px; flex: 1 1 240px; }

.strip__date {
  margin: 0 0 var(--space-4); /* 16px heading-to-list */
  font-weight: 650;
}

.strip__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px between go-lives */
}

.strip__item { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: baseline; }
.strip__clock { color: var(--ink-muted); min-width: 80px; }
.strip__item a { color: var(--accent); text-decoration: none; }
.strip__item a:hover { text-decoration: underline; }

/* ------------------------------------------------------------- clip rows */

.clips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8); /* 32px between clips */
}

.clip {
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px between every block inside a clip */
  padding-bottom: var(--space-8); /* 32px above the divider */
  border-bottom: 1px solid var(--line);
}

.clip:last-child { padding-bottom: 0; border-bottom: none; }

.clip__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4); /* 16px title-to-chip, chip-to-chip */
}

.clip__hook {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

/* ---------------------------------------------------- clip fact list */

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px between facts */
}

.fact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5); /* 12px stacked, 20px label-to-value */
  align-items: baseline;
}

.fact__label { flex: 0 0 180px; color: var(--ink-muted); }
.fact__value { flex: 1 1 320px; min-width: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }

/* --------------------------------------------------------- clip links */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8); /* 16px rows, 32px columns */
  align-items: center;
}

.link { color: var(--accent); }
.link-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.link-group__label { color: var(--ink-muted); }

/* ------------------------------------------------------- inline preview */

/* Open by default (the clip IS the thing being judged) but still preload="none",
   so a board of 18 clips downloads no video at all until somebody presses play. */
.preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
}

.preview__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 12px glyph-to-text */
  padding: var(--space-4) var(--space-5); /* 16px / 20px */
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

/* EXACTLY ONE disclosure glyph. Browsers draw their own via ::marker (Firefox,
   Chrome) or ::-webkit-details-marker (older WebKit); both are suppressed and
   replaced with one triangle we control, so no card ever shows two. */
.preview__toggle::-webkit-details-marker { display: none; }
.preview__toggle::marker { content: ""; }
summary::-webkit-details-marker { display: none; }

.preview__toggle::before {
  content: "▶";
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  transition: transform 120ms ease;
}

.preview[open] > .preview__toggle::before { transform: rotate(90deg); }
.preview__toggle:hover { text-decoration: underline; }

.preview__body {
  padding: 0 var(--space-5) var(--space-5); /* 20px around the player */
}

/* ------------------------------------------------- collapsed board section */

/* "Recently rejected" is history, not work: it opens when somebody goes looking. */
.fold > .fold__summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  list-style: none;
}

.fold > .fold__summary::-webkit-details-marker { display: none; }
.fold > .fold__summary::marker { content: ""; }

.fold > .fold__summary::before {
  content: "▶";
  font-size: 12px;
  line-height: 1;
  color: var(--ink-muted);
  transition: transform 120ms ease;
}

.fold[open] > .fold__summary::before { transform: rotate(90deg); }
.card__title--inline { margin: 0; }
.fold__body { padding-top: var(--space-6); } /* 24px summary-to-content */

/* ------------------------------------------------------------ undo window */

.undo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4); /* 16px chip-to-undo-to-countdown */
  margin: 0;
}

.undo__form { margin: 0; }

.btn-quiet {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

.undo__count {
  color: var(--ink-muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------- sort + filter controls */

.controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px between control rows */
  margin-bottom: var(--space-8); /* 32px controls-to-jump-list */
  padding: var(--space-5) var(--space-6); /* 20px / 24px */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
}

.controls__filter,
.controls__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4); /* 16px label-to-control */
  margin: 0;
}

.controls__label {
  flex: 0 0 auto;
  min-width: 56px;
  color: var(--ink-muted);
  font-weight: 550;
}

.controls__filter input[type="search"] {
  flex: 1 1 320px;
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.toggles { display: flex; flex-wrap: wrap; gap: var(--space-3); } /* 12px chip-to-chip */

.toggle {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.toggle:hover { border-color: var(--accent); color: var(--accent); }
.toggle--on { background: var(--accent); border-color: var(--accent); color: #fff; }
.toggle--clear { border-style: dashed; }

/* Same reason as the filled buttons above: the dark accent is a light blue. */
@media (prefers-color-scheme: dark) {
  .toggle--on { color: var(--canvas); }
}

/* ------------------------------------------------------------- jump list */

/* Smooth scroll to a card, landing it clear of the sticky-ish top of the page. */
html { scroll-behavior: smooth; }
.clip { scroll-margin-top: var(--space-6); }

.toc {
  margin-bottom: var(--space-8); /* 32px jump-list-to-first-card */
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toc__head { margin: 0 0 var(--space-4); font-weight: 650; } /* 16px head-to-list */

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px between jump rows */
}

.toc__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4); /* 16px title-to-score */
}

.toc__link { color: var(--accent); text-decoration: none; }
.toc__link:hover { text-decoration: underline; }

/* A muted second line under a fact's headline value — the raw policy verdict
   sits here, so the plain-language outcome is what gets read first. */
.fact__note { display: block; margin-top: var(--space-2); font-size: 14px; }

/* ------------------------------------------------------- customize link */

/* Where a decided clip's copy gets changed. Deliberately loud: the complaint
   that produced it was "I approved one and can't find where to edit it". */
.customize {
  margin: 0;
  padding-top: var(--space-4);  /* 16px above the link, whatever it follows */
}

.customize__link {
  display: inline-block;
  padding: var(--space-3) var(--space-4); /* 12px / 16px around the words */
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.customize__link:hover { text-decoration: underline; }

/* ------------------------------------------------------ decision buttons */

.decide {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4); /* 16px between approve and reject */
  margin: 0;
}

.clip__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.clip__title:hover { color: var(--accent); text-decoration: underline; }
.clip__meta { margin: 0; color: var(--ink-muted); font-size: 15px; }

.surfaces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8); /* 16px rows, 32px columns */
}

.surface { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.surface__label { color: var(--ink-muted); }
.surface a { color: var(--accent); }

.clip__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-5); /* 20px between the two controls */
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3); /* 12px label-to-control */
  margin: 0;
}

.inline-form__label { color: var(--ink-muted); }

.edit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4); /* 16px field-to-button */
  margin: 0;
  width: 100%;
}

/* Inputs earn the card's full width instead of sitting in a stub. */
.edit .field { flex: 1 1 320px; }
.edit input[type="text"] { width: 100%; }

.field--wide { flex: 1 1 100%; min-width: 0; align-self: stretch; }
/* Helper line under an input: 8px below the box (the `.field` gap), smaller type. */
.field__help { font-size: 14px; }
/* The clip page's copy editor: 24px between one field's Save button and the
   next field's label, so each label/box/help/button reads as one unit. */
.stack--copy { gap: var(--space-6); width: 100%; }
/* Each box takes the full card width and its Save button sits 16px under the
   helper line, so boxes line up instead of shrinking around their buttons. */
.stack--copy .edit { flex-direction: column; align-items: flex-start; }
.stack--copy .field { flex: 0 0 auto; width: 100%; }
.stack--copy input[type="text"],
.stack--copy textarea { width: 100%; box-sizing: border-box; }
.stack > .field { align-self: stretch; }

/* ----------------------------------------------------------------- media */

/* `preload="none"` means the browser knows no dimensions until someone presses
   play, and an unsized <video> collapses to 300x150. Reserving 16:9 keeps the
   card from jumping open the moment playback starts. */
.player {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #000;
  margin-bottom: var(--space-5); /* 20px player-to-caption */
  /* The whole picture toggles playback (board.js), so say so with the pointer
     rather than making people find the 24px triangle in the corner. */
  cursor: pointer;
  /* A poster frame is a still of the clip, not a crop of it. */
  object-fit: contain;
}

.thumb {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: var(--space-5);
}

/* -------------------------------------------------------------- comments */

.comments {
  list-style: none;
  margin: 0 0 var(--space-6); /* 24px list-to-form */
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px between comments */
}

.comment {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.comment:last-child { padding-bottom: 0; border-bottom: none; }
.comment__meta { margin: 0 0 var(--space-2); color: var(--ink-muted); font-size: 14px; }
.comment__body { margin: 0; }

/* -------------------------------------------------------------- timeline */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-5);
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px between history entries */
}

.timeline__when { margin: 0 0 var(--space-2); color: var(--ink-muted); font-size: 14px; }
.timeline__what { margin: 0; }

.chip--warn { background: var(--warn-soft); color: var(--warn-ink); }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 480px) {
  .topbar { padding: var(--space-4) var(--space-5); }
  .page { padding: var(--space-6) var(--space-5); gap: var(--space-8); }
  /* Every card keeps the full 24px gutter on a phone (whitespace floor). */
  .card { padding: var(--space-6); }
  .card--narrow { padding: var(--space-6); }
  .table { display: block; overflow-x: auto; }
  .clip__actions { align-items: stretch; gap: var(--space-5); }
  .inline-form { align-items: stretch; }
  .inline-form input[type="datetime-local"],
  .inline-form button,
  .edit button { width: 100%; }
  .field { min-width: 0; width: 100%; }
  .edit input[type="text"] { width: 100%; }
  .ad-slots, .ad-slot { width: 100%; }
  .ad-slots { gap: var(--space-8); }
  .ad-slot { gap: var(--space-4); }
  .ad-slot .field { min-width: 0; width: 100%; }
  .ad-slot select, .ad-slot input[type="text"], .ad-slots button { width: 100%; box-sizing: border-box; }
  .strip { gap: var(--space-6); }

  /* Every floor above survives on a phone; only side-by-side pairs stack.
     Stacked, a label sits 8px above its own value while facts stay 20px apart,
     so each pair still reads as one unit instead of a wall of lines. */
  .facts { gap: var(--space-5); }
  .fact { gap: var(--space-2); }
  .fact__label { flex: 1 1 100%; }
  .fact__value { flex: 1 1 100%; }
  .links { gap: var(--space-4); align-items: flex-start; flex-direction: column; }
  .slot { padding: var(--space-5) var(--space-4); gap: var(--space-3); }
  .slot__clock { flex: 1 1 100%; }
  .decide { gap: var(--space-4); }
  .decide button { flex: 1 1 100%; }
  .clip__head { gap: var(--space-3); }

  /* Controls, jump list and the undo row keep every floor; only side-by-side
     pairs stack, and the two boxes lose the same 4px of side padding the cards do. */
  .controls { padding: var(--space-5); gap: var(--space-5); }
  .controls__filter input[type="search"] { flex: 1 1 100%; }
  .controls__filter button { width: 100%; }
  .controls__label { flex: 1 1 100%; }
  .toc { padding: var(--space-5); }
  .undo { gap: var(--space-4); }
  .undo__form { flex: 1 1 100%; }
  .undo__form .btn-quiet { width: 100%; }
}
