:root {
  color-scheme: dark;
  /* Arctic Fuse 2 palette — derived from the Android app's colors.xml */
  --bg: #000000;
  --bg-card: #0d0d0d;
  --bg-elevated: #1a1a1a;
  --text: #ededed;
  --muted: rgba(237, 237, 237, 0.7);
  --soft: rgba(237, 237, 237, 0.5);
  --chip: rgba(237, 237, 237, 0.12);
  --chip-focus: rgba(237, 237, 237, 0.22);
  --line: rgba(237, 237, 237, 0.16);
  --gold: #ffcd3c;
  --green: #00d588;
  --red: #e74c3c;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

select {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0 14px;
  outline: none;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.12), transparent 22%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.74) 34%, rgba(0, 0, 0, 0.26) 70%, rgba(0, 0, 0, 0.08) 100%),
    #050505;
  overflow-x: hidden;
  width: 100%;
}

.app-boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(0, 213, 136, 0.12), transparent 30%),
    linear-gradient(180deg, #050607, #000);
  color: #fff;
}

.app-boot-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(0, 213, 136, 0.26));
}

.app-boot-wordmark {
  height: 18px;
  width: auto;
  filter: drop-shadow(0 0 28px rgba(0, 213, 136, 0.26));
}

.mobile-header,
.mobile-bottom-nav {
  display: none !important;
}

.sidebar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: clamp(74px, 9.1vh, 98px);
  padding: 0 3.35vw;
  display: grid;
  grid-template-columns: minmax(150px, 16vw) 1fr minmax(92px, 10vw);
  align-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.36), transparent);
  pointer-events: none;
}

.profile-cluster,
.sidebar nav,
.top-right {
  pointer-events: auto;
}

.profile-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand {
  width: clamp(38px, 3.05vw, 58px);
  height: clamp(38px, 3.05vw, 58px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}

.brand img {
  width: 100%;
  height: 100%;
}

.profile-name {
  width: clamp(70px, 6vw, 112px);
  height: clamp(14px, 1.15vw, 22px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: transparent;
  overflow: hidden;
}

.sidebar nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 0.94vw, 18px);
}

.nav-item {
  min-width: 0;
  min-height: clamp(44px, 3.05vw, 58px);
  padding: 0 clamp(14px, 1.25vw, 24px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  display: inline-flex;
  align-items: center;
  gap: clamp(7px, 0.63vw, 12px);
  font-size: clamp(18px, 1.45vw, 28px);
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.nav-item svg {
  width: clamp(19px, 1.45vw, 28px);
  height: clamp(19px, 1.45vw, 28px);
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-active {
  outline: none;
  color: #fff;
  background: var(--chip-focus);
}

/* Scale is a hover affordance only — a persistently scaled active tab would
   sit 1-2px off against its siblings. */
.nav-item:hover,
.nav-item:focus-visible {
  transform: scale(1.045);
}

.top-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.1vw, 22px);
}

.settings-gear {
  width: clamp(40px, 3vw, 54px);
  height: clamp(40px, 3vw, 54px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.settings-gear:hover,
.settings-gear:focus-visible,
.settings-gear.is-active {
  outline: none;
  color: #fff;
  background: var(--chip-focus);
  transform: scale(1.045);
}

.content {
  min-height: 100vh;
  position: relative;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.sync-strip {
  position: fixed;
  right: 3.35vw;
  top: clamp(80px, 9.6vh, 104px);
  z-index: 40;
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  opacity: 0.72;
}

.screen {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  padding: clamp(120px, 15vh, 160px) 0 78px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

/* Screens that already supply their own top offset must not stack this one:
   .section-heading carries clamp(112px, 14.3vh, 154px) of its own padding
   (Watchlist/Browse/Addons), a hero fills the space itself, and .livetv-shell
   sets its own. Without these exclusions those pages rendered ~232px of empty
   space above the first heading instead of ~112px. */
.screen:has(.hero),
.screen:has(> .section-heading:first-child),
.screen.livetv-shell {
  padding-top: 0;
}

.hero {
  min-height: 100vh;
  width: 100%;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  padding: clamp(140px, 16vh, 195px) 3.35vw clamp(145px, 20.2vh, 218px);
  background-size: cover;
  background-position: center right;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.76) 33%, rgba(0, 0, 0, 0.22) 72%, transparent),
    linear-gradient(0deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.28) 32%, rgba(0, 0, 0, 0.06) 80%);
}

.hero-copy {
  position: relative;
  width: min(760px, 52vw);
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 clamp(8px, 1.7vh, 18px);
  color: rgba(255, 255, 255, 0.82);
  text-transform: none;
  font-size: clamp(18px, 1.5vw, 29px);
  line-height: 1.2;
  font-weight: 500;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h2 {
  margin: 0 0 clamp(12px, 2vh, 22px);
  font-size: clamp(40px, 5.2vw, 86px);
  line-height: 0.95;
  font-weight: 820;
  letter-spacing: 0;
  text-shadow: 0 5px 20px rgba(0, 0, 0, 0.55);
}

.hero-copy p:not(.eyebrow) {
  max-width: 980px;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(18px, 1.5vw, 29px);
  line-height: 1.48;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.65);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: clamp(14px, 2.4vh, 26px);
  /* The first rail after the hero is pulled UP over it (Netflix-style overlap,
     `.hero + .rail`, up to -150px). A tall hero block — a title treatment near
     `.hero-logo`'s max-height plus a three-line synopsis — then grows down INTO
     that overlap and the buttons end up glued to the rail heading. This reserve
     mirrors the pull exactly, so the rail can never reach the buttons.
     Verified harmless where the overlap doesn't apply: adding it left the
     measured button-to-heading gap unchanged (the hero simply grows), so it
     costs nothing on layouts that were already fine. */
  margin-bottom: clamp(96px, 17vh, 150px);
}

.primary,
.secondary {
  min-height: clamp(48px, 6.1vh, 66px);
  border-radius: clamp(16px, 2.2vh, 24px);
  padding: 0 clamp(20px, 1.56vw, 30px);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  cursor: pointer;
  font-size: clamp(17px, 1.3vw, 25px);
  font-weight: 620;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary {
  background: #fff;
  color: #050505;
}

.secondary {
  width: clamp(48px, 6.1vh, 66px);
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.secondary span {
  white-space: nowrap;
}

/* ---- Refined hover / focus system ----
   Mouse hover = smooth lift + zoom (no hard ring).
   Keyboard focus = accent ring (accessibility / remote nav). */

.primary,
.secondary {
  transition: transform 180ms ease, box-shadow 200ms ease, background 180ms ease;
}
.primary:hover,
.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
.primary:focus-visible,
.secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent, #fff);
}

.source-row:hover,
.channel-row button:hover {
  background: rgba(237, 237, 237, 0.16);
}
.source-row:focus-visible,
.channel-row button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent, #fff);
}

.rail {
  margin-top: 8px;
  padding: 0 0 0 3.35vw;
  position: relative;
  z-index: 5;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  /* Skip layout/paint for rails far from the viewport — the single biggest win
     for smooth vertical scrolling with many rails. The intrinsic-size estimate
     keeps the scrollbar stable before a rail has been rendered. */
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}

/* Only the first rail after the hero overlaps it (Netflix-style). */
.hero + .rail,
.hero + .rail-skeleton {
  margin-top: clamp(-274px, -33.3vh, -220px);
  /* The hero-overlapping rail is always on-screen; keep it fully rendered so
     containment never interferes with the negative-margin overlap. */
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

.rail-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(10px, 1.5vh, 16px);
}

.rail-head h3,
.section-heading h2 {
  margin: 0;
  font-size: clamp(25px, 1.98vw, 38px);
  font-weight: 500;
}

.rail-head span {
  color: var(--soft);
  font-size: 20px;
}

.rail-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(280px, 22.1vw, 424px);
  gap: clamp(16px, 1.25vw, 24px);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 6px 3.35vw clamp(22px, 3.15vh, 34px) 0;
  scrollbar-width: none;
}

.rail-strip::-webkit-scrollbar {
  display: none;
}

.rail-scroll-shell {
  position: relative;
  min-width: 0;
}

.rail-scroll-shell::before,
.rail-scroll-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 18px;
  z-index: 11;
  width: clamp(54px, 7vw, 126px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.rail-scroll-shell::before {
  left: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0));
}

.rail-scroll-shell::after {
  right: 0;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0));
}

.rail-scroll-shell.can-prev::before,
.rail-scroll-shell.can-next::after {
  opacity: 1;
}

.rail-arrow {
  position: absolute;
  top: 50%;
  z-index: 12;
  width: clamp(42px, 3.3vw, 56px);
  height: clamp(42px, 3.3vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    rgba(0, 0, 0, 0.58);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.rail-arrow-left {
  left: clamp(2px, 0.5vw, 10px);
}

.rail-arrow-right {
  right: clamp(12px, 3vw, 54px);
}

.rail-arrow:hover,
.rail-arrow:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #fff) 62%, transparent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.11)),
    rgba(0, 0, 0, 0.74);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent, #fff) 40%, transparent),
    0 20px 58px rgba(0, 0, 0, 0.58);
}

.rail-arrow-left:hover,
.rail-arrow-left:focus-visible {
  transform: translateY(-50%) translateX(-2px);
}

.rail-arrow-right:hover,
.rail-arrow-right:focus-visible {
  transform: translateY(-50%) translateX(2px);
}

.rail-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.detail-wide .rail-arrow-right,
.episodes-section .rail-arrow-right,
.person-content .rail-arrow-right {
  right: clamp(4px, 1vw, 16px);
}

.media-card {
  width: clamp(280px, 22.1vw, 424px);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.poster {
  aspect-ratio: 16 / 9;
  border-radius: clamp(12px, 0.94vw, 18px);
  overflow: hidden;
  background: linear-gradient(135deg, #242735, #0b0b10);
  border: 0;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 260ms ease;
  transform-origin: center bottom;
  will-change: transform;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: arvio-img-in 420ms ease both;
}

@keyframes arvio-img-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Hover: lift + zoom the poster only (title text stays put) */
.media-card:hover {
  z-index: 6;
}
.media-card:hover .poster {
  transform: scale(1.05);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.62);
}
.media-card:hover .poster img {
  transform: scale(1.06);
}

/* Keyboard / remote focus: accent ring on the poster */
.media-card:focus-visible {
  outline: none;
  z-index: 6;
}
.media-card:focus-visible .poster {
  transform: scale(1.04);
  box-shadow: 0 0 0 3px var(--accent, #fff), 0 22px 46px rgba(0, 0, 0, 0.55);
}

.media-card strong {
  transition: color 160ms ease;
}
.media-card:hover strong {
  color: #fff;
}

.poster svg {
  color: rgba(255, 255, 255, 0.62);
}

.progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  background: var(--green);
}

.media-card strong,
.media-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card strong {
  margin-top: clamp(10px, 1.5vh, 16px);
  font-size: clamp(20px, 1.6vw, 31px);
  line-height: 1.08;
  font-weight: 460;
}

.media-card span {
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(15px, 1.2vw, 23px);
  margin-top: 3px;
}

.section-heading {
  padding: clamp(112px, 14.3vh, 154px) 3.35vw 0;
}

.section-heading .eyebrow {
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 20px;
}

.section-heading h2 {
  font-size: clamp(36px, 2.8vw, 54px);
}

.search-hero {
  min-height: clamp(190px, 24vh, 260px);
  padding: clamp(108px, 13.9vh, 150px) 3.35vw 34px;
  display: flex;
  align-items: center;
  gap: 18px;
}

input {
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0 18px;
  outline: none;
}

input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.search-hero input {
  flex: 1;
  min-height: 72px;
  border-radius: 999px;
  font-size: 31px;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
}

.grid-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, clamp(280px, 22.1vw, 424px));
  gap: 34px 24px;
  padding: 0 3.35vw 64px;
}

.details-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  overflow-y: auto;
}

.close {
  position: fixed;
  right: 48px;
  top: 42px;
  z-index: 4;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.detail-backdrop {
  position: absolute;
  inset: 0 0 auto;
  height: 680px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.46) 58%, transparent),
    linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.18) 42%, transparent),
    linear-gradient(135deg, #222, #080808);
  background-size: cover;
  background-position: center right;
}

.detail-body {
  position: relative;
  z-index: 2;
  width: min(1080px, 68vw);
  padding: 148px 0 80px 64px;
}

.detail-body h2 {
  margin: 0 0 22px;
  font-size: clamp(54px, 6vw, 104px);
  line-height: 0.98;
}

.detail-body p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.91);
  font-size: 28px;
  line-height: 1.48;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 30px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 28px;
}

.trailer-link {
  width: fit-content;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  color: #050505;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
}

.detail-section {
  margin-top: 34px;
}

.detail-section h3 {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 650;
}

.mini-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 142px;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
}

.mini-strip::-webkit-scrollbar {
  display: none;
}

.mini-card {
  min-width: 0;
}

.mini-card img,
.mini-card > svg {
  width: 142px;
  height: 196px;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.mini-card.person img,
.mini-card.person > svg {
  height: 142px;
  border-radius: 999px;
}

.mini-card strong,
.mini-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card strong {
  margin-top: 8px;
  font-size: 15px;
}

.mini-card span {
  color: var(--muted);
  font-size: 13px;
}

.rail-strip.compact {
  grid-auto-columns: 240px;
  padding-right: 0;
}

.rail-strip.compact .media-card {
  width: 240px;
}

.chips span {
  min-height: 36px;
  padding: 5px 14px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.52);
  color: rgba(255, 255, 255, 0.86);
  font-size: 21px;
}

.source-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.source-row {
  width: min(980px, calc(100vw - 128px));
  min-height: 76px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 12px 18px;
  cursor: pointer;
}

.source-row strong {
  font-size: 23px;
}

.source-row span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 17px;
}

.quality {
  color: var(--gold) !important;
  font-weight: 800;
}

.quality.muted {
  color: var(--soft) !important;
}

.empty {
  color: var(--muted);
}

/* ── Web membership paywall ──────────────────────────────────────────────── */
.paywall,
.paywall-boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(120% 120% at 50% 0%, #0e1417 0%, #070809 60%);
}
.paywall-spinner {
  animation: arvio-spin 0.9s linear infinite;
}
@keyframes arvio-spin { to { transform: rotate(360deg); } }
.paywall-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  background: rgba(16, 18, 21, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 34px 28px 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}
.paywall-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}
.paywall-logo { width: 38px; height: 38px; }
.paywall-wordmark { height: 20px; width: auto; }
.paywall-card h1 {
  font-size: 22px;
  font-weight: 750;
  margin: 0 0 10px;
  line-height: 1.25;
}
.paywall-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 22px;
}
.paywall-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}
.paywall-amount { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.paywall-period { color: var(--muted); font-size: 15px; }
.paywall-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 13px;
  background: linear-gradient(90deg, #00d588, #09b3f0);
  color: #04120c;
  font-weight: 750;
  font-size: 15px;
  text-decoration: none;
}
.paywall-primary:hover { filter: brightness(1.06); }
.paywall-trial,
.paywall-link-toggle,
.paywall-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}
.paywall-trial {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 650;
  font-size: 14px;
}
.paywall-trial:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }
.paywall-trial:disabled { opacity: 0.6; cursor: default; }
.paywall-link-toggle {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
}
.paywall-link-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.paywall-link-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font: inherit;
}
.paywall-link-row button {
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}
.paywall-error {
  color: #ff8080;
  font-size: 13px;
  margin: 14px 0 0;
}
.paywall-signout {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}
.paywall-signout:hover { color: #fff; }

.vlc-setup-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 213, 136, 0.1);
  border: 1px solid rgba(0, 213, 136, 0.24);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}
.vlc-setup-hint button {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 9px;
  border: 0;
  background: linear-gradient(90deg, #00d588, #09b3f0);
  color: #04120c;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.vlc-setup-hint button:hover { filter: brightness(1.06); }

.episode-retry {
  background: none;
  border: 1px solid var(--muted);
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 2px 12px;
}

.episode-retry:hover {
  border-color: var(--accent, #ededed);
  color: var(--accent, #ededed);
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
}

.player-overlay video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-top {
  position: absolute;
  inset: 0 0 auto;
  min-height: 120px;
  padding: max(28px, env(safe-area-inset-top)) 48px 28px;
  display: flex;
  justify-content: space-between;
  background: none;
  pointer-events: none;
}

.player-top button {
  pointer-events: auto;
}

.player-top h2 {
  margin: 0;
  font-size: 34px;
}

.player-meta {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
}

.live-layout {
  grid-template-columns: 380px 1fr;
  align-items: start;
  gap: 32px;
  padding: 154px 64px 80px;
}

.live-panel,
.settings-panel,
.addon-tile {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
}

.live-panel h2,
.settings-panel h2 {
  margin: 0 0 18px;
  font-size: 36px;
}

.inline-form {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1 1 180px;
}

.inline-form.wide {
  padding: 0 64px;
}

.inline-form.wide input {
  flex-basis: 520px;
}

.playlist-list,
.channel-list,
.login-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.playlist-list button,
.channel-row,
.account-row,
.setting-row {
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.playlist-list button {
  justify-content: space-between;
  cursor: pointer;
}

.playlist-list em,
.account-row span {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.channel-browser {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.channel-group h3 {
  margin: 0 0 12px;
  font-size: 32px;
}

.channel-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.channel-group-head h3 {
  margin: 0;
}

.channel-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.channel-row {
  padding: 0;
  overflow: hidden;
}

.channel-row button:first-child {
  flex: 1;
  min-width: 0;
  min-height: 60px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.channel-row img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
}

.channel-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-row span em {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.star {
  width: 46px;
  height: 58px;
  border: 0;
  background: transparent;
  color: var(--soft);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.star.active {
  color: var(--gold);
}

.addon-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  padding: 0 64px 64px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.addon-tile p {
  color: var(--muted);
  line-height: 1.5;
}

.setting-row {
  justify-content: space-between;
  margin-top: 12px;
}

.setting-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.setting-row input[type="checkbox"] {
  min-height: 0;
  width: 22px;
  height: 22px;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.settings-list-row {
  min-height: 58px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.settings-list-row input {
  min-height: 44px;
}

.settings-list-row span {
  color: var(--muted);
  font-size: 13px;
}

.parity-list {
  gap: 12px;
}

.parity-row {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
}

.parity-row strong,
.parity-row span {
  display: block;
}

.parity-row strong {
  font-size: 18px;
}

.parity-row span,
.parity-row p {
  color: var(--muted);
  font-size: 13px;
}

.parity-row p {
  grid-column: 1 / -1;
  margin: 0;
}

.parity-row em {
  height: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
}

.parity-row.status-complete em {
  background: rgba(32, 208, 112, 0.22);
  color: #7dffb1;
}

.parity-row.status-partial em {
  background: rgba(244, 197, 31, 0.2);
  color: var(--gold);
}

.parity-row.status-blocked em {
  background: rgba(255, 107, 107, 0.18);
  color: #ff9a9a;
}

.icon-button,
.pill {
  min-width: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.pill {
  padding: 0 12px;
  font-size: 13px;
}

.pill.active,
.icon-button:focus-visible,
.pill:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.danger {
  color: #ff8585 !important;
}

.text-button {
  width: auto;
  min-width: max-content;
  padding: 0 16px;
  border-radius: 999px;
}

.device-code {
  margin-top: 16px;
}

.device-code span {
  display: inline-flex;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(244, 197, 31, 0.16);
  color: var(--gold);
  font-size: 30px;
  font-weight: 900;
}

/* ── Telegram settings ───────────────────────────────────────────────────── */
.tg-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 12px 0 4px;
  text-align: center;
}

.tg-lead {
  max-width: 460px;
  color: var(--text, #fff);
}

.tg-error {
  color: var(--pink, #ff4d6d);
}

.tg-fineprint {
  font-size: 12px;
}

.tg-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.tg-qr {
  display: inline-flex;
  padding: 14px;
  background: #fff;
  border-radius: 16px;
}

.tg-qr img {
  display: block;
  border-radius: 4px;
}

.tg-connected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 0;
}

.tg-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.28);
}

.tg-badge strong {
  color: #34c759;
}

.tg-badge span {
  color: var(--muted);
  font-size: 13px;
}

.danger-button {
  background: rgba(255, 77, 109, 0.14);
  border: 1px solid rgba(255, 77, 109, 0.4);
  color: var(--pink, #ff4d6d);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(720px, calc(100vw - 32px));
  border: 0;
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.96);
  color: var(--text);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

@media (max-width: 980px) {
  .sidebar {
    height: 86px;
    padding: 0 18px;
    grid-template-columns: 76px 1fr auto;
  }

  .profile-name {
    display: none;
  }

  .sidebar nav {
    justify-content: flex-start;
    overflow-x: auto;
    gap: 8px;
  }

  .nav-item {
    min-height: 50px;
    padding: 0 15px;
    font-size: 17px;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .hero {
    min-height: 620px;
    padding: 112px 24px 190px;
  }

  .hero-copy {
    width: min(100%, 680px);
  }

  .hero h2 {
    font-size: 48px;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 20px;
  }

  .primary,
  .secondary {
    min-height: 54px;
    font-size: 18px;
  }

  .rail {
    margin-top: 8px;
    padding-left: 24px;
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: -170px;
  }

  .rail-strip {
    grid-auto-columns: 310px;
    gap: 16px;
    padding-right: 24px;
  }

  .media-card {
    width: 310px;
  }

  .media-card strong {
    font-size: 22px;
  }

  .media-card span {
    font-size: 17px;
  }

  .live-layout,
  .section-heading,
  .search-hero {
    padding-left: 24px;
    padding-right: 24px;
  }

  .live-layout {
    grid-template-columns: 1fr;
  }

  .addon-grid,
  .settings-grid,
  .grid-results,
  .inline-form.wide {
    padding-left: 24px;
    padding-right: 24px;
  }

  .detail-body {
    width: auto;
    padding: 126px 24px 70px;
  }
}

/* ============================================================
   Phase 1 — Login, Profile Selection, avatars, profile switcher
   ============================================================ */

.profile-name-text {
  font-size: clamp(14px, 1vw, 18px);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: clamp(80px, 8vw, 160px);
}

/* Avatar visual (shared) */
.avatar-visual {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  object-fit: cover;
}
.avatar-emoji {
  width: 78%;
  height: 78%;
  object-fit: contain;
}
.avatar-letter span {
  font-size: 0.42em;
  font-weight: 800;
  color: #fff;
}

/* ---- Profile selection ---- */
.profile-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #050505, #000 64%);
  padding: 48px 24px;
  overflow: hidden;
}
.profile-center {
  width: min(1180px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}
.profile-brand {
  font-size: clamp(26px, 2.6vw, 40px);
  font-weight: 800;
  letter-spacing: 0.32em;
  color: #fff;
  margin-bottom: 14px;
}
.profile-heading {
  margin: 0 0 clamp(36px, 5vh, 56px);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 400;
  color: var(--muted);
}
.profile-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 2.4vw, 40px);
  width: 100%;
  max-width: 1040px;
}
.profile-pick {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--soft);
  transition: color 150ms ease;
}
.avatar-tile {
  width: clamp(96px, 8.5vw, 132px);
  height: clamp(96px, 8.5vw, 132px);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 3px solid transparent;
  transition: transform 150ms ease, border-color 150ms ease;
  background: var(--bg-elevated);
}
.avatar-tile.lg {
  width: 120px;
  height: 120px;
}
.avatar-tile.add {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.28);
}
.profile-pick:hover .avatar-tile,
.profile-pick:focus-visible .avatar-tile {
  transform: scale(1.07);
  border-color: #fff;
  outline: none;
}
.profile-pick:hover,
.profile-pick:focus-visible {
  color: #fff;
}
.profile-pick span {
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 500;
}
.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  color: #fff;
}
.manage-profiles-btn {
  margin-top: clamp(36px, 5vh, 56px);
  padding: 10px 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.manage-profiles-btn:hover,
.manage-profiles-btn:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}
.cloud-connect-btn {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.cloud-connect-btn:hover,
.cloud-connect-btn:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ---- Login ---- */
.login-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 76% 20%, rgba(0, 213, 136, 0.16), transparent 30%),
    radial-gradient(circle at 18% 78%, rgba(103, 183, 255, 0.12), transparent 28%),
    linear-gradient(135deg, #050505 0%, #0b1018 54%, #020202 100%);
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 56px);
  overflow: hidden;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  pointer-events: none;
}
.login-back {
  position: absolute;
  top: 32px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}
.login-back:hover { color: #fff; }
.login-hero {
  position: relative;
  width: min(1180px, 100%);
  min-height: min(640px, calc(100vh - 88px));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
  align-items: center;
  gap: clamp(28px, 5vw, 78px);
}
.login-copy { min-width: 0; }
.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  margin-bottom: clamp(24px, 4vh, 42px);
  /* Keep the lockup inside its grid column — the wide wordmark SVG (width:auto)
     was overflowing right and sliding under the sign-in card. */
  max-width: 100%;
  min-width: 0;
}
.login-brand-logo {
  flex: 0 0 auto;
  width: clamp(68px, 7vw, 112px) !important;
  height: clamp(68px, 7vw, 112px) !important;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(0, 213, 136, 0.24));
}
.login-wordmark {
  height: clamp(34px, 4.4vw, 68px) !important;
  /* Cap width to the remaining column space; the SVG keeps its aspect ratio via
     object-fit and simply scales down instead of overflowing. */
  width: auto !important;
  max-width: 100%;
  min-width: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(0, 213, 136, 0.24));
}
.login-tag {
  font-size: clamp(26px, 2.8vw, 46px);
  line-height: 1.05;
  font-weight: 760;
  color: #fff;
  margin: 0 0 16px;
}
.login-sub {
  font-size: clamp(16px, 1.35vw, 22px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  max-width: 610px;
}
.login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(22px, 3vh, 34px);
}
.login-proof span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 650;
}
.login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(24px, 3vw, 34px);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(26px);
}
.login-card-title {
  margin: 0 0 8px;
  font-size: clamp(20px, 1.7vw, 26px);
  font-weight: 760;
  color: #fff;
}
.login-error {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #3d1515;
  color: #ef4444;
  font-size: 13px;
}
.login-submit { width: 100%; }
/* Sign-up variant: the submit is an <a> to the auth site. Keep it identical to
   the .primary button and centre its label. */
a.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
.login-signup-copy {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 4px;
  max-width: none;
}
.login-toggle {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}
.login-toggle:hover { color: #fff; }

@media (max-width: 860px) {
  .login-shell {
    overflow-y: auto;
  }
  .login-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 26px;
    align-content: center;
  }
  .login-brand-lockup {
    margin-bottom: 18px;
  }
  .login-sub {
    max-width: none;
  }
}

/* ---- Profile add/edit dialog ---- */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
}
.profile-dialog {
  width: min(720px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.profile-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profile-dialog-head h2 { margin: 0; font-size: 26px; }
.profile-dialog-preview {
  display: grid;
  place-items: center;
  margin: 14px 0 18px;
}
.profile-name-input {
  width: 100%;
  margin-bottom: 18px;
}
.profile-dialog-label {
  margin: 8px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.color-dot {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
}
.color-dot.is-active { border-color: #fff; }
.avatar-picker {
  display: grid;
  gap: 18px;
}
.avatar-category-label {
  display: block;
  font-size: 13px;
  color: var(--soft);
  margin-bottom: 8px;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 10px;
}
.avatar-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 8px;
  display: grid;
  place-items: center;
}
.avatar-cell img { width: 100%; height: 100%; object-fit: contain; }
.avatar-cell.is-active { border-color: #fff; }
.profile-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ============================================================
   Phase 2 — Home: hero logo + metadata, card logo overlay, badges
   ============================================================ */

.hero-logo {
  max-width: min(46vw, 520px);
  max-height: clamp(110px, 18vh, 200px);
  object-fit: contain;
  object-position: left bottom;
  margin: 0 0 clamp(12px, 2vh, 22px);
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6));
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  margin-bottom: clamp(10px, 1.6vh, 18px);
  color: rgba(237, 237, 237, 0.82);
  font-size: clamp(15px, 1.15vw, 22px);
  font-weight: 500;
}
.hero-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-meta > span + span::before {
  content: "•";
  margin-right: clamp(8px, 1vw, 16px);
  color: rgba(237, 237, 237, 0.4);
}
.hero-rating {
  color: var(--gold);
  font-weight: 700;
}
.hero-rating::before { color: rgba(237, 237, 237, 0.4); }

/* Card title-treatment logo overlay (landscape) */
.media-card .poster .card-logo {
  position: absolute;
  left: 10px;
  bottom: 12px;
  width: 52%;
  max-height: 42%;
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.7));
  z-index: 2;
}

/* Watched green check badge */
/* Watched: solid green circle with a clear white checkmark, top-right of the
   artwork (matches the Android app). */
.media-card .watched-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  /* Full-strength white — a lower-specificity .media-card span rule was dimming
     it to 76% opacity. */
  color: #ffffff !important;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

.watched-badge svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.detail-title-line {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(760px, 100%);
}

.detail-title-line h2 {
  margin: 0 0 18px;
}

.detail-watched-badge {
  position: relative;
  right: auto;
  bottom: auto;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  margin-bottom: 18px;
  background: rgba(0, 213, 136, 0.22);
  box-shadow: 0 0 26px rgba(0, 213, 136, 0.24);
}

.detail-watched-badge svg {
  width: 15px;
  height: 15px;
}

.episode-watched-badge {
  right: 12px;
  bottom: 12px;
  width: 22px;
  height: 22px;
  background: rgba(0, 213, 136, 0.22);
  box-shadow: 0 0 22px rgba(0, 213, 136, 0.22);
}

.episode-watched-badge svg {
  width: 13px;
  height: 13px;
}

/* Continue-watching pill badge (time remaining / new episode) */
.cw-badge {
  position: absolute;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(26, 26, 26, 0.85);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.cw-badge.top-right { top: 8px; right: 8px; }

/* Continue-watching progress bar */
.cw-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  overflow: hidden;
  z-index: 2;
}
.cw-progress > span {
  display: block;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
}

/* Lazy rail skeletons (rows load as they scroll into view) */
.rail-skeleton {
  min-height: clamp(220px, 28vh, 320px);
}
.card-skeleton {
  width: clamp(280px, 22.1vw, 424px);
  aspect-ratio: 16 / 9;
  border-radius: clamp(12px, 0.94vw, 18px);
  background: linear-gradient(100deg, var(--bg-card) 30%, var(--bg-elevated) 50%, var(--bg-card) 70%);
  background-size: 200% 100%;
  animation: arvio-shimmer 1.4s ease-in-out infinite;
}

.rail-skeleton.is-poster .card-skeleton {
  width: clamp(150px, 12vw, 210px);
  aspect-ratio: 2 / 3;
}
@keyframes arvio-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   Phase 3 — Details: seasons/episodes, reviews, locked sources
   ============================================================ */

.season-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.season-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.season-tab.is-active,
.season-tab:hover {
  background: #fff;
  color: #050505;
}

.episode-list {
  display: grid;
  gap: 12px;
}
.episode-row {
  display: flex;
  gap: 16px;
  text-align: left;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}
.episode-row:hover,
.episode-row:focus-visible,
.episode-row.is-active {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.episode-still {
  position: relative;
  flex-shrink: 0;
  width: 168px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  color: var(--soft);
}
.episode-still img { width: 100%; height: 100%; object-fit: cover; }
.episode-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  opacity: 0;
  transition: opacity 150ms ease;
}
.episode-row:hover .episode-play,
.episode-row.is-active .episode-play { opacity: 1; }
.episode-info { min-width: 0; }
.episode-info strong { display: block; font-size: 17px; margin-bottom: 4px; }
.episode-info > span { display: block; color: var(--soft); font-size: 13px; margin-bottom: 6px; }
.episode-info p {
  margin: 0;
  color: var(--muted);
  font-size: 14px !important;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-row.is-locked { opacity: 0.5; }
.source-row.is-locked .quality { color: var(--soft) !important; }

.review-list { display: grid; gap: 14px; }
.review-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  padding: 16px;
}
.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.review-head img { width: 32px; height: 32px; border-radius: 999px; object-fit: cover; }
.review-head strong { font-size: 15px; }
.review-rating {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
}
.review-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px !important;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Phase 4 — player next-episode control */
.player-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
.player-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.player-next:hover { background: rgba(255, 255, 255, 0.2); }

/* ============================================================
   Phase 5 — Settings (sidebar + sections)
   ============================================================ */

.app-shell.oled { background: #000 !important; }

.settings-shell {
  display: block;
  min-height: 100vh;
  padding: clamp(90px, 11vh, 125px) clamp(18px, 3.35vw, 64px) 80px;
  width: 100%;
  box-sizing: border-box;
}

.settings-sidebar {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: clamp(18px, 3.35vw, 64px);
  width: 240px;
  height: fit-content;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(14, 16, 20, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), padding 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: width;
  z-index: 30;
}

.settings-shell.sidebar-collapsed .settings-sidebar {
  width: 64px;
  padding: 14px 6px;
}

.settings-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  min-height: 38px;
  padding: 0 6px;
  overflow: hidden;
}

.settings-sidebar-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  opacity: 1;
  max-width: 160px;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-collapsed .settings-sidebar-title {
  opacity: 0;
  max-width: 0;
}

.settings-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.settings-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-section-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.sidebar-collapsed .settings-section-btn {
  justify-content: flex-start;
  padding: 10px 13px;
}

.settings-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.settings-btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  max-width: 160px;
  transition: opacity 0.2s ease, max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-collapsed .settings-btn-label {
  opacity: 0;
  max-width: 0;
}

.settings-section-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.09);
}

.settings-section-btn.is-active {
  color: #ffffff;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent, #fff) 22%, rgba(255, 255, 255, 0.08));
  border-color: color-mix(in srgb, var(--accent, #fff) 35%, rgba(255, 255, 255, 0.16));
  box-shadow: none !important;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  width: calc(100% - 264px);
  max-width: 1280px;
  margin-left: 264px;
  transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1), width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-collapsed .settings-content,
.settings-shell.sidebar-collapsed .settings-content {
  margin-left: 84px;
  width: calc(100% - 84px);
}

/* Settings Mobile Navigation Drawer Overlay & Floating Menu */
.settings-floating-menu-btn,
.settings-mobile-header {
  display: none;
}

.settings-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-mobile-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.settings-mobile-drawer {
  position: fixed;
  top: calc(50% + 10px);
  left: 12px;
  transform: translateY(-50%) translateX(-120%) scale(0.92);
  width: min(260px, 82vw);
  max-height: calc(88vh - 40px);
  background: rgba(12, 14, 18, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  z-index: 56;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  opacity: 0;
  overflow-y: auto;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.settings-mobile-overlay.is-open .settings-mobile-drawer {
  transform: translateY(-50%) translateX(0) scale(1);
  opacity: 1;
}

.settings-mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.settings-mobile-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.settings-mobile-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.settings-mobile-drawer-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.settings-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-mobile-nav .settings-section-btn {
  justify-content: flex-start !important;
  padding: 12px 14px !important;
  width: 100% !important;
}

.settings-mobile-nav .settings-btn-label {
  opacity: 1 !important;
  max-width: none !important;
}

@keyframes settings-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes settings-slide-right {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes settings-slide-float {
  from {
    transform: translateY(-50%) translateX(-120%) scale(0.94);
    opacity: 0;
  }
  to {
    transform: translateY(-50%) translateX(0) scale(1);
    opacity: 1;
  }
}

.settings-panel-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  box-sizing: border-box;
  min-height: 220px;
}
.settings-panel-card h2 {
  margin: 0 0 18px;
  font-size: 24px;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.set-row:last-child { border-bottom: 0; }
.set-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 16px;
  color: var(--text);
}
.set-label em {
  font-style: normal;
  font-size: 12px;
  color: var(--soft);
}
.set-control { display: flex; align-items: center; }
.set-control input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; }
.set-control input[type="number"], .set-control input[type="text"], .set-control input:not([type]),
.set-control input[type="password"], .set-control input[type="color"] { min-height: 42px; width: clamp(140px, 16vw, 220px); }
.set-control select { min-height: 42px; }

/* Phase 6 — Live TV EPG now/next */
.channel-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.channel-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epg-now, .epg-next {
  font-style: normal;
  font-size: 12px;
  color: rgba(237, 237, 237, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epg-next { color: rgba(237, 237, 237, 0.4); }
.epg-progress {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  margin: 2px 0;
}
.epg-progress > span { display: block; height: 100%; background: var(--green); }

/* ============================================================
   Phase 8 — poster mode, accent themes, spoiler blur
   ============================================================ */

/* Poster (portrait) card layout */
.rail.is-poster .rail-strip {
  grid-auto-columns: clamp(150px, 12vw, 210px);
}
.media-card.is-poster {
  width: clamp(150px, 12vw, 210px);
}
.media-card.is-poster .poster {
  aspect-ratio: 2 / 3;
}

.poster-results .grid-results {
  grid-template-columns: repeat(auto-fill, minmax(150px, 210px));
  align-items: start;
}

.poster-results .grid-results .media-card {
  width: 100%;
}

/* Accent theme — applied via --accent on .app-shell */
.app-shell .nav-item.is-active {
  background: color-mix(in srgb, var(--accent, #ededed) 24%, transparent);
}
/* (accent focus rings are defined in the refined hover/focus system above) */

/* Spoiler blur — hide episode/review text until hover */
.spoiler-blur .episode-info p,
.spoiler-blur .review-card p {
  filter: blur(5px);
  transition: filter 160ms ease;
}
.spoiler-blur .episode-row:hover .episode-info p,
.spoiler-blur .review-card:hover p {
  filter: none;
}

/* ============================================================
   Custom video player controls
   ============================================================ */

.player-overlay { cursor: default; }
.player-overlay.controls-off { cursor: none; }
.player-youtube { width: 100%; height: 100%; border: 0; }

/* Top bar fades with the controls */
.player-top {
  transition: opacity 250ms ease;
  z-index: 3;
}
.player-overlay.controls-off .player-top,
.player-overlay.controls-off .player-controls {
  opacity: 0;
  pointer-events: none;
}
.player-top.show { opacity: 1 !important; }
.player-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
}
.player-top-left h2 { margin: 0; font-size: 30px; }

.player-icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 160ms ease, transform 160ms ease;
}
.player-icon-btn:hover,
.player-icon-btn.is-active {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

/* Center states */
.player-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  z-index: 2;
  pointer-events: none;
}
.player-spinner svg { animation: arvio-spin 900ms linear infinite; }
@keyframes arvio-spin { to { transform: rotate(360deg); } }

.player-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
  z-index: 2;
}
.player-error p { font-size: 22px; font-weight: 700; margin: 0; }
.player-error span { color: var(--soft); }

.player-bigplay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 160ms ease, background 160ms ease;
}
.player-bigplay:hover { transform: scale(1.08); background: rgba(0, 0, 0, 0.66); }

/* Bottom controls */
.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 24px clamp(20px, 3vw, 48px) max(clamp(16px, 2vh, 28px), env(safe-area-inset-bottom));
  background: none;
  transition: opacity 250ms ease;
  display: grid;
  gap: 10px;
}
.player-controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.player-spacer { flex: 1; }
.player-time { font-size: 14px; color: rgba(255, 255, 255, 0.86); white-space: nowrap; }
.player-time em { color: var(--soft); font-style: normal; margin: 0 2px; }
.player-quality {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
}
.player-volume { display: flex; align-items: center; gap: 6px; }
.player-volume .volume-slider {
  width: 0;
  opacity: 0;
  transition: width 200ms ease, opacity 200ms ease;
}
.player-volume:hover .volume-slider { width: 90px; opacity: 1; }

/* Range sliders (scrubber + volume) */
.scrubber, .volume-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  background: linear-gradient(90deg,
    var(--accent, #fff) 0, var(--accent, #fff) var(--pct, 0%),
    rgba(255, 255, 255, 0.4) var(--pct, 0%), rgba(255, 255, 255, 0.4) var(--buf, var(--pct, 0%)),
    rgba(255, 255, 255, 0.16) var(--buf, var(--pct, 0%)), rgba(255, 255, 255, 0.16) 100%);
}
.scrubber { width: 100%; height: 6px; }
.scrubber::-webkit-slider-thumb,
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent, #fff);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.scrubber::-moz-range-thumb,
.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent, #fff);
  cursor: pointer;
}
.volume-slider { height: 5px; }
.volume-slider::-webkit-slider-thumb { width: 11px; height: 11px; }
.player-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}
.player-next:hover { background: rgba(255, 255, 255, 0.2); }

.player-metadata {
  max-width: min(860px, 58vw);
  align-items: flex-start;
}

.player-accent-rail {
  width: 4px;
  min-height: 74px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent, #fff), rgba(255, 255, 255, 0.24));
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.28);
}

.player-overview {
  max-width: 760px;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.player-source-warning {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.34);
  color: #fbd38d;
  font-size: 12px;
  font-weight: 700;
}

.player-action-pill {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.player-action-pill:hover,
.player-action-pill.is-active {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.16);
}

.player-badges {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.player-skip-overlay {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 122px;
  height: 122px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateY(-50%);
  pointer-events: none;
}

.player-skip-overlay.back { left: 22%; }
.player-skip-overlay.forward { right: 22%; }
.player-skip-overlay strong { font-size: 19px; }

.player-side-panel {
  position: absolute;
  top: 118px;
  right: 42px;
  bottom: 116px;
  z-index: 5;
  width: min(460px, calc(100vw - 84px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(25, 30, 38, 0.95), rgba(5, 8, 12, 0.96)),
    rgba(0, 0, 0, 0.88);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(22px);
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  overflow: hidden;
}

.player-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.player-panel-head h3 {
  margin: 3px 0 0;
  font-size: 24px;
}

.player-panel-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 4px;
}

.player-panel-row {
  min-height: 74px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  text-align: left;
}

.player-panel-row:hover,
.player-panel-row.is-active {
  border-color: color-mix(in srgb, var(--accent, #fff) 62%, transparent);
  background: rgba(255, 255, 255, 0.14);
}

.player-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent, #fff);
  font-size: 13px;
  font-weight: 800;
}

.player-panel-row strong,
.player-panel-row em,
.player-panel-row small {
  display: block;
}

.player-panel-row strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-panel-row em {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-style: normal;
}

.player-panel-row small {
  margin-top: 5px;
  color: #fbd38d;
  font-size: 11px;
}

.player-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.player-row-actions button {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.player-row-actions button:hover,
.player-row-actions button:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #fff) 58%, transparent);
  background: rgba(255, 255, 255, 0.16);
}

.player-panel-empty {
  margin: 12px 4px;
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.5;
}

.player-settings-grid {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.player-settings-grid div {
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.player-settings-grid span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.player-settings-grid strong {
  font-size: 14px;
  text-transform: capitalize;
}

.player-settings-grid p {
  margin: 6px 4px 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .player-top {
    padding: 20px;
    gap: 12px;
  }

  .player-metadata {
    max-width: 100%;
  }

  .player-top-left h2 {
    font-size: 22px;
  }

  .player-overview,
  .player-action-pill {
    display: none;
  }

  .player-side-panel {
    top: auto;
    left: 14px;
    right: 14px;
    bottom: 104px;
    width: auto;
    max-height: 56vh;
  }

  .player-controls {
    padding-left: 14px;
    padding-right: 14px;
  }

  .player-badges {
    display: none;
  }
}

/* ============================================================
   Motion polish — entrance animations, scrollbar, reduced-motion
   ============================================================ */

@keyframes arvio-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes arvio-rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes arvio-drawer-in { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }

/* Section content fades/rises in when switching tabs */
.content > .screen,
.settings-content {
  animation: arvio-rise-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.profile-shell,
.login-shell { animation: arvio-fade-in 320ms ease both; }

.details-drawer { animation: arvio-drawer-in 300ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.player-overlay { animation: arvio-fade-in 240ms ease both; }
.modal-scrim { animation: arvio-fade-in 180ms ease both; }
.profile-dialog { animation: arvio-rise-in 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.toast { animation: arvio-rise-in 220ms ease both; }

/* Hero copy rises in */
.hero-copy > * { animation: arvio-rise-in 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-copy > *:nth-child(2) { animation-delay: 40ms; }
.hero-copy > *:nth-child(3) { animation-delay: 80ms; }
.hero-copy > *:nth-child(4) { animation-delay: 120ms; }

/* Page scrollbar — subtle, on-brand */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(237, 237, 237, 0.28) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(237, 237, 237, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(237, 237, 237, 0.4); background-clip: padding-box; }

/* Crisper card titles (closer to Android's medium weight) */
.media-card strong { font-weight: 560; }

/* ============================================================
   Premium UI pass - shared polish across web ARVIO
   ============================================================ */

:root {
  --surface-glass: rgba(16, 18, 22, 0.66);
  --surface-glass-strong: rgba(18, 20, 24, 0.82);
  --line-bright: rgba(255, 255, 255, 0.18);
  --focus-glow: 0 0 0 3px color-mix(in srgb, var(--accent, #fff) 70%, transparent), 0 20px 54px rgba(0, 0, 0, 0.52);
  --panel-radius: 20px;
}

body {
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  background:
    radial-gradient(circle at 82% 8%, rgba(0, 213, 136, 0.12), transparent 25%),
    radial-gradient(circle at 12% 22%, rgba(120, 170, 255, 0.1), transparent 24%),
    linear-gradient(180deg, #050607 0%, #000 58%, #020202 100%);
}

.sidebar {
  height: clamp(76px, 8.6vh, 96px);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.52) 58%, transparent),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 36%, rgba(255, 255, 255, 0.035));
}

.brand {
  background: radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.profile-name-text {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 680;
}

.nav-item,
.settings-gear {
  border: 1px solid transparent;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-active,
.settings-gear:hover,
.settings-gear:focus-visible,
.settings-gear.is-active {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

.nav-item.is-active,
.settings-gear.is-active {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.21), rgba(255, 255, 255, 0.1)),
    color-mix(in srgb, var(--accent, #fff) 12%, transparent);
}

.sync-strip {
  top: clamp(84px, 9vh, 104px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.hero {
  min-height: min(100vh, 920px);
  background-position: center right;
}

.hero::before {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.97) 0%, rgba(0, 0, 0, 0.82) 29%, rgba(0, 0, 0, 0.28) 72%, rgba(0, 0, 0, 0.06)),
    linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.84) 10%, rgba(0, 0, 0, 0.12) 58%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-copy {
  width: min(820px, 54vw);
}

.hero-logo {
  filter: drop-shadow(0 20px 42px rgba(0, 0, 0, 0.72));
}

.hero-meta {
  gap: 8px;
}

.hero + .rail,
.hero + .rail-skeleton {
  margin-top: clamp(-150px, -17vh, -96px);
}

.hero-actions .secondary {
  width: auto;
  min-width: clamp(128px, 11vw, 172px);
  padding: 0 clamp(18px, 1.35vw, 26px);
  border-radius: clamp(16px, 2.2vh, 24px);
  white-space: nowrap;
}

.hero-meta > span,
.chips span,
.login-proof span,
.player-quality {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.primary {
  background: linear-gradient(180deg, #fff, #dcdcdc);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
}

.secondary,
.text-button,
.icon-button,
.pill {
  background: rgba(255, 255, 255, 0.105);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.primary:hover,
.secondary:hover,
.icon-button:hover,
.pill:hover,
.text-button:hover {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}

.primary:focus-visible,
.secondary:focus-visible,
.icon-button:focus-visible,
.pill:focus-visible,
.text-button:focus-visible,
.media-card:focus-visible .poster,
.profile-pick:focus-visible .avatar-tile,
.settings-section-btn:focus-visible,
.source-row:focus-visible,
.episode-row:focus-visible,
.player-icon-btn:focus-visible,
.player-action-pill:focus-visible {
  outline: none;
  box-shadow: var(--focus-glow);
}

.rail {
  padding-left: clamp(18px, 3.35vw, 64px);
}

.rail-head {
  padding-right: clamp(18px, 3.35vw, 64px);
}

.rail-head h3,
.section-heading h2,
.detail-section h3 {
  font-weight: 780;
  letter-spacing: 0;
}

.rail-head span {
  font-size: clamp(14px, 1vw, 18px);
}

.rail-strip {
  grid-auto-columns: clamp(245px, 20.5vw, 392px);
  gap: clamp(14px, 1.18vw, 22px);
}

.media-card {
  width: clamp(245px, 20.5vw, 392px);
  border-radius: 18px;
  transition: transform 180ms ease;
}

.media-card:hover {
  transform: translateY(-3px);
}

.poster {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
}

.poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), transparent);
  pointer-events: none;
}

.media-card:hover .poster,
.media-card:focus-visible .poster {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 28px 64px rgba(0, 0, 0, 0.64);
}

.media-card strong {
  margin-top: 12px;
  font-size: clamp(16px, 1.22vw, 23px);
  line-height: 1.18;
  font-weight: 720;
  color: rgba(255, 255, 255, 0.94);
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
}

.card-meta-row span {
  min-width: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(13px, 0.95vw, 16px);
}

/* Continue Watching / Up Next episode line under the card title. */
.card-episode-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  min-width: 0;
}

.card-episode {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(13px, 0.95vw, 16px);
}

.media-card .card-upnext {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 6px;
  background: #ffffff;
  color: #000000 !important;
  font-size: clamp(11px, 0.72vw, 13px);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.card-rating {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  color: #ffd86a !important;
}

.section-heading,
.search-hero {
  padding-left: clamp(18px, 3.35vw, 64px);
  padding-right: clamp(18px, 3.35vw, 64px);
}

.search-hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    radial-gradient(circle at 74% 0%, rgba(0, 213, 136, 0.1), transparent 35%);
}

.search-hero input,
.inline-form input,
.login-form input,
.profile-name-input,
.set-control input,
.set-control select,
select {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.search-hero input:focus,
.inline-form input:focus,
.login-form input:focus,
.profile-name-input:focus,
.set-control input:focus,
.set-control select:focus,
select:focus {
  outline: none;
  box-shadow: var(--focus-glow);
}

.grid-results {
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: clamp(18px, 1.5vw, 28px);
  padding-left: clamp(18px, 3.35vw, 64px);
  padding-right: clamp(18px, 3.35vw, 64px);
}

.settings-shell {
  grid-template-columns: minmax(230px, 17vw) minmax(0, 1fr);
  gap: clamp(22px, 2.8vw, 44px);
  padding-left: clamp(18px, 3.35vw, 64px);
  padding-right: clamp(18px, 3.35vw, 64px);
}

.settings-sidebar {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--panel-radius);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(16px);
}

.settings-content {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  align-items: start;
}

.settings-panel-card,
.live-panel,
.settings-panel,
.addon-tile,
.login-card,
.profile-dialog,
.source-section,
.review-card,
.episode-row,
.settings-list-row,
.parity-row,
.account-row,
.channel-row {
  border-color: rgba(255, 255, 255, 0.095);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    rgba(8, 9, 11, 0.72);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.26);
}

.settings-panel-card {
  border-radius: var(--panel-radius);
  padding: clamp(18px, 1.7vw, 28px);
}

.live-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  margin: 18px 0 16px;
}

.live-status-grid span,
.live-warning {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.live-status-grid strong {
  color: #fff;
}

.live-status-grid .pill {
  min-height: 46px;
  white-space: nowrap;
}

.live-warning {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
  border-color: rgba(255, 205, 60, 0.28);
  background: rgba(255, 205, 60, 0.08);
  color: rgba(255, 255, 255, 0.76);
}

.live-warning strong {
  color: #ffd86a;
}

/* settings section button sizing handled in core settings-shell styling */

.set-row {
  min-height: 64px;
}

.profile-shell,
.login-shell {
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 213, 136, 0.13), transparent 28%),
    radial-gradient(circle at 20% 72%, rgba(117, 161, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #06080a, #000 68%);
}

.profile-center,
.login-hero {
  isolation: isolate;
}

.profile-pick {
  border-radius: 18px;
  padding: 12px;
}

.profile-pick:hover,
.profile-pick:focus-visible {
  background: rgba(255, 255, 255, 0.055);
}

.avatar-tile {
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

.login-card {
  border-radius: 26px;
  backdrop-filter: blur(22px);
}

.login-card-title,
.profile-heading {
  letter-spacing: 0;
}

.detail-kicker {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-kicker span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-layout {
  width: 100%;
}

.detail-section,
.episodes-section,
.source-section {
  min-width: 0;
}

.detail-body h2,
.hero h2 {
  text-wrap: balance;
}

.detail-body p:not(.eyebrow),
.hero-copy p:not(.eyebrow) {
  text-wrap: pretty;
}

.episode-row,
.source-row,
.player-panel-row,
.channel-row {
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 180ms ease;
}

.episode-row:hover,
.source-row:hover,
.player-panel-row:hover,
.channel-row:hover {
  transform: translateY(-1px);
}

.player-top,
.player-controls,
.player-side-panel {
  backdrop-filter: blur(18px);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

@media (max-width: 980px) {
  .sidebar {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding-inline: 14px;
  }

  .profile-name-text {
    display: none;
  }

  .sidebar nav {
    justify-content: center;
  }

  .nav-item {
    min-width: 48px;
    padding: 0 13px;
  }

  .nav-item span {
    display: none;
  }

  .hero-copy {
    width: min(760px, 76vw);
  }

  .settings-shell {
    display: block !important;
    padding: 16px var(--phone-gutter, 16px) 32px !important;
    min-height: auto !important;
  }

  .settings-sidebar {
    display: none !important;
  }

  .settings-shell.sidebar-expanded .settings-sidebar {
    display: none !important;
  }

  .settings-content,
  .settings-shell.sidebar-collapsed .settings-content,
  .settings-shell.sidebar-expanded .settings-content {
    margin-left: 0 !important;
    width: 100% !important;
    transition: none !important;
  }

  .settings-floating-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    margin-bottom: 14px;
    background: rgba(14, 16, 22, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    z-index: 57 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  }

  .settings-floating-menu-btn:active,
  .settings-floating-menu-btn.is-open {
    background: color-mix(in srgb, var(--accent, #8b5cf6) 30%, rgba(255, 255, 255, 0.12)) !important;
    border-color: color-mix(in srgb, var(--accent, #8b5cf6) 50%, rgba(255, 255, 255, 0.25)) !important;
    color: #ffffff;
  }

  .settings-floating-menu-btn:active {
    transform: scale(0.92);
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 710px;
    align-items: flex-end;
    padding: 104px 16px 132px;
    background-position: center top;
  }

  .hero-copy {
    width: 100%;
    margin-top: 0;
  }

  .hero-copy p:not(.eyebrow) {
    -webkit-line-clamp: 4;
    font-size: 16px;
  }

  .hero-actions,
  .detail-actions {
    width: 100%;
  }

  .hero-actions .primary,
  .hero-actions .secondary {
    flex: 1 1 0;
  }

  .rail-strip {
    grid-auto-columns: minmax(220px, 74vw);
    padding-right: 16px;
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: -92px;
  }

  .media-card {
    width: min(74vw, 310px);
  }

  .settings-content {
    grid-template-columns: 1fr;
  }

  .live-status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .live-status-grid .pill {
    grid-column: 1 / -1;
    width: 100%;
  }

  .set-row,
  .settings-list-row,
  .account-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-row {
    gap: 12px;
  }

  .login-hero {
    min-height: auto;
  }
}

/* ============================================================
   Details page polish - full page, persistent nav, responsive
   ============================================================ */

.details-drawer {
  position: relative;
  inset: auto;
  z-index: 2;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #000;
  animation: arvio-rise-in 300ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.details-drawer .close {
  display: none !important;
}

.detail-backdrop {
  position: absolute;
  inset: 0 0 auto;
  height: clamp(520px, 75vh, 820px);
  background-size: cover;
  background-position: center right;
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.78) 31%, rgba(0, 0, 0, 0.34) 67%, rgba(0, 0, 0, 0.1) 100%),
    linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.86) 12%, rgba(0, 0, 0, 0.26) 52%, rgba(0, 0, 0, 0.62) 100%);
}

.detail-body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  padding: clamp(104px, 13vh, 138px) clamp(22px, 4vw, 68px) clamp(58px, 8vh, 96px);
}

.detail-hero-content {
  width: min(900px, 59vw);
  min-height: clamp(390px, 51vh, 585px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(42px, 5vh, 78px);
}

.detail-body .eyebrow {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 1.25vw, 24px);
  font-weight: 700;
}

.detail-body h2 {
  max-width: 12ch;
  margin: 0 0 clamp(18px, 1.6vw, 28px);
  font-size: clamp(44px, 5.5vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.detail-body p:not(.eyebrow) {
  max-width: 960px;
  margin-top: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(18px, 1.45vw, 26px);
  line-height: 1.46;
}

.detail-body .chips {
  margin: clamp(18px, 1.8vw, 28px) 0 clamp(24px, 2.1vw, 36px);
}

.detail-body .chips span {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.56);
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(14px, 1vw, 18px);
  backdrop-filter: blur(14px);
}

.detail-actions {
  gap: 14px;
  margin-bottom: 18px;
}

.detail-actions .primary,
.detail-actions .secondary,
.trailer-link {
  min-height: clamp(46px, 3.4vw, 58px);
  padding-inline: clamp(16px, 1.35vw, 24px);
  border-radius: 999px;
  font-size: clamp(15px, 1.05vw, 18px);
}

.detail-actions .secondary {
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.trailer-link {
  margin-top: 28px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: clamp(22px, 3vw, 46px);
  align-items: start;
  max-width: 1760px;
}

.detail-wide {
  grid-column: 1 / -1;
}

.episodes-section {
  min-width: 0;
}

.source-section {
  position: sticky;
  top: clamp(92px, 11vh, 120px);
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: clamp(16px, 1.55vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.detail-section {
  margin-top: 0;
}

.detail-section + .detail-section {
  margin-top: clamp(24px, 3vw, 44px);
}

.detail-section h3 {
  margin: 0 0 16px;
  font-size: clamp(23px, 1.85vw, 34px);
  font-weight: 760;
}

.season-tabs {
  margin-bottom: 18px;
}

.season-tab {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: clamp(14px, 1vw, 17px);
}

.episode-list {
  max-width: 1040px;
  gap: 14px;
}

.episode-row {
  width: 100%;
  min-height: clamp(112px, 8.6vw, 142px);
  padding: clamp(12px, 1vw, 16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.062);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
}

.episode-still {
  width: clamp(140px, 15vw, 228px);
  border-radius: 14px;
}

.episode-info strong {
  font-size: clamp(16px, 1.2vw, 21px);
}

.episode-info > span {
  font-size: clamp(12px, 0.9vw, 15px);
}

.episode-info p {
  font-size: clamp(13px, 1vw, 16px) !important;
  line-height: 1.5;
}

.source-list {
  gap: 10px;
  margin-top: 14px;
}

.source-row {
  width: 100%;
  min-height: 66px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
}

.source-row:hover,
.source-row:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.source-row strong {
  font-size: clamp(15px, 1.08vw, 18px);
}

.source-row span {
  font-size: clamp(12px, 0.86vw, 14px);
  line-height: 1.35;
}

.source-row .quality {
  margin-left: 12px;
  font-size: clamp(13px, 0.95vw, 16px);
}

.review-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

@media (min-width: 1540px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1.42fr) minmax(400px, 0.58fr);
  }

  .detail-hero-content {
    width: min(960px, 54vw);
  }
}

@media (max-width: 1180px) {
  .detail-hero-content {
    width: min(780px, 76vw);
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .source-section {
    position: relative;
    top: auto;
    max-height: none;
    order: -1;
  }

  .episode-list {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .detail-backdrop {
    height: 560px;
    background-position: center top;
  }

  .detail-backdrop::after {
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.18)),
      linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.92) 20%, rgba(0, 0, 0, 0.3) 66%, rgba(0, 0, 0, 0.72) 100%);
  }

  .detail-body {
    padding: 92px 16px 46px;
  }

  .detail-hero-content {
    width: 100%;
    min-height: 410px;
    justify-content: flex-end;
    padding-bottom: 18px;
  }

  .detail-body h2 {
    max-width: 10ch;
    font-size: clamp(42px, 13vw, 64px);
  }

  .detail-body p:not(.eyebrow) {
    font-size: 17px;
    line-height: 1.48;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .detail-actions .primary {
    grid-column: 1 / -1;
  }

  .detail-actions .primary,
  .detail-actions .secondary,
  .trailer-link {
    min-height: 46px;
    justify-content: center;
    padding-inline: 13px;
    font-size: 14px;
  }

  .source-section {
    padding: 14px;
    border-radius: 16px;
  }

  .episode-row {
    flex-direction: column;
    gap: 12px;
  }

  .episode-still {
    width: 100%;
  }

  .mini-strip {
    grid-auto-columns: 122px;
  }

  .mini-card img,
  .mini-card > svg {
    width: 122px;
    height: 168px;
  }

  .mini-card.person img,
  .mini-card.person > svg {
    height: 122px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/*
   Browser fit pass: keep TV-style density without letting labels, rows, or
   detail panels bleed outside desktop/tablet/mobile viewports.
*/
html,
body,
.app-shell,
.main-content,
.detail-body,
.detail-layout,
.episodes-section,
.source-section,
.settings-shell,
.live-layout,
.channel-browser {
  min-width: 0;
}

button,
.nav-item,
.primary,
.secondary,
.text-button,
.pill,
.season-tab,
.source-row,
.episode-row {
  min-width: 0;
}

.primary,
.secondary,
.text-button,
.pill,
.season-tab,
.trailer-link {
  white-space: nowrap;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.source-row > div,
.episode-info,
.media-card,
.rail-strip,
.live-layout > *,
.settings-shell > * {
  min-width: 0;
}

.source-row strong,
.source-row span:not(.quality),
.episode-info strong,
.episode-info span,
.episode-info p {
  overflow-wrap: anywhere;
}

.source-row .quality {
  white-space: nowrap;
  justify-self: end;
}

.episode-row {
  display: grid;
  grid-template-columns: clamp(150px, 17vw, 230px) minmax(0, 1fr);
  align-items: center;
}

.detail-actions {
  max-width: 100%;
}

@media (max-width: 920px) {
  .detail-body {
    overflow-x: hidden;
  }

  .episode-row {
    grid-template-columns: 1fr;
  }

  .episode-still {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .detail-actions {
    grid-template-columns: 1fr;
  }

  .detail-actions .primary,
  .detail-actions .secondary,
  .trailer-link {
    width: 100%;
  }

  .primary,
  .secondary,
  .text-button,
  .pill,
  .season-tab,
  .trailer-link {
    white-space: normal;
  }

  .source-row {
    grid-template-columns: 1fr;
  }

  .source-row .quality {
    justify-self: start;
  }
}

/* ============================================================
   Android TV parity pass - ratings, episode rail, stream badges
   ============================================================ */

/* IMDb badge — matches the Android app: solid IMDb-yellow, black text. */
.imdb-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px !important;
  border-radius: 6px;
  background: #f5c518;
  padding: 5px 10px;
  overflow: visible;
  box-shadow: none;
}

.imdb-rating b,
.imdb-rating em {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: #0a0a0a;
  font-style: normal;
  font-size: clamp(12px, 0.85vw, 14px);
  line-height: 1;
  letter-spacing: 0;
}

.imdb-rating b { font-weight: 800; }
.imdb-rating em { font-weight: 700; }

.episodes-section {
  overflow: hidden;
}

.episode-list {
  max-width: none !important;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(260px, 23vw, 390px);
  gap: clamp(14px, 1.2vw, 20px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px clamp(18px, 2vw, 34px) 18px 0;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.episode-list::-webkit-scrollbar {
  display: none;
}

.episode-row {
  scroll-snap-align: start;
  width: auto !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-content: start;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045)),
    rgba(0, 0, 0, 0.44) !important;
}

.episode-row:hover,
.episode-row:focus-visible,
.episode-row.is-active {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent, #fff) 64%, transparent) !important;
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

.episode-still {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.06);
}

.episode-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-info {
  padding: 14px 15px 16px;
}

.episode-number {
  display: inline-flex !important;
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(245, 197, 31, 0.16);
  color: #f5c518 !important;
  font-size: 11px !important;
  font-weight: 850;
  text-transform: uppercase;
}

.episode-info strong {
  display: -webkit-box;
  min-height: 2.5em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.episode-info p {
  display: -webkit-box;
  min-height: 4.5em;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.source-row {
  min-height: 88px;
  align-items: center;
  border-radius: 16px;
}

.source-row > div {
  display: grid;
  gap: 6px;
}

.stream-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.stream-badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px !important;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.stream-badge.gold {
  border-color: rgba(245, 197, 31, 0.5);
  background: rgba(245, 197, 31, 0.16);
  color: #f5c518;
}

.stream-badge.ok {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.14);
  color: #8df4b0;
}

.stream-badge.warn {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.14);
  color: #fbd38d;
}

@media (max-width: 760px) {
  .episode-list {
    grid-auto-columns: minmax(240px, 82vw);
  }

  .source-row {
    grid-template-columns: 1fr;
  }

  .source-row .quality {
    justify-self: start;
  }
}

/* ============================================================
   Satisfying focus/hover + cast person modal
   ============================================================ */

.rail-strip,
.mini-strip,
.episode-list,
.person-known-rail {
  padding-top: 12px;
  padding-bottom: 26px;
}

.media-card {
  border-radius: clamp(12px, 0.94vw, 18px);
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 220ms ease;
}

.media-card:hover {
  transform: translateY(-5px) !important;
  filter: brightness(1.05);
}

.media-card:hover .poster,
.media-card:focus-visible .poster {
  transform: none !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent, #fff) 76%, transparent),
    0 18px 52px rgba(0, 0, 0, 0.58) !important;
}

.media-card:hover .poster img,
.media-card:focus-visible .poster img {
  transform: scale(1.045) !important;
}

.media-card:focus-visible {
  outline: none;
  transform: translateY(-5px);
}

.episode-row,
.source-row,
.mini-card,
.person-known-card {
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 180ms ease,
    box-shadow 220ms ease,
    background 180ms ease,
    filter 180ms ease;
}

.episode-row:hover,
.episode-row:focus-visible,
.episode-row.is-active,
.source-row:hover,
.source-row:focus-visible,
.mini-card:hover,
.mini-card:focus-visible,
.person-known-card:hover,
.person-known-card:focus-visible {
  transform: translateY(-5px) !important;
  border-color: color-mix(in srgb, var(--accent, #fff) 60%, transparent) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 18px 52px rgba(0, 0, 0, 0.5) !important;
  filter: brightness(1.05);
  outline: none;
}

.episode-row:hover .episode-still img,
.episode-row:focus-visible .episode-still img,
.person-known-card:hover img,
.person-known-card:focus-visible img,
.mini-card:hover img,
.mini-card:focus-visible img {
  transform: scale(1.045);
}

.episode-still img,
.person-known-card img,
.mini-card img {
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cast-card {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.cast-card:focus-visible {
  outline: none;
}

.person-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
}

.person-modal-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 24%, rgba(146, 46, 118, 0.28), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(0, 213, 136, 0.12), transparent 28%),
    rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
}

.person-panel {
  position: relative;
  width: min(1180px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(30px, 4vw, 58px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(33, 18, 32, 0.92), rgba(7, 8, 10, 0.96) 54%, rgba(0, 0, 0, 0.98)),
    #050505;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.72);
  padding: clamp(24px, 3.4vw, 48px);
  animation: arvio-drawer-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.person-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.person-close:hover,
.person-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.person-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.person-photo {
  width: 180px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.42);
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-sidebar h2 {
  margin: 24px 0 12px;
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

.person-facts {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.person-facts span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.person-content {
  min-width: 0;
  overflow-y: auto;
  padding-right: clamp(4px, 1vw, 14px);
}

.person-content .eyebrow {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  font-weight: 760;
}

.person-bio {
  max-width: 840px;
  margin: 0 0 34px;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(15px, 1.12vw, 18px);
  line-height: 1.62;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
}

.person-known-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(220px, 19vw, 310px);
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.person-known-rail.is-poster {
  grid-auto-columns: clamp(150px, 12vw, 210px);
}

.person-known-rail::-webkit-scrollbar {
  display: none;
}

.person-known-card {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  padding: 0 0 12px;
}

.person-known-card div {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.person-known-rail.is-poster .person-known-card div {
  aspect-ratio: 2 / 3;
}

.person-known-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-known-card strong,
.person-known-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-inline: 12px;
}

.person-known-card strong {
  margin-top: 11px;
  font-size: 15px;
}

.person-known-card span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.person-loading {
  grid-column: 1 / -1;
  min-height: 360px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
}

/* ============================================================
   Live TV browser parity pass
   ============================================================ */

.live-tv-shell {
  min-height: 100dvh;
  padding: clamp(92px, 11vh, 132px) clamp(18px, 3.2vw, 58px) clamp(28px, 4vw, 64px);
  display: grid;
  grid-template-columns: minmax(250px, 17vw) minmax(0, 1fr) minmax(300px, 22vw);
  gap: clamp(14px, 1.5vw, 24px);
  align-items: stretch;
}

.live-tv-sidebar,
.live-guide-panel,
.live-now-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.095);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032)),
    rgba(8, 9, 11, 0.72);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.live-tv-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100dvh - 124px);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.live-tv-title h2,
.live-now-panel h2 {
  margin: 2px 0 0;
  font-size: clamp(25px, 2vw, 38px);
  line-height: 1;
}

.live-tv-search {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.075);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
}

.live-tv-search input {
  min-height: 0;
  height: 46px;
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.live-tv-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-tv-stats span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  padding: 9px 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  text-align: center;
}

.live-tv-stats strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.live-refresh {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

.live-category-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
  scrollbar-width: thin;
}

.live-category-list button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
}

.live-category-list button:hover,
.live-category-list button:focus-visible,
.live-category-list button.is-active {
  border-color: color-mix(in srgb, var(--accent, #fff) 44%, rgba(255, 255, 255, 0.08));
  background: color-mix(in srgb, var(--accent, #fff) 14%, rgba(255, 255, 255, 0.08));
  color: #fff;
  transform: translateX(2px);
}

.live-category-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-category-list em {
  min-width: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  color: rgba(255, 255, 255, 0.62);
  font-style: normal;
  font-size: 12px;
  text-align: center;
}

.live-guide-panel {
  min-height: calc(100dvh - 160px);
  border-radius: 28px;
  padding: clamp(16px, 1.6vw, 26px);
  overflow: hidden;
}

.live-playlist-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 270px);
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 14px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.live-playlist-strip::-webkit-scrollbar {
  display: none;
}

.live-playlist-strip button {
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
}

.live-playlist-strip span,
.live-playlist-strip em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-playlist-strip em {
  grid-column: 2;
  color: rgba(255, 255, 255, 0.55);
  font-style: normal;
  font-size: 12px;
}

.live-guide-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.live-guide-head h3 {
  margin: 0;
  font-size: clamp(28px, 2.5vw, 46px);
}

.live-guide-head span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.live-channel-list {
  max-height: calc(100dvh - 250px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.live-channel-row {
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.live-channel-row:hover,
.live-channel-row:focus-within,
.live-channel-row.is-selected {
  border-color: color-mix(in srgb, var(--accent, #fff) 48%, rgba(255, 255, 255, 0.08));
  background: color-mix(in srgb, var(--accent, #fff) 12%, rgba(255, 255, 255, 0.06));
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.live-channel-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.live-logo {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.live-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.live-channel-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.live-channel-copy strong,
.live-channel-copy em,
.live-channel-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-channel-copy strong {
  font-size: 16px;
}

.live-channel-copy em,
.live-channel-copy small {
  color: rgba(255, 255, 255, 0.58);
  font-style: normal;
  font-size: 12px;
}

.live-now-panel {
  position: sticky;
  top: 96px;
  max-height: calc(100dvh - 124px);
  border-radius: 28px;
  padding: clamp(18px, 1.8vw, 28px);
  overflow-y: auto;
}

.live-channel-art {
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent, #fff) 20%, transparent), transparent 55%),
    rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  overflow: hidden;
}

.live-channel-art img {
  max-width: 72%;
  max-height: 72%;
  object-fit: contain;
}

.live-program-card {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
  padding: 14px;
}

.live-program-card.muted {
  background: rgba(255, 255, 255, 0.035);
}

.live-program-card span,
.live-program-card em {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-style: normal;
}

.live-program-card strong {
  display: block;
  margin: 5px 0;
  font-size: 17px;
}

.live-program-card p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.45;
}

.live-now-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.live-now-actions.secondary-row {
  margin-top: 10px;
}

.live-now-actions button {
  min-height: 46px;
  justify-content: center;
}

.live-empty-card,
.live-empty-side {
  min-height: 340px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.68);
}

.live-empty-card.compact {
  min-height: 260px;
}

.live-empty-card h3,
.live-empty-side h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 2.4vw, 42px);
}

.live-empty-card p,
.live-empty-side p {
  max-width: 620px;
  margin: 0;
}

@media (max-width: 1180px) {
  .live-tv-shell {
    grid-template-columns: minmax(230px, 30vw) minmax(0, 1fr);
  }

  .live-now-panel {
    grid-column: 1 / -1;
    position: relative;
    top: auto;
    max-height: none;
    display: grid;
    grid-template-columns: minmax(220px, 32vw) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .live-now-panel > .eyebrow,
  .live-now-panel > h2,
  .live-now-panel > .empty,
  .live-program-card,
  .live-now-actions {
    grid-column: 2;
  }

  .live-channel-art {
    grid-row: 1 / span 6;
    margin-bottom: 0;
  }
}

@media (max-width: 760px) {
  .live-tv-shell {
    display: block;
    padding: 84px var(--phone-gutter, 14px) 98px;
  }

  .live-tv-sidebar,
  .live-guide-panel,
  .live-now-panel {
    position: relative;
    top: auto;
    max-height: none;
    border-radius: 20px;
  }

  .live-tv-sidebar {
    margin-bottom: 12px;
    overflow: visible;
  }

  .live-tv-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .live-category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .live-category-list::-webkit-scrollbar {
    display: none;
  }

  .live-category-list button {
    min-width: max-content;
  }

  .live-guide-panel {
    padding: 14px;
  }

  .live-guide-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .live-channel-list {
    max-height: none;
    overflow: visible;
  }

  .live-channel-row {
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .live-logo {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .live-channel-copy small {
    display: none;
  }

  .live-now-panel {
    display: block;
    margin-top: 12px;
  }

  .live-channel-art {
    aspect-ratio: 21 / 9;
    margin-bottom: 14px;
  }

  .live-now-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .person-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 28px);
    overflow-y: auto;
  }

  .person-sidebar {
    align-items: flex-start;
    text-align: left;
    padding-right: 48px;
  }

  .person-photo {
    width: 132px;
  }

  .person-facts span {
    justify-content: flex-start;
  }

  .person-known-rail {
    grid-auto-columns: minmax(220px, 76vw);
  }
}

/* ============================================================
   Phone web/app parity pass
   ============================================================ */

@media (max-width: 680px) {
  :root {
    --phone-gutter: 14px;
  }

  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    min-height: 100dvh;
    padding-top: calc(56px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(62px + env(safe-area-inset-bottom)) !important;
  }

  .content {
    min-height: calc(100dvh - 56px - 62px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    overflow-x: hidden;
  }

  .livetv-shell,
  .settings-shell,
  .screen:has(.search-hero) {
    min-height: auto !important;
  }

  .sidebar {
    display: none !important;
  }

  .mobile-header {
    display: flex !important;
    position: fixed;
    inset: 0 0 auto;
    top: 0;
    width: 100%;
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
    align-items: center;
    justify-content: space-between;
    z-index: 60;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(10, 11, 13, 0.96), rgba(7, 8, 10, 0.9));
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: background-color 0.25s ease;
  }

  .mobile-header.is-scrolled {
    background: rgba(7, 9, 11, 0.95) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-brand-logo {
    width: 28px !important;
    height: 28px !important;
  }

  .mobile-wordmark {
    height: 14px !important;
    width: auto !important;
  }

  .mobile-profile-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    inset: auto 0 0;
    bottom: 0;
    width: 100%;
    height: calc(62px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 11, 13, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 60;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  }

  .mobile-nav-item {
    flex: 1;
    height: 100%;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.18s ease;
    min-width: 0;
    padding: 0;
  }

  .mobile-nav-item svg {
    width: 21px;
    height: 21px;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mobile-nav-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .mobile-nav-item:active svg {
    transform: scale(0.9);
  }

  .mobile-nav-item.is-active {
    color: var(--accent, #8b5cf6);
  }

  .mobile-avatar-container {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid transparent;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s ease, transform 0.18s ease;
  }

  .mobile-profile-btn.is-active .mobile-avatar-container {
    border-color: var(--accent, #8b5cf6);
  }

  .sync-strip {
    /* Sits below the top nav bar now. */
    top: calc(66px + env(safe-area-inset-top));
    left: var(--phone-gutter);
    right: var(--phone-gutter);
    width: auto;
  }

  .hero {
    min-height: 620px;
    padding: 86px var(--phone-gutter) 156px;
    align-items: flex-end;
    background-position: center top;
  }

  .hero::before {
    background:
      linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.88) 28%, rgba(0, 0, 0, 0.2) 68%, rgba(0, 0, 0, 0.72) 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
  }

  .hero-copy {
    width: 100%;
    margin-top: 0;
  }

  .hero-logo {
    max-width: min(72vw, 280px);
    max-height: 112px;
  }

  .hero h2 {
    max-width: 11ch;
    font-size: clamp(42px, 14vw, 64px);
  }

  .hero-meta {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .hero-meta::-webkit-scrollbar {
    display: none;
  }

  .hero-copy p:not(.eyebrow) {
    max-width: none;
    font-size: 15px;
    line-height: 1.5;
    -webkit-line-clamp: 4;
  }

  .hero-actions,
  .detail-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .hero-actions .primary,
  .hero-actions .secondary,
  .detail-actions .primary,
  .detail-actions .secondary {
    min-height: 48px;
    justify-content: center;
    padding-inline: 12px;
    font-size: 14px;
  }

  .rail {
    padding-left: var(--phone-gutter);
    margin-top: 0;
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: -112px;
  }

  .rail-head {
    margin-bottom: 7px;
  }

  .rail-head h3,
  .section-heading h2,
  .detail-section h3 {
    font-size: 24px;
  }

  .rail-head span {
    font-size: 14px;
  }

  .rail-strip {
    grid-auto-columns: minmax(250px, 78vw);
    gap: 12px;
    padding: 8px var(--phone-gutter) 22px 0;
  }

  .rail.is-poster .rail-strip {
    grid-auto-columns: minmax(138px, 42vw);
  }

  .media-card {
    width: min(78vw, 320px);
  }

  .media-card.is-poster {
    width: min(42vw, 176px);
  }

  .media-card strong {
    margin-top: 9px;
    font-size: 14px;
  }

  .card-meta-row,
  .media-card span {
    font-size: 12px;
  }

  .search-hero {
    padding: 16px var(--phone-gutter) 14px;
    gap: 10px;
  }

  .search-hero input {
    min-height: 52px;
    font-size: 18px;
    padding-inline: 16px;
  }

  .grid-results {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 var(--phone-gutter) 24px !important;
  }

  .grid-results .media-card {
    width: 100%;
  }

  .poster-results .grid-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .poster-results .grid-results .media-card {
    width: 100%;
  }

  .section-heading {
    padding: 16px var(--phone-gutter) 16px;
  }

  .section-heading .eyebrow {
    font-size: 13px;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
  }

  .settings-shell {
    display: block !important;
    padding-top: 12px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 96px !important;
  }

  .livetv-shell {
    padding-top: 16px !important;
  }

  .settings-sidebar {
    display: none !important;
  }

  .settings-shell.sidebar-expanded .settings-sidebar {
    display: none !important;
  }

  .settings-content,
  .settings-shell.sidebar-collapsed .settings-content,
  .settings-shell.sidebar-expanded .settings-content {
    margin-left: 0 !important;
    width: 100% !important;
    transition: none !important;
  }

  .settings-mobile-overlay {
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .settings-mobile-drawer {
    top: calc(50% + (env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 6px) / 2) !important;
    max-height: calc(100dvh - 56px - 62px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px) !important;
  }

  .settings-section-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }
  .sidebar-collapsed .settings-section-btn {
    justify-content: center;
    padding: 10px 0;
  }

  .settings-content,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .set-row,
  .settings-list-row,
  .account-row {
    align-items: stretch;
    gap: 12px;
  }

  .set-control,
  .set-control input,
  .set-control select,
  .inline-form input,
  .login-form input {
    width: 100%;
  }

  .details-drawer {
    min-height: 100dvh;
    padding-bottom: 82px;
  }

  .detail-backdrop {
    height: 520px;
    background-position: center top;
  }

  .detail-body {
    padding: 76px var(--phone-gutter) 92px;
    overflow-x: hidden;
  }

  .detail-hero-content {
    width: 100%;
    min-height: 420px;
    justify-content: flex-end;
    padding: 0 0 18px;
  }

  .detail-body h2 {
    max-width: 11ch;
    font-size: clamp(40px, 12vw, 58px);
    line-height: 0.98;
  }

  .detail-body p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.52;
  }

  .detail-body .chips {
    gap: 8px;
    margin: 16px 0 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .detail-body .chips::-webkit-scrollbar {
    display: none;
  }

  .detail-body .chips span {
    flex: 0 0 auto;
    min-height: 30px;
    font-size: 12px;
  }

  .detail-actions {
    grid-template-columns: 1fr 1fr;
  }

  .detail-actions .primary {
    grid-column: 1 / -1;
  }

  .trailer-link {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  .detail-layout {
    display: block;
  }

  .detail-section + .detail-section {
    margin-top: 26px;
  }

  .source-section {
    position: relative;
    top: auto;
    max-height: none;
    padding: 13px;
    border-radius: 18px;
    margin-bottom: 26px;
  }

  .source-row {
    min-height: 86px;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 12px;
  }

  .source-row .quality {
    justify-self: start;
    margin-left: 0;
  }

  .stream-badges {
    gap: 5px;
  }

  .stream-badge {
    font-size: 10px !important;
  }

  .season-tabs,
  .mini-strip,
  .episode-list,
  .person-known-rail {
    margin-inline: calc(-1 * var(--phone-gutter));
    padding-left: var(--phone-gutter);
    padding-right: var(--phone-gutter);
  }

  .rail-arrow {
    width: 38px;
    height: 38px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  }

  .rail-arrow-left {
    left: 2px;
  }

  .rail-arrow-right,
  .detail-wide .rail-arrow-right,
  .episodes-section .rail-arrow-right,
  .person-content .rail-arrow-right {
    right: 2px;
  }

  .rail-scroll-shell::before,
  .rail-scroll-shell::after {
    bottom: 16px;
    width: 54px;
  }

  .season-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .season-tabs::-webkit-scrollbar {
    display: none;
  }

  .season-tab {
    flex: 0 0 auto;
    min-height: 40px;
    font-size: 13px;
  }

  .episode-list {
    grid-auto-columns: minmax(238px, 78vw);
    gap: 12px;
  }

  .episode-info {
    padding: 12px;
  }

  .episode-info p {
    min-height: 4.2em;
    font-size: 13px !important;
  }

  .mini-strip {
    grid-auto-columns: 118px;
    gap: 12px;
  }

  .mini-card img,
  .mini-card > svg {
    width: 118px;
    height: 158px;
  }

  .mini-card.person img,
  .mini-card.person > svg {
    width: 118px;
    height: 118px;
  }

  .person-modal {
    padding: 0;
    align-items: flex-end;
  }

  .person-panel {
    width: 100%;
    max-height: 92dvh;
    grid-template-columns: 1fr;
    gap: 18px;
    border-radius: 24px 24px 0 0;
    padding: 22px var(--phone-gutter) calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .person-sidebar {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    text-align: left;
    padding-right: 44px;
  }

  .person-photo {
    width: 92px;
    border-radius: 16px;
  }

  .person-sidebar h2 {
    margin: 0;
    font-size: 26px;
  }

  .person-facts {
    grid-column: 2;
    font-size: 12px;
  }

  .person-facts span {
    justify-content: flex-start;
  }

  .person-content {
    overflow: visible;
    padding-right: 0;
  }

  .person-bio {
    margin-bottom: 22px;
    font-size: 14px;
    -webkit-line-clamp: 8;
  }

  .person-known-rail {
    grid-auto-columns: minmax(220px, 72vw);
  }

.person-known-rail.is-poster {
  grid-auto-columns: minmax(140px, 42vw);
}


  .login-shell,
  .profile-shell {
    min-height: 100dvh;
    padding: 20px var(--phone-gutter);
    overflow-y: auto;
  }

  .login-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: auto;
  }

  .login-brand-lockup .login-brand-logo {
    width: 62px !important;
    height: 62px !important;
  }
  .login-brand-lockup .login-wordmark {
    height: 28px !important;
    width: auto !important;
  }

  .login-logo {
    font-size: 48px;
  }

  .login-tag {
    font-size: 28px;
  }

  .login-sub {
    font-size: 15px;
  }

  .login-proof {
    gap: 7px;
  }

  .login-proof span {
    padding: 8px 10px;
    font-size: 11px;
  }

  .login-card {
    padding: 20px;
    border-radius: 22px;
  }

  .profile-center {
    width: 100%;
  }

  .profile-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .profile-pick {
    width: 100%;
  }

  .avatar-tile {
    width: min(34vw, 132px);
    height: min(34vw, 132px);
  }

  .player-top {
    padding: calc(12px + env(safe-area-inset-top)) 12px 0;
  }

  .player-top-left {
    min-width: 0;
    gap: 10px;
  }

  .player-top-left h2 {
    max-width: 64vw;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-accent-rail,
  .player-overview,
  .player-action-pill,
  .player-badges,
  .player-volume,
  .player-time {
    display: none !important;
  }

  .player-controls {
    padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  }

  .player-controls-row {
    gap: 8px;
    justify-content: center;
  }

  .player-controls-row .player-spacer {
    display: none;
  }

  .player-icon-btn {
    width: 42px;
    height: 42px;
  }

  .player-side-panel {
    left: 10px;
    right: 10px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 58dvh;
    border-radius: 20px;
    padding: 14px;
  }

  .player-panel-row {
    min-height: 66px;
  }

  .live-layout {
    padding: 86px var(--phone-gutter) 96px;
  }

  .live-status-grid {
    grid-template-columns: 1fr;
  }

  .channel-browser {
    grid-template-columns: 1fr;
  }
}

/* Settings refinement - resilient controls and cleaner account-synced rows */
.settings-shell {
  width: 100%;
  overflow-x: hidden;
}

.settings-sidebar,
.settings-panel-card {
  border-radius: 18px;
}

.settings-sidebar {
  gap: 6px;
}

.settings-section-btn {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 14px;
}

.settings-section-btn:hover,
.settings-section-btn:focus-visible,
.settings-section-btn.is-active {
  border-color: rgba(255, 255, 255, 0.12);
}

.settings-panel-card {
  overflow: hidden;
}

.settings-panel-card h2 {
  letter-spacing: 0;
}

.set-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  align-items: center;
  gap: 18px;
}

.set-control {
  justify-content: flex-end;
  min-width: 0;
}

.set-control input,
.set-control select,
.inline-form input,
.inline-form select,
.login-form input,
.settings-list-row input {
  min-height: 48px;
  border-radius: 14px;
}

.set-control input[type="color"] {
  width: 64px;
  min-width: 64px;
  padding: 5px;
}

.toggle-switch {
  width: 54px;
  height: 32px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.toggle-switch span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  transform: translateX(0);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), background 160ms ease;
}

.toggle-switch.is-on {
  border-color: color-mix(in srgb, var(--accent, #fff) 54%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent, #fff) 44%, rgba(255, 255, 255, 0.12)), color-mix(in srgb, var(--accent, #fff) 24%, rgba(0, 0, 0, 0.18))),
    rgba(255, 255, 255, 0.1);
}

.toggle-switch.is-on span {
  transform: translateX(22px);
  background: #fff;
}

.toggle-switch:disabled,
.icon-button:disabled,
.primary:disabled,
.secondary:disabled {
  cursor: default;
  opacity: 0.46;
  transform: none !important;
}

.toggle-switch:focus-visible {
  outline: none;
  box-shadow: var(--focus-glow);
}

.settings-list-row {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 16px;
  overflow: hidden;
}

.settings-list-row strong,
.settings-list-row span,
.settings-list-row input {
  min-width: 0;
}

.settings-list-row strong,
.settings-list-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list-row.server-row {
  grid-template-columns: auto minmax(140px, 1.1fr) minmax(82px, 0.35fr) minmax(180px, 1.4fr) auto;
}

.settings-list-row.catalog-row {
  grid-template-columns: auto minmax(180px, 1fr) minmax(86px, auto) auto auto auto;
}

.settings-list-row.addon-row {
  grid-template-columns: auto minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(92px, auto);
}

.settings-error-card {
  border-color: rgba(245, 158, 11, 0.28);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(8, 9, 11, 0.76);
}

@media (max-width: 720px) {
  .set-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .set-control {
    width: 100%;
    justify-content: stretch;
  }

  .set-control input:not([type="color"]),
  .set-control select {
    width: 100%;
  }

  .settings-list-row.server-row,
  .settings-list-row.catalog-row,
  .settings-list-row.addon-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .settings-list-row.server-row span,
  .settings-list-row.catalog-row span,
  .settings-list-row.addon-row span,
  .settings-list-row.catalog-row input {
    grid-column: 2;
  }
}

@media (hover: none) and (pointer: coarse) {
  .media-card:hover,
  .episode-row:hover,
  .source-row:hover,
  .mini-card:hover,
  .person-known-card:hover,
  .primary:hover,
  .secondary:hover,
  .text-button:hover,
  .pill:hover {
    transform: none !important;
    filter: none;
  }

  .media-card:hover .poster,
  .episode-row:hover,
  .source-row:hover,
  .mini-card:hover,
  .person-known-card:hover {
    box-shadow: none;
  }
}

/* ============================================================
   Targeted parity hardening - details nav, settings rows, TV warnings
   ============================================================ */

.sidebar {
  z-index: 120;
}

.details-drawer {
  padding-top: 0;
}

.detail-action-hint {
  max-width: 760px !important;
  margin: -6px 0 18px !important;
  color: rgba(255, 255, 255, 0.68) !important;
  font-size: clamp(13px, 0.95vw, 16px) !important;
}

.live-warning.is-error {
  border-color: rgba(231, 76, 60, 0.34);
  background: rgba(231, 76, 60, 0.1);
}

.live-warning.is-error strong {
  color: #ff9389;
}

.settings-content {
  min-width: 0;
}

.settings-panel-card {
  max-width: 100%;
}

.settings-list {
  min-width: 0;
}

.account-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 14px;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-copy strong,
.account-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row .secondary {
  width: auto;
  min-width: 118px;
  padding-inline: 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.settings-list-row.catalog-row,
.settings-list-row.addon-row {
  min-height: 64px;
  align-items: center;
}

.settings-list-row.catalog-row input {
  width: 100%;
}

.settings-list-row.addon-row {
  grid-template-columns: auto minmax(180px, 1.35fr) minmax(160px, 0.85fr) minmax(80px, auto) auto;
}

.addon-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.addon-main strong,
.addon-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.addon-main span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
}

.reset-settings-button {
  width: auto;
  margin-top: 16px;
  padding-inline: 18px;
}

.rail-scroll-shell {
  overflow: visible;
}

.rail-strip,
.episode-list,
.mini-strip,
.person-known-rail {
  scroll-padding-inline: 16px;
}

.media-card:hover {
  transform: translateY(-4px) !important;
}

.media-card:hover .poster,
.media-card:focus-visible .poster {
  overflow: hidden;
}

@media (max-width: 980px) {
  .account-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-row .secondary {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .settings-list-row.addon-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .settings-list-row.addon-row > span {
    grid-column: 2 / -1;
  }

  .settings-list-row.addon-row .icon-button.danger {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 680px) {
  .details-drawer {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .detail-action-hint {
    margin-top: -4px !important;
  }
}

/* ============================================================
   Mobile fit pass - phone-first cards, home, and details
   ============================================================ */

@media (max-width: 680px) {
  :root {
    --phone-gutter: 14px;
  }

  .hero {
    min-height: 520px;
    padding: 78px var(--phone-gutter) 118px;
    background-position: center top;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-logo {
    max-width: min(68vw, 230px);
    max-height: 90px;
  }

  .hero h2 {
    max-width: 12ch;
    font-size: clamp(34px, 11vw, 48px);
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.42;
    -webkit-line-clamp: 3;
  }

  .hero-actions {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 14px;
  }

  .hero-actions .primary,
  .hero-actions .secondary {
    min-height: 44px;
    border-radius: 14px;
    font-size: 13px;
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: -76px;
  }

  .rail {
    padding-left: var(--phone-gutter);
    overflow: visible;
  }

  .rail-head {
    margin-bottom: 4px;
    padding-right: var(--phone-gutter);
  }

  .rail-head h3 {
    font-size: 19px;
  }

  .rail-head span {
    font-size: 12px;
  }

  .rail-strip {
    grid-auto-columns: minmax(178px, 46vw) !important;
    gap: 10px;
    padding: 7px var(--phone-gutter) 18px 0;
  }

  .media-card {
    width: min(46vw, 190px) !important;
  }

  .media-card .poster {
    border-radius: 12px;
  }

  .media-card strong {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.15;
  }

  .media-card span,
  .card-meta-row {
    font-size: 11px;
  }

  .media-card .poster .card-logo {
    max-width: 70%;
    max-height: 44%;
  }

  .card-rating {
    display: none !important;
  }

  .rail.is-poster .rail-strip,
  .poster-results .grid-results {
    grid-auto-columns: minmax(132px, 32vw) !important;
  }

  .media-card.is-poster {
    width: min(32vw, 146px) !important;
  }

  .grid-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 10px;
    padding: 0 var(--phone-gutter) 96px;
  }

  .grid-results .media-card,
  .poster-results .grid-results .media-card {
    width: 100% !important;
  }

  .details-drawer {
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .detail-backdrop {
    height: 430px;
  }

  .detail-body {
    padding: 70px var(--phone-gutter) 92px;
  }

  .detail-hero-content {
    min-height: 350px;
    padding-bottom: 12px;
  }

  .detail-body .eyebrow {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .detail-body h2 {
    max-width: 12ch;
    margin-bottom: 12px;
    font-size: clamp(34px, 10.5vw, 48px);
  }

  .detail-body p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.42;
  }

  .detail-hero-content > p:not(.eyebrow) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  .detail-body .chips {
    margin: 12px 0 14px;
  }

  .detail-body .chips span,
  .imdb-rating b,
  .imdb-rating em {
    min-height: 26px;
    padding-inline: 8px;
    font-size: 11px !important;
  }

  .detail-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .detail-actions .primary,
  .detail-actions .secondary,
  .trailer-link {
    min-height: 42px;
    border-radius: 13px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .detail-action-hint {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .season-tabs {
    gap: 7px;
  }

  .season-tab {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .episode-list {
    grid-auto-columns: minmax(190px, 56vw) !important;
    gap: 10px;
    padding-top: 6px;
    padding-bottom: 18px;
  }

  .episode-row {
    border-radius: 14px !important;
  }

  .episode-info {
    padding: 10px 11px 12px;
  }

  .episode-info strong {
    min-height: 2.35em;
    font-size: 13px;
  }

  .episode-info p {
    min-height: 3.8em;
    font-size: 12px !important;
    -webkit-line-clamp: 3;
  }

  .source-section {
    padding: 12px;
    border-radius: 16px;
  }

  .source-row {
    min-height: 74px;
    padding: 10px;
    border-radius: 13px;
  }

  .source-row strong {
    font-size: 14px;
  }

  .source-row span {
    font-size: 11px;
  }

  .mini-strip {
    grid-auto-columns: 92px !important;
    gap: 10px;
  }

  .mini-card img,
  .mini-card > svg,
  .mini-card.person img,
  .mini-card.person > svg {
    width: 92px !important;
    height: 92px !important;
  }

  .mini-card strong {
    font-size: 12px;
  }

  .mini-card span {
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .rail-strip {
    grid-auto-columns: minmax(152px, 44vw) !important;
  }

  .media-card {
    width: min(44vw, 166px) !important;
  }

  .media-card strong {
    font-size: 12px;
  }

  .media-card span,
  .card-meta-row {
    font-size: 10px;
  }

  .episode-list {
    grid-auto-columns: minmax(174px, 54vw) !important;
  }
}

/* ============================================================
   Details parity pass - full-width episode rail and ratings
   ============================================================ */

.episodes-section.detail-wide {
  grid-column: 1 / -1;
  width: 100%;
  overflow: visible;
}

.episodes-section.detail-wide .rail-scroll-shell {
  margin-right: calc(-1 * clamp(22px, 4vw, 68px));
}

.episodes-section.detail-wide .episode-list {
  grid-auto-columns: clamp(300px, 20vw, 420px);
  padding-right: clamp(22px, 4vw, 68px);
}

.episode-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.episode-meta-line .episode-number {
  margin-bottom: 0;
}

.episode-rating {
  flex: 0 0 auto;
  transform: scale(0.86);
  transform-origin: right center;
}

.episode-rating b,
.episode-rating em {
  min-height: 24px;
  padding-inline: 6px;
  font-size: 10px !important;
}

@media (min-width: 981px) {
  .details-drawer .source-section {
    grid-column: 1 / -1;
    position: relative;
    top: auto;
    max-height: none;
  }
}

@media (max-width: 680px) {
  .episodes-section.detail-wide .rail-scroll-shell {
    margin-right: calc(-1 * var(--phone-gutter));
  }

  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: minmax(190px, 56vw) !important;
    padding-right: var(--phone-gutter);
  }

  .episode-meta-line {
    gap: 6px;
  }

  .episode-rating {
    transform: scale(0.78);
  }
}

/* ============================================================
   Android TV details parity - cinematic episode cards
   ============================================================ */

.details-drawer .detail-body {
  padding-top: clamp(82px, 10vh, 116px);
}

.details-drawer .detail-hero-content {
  min-height: clamp(300px, 42vh, 470px);
  padding-top: clamp(14px, 2.8vh, 42px);
}

.details-drawer .detail-hero-content h2 {
  max-width: 760px;
}

.episodes-section.detail-wide {
  margin-top: clamp(2px, 1.4vh, 18px);
}

.episodes-section.detail-wide .episode-list {
  grid-auto-columns: clamp(430px, 31vw, 610px);
  gap: clamp(18px, 1.55vw, 28px);
  padding-top: 4px;
  padding-bottom: 24px;
}

.episodes-section.detail-wide .episode-row {
  min-height: clamp(268px, 25vw, 340px) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.055) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.episodes-section.detail-wide .episode-still {
  position: relative;
  overflow: hidden;
}

.episodes-section.detail-wide .episode-still::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent);
  pointer-events: none;
}

.episode-chip {
  position: absolute;
  z-index: 2;
  top: 14px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 13px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.episode-chip-left {
  left: 14px;
}

.episode-chip-center {
  left: 50%;
  transform: translateX(-50%);
}

.episode-chip-right {
  right: 14px;
  top: 14px;
  transform: none;
  transform-origin: center;
}

.episode-chip-right b,
.episode-chip-right em {
  min-height: 30px;
  padding-inline: 8px;
  font-size: 13px !important;
}

.episodes-section.detail-wide .episode-play {
  z-index: 3;
}

.episodes-section.detail-wide .episode-info {
  padding: 16px 18px 18px;
}

.episodes-section.detail-wide .episode-info strong {
  min-height: 0;
  font-size: clamp(20px, 1.35vw, 27px);
  line-height: 1.12;
  -webkit-line-clamp: 1;
}

.episodes-section.detail-wide .episode-info > span {
  margin-top: 5px;
  font-size: 14px;
}

.episodes-section.detail-wide .episode-info p {
  min-height: 3.8em;
  margin-top: 7px;
  font-size: clamp(15px, 1vw, 19px);
  line-height: 1.18;
  -webkit-line-clamp: 3;
}

@media (min-width: 1500px) {
  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: clamp(540px, 31vw, 650px);
  }
}

@media (max-width: 980px) {
  .details-drawer .detail-hero-content {
    width: min(780px, 82vw);
    min-height: clamp(300px, 43vh, 440px);
  }

  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: clamp(340px, 58vw, 520px) !important;
  }
}

@media (max-width: 680px) {
  .details-drawer .detail-body {
    padding-top: 86px;
  }

  .details-drawer .detail-hero-content {
    width: 100%;
    min-height: auto;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: minmax(258px, 82vw) !important;
    gap: 14px;
  }

  .episode-chip {
    top: 10px;
    min-height: 28px;
    padding-inline: 9px;
    font-size: 12px;
  }

  .episode-chip-left {
    left: 10px;
  }

  .episode-chip-center {
    display: none;
  }

  .episode-chip-right {
    right: 10px;
    top: 10px;
    transform: none;
  }

  .episode-chip-right b,
  .episode-chip-right em {
    min-height: 25px;
    padding-inline: 6px;
    font-size: 10px !important;
  }

  .episodes-section.detail-wide .episode-info strong {
    font-size: 17px;
  }

  .episodes-section.detail-wide .episode-info p {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
}

/* ============================================================
   Details source picker + smaller episode cards
   ============================================================ */

.episodes-section.detail-wide .episode-list {
  grid-auto-columns: clamp(382px, 27vw, 540px);
}

.episodes-section.detail-wide .episode-row {
  min-height: clamp(232px, 21vw, 302px) !important;
}

@media (min-width: 1500px) {
  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: clamp(475px, 28vw, 590px);
  }
}

.source-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: clamp(12px, 2.2vh, 24px) clamp(14px, 3vw, 42px);
  overflow: hidden;
}

.source-modal-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.11), transparent 34%),
    rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(18px);
}

.source-panel {
  position: relative;
  margin-top: 10px;
  z-index: 1;
  width: min(1440px, 100%);
  height: min(88dvh, 940px);
  max-height: calc(100dvh - clamp(24px, 4.4vh, 48px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(27, 31, 38, 0.96), rgba(5, 7, 10, 0.98)),
    #050505;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.68);
  padding: clamp(18px, 2.4vw, 30px);
  overflow: hidden;
}

.source-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.source-panel-head h2 {
  margin: 4px 0 6px;
  font-size: clamp(26px, 2.5vw, 42px);
  line-height: 1.05;
}

.episode-subline {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.episode-subline em {
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(245, 197, 31, 0.11);
  color: rgba(245, 197, 31, 0.86);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.source-panel-head span {
  color: var(--muted);
  font-weight: 650;
}

.source-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.source-search {
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
}

.source-search input {
  min-height: 0;
  height: 48px;
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: #fff;
}

.source-filter-group,
.source-addon-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-filter-group button,
.source-addon-tabs button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  font-weight: 750;
  cursor: pointer;
}

.source-filter-group button.is-active,
.source-addon-tabs button.is-active,
.source-filter-group button:hover,
.source-addon-tabs button:hover {
  color: #000;
  background: #fff;
  border-color: #fff;
}

.source-addon-tabs {
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  height: 50px;
  /* overflow-x:auto lets this collapse to 0 min-height, so in the flex column
     the tall source list's shrink pressure would crush it. Pin its size. */
  flex: 0 0 50px;
}

.source-addon-tabs::-webkit-scrollbar {
  display: none;
}

.source-addon-tabs button {
  flex: 0 0 auto;
}

.source-picker-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 4px;
}

.source-picker-row {
  width: 100%;
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.055)),
    rgba(0, 0, 0, 0.34);
  color: #fff;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 180ms ease, background 160ms ease;
}

.source-picker-row:hover,
.source-picker-row:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, #fff) 58%, transparent);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.38);
}

.source-picker-row.is-locked {
  opacity: 0.74;
}

.source-warning {
  display: block;
  margin-top: 2px;
  color: rgba(255, 214, 130, 0.92);
  font-size: 12px;
  font-style: normal;
}

.source-rank {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 850;
}

.source-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.source-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.source-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.source-side {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.source-side b {
  color: var(--gold);
  font-size: 18px;
}

.source-side small {
  color: var(--muted);
  font-weight: 750;
}

.source-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 280px;
}

.source-action {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.source-action.primary-action {
  background: color-mix(in srgb, var(--accent, #fff) 22%, rgba(255, 255, 255, 0.08));
}

.source-action.icon-only {
  width: 30px;
  padding: 0;
  justify-content: center;
}

.source-action:hover,
.source-action:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent, #fff) 60%, transparent);
  background: rgba(255, 255, 255, 0.16);
}

.source-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.source-empty {
  margin: 22px 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: clamp(300px, 52vw, 460px) !important;
  }

  .source-toolbar {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 680px) {
  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: minmax(226px, 76vw) !important;
  }

  .episodes-section.detail-wide .episode-row {
    min-height: 0 !important;
  }

  .source-modal {
    align-items: end;
    padding: 0;
  }

  .source-panel {
    width: 100%;
    max-height: 88vh;
    height: 88vh;
    border-radius: 22px 22px 0 0;
    padding: 18px 14px 16px;
  }

  .source-picker-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .source-rank {
    display: none;
  }

  .source-side {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    justify-items: stretch;
    gap: 8px;
  }

  .source-row-actions {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }
}

/* ============================================================
   Details/source layout repair - final overrides
   ============================================================ */

.details-drawer {
  overflow-x: hidden;
}

.details-drawer .detail-body {
  overflow-x: hidden;
}

.details-drawer .detail-hero-content {
  min-height: clamp(260px, 36vh, 430px);
  width: min(820px, calc(100vw - 72px));
}

.details-drawer .detail-layout,
.details-drawer .detail-wide {
  min-width: 0;
  max-width: 100%;
}

.episodes-section.detail-wide {
  overflow: hidden;
}

.episodes-section.detail-wide .rail-scroll-shell {
  max-width: 100%;
  overflow: hidden;
}

.episodes-section.detail-wide .episode-list {
  grid-auto-columns: clamp(292px, 34vw, 390px) !important;
  gap: clamp(12px, 1.4vw, 18px);
  max-width: 100%;
  padding: 4px clamp(32px, 4vw, 56px) 18px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.episodes-section.detail-wide .episode-row {
  width: 100%;
  min-height: 0 !important;
  height: auto;
  align-self: start;
  overflow: hidden;
}

.episodes-section.detail-wide .episode-still {
  aspect-ratio: 16 / 9;
  height: auto !important;
  min-height: 0;
}

.episodes-section.detail-wide .episode-info {
  padding: 12px 14px 14px;
}

.episodes-section.detail-wide .episode-info strong {
  font-size: clamp(16px, 1.35vw, 20px);
}

.episodes-section.detail-wide .episode-info > span,
.episode-subline {
  font-size: 12px;
  line-height: 1.25;
}

.episodes-section.detail-wide .episode-info p {
  min-height: 0;
  margin-top: 6px;
  font-size: clamp(12px, 1.05vw, 14px);
  line-height: 1.32;
  -webkit-line-clamp: 2;
}

.episode-chip {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.episode-chip-left {
  left: 10px;
}

.episode-chip-center {
  top: 10px;
}

.episode-chip-left,
.episode-chip-center {
  top: 10px;
}

.source-panel {
  width: min(1180px, calc(100vw - 28px));
  height: min(86dvh, 820px);
  gap: 12px;
}

.source-picker-row {
  grid-template-columns: 34px minmax(0, 1fr) minmax(178px, auto);
  gap: 10px;
  min-height: 76px;
}

.source-row-actions {
  max-width: 230px;
  gap: 5px;
}

.source-action {
  min-height: 28px;
  padding: 0 8px;
}

@media (max-width: 980px) {
  .details-drawer .detail-body {
    padding-left: clamp(18px, 4vw, 32px);
    padding-right: clamp(18px, 4vw, 32px);
  }

  .details-drawer .detail-hero-content {
    width: min(760px, calc(100vw - 48px));
    min-height: clamp(240px, 34vh, 380px);
  }

  .details-drawer .detail-body h2 {
    font-size: clamp(40px, 8vw, 64px);
  }

  .details-drawer .detail-body p:not(.eyebrow) {
    max-width: 78ch;
    font-size: clamp(16px, 2.2vw, 22px);
  }

  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: clamp(270px, 42vw, 360px) !important;
  }

  .source-panel-head {
    gap: 12px;
  }

  .source-panel-head h2 {
    font-size: clamp(22px, 4.4vw, 34px);
  }

  .source-picker-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-rank {
    display: none;
  }

  .source-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    justify-items: stretch;
    gap: 10px;
  }

  .source-row-actions {
    max-width: none;
    justify-content: flex-end;
  }
}

@media (max-width: 680px) {
  .details-drawer .detail-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .details-drawer .detail-hero-content {
    width: 100%;
    min-height: auto;
  }

  .details-drawer .detail-body h2 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .detail-actions {
    gap: 8px;
  }

  .detail-actions .primary,
  .detail-actions .secondary {
    min-height: 46px;
    padding-inline: 14px;
    font-size: 15px;
  }

  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: minmax(230px, 76vw) !important;
    padding-right: 28px;
  }

  .episodes-section.detail-wide .episode-info {
    padding: 10px 12px 12px;
  }

  .source-panel {
    width: 100%;
    height: 88dvh;
    max-height: 88dvh;
  }

  .source-panel-head {
    align-items: flex-start;
  }

  .source-panel-head span {
    font-size: 12px;
  }

  .source-side {
    justify-content: flex-start;
  }
}

.source-picker-row {
  grid-template-columns: 34px minmax(0, 1fr) !important;
  align-items: start;
  min-height: 112px;
  padding-block: 13px;
}

.source-rank {
  grid-row: 1 / span 2;
  margin-top: 1px;
}

.source-main {
  overflow: hidden;
}

.source-main strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.14;
}

.source-main em {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}

.source-main .stream-badges {
  max-width: 100%;
  margin-top: 5px;
}

.source-side {
  grid-column: 2;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-items: stretch;
  gap: 10px;
}

.source-side b,
.source-side small {
  flex: 0 0 auto;
}

.source-row-actions {
  max-width: none;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.source-picker-row .source-side > b,
.source-picker-row .source-side > small {
  display: none;
}

.source-picker-row .source-side {
  justify-content: flex-end;
}

.source-picker-row .source-row-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 680px) {
  .source-picker-row {
    min-height: 0;
    padding-block: 12px;
  }

  .source-side b,
  .source-side small {
    font-size: 13px;
  }

  .source-row-actions {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

/* Keep source rows readable after tablet/mobile overrides above. */
@media (min-width: 681px) {
  .source-picker-row {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
    align-items: start;
  }

  .source-rank {
    display: grid !important;
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .source-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
  }

  .source-side {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    width: 100%;
  }
}

/* Source picker polish: use the screen, sort-heavy rows, clear playback status. */
.source-panel {
  width: min(1680px, calc(100vw - 32px));
  height: min(94dvh, 1040px);
  max-height: calc(100dvh - 24px);
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.source-panel-head h2 {
  max-width: min(1120px, 74vw);
}

.source-picker-list {
  gap: 9px;
  padding-right: 8px;
}

.source-picker-row {
  min-height: 104px;
  padding: 13px 16px;
  border-radius: 14px;
}

.source-main {
  gap: 6px;
}

.source-main strong {
  font-size: clamp(18px, 1.35vw, 23px);
}

.source-main em {
  color: rgba(255, 255, 255, 0.64);
  -webkit-line-clamp: 2;
}

.source-playback-status {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

/* Playable in the browser (direct / remux) — calm green, not a warning. */
.source-playback-status.is-web {
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.12);
  color: #86efac;
}

/* Plays via debrid transcoding — informative blue. */
.source-playback-status.is-transcode {
  border-color: rgba(96, 205, 255, 0.34);
  background: rgba(96, 205, 255, 0.12);
  color: #8fdcff;
}

/* Needs an external player — muted neutral, not alarming yellow. */
.source-playback-status.needs-vlc,
.source-playback-status.is-unavailable {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.58);
}

.source-warning {
  margin-top: 0;
}

.source-picker-row .source-side {
  align-items: center;
}

.source-picker-row .source-row-actions {
  gap: 8px;
}

.source-action {
  min-height: 32px;
  padding-inline: 10px;
}

.source-action.primary-action:disabled {
  opacity: 0.36;
}

@media (min-width: 1180px) {
  .source-picker-row {
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
    grid-template-rows: auto;
    align-items: center;
  }

  .source-rank {
    grid-column: 1;
    grid-row: 1;
  }

  .source-main {
    grid-column: 2;
    grid-row: 1;
  }

  .source-side {
    grid-column: 3;
    grid-row: 1;
    width: auto;
    min-width: 300px;
  }
}

@media (max-width: 680px) {
  .source-panel {
    height: 94dvh;
    max-height: 94dvh;
    padding: 16px 12px 14px;
  }

  .source-panel-head h2 {
    max-width: calc(100vw - 86px);
  }

  .source-picker-row {
    min-height: 0;
    padding: 12px;
  }

  .source-main strong {
    font-size: 16px;
  }

  .source-playback-status {
    font-size: 11px;
  }

  .source-picker-row .source-row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Final source picker geometry: centered, symmetrical, and stable across wide screens. */
.source-modal {
  align-items: center !important;
  justify-items: center !important;
  padding: clamp(14px, 2.5vw, 34px) !important;
}

.source-panel {
  width: min(1320px, calc(100vw - 48px)) !important;
  height: min(88dvh, 900px) !important;
  max-height: calc(100dvh - 40px) !important;
  margin: auto !important;
  border-radius: 22px !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
}

.source-panel-head {
  align-items: flex-start !important;
}

.source-panel-head > div {
  min-width: 0;
}

.source-panel-head h2 {
  max-width: min(1040px, calc(100vw - 160px)) !important;
}

.source-toolbar {
  align-items: center;
}

.source-picker-list {
  padding: 2px 8px 12px 2px !important;
}

.source-picker-row {
  position: relative !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  align-items: start !important;
  gap: 8px 14px !important;
  min-height: 176px !important;
  padding: 14px 16px 58px !important;
}

.source-rank {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  margin-top: 2px !important;
}

.source-main {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  width: 100% !important;
}

.source-main strong {
  font-size: clamp(17px, 1.2vw, 22px) !important;
  line-height: 1.16 !important;
}

.source-main em {
  -webkit-line-clamp: 2 !important;
}

.source-main .stream-badges {
  max-width: calc(100% - 300px) !important;
}

.source-side {
  position: absolute !important;
  right: 16px !important;
  bottom: 14px !important;
  width: auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  justify-items: stretch !important;
  gap: 12px !important;
}

.source-picker-row .source-side > b,
.source-picker-row .source-side > small {
  display: none !important;
}

.source-side b {
  min-width: 58px;
  font-size: 16px !important;
}

.source-side small {
  min-width: 74px;
  text-align: left;
}

.source-row-actions {
  flex: 0 0 auto !important;
  max-width: none !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 7px !important;
}

.source-action {
  min-height: 32px !important;
  padding-inline: 10px !important;
}

@media (max-width: 980px) {
  .source-panel {
    width: min(760px, calc(100vw - 28px)) !important;
    height: min(90dvh, 860px) !important;
  }

  .source-panel-head h2 {
    max-width: calc(100vw - 120px) !important;
  }

  .source-picker-row {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    min-height: 188px !important;
  }

  .source-side {
    position: static !important;
    grid-column: 2 !important;
    width: 100% !important;
    margin-top: 10px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }

  .source-row-actions {
    flex: 1 1 100% !important;
    justify-content: flex-start !important;
  }

  .source-main .stream-badges {
    max-width: 100% !important;
  }
}

@media (max-width: 680px) {
  .source-modal {
    align-items: end !important;
    padding: 0 !important;
  }

  .source-panel {
    width: 100% !important;
    height: 92dvh !important;
    max-height: 92dvh !important;
    border-radius: 22px 22px 0 0 !important;
    padding: 16px 12px 14px !important;
  }

  .source-panel-head h2 {
    max-width: calc(100vw - 78px) !important;
  }

  .source-picker-row {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0 !important;
    padding: 12px !important;
  }

  .source-rank {
    display: none !important;
  }

  .source-main,
  .source-side {
    grid-column: 1 !important;
  }

  .source-side {
    position: static !important;
    width: 100% !important;
    margin-top: 10px !important;
  }

  .source-side b,
  .source-side small {
    display: none !important;
  }

  .source-row-actions {
    width: 100% !important;
  }

  .source-action {
    min-height: 34px !important;
  }
}

.external-playback-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
}

.external-playback-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.1), transparent 34%),
    rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
}

.external-playback-card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(28, 32, 40, 0.97), rgba(5, 7, 10, 0.98)),
    #050505;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.66);
  padding: clamp(22px, 3vw, 32px);
  color: #fff;
}

.external-playback-card h3 {
  margin: 5px 42px 9px 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
}

.external-playback-card p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.45;
}

.external-playback-card small {
  display: block;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 1.45;
}

.external-playback-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.external-playback-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.external-playback-actions button,
.external-progress-grid button,
.external-back {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 820;
  cursor: pointer;
}

.external-playback-actions .primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.external-playback-actions .secondary,
.external-progress-grid button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.external-playback-actions .ghost,
.external-back {
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}

.external-playback-actions button:hover,
.external-playback-actions button:focus-visible,
.external-progress-grid button:hover,
.external-progress-grid button:focus-visible,
.external-back:hover,
.external-back:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #fff) 62%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #fff) 30%, transparent);
}

.external-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.external-back {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 560px) {
  .external-playback-modal {
    align-items: end;
    padding: 0;
  }

  .external-playback-card {
    width: 100%;
    border-radius: 22px 22px 0 0;
  }

  .external-playback-actions {
    grid-template-columns: 1fr;
  }

  .external-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final polish: details clearlogo, external prompt buttons, and focus-safe rails. */
.detail-clearlogo {
  display: block;
  width: min(560px, 54vw);
  max-height: clamp(94px, 14vw, 178px);
  object-fit: contain;
  object-position: left center;
  margin: 10px 0 18px;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.62));
}

.external-playback-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch;
}

.external-playback-actions button,
.external-progress-grid button,
.external-back {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  height: auto;
  padding: 10px 14px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.12;
  letter-spacing: 0;
  font-size: clamp(13px, 1.1vw, 15px);
}

.external-playback-actions button svg,
.external-progress-grid button svg,
.external-back svg {
  flex: 0 0 auto;
}

.external-playback-actions .primary,
.external-playback-actions .secondary,
.external-playback-actions .ghost {
  border-radius: 16px;
}

.rail-scroll-shell,
.episodes-section.detail-wide,
.episodes-section.detail-wide .rail-scroll-shell {
  overflow: visible !important;
}

.rail-strip,
.episode-list,
.mini-strip,
.person-known-rail {
  padding-top: 12px !important;
  padding-bottom: clamp(24px, 3vh, 42px) !important;
  scroll-padding-inline: clamp(20px, 3vw, 48px) !important;
}

.rail-strip {
  padding-left: 10px !important;
}

.episodes-section.detail-wide .episode-list {
  padding-top: 12px !important;
  padding-bottom: 32px !important;
  overflow-x: auto !important;
}

.media-card,
.episode-row,
.mini-card,
.person-known-card {
  transform-origin: center center;
}

@media (max-width: 680px) {
  .detail-clearlogo {
    width: min(84vw, 420px);
    max-height: 118px;
    margin-bottom: 14px;
  }

  .external-playback-actions {
    grid-template-columns: 1fr !important;
  }

  .external-playback-actions button,
  .external-progress-grid button,
  .external-back {
    min-height: 50px;
    border-radius: 15px;
    font-size: 14px;
  }

  .rail-strip {
    padding-left: 6px !important;
  }
}

/* Settings control polish: stable button sizing, premium hover/focus, and no clipped labels. */
.settings-panel-card .primary,
.settings-panel-card .secondary,
.settings-panel-card .text-button,
.settings-panel-card .icon-button {
  box-sizing: border-box;
  min-width: 0;
  letter-spacing: 0;
  transition:
    transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 170ms ease,
    background 170ms ease,
    color 170ms ease,
    box-shadow 170ms ease;
}

.settings-panel-card .primary,
.settings-panel-card .secondary,
.settings-panel-card .text-button {
  max-width: 100%;
  width: fit-content;
  min-height: 44px;
  height: auto;
  padding: 10px 18px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.12;
}

.settings-panel-card .primary svg,
.settings-panel-card .secondary svg,
.settings-panel-card .text-button svg,
.settings-section-btn svg {
  flex: 0 0 auto;
}

.settings-panel-card .primary:hover:not(:disabled),
.settings-panel-card .secondary:hover:not(:disabled),
.settings-panel-card .text-button:hover:not(:disabled),
.settings-panel-card .icon-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, #fff) 34%, rgba(255, 255, 255, 0.16));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42), 0 0 0 1px color-mix(in srgb, var(--accent, #fff) 18%, transparent);
}

.settings-panel-card .primary:focus-visible,
.settings-panel-card .secondary:focus-visible,
.settings-panel-card .text-button:focus-visible,
.settings-panel-card .icon-button:focus-visible,
.settings-section-btn:focus-visible,
.settings-panel-card select:focus-visible,
.settings-panel-card input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #fff) 58%, rgba(255, 255, 255, 0.16));
  box-shadow: var(--focus-glow);
}

.settings-panel-card .primary:disabled,
.settings-panel-card .secondary:disabled,
.settings-panel-card .text-button:disabled,
.settings-panel-card .icon-button:disabled {
  white-space: normal;
  overflow-wrap: anywhere;
}

.settings-panel-card > .primary,
.settings-panel-card > .secondary,
.settings-panel-card > .text-button,
.device-code > .secondary {
  min-width: min(220px, 100%);
}

.settings-panel-card > .primary,
.settings-panel-card > .secondary {
  margin-top: 2px;
}

.settings-panel-card .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.settings-panel-card .hero-actions .primary,
.settings-panel-card .hero-actions .secondary {
  flex: 1 1 160px;
  width: auto;
  min-width: min(160px, 100%);
}

.device-code {
  max-width: 100%;
  overflow: hidden;
}

.device-code span,
.device-code p {
  overflow-wrap: anywhere;
}

.account-row .secondary {
  min-width: min(132px, 100%);
  max-width: 100%;
}

.set-control select,
.settings-panel-card select {
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.84) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.84) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.set-control select:hover,
.settings-panel-card select:hover,
.set-control input:hover,
.settings-panel-card input:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.105);
}

@media (max-width: 720px) {
  .settings-panel-card .primary,
  .settings-panel-card .secondary,
  .settings-panel-card .text-button,
  .settings-panel-card > .primary,
  .settings-panel-card > .secondary,
  .settings-panel-card > .text-button,
  .device-code > .secondary {
    width: 100%;
  }

  .settings-panel-card .hero-actions .primary,
  .settings-panel-card .hero-actions .secondary {
    flex-basis: 100%;
  }
}

/* Settings parity pass: Android-style option sheets, subtitle preview, and richer managers. */
.option-button {
  min-height: 48px;
  width: clamp(168px, 17vw, 260px);
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.065)),
    rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  font-weight: 760;
  cursor: pointer;
  text-align: left;
}

.option-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-button:hover,
.option-button:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #fff) 52%, rgba(255, 255, 255, 0.18));
  box-shadow: var(--focus-glow);
}

.option-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(16px);
  overscroll-behavior: contain;
  touch-action: none;
}

.option-sheet {
  width: min(520px, calc(100vw - 28px));
  max-height: min(76dvh, 720px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(30, 34, 42, 0.98), rgba(5, 7, 10, 0.98)),
    #050505;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.68);
  padding: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  touch-action: auto;
}

.option-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 8px;
}

.option-sheet-head strong {
  font-size: 22px;
}

.option-sheet-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.option-row {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  font-weight: 740;
  cursor: pointer;
}

.option-row:hover,
.option-row:focus-visible,
.option-row.is-selected {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #fff) 52%, transparent);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
}

.option-row.is-selected {
  color: #fff;
}

.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.settings-status-grid div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  padding: 12px;
}

.settings-status-grid span,
.settings-status-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-status-grid span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.settings-status-grid strong {
  margin-top: 4px;
  color: #fff;
  font-size: 14px;
}

.subtitle-preview {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.subtitle-preview-frame {
  position: relative;
  height: clamp(170px, 24vw, 250px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%),
    radial-gradient(circle at 76% 25%, rgba(0, 213, 136, 0.24), transparent 28%),
    linear-gradient(145deg, #111827, #020305 72%);
}

.subtitle-preview-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.35;
}

.subtitle-preview-text {
  position: absolute;
  left: 50%;
  max-width: 88%;
  padding: 4px 8px;
  transform: translateX(-50%);
  text-align: center;
  line-height: 1.18;
  font-weight: 800;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.9);
}

.subtitle-pos-bottom { bottom: 18px; }
.subtitle-pos-low { bottom: 42px; }
.subtitle-pos-medium { bottom: 50%; transform: translate(-50%, 50%); }
.subtitle-pos-high { top: 34px; }
.subtitle-style-shadow { text-shadow: 0 4px 12px rgba(0, 0, 0, 0.95); font-weight: 650; }
.subtitle-style-background { background: rgba(0, 0, 0, 0.62); border-radius: 8px; text-shadow: none; }
.subtitle-style-raised { text-shadow: 0 1px 0 #000, 0 3px 0 rgba(0, 0, 0, 0.72); }

.subtitle-preview p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.settings-list-row.catalog-row {
  grid-template-columns: auto minmax(180px, 1fr) minmax(86px, auto) minmax(150px, auto) auto auto auto;
}

.catalog-source-line {
  grid-column: 2 / -1;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list-row.iptv-row {
  grid-template-columns: auto minmax(130px, 0.7fr) minmax(220px, 1.4fr) minmax(180px, 1fr) auto;
}

.settings-list-row.iptv-row input {
  width: 100%;
}

@media (max-width: 860px) {
  /* Keep the three short status chips (Cloud / Trakt / Sync) side by side —
     stacking them full-width made them tall, unbalanced bars. */
  .settings-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .settings-status-grid div {
    padding: 10px 12px;
  }

  .settings-status-grid span {
    font-size: 11px;
  }

  .settings-status-grid strong {
    font-size: 13px;
  }

  .option-button {
    width: 100%;
  }

  .settings-list-row.catalog-row,
  .settings-list-row.iptv-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .settings-list-row.catalog-row > span,
  .settings-list-row.catalog-row > .option-button,
  .settings-list-row.catalog-row > .catalog-source-line,
  .settings-list-row.iptv-row input {
    grid-column: 2 / -1;
  }

  .settings-list-row.catalog-row > .icon-button.danger,
  .settings-list-row.iptv-row > .icon-button.danger {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .option-sheet-backdrop {
    align-items: end;
    padding: 0;
  }

  .option-sheet {
    width: 100%;
    max-height: 82dvh;
    border-radius: 22px 22px 0 0;
  }
}

/* ============================================================
   Cinematic hero integration - softer image exits and page blend
   ============================================================ */

.hero {
  isolation: isolate;
  min-height: clamp(780px, 98vh, 1080px);
  background-position: center right;
  box-shadow:
    inset 0 -260px 220px rgba(0, 0, 0, 0.96),
    inset 0 120px 160px rgba(0, 0, 0, 0.48);
}

.hero::before {
  z-index: 0;
  background:
    radial-gradient(ellipse at 78% 38%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.08) 34%, rgba(0, 0, 0, 0.72) 82%, #000 100%),
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.92) 25%, rgba(0, 0, 0, 0.44) 58%, rgba(0, 0, 0, 0.16) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.06) 30%, rgba(0, 0, 0, 0.48) 60%, #000 100%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
  inset: auto 0 0;
  height: min(56vh, 560px);
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.34) 24%, rgba(0, 0, 0, 0.9) 70%, #000 100%),
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.74) 24%, rgba(0, 0, 0, 0.16) 64%, transparent 100%);
}

.hero-copy {
  z-index: 2;
}

.hero-logo,
.detail-clearlogo {
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.72));
}

.hero + .rail,
.hero + .rail-skeleton {
  margin-top: clamp(-430px, -46vh, -310px);
  position: relative;
  z-index: 3;
}

.details-drawer {
  background:
    linear-gradient(180deg, #020303 0%, #000 48%, #000 100%);
}

.detail-backdrop {
  isolation: isolate;
  height: clamp(720px, 92vh, 1040px);
  overflow: hidden;
  /* Only a soft bottom vignette to blend into the page — no center darkening. */
  box-shadow: inset 0 -280px 220px -60px rgba(0, 0, 0, 0.95);
}

/* Bottom fade so the image dissolves into the content below. */
.detail-backdrop::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: auto 0 0;
  height: min(58vh, 600px);
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 45%, rgba(0, 0, 0, 0.9) 82%, #000 100%);
}

/* Left-side scrim for text legibility — fully clear on the right half so the
   hero image stays clean (no middle shade, no center radial). */
.detail-backdrop::after {
  z-index: 1;
  background: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.7) 24%, rgba(0, 0, 0, 0.28) 52%, transparent 74%);
}

.details-drawer .detail-body {
  /* Sit just under the transparent topbar so more fits on one screen. */
  padding-top: clamp(84px, 9vh, 108px);
}

.details-drawer .detail-hero-content {
  min-height: clamp(420px, 54vh, 620px);
}

.details-drawer .detail-layout {
  margin-top: clamp(-34px, -3vh, -14px);
  position: relative;
  z-index: 3;
}

.season-tab.is-loading {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: rgba(255, 255, 255, 0.62);
  cursor: default;
}

@media (max-width: 980px) {
  .hero {
    min-height: clamp(680px, 90vh, 900px);
    box-shadow:
      inset 0 -210px 170px rgba(0, 0, 0, 0.94),
      inset 0 90px 120px rgba(0, 0, 0, 0.44);
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: clamp(-240px, -28vh, -154px);
  }

  .detail-backdrop {
    height: clamp(620px, 78vh, 820px);
  }

  .details-drawer .detail-hero-content {
    min-height: clamp(390px, 54vh, 560px);
  }

  .details-drawer .detail-layout {
    margin-top: clamp(-28px, -2.5vh, -10px);
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 640px;
    padding-bottom: 148px;
    background-position: center top;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.14) 34%, rgba(0, 0, 0, 0.62) 72%, #000 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.32) 58%, rgba(0, 0, 0, 0.12) 100%);
  }

  .hero::after {
    height: 360px;
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: -142px;
  }

  .detail-backdrop {
    height: 680px;
    background-position: center top;
  }

  .detail-backdrop::after {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.12) 34%, rgba(0, 0, 0, 0.68) 72%, #000 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.12));
  }

  .details-drawer .detail-body {
    padding-top: 96px;
  }

  .details-drawer .detail-hero-content {
    min-height: 500px;
  }

  .details-drawer .detail-layout {
    margin-top: 0;
  }
}

/* Final premium hero/metadata pass */
.hero {
  min-height: clamp(760px, 94vh, 1060px);
  background-position: center right;
  box-shadow: inset 0 -300px 230px rgba(0, 0, 0, 0.98);
}

.hero::before {
  background:
    radial-gradient(ellipse at 76% 34%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.16) 40%, rgba(0, 0, 0, 0.88) 90%, #000 100%),
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.92) 25%, rgba(0, 0, 0, 0.38) 62%, rgba(0, 0, 0, 0.08) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.08) 32%, rgba(0, 0, 0, 0.5) 64%, #000 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: min(58vh, 620px);
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.42) 30%, rgba(0, 0, 0, 0.93) 76%, #000 100%),
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.66) 28%, transparent 72%);
  z-index: 1;
}

.hero-copy {
  z-index: 2;
}

.hero + .rail,
.hero + .rail-skeleton {
  margin-top: clamp(-250px, -27vh, -166px);
  position: relative;
  z-index: 3;
}

.hero-meta > span,
.hero-rating {
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.hero-meta {
  color: rgba(255, 255, 255, 0.84);
  gap: 0;
}

.hero-meta > span + span::before {
  content: "\2022";
  margin: 0 12px;
  color: rgba(255, 255, 255, 0.42);
}

.hero-rating {
  color: #f5c518;
}

.detail-rating-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: clamp(12px, 1.2vw, 18px) 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 700;
}

/* Genre chips beside the IMDb badge — Android MetaPill look (subtle, uppercase). */
.detail-rating-line > span:not(.imdb-rating) {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 11px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(11px, 0.78vw, 13px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-body .detail-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  margin: clamp(10px, 1vw, 16px) 0 clamp(14px, 1.4vw, 20px);
  line-height: 1.5;
}

.detail-body .detail-metadata span {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  padding: 0;
  backdrop-filter: none;
  font-size: clamp(13px, 0.95vw, 16px);
  font-weight: 650;
  line-height: 1.5;
}

.detail-body .detail-metadata span + span::before {
  content: "\2022";
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.38);
  font-weight: 400;
}

.detail-body p.detail-overview,
.detail-body p:not(.eyebrow) {
  max-width: 900px;
  margin: 0 0 clamp(18px, 1.8vw, 26px);
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(15px, 1.15vw, 20px);
  line-height: 1.55;
}

.detail-service-logos {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 clamp(16px, 1.8vw, 26px);
}

.detail-service-logos span {
  width: clamp(34px, 2.7vw, 44px);
  height: clamp(34px, 2.7vw, 44px);
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
  padding: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.detail-service-logos img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 980px) {
  .hero {
    min-height: clamp(650px, 86vh, 880px);
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: clamp(-170px, -20vh, -110px);
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 620px;
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: -96px;
  }

  .detail-rating-line,
  .detail-body .detail-metadata {
    row-gap: 7px;
  }

  .detail-service-logos span {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
}

/* Final search layout pass - keep search clear of the fixed top navigation */
.screen:has(.search-hero) {
  min-height: 100dvh;
  padding-top: 0;
}

.search-hero {
  min-height: 0;
  padding: clamp(118px, 15vh, 168px) clamp(22px, 4.2vw, 78px) clamp(28px, 4vh, 48px) !important;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 1.4vw, 22px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0)),
    radial-gradient(ellipse at 72% 0%, rgba(0, 213, 136, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.78) 68%, transparent);
}

.search-icon-shell {
  width: clamp(54px, 4.2vw, 70px);
  height: clamp(54px, 4.2vw, 70px);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.search-hero input {
  width: 100%;
  min-width: 0;
  min-height: clamp(62px, 5.2vw, 82px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.085)),
    rgba(0, 0, 0, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 60px rgba(0, 0, 0, 0.36);
  padding: 0 clamp(22px, 2vw, 34px);
  color: #fff;
  font-size: clamp(22px, 2.1vw, 34px);
  font-weight: 650;
}

.search-hero input::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.search-hero input:focus {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.7),
    0 24px 70px rgba(0, 0, 0, 0.44);
}

.screen:has(.search-hero) .grid-results {
  padding: 0 clamp(22px, 4.2vw, 78px) 96px;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  align-items: start;
}

.screen:has(.search-hero).poster-results .grid-results {
  grid-template-columns: repeat(auto-fill, minmax(150px, 210px));
}

@media (max-width: 980px) {
  .search-hero {
    padding-top: 112px !important;
    padding-bottom: 28px !important;
  }
}

@media (max-width: 560px) {
  .search-hero {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 16px var(--phone-gutter) 14px !important;
    gap: 10px;
  }

  .search-icon-shell {
    width: 42px;
    height: 42px;
  }

  .search-hero input {
    min-height: 50px;
    padding-inline: 16px;
    font-size: 16px;
  }

  .screen:has(.search-hero) .grid-results,
  .screen:has(.search-hero).poster-results .grid-results {
    grid-template-columns: 1fr;
    padding: 0 var(--phone-gutter) 24px !important;
  }
}

/* Final immersive nav pass: remove the visible desktop topbar divider/band. */
@media (min-width: 681px) {
  .sidebar {
    height: clamp(96px, 13vh, 154px);
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.48) 42%, rgba(0, 0, 0, 0.18) 76%, transparent 100%) !important;
  }

  .sidebar::before,
  .sidebar::after {
    content: none !important;
    display: none !important;
  }
}

/* Final cinematic hero pass: long fades, no visible image boundary. */
.hero {
  min-height: clamp(620px, 82vh, 880px) !important;
  padding: clamp(145px, 17.5vh, 200px) 3.35vw clamp(150px, 20vh, 240px) !important;
  background-position: 68% center !important;
  background-size: cover !important;
  isolation: isolate;
}

.hero::before {
  inset: -1px !important;
  z-index: 0;
  background:
    radial-gradient(ellipse 118% 92% at 82% 34%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.035) 34%, rgba(0, 0, 0, 0.24) 68%, rgba(0, 0, 0, 0.78) 100%),
    radial-gradient(ellipse 88% 76% at 9% 48%, rgba(0, 0, 0, 0.76) 0%, rgba(0, 0, 0, 0.5) 44%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.88) 24%, rgba(0, 0, 0, 0.46) 50%, rgba(0, 0, 0, 0.17) 78%, rgba(0, 0, 0, 0.08) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.08) 30%, rgba(0, 0, 0, 0.12) 56%, rgba(0, 0, 0, 0.34) 78%, rgba(0, 0, 0, 0.72) 100%) !important;
}

.hero::after {
  content: "" !important;
  position: absolute !important;
  inset: auto 0 -1px !important;
  height: min(78vh, 820px) !important;
  z-index: 1 !important;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.025) 18%, rgba(0, 0, 0, 0.13) 42%, rgba(0, 0, 0, 0.54) 72%, #000 100%),
    radial-gradient(ellipse 112% 100% at 8% 100%, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.5) 42%, rgba(0, 0, 0, 0) 78%),
    radial-gradient(ellipse 100% 78% at 100% 100%, rgba(0, 0, 0, 0.54) 0%, rgba(0, 0, 0, 0) 70%) !important;
}

.hero-copy {
  z-index: 2 !important;
  width: min(800px, 50vw);
  margin-top: 0 !important;
}

.hero-logo,
.hero h2 {
  max-width: min(760px, 48vw);
}

.hero + .rail,
.hero + .rail-skeleton {
  margin-top: clamp(-270px, -27vh, -190px) !important;
  position: relative;
  z-index: 4;
}

.hero + .rail::before,
.hero + .rail-skeleton::before {
  content: none !important;
  display: none !important;
}

@media (max-width: 1180px) {
  .hero {
    min-height: clamp(760px, 106vh, 1040px) !important;
    padding-bottom: clamp(250px, 34vh, 370px) !important;
    background-position: 62% center !important;
  }

  .hero-copy {
    width: min(690px, 58vw);
  }

  .hero-logo,
  .hero h2 {
    max-width: min(680px, 58vw);
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: clamp(-310px, -33vh, -218px) !important;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: clamp(620px, 88vh, 760px) !important;
    padding: 88px var(--phone-gutter) clamp(190px, 28vh, 260px) !important;
    align-items: end;
    background-position: center top !important;
  }

  .hero::before {
    background:
      radial-gradient(ellipse 120% 92% at 50% 22%, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.2) 48%, rgba(0, 0, 0, 0.74) 100%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.46) 0%, rgba(0, 0, 0, 0.08) 32%, rgba(0, 0, 0, 0.36) 68%, rgba(0, 0, 0, 0.82) 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.16) 64%, rgba(0, 0, 0, 0.08)) !important;
  }

  .hero::after {
    height: min(58vh, 460px) !important;
  }

  .hero-copy {
    width: 100%;
    margin-top: 0;
  }

  .hero-logo,
  .hero h2 {
    max-width: min(92vw, 420px);
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: clamp(-190px, -24vh, -126px) !important;
  }
}

/* Scrolled top-nav: solid blurred backdrop so page content never bleeds through the nav labels. */
.sidebar {
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.sidebar.is-scrolled {
  /* !important needed: the immersive-nav pass above forces a transparent gradient with !important. */
  background: rgba(7, 9, 11, 0.92) !important;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 34px rgba(0, 0, 0, 0.42);
}

/* Live TV player chrome */
.player-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
}

.player-live-indicator .live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.55);
  animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

/* Watchlist grid layout */
.watchlist-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  /* Clear the grid below from the heading/toolbar so cards (and their hover
     lift) never crowd or overlap the list-source text. */
  padding-bottom: clamp(18px, 2.4vh, 30px);
}

.watchlist-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.watchlist-pills {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.watchlist-pill {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.watchlist-pill:hover { color: #fff; }

.watchlist-pill.is-active {
  background: #fff;
  color: #0a0c0e;
}

.watchlist-sort,
.watchlist-source {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 14px;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
}

/* The list-source selector reads as the primary control — slightly emphasized. */
.watchlist-source {
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.2);
}

.watchlist-empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 72px 24px;
  color: rgba(255, 255, 255, 0.82);
}

.watchlist-empty p { font-size: 19px; font-weight: 600; margin: 0; }
.watchlist-empty span { color: rgba(255, 255, 255, 0.55); max-width: 420px; }

/* Live TV sidebar: let long category names wrap to two lines instead of hard-truncating at ~13 chars. */
.live-category-list button {
  min-height: 44px;
  padding-block: 8px;
}

.live-category-list span {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  font-size: 14px;
}

/* Live TV guide empty state (channel search with no hits) */
.live-guide-empty {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 56px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.live-guide-empty p { margin: 0; font-size: 16px; color: rgba(255, 255, 255, 0.78); }

.live-guide-empty button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font: inherit;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}

/* ============================================================
   UI QA polish pass: source picker, mobile rails, safe controls
   ============================================================ */

.brand,
.icon-button,
.pill,
.rail-arrow {
  min-width: 44px;
  min-height: 44px;
}

.settings-panel-card .icon-button {
  min-width: 44px !important;
  min-height: 44px !important;
}

.settings-shell button,
.settings-shell .option-button,
.settings-shell .text-button {
  max-width: 100%;
  white-space: normal;
  line-height: 1.15;
}

.settings-shell .secondary.text-button,
.settings-shell .primary,
.settings-shell .secondary {
  width: auto;
  min-width: 44px;
  padding-inline: 16px;
}

.settings-list-row {
  gap: 12px;
}

.settings-list-row input,
.settings-list-row select {
  min-width: 0;
}

.rail {
  overflow: visible;
}

.rail-scroll-shell {
  overflow: visible;
  isolation: isolate;
}

.rail-strip {
  padding-top: 12px;
  scroll-padding-inline: 3.35vw;
}

.media-card:hover .poster,
.media-card:focus-visible .poster {
  transform: translateY(-2px) scale(1.025);
}

.media-card:hover .poster img,
.media-card:focus-visible .poster img {
  transform: scale(1.04);
}

.media-card strong,
.media-card span,
.card-meta-row {
  min-width: 0;
}

.source-modal {
  overflow: hidden !important;
  padding: clamp(14px, 2vw, 28px) !important;
}

.source-panel {
  width: min(1280px, calc(100vw - 40px)) !important;
  height: min(88dvh, 900px) !important;
  max-height: calc(100dvh - 32px) !important;
  max-width: calc(100vw - 40px) !important;
  box-sizing: border-box;
  gap: clamp(12px, 1.3vw, 18px) !important;
  overflow: hidden !important;
}

.source-panel-head {
  min-width: 0;
}

.source-panel-head > div {
  min-width: 0;
}

.source-panel-head h2 {
  max-width: 100% !important;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.08;
}

.source-panel-head span {
  display: block;
  max-width: min(760px, 100%);
  line-height: 1.35;
}

.source-toolbar {
  min-width: 0;
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) auto !important;
  align-items: center;
  gap: 12px !important;
}

.source-search {
  min-width: 0;
}

.source-search input {
  min-width: 0;
}

.source-filter-group {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.source-filter-group button,
.source-addon-tabs button {
  min-height: 44px !important;
  max-width: min(260px, 62vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-addon-tabs {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.source-picker-list {
  min-width: 0;
  padding: 2px 8px 16px 2px !important;
  gap: 12px !important;
}

.source-picker-row {
  position: relative !important;
  width: 100%;
  min-width: 0;
  min-height: auto !important;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) minmax(282px, auto) !important;
  grid-template-rows: auto !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  overflow: hidden;
}

.source-picker-row *,
.source-main,
.source-side,
.source-row-actions {
  min-width: 0;
}

.source-rank {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 36px;
  height: 36px;
  margin: 0 !important;
}

.source-main {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  overflow: hidden;
}

.source-main strong {
  white-space: normal !important;
  overflow-wrap: anywhere;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical;
  line-height: 1.18 !important;
}

.source-main em {
  white-space: normal !important;
  overflow-wrap: anywhere;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical;
  line-height: 1.28 !important;
}

.source-status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.source-warning {
  display: inline-flex;
  max-width: 100%;
  margin: 0 !important;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.source-playback-status {
  min-height: 28px;
  white-space: nowrap;
}

.source-main .stream-badges {
  max-width: 100% !important;
  overflow: hidden;
}

.stream-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-side {
  position: static !important;
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

.source-picker-row .source-side > b,
.source-picker-row .source-side > small {
  display: none !important;
}

.source-row-actions {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, max-content);
  justify-content: end !important;
  gap: 8px !important;
}

.source-action {
  min-width: 44px !important;
  min-height: 44px !important;
  padding-inline: 12px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.source-action.primary-action {
  min-width: 94px !important;
}

.source-action.icon-only {
  width: 44px !important;
  padding-inline: 0 !important;
}

@media (max-width: 980px) {
  .source-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .source-filter-group {
    justify-content: flex-start;
  }

  .source-picker-row {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    align-items: start !important;
  }

  .source-side {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .source-row-actions {
    justify-content: flex-start !important;
    grid-template-columns: repeat(4, minmax(44px, max-content));
  }
}

@media (max-width: 680px) {
  .brand {
    width: 44px;
    height: 44px;
  }

  .screen {
    padding-bottom: 24px !important;
  }

  .rail {
    padding-left: var(--phone-gutter);
    margin-top: clamp(18px, 3vh, 28px);
  }

  .hero + .rail,
  .hero + .rail-skeleton {
    margin-top: clamp(-176px, -22vh, -118px) !important;
  }

  .rail + .rail,
  .rail + .rail-skeleton,
  .rail-skeleton + .rail {
    margin-top: clamp(22px, 4vh, 36px);
  }

  .rail-head {
    padding-right: var(--phone-gutter);
    margin-bottom: 10px;
  }

  .rail-head h3,
  .section-heading h2,
  .detail-section h3 {
    font-size: clamp(21px, 6vw, 25px);
    line-height: 1.12;
  }

  .rail-strip {
    /* One card fills ~72% of the viewport, the next peeks at the edge. The
       card must fill its own grid track (width:100%) — a competing fixed
       width made cards overflow their track and overlap the neighbour. */
    grid-auto-columns: 72vw !important;
    gap: 12px;
    padding: 10px var(--phone-gutter) 34px 0;
  }

  .rail.is-poster .rail-strip {
    grid-auto-columns: 38vw !important;
  }

  /* Touch scrolls by swipe — the desktop scroll arrows and edge-fade gradients
     just sat on top of the cards (the dark "shadow" over episodes and the
     ◄ ► buttons overlapping them). Hide them on mobile. */
  .rail-arrow {
    display: none !important;
  }

  .rail-scroll-shell::before,
  .rail-scroll-shell::after {
    display: none !important;
  }

  .media-card,
  .media-card.is-poster {
    width: 100% !important;
    max-width: 100% !important;
  }

  .media-card strong {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.18;
  }

  .card-meta-row,
  .media-card span {
    font-size: 12px;
  }

  .rail-arrow {
    width: 44px !important;
    height: 44px !important;
    top: 43%;
  }

  .rail-arrow-left {
    left: -4px;
  }

  .rail-arrow-right,
  .detail-wide .rail-arrow-right,
  .episodes-section .rail-arrow-right,
  .person-content .rail-arrow-right {
    right: 6px;
  }

  .rail-scroll-shell::before,
  .rail-scroll-shell::after {
    bottom: 34px;
    width: 54px;
  }

  .episodes-section.detail-wide .episode-list {
    grid-auto-columns: minmax(246px, 82vw) !important;
    gap: 14px;
    padding: 10px 54px 30px 0;
  }

  .season-tab {
    min-height: 44px !important;
    padding-inline: 16px;
  }

  .source-modal {
    align-items: end !important;
    padding: 0 !important;
  }

  .source-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: min(94dvh, 820px) !important;
    max-height: 94dvh !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom)) !important;
  }

  .source-panel-head {
    gap: 10px !important;
  }

  .source-panel-head h2 {
    max-width: calc(100vw - 76px) !important;
    font-size: clamp(21px, 6vw, 28px) !important;
  }

  .source-panel-head span {
    font-size: 12px;
  }

  .source-search {
    min-height: 46px;
  }

  .source-search input {
    height: 46px;
    font-size: 14px;
  }

  .source-filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .source-filter-group button {
    justify-content: center;
    width: 100%;
    max-width: none;
    padding-inline: 10px;
    font-size: 13px;
  }

  .source-addon-tabs {
    margin-inline: -2px;
    width: calc(100% + 4px);
    padding-bottom: 10px;
  }

  .source-addon-tabs button {
    max-width: min(220px, 72vw);
    min-height: 42px !important;
    font-size: 13px;
  }

  .source-picker-list {
    padding: 2px 2px 22px !important;
    gap: 12px !important;
  }

  .source-picker-row {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .source-rank {
    display: none !important;
  }

  .source-main,
  .source-side {
    grid-column: 1 !important;
  }

  .source-main strong {
    font-size: 16px !important;
    -webkit-line-clamp: 2 !important;
  }

  .source-main em {
    font-size: 13px;
    -webkit-line-clamp: 3 !important;
  }

  .source-playback-status {
    min-height: 26px;
    font-size: 11px;
  }

  .source-warning {
    font-size: 11px;
  }

  .source-side {
    grid-row: auto !important;
    width: 100% !important;
    justify-content: stretch !important;
  }

  .source-row-actions {
    width: 100% !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch !important;
    gap: 8px !important;
  }

  .source-action,
  .source-action.primary-action,
  .source-action.icon-only {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    justify-content: center;
    padding-inline: 10px !important;
    font-size: 13px;
  }

  .settings-list-row.catalog-row,
  .settings-list-row.iptv-row {
    align-items: stretch;
    gap: 10px;
  }
}

/* Debrid transcode playback states */
.source-playback-status.is-transcode {
  border-color: rgba(96, 205, 255, 0.4);
  background: rgba(96, 205, 255, 0.12);
  color: #8fdcff;
}

.player-error-transcode {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(96, 205, 255, 0.45);
  background: rgba(96, 205, 255, 0.14);
  color: #b8e9ff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.player-error-transcode:hover {
  background: rgba(96, 205, 255, 0.24);
}

/* Denser result grids: 4-5 columns at desktop widths instead of 3. */
.grid-results {
  grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr));
}

.screen:has(.search-hero) .grid-results {
  grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr));
}

/* Fallback avatar initial: scale with the tile itself (was a fixed tiny em). */
.avatar-letter {
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-letter span {
  font-size: 52cqmin;
  line-height: 1;
}

/* OLED black app background: no ambient green/blue glow behind rails. */
.app-shell {
  background: #000;
}

/* Source picker: guarantee every row the height its content needs.
   An earlier compact pass let list tracks collapse to ~30px strips. */
.source-picker-list {
  grid-auto-rows: minmax(112px, auto) !important;
  grid-template-rows: none !important;
}

.source-picker-row {
  height: auto !important;
  min-height: 112px !important;
  max-height: none !important;
  overflow: visible !important;
  align-items: center !important;
}

.source-picker-row .source-main {
  overflow: visible !important;
}

/* Let each source row size itself in normal flow — grid track sizing was
   collapsing/clamping rows regardless of their content height. */
.source-picker-list {
  display: block !important;
  margin-top: 40px;
}

.source-picker-row {
  min-height: 0 !important;
  margin-bottom: 12px !important;
  overflow: hidden !important;
}

/* Remux (client-side MKV) playback state + audio track panel */
.player-panel-heading {
  margin: 6px 4px 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.player-panel-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Profile screen: logo lockup + softer avatar tiles + pending-avatar shimmer */
.profile-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-brand-logo {
  width: clamp(44px, 4vw, 60px);
  height: clamp(44px, 4vw, 60px);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(9, 240, 199, 0.18);
}

.profile-wordmark {
  height: clamp(28px, 3.2vw, 42px) !important;
  width: auto !important;
}

.avatar-tile {
  border-radius: 16px;
}

.avatar-pending {
  width: 100%;
  height: 100%;
  animation: avatar-pending-pulse 1.4s ease-in-out infinite;
}

@keyframes avatar-pending-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

.profile-pick:hover .avatar-tile,
.profile-pick:focus-visible .avatar-tile {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.12) inset;
}

/* Fully transparent top nav — only the buttons are visible, no band/gradient,
   in ALL states including scrolled (owner preference: keep it immersive). */
.sidebar,
.sidebar.is-scrolled {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

/* ============ Player controls revamp (Netflix-style) ============ */

/* Full-width scrubber: hairline white, slightly thicker on hover. */
.player-controls .scrubber,
.player-controls .volume-slider {
  min-height: 0 !important;
  padding: 0;
  border: 0;
}

.player-controls .scrubber {
  -webkit-appearance: none;
  appearance: none;
  height: 3px !important;
  border-radius: 999px;
  background: linear-gradient(90deg,
    #fff 0, #fff var(--pct, 0%),
    rgba(255, 255, 255, 0.45) var(--pct, 0%), rgba(255, 255, 255, 0.45) var(--buf, var(--pct, 0%)),
    rgba(255, 255, 255, 0.18) var(--buf, var(--pct, 0%)), rgba(255, 255, 255, 0.18) 100%);
  transition: height 0.12s ease;
  margin-bottom: 4px;
}

.player-controls .scrubber:hover { height: 5px !important; }

/* iOS renders the native track unless it is explicitly zeroed out. */
.player-controls .scrubber::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  background: transparent;
  height: 100%;
  border: 0;
}

.player-controls .scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.player-controls .scrubber:hover::-webkit-slider-thumb,
.player-controls .scrubber:active::-webkit-slider-thumb { opacity: 1; }
.player-controls .scrubber::-moz-range-track { background: transparent; height: 100%; border: 0; }
.player-controls .scrubber::-moz-range-thumb { width: 12px; height: 12px; border: 0; background: #fff; opacity: 0; }
.player-controls .scrubber:hover::-moz-range-thumb,
.player-controls .scrubber:active::-moz-range-thumb { opacity: 1; }

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.player-controls-left,
.player-controls-right {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 12px);
}

.player-play-btn svg { width: 26px; height: 26px; }

/* +30 / -30 seek buttons: rotate icon with the number overlaid. */
.player-seek-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.player-seek-label {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
}

/* Player settings panel: real controls, not read-only text. */
.player-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 2px;
}

.player-setting-toggle,
.player-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.player-setting-toggle:hover,
.player-setting-row:hover { background: rgba(255, 255, 255, 0.05); }

.player-setting-toggle strong,
.player-setting-row strong { display: block; font-size: 15px; font-weight: 600; }
.player-setting-toggle em { display: block; font-size: 13px; color: rgba(255, 255, 255, 0.5); font-style: normal; margin-top: 2px; }

.player-switch {
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  transition: background 0.18s ease;
}

.player-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.player-switch.is-on { background: #e50914; }
.player-switch.is-on::after { transform: translateX(18px); }

.player-setting-stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.player-setting-stepper button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.player-setting-stepper b { min-width: 46px; text-align: center; font-weight: 700; }

.player-setting-choices {
  display: inline-flex;
  gap: 6px;
}

.player-setting-choices button {
  min-width: 44px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.player-setting-choices button.is-active {
  background: #fff;
  color: #0a0a0a;
  border-color: #fff;
}

/* ============ Live TV overhaul ============ */

.livetv-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(84px, 9vh, 104px) clamp(16px, 2.6vw, 40px) 24px;
  min-height: 100vh;
}

.livetv-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.livetv-heading h2 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; }
.livetv-heading span { font-size: 13px; color: rgba(255, 255, 255, 0.55); }

.livetv-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  max-width: 420px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
}

.livetv-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-size: 14px;
}

.livetv-search button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.livetv-topbar-actions { display: flex; gap: 8px; margin-left: auto; }

.livetv-chipbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.livetv-chipbtn:hover { background: rgba(255, 255, 255, 0.1); }

.is-spinning { animation: livetv-spin 1s linear infinite; }
@keyframes livetv-spin { to { transform: rotate(360deg); } }

/* Playlist management */
.livetv-manage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.livetv-manage-row { display: flex; align-items: center; gap: 12px; }

.livetv-switch {
  flex: 0 0 auto;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease;
}

.livetv-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.livetv-switch.is-on { background: var(--accent, #2ec4b6); }
.livetv-switch.is-on::after { transform: translateX(16px); }

.livetv-manage-name { flex: 1; min-width: 0; }
.livetv-manage-name strong { display: block; font-size: 14.5px; }
.livetv-manage-name em { font-size: 12px; color: rgba(255, 255, 255, 0.45); font-style: normal; }

.livetv-manage-remove {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.livetv-manage-remove:hover { background: rgba(229, 9, 20, 0.25); color: #fff; }

.livetv-manage-add {
  display: grid;
  grid-template-columns: minmax(90px, 0.5fr) minmax(200px, 2fr) minmax(120px, 1fr) auto;
  gap: 8px;
  margin-top: 6px;
}

.livetv-manage-add input {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13.5px;
  outline: none;
}

.livetv-manage-add input:focus { border-color: var(--accent, #2ec4b6); }

.livetv-warning {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(229, 9, 20, 0.35);
  background: rgba(229, 9, 20, 0.12);
}

.livetv-warning strong { font-size: 14px; }
.livetv-warning span { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); overflow-wrap: anywhere; }

.livetv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.livetv-empty h3 { color: #fff; font-size: 20px; }
.livetv-empty p { max-width: 420px; font-size: 14px; }

/* 3-column guide layout */
.livetv-columns {
  display: grid;
  grid-template-columns: clamp(200px, 17vw, 250px) minmax(0, 1fr) clamp(250px, 21vw, 320px);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.livetv-cats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  position: sticky;
  top: 96px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.livetv-cats button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.livetv-cats button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.livetv-cats button.is-active { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 700; }

.livetv-cats button span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livetv-cats button em { font-size: 11.5px; font-style: normal; color: rgba(255, 255, 255, 0.4); }
.livetv-cats button svg { flex: 0 0 auto; color: var(--gold, #f5c518); }

.livetv-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.livetv-list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.livetv-list-head h3 { font-size: 17px; font-weight: 700; }
.livetv-list-head > span { font-size: 12.5px; color: rgba(255, 255, 255, 0.45); }

.livetv-group-actions { display: flex; gap: 6px; margin-left: auto; }

.livetv-group-actions button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.livetv-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 16px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.livetv-rows { display: flex; flex-direction: column; gap: 4px; }

.livetv-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-radius: 12px;
  transition: background 0.12s ease;
}

.livetv-row:hover, .livetv-row.is-selected { background: rgba(255, 255, 255, 0.06); }

.livetv-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  min-height: 62px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.livetv-row-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.livetv-row-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }

.livetv-row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.livetv-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.livetv-row-title strong {
  font-size: 14.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livetv-quality {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.livetv-row-now { display: flex; align-items: center; gap: 10px; min-width: 0; }

.livetv-row-now em {
  font-size: 12.5px;
  font-style: normal;
  color: rgba(255, 255, 255, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.livetv-row-now em.is-muted { color: rgba(255, 255, 255, 0.35); }

.livetv-progress {
  flex: 1;
  max-width: 160px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: block;
}

.livetv-progress span { display: block; height: 100%; background: var(--accent, #2ec4b6); border-radius: 999px; }

.livetv-row-copy small {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.38);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livetv-row-play {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.livetv-row:hover .livetv-row-play { opacity: 1; }

.livetv-row-star {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.livetv-row-star:hover { color: #fff; }
.livetv-row-star.is-active { color: var(--gold, #f5c518); }

/* Detail panel */
.livetv-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.livetv-detail-art {
  display: grid;
  place-items: center;
  height: 110px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.livetv-detail-art img { max-width: 70%; max-height: 84%; object-fit: contain; }

.livetv-detail-group { font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); }
.livetv-detail h2 { font-size: 20px; font-weight: 800; line-height: 1.2; }

.livetv-program {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.livetv-program.is-next { background: rgba(255, 255, 255, 0.03); }

.livetv-program-head { display: flex; align-items: center; justify-content: space-between; }
.livetv-program-head span { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; color: var(--accent, #2ec4b6); }
.livetv-program.is-next .livetv-program-head span { color: rgba(255, 255, 255, 0.45); }
.livetv-program-head em { font-size: 12px; font-style: normal; color: rgba(255, 255, 255, 0.5); }
.livetv-program strong { font-size: 15px; line-height: 1.3; }
.livetv-program p { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); line-height: 1.5; max-height: 96px; overflow: hidden; }

.livetv-detail-empty { font-size: 13px; color: rgba(255, 255, 255, 0.4); }

.livetv-detail-actions { display: flex; gap: 8px; margin-top: 4px; }
.livetv-detail-actions .primary,
.livetv-detail-actions .secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.livetv-detail-actions .secondary.is-active { color: var(--gold, #f5c518); }

.livetv-detail-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 12px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

/* Tablet: drop the detail panel */
@media (max-width: 1100px) {
  .livetv-columns { grid-template-columns: clamp(180px, 24vw, 230px) minmax(0, 1fr); }
  .livetv-detail { display: none; }
}

/* Mobile: single column, categories become horizontal chips */
@media (max-width: 760px) {
  .livetv-shell { padding: 76px 12px 90px; gap: 10px; }
  .livetv-columns { display: flex; flex-direction: column; gap: 10px; }
  .livetv-cats {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    position: static;
    padding: 2px 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .livetv-cats::-webkit-scrollbar { display: none; }
  .livetv-cats button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
  }
  .livetv-cats button.is-active { background: #fff; color: #0a0a0a; }
  .livetv-cats button.is-active em { color: rgba(10, 10, 10, 0.55); }
  .livetv-topbar { gap: 10px; }
  .livetv-heading { flex: 1 1 100%; }
  .livetv-search { flex: 1 1 auto; max-width: none; }
  .livetv-topbar-actions { margin-left: 0; }
  .livetv-chipbtn { padding: 0 12px; font-size: 12.5px; }
  .livetv-manage-add { grid-template-columns: 1fr; }
  .livetv-row-main { min-height: 56px; gap: 10px; }
  .livetv-row-logo { width: 46px; height: 36px; }
  .livetv-row-play { display: none; }
  .livetv-progress { max-width: 90px; }
}

/* Symmetry pass: equal side columns so the center nav is truly centered. */
.sidebar {
  grid-template-columns: minmax(150px, 16vw) 1fr minmax(150px, 16vw);
}

/* Symmetry pass: IMDb badge matches the 26px genre pills beside it. */
.imdb-rating {
  min-height: 26px;
  padding: 0 10px !important;
  box-sizing: border-box;
}

/* ============ Live TV: guide grid, catch-up, perf ============ */

/* Native row virtualization: off-screen rows skip layout/paint entirely. */
.livetv-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 66px;
}

.livetv-sentinel { height: 2px; }

/* Stop the layout shifting ~5px when a scrollbar appears. */
html { scrollbar-gutter: stable; }

/* List | Guide toggle */
.livetv-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  margin-left: 6px;
}

.livetv-view-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.livetv-view-toggle button.is-active { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* Guide grid */
.livetv-guide {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.livetv-guide-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.livetv-guide-inner { position: relative; }

.livetv-guide-timebar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(10, 10, 10, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.livetv-guide-corner {
  flex: 0 0 232px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(10, 10, 10, 0.96);
}

.livetv-guide-ticks {
  display: flex;
  position: relative;
  height: 34px;
  align-items: center;
}

.livetv-guide-ticks span {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 8px;
}

.livetv-guide-nowline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e50914;
  z-index: 2;
  pointer-events: none;
}

.livetv-guide-row {
  display: flex;
  align-items: stretch;
  min-height: 52px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  content-visibility: auto;
  contain-intrinsic-size: auto 52px;
}

.livetv-guide-row.is-selected { background: rgba(255, 255, 255, 0.04); }

.livetv-guide-channel {
  flex: 0 0 232px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 0;
  background: rgba(10, 10, 10, 0.92);
  color: #fff;
  text-align: left;
  cursor: pointer;
  position: sticky;
  left: 0;
  z-index: 1;
}

.livetv-guide-channel .livetv-row-logo { width: 42px; height: 32px; }

.livetv-guide-channel strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.livetv-guide-lane {
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
}

.livetv-guide-block {
  position: absolute;
  top: 7px;
  bottom: 7px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.livetv-guide-block.is-live {
  background: rgba(46, 196, 182, 0.16);
  border-color: rgba(46, 196, 182, 0.4);
  color: #fff;
  font-weight: 600;
}

.livetv-guide-empty {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
}

/* Catch-up list in the detail panel */
.livetv-catchup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.livetv-catchup-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.livetv-catchup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.livetv-catchup-row:hover { background: rgba(255, 255, 255, 0.09); }
.livetv-catchup-row > svg:first-child { flex: 0 0 auto; color: rgba(255, 255, 255, 0.45); }
.livetv-catchup-row > svg:last-child { flex: 0 0 auto; opacity: 0.6; }

.livetv-catchup-row span { flex: 1; min-width: 0; }
.livetv-catchup-row strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.livetv-catchup-row em { font-size: 11.5px; font-style: normal; color: rgba(255, 255, 255, 0.45); }

@media (max-width: 760px) {
  .livetv-guide-channel { flex: 0 0 150px; }
  .livetv-guide-corner { flex: 0 0 150px; }
  .livetv-guide-channel strong { font-size: 12px; }
  .livetv-view-toggle button { padding: 0 9px; }
  .livetv-view-toggle button svg { margin: 0; }
}

/* Subtitle color dots in the player settings panel */
.player-subtitle-colors button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
}

.player-subtitle-colors button i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--dot, #fff);
}

.player-subtitle-colors button.is-active {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
}

/* Player: no scrims — title stays readable via text shadow instead. */
.player-top h2, .player-meta { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }

/* iOS: paint the safe-area/status-bar bleed black instead of page content. */
html { background: #000; }

/* Details polish: never overlap the hero actions with the sections below. */
.details-drawer .detail-layout {
  margin-top: clamp(12px, 2vh, 28px) !important;
}

/* IMDb badge exactly like the app: black bold IMDb wordmark + rating on the
   yellow chip, no star. */
.imdb-rating b {
  font-weight: 900;
  font-size: 12.5px;
  letter-spacing: -0.3px;
}

.imdb-rating em {
  font-weight: 800;
  font-size: 12.5px;
}

/* Watched chip in the rating line (replaces the floating dot). */
.detail-watched-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 11px !important;
  border-radius: 6px;
  border: 1px solid rgba(0, 213, 136, 0.5) !important;
  background: rgba(0, 213, 136, 0.14) !important;
  color: #2fe6a7;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Player boot screen — backdrop + pulsing clearlogo, blocks input until the
   first frames are decoded (matches the Android app's loading state). */
.player-boot {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background-color: #000;
  background-size: cover;
  background-position: center;
}

.player-boot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.player-boot-logo {
  position: relative;
  max-width: min(46vw, 420px);
  max-height: 30vh;
  object-fit: contain;
  animation: player-boot-pulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.6));
}

.player-boot-title {
  position: relative;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  text-align: center;
  padding: 0 24px;
  animation: player-boot-pulse 1.6s ease-in-out infinite;
}

@keyframes player-boot-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.985); }
  50% { opacity: 1; transform: scale(1); }
}

/* Details: episodes/sources sit tight under the hero action buttons. */
.details-drawer .detail-hero-content {
  min-height: 0 !important;
}

/* APK parity: bare clearlogos for services (no white tiles), official IMDb
   logo with the rating in plain white text beside it. */
.detail-service-logos span {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.detail-service-logos img {
  height: clamp(18px, 1.6vw, 26px) !important;
  width: auto !important;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

.detail-service-logos { gap: clamp(14px, 1.4vw, 22px) !important; align-items: center; }

.imdb-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  min-height: 26px;
}

.imdb-lockup img { height: 22px; width: auto; border-radius: 4px; }
.imdb-lockup b { font-size: 14.5px; font-weight: 800; color: #fff; }

/* Episodes/sources sit immediately under the action buttons. */
.details-drawer .detail-layout {
  margin-top: clamp(6px, 1vh, 12px) !important;
}

/* IMDb + service clearlogo badges on cards and episode rows. */
.card-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.card-badges { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.card-service-logo {
  height: 11px;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
}

.card-imdb { display: inline-flex; align-items: center; gap: 4px; }
.card-imdb img { height: 13px; width: auto; border-radius: 2.5px; }
.card-imdb b { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.85); }

.episode-imdb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-style: normal;
}

.episode-imdb img { height: 13px; width: auto; border-radius: 2.5px; }

/* IMDb badge lives inside the artwork, bottom-right (like the app). */
.poster .card-imdb {
  position: absolute;
  right: 7px;
  bottom: 9px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.poster .card-imdb img { height: 12px; width: auto; border-radius: 2px; }
.poster .card-imdb b { font-size: 11.5px; font-weight: 700; color: #fff; }

/* Meta row keeps only the year + service logos now. */
.card-meta-row .card-badges:empty { display: none; }

/* Home hero IMDb badge — official logo + rating, matching the details page. */
.hero-imdb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-imdb img { height: 20px; width: auto; border-radius: 4px; }
.hero-imdb b { font-size: 15px; font-weight: 800; color: #fff; }

/* Player error: external-player escape hatch buttons. */
.player-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.player-error-external {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}

.player-error-external:hover { background: rgba(255, 255, 255, 0.16); }

/* Yellow hint on sources that play best in an external player. */
.source-external-hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #f5c518;
}

/* Source row: yellow "external player recommended" status. */
.source-playback-status.recommend-external {
  color: #f5c518;
  font-weight: 600;
}

/* Service clearlogos top-left inside card artwork. */
.card-services.top-left {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-services.top-left img {
  height: 13px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

/* Card meta line: full release date + runtime. */
.card-meta-row .card-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta-row .card-runtime {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.55);
}

.card-meta-row .card-runtime::before {
  content: "·";
  margin: 0 6px;
  color: rgba(255, 255, 255, 0.35);
}

/* Watchlist grid: comfortable, even spacing (rows were too tight because a
   later single-value gap collapsed the larger row gap). */
/* All result grids (search + watchlist): comfortable, even spacing. A later
   single-value gap had collapsed the larger row gap, squashing the rows. */
.grid-results {
  gap: clamp(30px, 2.6vw, 44px) clamp(20px, 1.6vw, 28px) !important;
  align-content: start;
}

/* Details action buttons: clear keyboard/remote focus ring. */
.detail-actions .primary,
.detail-actions .secondary,
.detail-actions .text-button,
.hero-actions .primary,
.hero-actions .secondary,
.trailer-link {
  transition: box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

/* Mouse hover — visible ring + lift so the pointer target is obvious. */
.detail-actions .primary:hover,
.detail-actions .secondary:hover,
.detail-actions .text-button:hover,
.hero-actions .primary:hover,
.hero-actions .secondary:hover,
.trailer-link:hover {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.detail-actions .primary:hover,
.hero-actions .primary:hover,
.trailer-link:hover {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 0 4px var(--accent, #fff);
}

.detail-actions .secondary:hover,
.hero-actions .secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Keyboard / remote focus — stronger ring. */
.detail-actions .primary:focus-visible,
.detail-actions .secondary:focus-visible,
.detail-actions .text-button:focus-visible,
.hero-actions .primary:focus-visible,
.hero-actions .secondary:focus-visible,
.trailer-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.6), 0 0 0 5px #fff;
  transform: translateY(-1px);
}

.detail-actions .primary:focus-visible,
.hero-actions .primary:focus-visible,
.trailer-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.6), 0 0 0 5px var(--accent, #fff);
}

/* ============================================================
   Result grids: FIXED column counts per breakpoint.
   auto-fill produced width-dependent layouts that could look cramped on
   specific devices — deterministic counts fit perfectly everywhere.
   ============================================================ */
.grid-results {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.grid-results .media-card {
  width: 100% !important;
}

.poster-results .grid-results {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

@media (min-width: 1280px) {
  .grid-results { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .poster-results .grid-results { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
}

@media (min-width: 1700px) {
  .grid-results { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .poster-results .grid-results { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
}

@media (max-width: 999px) {
  .grid-results { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .poster-results .grid-results { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (max-width: 759px) {
  .grid-results { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .poster-results .grid-results { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 519px) {
  .grid-results { grid-template-columns: 1fr !important; }
  .poster-results .grid-results { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* --- TV / keyboard navigation ------------------------------------------- */
/* Universal fallback focus ring for D-pad (Tizen/webOS) and keyboard users.
   :where() keeps specificity at zero so every bespoke :focus-visible rule
   above still wins; this only catches interactive elements without one. */
:where(button, a[href], [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--accent, #fff);
  outline-offset: 2px;
}

/* ---- Login usuario+contraseña ---- */
.login-form { display: grid; gap: 10px; margin-top: 16px; }
.login-form .login-label { font-size: 12px; color: var(--muted, #8b96a5); margin: 6px 0 -2px; }
.login-form .login-input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12); color: inherit; font-size: 15px; background: rgba(255,255,255,0.06); }
.login-form .login-submit { margin-top: 14px; }
/* ---- Touch: tap al primer toque ---- */
button, a, [role="button"], .media-card, .nav-item, .episode-row, .channel-row, .season-tab {
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
/* ---- Live TV: no montar el menú con la barra ---- */
.screen.livetv-shell { padding-top: clamp(90px, 9vh, 110px); }
