:root {
  --bg: #121212;
  --bg-dim: #0a0a0a;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e6e1e5;
  --text-2: #cac4d0;
  --text-3: #938f99;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.18);
  --gold: #ffd54f;
  --danger: #ba1a1a;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --nav-h: 68px;
  --bottom-h: 64px;
  --font: "Manrope", sans-serif;
  --display: "Outfit", sans-serif;

  /* Layout scale — use these everywhere */
  --page-gutter: 16px;
  --m-pad: var(--page-gutter);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --section-y: var(--space-7);
  --page-head-y: var(--space-4);
  --card-gap: var(--space-3);
  --grid-gap-y: var(--space-4);
  --grid-gap-x: var(--space-3);
  --control-h: 42px;
  --control-h-sm: 36px;
  --control-h-lg: 48px;
  --title-page: clamp(1.8rem, 4vw, 2.4rem);
  --title-section: 1.25rem;
  --radius-sm: 12px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  /* Prevent default white flash / overscroll gaps under dark UI */
  background: #121212;
  color-scheme: dark;
  /* App-like: block double-tap / pinch zoom */
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  /* Solid + light gradient (no background-attachment:fixed — that tanks scroll) */
  background-color: #121212;
  background-image: linear-gradient(180deg, #16161a 0%, #121212 42%, #0e0e10 100%);
  background-repeat: no-repeat;
  background-attachment: scroll;
  padding-bottom: calc(var(--bottom-h) + 16px);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

input, textarea, [contenteditable="true"], .allow-select {
  -webkit-user-select: text;
  user-select: text;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }

.app-main {
  width: min(1280px, calc(100% - (var(--page-gutter) * 2)));
  margin: 0 auto;
  padding: var(--space-3) 0 var(--space-8);
  background: transparent;
  min-height: 50vh;
}
#homeApp,
.client-app {
  background: transparent;
  min-height: 40vh;
}
.app-main--flush {
  width: 100%;
  margin: 0;
  padding: 0;
}
.page-player { padding-bottom: 0; }
.page-player .topbar { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--nav-h);
  padding: 10px var(--page-gutter);
  /* Solid sticky bar — blur on scroll is a major jank source */
  background: #141416;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  background: linear-gradient(145deg, var(--accent), #60a5fa);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.brand-mark svg {
  display: block;
  margin-left: 2px;
}
.brand-name {
  font-family: var(--display);
  font-weight: 750;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.topbar-actions {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.topbar-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #e5e7eb;
  text-decoration: none;
}
.topbar-icon:hover,
.topbar-icon.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.search-form {
  position: relative;
  flex: 1 1 auto;
  max-width: 460px;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 6px 0 16px;
}
.search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 11px 0;
  font-size: 16px; /* prevent iOS focus zoom */
  -webkit-text-size-adjust: 100%;
}
.search-btn {
  border: 0;
  background: transparent;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-2);
  cursor: pointer;
}
.suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.suggest-box a {
  display: block;
  padding: 12px 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.suggest-box a:hover { background: var(--accent-soft); color: var(--text); }
.topnav {
  display: none;
  gap: 6px;
  margin-left: auto;
}
.topnav-link {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
}
.topnav-link.is-active,
.topnav-link:hover {
  background: var(--accent-soft);
  color: #fff;
}

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--bottom-h);
  background: #141416;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}
.bottomnav-item.is-active { color: #93c5fd; }

.banner-error {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(186, 26, 26, 0.16);
  border: 1px solid rgba(186, 26, 26, 0.35);
  color: #ffb4ab;
}

.hero {
  --hero-h: clamp(340px, 42vw, 520px);
  position: relative;
  margin: var(--space-2) 0 var(--space-8);
  border-radius: 28px;
  overflow: hidden;
  min-height: var(--hero-h);
  isolation: isolate;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  contain: layout paint;
}
.hero-track {
  position: relative;
  min-height: var(--hero-h);
  height: var(--hero-h);
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background-color: #101014;
  transition: opacity 0.85s ease, visibility 0.85s ease;
  z-index: 0;
  cursor: pointer;
}
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Bias faces/right; hide baked-in title art on the left under the scrim */
  object-position: 72% center;
  z-index: 0;
  transform: scale(1.04);
  transform-origin: 70% center;
  pointer-events: none;
  user-select: none;
  background: #141418;
}
.hero-media-empty {
  background:
    radial-gradient(circle at 30% 30%, #1e293b, transparent 55%),
    #101014;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}
.hero-slide.is-active .hero-media {
  transform: scale(1.03);
}
.hero-glow {
  position: absolute;
  left: -10%;
  bottom: -20%;
  width: 55%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.22), transparent 68%);
  pointer-events: none;
  z-index: 1;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 4, 8, 0.25) 0%, transparent 32%, rgba(4, 4, 8, 0.55) 70%, rgba(4, 4, 8, 0.94) 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-scrim-side {
  position: absolute;
  inset: 0;
  /* Heavy left wash so poster title text in the still doesn't clash with H1 */
  background:
    linear-gradient(90deg,
      rgba(4, 4, 8, 0.97) 0%,
      rgba(4, 4, 8, 0.88) 22%,
      rgba(4, 4, 8, 0.55) 42%,
      rgba(4, 4, 8, 0.18) 58%,
      transparent 72%);
  z-index: 1;
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 540px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 52px);
  padding-bottom: clamp(56px, 7vw, 72px);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.7s ease;
  isolation: isolate;
}
.hero-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -8%;
  right: -12%;
  bottom: 4%;
  top: 28%;
  background:
    radial-gradient(ellipse at 25% 75%, rgba(0, 0, 0, 0.55), transparent 72%);
  pointer-events: none;
}
.hero-slide.is-active .hero-copy {
  transform: none;
  opacity: 1;
  transition-delay: 0.12s;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.hero-kicker,
.hero-meta-dot {
  color: #c7c7d1;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-meta-dot::before {
  content: "·";
  margin-right: 8px;
  color: #71717a;
}
.hero-rating {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 213, 79, 0.14);
  border: 1px solid rgba(255, 213, 79, 0.28);
  color: #ffe082;
  font-size: 0.75rem;
  font-weight: 800;
}
.hero-title,
.detail-title,
.page-title,
.player-title {
  font-family: var(--display);
  letter-spacing: -0.03em;
  margin: 0;
}
.hero-title {
  position: relative;
  font-size: clamp(2.05rem, 4.8vw, 3.35rem);
  line-height: 1.08;
  max-width: 16ch;
  font-weight: 750;
  color: #fff;
  /* Tight readable shadow — avoid huge blur that looks like a ghost title */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 6px 20px rgba(0, 0, 0, 0.65);
}
.hero-desc {
  margin: 12px 0 20px;
  color: #d6d6de;
  line-height: 1.55;
  max-width: 42ch;
  font-size: 1rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.hero-btn-play {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.42);
}
.hero-btn-more {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}
.hero-navs {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-nav {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 16, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.hero-nav:hover {
  background: rgba(37, 99, 235, 0.55);
  border-color: rgba(147, 197, 253, 0.45);
  transform: scale(1.04);
}
.hero-progress,
.hero-dots {
  position: absolute;
  left: clamp(28px, 5vw, 52px);
  right: clamp(28px, 5vw, 52px);
  bottom: 18px;
  z-index: 4;
  display: flex;
  gap: 8px;
  align-items: center;
}
.hero-prog {
  flex: 1;
  max-width: 72px;
  height: 3px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.hero-prog-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #fff);
  border-radius: inherit;
}
.hero.is-autoplaying .hero-prog.is-active .hero-prog-fill {
  animation: heroProg 6.5s linear forwards;
}
@keyframes heroProg {
  from { width: 0; }
  to { width: 100%; }
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  padding: 0;
}
.hero-dot.is-active { background: #fff; width: 22px; border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-copy,
  .hero-prog-fill,
  .hero-media { transition: none !important; animation: none !important; }
  .hero-slide.is-active.is-anim .hero-media { animation: none !important; transform: scale(1.02); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.rail {
  margin: var(--section-y) 0;
  /* Skip paint for off-screen rails; size reserved so no white gaps */
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}
.rail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.rail-title {
  margin: 0;
  font-family: var(--display);
  font-size: var(--title-section);
  letter-spacing: -0.02em;
}
.rail-slide {
  position: relative;
  --rail-arrow-space: 48px;
}
.rail-slide.has-overflow {
  padding-left: var(--rail-arrow-space);
  padding-right: var(--rail-arrow-space);
  margin-left: calc(var(--rail-arrow-space) * -1);
  margin-right: calc(var(--rail-arrow-space) * -1);
}
/* no scroll-behavior:smooth here — fights touch scrolling / causes jank */
.rail-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: #1c1c22;
  color: #f4f4f5;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, transform 0.15s ease;
}
.rail-arrow:hover {
  background: #2563eb;
  color: #fff;
}
.rail-arrow:active { transform: translateY(-50%) scale(0.96); }
.rail-arrow[hidden] { display: none !important; }
.rail-arrow-prev { left: 2px; }
.rail-arrow-next { right: 2px; }
/* Class set by JS — avoid expensive :has() on scroll */
.rail-slide.is-poster-rail .rail-arrow { top: 106px; }
.rail-slide.is-cast-rail .rail-arrow { top: 36px; }
/* Soft edge fade when that side can scroll */
.rail-slide.can-prev::before,
.rail-slide.can-next::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 8px;
  width: var(--rail-arrow-space);
  z-index: 3;
  pointer-events: none;
}
.rail-slide.can-prev::before {
  left: 0;
  background: linear-gradient(90deg, rgba(18, 18, 22, 0.92), transparent);
}
.rail-slide.can-next::after {
  right: 0;
  background: linear-gradient(270deg, rgba(18, 18, 22, 0.92), transparent);
}
.rail-slide.is-poster-rail.can-prev::before,
.rail-slide.is-poster-rail.can-next::after {
  bottom: auto;
  height: 213px;
}
.poster-row,
.cast-row,
.chip-row,
.continue-row {
  display: flex;
  gap: var(--card-gap);
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.poster-row::-webkit-scrollbar,
.chip-row::-webkit-scrollbar,
.cast-row::-webkit-scrollbar,
.continue-row::-webkit-scrollbar { height: 0; }


.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--grid-gap-y) var(--grid-gap-x);
}
.poster-card {
  flex: 0 0 142px;
  scroll-snap-align: start;
}
@media (hover: hover) and (pointer: fine) {
  .poster-card { transition: transform 0.2s ease; }
  .poster-card:hover { transform: translateY(-4px); }
}
.poster-media {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.poster-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lazy-img {
  opacity: 0.4;
  transition: opacity 0.25s ease;
  background: #2c2c2e;
}
.lazy-img.is-loaded,
.lazy-img.is-eager {
  opacity: 1;
  background: none;
}
.poster-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 2rem;
  color: var(--text-3);
}
.poster-rating {
  position: absolute;
  top: 8px;
  left: 8px;
  right: auto;
  width: auto;
  max-width: calc(100% - 16px);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.72);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
}
.hero-subline {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 650;
}
.hero-sub-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.hero-year { color: rgba(255, 255, 255, 0.72); }
.poster-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 8px;
}
.poster-meta { padding: 10px 2px 0; }
.poster-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-sub {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 0.78rem;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h-sm);
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.chip:hover,
.chip.is-active {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.45);
  color: #fff;
}
.chip-static { cursor: default; }

.page-head { margin: var(--space-2) 0 var(--page-head-y); }
.page-head-split {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-3);
}
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.page-title,
.lib-title {
  margin: 0;
  font-family: var(--display);
  font-size: var(--title-page);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.page-sub,
.lib-sub {
  margin: var(--space-2) 0 0;
  color: var(--text-3);
  font-size: 0.95rem;
  line-height: 1.4;
}
.btn-sm {
  min-height: var(--control-h-sm);
  padding: 0 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}
.rail-link {
  color: #93c5fd;
  font-weight: 700;
  font-size: 0.88rem;
}
.rail-link:hover { color: #fff; }

/* Continue watching */
.continue-row::-webkit-scrollbar { height: 0; }
.continue-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  color: inherit;
}
.continue-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #1c1c1e;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.continue-media img,
.continue-media .poster-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.continue-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.continue-card:hover .continue-play { opacity: 1; }
.continue-play svg {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.continue-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
}
.continue-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.continue-meta { padding: 10px 2px 0; }
.continue-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-sub {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 650;
}

.detail-resume-hint {
  margin: 6px 0 0;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 650;
}

/* —— Library: History / Watchlist —— */
.lib-shell {
  margin: var(--space-2) 0 var(--section-y);
}
.lib-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--page-head-y);
}
.lib-kicker {
  margin: 0 0 var(--space-2);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lib-sub { max-width: 36ch; }
.lib-clear {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  min-height: var(--control-h-sm);
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  flex: 0 0 auto;
  margin-top: var(--space-1);
}
.lib-clear:hover {
  background: rgba(186, 26, 26, 0.18);
  border-color: rgba(186, 26, 26, 0.4);
  color: #ffb4ab;
}
.lib-shell--bookmarks .lib-kicker { color: #fbbf24; }
.lib-shell--bookmarks .lib-empty-icon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.28);
}
.lib-empty {
  text-align: center;
  padding: 56px 22px;
  color: var(--text-2);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.16), transparent 55%),
    rgba(20, 20, 24, 0.7);
}
.lib-empty-soft {
  padding: 28px 18px;
  min-height: 120px;
}
.lib-empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.25);
}
.lib-empty h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--display);
  color: var(--text);
  font-size: var(--title-section);
}
.lib-empty p {
  margin: 0 auto 18px;
  max-width: 34ch;
  line-height: 1.45;
}

/* History cards */
.hist-list {
  display: grid;
  gap: var(--card-gap);
}
.hist-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(28, 28, 34, 0.95), rgba(16, 16, 20, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}
.hist-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: #121216;
}
.hist-thumb img,
.hist-thumb .poster-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hist-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.hist-play svg {
  width: 36px;
  height: 36px;
  padding: 9px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.95);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}
.hist-card:hover .hist-play { opacity: 1; }
.hist-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}
.hist-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.hist-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.hist-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.hist-copy { min-width: 0; flex: 1; }
.hist-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hist-title a:hover { color: #93c5fd; }
.hist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 7px 0 0;
  color: #8b8b96;
  font-size: 0.78rem;
  font-weight: 700;
}
.hist-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: #52525b;
}
.hist-remove {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #71717a;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.hist-remove:hover {
  background: rgba(186, 26, 26, 0.18);
  color: #ffb4ab;
}
.hist-actions {
  display: flex;
  gap: 8px;
}
.hist-resume,
.hist-details {
  min-height: var(--control-h-sm);
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 750;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hist-resume {
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}
.hist-details {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
}
.hist-details:hover { background: rgba(255, 255, 255, 0.1); }

/* Watchlist grid */
.wl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--grid-gap-y) var(--grid-gap-x);
}
.wl-card {
  position: relative;
}
.wl-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #16161a;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}
.wl-poster img,
.wl-poster .poster-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wl-type {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  color: #e4e4e7;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wl-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.wl-remove:hover {
  background: rgba(186, 26, 26, 0.85);
}
.wl-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.wl-title {
  margin: 0;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-title a:hover { color: #93c5fd; }
.wl-play {
  flex: 0 0 auto;
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 800;
}
.wl-play:hover { color: #fff; }

@media (max-width: 720px) {
  .continue-card { flex: 0 0 188px; }
  .page-head-split { align-items: stretch; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .lib-shell { margin: var(--space-3) 0 var(--space-6); }
  .lib-hero { gap: var(--space-3); }
  .lib-sub { font-size: 0.88rem; }
  .hist-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: 16px;
  }
  .hist-title { font-size: 0.95rem; }
  .hist-body { gap: var(--space-3); }
  .hist-resume,
  .hist-details {
    flex: 1;
    min-height: var(--control-h-sm);
  }
  .hist-card:hover .hist-play { opacity: 1; }
  .wl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--grid-gap-y) 10px;
  }
  .wl-poster { border-radius: var(--radius-sm); }
  .wl-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 10px;
  }
}

/* Browse — app-style toolbar + filter sheet */
.browse-shell { margin: var(--space-2) 0 var(--section-y); }
.browse-hero { margin-bottom: var(--page-head-y); }
.browse-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-4);
}
.browse-sort-row {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.browse-sort-row::-webkit-scrollbar { display: none; }
.browse-sort-row .chip { flex: 0 0 auto; }
.browse-filter-btn {
  appearance: none;
  flex: 0 0 auto;
  min-height: var(--control-h-sm);
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.browse-filter-btn:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.4);
}
.browse-filter-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
.browse-active {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: -4px 0 var(--space-4);
}
.browse-active-chip {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #dbeafe;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
.browse-active-clear {
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 750;
}

.browse-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}
.browse-sheet.is-open,
.browse-sheet:not([hidden]) {
  display: block;
}
.browse-sheet[hidden] { display: none !important; }
.browse-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.browse-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(82vh, 720px);
  overflow: auto;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #1a1a22, #101014 40%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.45);
  animation: browseSheetIn 0.22s ease;
}
@keyframes browseSheetIn {
  from { transform: translateY(24px); opacity: 0.7; }
  to { transform: none; opacity: 1; }
}
.browse-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.browse-sheet-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.browse-sheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.browse-field {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}
.browse-field legend {
  margin: 0 0 10px;
  color: #8b8b96;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.browse-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.browse-opt {
  cursor: pointer;
}
.browse-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.browse-opt span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font-size: 0.82rem;
  font-weight: 700;
}
.browse-opt input:checked + span {
  background: rgba(37, 99, 235, 0.35);
  border-color: rgba(96, 165, 250, 0.55);
  color: #fff;
}
.browse-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, transparent, #101014 30%);
}
.browse-sheet-actions .btn { width: 100%; border-radius: 14px; }
body.browse-sheet-open { overflow: hidden; }

@media (min-width: 721px) {
  .browse-sheet-panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 48px));
    max-height: min(80vh, 680px);
    border-radius: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    animation: none;
  }
}

/* Topbar: mobile opens dedicated search page; desktop keeps inline form */
.search-form-launch { display: none; }
.search-launch-ico {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #8b8b96;
}
.search-input-fake {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 11px 0;
  color: #7a7a85;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* App-style search screen */
.page-search {
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(37, 99, 235, 0.2), transparent 55%),
    #0b0b0e;
}
.page-search .app-main--flush {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 721px) {
  .search-app-bar,
  .search-type-row,
  .search-app-body {
    width: min(760px, 100%);
    margin-inline: auto;
  }
  .search-app-bar {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }
}
.search-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.search-app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--page-gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11, 11, 14, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.search-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.search-back:hover { background: rgba(255, 255, 255, 0.12); }
.search-app-form {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  background: #17171d;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.search-app-icon { color: #8b8b96; flex: 0 0 auto; }
.search-app-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  /* 16px minimum — iOS zooms inputs under 16px on focus */
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  padding: 10px 0;
  -webkit-text-size-adjust: 100%;
}
.search-app-input::placeholder { color: #71717a; font-weight: 500; }
.search-app-input::-webkit-search-cancel-button { display: none; }
.search-app-clear {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.search-app-clear:hover { background: rgba(255, 255, 255, 0.18); }
.search-app-clear[hidden] { display: none !important; }

.search-type-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 12px var(--page-gutter) 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.search-type-row::-webkit-scrollbar { display: none; }
.search-type-row .chip { flex: 0 0 auto; }

.search-app-body {
  flex: 1;
  padding: 12px var(--page-gutter) 28px;
}
.search-block { margin: 8px 0 22px; }
.search-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.search-block-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.search-block-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: #93c5fd;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  padding: 4px 0;
}
.search-suggest-list {
  display: grid;
  gap: 2px;
}
.search-suggest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #e4e4e7;
}
.search-suggest-row:hover,
.search-suggest-row:active {
  background: rgba(255, 255, 255, 0.06);
}
.search-suggest-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: #93c5fd;
  flex: 0 0 auto;
}
.search-suggest-text {
  min-width: 0;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-suggest-ico-trend { color: #fbbf24; }
.search-empty-hint {
  margin: 18px 0;
  color: var(--text-3);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}
.search-idle-skel .chip-row {
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--section-y) 0 var(--space-2);
}
.pager-label { color: var(--text-3); font-weight: 600; }
.results-label {
  margin: 0 0 var(--space-3);
  color: var(--text-3);
  font-size: 0.85rem;
  font-weight: 700;
}

/* —— Detail page (MovieBox app layout) —— */
.detail-app {
  max-width: 720px;
  margin: 0 auto;
}
.detail-banner {
  --banner-h: clamp(220px, 42vw, 360px);
  position: relative;
  height: var(--banner-h);
  min-height: 220px;
  overflow: hidden;
  background: #0a0a0c;
}
.detail-banner-media {
  position: absolute;
  inset: 0;
  background-color: #141418;
  background-size: cover;
  background-position: center 20%;
}
.detail-banner.is-bg-loaded .detail-banner-media {
  background-image: var(--hero-image);
}
.detail-banner-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 28%, rgba(0, 0, 0, 0.55) 70%, #000 100%);
}
.detail-back {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.detail-back:hover { background: rgba(0, 0, 0, 0.55); }
.detail-hero-play {
  appearance: none;
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.detail-hero-play svg { margin-left: 3px; }
.detail-hero-play:hover {
  background: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.04);
}
.detail-hero-play:active {
  transform: translate(-50%, -50%) scale(0.97);
}
.detail-hero-play.is-loading {
  opacity: 0.65;
  pointer-events: none;
}
.detail-hero-play[hidden] { display: none !important; }
.detail-trailer-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.detail-banner.is-trailer-playing .detail-trailer-video {
  opacity: 1;
  pointer-events: auto;
  z-index: 4;
}
.detail-banner.is-trailer-playing .detail-banner-media,
.detail-banner.is-trailer-playing .detail-banner-fade {
  opacity: 0;
}
.detail-banner.is-trailer-playing .detail-back {
  z-index: 6;
}
/* Trailer fullscreen uses banner container (no native video download UI) */
.detail-banner:fullscreen,
.detail-banner:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-height: none;
  background: #000;
}
.detail-banner:fullscreen .detail-trailer-video,
.detail-banner:-webkit-full-screen .detail-trailer-video {
  object-fit: contain;
}
.detail-banner:fullscreen .detail-trailer-bar,
.detail-banner:-webkit-full-screen .detail-trailer-bar {
  bottom: max(18px, env(safe-area-inset-bottom));
  right: max(14px, env(safe-area-inset-right));
}
.detail-trailer-video::-webkit-media-controls-enclosure {
  display: none !important;
}
.detail-trailer-bar {
  position: absolute;
  right: 10px;
  bottom: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.detail-trailer-bar[hidden] { display: none !important; }
.detail-trailer-btn {
  appearance: none;
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.detail-trailer-btn:hover { background: rgba(0, 0, 0, 0.72); }
.detail-trailer-btn svg {
  display: none;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
/* Default: playing + audible; always-on icons for fs/close */
.detail-trailer-btn .ico-pause,
.detail-trailer-btn .ico-vol,
.detail-trailer-btn .ico-fs,
.detail-trailer-btn .ico-close { display: block; }
.detail-trailer-btn.is-paused .ico-pause { display: none; }
.detail-trailer-btn.is-paused .ico-play { display: block; }
.detail-trailer-btn.is-muted .ico-vol { display: none; }
.detail-trailer-btn.is-muted .ico-mute { display: block; }
.detail-banner-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 2px;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}
.detail-banner-progress i {
  display: block;
  height: 100%;
  background: #2563eb;
  border-radius: 0;
}
.detail-banner-progress.is-resume {
  height: 3px;
  background: rgba(37, 99, 235, 0.25);
}
.detail-banner-progress.is-resume i {
  border-radius: 0 2px 2px 0;
}
.detail-banner-progress:not(.is-resume) i {
  width: 100% !important;
}

.detail-body {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 10px 16px 28px;
  background: #000;
}
.detail-head { margin-bottom: 16px; }
.detail-title {
  margin: 0;
  padding: 0;
  font-family: var(--display);
  font-size: clamp(1.28rem, 5.2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  border: 0;
  box-shadow: none;
  /* kill any accidental underline from global link/title styles */
  background-image: none;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0;
  margin: 8px 0 0;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}
.detail-meta > span { white-space: nowrap; }
.detail-meta-sep {
  margin: 0 7px;
  color: rgba(156, 163, 175, 0.55);
  font-weight: 500;
}
.detail-meta-rating {
  color: #9ca3af;
  font-weight: 650;
}
.detail-meta-rating [aria-hidden="true"],
.detail-meta-rating > span:first-child {
  color: #fbbf24;
}
.detail-list-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #252525;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.detail-list-btn:hover { background: #303030; }
.detail-list-btn.is-on {
  background: rgba(37, 99, 235, 0.28);
  color: #93c5fd;
}
.detail-list-btn.is-on svg {
  fill: currentColor;
  stroke: currentColor;
}

.detail-section {
  margin: 22px 0 0;
}
.detail-section-title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.detail-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.detail-select {
  position: relative;
  display: block;
  min-width: 0;
}
.detail-select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 42px;
  padding: 0 36px 0 12px;
  border-radius: 10px;
  border: 1px solid #2a2a2e;
  background: #1a1a1e;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.detail-select select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
}
.detail-select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  display: grid;
}
.detail-selects .detail-select:only-child,
.detail-selects .detail-select-wide,
.detail-selects .detail-dd:only-child,
.detail-selects .detail-dd.detail-select-wide {
  grid-column: 1 / -1;
}
.detail-dd {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #2a2a2e;
  background: #1a1a1e;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.detail-dd:hover {
  background: #222228;
  border-color: #3a3a42;
}
.detail-dd span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-dd svg {
  flex: 0 0 auto;
  color: #9ca3af;
}

.ep-season-pane[hidden] { display: none !important; }
.ep-rail-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ep-rail-wrap .ep-rail {
  flex: 1;
  min-width: 0;
}
.ep-all-btn {
  appearance: none;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #252525;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.ep-all-btn:hover { background: #303036; }
.ep-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.ep-rail::-webkit-scrollbar { height: 0; }
.ep-chip {
  appearance: none;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 0;
  background: #252525;
  color: #d1d5db;
  font: inherit;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.ep-chip:hover {
  background: #303036;
  color: #fff;
}
.ep-chip.is-active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}
.ep-chip-num {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Detail bottom sheets (language / season / episodes) */
body.detail-sheet-open {
  overflow: hidden;
}
.detail-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.detail-sheet-backdrop.is-open {
  opacity: 1;
}
.detail-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 81;
  width: 100%;
  max-width: 100%;
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 0 0;
  background: #121214;
  color: #fff;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(105%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
}
.detail-sheet.is-open {
  transform: translateY(0);
}
.detail-sheet[hidden] { display: none !important; }
.detail-sheet-backdrop[hidden] { display: none !important; }
.detail-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.detail-sheet-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.detail-sheet-close {
  appearance: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.detail-sheet-close:hover { background: rgba(255, 255, 255, 0.08); }
.detail-sheet-body {
  overflow-y: auto;
  padding: 12px 16px 16px;
  -webkit-overflow-scrolling: touch;
}
.detail-sheet-option {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin: 0 0 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #2c2c2e;
  color: #e5e7eb;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.detail-sheet-option:last-child { margin-bottom: 0; }
.detail-sheet-option:hover { background: #36363a; color: #fff; }
.detail-sheet-option.is-active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.detail-ep-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.detail-ep-cell {
  appearance: none;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #2c2c2e;
  color: #9ca3af;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.detail-ep-cell:hover {
  background: #36363a;
  color: #fff;
}
.detail-ep-cell.is-active {
  background: #2563eb;
  color: #fff;
}
.detail-ep-cell .ep-chip-num {
  font-size: 0.9rem;
}
.detail-sheet-eps {
  max-height: min(78vh, 720px);
}
.detail-sheet-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #121214;
}
.detail-sheet-foot .detail-play-cta {
  margin-top: 0;
}

/* Desktop / big screen: centered sheet card, not full-bleed */
@media (min-width: 768px) {
  .detail-sheet {
    left: 50%;
    right: auto;
    bottom: 28px;
    width: min(440px, calc(100vw - 64px));
    max-width: min(440px, calc(100vw - 64px));
    max-height: min(70vh, 580px);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    transform: translate(-50%, calc(100% + 40px));
  }
  .detail-sheet.is-open {
    transform: translate(-50%, 0);
  }
  .detail-sheet-eps {
    width: min(520px, calc(100vw - 64px));
    max-width: min(520px, calc(100vw - 64px));
  }
  .detail-sheet-head {
    padding: 18px 20px 14px;
  }
  .detail-sheet-body {
    padding: 14px 20px 20px;
  }
  .detail-sheet-foot {
    padding: 12px 20px 18px;
  }
  .detail-sheet-option {
    min-height: 48px;
  }
}

.detail-foryou-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.detail-foryou-grid .poster-card {
  flex: none;
  width: 100%;
  min-width: 0;
}
.detail-foryou-grid .poster-media {
  border-radius: 10px;
}
.detail-foryou-grid .poster-card:hover {
  transform: none;
}
.detail-play-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 18px;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
  transition: background 0.15s ease, transform 0.12s ease;
}
.detail-play-cta:hover {
  background: #1d4ed8;
  color: #fff;
}
.detail-play-cta:active { transform: scale(0.985); }
.detail-play-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
}
.detail-play-icon svg { display: block; margin-left: 2px; }

.detail-about .detail-desc {
  margin: 0;
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-about .detail-desc.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.detail-more {
  appearance: none;
  display: inline-block;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #3b82f6;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
}
.detail-more:hover { color: #60a5fa; }

.detail-cast .cast-row,
.detail-foryou .poster-row {
  gap: 10px;
}
.detail-section .rail-slide {
  margin: 0;
}
.detail-resume-hint { display: none; }
.cast-card {
  flex: 0 0 96px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-2);
}
.cast-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #2a2a32, #1a1a22);
  display: grid;
  place-items: center;
}
.cast-letter {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #a1a1aa;
  line-height: 1;
  user-select: none;
}
.cast-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.cast-avatar.is-fallback img { display: none; }

/* —— Watch / Play page —— */
.page-player {
  padding-bottom: 0;
  background: #030306;
  overflow: hidden;
}
.page-player .app-main--flush {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.watch {
  --watch-panel-w: min(380px, 34vw);
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
    #030306;
  color: #f4f4f5;
}
.watch-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 58vh;
  background: #000;
}
.watch-chrome {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}
.watch.is-playing:not(.is-chrome-on):not(.is-panel-open) .watch-chrome,
.watch.is-playing:not(.is-chrome-on):not(.is-panel-open) .vp-controls {
  opacity: 0;
  pointer-events: none;
}
/* Idle playback: hide mouse cursor with the controls */
.watch.is-playing:not(.is-chrome-on):not(.is-panel-open),
.watch.is-playing:not(.is-chrome-on):not(.is-panel-open) * {
  cursor: none !important;
}
.watch-top {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}
.watch-back,
.watch-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 22, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  flex: 0 0 auto;
  transition: background 0.15s ease, transform 0.15s ease;
}
.watch-back:hover,
.watch-icon-btn:hover {
  background: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}
.watch-heading {
  flex: 1;
  min-width: 0;
}
.watch-heading h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watch-heading p {
  margin: 4px 0 0;
  color: #a1a1aa;
  font-size: 0.8rem;
  font-weight: 650;
}
.watch-top-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.watch-player-wrap {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 58vh;
  background:
    radial-gradient(circle at center, #121218 0%, #000 70%);
}
.watch-video {
  width: 100%;
  height: min(78vh, 100%);
  max-height: 100dvh;
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  cursor: pointer;
  transition: object-fit 0.15s ease;
}
.watch-video.is-size-fit { object-fit: contain; }
.watch-video.is-size-fill {
  object-fit: cover;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}
.watch-video.is-size-stretch {
  object-fit: fill;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}
.watch-video::-webkit-media-controls { display: none !important; }
.watch-video::-webkit-media-controls-enclosure { display: none !important; }

.vp-seek-flash {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(0.85);
}
.vp-seek-flash-back { left: 12%; }
.vp-seek-flash-fwd { right: 12%; }
.vp-seek-flash svg { display: block; }
.vp-seek-flash.is-anim {
  animation: vp-seek-pop 0.7s ease forwards;
}
@keyframes vp-seek-pop {
  0% { opacity: 0; transform: translateY(-50%) scale(0.8); }
  18% { opacity: 1; transform: translateY(-50%) scale(1.05); }
  70% { opacity: 1; transform: translateY(-50%) scale(1); }
  100% { opacity: 0; transform: translateY(-50%) scale(0.95); }
}

.vp-subs {
  position: absolute;
  left: 50%;
  bottom: 11%;
  transform: translateX(-50%);
  z-index: 5;
  max-width: min(92%, 920px);
  padding: 0.2em 0.55em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  transition: bottom 0.25s ease;
}
.watch.is-chrome-on .vp-subs,
.watch:hover .vp-subs {
  bottom: 22%;
}

.vp-cc-wrap,
.vp-q-wrap,
.vp-lang-wrap {
  position: relative;
}
.vp-btn.is-cc-on,
.vp-btn.is-lang-on {
  color: #93c5fd;
}
.vp-sub-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  min-width: 148px;
  max-height: min(50vh, 320px);
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 24, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
.vp-sub-menu.is-open {
  display: grid;
}
.vp-sub-menu[hidden] {
  display: none !important;
}
.vp-lang-menu {
  min-width: min(240px, 72vw);
  max-height: min(55vh, 420px);
}
.vp-sub-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e4e4e7;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}
.vp-sub-item:hover {
  background: rgba(37, 99, 235, 0.25);
  color: #fff;
}
.vp-sub-item.is-active {
  background: rgba(37, 99, 235, 0.4);
  color: #fff;
}

/* Custom video player UI — always 2 rows: seek, then buttons */
.vp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  row-gap: 8px;
  padding: 56px 18px 14px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  box-sizing: border-box;
  transition: opacity 0.35s ease;
}
.vp-seek {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  padding: 10px 0 4px;
  cursor: pointer;
  touch-action: none;
}
.vp-seek-track {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: height 0.12s ease;
}
.vp-seek:hover .vp-seek-track,
.vp-seek:active .vp-seek-track { height: 7px; }
.vp-seek-buffered,
.vp-seek-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  width: 0%;
  max-width: 100%;
  pointer-events: none;
}
.vp-seek-buffered { background: rgba(255, 255, 255, 0.35); }
.vp-seek-played {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.vp-seek-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  opacity: 0.85;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.vp-seek:hover .vp-seek-thumb,
.vp-seek:active .vp-seek-thumb {
  width: 15px;
  height: 15px;
}
.vp-toolbar {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vp-cluster {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.vp-cluster-end {
  flex-shrink: 0;
}
.vp-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  flex: 0 0 auto;
  transition: background 0.15s ease;
}
.vp-btn > svg {
  grid-area: 1 / 1;
}
/* SVG [hidden] is ignored by some browsers inside grid — force hide */
.vp-btn svg[hidden],
.vp-btn [hidden] {
  display: none !important;
}
/* Play/pause: drive from .is-playing (SVG.hidden is unreliable in some browsers) */
#vpPlay .vp-icon-pause {
  display: none !important;
}
.watch.is-playing #vpPlay .vp-icon-play {
  display: none !important;
}
.watch.is-playing #vpPlay .vp-icon-pause {
  display: block !important;
}
.vp-btn:hover { background: rgba(255, 255, 255, 0.12); }
.vp-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 4px;
}
.vp-volume-range {
  width: 72px;
  height: 4px;
  accent-color: #60a5fa;
  cursor: pointer;
}
.vp-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 0 4px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #e4e4e7;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vp-time-sep { color: #71717a; }
.vp-chip {
  appearance: none;
  min-height: 30px;
  padding: 0 11px;
  margin-right: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  user-select: none;
  cursor: pointer;
}
.vp-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}
.vp-chip[aria-expanded="true"] {
  background: rgba(37, 99, 235, 0.4);
  border-color: rgba(96, 165, 250, 0.55);
}
.vp-center-play {
  position: absolute;
  z-index: 5;
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.92));
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.45);
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.vp-center-play:hover { transform: scale(1.05); }
.vp-center-play[hidden] { display: none !important; }
.watch.is-playing .vp-center-play { opacity: 0; pointer-events: none; }

.watch-loader,
.watch-error,
.watch-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  color: #d4d4d8;
  background: rgba(0, 0, 0, 0.62);
  z-index: 4;
  padding: 24px;
}
.watch-loader[hidden],
.watch-error[hidden] { display: none !important; }
.watch-empty-hint {
  margin: 0;
  max-width: 28rem;
  justify-self: center;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #a1a1aa;
}
.watch-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #60a5fa;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.watch-panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(22, 22, 28, 0.98), rgba(8, 8, 12, 0.99));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 42vh;
  overflow: auto;
}
.watch-panel-inner { padding: 18px 16px 28px; }
.watch-panel-head {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.watch-panel-info { min-width: 0; }
.watch-panel-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.watch-panel-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.watch-poster {
  width: 78px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.watch-panel-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  padding-right: 4px;
}
.watch-panel-meta {
  margin: 8px 0 0;
  color: #a1a1aa;
  font-size: 0.85rem;
  font-weight: 600;
}
.watch-now {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.22);
  color: #93c5fd;
  font-size: 0.75rem;
  font-weight: 750;
}
.watch-block { margin-bottom: 22px; }
.watch-block h3 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #71717a;
  font-weight: 750;
}
.watch-quality {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.watch-qchip {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.watch-qchip:hover { transform: translateY(-1px); }
.watch-qchip.is-active {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.45), rgba(37, 99, 235, 0.2));
  border-color: rgba(96, 165, 250, 0.55);
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
}
.watch-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.watch-subchip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font-weight: 650;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
}
.watch-subchip:hover {
  background: rgba(37, 99, 235, 0.22);
  color: #fff;
}
.watch-subchip.is-active {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.45), rgba(37, 99, 235, 0.2));
  border-color: rgba(96, 165, 250, 0.55);
  color: #fff;
}
.watch-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.watch-langchip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font-weight: 650;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
}
.watch-langchip:hover {
  background: rgba(37, 99, 235, 0.22);
  color: #fff;
}
.watch-langchip.is-active {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.45), rgba(37, 99, 235, 0.2));
  border-color: rgba(96, 165, 250, 0.55);
  color: #fff;
}
/* Native cues stay hidden — we render via #vpSubs for custom controls */
.watch-video::cue {
  opacity: 0;
}
.watch-season-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
}
.watch-season-tabs::-webkit-scrollbar { height: 0; }
.watch-season-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #a1a1aa;
  font-weight: 750;
  font-size: 0.8rem;
  cursor: pointer;
}
.watch-season-tab.is-active {
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(96, 165, 250, 0.45);
  color: #fff;
}
.watch-ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}
.watch-ep {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  font-weight: 800;
  font-size: 0.88rem;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.watch-ep:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.08); }
.watch-ep.is-active {
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}
.watch-ep-pane[hidden] { display: none !important; }
.watch-details-btn {
  width: 100%;
  margin-top: 4px;
  min-height: 44px;
  border-radius: 14px;
}
.watch-backdrop {
  display: none;
}
.watch.is-panel-open .watch-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 20;
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-2);
}
.empty-state h2 {
  font-family: var(--display);
  margin: 0 0 8px;
  color: var(--text);
}

/* —— Page loading / skeletons —— */
.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
}
.page-progress.is-active { opacity: 1; }
.page-progress-bar {
  height: 100%;
  width: 30%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
  background-size: 200% 100%;
  animation: progressSlide 1.1s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.55);
}
.page-progress.is-done .page-progress-bar {
  width: 100%;
  animation: none;
  transition: width 0.25s ease;
}
@keyframes progressSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(350%); }
}

.skel-block,
.skel-line,
.skel-chip,
.skel-ep-chip {
  background: linear-gradient(110deg, #242428 18%, #35353c 38%, #242428 58%);
  background-size: 220% 100%;
  animation: shimmer 1.35s linear infinite;
  border-radius: 10px;
}
.skel-line { height: 12px; width: 100%; margin-top: 8px; }
.skel-line-title { width: 78%; height: 11px; }
.skel-line-sub { width: 48%; height: 9px; }
.skel-line-heading { width: min(160px, 42%); height: 20px; border-radius: 8px; margin: 0; }
.skel-line-kicker { width: 110px; height: 10px; margin-top: 0; }
.skel-line-title-lg { width: min(380px, 92%); height: 30px; border-radius: 12px; margin-top: 10px; }
.skel-line-genre { width: min(200px, 70%); height: 12px; }
.skel-line-short { width: 55%; }
.skel-line-btn {
  width: 132px;
  height: 44px;
  border-radius: 14px;
  margin-top: 0;
}
.skel-line-btn-ghost { opacity: 0.7; width: 120px; }
.skel-line-btn-wide { width: min(220px, 100%); margin-top: 14px; }
.skel-chip {
  flex: 0 0 auto;
  display: block;
  width: 92px;
  height: 34px;
  border-radius: 999px;
}
.skel-chip-sm { width: 58px; height: 26px; }
.skel-card { pointer-events: none; }
.skel-card .poster-media { border-radius: 14px; }
.skel-card .poster-meta { min-height: 42px; }
.skel-rail .poster-row { gap: 12px; }
.skel-rail .poster-card { flex: 0 0 148px; }

/* Home hero skeleton — mirrors featured card */
.skel-home { padding: 0; }
.skel-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  margin: 10px 0 24px;
  min-height: clamp(340px, 42vw, 520px);
  background: #141418;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.skel-hero-media {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.9;
}
.skel-hero-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 12, 0.92) 0%, rgba(8, 8, 12, 0.45) 42%, transparent 70%),
    linear-gradient(180deg, transparent 40%, rgba(8, 8, 12, 0.88) 100%);
  pointer-events: none;
}
.skel-hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  max-width: 540px;
  padding: clamp(22px, 4vw, 44px);
  padding-bottom: clamp(28px, 5vw, 48px);
}
.skel-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.skel-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.skel-platforms .chip-row { padding: 0; }
.skel-platforms { margin-bottom: 8px; }

/* Detail skeleton — banner + body */
.skel-detail-banner {
  height: clamp(220px, 42vw, 320px);
  border-radius: 0;
  margin: 0;
}
.skel-detail-body {
  padding: 18px 16px 24px;
  background: #000;
  margin-top: -20px;
  position: relative;
  z-index: 1;
}
.skel-detail-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.skel-detail-select {
  height: 42px;
  border-radius: 10px;
}
.skel-section {
  margin: 8px 0 22px;
}
.skel-section .skel-line-heading { margin-bottom: 14px; }
.skel-ep-row {
  display: flex;
  gap: 8px;
  overflow: hidden;
}
.skel-ep-chip {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 10px;
}
.skel-search-heading { margin: 0 0 16px; }
.skel-play-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #71717a;
}
.load-error {
  text-align: center;
  padding: 72px 20px;
  color: var(--text-2);
}
.load-error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffb4ab;
  background: rgba(186, 26, 26, 0.18);
  border: 1px solid rgba(186, 26, 26, 0.35);
}
.load-error h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  color: var(--text);
}
.load-error p { margin: 0 0 18px; max-width: 42ch; margin-left: auto; margin-right: auto; }
.client-app.is-loading { min-height: 240px; }
.watch-loader.is-page-loader {
  position: relative;
  min-height: 56vh;
  inset: auto;
  background: transparent;
}
@keyframes shimmer {
  to { background-position-x: -200%; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .bottomnav { display: none; }
  .topnav { display: flex; }
  .topbar-actions { display: none !important; }
  .search-form-launch { display: none !important; }
  .page-detail .topbar { display: flex; }
  .detail-app { max-width: 760px; padding-bottom: 24px; }
  .detail-banner { border-radius: 0 0 18px 18px; overflow: hidden; }
  .hero-subline { display: none; }
}

/* Phone / tablet / short landscape: player full-bleed, panel as bottom sheet */
@media (max-width: 1099px), (max-height: 639px) {
  .watch {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    height: 100dvh;
  }
  .watch-stage {
    min-height: 0;
    flex: 1;
    max-height: none;
  }
  .watch-player-wrap {
    min-height: 0;
    flex: 1;
    height: 100%;
  }
  .watch-video {
    width: 100%;
    height: 100%;
    max-height: none;
  }
  .watch-panel {
    display: none;
  }
  .watch.is-panel-open .watch-panel {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    max-height: min(72vh, 560px);
    border-radius: 22px 22px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.45);
    animation: watchSheet 0.28s ease;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: auto;
  }
  .watch-top-actions .watch-panel-toggle,
  .vp-panel-btn { display: inline-grid; }
}

/* Wide desktop only: persistent side panel */
@media (min-width: 1100px) and (min-height: 640px) {
  .watch {
    grid-template-columns: minmax(0, 1fr) var(--watch-panel-w);
    height: 100vh;
    height: 100dvh;
  }
  .watch-stage { min-height: 100%; }
  .watch-player-wrap { min-height: 100%; }
  .watch-video {
    height: 100%;
    max-height: 100dvh;
  }
  .watch-panel {
    display: block;
    max-height: none;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }
  .watch.is-panel-open .watch-panel {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    padding-bottom: 0;
  }
  /* Hide mobile sheet openers — quality chip stays */
  .watch-top-actions .watch-panel-toggle,
  .vp-panel-btn { display: none; }
  .watch-panel-close { display: none; }
  .watch.is-panel-open .watch-backdrop { display: none; }
}
@keyframes watchSheet {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

/* —— Mobile redesign v2: card hero + floating dock —— */
@media (max-width: 720px) {
  :root {
    --nav-h: 56px;
    --bottom-h: 58px;
    --page-gutter: 14px;
    --m-pad: var(--page-gutter);
    --dock-gap: 10px;
    --section-y: var(--space-6);
    --page-head-y: var(--space-4);
    --title-page: 1.7rem;
    --title-section: 1.12rem;
  }

  body {
    padding-bottom: calc(var(--bottom-h) + var(--dock-gap) + 20px + env(safe-area-inset-bottom));
    background: #121212;
  }

  /* Scroll perf: blur is expensive on mobile compositing */
  .topbar,
  .bottomnav,
  .hero-btn-more,
  .detail-back,
  .detail-hero-play,
  .poster-rating {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .hero-slide.is-active.is-anim .hero-media {
    animation: none !important;
    transform: scale(1.02);
  }
  .poster-media {
    box-shadow: none;
  }

  .app-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 var(--page-gutter) var(--space-7);
  }

  /* AJx-style top chrome: logo + icon actions */
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--nav-h);
    padding: 8px var(--page-gutter);
    padding-top: max(8px, env(safe-area-inset-top));
    background: rgba(18, 18, 18, 0.92);
    border-bottom: 0;
  }
  .topnav { display: none; }
  .search-form-launch,
  .search-form-desktop { display: none !important; }
  .brand-name {
    display: inline;
    font-size: 1.05rem;
    font-weight: 800;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
  }
  .topbar-actions { display: flex; }
  .topbar-icon {
    width: 38px;
    height: 38px;
    color: #f3f4f6;
  }

  /* Floating text-pill dock */
  .bottomnav {
    left: var(--dock-gap);
    right: var(--dock-gap);
    bottom: max(var(--dock-gap), env(safe-area-inset-bottom));
    height: 52px;
    padding: 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(24, 24, 28, 0.94);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .bottomnav-item {
    flex-direction: row;
    font-size: 0.78rem;
    font-weight: 750;
    gap: 0;
    border-radius: 999px;
    margin: 0;
    color: #fff;
    background: transparent;
  }
  .bottomnav-item.is-active {
    color: #fff;
    background: #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
  }

  /* Featured card — AJx style */
  .hero {
    --hero-h: min(52vh, 360px);
    margin: var(--space-2) 0 var(--space-4);
    border-radius: 18px;
    min-height: var(--hero-h);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  }
  .hero-track {
    min-height: var(--hero-h);
    height: var(--hero-h);
  }
  .hero-media {
    object-fit: cover;
    object-position: 55% 20%;
    transform-origin: 55% 25%;
  }
  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.92) 100%);
  }
  .hero-scrim-side {
    opacity: 1;
    background:
      linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.45) 70%, rgba(0, 0, 0, 0.85) 100%);
  }
  .hero-glow { display: none; }
  .hero-copy {
    max-width: none;
    padding: 18px 14px 42px;
    justify-content: flex-end;
  }
  .hero-copy::before { display: none; }
  .hero-meta {
    gap: 0;
    margin-bottom: 8px;
  }
  .hero-kicker,
  .hero-meta-dot { display: none; }
  .hero-badge {
    min-height: 22px;
    padding: 0 10px;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    border-radius: 999px;
    background: #2563eb;
    border: 0;
    color: #fff;
  }
  .hero-title {
    font-size: clamp(1.45rem, 6.5vw, 1.9rem);
    max-width: 16ch;
    line-height: 1.08;
  }
  .hero-subline {
    display: inline-flex;
  }
  .hero-desc { display: none; }
  .hero-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: auto;
    margin-top: 12px;
  }
  .hero-btn-play {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 40px;
    border-radius: 999px;
    padding: 0 18px;
    font-size: 0.9rem;
    font-weight: 800;
    gap: 6px;
  }
  .hero-btn-more { display: none; }
  .hero-navs { display: none; }
  .hero-progress,
  .hero-dots {
    left: 50%;
    right: auto;
    bottom: 12px;
    transform: translateX(-50%);
    width: auto;
    justify-content: center;
    gap: 5px;
  }
  .hero-prog {
    flex: 0 0 auto;
    max-width: none;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    overflow: hidden;
    padding: 0;
    border: 0;
  }
  .hero-prog.is-active {
    width: 18px;
    background: #2563eb;
  }
  .hero-prog-fill { display: none; }
  .hero.is-autoplaying .hero-prog.is-active .hero-prog-fill {
    animation: none;
  }
  .rail-platforms {
    margin-top: 2px;
    margin-bottom: var(--space-4);
  }
  .rail-platforms .chip-row {
    gap: 8px;
  }

  /* Sections */
  .rail { margin: var(--space-2) 0 var(--section-y); }
  .rail-head {
    margin-bottom: var(--space-3);
    align-items: center;
  }
  .rail-title { letter-spacing: -0.03em; }

  .rail-slide.has-overflow {
    padding: 0;
    margin: 0;
  }
  .rail-arrow,
  .rail-slide.can-prev::before,
  .rail-slide.can-next::after {
    display: none !important;
  }

  /* Edge-bleed horizontal rails (scroll under page gutter) */
  .poster-row,
  .chip-row,
  .cast-row,
  .continue-row {
    gap: var(--card-gap);
    margin-inline: calc(var(--page-gutter) * -1);
    padding: 0 var(--page-gutter) 2px;
    scroll-padding-left: var(--page-gutter);
  }

  .chip {
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 999px;
    background: #1f1f24;
    border-color: transparent;
    color: #d1d5db;
  }
  .chip.is-active,
  .chip:hover {
    background: #2a2a32;
    color: #fff;
  }

  .poster-card { flex: 0 0 132px; }
  .poster-card:hover { transform: none; }
  .poster-media {
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  }
  .poster-corner { display: none; }
  .poster-meta { margin-top: 8px; }
  .poster-title {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    -webkit-line-clamp: 1;
  }
  .poster-sub {
    display: none;
    font-size: 0.72rem;
    color: #8e8e98;
  }
  .poster-rating {
    top: 6px;
    left: 6px;
    right: auto;
    width: auto;
    max-width: none;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #fbbf24;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .poster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--grid-gap-y) var(--grid-gap-x);
  }

  .page-head { margin-top: var(--space-2); margin-bottom: var(--page-head-y); }

  .browse-toolbar {
    margin-inline: calc(var(--page-gutter) * -1);
    padding-inline: var(--page-gutter);
  }
  .browse-sort-row {
    margin-right: 0;
  }
  .browse-active {
    margin-inline: 0;
  }

  .search-form-launch {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: none;
    min-height: 42px;
    padding: 0 14px;
    text-decoration: none;
    background: #1a1a20;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .search-form-launch:active {
    background: #202028;
  }
  .search-form-desktop { display: none !important; }
  .search-app-bar { padding-left: var(--m-pad); padding-right: var(--m-pad); }
  .search-type-row { padding-left: var(--m-pad); padding-right: var(--m-pad); }
  .search-app-body { padding-left: var(--m-pad); padding-right: var(--m-pad); }

  /* Detail — app chrome */
  .page-detail .topbar { display: none; }
  .page-detail .app-main {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .page-detail {
    background: #000;
  }
  .detail-app { max-width: none; }
  .detail-banner {
    --banner-h: min(42vh, 320px);
  }
  .detail-hero-play {
    width: 72px;
    height: 72px;
  }
  .detail-body {
    margin-top: 0;
    padding: 10px var(--page-gutter) 8px;
  }
  .detail-title {
    font-size: 1.35rem;
  }
  .detail-meta {
    font-size: 0.78rem;
  }
  .detail-selects { gap: 8px; }
  .ep-chip {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }
  .detail-cast .cast-row {
    margin-inline: calc(var(--page-gutter) * -1);
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }
  .ep-rail-wrap {
    margin-inline: calc(var(--page-gutter) * -1);
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }
  .detail-foryou-grid {
    gap: 10px 8px;
  }
  .detail-foryou-grid .poster-title {
    font-size: 0.72rem;
  }
  .detail-sheet {
    max-height: min(78vh, 720px);
  }
  .detail-ep-grid { gap: 7px; }
  .cast-card { flex: 0 0 88px; font-size: 0.74rem; }
  .cast-avatar {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .cast-letter { font-size: 1.3rem; }

  .skel-home { padding: 0 0 var(--space-2); }
  .skel-hero-card {
    margin: var(--space-2) 0 18px;
    border-radius: 22px;
    min-height: min(58vh, 440px);
  }
  .skel-hero-copy {
    max-width: none;
    padding: 18px 16px 22px;
  }
  .skel-hero-fade {
    background:
      linear-gradient(180deg, rgba(8, 8, 12, 0.12) 20%, rgba(8, 8, 12, 0.55) 55%, rgba(8, 8, 12, 0.96) 100%);
  }
  .skel-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  .skel-hero-actions .skel-line-btn,
  .skel-hero-actions .skel-line-btn-ghost {
    width: 100%;
  }
  .skel-platforms,
  .skel-rail,
  .skel-section,
  .skel-search {
    padding-left: 0;
    padding-right: 0;
  }
  .skel-rail .poster-card { flex: 0 0 132px; }
  .skel-detail {
    padding-bottom: var(--space-3);
  }
  .skel-detail-banner {
    height: min(42vh, 300px);
  }
  .skel-detail-body {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }
  .skel-line-btn-wide { width: 100%; height: 46px; border-radius: 12px; }
  .skel-ep-row {
    margin-inline: calc(var(--page-gutter) * -1);
    padding: 0 var(--page-gutter);
    gap: var(--space-2);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .skel-ep-row::-webkit-scrollbar { display: none; }
  .skel-search-heading { margin-left: 0; margin-right: 0; }

  /* Player */
  .watch-top {
    gap: 8px;
    padding: 10px 10px 28px;
  }
  .watch-back,
  .watch-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }
  .watch-heading h1 { font-size: 0.95rem; }
  .watch-heading p { font-size: 0.72rem; }
  .watch-top-actions .watch-icon-btn:not(.watch-panel-toggle) { display: none; }

  .vp-controls { padding: 36px 10px 10px; row-gap: 2px; }
  .vp-seek { padding: 6px 0 2px; }
  .vp-toolbar { gap: 6px; }
  .vp-volume-range { display: none; }
  .vp-time { font-size: 0.7rem; margin-left: 2px; gap: 4px; }
  .vp-btn { width: 36px; height: 36px; border-radius: 10px; }
  .vp-chip {
    min-height: 28px;
    padding: 0 8px;
    font-size: 0.7rem;
    margin-right: 2px;
  }
  .vp-center-play { width: 58px; height: 58px; }
  .vp-center-play svg { width: 28px; height: 28px; }

  .watch-panel-inner { padding: 14px 14px 22px; }
  .watch-panel-head { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; }
  .watch-panel-close { width: 36px; height: 36px; border-radius: 10px; }
  .watch-poster { width: 64px; }
  .watch-panel-title { font-size: 1.05rem; }
  .watch-ep-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}

@media (max-width: 480px) {
  :root {
    --page-gutter: 12px;
    --m-pad: var(--page-gutter);
    --grid-gap-y: 14px;
    --grid-gap-x: 10px;
  }

  .hero {
    --hero-h: min(62vh, 440px);
    border-radius: 20px;
  }
  .hero-media { object-position: center 24%; }
  .hero-title { font-size: clamp(1.55rem, 7.5vw, 2rem); }
  .hero-kicker { font-size: 0.7rem; }
  .hero-actions { flex-direction: column; }
  .hero-btn-play,
  .hero-btn-more { flex: 1 1 auto; width: 100%; }

  .poster-card { flex: 0 0 142px; }
  .poster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .watch-heading p { display: none; }
}

/* Size modes must win over responsive video height rules */
.watch-player-wrap .watch-video.is-size-fill {
  object-fit: cover;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}
.watch-player-wrap .watch-video.is-size-stretch {
  object-fit: fill;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}
.watch-player-wrap .watch-video.is-size-fit {
  object-fit: contain;
}
