/* Shared styles for the Xtream catalog sections (Movies, Series) and the
   Search results: hero, horizontal rails, poster grid, and the detail screens. */
.catalog-hint {
  margin: 0;
  font-size: calc(30px * var(--font-scale));
  color: var(--text-secondary);
}

.catalog-view {
  width: 1920px;
  height: 100%;
  box-sizing: border-box;
  padding: 40px 80px 60px;
  overflow-y: auto;
}

.catalog-loading,
.catalog-empty { display: flex; align-items: center; justify-content: center; height: 100%; }

/* A new install's first visit: the library is fetched, which takes a while. */
.catalog-first-load {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.catalog-first-load-title {
  margin: 32px 0 12px;
  font-size: calc(40px * var(--font-scale));
  font-weight: 600;
  color: var(--text-primary);
}

.catalog-browse {
  position: relative;
  display: flex;
  height: 100%;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* Category browsing, as IPTV players lay it out (catalog-view.ts
   renderBrowse): the categories down the left, the chosen one's posters on
   the right. The list and the grid each scroll on their own. */
.cb-side {
  flex: 0 0 440px;
  display: flex;
  flex-direction: column;
  padding: 28px 0 0 40px;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}
/* The headings keep their height: in a column beside a list or grid tens of
   thousands of pixels tall, a shrinkable heading was squeezed to nothing. */
.cb-kicker,
.cb-edit,
.cb-title,
.cb-main > .catalog-hint { flex: 0 0 auto; }
.cb-kicker {
  font-size: calc(22px * var(--font-scale)); letter-spacing: 4px; font-weight: 700;
  color: var(--accent); text-transform: uppercase;
}
/* Edit categories: a real button, since newer LG remotes have no colour
   keys; the green dot says green is its shortcut. */
.cb-edit {
  align-self: flex-start;
  display: flex;
  align-items: center;
  height: 44px;
  margin: 12px 0 14px;
  padding: 0 16px;
  border: 3px solid transparent;
  border-radius: 22px;
  background: var(--catalog-surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: calc(20px * var(--font-scale));
  cursor: pointer;
  box-sizing: border-box;
}
.cb-edit > * + * { margin-left: 10px; }
.cb-edit.focused { border-color: var(--catalog-focus); color: var(--text-primary); }
.cb-edit.is-on { background: var(--accent); color: var(--bg-primary); }
.cb-edit-icon svg { display: block; width: 20px; height: 20px; }
.cb-edit-key {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--remote-key-green);
}
.cb-list {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  /* Room for the focused row's glow inside the clip. */
  padding: 6px 16px 24px 6px;
}
.cb-list-spacer { position: relative; }
/* A faint rule between rows, so neighbouring names read as separate. */
.cb-row::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 1px;
  background: var(--border);
  opacity: 0.6;
}
/* Editing: the list widens so the names stay readable beside the one row's
   controls. */
.catalog-browse.is-editing .cb-side { flex-basis: 720px; }
.cb-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
}
.cb-row-name {
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border: 3px solid transparent;
  border-left-width: 6px;
  border-radius: 10px;
  box-sizing: border-box;
  font-size: calc(24px * var(--font-scale));
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
/* The row whose posters are showing, whether or not it has focus. */
.cb-row.is-selected .cb-row-name {
  border-left-color: var(--accent);
  background: var(--catalog-surface);
  color: var(--text-primary);
}
.cb-row-name.focused {
  border-color: var(--catalog-focus);
  background: var(--catalog-surface);
  color: var(--text-primary);
}

.cb-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 0 0 40px;
  box-sizing: border-box;
}
.cb-title {
  margin: 0 0 16px;
  font-size: calc(40px * var(--font-scale));
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-count {
  margin-left: 16px;
  font-size: calc(24px * var(--font-scale));
  font-weight: 500;
  color: var(--text-secondary);
}
.cb-grid {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  /* Room for the focused poster's ring above the first row. */
  padding: 12px 0 0 12px;
}
.cb-grid-track { position: relative; }

.catalog-rail { margin-bottom: 28px; }
.catalog-rail-title { margin: 0 0 12px; font-size: calc(30px * var(--font-scale)); font-weight: 600; color: var(--text-primary); }
.catalog-rail-track { display: flex; gap: 20px; overflow-x: auto; padding: 12px 12px 20px; margin: 0 -12px; }
.catalog-category-actions { display: flex; margin-left: 16px; }
.catalog-category-actions > * + * { margin-left: 10px; }
.catalog-category-action {
  width: 52px; height: 52px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--catalog-surface); border: 3px solid transparent;
  color: var(--text-primary); box-sizing: border-box; cursor: pointer;
}
.catalog-category-action svg { width: 26px; height: 26px; }
.catalog-category-action.disabled { opacity: 0.35; }
.catalog-category-action.focused {
  outline: 3px solid var(--catalog-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(var(--catalog-focus-rgb-legacy), 0.25);
}

.catalog-grid-cell { position: absolute; width: 160px; height: 274px; }

/* Smaller cards: more titles per screen on a 48-65" panel at 1080p. */
.catalog-tile { width: 160px; flex: 0 0 auto; cursor: pointer; }
.catalog-poster-wrap {
  position: relative;
  width: 160px; height: 240px;
  border-radius: 12px; overflow: hidden;
  background: var(--catalog-surface);
}
.catalog-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.catalog-poster-empty { display: flex; align-items: center; justify-content: center; font-size: calc(56px * var(--font-scale)); color: var(--text-secondary); }
.catalog-tile-name {
  margin-top: 8px; font-size: calc(19px * var(--font-scale)); color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.catalog-tile-versions {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: calc(15px * var(--font-scale));
}
.catalog-tile.focused {
  box-shadow: none;
  border-color: transparent !important;
}
.catalog-tile.focused .catalog-poster-wrap {
  outline: 3px solid var(--catalog-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(var(--catalog-focus-rgb-legacy), 0.25), 0 10px 24px rgba(0, 0, 0, 0.6);
}

.movies-detail { display: block; }
.detail-poster-wrap {
  width: 360px; height: 540px; flex: 0 0 auto;
  border-radius: 16px; overflow: hidden; background: var(--catalog-surface);
}
.detail-body { flex: 1 1 auto; max-width: 1280px; }
.detail-title { margin: 0 0 12px; font-size: calc(56px * var(--font-scale)); font-weight: 700; color: var(--text-primary); }
/* One slot for the title, sized for the logo before it is known: the
   logo arriving (TMDB, a moment after the page) took the place of a 78px
   title at up to 220px and pushed everything below down (Follow-up 150).
   The text title sits at the slot's foot, where the logo's would end. */
.detail-logo-wrap {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 160px;
  margin: 0 0 18px;
  max-width: 720px;
}
.detail-logo-wrap .detail-title { margin-bottom: 0; }
.detail-logo-wrap.has-logo .detail-title { display: none; }
.detail-logo-wrap.has-logo .detail-logo.is-broken { display: none; }
.detail-logo-wrap.has-logo .detail-logo.is-broken ~ .detail-title { display: block; }
.detail-logo {
  display: block;
  max-width: 100%;
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
  animation: detail-logo-in 240ms ease-out;
}
@keyframes detail-logo-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.detail-content-cinematic {
  display: block;
  max-width: 1400px;
}
.detail-content-cinematic .detail-body { max-width: 1400px; }
.detail-content-cinematic .detail-plot-wrap { max-width: 936px; }
.detail-meta { font-size: calc(26px * var(--font-scale)); color: var(--text-secondary); margin-bottom: 24px; }
.detail-plot { max-width: 1000px; font-size: calc(28px * var(--font-scale)); line-height: 1.5; color: var(--text-primary); margin: 0 0 24px; }
.detail-cast { max-width: 1000px; font-size: calc(24px * var(--font-scale)); color: var(--text-secondary); margin-bottom: 8px; }
.detail-label { color: var(--text-primary); font-weight: 600; margin-right: 8px; }
.detail-actions { display: flex; flex-wrap: nowrap; gap: 12px; margin-top: 32px; }
.detail-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 10px; border: 3px solid transparent;
  background: var(--glass-tint); backdrop-filter: var(--glass-filter);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--text-primary); font-size: calc(24px * var(--font-scale)); font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.detail-btn-primary {
  background: var(--glass-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #fff;
}
.detail-btn.focused { border-color: var(--text-primary); }
/* The accent-filled button can't show focus in the accent (its border and
   glow vanished into it, the owner): focused, it turns white instead. */
.detail-btn-primary.focused {
  background: #fff;
  color: #111;
  border-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 0 24px rgba(255, 255, 255, 0.35);
}
.detail-btn-icon { display: inline-flex; width: 28px; height: 28px; flex: 0 0 auto; }
.detail-btn-icon svg { width: 100%; height: 100%; }
.watchlist-glyph.set { fill: currentColor; }
/* Like / dislike: icon-only buttons beside the Watchlist one. */
.detail-btn.detail-btn-icon-only { padding-left: 10px; padding-right: 10px; }
.thumb-glyph.set { fill: currentColor; }
.thumb-glyph.unset { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.watchlist-glyph.unset {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

/* Series detail: a compact header (poster + season selector) over an episode
   list. The page scrolls inside .detail-scroll; the virtualizer treats the
   header (and discovery rails) as leading size above the episode window. */
.series-detail { display: block; }
.series-detail-head { display: flex; gap: 56px; margin-bottom: 32px; }
.series-detail-poster { width: 260px; height: 390px; }

.series-seasons { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.series-season-btn {
  padding: 12px 28px; border-radius: 10px; border: 3px solid transparent;
  background: var(--catalog-control); color: var(--text-primary); font-size: calc(26px * var(--font-scale)); font-weight: 600; cursor: pointer;
}
.series-season-btn.active { background: var(--accent, #3ea6ff); color: #fff; }
.series-season-btn.focused { border-color: var(--text-primary); }

.series-episodes { position: relative; overflow-anchor: none; }
.series-episodes-spacer { position: relative; width: 100%; }
.series-episode-cell { position: absolute; left: 0; right: 0; display: flex; align-items: flex-start; }
.series-episode-cell > .episode-row { flex: 1 1 auto; min-width: 0; }
/* An episode's own "subtitles from the video" (series.ts readEpisodeSubtitles):
   small and quiet beside the row, as rarely needed. */
.episode-subs {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  margin-left: 12px;
  padding: 16px;
  box-sizing: border-box;
  border: 3px solid transparent;
  border-radius: 12px;
  background: var(--catalog-surface);
  color: var(--text-muted);
  cursor: pointer;
}
.episode-subs svg { width: 100%; height: 100%; }
.episode-subs.focused,
.episode-subs:hover { color: var(--text-primary); border-color: var(--accent, #3ea6ff); }
.episode-subs.is-reading { color: var(--accent, #3ea6ff); }
.episode-row {
  box-sizing: border-box;
  display: flex; gap: 20px; align-items: flex-start;
  padding: 20px 24px; border-radius: 12px; background: var(--catalog-surface);
  border: 3px solid transparent; cursor: pointer;
}
.episode-row.focused { border-color: var(--accent, #3ea6ff); }
.episode-badge { display: inline-flex; width: 32px; height: 32px; flex: 0 0 auto; color: var(--text-secondary); margin-top: 4px; }
.episode-badge svg { width: 100%; height: 100%; }
.episode-body { flex: 1 1 auto; min-width: 0; }
.episode-title { display: flex; align-items: center; gap: 16px; font-size: calc(28px * var(--font-scale)); font-weight: 600; color: var(--text-primary); }
.episode-num { color: var(--text-secondary); font-weight: 700; }
.episode-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-resume {
  font-size: calc(20px * var(--font-scale)); font-weight: 600; color: #fff;
  background: var(--accent, #3ea6ff); border-radius: 6px; padding: 2px 12px;
}
.episode-meta { font-size: calc(22px * var(--font-scale)); color: var(--text-secondary); margin-top: 6px; }
.episode-plot {
  font-size: calc(24px * var(--font-scale)); line-height: 1.4; color: var(--text-secondary);
  margin: 10px 0 0; max-height: 68px; overflow: hidden;
}

/* Version picker on a catalog detail — the other copies of the same title.
   Only rendered when a grouped card had more than one behind it. */
.detail-versions { margin-top: 28px; }
.detail-versions-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  font-size: calc(20px * var(--font-scale));
  color: var(--text-secondary);
}
.detail-versions-row { display: flex; flex-wrap: wrap; }
.detail-versions-row > * { margin: 0 12px 12px 0; }

.detail-version {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 240px;
  padding: 10px 18px;
  border: 3px solid transparent;
  border-radius: 8px;
  background: var(--glass-tint);
  backdrop-filter: var(--glass-filter);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--text-primary);
  font-size: calc(20px * var(--font-scale));
  cursor: pointer;
  box-sizing: border-box;
  /* One height for every card, the tallest one's (a badge over name, the
     audio label, languages and tag, with a few px to spare for the TV's
     font): cards grew as reads gave them a badge or a line, and the rows
     below moved with them (Follow-up 150). */
  height: 138px;
  overflow: hidden;
}
.detail-version-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.detail-version-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  /* Lets the sibling HDR tag keep its own width in the flex row instead of
     being squeezed out before the name gets a chance to ellipsize. */
  min-width: 0;
}
/* The exact size after the tier ("4K (3840x1600)"), quieter so the pair
   still fits beside an HDR tag. */
.detail-version-size {
  font-size: calc(17px * var(--font-scale));
  font-weight: 400;
  color: var(--text-secondary);
}
/* A fact read from the file's own colour metadata (PQ/HLG transfer curve),
   not a guess from a category name — a "4K-FR-HDR" copy isn't always HDR,
   and a plain "4K" copy sometimes is. See docs/version-facts.md. Amber
   rather than the theme accent, deliberately — the accent is already
   "Recommended"'s color, and this badge sitting on the same card must read
   as a second, distinct fact, not a duplicate of that one. */
.detail-version-hdr {
  flex: none;
  padding: 1px 6px;
  border: 1px solid rgb(255 191 89 / 0.55);
  border-radius: 4px;
  background: rgb(255 191 89 / 0.14);
  color: #ffbf59;
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 0 8px rgb(255 191 89 / 0.45);
}
/* "Audio languages", small over the languages line, so the line reads as
   the audio and not the subtitles (the owner, 2026-10-10). */
.detail-version-audio {
  margin-top: 4px;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.2;
  color: var(--text-secondary);
  opacity: 0.7;
}
.detail-version-meta {
  margin-top: 2px;
  font-size: calc(16px * var(--font-scale));
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
/* The provider's own quality tag ("4K-FR-HDR") — kept even once a resolution
   is known, since it's the only thing that still tells apart two copies that
   read the same resolution and the same audio languages. */
.detail-version-tag {
  margin-top: 4px;
  font-size: calc(13px * var(--font-scale));
  color: var(--text-secondary);
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
/* The provider refuses the file: last in the list, dimmed, marked. */
.detail-version.unavailable { opacity: 0.55; }
.detail-version-unavailable { color: var(--danger); }
.detail-version.active { border-color: var(--text-secondary); }
.detail-version.focused {
  outline: 3px solid var(--catalog-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(var(--catalog-focus-rgb-legacy), 0.25);
}

/* The version the app picked for you, using facts read from the file itself
   (resolution, real audio-track language) rather than guessed from a
   provider category name — see docs/version-facts.md. Declared after
   .active so its accent border wins when a copy is both (the common case:
   this is what actually plays by default). */
.detail-version.recommended { border-color: rgba(var(--accent-rgb-legacy), 0.6); }
.detail-version-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb-legacy), 0.16);
  color: var(--accent);
  font-size: calc(14px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.detail-version-badge svg { width: 12px; height: 12px; }

/* The "+N more versions" tile that reveals the rest of a long list — dashed
   rather than solid so it reads as "more", not as another real option. */
.detail-version-more {
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-style: dashed;
  border-color: var(--border);
}
.detail-version-more:hover,
.detail-version-more.focused { color: var(--text-primary); }
/* "Hide versions" last in the versions row: small and quiet, it's rarely
   needed, and out of the way of Up and Down. */
.detail-versions-hide {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: calc(16px * var(--font-scale));
  cursor: pointer;
}
.detail-versions-hide svg { width: 18px; height: 18px; }
.detail-versions-hide.focused,
.detail-versions-hide:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* "Checking versions…" beside the heading while copies' files are read. */
.detail-versions-scanning {
  color: var(--text-muted);
  font-size: calc(16px * var(--font-scale));
  font-weight: 400;
}

/* Online availability and file-read progress appear under the detail action row. */
/* Online subtitles and the ones read from the video, in one small box. */
.detail-subs-box {
  display: inline-block;
  /* Room for both lines from the start: the line for the video's own
     subtitles comes once a read starts, and moved what is below. */
  min-height: 114px;
  max-width: 1124px;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  background: var(--glass-tint);
  backdrop-filter: var(--glass-filter);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.detail-subs-box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: calc(16px * var(--font-scale));
}
/* "Change language": small and quiet, as "Hide versions" is. */
.detail-subs-change {
  margin-left: 16px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: calc(16px * var(--font-scale));
  cursor: pointer;
}
.detail-subs-change.focused,
.detail-subs-change:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}
.detail-online-subs-status,
.detail-subs-status {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: calc(22px * var(--font-scale));
}

.detail-discovery { margin-top: 28px; }
.detail-cast-section h2,
.detail-related h2 {
  margin: 0 0 14px;
  font-size: calc(28px * var(--font-scale));
  color: var(--text-primary);
}
/* The cast and "More like this" rows scroll sideways, which clips them
   top and bottom too: the padding is room for the focused card's glow
   (navigation.css [data-focusable].focused, 20px), taken back with the
   negative margin so the cards keep their place. */
.detail-people {
  display: flex;
  /* Top-aligned: stretched, the cards centred their content, and the
     director's extra "Director" line lifted its photo above the rest. */
  align-items: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 24px 24px 28px;
  margin: -16px -24px -8px;
}
.detail-person {
  width: 148px;
  flex: 0 0 auto;
  margin: 0 14px 0 0;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
}
.detail-person.focused {
  border-color: var(--catalog-focus);
  box-shadow: 0 0 0 4px rgba(var(--catalog-focus-rgb-legacy), 0.28);
}
.detail-person-photo {
  display: block;
  width: 142px;
  height: 213px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--catalog-surface);
}
.detail-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-person-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: calc(48px * var(--font-scale));
  font-weight: 700;
  color: var(--text-secondary);
}
.detail-person-name {
  display: block;
  padding: 8px 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(18px * var(--font-scale));
}
.detail-person-role {
  display: block;
  padding: 2px 4px 6px;
  font-size: calc(15px * var(--font-scale));
  color: var(--text-secondary);
}
.detail-related { margin-top: 24px; }
.detail-title-row { display: flex; overflow-x: auto; padding: 24px 24px 28px; margin: -16px -24px -20px; }
.detail-title-card {
  width: 142px;
  flex: 0 0 auto;
  margin-right: 16px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}
.detail-title-card.focused { border-color: var(--catalog-focus); }
/* The open title in its own series' row: where it sits, quieter. */
.detail-title-card.is-current .detail-title-art { opacity: 0.5; }
.detail-title-art {
  position: relative;
  display: block;
  width: 136px;
  height: 204px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--catalog-surface);
}
.detail-title-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-title-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: calc(50px * var(--font-scale));
}
.detail-title-name {
  display: block;
  padding: 8px 3px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(18px * var(--font-scale));
}

.detail-stage {
  position: relative;
}
.catalog-view.movies-detail,
.catalog-view.series-detail {
  position: relative;
  overflow: hidden;
  padding: 0;
  background-color: var(--bg-primary);
}
/* Focus moves at once on a title's page, no transition. Its buttons are
   glass over a full-screen picture, so every frame of a focus animation
   re-blurred what lies under them: ~450ms of GPU work per press on the C3,
   a choppy ~14 frames a second (the owner: "like 3 fps"). Without it, one
   frame. The cards on the homes already move this way. */
.catalog-view.movies-detail [data-focusable],
.catalog-view.series-detail [data-focusable],
.catalog-view.movies-detail button,
.catalog-view.series-detail button {
  transition: none !important;
}
.detail-backdrop {
  /* The whole screen, under the glass tab bar too: the page itself starts
     below the bar, the picture doesn't (the owner). Fixed escapes the
     page's overflow clip; nothing above it is transformed. */
  position: fixed;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  z-index: 0;
  background-color: var(--bg-primary);
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  pointer-events: none;
}
.detail-backdrop::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.72) 42%, rgba(0, 0, 0, 0.28) 100%),
    /* Light at the very top, where the glass tab bar shows the picture. */
    linear-gradient(0deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.22) 40%, rgba(0, 0, 0, 0.45) 85%, rgba(0, 0, 0, 0.15) 100%);
}
/* A TV drawing at 4K (data-density): on a title's page the glass of the
   buttons, the subtitles box and the version cards keeps its tint but not
   the blur, which was redone for each of them every frame of a scroll over
   the fixed backdrop: 2-5 frames shown in half a second there, 7-13
   without (Follow-up 151). */
html[data-density="2x"] .detail-scroll * { backdrop-filter: none; }

.detail-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  box-sizing: border-box;
  padding: 40px 80px 140px;
  overflow-x: hidden;
  overflow-y: auto;
}
.detail-content,
.person-panel,
.detail-discovery,
.series-episodes {
  position: relative;
  z-index: 1;
}
.movies-detail .detail-content {
  display: flex;
  gap: 56px;
}
.movies-detail .detail-content-cinematic {
  display: block;
}
.person-panel { max-width: 1600px; }
.person-head {
  display: flex;
  gap: 40px;
  margin-bottom: 28px;
}
.person-photo {
  width: 260px;
  height: 390px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: var(--catalog-surface);
}
.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.person-body { flex: 1 1 auto; min-width: 0; }
/* A title's overview: five lines, cut at a word with "(...)" after it when
   it runs longer (catalog-view.ts plotBlock); OK on it shows the rest. The
   height is only a guard until it has been measured. */
.detail-plot-wrap {
  max-width: 1016px;
  margin: 0 0 21px -11px;
  border: 3px solid transparent;
  border-radius: 10px;
  padding: 4px 8px;
}
.detail-plot-wrap.focused { border-color: var(--catalog-focus); }
.detail-plot-wrap .detail-plot {
  margin: 0;
  max-height: 210px;
  overflow: hidden;
}
.detail-plot-wrap.is-expanded .detail-plot { max-height: none; }

/* Five lines (28px at 1.5), then "(...)" in the corner over a fade; OK on
   it shows the rest (catalog-view.ts markBioClamp, personBioExpanded). */
.person-bio-wrap {
  position: relative;
  max-width: 1000px;
  margin: 0 0 24px;
  border: 3px solid transparent;
  border-radius: 10px;
  padding: 4px 8px;
  margin-left: -11px;
}
.person-bio-wrap.focused { border-color: var(--catalog-focus); }
.person-bio-wrap .person-bio {
  max-height: 210px;
  margin: 0;
  overflow: hidden;
}
.person-bio-wrap.is-expanded .person-bio { max-height: none; }
.person-bio-more {
  display: none;
  position: absolute;
  right: 8px;
  bottom: 4px;
  padding-left: 48px;
  font-size: calc(28px * var(--font-scale));
  line-height: 42px;
  color: var(--text-secondary);
  background: linear-gradient(90deg, transparent 0, var(--bg-primary) 40px);
}
.person-bio-wrap.is-clamped:not(.is-expanded) .person-bio-more { display: block; }

.trailer-player {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5000;
  padding: 64px;
  background: rgba(0, 0, 0, 0.92);
  box-sizing: border-box;
}
.trailer-shell { position: relative; width: 100%; height: 100%; }
.trailer-frame { width: 100%; height: 100%; border: 0; background: #000; }
.trailer-close {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1;
  padding: 12px 22px;
  border: 3px solid #fff;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: calc(22px * var(--font-scale));
}

@media (prefers-reduced-motion: reduce) {
  .detail-logo { animation: none; }
}
