/**
 * The Food Gene — listing.css
 * Version: 3.4 (Site V2) · Teal Kitchen
 *
 * OWNER: Listings agent. Rules for the listing and utility pages only:
 *   · loaded by layouts/site.php on body.page-recipe-index, page-search,
 *     page-saved, page-guide-index, page-watch and page-video;
 *   · added through the template's "head" section by the static pages, the
 *     404, the subscribe and unpublished notices, and linked directly by the
 *     standalone error pages.
 * Shared components — chips, pills, cards and the card grids, panels,
 * pagination, empty states — are in main.css; this file arranges them and adds
 * only what those pages need. Every colour comes from tokens.css (NFR-008).
 *
 * Structure:
 *   1. Listing heads and tabs (CNT-011, CNT-023)
 *   2. Filters (CNT-011)
 *   3. Results bar and results (CNT-011, CNT-025)
 *   4. Search (NAV-003, NFR-020, CNT-025)
 *   5. Saved recipes (CNT-021)
 *   6. Watch & Cook (CNT-023, CNT-010, MED-006)
 *   7. The player window (CNT-023, CNT-026, INT-010)
 *   8. Static pages (CMS-012)
 *   9. 404, notices and error pages (CNT-025, NFR-012)
 *  10. Responsive (BR-007, NFR-010)
 */

/* ═══ 1. Listing heads and tabs (CNT-011, CNT-023) ═══════════════════════ */

.listing-head { margin: 0 0 var(--space-md); }
.listing-head h1 { margin: 0; }
/* The heading takes focus after an in-place update (listing.js); the change of
   content is the cue, so no ring is drawn round a heading. */
.listing-head h1:focus { outline: none; }
.listing-head .kicker { margin-bottom: var(--space-2xs); }
.listing-head__intro {
  max-width: 62ch;
  margin: var(--space-xs) 0 0;
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.listing-tabs .mb-chips { margin-bottom: var(--space-sm); }
/* On a subcategory page the main category's tab stays lit. */
.listing-tabs .mb-chip[aria-current="true"] { background: var(--accent-juniper); color: var(--text-inverse); }

/* A small count inside a tab chip: "Short techniques 8". */
.mb-chip__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.75em;
  height: 1.75em;
  margin-left: var(--space-2xs);
  padding: 0 0.45em;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--accent-sage-strong);
  font-size: var(--size-badge);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* CNT-011: the subcategory row. Outlined pills, one step quieter than the
   category tabs above them, so the two levels read as two levels. */
.subcats { margin: 0 0 var(--space-md); }
.subcats__list { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.subcats__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1.5px var(--border-medium);
  color: var(--accent-juniper);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.subcats__link:hover { background: var(--bg-accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-juniper); color: var(--accent-juniper-hover); }
.subcats__link[aria-current="page"] {
  background: var(--bg-accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent-juniper);
  color: var(--accent-juniper-hover);
}

/* ═══ 2. Filters (CNT-011) ═══════════════════════════════════════════════ */

.filters {
  margin: 0 0 var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-subtle);
}

.filters__label {
  display: block;
  float: none;
  margin: 0 0 var(--space-2xs);
  padding: 0;
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}

.filters__search-row { display: flex; gap: var(--space-2xs); }
.filters__search-row input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding-inline: 20px;
  border-radius: var(--radius-pill);
}
.filters__search-row .btn { flex: none; min-height: 48px; }

/* One group per row, its name at the left: four short rows that each fit on
   one line in the 1000px column. */
.filters__groups {
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-sand);
}
.filters__group { min-width: 0; margin: 0; padding: 0; border: 0; }
.filters__group > .filters__label {
  float: left;
  width: 5.5rem;
  margin: 0;
  padding-top: 15px;   /* centred on the first row of 44px chips */
}
.filters__chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); min-width: 0; }

/* A filter chip is a real radio button or checkbox with the chip drawn on its
   label. The input stays in the page (and in the tab order) but out of sight. */
.filter-chip {
  position: relative;
  display: inline-flex;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
}
.filter-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
/* White chips on the grey panel; the chosen one inverts, as main.css does. */
.filter-chip .mb-chip {
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border-medium);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.filter-chip:hover .mb-chip { background: var(--bg-accent-soft); color: var(--accent-juniper); }
.filter-chip input:checked + .mb-chip {
  background: var(--accent-juniper);
  box-shadow: none;
  color: var(--text-inverse);
}
/* NFR-004 and WCAG 1.4.1: the chosen state is shown by a tick as well as by
   colour. The tick is a mask, so its colour is the chip's text colour. */
.filter-chip input:checked + .mb-chip::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0 6px 0 -4px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%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' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.filter-chip input:focus-visible + .mb-chip { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
/* "Any time", "Any level" and "Newest" are where each group starts. Chosen,
   they take the tint rather than the solid fill, so a page with nothing
   filtered is not a row of solid buttons and a real choice stands out. */
.filter-chip--any input:checked + .mb-chip {
  background: var(--bg-accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-juniper);
  color: var(--accent-juniper-hover);
}

.filters__apply { margin: var(--space-md) 0 0; }

/* ═══ 3. Results bar and results (CNT-011, CNT-025) ═════════════════════ */

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-sm);
  margin: 0 0 var(--space-md);
}
.result-count {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.result-count strong { font-weight: var(--weight-semi); color: var(--accent-juniper); }

.guides-count { margin-bottom: var(--space-md); }

/* Each chosen option, removable in one press. */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); }
.active-filters__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap-target);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-accent-soft);
  color: var(--accent-sage-strong);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-badge);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.active-filters__chip:hover { background: var(--accent-juniper); color: var(--text-inverse); }
.active-filters__clear {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  padding: 0 var(--space-2xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-underline-offset: 0.3em;
}

/* While listing.js fetches the next set, the current one dims (it is still
   readable and still usable). */
.results { margin: 0; transition: opacity var(--transition-smooth); }
[data-listing][aria-busy="true"] .results { opacity: 0.5; }

.empty-state .empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2xs) var(--space-sm);
  max-width: none;
  margin: var(--space-md) 0 0;
}
.empty-state .empty-state__actions .btn,
.empty-state .empty-state__actions .mb-pill { margin: 0; }
.empty-state__browse { margin: var(--space-lg) 0 0; }
.empty-state__chips { justify-content: center; margin: 0; }
.empty-state__chips .mb-chip { background: var(--bg-surface); }
.empty-state__chips .mb-chip:hover { background: var(--bg-accent-soft); }

/* ═══ 4. Search (NAV-003, NFR-020, CNT-025) ═════════════════════════════ */

.search-page__form {
  display: flex;
  gap: var(--space-2xs);
  max-width: var(--width-reading);
  margin: 0 0 var(--space-md);
}
.search-page__form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding-inline: 22px;
  border-radius: var(--radius-pill);
  font-size: var(--text-lg);
}
.search-page__form .btn { flex: none; min-height: 52px; }

/* "4 results: 1 recipe, 3 videos" — each group a jump link. */
.search-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-sm); margin: 0 0 var(--space-lg); }
.search-summary .mb-chips { margin: 0; }

.search-group { margin: 0 0 var(--space-xl); scroll-margin-top: var(--space-lg); }
.search-group .section-head { margin-bottom: var(--space-sm); }
/* The group's count, as a small pill beside its heading. */
.search-group__count {
  display: inline-grid;
  place-items: center;
  min-width: 2.1em;
  height: 2.1em;
  margin-left: var(--space-2xs);
  padding: 0 0.6em;
  border-radius: var(--radius-pill);
  background: var(--bg-accent-soft);
  color: var(--accent-sage-strong);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  letter-spacing: 0;
  vertical-align: 0.35em;
}
.search-group__more { margin: var(--space-md) 0 0; }

/* ═══ 5. Saved recipes (CNT-021) ════════════════════════════════════════ */

.saved-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-sm);
  margin: 0 0 var(--space-md);
}
.saved-bar .btn { margin-left: auto; }

/* A saved recipe that is no longer published: kept, so it can be removed. */
.saved-missing {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-sm);
  aspect-ratio: 3 / 4;
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
}
.saved-missing__title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: var(--weight-semi);
  font-size: var(--size-card);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-title);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
.saved-missing p { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }

/* ═══ 6. Watch & Cook (CNT-023, CNT-010, MED-006) ═══════════════════════ */

/* The type line: "Full recipe · 12:05". */
.watch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0 0 var(--space-xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* The featured film on the deep-teal panel (BR-002, BR-014): the player beside
   its title, the written-recipe button and the chapter list. */
.watch-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  margin: var(--space-sm) 0 var(--space-xl);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-panel-deep);
  color: var(--text-on-dark);
}
.watch-featured :focus-visible { outline: var(--focus-ring-on-dark); }
.watch-featured .kicker { color: var(--accent-mint); }   /* BR-012: mint as text on deep teal only */
.watch-featured .watch-meta { color: var(--text-on-dark-muted); }
.watch-featured__title { margin: 0 0 var(--space-xs); font-size: var(--size-h3); color: var(--text-on-dark); }
.watch-featured__title a { color: inherit; text-decoration: none; }
.watch-featured__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.watch-featured__summary { color: var(--text-on-dark); }
.watch-featured__actions { margin: var(--space-md) 0 0; }

/* The still and its notice, where no film is stored yet (CNT-025), keep the
   film's shape rather than the photograph's. */
.watch-featured .video-player__missing .media,
.player .video-player__missing .media {
  aspect-ratio: var(--video-ratio, 16 / 9);
  overflow: hidden;
  border-radius: var(--radius-md);
}
.watch-featured .video-player__missing img,
.player .video-player__missing img { width: 100%; height: 100%; max-width: none; }
.watch-featured .video-player__notice,
.watch-featured .video-player__missing p { color: var(--text-on-dark-muted); }

/* CNT-023: the chapter list, on the dark panel. */
.watch-chapters { margin-top: var(--space-md); }
.watch-chapters__heading {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  color: var(--accent-mint);
}
.watch-chapters__list { border-top: 1px solid var(--wash-on-dark); }
.watch-chapters__list a {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap-target);
  padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) 0;
  border-bottom: 1px solid var(--wash-on-dark);
  color: var(--text-on-dark);
  text-decoration: none;
}
.watch-chapters__list a:hover { background: var(--wash-on-dark); }
.watch-chapters__list a:hover .watch-chapters__label { text-decoration: underline; }
/* BR-012: mint passes on the deep panel (4.5:1) but not on the lighter hover
   wash (3.0:1), so the time turns white while its row is hovered. */
.watch-chapters__list a:hover .watch-chapters__time { color: var(--text-on-dark); }
.watch-chapters__time {
  padding-left: var(--space-2xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-mint);
}
.watch-chapters__label { font-size: var(--text-sm); }

.watch-section { margin: 0 0 var(--space-xl); }
.watch-section--first { margin-top: var(--space-lg); }
.watch-section .section-head { margin-bottom: var(--space-2xs); }
.watch-section .section-head .result-count { margin: 0; }
.watch-section__intro { max-width: 62ch; margin: 0 0 var(--space-md); color: var(--text-primary); }
.watch-section--tint {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-accent-soft);
}

/* Video grids: wider 3:2 cards (BR-007 allows them for video lists). */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-sm);
}
.video-grid--vertical { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* The film card (partials/video-thumb.php) is main.css's .card; these add the
   run time on the still and the tall 9:16 shape for shorts (CNT-010). */
.vcard .card__media { margin: 0; }
.vcard .card__title { margin-bottom: var(--space-3xs); }
.vcard--vertical .card__media { aspect-ratio: 9 / 16; }
.vcard--vertical .card__title { font-size: 1.125rem; }
.vcard:hover .card__play { background: var(--scrim-strong); }
.card__play { transition: background-color var(--transition-fast); }

/* CNT-023: the vertical row of short techniques. It scrolls sideways inside
   itself — the page never does (NFR-010) — and a part-card at the edge shows
   there is more. */
.shorts-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4 * var(--space-sm)) / 5.35);
  gap: var(--space-sm);
  margin: 0 calc(-1 * var(--space-3xs));
  padding: var(--space-3xs) var(--space-3xs) var(--space-sm);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}
.shorts-row > li { scroll-snap-align: start; min-width: 0; }

/* ═══ 7. The player window (CNT-023, CNT-026, INT-010) ══════════════════ */

.player {
  width: min(64rem, calc(100vw - 2 * var(--space-sm)));
  max-width: none;
  max-height: calc(100vh - 2 * var(--space-sm));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}
.player[open] { animation: player-in var(--transition-smooth); }
.player::backdrop { background: var(--backdrop); }
@keyframes player-in {
  from { opacity: 0; transform: translateY(12px); }
}

.player__frame { position: relative; padding: var(--space-lg); }
.player__close {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-subtle);
  color: var(--accent-juniper);
  cursor: pointer;
}
.player__close:hover { background: var(--bg-accent-soft); color: var(--accent-juniper-hover); }

.player__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
}
/* A 9:16 film is as tall as the window allows and keeps its shape (CNT-010). */
.player__layout--vertical { grid-template-columns: auto minmax(0, 1fr); }
.player__layout--vertical .player__media { width: min(360px, calc((100vh - 8rem) * 9 / 16)); }
.player__info { padding-right: var(--space-xl); }
.player__title { margin: 0 0 var(--space-xs); font-size: var(--size-h3); }
.player__summary { margin: 0; color: var(--text-primary); }
.player__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-sm);
  margin: var(--space-md) 0;
}
.player__share { padding-top: var(--space-sm); border-top: 1px solid var(--border-subtle); }
.player__share-label {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
.player .share-btn__flash { bottom: auto; top: calc(-1 * var(--space-md)); }

/* The page behind an open window does not scroll. */
body.player-open { overflow: hidden; }

/* ═══ 8. Static pages (CMS-012) ═════════════════════════════════════════ */

/* A reading column centred in the white column: a measure of about 70
   characters at 17px, which is where long policy text stays readable. */
.static-page { max-width: var(--width-reading); margin: 0 auto; }
.static-page .page-head {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}
.static-page .page-head h1 { margin-bottom: var(--space-sm); }
.static-page .page-head__intro { margin: 0 0 var(--space-sm); }
.static-page .page-head__meta { margin: 0; font-family: var(--font-label); font-weight: var(--weight-medium); letter-spacing: 0.04em; }

.static-page .prose { max-width: none; font-size: 1.0625rem; line-height: 1.7; }
.static-page .prose > * + * { margin-top: var(--space-sm); }
.static-page .prose p { margin-bottom: 0; }
.static-page .prose h2 { margin-top: var(--space-xl); margin-bottom: 0; font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
.static-page .prose h3 {
  margin-top: var(--space-lg);
  margin-bottom: 0;
  font-family: var(--font-title);
  font-weight: var(--weight-semi);
  font-size: var(--size-card);
  letter-spacing: var(--tracking-title);
}
.static-page .prose h2 + *, .static-page .prose h3 + * { margin-top: var(--space-xs); }
.static-page .prose a { color: var(--accent-juniper); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.static-page .prose a:hover { color: var(--accent-juniper-hover); text-decoration-thickness: 2px; }
.static-page .prose strong { font-weight: var(--weight-semi); }
.static-page .prose ul, .static-page .prose ol { padding-left: 1.4em; }
.static-page .prose li { margin-bottom: var(--space-2xs); padding-left: 0.2em; }
.static-page .prose li::marker { color: var(--accent-juniper); font-weight: var(--weight-semi); }
.static-page .prose hr { margin: var(--space-xl) 0; }
.static-page .prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}
.static-page .prose th, .static-page .prose td {
  padding: var(--space-2xs) var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}
.static-page .prose th {
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
/* A wide table scrolls inside itself rather than widening the page (NFR-010). */
.static-page .prose .table-wrap, .static-page .prose figure.table { overflow-x: auto; }

.static-page .faq { margin-top: var(--space-xl); }
.static-page .faq__list dt { margin-top: var(--space-md); font-weight: var(--weight-semi); color: var(--accent-juniper); }
.static-page .faq__list dd { margin: var(--space-3xs) 0 0; }

/* ═══ 9. 404, notices and error pages (CNT-025, NFR-012) ════════════════ */

/* One centred panel: what happened in plain words, then the next steps. */
.status-page {
  max-width: 44rem;
  margin: var(--space-sm) auto var(--space-xl);
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-accent-soft);
  text-align: center;
}
.status-page h1 { margin: 0 0 var(--space-sm); font-size: var(--size-h2); }
.status-page p { max-width: 48ch; margin-inline: auto; color: var(--text-primary); }
.status-page .kicker { margin-bottom: var(--space-xs); }
.status-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2xs) var(--space-sm);
  margin: var(--space-md) 0 0;
}
.status-page__search {
  display: flex;
  gap: var(--space-2xs);
  max-width: 30rem;
  margin: var(--space-md) auto 0;
}
.status-page__search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding-inline: 20px;
  border-radius: var(--radius-pill);
}
.status-page__search .btn { flex: none; min-height: 48px; }
.status-page__browse { margin: var(--space-lg) 0 0; }
.status-page__browse .mb-chips { justify-content: center; margin: 0; }
.status-page__browse .mb-chip { background: var(--bg-surface); }
.status-page__browse .mb-chip:hover { background: var(--bg-surface-subtle); }
.status-page .smallprint { margin-top: var(--space-sm); }

.status-latest .section-head { margin-bottom: var(--space-md); }

/* The standalone pages (error, unavailable, not configured, maintenance) sit
   in the bare layout's white card, so the panel drops its own fill. */
.status-page--bare {
  margin: 0;
  padding: 0;
  background: transparent;
}
.status-page--bare .wordmark { display: block; margin: 0 0 var(--space-md); color: var(--accent-mint); }   /* BR-005 logotype */
.status-page--bare ol { margin: var(--space-sm) auto; max-width: 48ch; text-align: left; }
.status-page--bare ol li { list-style: decimal; margin-left: 1.25em; }
.status-page--bare code { overflow-wrap: anywhere; }

/* ═══ 10. Responsive (BR-007, NFR-010) ══════════════════════════════════ */

/* BR-007: video grids — three wide cards from 900px, two below. */
@media (min-width: 600px) {
  .video-grid--vertical { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg) var(--space-md); }
  .video-grid--vertical { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 899.98px) {
  .watch-featured { grid-template-columns: 1fr; }
  .shorts-row { grid-auto-columns: calc((100% - 2 * var(--space-sm)) / 3.3); }
}

@media (max-width: 759.98px) {
  .player__frame { padding: calc(var(--tap-target) + var(--space-sm)) var(--space-sm) var(--space-md); }
  .player__layout, .player__layout--vertical { grid-template-columns: 1fr; gap: var(--space-md); }
  .player__layout--vertical .player__media { width: min(100%, calc((100vh - 12rem) * 9 / 16)); margin-inline: auto; }
  .player__info { padding-right: 0; }
}

@media (max-width: 599.98px) {
  /* On a phone every chip row — the tabs, the subcategories and each filter
     group — is one line that scrolls sideways inside itself, so the results
     start within a screen or so rather than after several (NFR-010: the page
     itself never scrolls sideways). A part-chip at the edge shows there is
     more; listing.js brings the chosen tab into view. */
  .listing-tabs .mb-chips,
  .subcats__list,
  .filters__chips {
    /* The containing block for the chips' visually-hidden spans. Without it
       they are positioned against <body>, escape this scroller, and widen the
       whole page to ~684px at 375 (NFR-010). */
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .listing-tabs .mb-chips::-webkit-scrollbar,
  .subcats__list::-webkit-scrollbar,
  .filters__chips::-webkit-scrollbar { display: none; }
  .listing-tabs .mb-chips > li, .subcats__list > li, .filter-chip { flex: none; }
  /* The rows bleed to the column's edge; the padding keeps focus rings in. */
  .listing-tabs .mb-chips, .subcats__list {
    margin-inline: calc(-1 * var(--sheet-pad));
    padding: 4px var(--sheet-pad);
  }
  .listing-tabs .mb-chips { margin-bottom: var(--space-2xs); }
  .subcats { margin-bottom: var(--space-sm); }

  .filters { padding: var(--space-sm); border-radius: var(--radius-md); }
  .filters__groups { gap: var(--space-2xs); margin-top: var(--space-sm); padding-top: var(--space-sm); }
  .filters__group > .filters__label { width: 4.4rem; padding-top: 19px; }
  .filters__chips {
    margin-right: calc(-1 * var(--space-sm));
    padding: 4px var(--space-sm) 4px 4px;
  }

  .search-page__form .btn, .filters__search-row .btn { padding-inline: 16px; }
  /* BR-006.2: a film card keeps its summary on a phone. The same content
     appears at every width; only the layout changes. */
  .shorts-row { grid-auto-columns: calc((100% - var(--space-sm)) / 2.25); }

  .watch-featured { padding: var(--space-sm) var(--space-sm) var(--space-md); border-radius: var(--radius-md); }
  .watch-section--tint { padding: var(--space-md) var(--space-sm); border-radius: var(--radius-md); }

  .status-page { padding: var(--space-lg) var(--space-sm); border-radius: var(--radius-md); }
  .status-page h1 { font-size: var(--size-h3); }
  .status-page--bare { padding: 0; }
  .saved-bar .btn { margin-left: 0; }
}
