:root {
  --ink: #07121d;
  --ink-soft: #526273;
  --paper: #e8e2d6;
  --surface: #f8f6f0;
  --line: #c7c0b5;
  --blue: #14738a;
  --blue-deep: #0b4658;
  --oxide: #d95750;
  --broadcast: #7ddae8;
  --coral: #ff766b;
  --lime: #b7e36b;
  --night: #07121d;
  --night-soft: #0c1c2b;
  --celluloid: #e8e2d6;
  --film: #dce5ec;
  --focus: #f09a3e;
  --shadow: 0 18px 55px rgba(24, 36, 50, 0.12);
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(33, 97, 140, 0.035) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--paper);
}

[hidden] { display: none !important; }

.mode-badge {
  border: 1px solid var(--blue);
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.38rem 0.58rem;
  text-transform: uppercase;
  white-space: nowrap;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent);
  outline-offset: 2px;
}

.film-edge {
  position: fixed;
  inset: 0 auto 0 0;
  width: 18px;
  z-index: 10;
  pointer-events: none;
  background:
    radial-gradient(ellipse 5px 9px at 9px 16px, var(--paper) 98%, transparent) 0 0 / 18px 32px,
    var(--ink);
}

.masthead {
  height: 72px;
  margin-left: 18px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: clamp(12px, 2vw, 28px);
  align-items: center;
  border-bottom: 1px solid #233848;
  background: rgba(7, 18, 29, 0.92);
  backdrop-filter: blur(12px);
  color: var(--celluloid);
  position: relative;
  z-index: 20;
}

.wordmark {
  width: max-content;
  display: flex;
  align-items: baseline;
  gap: 3px;
  text-decoration: none;
  font: 600 22px/1 "Avenir Next Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
}
.wordmark i { color: var(--oxide); font-style: normal; }
.primary-nav { display: flex; gap: 4px; }
.primary-nav a { padding: 8px 10px; border-radius: 999px; color: #9caebb; font-size: 11px; text-decoration: none; }
.primary-nav a:hover { background: #13283a; color: white; }
.source-note, .build-state { margin: 0; font: 400 11px/1.4 "SFMono-Regular", Consolas, monospace; color: #91a4b2; }
.source-note { justify-self: center; }
.source-note span { color: var(--oxide); }
.build-state { justify-self: end; }
.build-state { display: flex; align-items: center; gap: 7px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(183, 227, 107, 0.12); }

main { margin-left: 18px; }
.thesis, .console, .results, footer { padding-inline: clamp(20px, 4vw, 64px); }

.discovery {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  color: var(--celluloid);
  background:
    radial-gradient(circle at 74% 4%, rgba(125, 218, 232, 0.16), transparent 28%),
    radial-gradient(circle at 12% 76%, rgba(255, 118, 107, 0.09), transparent 28%),
    var(--night);
  border-bottom: 1px solid #233848;
}
.broadcast-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(125, 218, 232, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 218, 232, 0.05) 1px, transparent 1px);
  background-size: 100% 36px, 36px 100%;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
.discovery-inner { position: relative; padding: clamp(52px, 7vw, 104px) clamp(20px, 4vw, 64px) 80px; }
.discovery-intro { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.55fr); align-items: end; gap: clamp(36px, 8vw, 120px); max-width: 1480px; }
.live-eyebrow { color: var(--broadcast); }
.live-eyebrow span { display: inline-block; width: 34px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--broadcast); box-shadow: 18px 0 var(--broadcast); animation: broadcast 2.4s steps(2, jump-none) infinite; }
@keyframes broadcast { 50% { box-shadow: 8px 0 var(--broadcast); opacity: 0.55; } }
.discovery h1 {
  max-width: 980px;
  margin: 0;
  font: 630 clamp(54px, 8.2vw, 126px)/0.83 "Avenir Next Condensed", "Arial Narrow", sans-serif;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}
.discovery h1 em { color: var(--broadcast); font-style: normal; font-weight: 380; }
.discovery-lede { max-width: 620px; margin: 28px 0 0; color: #adc0cb; font-size: clamp(15px, 1.5vw, 19px); line-height: 1.55; }
.signal-note { border-top: 1px solid #395061; padding-top: 16px; }
.signal-note-label { color: var(--lime); font: 600 10px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.signal-note p { margin: 12px 0 0; color: #adc0cb; font-size: 13px; line-height: 1.6; }

.season-reel { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: stretch; gap: 10px; margin-top: clamp(48px, 7vw, 88px); }
.year-step { border: 1px solid #2a4153; border-radius: 50%; width: 46px; height: 46px; align-self: end; background: transparent; color: var(--celluloid); font-size: 20px; }
.year-step:hover { border-color: var(--broadcast); color: var(--broadcast); }
.season-window { min-width: 0; }
.season-reel-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #2a4153; padding-bottom: 10px; }
.season-reel-head span { font: 500 clamp(30px, 4vw, 52px)/1 "SFMono-Regular", Consolas, monospace; letter-spacing: -0.06em; }
.season-reel-head small { color: #91a4b2; font: 400 10px/1.4 "SFMono-Regular", Consolas, monospace; }
.season-track { --season-position: 0; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); }
.season-track::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #2a4153; }
.season-track button { position: relative; border: 0; padding: 18px 8px 22px; background: transparent; color: #748a99; text-align: left; font: 500 clamp(13px, 1.4vw, 18px)/1 "Avenir Next", sans-serif; }
.season-track button::before { content: ""; display: block; width: 5px; height: 5px; margin-bottom: 12px; border-radius: 50%; background: #425869; }
.season-track button.is-active { color: white; }
.season-track button.is-active::before { background: var(--coral); box-shadow: 0 0 0 6px rgba(255,118,107,.12); }
.broadcast-marker { position: absolute; z-index: 2; left: calc((var(--season-position) * 25%) + 2px); bottom: -1px; width: calc(25% - 4px); height: 2px; background: var(--coral); box-shadow: 0 0 18px rgba(255,118,107,.55); transition: left 450ms cubic-bezier(.2,.75,.25,1); }

.discovery-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-top: 54px; }
.media-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid #2a4153; border-radius: 999px; background: #0a1825; }
.media-tabs button { border: 0; border-radius: 999px; padding: 10px 14px; background: transparent; color: #91a4b2; font-size: 12px; }
.media-tabs button span { margin-left: 6px; color: #657b8b; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; }
.media-tabs button.is-active { background: var(--celluloid); color: var(--night); }
.media-tabs button.is-active span { color: #3e5360; }
.discovery-actions { display: flex; align-items: end; gap: 10px; }
.discovery-sort { display: grid; gap: 5px; color: #728896; font: 500 9px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.discovery-sort select, .refresh-button { min-height: 41px; border: 1px solid #2a4153; border-radius: 3px; background: #0a1825; color: var(--celluloid); padding: 0 12px; font-size: 11px; }
.refresh-button { border-color: var(--broadcast); color: var(--broadcast); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.refresh-button:disabled { opacity: .55; }
.source-rail { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; color: #6f8392; font: 400 9px/1 "SFMono-Regular", Consolas, monospace; text-transform: uppercase; letter-spacing: .07em; }
.source-rail span, .source-rail button { border: 0; border-radius: 999px; padding: 7px 9px 7px 23px; background: #0c1c2b; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; position: relative; }
.source-rail span::before, .source-rail button::before { content: ""; position: absolute; left: 10px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #566b7a; transform: translateY(-50%); }
.source-rail .is-loading::before { background: var(--broadcast); animation: pulse 1s infinite; }
.source-rail .is-ready::before { background: var(--lime); }
.source-rail .is-error::before { background: var(--coral); }
.source-rail small { margin-left: auto; color: #718695; text-transform: none; letter-spacing: 0; }
@keyframes pulse { 50% { opacity: .25; transform: translateY(-50%) scale(.7); } }

.discovery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); margin-top: 30px; }
.programme-card { min-width: 0; overflow: hidden; border: 1px solid #243a4a; border-radius: 4px; background: #0a1825; animation: card-in 480ms both; animation-delay: var(--delay, 0ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
.programme-card:hover { border-color: color-mix(in srgb, var(--card-accent), #243a4a 50%); transform: translateY(-2px); transition: transform 180ms ease, border-color 180ms ease; }
.programme-poster { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #102536; }
.programme-poster::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(7,18,29,.88)); pointer-events: none; }
.programme-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 450ms ease; }
.programme-card:hover .programme-poster img { transform: scale(1.025); }
.poster-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: repeating-linear-gradient(135deg, #102536 0 18px, #0d202f 18px 36px); }
.poster-fallback span { color: #496271; font: 600 13px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; }
.media-kind { position: absolute; z-index: 2; top: 12px; left: 12px; border: 1px solid rgba(255,255,255,.26); border-radius: 999px; padding: 6px 9px; background: rgba(7,18,29,.68); backdrop-filter: blur(8px); color: white; font: 600 9px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.pick-score { position: absolute; z-index: 2; right: 12px; bottom: 12px; width: 54px; height: 54px; display: grid; place-items: center; align-content: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(7,18,29,.86); backdrop-filter: blur(8px); }
.pick-score b { color: var(--lime); font: 600 18px/1 "SFMono-Regular", Consolas, monospace; }
.pick-score small { margin-top: 3px; color: #8194a1; font: 500 7px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.programme-copy { padding: 17px 16px 15px; }
.programme-meta { min-height: 15px; margin: 0 0 8px; color: var(--broadcast); font: 500 9px/1.4 "SFMono-Regular", Consolas, monospace; text-transform: uppercase; letter-spacing: .06em; }
.programme-copy h3 { margin: 0; min-height: 2.4em; color: #f3efe7; font: 600 clamp(17px, 1.7vw, 23px)/1.08 "Avenir Next Condensed", "Arial Narrow", sans-serif; letter-spacing: -.01em; }
.original-title { min-height: 1.2em; margin: 5px 0 0; color: #728896; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating-row { min-height: 43px; display: flex; gap: 7px; margin-top: 16px; }
.source-rating { min-width: 68px; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 5px; border-left: 2px solid var(--coral); padding-left: 7px; }
.source-rating b { color: white; font: 500 17px/1 "SFMono-Regular", Consolas, monospace; }
.source-rating small { color: #728896; font: 400 7px/1.2 "SFMono-Regular", Consolas, monospace; }
.rating-pending { color: #718695; font-size: 10px; }
.genre-row { min-height: 22px; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.genre-row span { border: 1px solid #263d4d; border-radius: 999px; padding: 4px 7px; color: #8fa2af; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.programme-footer { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin-top: 14px; padding-top: 11px; border-top: 1px solid #1d3242; color: #607685; font: 400 8px/1.4 "SFMono-Regular", Consolas, monospace; }
.programme-links { display: flex; gap: 7px; text-align: right; }
.programme-links a { color: #9bb0bc; text-decoration: none; }
.programme-links a:hover { color: var(--broadcast); }
.connect-card { min-height: 420px; display: flex; flex-direction: column; align-items: flex-start; justify-content: end; border: 1px dashed #3b5567; border-radius: 4px; padding: 24px; background: linear-gradient(145deg, #0c1c2b, #10283a); color: #91a4b2; text-align: left; }
.connect-card:hover { border-color: var(--broadcast); }
.connect-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: auto; border-radius: 50%; background: var(--broadcast); color: var(--night); font: 700 22px/1 "SFMono-Regular", Consolas, monospace; }
.connect-card strong { color: white; font: 600 24px/1.1 "Avenir Next Condensed", "Arial Narrow", sans-serif; }
.connect-card small { margin-top: 10px; line-height: 1.5; }
.connect-card i { margin-top: 18px; color: var(--broadcast); font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.discovery-empty { margin-top: 30px; border: 1px dashed #3b5567; padding: 50px; text-align: center; color: #879aa7; }
.discovery-empty strong, .discovery-empty span { display: block; }
.discovery-empty strong { color: white; font-size: 20px; }
.discovery-empty span { margin-top: 8px; font-size: 12px; }
.discovery-footnote { margin: 25px 0 0; color: #718695; font: 400 9px/1.5 "SFMono-Regular", Consolas, monospace; }
.skeleton-card { animation: none; }
.skeleton-card .programme-poster, .skeleton-lines i { background: linear-gradient(100deg, #0e2232 30%, #173044 50%, #0e2232 70%) 0 0 / 220% 100%; animation: shimmer 1.4s infinite; }
.skeleton-lines { padding: 18px; }
.skeleton-lines i { display: block; height: 10px; margin-bottom: 10px; border-radius: 2px; }
.skeleton-lines i:nth-child(2) { width: 72%; }.skeleton-lines i:nth-child(3) { width: 46%; }
@keyframes shimmer { to { background-position: -220% 0; } }

.tmdb-dialog { width: min(520px, calc(100vw - 32px)); border: 1px solid #385165; border-radius: 5px; padding: 0; background: #0b1a27; color: var(--celluloid); box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.tmdb-dialog::backdrop { background: rgba(2,8,13,.78); backdrop-filter: blur(6px); }
.tmdb-dialog form { position: relative; padding: 34px; }
.tmdb-dialog h2 { margin: 0; font: 600 38px/1 "Avenir Next Condensed", "Arial Narrow", sans-serif; }
.tmdb-dialog p:not(.eyebrow) { color: #9bb0bc; line-height: 1.6; font-size: 13px; }
.tmdb-dialog label { display: grid; gap: 8px; margin-top: 24px; color: #9bb0bc; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.tmdb-dialog input { height: 46px; border: 1px solid #385165; border-radius: 3px; padding: 0 12px; background: #07121d; color: white; font-family: "SFMono-Regular", Consolas, monospace; }
.dialog-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; color: #91a4b2; font-size: 25px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-actions button { min-height: 42px; border: 1px solid var(--broadcast); border-radius: 3px; padding: 0 14px; background: var(--broadcast); color: var(--night); font-weight: 700; }
.dialog-actions .quiet-button { border-color: #385165; background: transparent; color: #9bb0bc; }
.tmdb-dialog small { display: block; margin-top: 20px; color: #617887; font-size: 9px; line-height: 1.5; }

.thesis {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: clamp(30px, 7vw, 110px);
  align-items: end;
  padding-block: 64px 52px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font: 500 11px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.thesis h2 {
  max-width: 900px;
  margin: 0;
  font: 600 clamp(48px, 7.5vw, 104px)/0.86 "Avenir Next Condensed", "Arial Narrow", sans-serif;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.thesis h2 span { color: var(--blue); }

.counter-grid { border-top: 1px solid var(--ink); }
.counter-grid div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.counter-grid span { font: 500 23px/1 "SFMono-Regular", Consolas, monospace; }
.counter-grid small { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

.console { padding-block: 30px; background: var(--surface); border-bottom: 1px solid var(--line); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.search-box, .page-size { display: grid; gap: 7px; color: var(--ink-soft); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.search-box { position: relative; }
.search-box input, .page-size select, .builder-controls input, .builder-controls select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  color: var(--ink);
}
.search-box input { padding: 0 56px 0 14px; font-size: 15px; text-transform: none; letter-spacing: 0; }
.search-box kbd { position: absolute; right: 14px; bottom: 11px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 2px; font: 400 11px/1 "SFMono-Regular", Consolas, monospace; }
.page-size select { min-width: 88px; padding: 0 12px; }

.builders { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr); gap: 20px; margin-top: 22px; }
.builder-panel { min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.panel-heading span { font: 600 14px/1 "Avenir Next Condensed", "Arial Narrow", sans-serif; letter-spacing: 0.07em; text-transform: uppercase; }
.panel-heading small { color: var(--ink-soft); font: 400 10px/1 "SFMono-Regular", Consolas, monospace; }
.builder-controls { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr 1.2fr auto; gap: 7px; }
.builder-controls select, .builder-controls input { min-width: 0; padding: 0 10px; font-size: 12px; }
.builder-controls button, .pagination button {
  min-height: 44px;
  border: 1px solid var(--blue-deep);
  border-radius: 2px;
  padding: 0 16px;
  background: var(--blue-deep);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sort-controls { grid-template-columns: 1fr 0.8fr auto; }

.splice-strip {
  min-height: 49px;
  margin-top: 22px;
  padding: 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 3px 5px at 8px 5px, var(--surface) 98%, transparent) 0 0 / 16px 10px,
    var(--film);
}
.rule-chip {
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 11px;
  border-left: 3px solid var(--oxide);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(24, 36, 50, 0.1);
  font: 400 11px/1.3 "SFMono-Regular", Consolas, monospace;
}
.rule-chip.sort { border-left-color: var(--blue); }
.rule-chip button { border: 0; background: transparent; color: var(--ink-soft); font-size: 16px; line-height: 1; }
.empty-rules { margin-left: 12px; color: var(--ink-soft); font: 400 11px/1 "SFMono-Regular", Consolas, monospace; }

.results { padding-block: 34px 54px; }
.results-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.results-meta p { margin: 0; color: var(--ink-soft); font: 400 11px/1 "SFMono-Regular", Consolas, monospace; }
.text-button { border: 0; border-bottom: 1px solid currentColor; padding: 2px 0; background: transparent; color: var(--blue); font-size: 11px; }

.table-shell { position: relative; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; min-width: 1250px; border-collapse: collapse; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 12px;
  border-right: 1px solid #304154;
  background: var(--ink);
  color: #f5f8fa;
  text-align: left;
  white-space: nowrap;
  font: 500 10px/1.2 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
th button { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
th .sort-index { margin-left: 5px; color: #f0b27a; }
td { max-width: 260px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tbody tr:hover { background: #e7f0f6; }
td.title-cell { min-width: 230px; font-weight: 600; }
td.title-cell a { color: var(--blue-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
td.number-cell, td.code-cell { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.rating { display: inline-block; min-width: 28px; border-bottom: 3px solid var(--oxide); padding-bottom: 2px; font-weight: 500; }
.null { color: #99a5af; }
.empty-cell { height: 180px; text-align: center; color: var(--ink-soft); }

.loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; background: rgba(249, 251, 252, 0.88); color: var(--ink-soft); font: 400 11px/1 "SFMono-Regular", Consolas, monospace; }
.loading span { width: 110px; height: 3px; background: linear-gradient(90deg, transparent, var(--oxide), transparent); animation: scan 1s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateX(-40px); opacity: 0.3; } 50% { transform: translateX(40px); opacity: 1; } }

.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; }
.pagination button { background: transparent; color: var(--blue-deep); }
.pagination button:disabled { cursor: not-allowed; opacity: 0.35; }
.pagination span { min-width: 140px; text-align: center; font: 400 11px/1 "SFMono-Regular", Consolas, monospace; }

footer { margin-left: 18px; padding-block: 25px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--ink-soft); font: 400 10px/1.4 "SFMono-Regular", Consolas, monospace; }
.is-hidden { display: none !important; }

@media (max-width: 900px) {
  .masthead { grid-template-columns: auto auto 1fr auto; }
  .source-note { display: none; }
  .mode-badge { justify-self: center; }
  .discovery-intro { grid-template-columns: 1fr; }
  .signal-note { max-width: 480px; }
  .discovery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thesis { grid-template-columns: 1fr; min-height: 0; padding-block: 50px 38px; }
  .builders { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .film-edge { width: 10px; background-size: 10px 28px; background-position: -4px 0; }
  .masthead, main { margin-left: 10px; }
  .masthead { height: 62px; padding-inline: 16px; grid-template-columns: auto 1fr auto; }
  .primary-nav { display: none; }
  .build-state { display: none; }
  .thesis, .console, .results, footer { padding-inline: 16px; }
  .discovery-inner { padding-inline: 16px; padding-top: 56px; }
  .discovery h1 { font-size: clamp(50px, 15vw, 76px); }
  .discovery-lede { margin-top: 20px; font-size: 14px; }
  .season-reel { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 5px; }
  .year-step { width: 32px; height: 32px; font-size: 14px; }
  .season-reel-head { align-items: end; }
  .season-reel-head small { max-width: 160px; text-align: right; font-size: 8px; }
  .season-track button { padding-inline: 2px; font-size: 11px; }
  .discovery-toolbar { align-items: stretch; flex-direction: column; }
  .media-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
  .media-tabs button { padding-inline: 6px; font-size: 10px; }
  .media-tabs button span { display: block; margin: 4px 0 0; }
  .discovery-actions { justify-content: space-between; }
  .discovery-sort { flex: 1; }
  .discovery-sort select { width: 100%; }
  .source-rail small { width: 100%; margin: 4px 0 0; }
  .discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .programme-poster { aspect-ratio: 3 / 4; }
  .programme-copy { padding: 12px 11px; }
  .programme-copy h3 { font-size: 17px; }
  .programme-meta { font-size: 7px; }
  .pick-score { width: 45px; height: 45px; right: 8px; bottom: 8px; }
  .pick-score b { font-size: 15px; }
  .media-kind { top: 8px; left: 8px; font-size: 7px; }
  .rating-row { min-height: 36px; }
  .source-rating { min-width: 0; }
  .source-rating b { font-size: 13px; }
  .source-rating small { display: none; }
  .programme-footer { display: block; }
  .programme-links { margin-top: 7px; }
  .connect-card { min-height: 320px; padding: 15px; }
  .thesis { gap: 36px; }
  .thesis h2 { font-size: clamp(46px, 16vw, 74px); }
  .search-row { grid-template-columns: 1fr 80px; }
  .builder-controls, .sort-controls { grid-template-columns: 1fr 1fr; }
  .builder-controls input { grid-column: span 1; }
  .builder-controls button { grid-column: 1 / -1; }
  footer { margin-left: 10px; flex-direction: column; gap: 8px; }
}

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