:root {
    /* Dynamic viewport width avoids scrollbar gutter overflow on phones (Safari “zoomed” layout). */
    --100vw: 100vw;
    --bg: #0b0b0d;
    --surface: #121214;
    --surface-bar: rgba(18, 18, 20, 0.97);
    --border: #2a2a2e;
    --text: #e6e6e6;
    --muted: #a6a6a6;
    --primary: #e50914;
    --on-primary: #ffffff;
    --focus-ring: #ffffff;
    --hero-max-w: min(720px, 54vw);
    /* Fixed billboard: always half viewport; text scrolls inside .hero-copy-block */
    --hero-billboard-height: 45vh;
    --tile-radius: 8px;
    --poster-w-movie: 180px;
    --poster-w-live: 220px;
    --poster-aspect-movie: 2 / 3;
    --poster-aspect-live: 16 / 9;
    --font: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    /* Same scale as .row-label (“[MULTI-LANG] TOP 2026 MOVIES (203)” etc.) */
    --browse-category-heading-font: clamp(0.9rem, 0.35vh + 0.78rem, 1.05rem);
    /* Poster titles under browse tiles */
    --poster-title-font: 14px;
}

@supports (width: 100dvw) {
    :root {
        --100vw: 100dvw;
    }
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: clamp(14px, 0.25rem + 1.05vw, 17px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hidden {
    display: none !important;
}

/* ----- Full-screen backdrop ----- */
.backdrop-host {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.backdrop-host::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(155deg, #221a38 0%, #100f18 28%, #070708 100%);
    pointer-events: none;
}

.backdrop-img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.28s ease;
    filter: saturate(1.12) brightness(0.5);
}

.backdrop-img.is-visible {
    opacity: 1;
}

/* When art loads, keep image bright (default stack was nearly black). */
.backdrop-host.has-poster::before {
    opacity: 0.5;
}

.backdrop-host.has-poster .backdrop-img {
    filter: saturate(1.06) brightness(0.92) contrast(1.02);
}

/* Match Android res/drawable/hero_full_gradient.xml: left readability scrim + bottom fade (not a heavy radial wash). */
.backdrop-host.has-poster .backdrop-vignette {
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.72) 28%, rgba(0, 0, 0, 0.52) 52%, rgba(0, 0, 0, 0.26) 74%, rgba(0, 0, 0, 0.04) 92%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.16) 56%, rgba(0, 0, 0, 0.72) 100%);
}

.backdrop-host.has-poster .backdrop-bottom-fade {
    height: 34%;
    background: linear-gradient(to bottom, transparent 0%, rgba(11, 11, 11, 0.22) 52%, rgba(11, 11, 11, 0.58) 84%, var(--bg) 98%);
}

.backdrop-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse 95% 85% at 72% 38%, transparent 0%, rgba(11, 11, 13, 0.55) 45%, rgba(11, 11, 13, 0.92) 72%, var(--bg) 100%),
        linear-gradient(to top, rgba(11, 11, 13, 0.97) 0%, transparent 42%);
}

.backdrop-bottom-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 58%;
    background: linear-gradient(to bottom, transparent 0%, var(--bg) 92%);
}

/* Let full-screen #backdropHost show through header + hero (Netflix-style billboard) */
.app-root.browse-backdrop {
    background-color: transparent;
    background-image:
        linear-gradient(90deg, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.2) 36%, rgba(0, 0, 0, 0.06) 68%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.08) 58%, rgba(0, 0, 0, 0.42) 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.preview-debug-panel {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 1300;
    width: min(1200px, calc(var(--100vw) - 28px));
    max-height: 44vh;
    overflow: auto;
    margin: 0;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(120, 190, 255, 0.65);
    background: rgba(0, 0, 0, 0.76);
    color: #9ad1ff;
    font: 20px/1.5 Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
    word-break: break-word;
    pointer-events: none;
}

/* ----- App shell ----- */
.app-root {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    height: 100%;
    /* Keeps shell tall when main.auth-flow is position:absolute (out of flex flow) */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: var(--bg);
}

/* Let full-screen #backdropHost show through header + hero (Netflix-style billboard) */
.app-root.browse-backdrop {
    background-color: transparent;
    background-image:
        linear-gradient(90deg, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.2) 36%, rgba(0, 0, 0, 0.06) 68%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.08) 58%, rgba(0, 0, 0, 0.42) 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.app-header {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    background: transparent;
}

.header-surface {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(8px, 2vw, 24px);
    padding: 10px clamp(12px, 4vw, 36px);
    flex-wrap: wrap;
    background: transparent;
    border-bottom: none;
}

/* When the browse backdrop is active, lay a soft top scrim behind the header
   so the menu stays readable while the backdrop image shows through. */
.app-root.browse-backdrop .app-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.42) 60%,
        rgba(0, 0, 0, 0) 100%
    );
}

.header-left {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;
}

.logo-mark {
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 1.15em;
    color: var(--primary);
    flex-shrink: 0;
    display: none;
}

.nav-modes {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Match .icon-btn: same border, fill, height, and focus ring as top-right header actions */
.nav-tab.mode {
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    padding: 8px 18px;
    min-height: 46px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-tab.mode:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.nav-tab.mode.active {
    background: var(--primary);
    color: var(--on-primary);
    border-color: transparent;
}

.nav-tab.mode:focus {
    outline: none;
    border-color: var(--focus-ring);
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.nav-tab.mode.active:focus {
    border-color: rgba(255, 255, 255, 0.85);
    background: var(--primary);
    color: var(--on-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}

.header-meta {
    color: var(--muted);
    font-size: 0.78em;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.header-meta.hidden {
    display: none !important;
}

.icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: var(--on-primary);
    font-size: 1.15em;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.icon-btn:focus {
    outline: none;
    border-color: var(--focus-ring);
    background: rgba(255, 255, 255, 0.14);
}

.header-icon {
    width: 28px;
    height: 28px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-icon-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    max-width: 240px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.82em;
    font-weight: 600;
    line-height: 1.25;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -4px);
    transition: opacity 120ms ease, transform 120ms ease;
    z-index: 12;
    white-space: nowrap;
}

.header-icon-tooltip.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ----- Hero: fixed half-screen; inner copy scrolls so height never changes ----- */
.hero-block {
    flex: 0 0 var(--hero-billboard-height);
    position: relative;
    z-index: 2;
    width: 100%;
    height: var(--hero-billboard-height);
    min-height: var(--hero-billboard-height);
    max-height: var(--hero-billboard-height);
    max-width: none;
    padding: 12px 48px 16px 48px;
    margin: 0;
    box-sizing: border-box;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.hero-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: clamp(16px, 3vw, 36px);
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-width: 900px) {
    .hero-layout {
        flex-direction: column;
        align-items: stretch;
        overflow: visible;
    }

    .hero-preview-panel {
        max-width: 100%;
        align-self: center;
    }

    .hero-preview-card {
        max-height: min(38vh, 360px);
    }

    .hero-block {
        flex-basis: auto;
        height: auto;
        min-height: min(52vh, 420px);
        max-height: none;
    }
}

.hero-copy-block {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    max-width: var(--hero-max-w);
    align-self: stretch;
    pointer-events: auto;
    padding-top: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hero-title {
    margin: 0;
    font-size: clamp(1.45rem, 1.5vh + 1rem, 2.65rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 32px rgba(0, 0, 0, 0.9), 0 6px 64px rgba(0, 0, 0, 0.6);
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: clamp(0.78rem, 0.35vh + 0.62rem, 0.95rem);
    line-height: 1.35;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Home Live TV: program guide under meta (D-pad focus on row posters) */
.hero-live-epg {
    margin: 12px 0 0;
    padding: 12px 14px;
    max-width: 100%;
    border-radius: 12px;
    background: rgba(12, 12, 16, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: clamp(0.78rem, 0.35vh + 0.62rem, 0.92rem);
    line-height: 1.4;
    color: var(--text);
}

.hero-live-epg.hidden {
    display: none !important;
}

.hero-epg-label {
    display: block;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin-bottom: 4px;
}

.hero-epg-block + .hero-epg-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-epg-time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.hero-epg-desc {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92em;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-plot {
    margin: 10px 0 0;
    font-size: clamp(0.82rem, 0.4vh + 0.65rem, 1rem);
    line-height: 1.45;
    color: var(--text);
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

.hero-director,
.hero-cast,
.hero-more {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: clamp(0.76rem, 0.32vh + 0.58rem, 0.9rem);
    line-height: 1.35;
    max-width: 100%;
}

.hero-cast {
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-more {
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Live preview PiP in hero */
.hero-preview-panel {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 0;
    width: 100%;
    max-width: min(100%, 720px);
    pointer-events: none;
}

.hero-preview-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: min(42vh, 420px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.14);
    background: #000;
}

.preview-video {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}

.preview-loader::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.preview-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    padding: 8px 12px;
    font-size: 0.65em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: rgba(255, 255, 255, 0.85);
}

.preview-status {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    white-space: pre-line;
    font-size: 0.72em;
    font-weight: 700;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.94);
    background: rgba(0, 0, 0, 0.62);
}

.poster-heart {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 26px;
    line-height: 1;
    font-weight: 800;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.95));
}

.poster-heart.on {
    color: #ffd54f;
}

.poster-resume {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.58em;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(229, 9, 20, 0.92);
    color: #fff;
}

/* ----- Category chips ----- */
.chips-host {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    padding: 4px 32px 10px;
}

.chips-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 8px;
    scrollbar-width: none;
}

.chips-scroll::-webkit-scrollbar {
    display: none;
}

/* Same surface treatment as .icon-btn / .nav-tab.mode (header controls) */
#chipsScroll button.chip,
.chips-scroll button.chip {
    flex: 0 0 auto;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-family: var(--font);
    font-size: var(--browse-category-heading-font) !important;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 8px 16px;
    min-height: 38px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    -webkit-text-size-adjust: 100%;
}

#chipsScroll button.chip:hover,
.chips-scroll button.chip:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

#chipsScroll button.chip:focus,
.chips-scroll button.chip:focus {
    outline: none;
    border-color: var(--focus-ring);
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

#chipsScroll button.chip.selected,
.chips-scroll button.chip.selected {
    background: var(--primary);
    border-color: transparent;
    color: var(--on-primary);
}

#chipsScroll button.chip.selected:hover,
.chips-scroll button.chip.selected:hover {
    color: var(--on-primary);
    background: var(--primary);
}

#chipsScroll button.chip.selected:focus,
.chips-scroll button.chip.selected:focus {
    border-color: rgba(255, 255, 255, 0.85);
    background: var(--primary);
    color: var(--on-primary);
}

/* ----- Main browse area ----- */
.main {
    flex: 1 1 auto;
    min-height: 0;
    outline: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 0 28px;
}

.app-root.browse-backdrop .main.browse-main {
    background: transparent;
    min-height: 0;
    overflow: hidden;
}

.app-root.browse-backdrop .chips-host {
    background: transparent;
}

.browse-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 32px 40px;
    scroll-behavior: auto;
}

.app-root.browse-backdrop {
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.content-row {
    margin-bottom: 22px;
}

.row-label {
    margin: 0 0 10px 4px;
    font-size: var(--browse-category-heading-font);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
}

.row-track-wrap {
    overflow: hidden;
    margin: 0 -8px;
}

.row-track {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 6px 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: auto;
    scrollbar-width: none;
}

.row-track::-webkit-scrollbar {
    display: none;
}

.content-row-grid {
    margin-bottom: 0;
}

.row-grid-wrap {
    overflow: visible;
}

.row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--poster-w-movie), 1fr));
    gap: 18px 14px;
    align-items: start;
    padding: 6px 4px 36px;
}

.row-grid .poster {
    width: 100%;
    max-width: var(--poster-w-movie);
}

.row-grid .poster.mode-live {
    max-width: var(--poster-w-live);
}

.poster {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 2px solid transparent;
    border-radius: var(--tile-radius);
    padding: 0;
    background: var(--surface);
    cursor: pointer;
    overflow: visible;
    transition: transform 0.15s ease, border-color 0.12s ease, box-shadow 0.15s ease;
}

.poster-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: var(--poster-aspect-movie);
    border-radius: var(--tile-radius);
    overflow: hidden;
    background: #1a1a1f;
}

.poster.mode-live .poster-thumb {
    aspect-ratio: var(--poster-aspect-live);
}

.poster.mode-movie,
.poster.mode-series {
    width: var(--poster-w-movie);
}

.poster.mode-live {
    width: var(--poster-w-live);
    background: transparent;
    border-color: transparent;
}

.poster.mode-live .poster-thumb {
    background: transparent;
}

.poster-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 7px 2px 1px;
    padding: 0 2px;
    font-size: var(--poster-title-font) !important;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    text-align: center;
    min-height: 2.5em;
}

/* Live: drop min-height so two-line titles don’t force a tall strip */
.poster.mode-live .poster-title {
    min-height: 0;
}

.poster:focus {
    outline: none;
    border-color: var(--focus-ring);
    transform: scale(1.035);
    z-index: 2;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.25;
}

.poster-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.62em;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
}

.poster-badge.live {
    background: var(--primary);
}

.poster-more {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9em;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    font-family: inherit;
}

.poster-more:hover,
.poster-more:focus {
    color: var(--text);
}

.poster-action {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    min-width: 38px;
    min-height: 34px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.74);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.poster-action-remove {
    padding: 5px 10px;
}

.poster-action-favorite {
    color: #ffd54f;
    font-size: 1.05rem;
}

.poster:hover .poster-action,
.poster:focus .poster-action,
.poster:focus-within .poster-action {
    opacity: 1;
    transform: translateY(0);
}

.poster-action:hover,
.poster-action:focus {
    outline: none;
    opacity: 1;
    background: rgba(229, 9, 20, 0.94);
    border-color: rgba(255, 255, 255, 0.82);
}

/* ----- Inner screens (login, forms, lists) ----- */
.panel-page {
    padding: 24px 40px 40px;
    max-width: 920px;
}

.panel-page.live-channels-page {
    max-width: none;
    width: 100%;
}

.live-channels-layout {
    display: grid;
    grid-template-columns: minmax(360px, 520px) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
    width: 100%;
}

.live-channels-list {
    max-height: calc(100vh - 220px);
    background: transparent !important;
    padding: 0;
    gap: 4px;
}

/* Full list + EPG: only icon + title, no dark tile fill (.tile,.row-item wins without !important). */
.panel-page.live-channels-page .live-channels-list .row-item.live-channel-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 8px;
    background: transparent !important;
    border: 2px solid transparent;
    box-shadow: none;
}

.panel-page.live-channels-page .live-channels-list .row-item.live-channel-row:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.35);
    background: transparent !important;
}

.panel-page.live-channels-page .live-channels-list .live-channel-thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
}

.panel-page.live-channels-page .live-channels-list .live-channel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.panel-page.live-channels-page .live-channels-list .live-channel-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-page.live-channels-page .live-channels-list .live-channel-name {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    /* Match .screen-title size exactly */
    font-size: 1.25em !important;
}

.panel-page.live-channels-page .live-channels-list .live-channel-row .sub {
    margin-top: 0;
}

.epg-panel {
    background: rgba(30, 30, 34, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    padding: 14px 16px 16px;
    max-height: calc(100vh - 220px);
    overflow: hidden;
    min-height: 160px;
}

@media (max-width: 980px) {
    .live-channels-layout {
        grid-template-columns: 1fr;
    }
}

.epg-title {
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 2px 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding-right: 4px;
}

.epg-empty,
.epg-loading {
    color: var(--muted);
    font-size: 0.9em;
    padding: 10px 4px;
}

.epg-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 12px 12px 11px;
}

.epg-card-kicker {
    color: var(--muted);
    font-size: 0.78em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.epg-card-line {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.epg-time {
    color: #c9c9d2;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.epg-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epg-desc {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86em;
    line-height: 1.45;
    max-height: 7.4em;
    overflow: hidden;
}

.panel-page.vod-detail {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* ── New full-screen VOD detail layout ── */
.vd-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: auto;
    background: #111;
}

.vd-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.vd-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Match home/main browse backdrop scrim so the left-side glare reads the same.
   Two-axis Netflix-style fade: dark on the left, soft fade at the bottom. */
.vd-bg-scrim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.72) 28%, rgba(0, 0, 0, 0.52) 52%, rgba(0, 0, 0, 0.26) 74%, rgba(0, 0, 0, 0.04) 92%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.16) 56%, rgba(0, 0, 0, 0.72) 100%);
}

/* ── Info panel: pure layout container; the scrim is rendered by .vd-bg-scrim ── */
.vd-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(760px, 62%);
    background: transparent;
    padding: clamp(62px, 7vh, 84px) clamp(44px, 5vw, 80px) clamp(36px, 5vh, 56px) clamp(42px, 5vw, 68px);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
}

/* ── Top row: poster thumb + title/badges/info ── */
.vd-top-row {
    display: -webkit-flex;
    display: flex;
    gap: 0;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    margin-bottom: clamp(22px, 4vh, 36px);
}

.vd-thumb {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    width: clamp(178px, 15vw, 245px);
    height: auto;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}

.vd-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vd-title-block {
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: clamp(10px, 1.5vh, 16px);
    padding-top: 6px;
    padding-left: clamp(24px, 3vw, 36px);
    border-left: 3px solid rgba(255,255,255,0.15);
}

.vd-title {
    margin: 0;
    font-size: clamp(2.15rem, 3.2vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vd-badges {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 12px;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

.vd-badge {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 6px;
    font-size: clamp(1rem, 1.45vw, 1.28rem);
    font-weight: 700;
    white-space: nowrap;
}

.vd-badge-rating {
    background: #e6b800;
    color: #000;
}

.vd-badge-genre {
    color: rgba(255,255,255,0.85);
    font-size: clamp(1rem, 1.45vw, 1.28rem);
}

.vd-info-lines {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 8px;
}

.vd-info-line {
    font-size: clamp(1rem, 1.45vw, 1.28rem);
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
}

.vd-info-label {
    color: rgba(255,255,255,0.48);
}

/* ── Cast / Plot sections ── */
.vd-section {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 8px;
    margin-bottom: clamp(18px, 3.4vh, 28px);
}

.vd-section-label {
    font-size: clamp(1.25rem, 1.8vw, 1.65rem);
    font-weight: 800;
    color: #fff;
}

.vd-section-text {
    font-size: clamp(1rem, 1.45vw, 1.25rem);
    color: rgba(255,255,255,0.82);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Action buttons ── */
.vd-actions {
    display: -webkit-flex;
    display: flex;
    gap: 14px;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 14px;
}

.vd-btn {
    padding: 15px 30px;
    font-size: clamp(1rem, 1.55vw, 1.35rem);
    font-weight: 800;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    min-width: 160px;
    text-align: center;
}

.vd-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.5);
}

.vd-btn-play {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
    min-width: 220px;
}

.vd-btn-trailer {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}

.vd-btn-back {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}


/* ── YouTube player screen ── */
.yt-player-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background: #000;
}

.yt-player-top {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 24px;
    background: rgba(0, 0, 0, 0.72);
    flex-shrink: 0;
    z-index: 2;
}

.yt-player-title {
    color: var(--text);
    font-size: 1em;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yt-frame-wrap {
    flex: 1;
    position: relative;
    background: #000;
}

.yt-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.yt-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 48px;
    max-width: 900px;
}

.yt-fallback-title {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 24px;
}

.yt-fallback-msg {
    font-size: 26px;
    color: rgba(255,255,255,0.75);
    margin: 0 0 20px;
}

.yt-fallback-url {
    font-size: 24px;
    color: #ffc107;
    word-break: break-all;
    margin: 0 0 32px;
    padding: 16px 24px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
}

.yt-fallback-hint {
    font-size: 22px;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

.screen-title {
    margin: 0 0 12px;
    font-size: 1.25em;
    font-weight: 700;
}

.screen-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.screen-topbar .screen-title {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-back-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font: inherit;
    font-size: 1.15em;
    font-weight: 800;
    cursor: pointer;
}

.screen-back-btn:hover,
.screen-back-btn:focus {
    outline: none;
    border-color: var(--focus-ring);
    background: rgba(255, 255, 255, 0.14);
}

.hint {
    color: var(--muted);
    font-size: 0.85em;
    margin: 0 0 18px;
}

.settings-option-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 4px 4px;
    max-width: 560px;
    color: var(--text);
    cursor: pointer;
}

.settings-option-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 4px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.settings-option-row .settings-option-text {
    flex: 1;
    min-width: 0;
}

.settings-option-row .settings-option-title {
    font-weight: 700;
    margin: 0 0 6px;
    font-size: 1.02em;
}

.settings-option-row .settings-option-desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.86em;
    line-height: 1.45;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 4px;
}

.tile, .row-item {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--tile-radius);
    padding: 14px 18px;
    color: var(--text);
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s ease, transform 0.12s ease;
}

.tile:focus, .row-item:focus, .field:focus, .btn:focus, .tab:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.35);
}

.tile .sub, .row-item .sub {
    display: block;
    color: var(--muted);
    font-size: 0.78em;
    margin-top: 6px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 4px;
}

.form {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 1em;
    font-family: inherit;
}

.search-page {
    max-width: none;
    width: 100%;
    min-height: calc(100vh - 72px);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 44px) clamp(22px, 5vw, 56px) 44px;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.06);
}

.search-title {
    margin: 0 0 28px;
    color: var(--text);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.search-back-btn {
    margin-bottom: 18px;
}

.search-input {
    height: 56px;
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: #000;
    color: var(--text);
    font-size: 1rem;
    padding: 0 24px;
}

.search-filter-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100%;
    margin: 20px 0 32px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.search-filter {
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 11px 16px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
}

.search-filter.active {
    background: rgba(255, 255, 255, 0.30);
}

.search-filter:focus,
.search-result-row:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 340px);
    overflow-y: auto;
    padding: 2px;
}

.search-result-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.search-result-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.10);
    color: var(--muted);
    font-size: 1.1em;
    font-weight: 900;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-result-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-name {
    font-size: 1rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-meta,
.search-empty {
    color: var(--muted);
    font-size: 0.86rem;
}

.search-empty {
    padding: 40px 4px;
    font-size: 1.2em;
}

.row-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn {
    padding: 12px 22px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95em;
    font-family: inherit;
    cursor: pointer;
}

.btn.primary {
    background: var(--primary);
    border-color: #ff1828;
    color: var(--on-primary);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 18px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.88em;
    cursor: pointer;
}

.tab.active {
    border-color: var(--primary);
    color: var(--primary);
}

.manage-categories-page {
    max-width: none;
    width: 100%;
    padding: 26px 42px 42px;
}

.manage-categories-top {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
}

.manage-back-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 1.25em;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
}

.manage-back-btn:focus,
.manage-bulk-btn:focus,
.manage-segment:focus,
.manage-category-row:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.manage-categories-title {
    margin: 0;
    text-align: center;
}

.manage-bulk-btn {
    min-width: 138px;
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 13px 20px;
    background: rgba(229, 9, 20, 0.10);
    color: #ff5f68;
    font-family: inherit;
    font-size: 0.92em;
    font-weight: 700;
    cursor: pointer;
}

.manage-segmented-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    max-width: 920px;
    margin: 0 auto 56px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.manage-segment {
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 12px 18px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
}

.manage-segment.active {
    background: rgba(255, 255, 255, 0.30);
    color: #ffffff;
}

.manage-category-card {
    width: 100%;
    max-width: 920px;
    max-height: calc(100vh - 270px);
    margin: 0 auto;
    padding: 22px 42px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.manage-category-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 2px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 1.08em;
    font-weight: 650;
    text-align: left;
    padding: 22px 0;
    cursor: pointer;
}

.manage-category-row:last-child {
    border-bottom-color: transparent;
}

.manage-category-row.is-hidden {
    color: var(--muted);
}

.manage-category-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-eye {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 22px;
    border: 3px solid #24c35a;
    border-radius: 50%;
}

.category-eye::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #24c35a;
    transform: translate(-50%, -50%);
}

.manage-category-row.is-hidden .category-eye {
    border-color: #6f737c;
    opacity: 0.6;
}

.manage-category-row.is-hidden .category-eye::before {
    background: #6f737c;
}

.manage-accounts-page {
    max-width: none;
    width: 100%;
    padding: 26px 42px 42px;
}

.manage-account-card {
    width: 100%;
    max-width: 980px;
    max-height: calc(100vh - 170px);
    margin: 0 auto;
    padding: 14px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.manage-account-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 18px 20px;
    cursor: pointer;
}

.manage-account-row + .manage-account-row {
    margin-top: 8px;
}

.manage-account-row.selected {
    background: rgba(229, 9, 20, 0.12);
}

.manage-account-row:focus,
.account-action:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.manage-account-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.manage-account-name {
    color: var(--text);
    font-size: 1.12em;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-account-sub {
    color: var(--muted);
    font-size: 0.82em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-account-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.account-action {
    min-width: 104px;
    padding: 10px 16px;
}

.account-action[disabled] {
    opacity: 0.7;
    cursor: default;
}

/* Current account: keep controls focusable for keyboard / TV remotes. */
.account-action.account-action-current {
    opacity: 0.85;
    cursor: default;
}

.account-info-card {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.08);
}

.account-info-row {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
    gap: 22px;
    padding: 17px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.account-info-row:last-of-type {
    border-bottom-color: transparent;
}

.account-info-label {
    color: var(--muted);
    font-size: 0.86em;
    font-weight: 750;
}

.account-info-value {
    color: var(--text);
    font-size: 0.96em;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.account-info-exp-green {
    color: #7ee787;
}

.account-info-exp-red {
    color: #ff6b6b;
}

.account-info-actions {
    margin-top: 22px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pill {
    font-size: 0.72em;
    padding: 4px 10px;
    border-radius: 999px;
    background: #21262d;
    color: var(--muted);
}

.pill.on { color: #7ee787; }
.pill.off { color: var(--muted); }
.pill.live { color: #79c0ff; }
.pill.movie { color: #d2a8ff; }
.pill.series { color: #7ee787; }

.empty {
    color: var(--muted);
    padding: 24px 8px;
}

.row-busy {
    padding: 18px 12px;
    color: var(--muted);
    font-size: 0.88em;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    background: #1e1e22;
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 10px;
    max-width: 80%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 250;
}

.toast.show {
    opacity: 1;
}

.loading {
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 13, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.player-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 200;
    display: block;
    overflow: hidden;
}

/* Video fills the entire layer */
.player-layer video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
    z-index: 1;
}

.player-close-btn {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 40;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(10, 10, 14, 0.78);
    color: #fff;
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    padding: 10px 18px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.player-layer.player-overlay-visible .player-close-btn,
.player-close-btn:focus {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.player-close-btn:hover,
.player-close-btn:focus {
    outline: none;
    border-color: #fff;
    background: rgba(229, 9, 20, 0.92);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.player-status-overlay {
    position: absolute;
    inset: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
}

.player-status-box {
    width: min(520px, 92vw);
    padding: 22px 24px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(10, 10, 14, 0.86);
    color: #fff;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
    pointer-events: auto;
}

.player-status-message {
    margin: 0 0 16px;
    font-size: 1rem;
    line-height: 1.45;
}

.player-status-action {
    min-width: 132px;
    min-height: 44px;
    border: 2px solid var(--primary);
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.player-status-action:focus,
.player-status-action:hover {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

/* Live-TV channel name overlay — shown only for live, hidden for VOD */
.player-title.live-only {
    position: absolute;
    top: 20px;
    left: 24px;
    z-index: 12;
    margin: 0;
    font-size: clamp(14px, 1.45vw, 20px);
    font-weight: 650;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
    pointer-events: none;
    background: rgba(0,0,0,0.45);
    padding: 7px 14px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    cursor: pointer;
    max-width: min(68vw, 560px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-layer.player-overlay-visible .player-title.live-only {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.player-title.live-only:hover,
.player-title.live-only:focus {
    outline: none;
    background: rgba(229, 9, 20, 0.82);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.player-title.live-only.hidden {
    display: none !important;
}

/* Kill full-bleed poster on :root during playback — inline styles from browse beat plain class rules. */
html.player-shell-open,
body.player-shell-open {
    background-color: #000 !important;
    background-image: none !important;
    background-size: auto !important;
    background-position: 0 0 !important;
    background-repeat: no-repeat !important;
}

/* Hide app UI during playback so the player layer is fully visible */
body.player-shell-open #app,
body.player-shell-open .backdrop-host {
    display: none !important;
}

/* Live hero preview: allow preview card to extend when open */
.hero-block.hero-live-preview-open,
.hero-block.hero-live-preview-open .hero-layout {
    overflow: visible;
}

.hero-block.hero-live-preview-open .hero-preview-panel {
    position: absolute;
    top: 12px;
    right: clamp(16px, 4vw, 48px);
    z-index: 60;
    display: block;
    width: min(42vw, 520px);
    max-width: min(520px, calc(100% - 96px));
}

.hero-block.hero-live-preview-open .hero-preview-card {
    overflow: hidden;
    min-height: 160px;
    max-height: calc(var(--hero-billboard-height) - 34px);
}

@media (max-width: 900px) {
    .hero-block.hero-live-preview-open .hero-preview-panel {
        top: 12px;
        right: 16px;
        bottom: auto;
        width: min(48vw, 340px);
        max-width: calc(100% - 32px);
    }

    .hero-block.hero-live-preview-open .hero-preview-card {
        min-height: 120px;
    }
}

/* .player-layer video rule is defined earlier with the .player-layer block */

.player-hud {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12;
    padding: 0 32px 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95) 72%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.player-hud.visible {
    opacity: 1;
    pointer-events: auto;
}

.player-title {
    margin: 0 0 20px;
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* ── Progress bar ── */
.player-progress-wrap {
    margin-bottom: 18px;
}

.player-progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: background 0.22s ease, border-color 0.22s ease;
}

.player-progress-bar:focus-visible,
.player-progress-bar.focused {
    outline: none;
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.player-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #ff7a7a 100%);
    border-radius: 999px;
    width: 0%;
    transition: width 0.18s linear;
}

.player-progress-thumb {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    border: 2px solid rgba(11, 11, 13, 0.95);
    transform: translate(-50%, -50%);
    left: 0%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.player-time-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
}

.player-time {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.82);
    font-variant-numeric: tabular-nums;
}

/* ── Controls row ── */
.player-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.player-ctrl-btn {
    padding: 12px 20px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: rgba(10, 10, 14, 0.72);
    backdrop-filter: blur(12px);
    color: #fff;
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.player-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-ctrl-btn:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.player-ctrl-play {
    min-width: 88px;
    min-height: 88px;
    border-radius: 22px;
    background: var(--primary);
    border-color: var(--primary);
    font-size: 32px;
}

.player-ctrl-play:hover {
    background: #ff1d22;
}

.player-ctrl-play:focus {
    background: #ff2030;
    border-color: #ff2030;
}

.player-ctrl-track {
    margin-left: auto;
}

.player-ctrl-track:first-of-type {
    margin-left: auto;
}

/* Track picker overlay */
.player-track-picker {
    position: fixed;
    bottom: 180px;
    right: 48px;
    min-width: min(320px, calc(var(--100vw) - 32px));
    max-height: 480px;
    overflow-y: auto;
    background: rgba(10,10,14,0.98);
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: 18px;
    padding: 16px 0;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.75);
    z-index: 99999;
}

.player-track-picker-title {
    padding: 8px 24px 14px;
    font-size: 24px;
    font-weight: 800;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.player-track-item {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 26px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.player-track-item:focus {
    outline: none;
    background: rgba(255,255,255,0.12);
}

.player-track-item.active {
    color: var(--primary);
}

.live-player-channel-drawer {
    position: absolute;
    left: 24px;
    top: 56px;
    width: min(360px, calc(var(--100vw) - 48px));
    height: min(68vh, 620px);
    max-height: calc(100vh - 96px);
    z-index: 260;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(5, 6, 10, 0.94);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.72);
    padding: 12px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.live-player-channel-title {
    flex: 0 0 auto;
    padding: 0 8px 10px;
    font-weight: 750;
    color: #fff;
    font-size: 16px;
    line-height: 1.1;
}

.live-player-channel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.live-player-channel-list::-webkit-scrollbar {
    display: none;
}

.live-player-channel-item {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0 0 6px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f7ff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 42px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-player-channel-item.current {
    color: #fff;
    border-color: rgba(229, 9, 20, 0.54);
}

.live-player-channel-item.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.search-bar .field {
    flex: 1;
}

/* ----- Auth & account picker (TV) -----
   Fill the shell explicitly — some TV WebViews collapse flex children to 0 height. */
.main.auth-flow {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 48px 48px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(155deg, rgba(30, 30, 34, 0.97) 0%, rgba(12, 12, 14, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    padding: 38px 42px 34px;
    box-shadow:
        0 32px 96px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.auth-card-form {
    max-width: 560px;
}

.auth-brand {
    margin: 0 0 10px;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--primary);
}

.auth-title {
    margin: 0 0 10px;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text);
}

.auth-sub {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 0.86em;
    line-height: 1.5;
    max-width: 44em;
}

.auth-empty {
    margin: 0 0 20px;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.25);
    color: #e8b4b8;
    font-size: 0.88em;
    line-height: 1.45;
}

.auth-account-list {
    gap: 12px;
    max-height: none;
}

.row-item.account-pick {
    padding: 18px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.02em;
    border-width: 2px;
}

.auth-form {
    gap: 18px;
    max-width: none;
}

.field-group .field {
    font-size: 0.95em;
}

.field:focus {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.45);
}

.auth-actions {
    margin-top: 12px;
    flex-direction: column;
    align-items: stretch;
}

.auth-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 16px 22px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 10px;
}

.btn-wide {
    min-width: 200px;
}

.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--muted);
}

.btn-ghost:focus {
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25);
}

/* ═══════════════════════════════════════════
   Series Detail Screen
   ═══════════════════════════════════════════ */

.sd-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
    overflow-y: auto;
}

/* ── Hero ── */
.sd-hero {
    position: relative;
    width: 100%;
    height: min(52vh, 480px);
    background: #0a0a0c;
    overflow: hidden;
    flex-shrink: 0;
}

.sd-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: saturate(1.08) brightness(0.72);
}

.sd-hero-fade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to top, var(--bg) 0%, rgba(11,11,13,0.55) 40%, transparent 72%),
        linear-gradient(to right, rgba(11,11,13,0.6) 0%, transparent 60%);
}

.sd-hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px 36px 28px;
    gap: 10px;
}

.sd-back-btn {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 12;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.12);
    color: var(--text);
    font-size: 1.6em;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: auto;
}

.sd-back-btn:hover,
.sd-back-btn:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.28);
}

.sd-title {
    margin: 0;
    font-size: clamp(1.4em, 3.2vw, 2.2em);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

/* ── Badges ── */
.sd-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sd-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(0,0,0,0.45);
    color: var(--text);
    font-size: 0.78em;
    font-weight: 600;
    white-space: nowrap;
}

.sd-badge-rating {
    border-color: #ffc107;
    color: #ffc107;
    background: rgba(255,193,7,0.12);
}

/* ── Body ── */
.sd-body {
    padding: 20px 36px 60px;
    max-width: 980px;
    width: 100%;
}

/* ── Play button ── */
.sd-play-btn {
    width: 100%;
    max-width: 680px;
    padding: 16px;
    font-size: 1.1em;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 6px;
}

.sd-play-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
}

/* ── Plot ── */
.sd-plot {
    margin: 0 0 12px;
    font-size: 0.92em;
    line-height: 1.55;
    color: rgba(255,255,255,0.82);
    max-width: 680px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Cast ── */
.sd-cast {
    margin: 0 0 24px;
    font-size: 0.88em;
    color: rgba(255,255,255,0.65);
    max-width: 680px;
}

.sd-cast-label {
    font-weight: 700;
    color: var(--text);
}

/* ── Season tabs ── */
.sd-season-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(255,255,255,0.12);
    margin-bottom: 8px;
    max-width: 680px;
    overflow-x: auto;
}

/* ── Bottom section: season tabs + episode row (new series detail layout) ── */
.sd-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 48px 36px;
    z-index: 2;
}

.sd-bottom .sd-season-tabs {
    max-width: none;
    border-bottom: 2px solid rgba(255,255,255,0.18);
    margin-bottom: 20px;
    padding-bottom: 4px;
}

.sd-bottom .sd-season-tab {
    padding: 10px 18px;
    font-size: 1rem;
}

.sd-bottom .row-track-wrap {
    margin: 0;
}

.sd-bottom .row-track {
    padding: 8px 0 16px;
    gap: 12px;
}

/* Episode cards in series detail — 16:9 aspect, wider than movie posters */
.sd-ep-card {
    width: clamp(190px, 18vw, 240px);
    flex-shrink: 0;
}

.sd-ep-card .poster-thumb {
    aspect-ratio: 16 / 9 !important;
}

.sd-ep-card .poster-title {
    font-size: 13px !important;
    min-height: 0;
    text-align: left;
    padding: 0 4px;
}

.sd-season-tab {
    padding: 12px 22px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: rgba(255,255,255,0.55);
    font-family: inherit;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
}

.sd-season-tab.active {
    color: #fff;
    border-bottom-color: var(--primary);
}

.sd-season-tab:focus {
    outline: none;
    color: #fff;
    background: rgba(255,255,255,0.07);
}

/* ── Episode list ── */
.sd-ep-list {
    max-width: 680px;
}

.sd-ep-row {
    display: grid;
    grid-template-columns: 32px 120px minmax(0,1fr) 24px;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 10px;
    background: transparent;
    border: 2px solid transparent;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.sd-ep-row:last-child {
    border-bottom-color: transparent;
}

.sd-ep-row:focus {
    outline: none;
    border-color: var(--focus-ring);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}

.sd-ep-num {
    color: rgba(255,255,255,0.45);
    font-size: 1em;
    font-weight: 700;
    text-align: center;
}

.sd-ep-thumb {
    display: block;
    width: 120px;
    height: 68px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sd-ep-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sd-ep-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.sd-ep-title {
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sd-ep-dur {
    font-size: 0.80em;
    color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
}

.sd-ep-chevron {
    color: rgba(255,255,255,0.35);
    font-size: 1.4em;
    font-weight: 300;
    text-align: center;
}

/* ── VOD track picker buttons (Audio / Subtitles) ── */
/* Float in the top-right corner, always visible over the video */
.vod-track-btns {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 20;
    display: flex;
    gap: 14px;
    pointer-events: auto;
    /* Subtle fade-in so it doesn't distract during normal playback */
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

/* Full opacity when a button inside is focused */
.vod-track-btns:focus-within {
    opacity: 1;
}

.vod-track-btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(10, 10, 14, 0.82);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: var(--font);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.vod-track-btn:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
    opacity: 1;
}

/* Small hint label at the bottom so user knows ▲ opens track controls */
.vod-track-btns::after {
    content: '▲ for tracks';
    position: absolute;
    bottom: -28px;
    right: 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    pointer-events: none;
}

/* Track picker overlay (shared by audio + subtitle pickers) */
.player-track-picker {
    position: absolute;
    top: 90px;
    right: 32px;
    min-width: min(320px, calc(var(--100vw) - 32px));
    max-height: 480px;
    overflow-y: auto;
    background: rgba(10, 10, 14, 0.98);
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    padding: 16px 0;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.75);
    z-index: 30;
}

.player-track-picker-title {
    padding: 8px 24px 14px;
    font-size: 22px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.player-track-item {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font);
    font-size: 24px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    pointer-events: auto;
}

.player-track-item:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}

.player-track-item.active {
    color: var(--primary);
}

/* ── Live TV buffering spinner ── */
.live-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 260;
    pointer-events: none;
}

.player-layer.player-loading video {
    opacity: 0.72;
}

.live-spinner.hidden {
    display: none !important;
}

.live-spinner-ring {
    width: 72px;
    height: 72px;
    border: 6px solid rgba(255, 255, 255, 0.18);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

/* ── Browse category loading spinner ── */
.browse-row-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 80px 0;
}

.browse-row-spinner-ring {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

/* ── VOD subtitle overlay — receives text from AVPlay onsubtitlechange ── */
.vod-subtitle-overlay {
    position: absolute;
    bottom: 120px;
    left: 5%;
    right: 5%;
    z-index: 25;
    text-align: center;
    font-size: 36px;
    font-weight: 600;
    color: #fff;
    text-shadow:
        -2px -2px 4px #000,
         2px -2px 4px #000,
        -2px  2px 4px #000,
         2px  2px 4px #000,
         0    4px 12px rgba(0,0,0,0.9);
    line-height: 1.4;
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Shaka UI container ── */
.shaka-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Hide Shaka's control bar for live TV — we use our own channel drawer */
.shaka-container.shaka-controls-hidden .shaka-controls-container {
    display: none !important;
}

/* Make Shaka controls larger for TV remote use */
.shaka-controls-container {
    font-size: 20px !important;
}

.shaka-controls-button-panel button,
.shaka-controls-button-panel .shaka-overflow-button {
    width: 56px !important;
    height: 56px !important;
    font-size: 22px !important;
}

.shaka-controls-button-panel button:focus,
.shaka-controls-button-panel .shaka-overflow-button:focus {
    outline: 3px solid #fff !important;
    outline-offset: 2px !important;
}

/* Larger seek bar for TV */
.shaka-seek-bar-container {
    height: 8px !important;
}

/* Overflow menu (language/captions/quality) — larger for TV */
.shaka-overflow-menu {
    font-size: 22px !important;
    min-width: 280px !important;
}

.shaka-overflow-menu button {
    padding: 16px 20px !important;
    font-size: 22px !important;
}

.shaka-overflow-menu button:focus {
    outline: 3px solid #fff !important;
    background: rgba(255,255,255,0.15) !important;
}

/* ══════════════════════════════════════════
   VOD Player HUD
   ══════════════════════════════════════════ */
.vod-hud {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 0 48px 36px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.55) 30%, rgba(0,0,0,0.92) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.vod-hud.visible {
    opacity: 1;
    pointer-events: auto;
}

.vod-hud-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Progress bar */
.vod-hud-progress {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
    outline: none;
}

.vod-hud-progress:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
}

.vod-hud-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary, #e50914);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s linear;
}

.vod-hud-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
    transition: left 0.5s linear;
}

/* Time row */
.vod-hud-time-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.vod-hud-time {
    font-size: 22px;
    color: rgba(255,255,255,0.85);
    font-variant-numeric: tabular-nums;
}

/* Controls row */
.vod-hud-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vod-hud-btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(10,10,14,0.75);
    color: #fff;
    font-family: var(--font);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.vod-hud-btn:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255,255,255,0.18);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
    transform: scale(1.06);
}

/* Play/pause is larger and centred */
.vod-hud-play {
    min-width: 80px;
    min-height: 80px;
    border-radius: 50%;
    font-size: 32px;
    background: var(--primary, #e50914);
    border-color: var(--primary, #e50914);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vod-hud-play:focus {
    background: #ff2030;
    border-color: #ff2030;
}

/* Push audio/subs to the right */
.vod-hud-track {
    margin-left: auto;
}

.vod-hud-track + .vod-hud-track {
    margin-left: 0;
}

/* ── Resume / Start-over dialog ── */
.resume-dialog-overlay {
    position: absolute;
    inset: 0;
    z-index: 8000;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
}
.resume-dialog {
    background: rgba(18, 18, 22, 0.98);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 48px 56px 44px;
    min-width: 560px;
    max-width: 780px;
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}

.resume-dialog-msg {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.3;
}

.resume-dialog-btns {
    display: flex;
    gap: 24px;
}

.resume-dialog-btn {
    padding: 20px 44px;
    font-size: 30px;
    font-weight: 700;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.resume-dialog-btn:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.resume-dialog-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.resume-dialog-btn-primary:focus {
    background: #ff2030;
    border-color: #ff2030;
}

/* Parental PIN dialogs (fixed overlay on top of app) */
.parental-pin-overlay-fixed {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.parental-pin-dialog-box {
    width: min(92vw, 640px);
}

.parental-pin-input {
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    font-size: 28px;
    letter-spacing: 0.25em;
    text-align: center;
    padding: 14px 18px;
}

.parental-pin-label {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    align-self: flex-start;
}

.parental-pin-error {
    margin: 0;
    min-height: 1.35em;
    font-size: 20px;
    font-weight: 600;
    color: #f87171;
    text-align: center;
}

/* Series detail TV refresh (match screenshot layout) */
.sd-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #09090b;
}

.sd-hero {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
}

.sd-hero-img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: saturate(1.04) brightness(0.78);
}

.sd-hero-fade {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.83) 33%, rgba(0, 0, 0, 0.56) 58%, rgba(0, 0, 0, 0.22) 78%, rgba(0, 0, 0, 0.06) 90%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.2) 52%, rgba(0, 0, 0, 0.86) 100%);
}

.sd-hero-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 58px 42px 176px;
}

.sd-top-row {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    width: min(1240px, 92vw);
}

.sd-thumb {
    width: 128px;
    height: 192px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    flex: 0 0 auto;
}

.sd-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sd-info {
    min-width: 0;
    max-width: min(780px, 68vw);
}

.sd-title {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 2.45vw, 42px);
    line-height: 1.08;
    font-weight: 800;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.65);
}

.sd-meta-line {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-episode-heading {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(17px, 1.65vw, 24px);
    line-height: 1.25;
    font-weight: 700;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.72);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sd-plot {
    margin: 7px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.45;
    max-width: min(780px, 68vw);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sd-body {
    position: absolute;
    left: 42px;
    width: 140px;
    bottom: 42px;
    z-index: 3;
    padding: 0;
    max-width: none;
}

.sd-actions {
    margin: 0;
}

.sd-play-btn {
    min-width: 104px;
    width: 104px;
    height: 76px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.24);
    background: rgba(41, 109, 244, 0.95);
    color: #fff;
    font-size: 38px;
    line-height: 1;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.sd-play-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.42);
    border-color: #fff;
}

.sd-bottom {
    position: absolute;
    left: 42px;
    right: 42px;
    bottom: 88px;
    z-index: 3;
    padding: 0;
}

.sd-bottom .row-track-wrap {
    margin: 0;
}

.sd-bottom .sd-season-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    border-bottom: none;
    overflow-x: auto;
}

.sd-bottom .sd-season-tab {
    min-width: 48px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid rgba(70, 120, 255, 0.6);
    background: rgba(41, 109, 244, 0.35);
    color: #fff;
    padding: 0 14px;
    margin: 0;
    font-size: 14px;
    font-weight: 800;
}

.sd-bottom .sd-season-tab.active {
    background: rgba(41, 109, 244, 0.95);
    border-color: rgba(255, 255, 255, 0.58);
}

.sd-bottom .sd-season-tab:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.sd-bottom .row-track {
    gap: 10px;
    padding: 0 0 10px;
}

.sd-ep-card {
    width: 124px;
    background: transparent;
}

.sd-ep-card .poster-thumb {
    border-radius: 10px;
    aspect-ratio: 2 / 3 !important;
}

.sd-ep-card .poster-title {
    text-align: center;
    font-size: 12px !important;
    line-height: 1.14;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.94);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.sd-ep-card .poster-badge {
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 6px;
}

.sd-season-card {
    background: transparent;
    padding: 0;
    color: #fff;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
}

.sd-season-card .poster-thumb {
    border-radius: 10px;
    aspect-ratio: 2 / 3 !important;
}

.sd-season-card .poster-title {
    text-align: center;
    font-size: 12px !important;
    line-height: 1.14;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.sd-season-card .poster-badge {
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 6px;
}

.sd-season-card:focus {
    outline: none;
    border-color: #fff;
}

/* Netflix-like series details: hero + season tabs + vertical episode list */
.sd-wrap {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
}

.sd-hero {
    position: relative;
    height: min(52vh, 460px);
    min-height: 330px;
}

.sd-hero-content {
    padding: 62px clamp(32px, 5vw, 64px) 96px;
    align-items: flex-end;
}

.sd-top-row {
    width: min(1120px, 100%);
    align-items: flex-end;
}

.sd-thumb {
    width: clamp(110px, 11vw, 150px);
    height: auto;
    aspect-ratio: 2 / 3;
}

.sd-info {
    max-width: min(760px, 72vw);
}

.sd-title {
    font-size: clamp(2rem, 3.2vw, 3.4rem);
}

.sd-meta-line {
    white-space: normal;
}

.sd-episode-heading {
    font-size: clamp(1.05rem, 1.55vw, 1.45rem);
}

.sd-plot {
    font-size: clamp(0.92rem, 1vw, 1.05rem);
    max-width: min(760px, 72vw);
    -webkit-line-clamp: 3;
}

.sd-body {
    display: none;
}

.sd-bottom {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: min(1100px, calc(100% - 64px));
    margin: -58px auto 48px;
    padding: 0;
    z-index: 5;
}

.sd-section-title {
    margin: 0 0 16px;
    font-size: clamp(1.25rem, 1.9vw, 1.75rem);
    line-height: 1.2;
    color: #fff;
}

.sd-bottom .sd-season-tabs {
    gap: 10px;
    margin: 0 0 18px;
    padding: 0 0 4px;
    border: 0;
}

.sd-bottom .sd-season-tab {
    min-width: 0;
    height: 36px;
    padding: 0 16px;
    border-radius: 4px;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
}

.sd-bottom .sd-season-tab.active {
    background: #fff;
    border-color: #fff;
    color: #111;
}

.sd-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sd-episode-row {
    display: grid;
    grid-template-columns: 34px minmax(120px, 168px) minmax(0, 1fr) 38px;
    gap: 16px;
    align-items: center;
    width: 100%;
    min-height: 112px;
    padding: 14px 10px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sd-episode-row:hover,
.sd-episode-row:focus,
.sd-episode-row.selected {
    outline: none;
    background: rgba(255, 255, 255, 0.09);
}

.sd-episode-number {
    color: rgba(255, 255, 255, 0.58);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.sd-episode-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.sd-episode-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sd-episode-copy {
    min-width: 0;
}

.sd-episode-title-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: baseline;
    margin-bottom: 6px;
}

.sd-episode-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 750;
}

.sd-episode-duration {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.86rem;
}

.sd-episode-desc {
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.88rem;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sd-episode-play {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.8rem;
}

/* ══════════════════════════════════════════
   Browser responsive polish
   ══════════════════════════════════════════ */
@media (hover: hover) and (pointer: fine) {
    * {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
    }

    *::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    *::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.22);
        border-radius: 999px;
    }

    *::-webkit-scrollbar-track {
        background: transparent;
    }

    .poster:hover,
    .tile:hover,
    .row-item:hover,
    .btn:hover,
    .vd-btn:hover,
    .sd-season-tab:hover {
        border-color: rgba(255, 255, 255, 0.34);
        transform: translateY(-2px);
    }

    .poster:hover {
        box-shadow: 0 16px 42px rgba(0, 0, 0, 0.48);
    }
}

@supports (height: 100svh) {
    .main.auth-flow {
        position: relative;
        inset: auto;
        min-height: 100svh;
    }
}

@media (min-width: 1180px) {
    :root {
        --poster-w-movie: clamp(142px, 10vw, 180px);
        --poster-w-live: clamp(180px, 12.5vw, 220px);
        --poster-title-font: 13px;
        --hero-billboard-height: min(520px, 46vh);
    }

    html,
    body {
        font-size: 15px;
    }

    .header-surface,
    .hero-block,
    .chips-host,
    .browse-scroll {
        padding-left: clamp(24px, 4vw, 64px);
        padding-right: clamp(24px, 4vw, 64px);
    }

    .header-surface {
        padding-top: 14px;
        padding-bottom: 12px;
    }

    .hero-preview-panel {
        max-width: min(42vw, 680px);
    }

    .content-row {
        margin-bottom: 20px;
    }
}

@media (max-width: 1179px) {
    :root {
        --poster-w-movie: clamp(126px, 18vw, 158px);
        --poster-w-live: clamp(160px, 27vw, 205px);
        --poster-title-font: 13px;
        --hero-billboard-height: auto;
    }

    html,
    body {
        font-size: 14px;
    }

    .app-root {
        min-height: 100svh;
    }

    .header-surface {
        gap: 12px;
        padding: 12px clamp(14px, 3vw, 28px);
    }

    .header-left {
        width: 100%;
        gap: 12px;
    }

    .nav-modes {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .nav-tab.mode {
        min-height: 38px;
        padding: 7px 13px;
        font-size: 0.9rem;
        flex: 0 0 auto;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
        flex: 0 0 auto;
    }

    .header-icon {
        width: 22px;
        height: 22px;
    }

    .hero-block {
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 12px clamp(16px, 4vw, 28px) 18px;
        pointer-events: auto;
    }

    .hero-layout {
        flex-direction: column;
        gap: 16px;
        overflow: visible;
    }

    .hero-copy-block {
        max-width: 100%;
        overflow: visible;
    }

    .hero-title {
        font-size: clamp(1.7rem, 5vw, 2.65rem);
        letter-spacing: 0;
    }

    .hero-meta {
        white-space: normal;
    }

    .hero-plot {
        -webkit-line-clamp: 4;
    }

    .hero-preview-panel {
        max-width: min(100%, 680px);
    }

    .vd-wrap {
        height: auto;
        min-height: 100svh;
        overflow-y: auto;
    }

    .vd-bg {
        position: fixed;
        inset: 0;
    }

    .vd-panel {
        position: relative;
        width: min(760px, 88vw);
        min-height: 100svh;
        padding: 72px clamp(18px, 5vw, 46px) 34px;
    }

    .vd-top-row {
        gap: 22px;
        margin-bottom: 26px;
    }

    .vd-thumb {
        width: clamp(150px, 23vw, 210px);
    }

    .vd-title-block {
        padding-left: 24px;
        gap: 12px;
    }

    .vd-title {
        font-size: clamp(2rem, 4.6vw, 2.75rem);
    }

    .vd-badge,
    .vd-badge-genre,
    .vd-info-line {
        font-size: 1rem;
    }

    .vd-section-label {
        font-size: 1.25rem;
    }

    .vd-section-text {
        font-size: 1rem;
    }

    .chips-host {
        padding: 0 clamp(12px, 3vw, 26px) 10px;
    }

    #chipsScroll button.chip,
    .chips-scroll button.chip {
        min-height: 34px;
        padding: 7px 13px;
        font-size: 0.88rem !important;
    }

    .main {
        overflow: visible;
    }

    .browse-scroll {
        padding: 0 clamp(12px, 3vw, 26px) 36px;
        overflow-y: visible;
    }

    .app-root.browse-backdrop .main.browse-main {
        overflow: hidden;
    }

    .app-root.browse-backdrop .browse-scroll {
        overflow-y: auto;
    }

    .row-track-wrap {
        margin: 0 calc(clamp(12px, 3vw, 26px) * -1);
    }

    .row-track {
        gap: 10px;
        padding-left: clamp(12px, 3vw, 26px);
        padding-right: clamp(12px, 3vw, 26px);
        scroll-snap-type: x proximity;
    }

    .row-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--poster-w-movie), 1fr));
        gap: 16px 12px;
        padding-left: 0;
        padding-right: 0;
    }

    .poster {
        border-width: 2px;
        scroll-snap-align: start;
    }

    .poster:focus {
        transform: scale(1.025);
    }

    .panel-page,
    .manage-categories-page,
    .manage-accounts-page {
        padding: 22px clamp(16px, 4vw, 32px) 36px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
        max-height: none;
    }

    .list,
    .live-channels-list,
    .search-results {
        max-height: none;
    }

    .search-page {
        min-height: auto;
        padding: 26px clamp(16px, 4vw, 32px) 36px;
        border-radius: 0;
        background: transparent;
    }

    .search-title {
        font-size: clamp(2rem, 7vw, 3.25rem);
        letter-spacing: 0;
    }

    .search-input {
        height: 56px;
        font-size: 1.05rem;
    }

    .search-filter-tabs {
        display: flex;
        overflow-x: auto;
        border-radius: 14px;
    }

    .search-filter {
        flex: 1 0 auto;
        padding: 11px 16px;
        font-size: 0.95rem;
    }

    .search-result-row {
        gap: 14px;
        padding: 12px 14px;
    }

    .search-result-thumb {
        width: 68px;
        height: 68px;
        border-radius: 10px;
    }

    .search-result-name {
        font-size: 1rem;
    }

    .search-result-meta,
    .search-empty {
        font-size: 0.9rem;
    }

    .live-channels-layout {
        grid-template-columns: 1fr;
    }

    .epg-panel {
        max-height: none;
    }

    .epg-body {
        max-height: none;
    }

    .manage-categories-top {
        grid-template-columns: 48px 1fr auto;
        gap: 10px;
    }

    .manage-back-btn {
        width: 46px;
        height: 46px;
    }

    .manage-segmented-tabs {
        margin-bottom: 24px;
    }

    .manage-category-card,
    .manage-account-card,
    .account-info-card {
        max-height: none;
        border-radius: 14px;
        padding: 14px;
    }

    .manage-account-row {
        grid-template-columns: 1fr;
    }

    .manage-account-actions {
        flex-wrap: wrap;
    }

    .account-info-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (max-width: 760px) {
    :root {
        --poster-w-movie: min(34vw, 128px);
        --poster-w-live: min(58vw, 190px);
        --poster-title-font: 12px;
        --browse-category-heading-font: 0.92rem;
    }

    /* iOS Safari zooms focused inputs when font-size is under 16px. */
    .field,
    .search-input,
    textarea.field,
    select.field {
        font-size: 16px;
    }

    .backdrop-host {
        display: none;
    }

    .app-root,
    .app-root.browse-backdrop {
        background: var(--bg);
        background-image: none;
        height: auto;
        min-height: 100svh;
        overflow: visible;
    }

    .app-root.browse-backdrop {
        height: 100svh;
        min-height: 100svh;
        overflow: hidden;
    }

    .app-root.browse-backdrop .main.browse-main {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        padding-bottom: 0;
    }

    .app-root.browse-backdrop .app-header::before {
        display: none;
    }

    .header-surface {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: max(10px, env(safe-area-inset-top)) 16px 8px;
    }

    .header-left {
        order: 2;
        width: 100%;
        min-width: 0;
    }

    .header-right {
        order: 1;
        justify-self: end;
        width: auto;
        max-width: calc(var(--100vw) - 44px);
        gap: 9px;
        padding: 6px 12px;
        overflow: visible;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.035);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
    }

    .nav-modes {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        padding: 0;
        overflow: visible;
    }

    .nav-tab.mode {
        width: 100%;
        min-height: 48px;
        padding: 9px 8px;
        border-radius: 8px;
        background: transparent;
        color: rgba(255, 255, 255, 0.58);
        font-size: clamp(0.98rem, 3.5vw, 1.16rem);
        font-weight: 800;
        text-align: center;
    }

    .nav-tab.mode.active {
        background: #df2924;
        color: #fff;
    }

    .nav-tab.mode:hover,
    .nav-tab.mode:focus {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .nav-tab.mode.active:hover,
    .nav-tab.mode.active:focus {
        background: #df2924;
        color: #fff;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
        background: transparent;
        color: #fff;
    }

    .icon-btn:hover,
    .icon-btn:focus {
        background: rgba(255, 255, 255, 0.08);
    }

    .header-icon {
        width: 26px;
        height: 26px;
        stroke-width: 2.35;
    }

    .hero-block,
    .hero-block.hero-live-preview-open,
    .hero-block.hero-live-preview-open .hero-layout {
        display: none;
        height: 0;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }

    .chips-host {
        padding-top: 5px;
        padding-bottom: 6px;
        background: var(--bg);
    }

    .browse-scroll {
        padding-top: 2px;
        overflow-y: visible;
    }

    .app-root.browse-backdrop .browse-scroll {
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: max(28px, env(safe-area-inset-bottom));
    }

    .row-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--poster-w-movie), 1fr));
        gap: 14px 10px;
    }

    .hero-preview-panel {
        display: none;
    }

    .hero-live-epg {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .row-label {
        margin-left: 2px;
        margin-bottom: 8px;
    }

    .poster-title {
        margin-top: 6px;
        line-height: 1.2;
    }

    .poster-action {
        opacity: 1;
        transform: none;
        min-height: 32px;
    }

    .panel-page.live-channels-page .live-channels-list .row-item.live-channel-row {
        gap: 10px;
        padding: 8px 4px;
    }

    .panel-page.live-channels-page .live-channels-list .live-channel-thumb {
        width: 44px;
        height: 44px;
    }

    .panel-page.live-channels-page .live-channels-list .live-channel-name {
        font-size: 1rem !important;
    }

    .auth-card {
        max-width: none;
        border-radius: 14px;
        padding: 28px 20px 24px;
    }

    .main.auth-flow {
        justify-content: flex-start;
        padding: max(22px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
    }

    .auth-brand {
        letter-spacing: 0.22em;
    }

    .auth-title {
        font-size: 1.55rem;
    }

    .row-actions {
        flex-direction: column;
    }

    .row-actions .btn,
    .btn-wide {
        width: 100%;
    }

    .vd-wrap,
    .sd-wrap {
        height: auto;
        min-height: 100svh;
        overflow-y: auto;
    }

    .vd-bg,
    .sd-hero {
        position: fixed;
        inset: 0;
        min-height: 100svh;
    }

    .vd-bg-scrim,
    .sd-hero-fade {
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.86) 36%, #09090b 86%);
    }

    .vd-panel {
        position: relative;
        width: 100%;
        min-height: 100svh;
        padding: 72px 18px 32px;
    }

    .vd-top-row,
    .sd-top-row {
        flex-direction: column;
        gap: 18px;
        width: 100%;
    }

    .vd-thumb,
    .sd-thumb {
        width: min(38vw, 150px);
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .vd-title-block {
        padding: 0;
        border-left: 0;
        gap: 12px;
    }

    .vd-title {
        font-size: clamp(2rem, 9vw, 3rem);
        letter-spacing: 0;
    }

    .vd-badge,
    .vd-badge-genre,
    .vd-info-line,
    .vd-section-label,
    .vd-section-text {
        font-size: 1rem;
    }

    .vd-actions {
        margin-top: 22px;
        gap: 12px;
    }

    .vd-btn {
        width: 100%;
        min-width: 0;
        padding: 15px 18px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .sd-hero-content {
        position: relative;
        padding: 66px 16px 210px;
    }

    .sd-info {
        max-width: 100%;
    }

    .sd-title {
        font-size: clamp(1.55rem, 7vw, 2.25rem);
        letter-spacing: 0;
    }

    .sd-meta-line {
        white-space: normal;
        font-size: 0.95rem;
    }

    .sd-episode-heading {
        font-size: 1rem;
    }

    .sd-plot {
        max-width: 100%;
        font-size: 0.86rem;
        -webkit-line-clamp: 4;
    }

    .sd-bottom {
        left: 0;
        right: 0;
        bottom: 14px;
        padding: 0 0 0 16px;
    }

    .sd-bottom .sd-season-tabs {
        padding-right: 18px;
    }

    .sd-bottom .sd-season-tab {
        min-width: 42px;
        height: 32px;
        padding: 0 12px;
        font-size: 0.78rem;
    }

    .sd-bottom .row-track {
        padding-right: 18px;
    }

    .sd-ep-card {
        width: min(32vw, 118px);
    }

    .sd-ep-card .poster-title,
    .sd-season-card .poster-title {
        font-size: 11px !important;
    }

    .sd-back-btn {
        top: max(12px, env(safe-area-inset-top));
        left: 14px;
        width: 44px;
        height: 44px;
    }

    .resume-dialog {
        width: calc(var(--100vw) - 32px);
        min-width: 0;
        padding: 26px 18px;
        gap: 22px;
    }

    .resume-dialog-msg {
        font-size: 1.25rem;
    }

    .resume-dialog-btns {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .resume-dialog-btn {
        width: 100%;
        padding: 14px 18px;
        font-size: 1rem;
    }

    .vod-hud,
    .player-hud {
        padding: 0 16px max(18px, env(safe-area-inset-bottom));
    }

    .player-close-btn {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
        padding: 8px 13px;
        font-size: 0.9rem;
    }

    .player-status-overlay {
        align-items: flex-end;
        padding: 16px 16px max(88px, env(safe-area-inset-bottom));
    }

    .vod-hud-controls,
    .player-controls {
        gap: 10px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .vod-hud-btn,
    .player-ctrl-btn,
    .vod-track-btn,
    .player-track-item {
        font-size: 0.95rem;
        padding: 10px 14px;
    }

    .vod-hud-play,
    .player-ctrl-play {
        min-width: 54px;
        min-height: 54px;
        font-size: 1.3rem;
    }

    .player-track-picker {
        left: 16px;
        right: 16px;
        top: 76px;
        min-width: 0;
        max-height: min(64vh, 420px);
    }

    .player-title.live-only {
        top: max(12px, env(safe-area-inset-top));
        left: 12px;
        font-size: 13px;
        max-width: calc(var(--100vw) - 24px);
        padding: 6px 10px;
        border-radius: 7px;
    }

    .live-player-channel-drawer {
        left: 10px;
        right: auto;
        top: 52px;
        width: min(78vw, 300px);
        height: min(56svh, 440px);
        max-height: calc(100svh - 72px);
        border-radius: 12px;
        padding: 10px 8px;
    }

    .live-player-channel-title {
        font-size: 14px;
        padding: 0 7px 8px;
    }

    .live-player-channel-item {
        height: 42px;
        line-height: 40px;
        font-size: 13px;
        border-radius: 8px;
        margin-bottom: 5px;
        padding: 0 10px;
    }
}

@media (hover: none) and (pointer: coarse) and (max-width: 980px) {
    .backdrop-host {
        display: none;
    }

    .app-root,
    .app-root.browse-backdrop {
        background: var(--bg);
        background-image: none;
        height: auto;
        min-height: 100svh;
        overflow: visible;
    }

    .app-root.browse-backdrop {
        height: 100svh;
        min-height: 100svh;
        overflow: hidden;
    }

    .app-root.browse-backdrop .app-header::before {
        display: none;
    }

    .hero-block,
    .hero-block.hero-live-preview-open,
    .hero-block.hero-live-preview-open .hero-layout {
        display: none;
        height: 0;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }

    .app-root.browse-backdrop .main.browse-main {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        padding-bottom: 0;
    }

    .app-root.browse-backdrop .browse-scroll {
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: max(28px, env(safe-area-inset-bottom));
    }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-width: 980px) {
    .header-surface {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
    }

    .header-left {
        order: 1;
        width: auto;
        min-width: 0;
    }

    .header-right {
        order: 2;
        justify-self: end;
        width: auto;
        max-width: 42vw;
        gap: 6px;
        padding: 5px 8px;
    }

    .nav-modes {
        display: flex;
        width: auto;
        min-width: 0;
        gap: 7px;
        overflow-x: auto;
    }

    .nav-tab.mode {
        flex: 0 0 auto;
        width: auto;
        min-height: 34px;
        padding: 6px 12px;
        font-size: 0.86rem;
    }

    .icon-btn {
        width: 30px;
        height: 30px;
    }

    .header-icon {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 760px) {
    .sd-wrap {
        height: auto;
        min-height: 100svh;
        overflow-y: auto;
    }

    .sd-hero {
        position: relative;
        min-height: 360px;
        height: auto;
    }

    .sd-hero-content {
        position: relative;
        padding: 62px 16px 84px;
    }

    .sd-top-row {
        flex-direction: row;
        align-items: flex-end;
        gap: 14px;
    }

    .sd-thumb {
        width: 94px;
    }

    .sd-info {
        max-width: calc(100% - 108px);
    }

    .sd-title {
        font-size: clamp(1.45rem, 7vw, 2.1rem);
    }

    .sd-meta-line,
    .sd-plot {
        font-size: 0.82rem;
    }

    .sd-episode-heading {
        font-size: 0.95rem;
    }

    .sd-bottom {
        width: calc(100% - 24px);
        margin: -52px auto 32px;
    }

    .sd-section-title {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }

    .sd-bottom .sd-season-tabs {
        margin-bottom: 12px;
    }

    .sd-bottom .sd-season-tab {
        height: 32px;
        padding: 0 12px;
        font-size: 0.78rem;
    }

    .sd-episode-row {
        grid-template-columns: 24px 112px minmax(0, 1fr);
        gap: 10px;
        min-height: 92px;
        padding: 10px 4px;
    }

    .sd-episode-play {
        display: none;
    }

    .sd-episode-title-row {
        display: block;
        margin-bottom: 4px;
    }

    .sd-episode-title {
        display: block;
        font-size: 0.86rem;
    }

    .sd-episode-duration {
        display: block;
        margin-top: 2px;
        font-size: 0.72rem;
    }

    .sd-episode-desc {
        font-size: 0.74rem;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 420px) {
    :root {
        --poster-w-movie: min(33vw, 118px);
        --poster-w-live: min(56vw, 178px);
    }

    .header-surface {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-right {
        max-width: calc(var(--100vw) - 24px);
        gap: 7px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
    }

    .header-icon {
        width: 24px;
        height: 24px;
    }

    .nav-modes {
        gap: 10px;
    }

    .nav-tab.mode {
        min-height: 44px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .search-filter-tabs,
    .manage-segmented-tabs {
        display: flex;
        overflow-x: auto;
    }

    .manage-segment {
        flex: 1 0 auto;
    }

    .manage-categories-top {
        grid-template-columns: 44px 1fr;
    }

    .manage-categories-top .manage-bulk-btn,
    .manage-categories-top .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}
