/* Cinema downstream: touch browser layout; TV and desktop unchanged. */
html,body{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media (max-width:800px) and (pointer:coarse), (max-width:600px){
:root{
 --tv-safe-gutter:16px!important;--tv-safe-gutter-wide:20px!important;
 --tv-card-radius:10px!important;--tv-card-gap:10px!important;
 --tv-button-height:46px!important;--tv-button-padding-x:14px!important;
 --tv-control-size:44px!important;--tv-control-icon-size:22px!important;
 --tv-caption-text:12px!important;--tv-secondary-text:14px!important;
 --tv-body-text:16px!important;--tv-subtitle-text:20px!important;--tv-title-text:28px!important;
}
html,body{width:100%;height:100%;font-size:16px!important;overflow:hidden}
#app,.screen{width:100%!important;height:100vh!important;height:100dvh!important;max-width:100%;overflow-x:hidden}
.screen:not(#player){overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
#account .qr-layout{position:relative!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:20px!important;width:100%!important;height:auto!important;min-height:100%;max-width:100%!important;padding:56px 18px 24px!important;padding-bottom:max(24px,env(safe-area-inset-bottom))!important;overflow:visible!important}
#account .qr-left-panel,#account .qr-card-panel,#account .qr-card,#account .qr-copy-block{position:relative!important;inset:auto!important;flex:none!important;width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;max-height:none!important;transform:none!important}
#account .qr-left-panel{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:12px!important;padding:0!important;text-align:left!important}
#account .qr-brand-lockup{width:auto!important;max-width:180px!important;margin:0!important}
#account .qr-logo{width:140px!important;height:auto!important;max-height:44px!important;object-fit:contain}
#account .qr-title{font-size:30px!important;line-height:1.12!important;letter-spacing:-.03em!important;margin:8px 0!important;text-align:left!important}
#account .qr-description,#account .qr-card-subtitle,#account .qr-login-instruction{font-size:15px!important;line-height:1.45!important;white-space:normal!important;overflow-wrap:anywhere;text-align:left!important;margin:8px 0!important}
#account .qr-card-panel{display:block!important;padding:0!important}
#account .qr-card{padding:18px!important;border-radius:16px!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:12px!important;text-align:left!important;overflow:visible!important}
#account .qr-card-title{font-size:23px!important;line-height:1.2!important;margin:0!important;text-align:left!important}
#account .qr-email-form,#account .qr-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;width:100%!important;gap:10px!important;margin:0!important}
#account .qr-auth-input,#account .qr-action-btn{width:100%!important;max-width:100%!important;min-height:48px!important;height:auto!important;padding:12px!important;font-size:16px!important;white-space:normal!important;line-height:1.3!important;transform:none!important}
#account .qr-input-label,#account .qr-terms,#account .qr-terms-link,#account .qr-status,#account .qr-code-text,#account .qr-manual-text,#account .qr-expiry{font-size:14px!important;line-height:1.4!important;overflow-wrap:anywhere}
#account .qr-code-frame{align-self:center;width:min(220px,100%)!important;height:auto!important;aspect-ratio:1}
#account .qr-code-frame img,#account .qr-code-frame canvas,#account .qr-code-frame svg{max-width:100%!important;height:auto!important}
#account .qr-server-menu-trigger{position:absolute!important;top:8px!important;left:auto!important;right:16px!important;width:44px!important;height:44px!important;font-size:24px!important;z-index:10}
#account .qr-server-menu{position:absolute!important;top:56px!important;right:16px!important;left:auto!important;width:min(300px,calc(100% - 32px))!important;max-width:100%!important;font-size:15px!important;z-index:20}
#account .qr-server-menu-item{white-space:normal!important;font-size:15px!important;min-height:44px!important}
#app :is(input,textarea,select){font-size:16px!important;max-width:100%}
#app :is(button,[role=button]){touch-action:manipulation;white-space:normal}
#app :is(.home-shell,.home-screen-shell){max-width:100%;min-width:0}
#app :is(.home-main,.home-screen-main,.home-route-content){min-width:0!important;max-width:100%!important}
#app :is(.home-main,.home-screen-main){overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch}
#app :is(.poster-card,.home-poster-card){max-width:42vw}
#app :is(.home-row-track,.modern-row-track,.catalog-row,.poster-row){overflow-x:auto!important;touch-action:pan-x pan-y;scrollbar-width:none}
#app .focused{scroll-margin:12px}
[role=dialog],.settings-dialog,.app-update-dialog{max-width:calc(100vw - 28px)!important;max-height:calc(100dvh - 36px)!important;overflow-y:auto!important;overflow-x:hidden!important;overflow-wrap:anywhere;font-size:16px!important}
[role=dialog] :is(h1,h2,h3),.settings-dialog-title{font-size:22px!important;line-height:1.2!important}
[role=dialog] :is(button,p,input),.settings-dialog-option,.settings-text-dialog-message{font-size:16px!important;line-height:1.4!important;white-space:normal!important}
#player video{max-width:100%;max-height:100%;object-fit:contain}
}

/* Hide the placeholder while a pairing code is being requested or retried. */
#account .qr-code-frame:empty,
#account .qr-manual-text:empty,
#account .qr-code-text:empty,
#account .qr-expiry:empty {
  display: none;
}

#account .cinema-pair-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 8px auto 0;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
  color: inherit;
}

#account .cinema-pair-link:focus-visible {
  outline: 2px solid currentColor !important;
  outline-offset: 2px;
}

@media (max-width: 800px) and (pointer: coarse), (max-width: 600px) {
  #account .qr-layout {
    gap: 12px !important;
    padding-top: 20px !important;
  }

  #account .qr-title { font-size: 25px !important; }
  #account .qr-login-instruction { display: none; }
  #account .qr-card { padding: 14px !important; gap: 8px !important; }
  #account .qr-code-frame { width: min(170px, 100%) !important; min-height: 0 !important; }
  #account .qr-code-frame .qr-image { display: block; width: 100%; object-fit: contain; }
  #account .qr-status { padding: 8px 10px; }

  #profileSelection .profile-screen {
    height: 100%;
    width: 100%;
    overflow-y: auto;
  }

  #profileSelection .profile-main-layer {
    height: auto;
    min-height: 100%;
    padding: clamp(22px, 6vh, 52px) 16px 24px;
  }

  #profileSelection .profile-logo { width: 148px; height: auto; max-height: 42px; object-fit: contain; }
  #profileSelection .profile-title { font-size: clamp(25px, 8vw, 40px); margin-top: 16px; }
  #profileSelection .profile-subtitle { font-size: 15px; margin: 8px 0 0; }
  #profileSelection .profile-grid {
    justify-content: center;
    gap: 12px;
    min-height: 0;
    margin-top: 24px;
    flex-wrap: wrap;
  }

  #profileSelection .profile-card { width: min(128px, 40vw); padding: 8px 4px; }
  #profileSelection .profile-card .profile-avatar-ring { width: 76px; height: 76px; margin: 4px auto; border-width: 2px; }
  #profileSelection .profile-card .profile-avatar { width: 64px; height: 64px; font-size: 30px; }
  #profileSelection .profile-avatar-add::before { width: 24px; height: 3px; }
  #profileSelection .profile-avatar-add::after { width: 3px; height: 24px; }
  #profileSelection .profile-card .profile-name { font-size: 15px; margin: 8px 0 0; }
  #profileSelection .profile-card :is(.profile-badge, .profile-badge-slot) { font-size: 11px; min-height: 0; margin-top: 4px; }
  #profileSelection .profile-card .profile-primary-dot { width: 24px; height: 24px; font-size: 13px; border-width: 2px; }

  #app .experience-mode-screen {
    min-height: 100%;
    width: 100%;
    padding: clamp(22px, 6vh, 52px) 16px 24px;
  }

  #app .experience-mode-logo { width: 116px; margin-bottom: 18px; }
  #app .experience-mode-screen h1 { font-size: clamp(25px, 8vw, 38px); }
  #app .experience-mode-screen > p { font-size: 15px; line-height: 1.45; }
  #app .experience-mode-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 440px);
    gap: 10px;
    margin-top: 20px;
  }

  #app .experience-mode-card { padding: 14px; }
  #app .experience-mode-card strong { font-size: 17px; }
  #app .experience-mode-card span { font-size: 14px; }

  #app .home-shell {
    --legacy-sidebar-rail-width: 52px;
    --legacy-sidebar-open-width: min(216px, 76vw);
    --legacy-sidebar-item-width: 44px;
    --legacy-sidebar-item-expanded-width: min(194px, 68vw);
    --legacy-sidebar-item-height: 46px;
    --legacy-sidebar-padding: 4px;
    --legacy-sidebar-item-gap: 6px;
    --legacy-sidebar-profile-top-gap: 12px;
    --legacy-sidebar-profile-bottom-gap: 8px;
    --legacy-sidebar-leading-offset: 9px;
    --legacy-sidebar-label-start: 36px;
    --legacy-sidebar-label-end: 8px;
    --legacy-sidebar-focus-scale: 1;
    --sidebar-icon-size: 22px;
    --modern-sidebar-collapsed-width: 54px;
    --modern-sidebar-open-width: min(226px, 79vw);
    --modern-sidebar-surface-width: min(212px, 74vw);
    --modern-sidebar-surface-top: 8px;
    --modern-sidebar-surface-left: 4px;
    --modern-sidebar-panel-padding-x: 8px;
    --modern-sidebar-panel-padding-y: 8px;
    --modern-sidebar-button-height: 44px;
    --modern-sidebar-button-gap: 8px;
    --modern-sidebar-list-gap: 4px;
    --modern-sidebar-pill-top: 8px;
    --modern-sidebar-pill-left: 4px;
    --modern-sidebar-pill-height: 44px;
    --modern-sidebar-pill-chevron-width: 8px;
    --modern-sidebar-pill-chevron-height: 16px;
    --modern-sidebar-pill-chip-gap: 4px;
    height: 100%;
  }

  #app .home-sidebar,
  #app .home-main { height: 100%; }
  #app .home-sidebar .home-nav-label { font-size: 15px; line-height: 1.2; }
  #app .home-profile-pill { padding-left: 12px; }
  #app .modern-sidebar-profile { margin: 4px auto 8px; padding: 6px; gap: 8px; }
  #app .modern-sidebar-profile-avatar { width: 30px; height: 30px; font-size: 15px; }
  #app .modern-sidebar-nav-list { transform: none; }
  #app .modern-sidebar-nav-item { padding: 4px 6px; }
  #app :is(.modern-sidebar-nav-icon-circle, .modern-sidebar-pill-icon-wrap) { width: 30px; height: 30px; padding: 4px; }
  #app :is(.modern-sidebar-nav-label, .modern-sidebar-profile-name) { font-size: 14px; line-height: 1.2; }

  #app .home-screen-shell {
    --home-content-start: 14px;
    --home-track-end: 14px;
    --home-row-gap: 8px;
    /* The TV home renderer also sets these sizes inline from user settings. */
    --home-poster-width: clamp(76px, 23vw, 126px) !important;
    --home-poster-height: calc(var(--home-poster-width) * 1.5) !important;
    --home-modern-portrait-poster-width: var(--home-poster-width) !important;
    --home-modern-portrait-poster-height: var(--home-poster-height) !important;
    --home-modern-portrait-expanded-width: var(--home-poster-width) !important;
    --home-landscape-poster-width: clamp(138px, 42vw, 224px) !important;
    --home-landscape-poster-height: calc(var(--home-landscape-poster-width) * 0.5625) !important;
    --home-poster-expanded-width: var(--home-landscape-poster-width) !important;
    --home-poster-radius: 8px !important;
    --home-continue-width: var(--home-landscape-poster-width);
    --home-continue-height: var(--home-landscape-poster-height);
  }

  #app .home-screen-shell .home-row-title { font-size: 17px; }
  #app .home-screen-shell .home-row-head { padding-left: var(--home-content-start); margin-bottom: 8px; }
  #app .home-screen-shell .home-track {
    --home-track-gap: 8px;
    margin-left: 0;
    padding: 2px var(--home-track-end) 6px var(--home-content-start);
    touch-action: pan-x pan-y;
  }

  #app .home-screen-shell .home-track > .home-content-card { margin-right: 0; }
  #app .home-screen-shell .home-poster-title { font-size: 12px; }
  #app .home-screen-shell .home-hero-card { min-height: 230px; }
  #app .home-screen-shell .home-hero-copy {
    width: 100%;
    max-width: 100%;
    min-height: 230px;
    padding: 16px 14px;
  }

  #app .home-screen-shell .home-hero-title-text { font-size: clamp(21px, 6vw, 32px); line-height: 1.1; }
  #app .home-screen-shell .home-hero-logo { width: auto; max-width: min(74%, 235px); height: auto; max-height: 64px; }
  #app .home-screen-shell .home-hero-description { font-size: 13px; line-height: 1.4; -webkit-line-clamp: 2; }

  #app .home-screen-shell.home-layout-modern {
    --modern-rows-viewport-height: 59%;
    --modern-rows-viewport-padding-bottom: 18vh;
    --modern-rows-page-height: 59vh;
    --modern-hero-copy-bottom-gap: 14px;
    --modern-hero-copy-gap: 6px;
    --modern-hero-title-size: 26px;
    --modern-hero-meta-size: 13px;
    --modern-hero-secondary-size: 12px;
  }

  #app .home-screen-shell.home-layout-modern:is(.has-modern-sidebar, .home-modern-sidebar-enabled) {
    --home-content-start: 58px;
  }

  #app .home-screen-shell.home-layout-modern .home-modern-hero-media { width: 100%; height: 48%; min-height: 0; }
  #app .home-screen-shell.home-layout-modern .home-modern-hero-media::after {
    background: linear-gradient(0deg, var(--bg-color) 0%, rgba(13, 13, 13, 0.76) 30%, transparent 84%);
  }

  #app .home-screen-shell.home-layout-modern .home-poster-card.is-expanded:not(.is-landscape) .content-poster { opacity: 1; }
  #app .home-screen-shell.home-layout-modern .home-poster-card.is-expanded:not(.is-landscape)
    :is(.home-poster-expanded-backdrop, .home-poster-expanded-gradient, .home-poster-expanded-brand, .home-poster-trailer-layer) {
    display: none;
  }

  #app .home-screen-shell.home-layout-modern .home-modern-hero-copy {
    left: var(--home-content-start);
    right: 12px;
    top: 12px;
    width: auto;
    max-width: none;
  }

  #app .home-screen-shell.home-layout-modern :is(.home-modern-rows-scroll, .home-modern-catalogs) { gap: 14px; }
}

@media (max-width: 800px) and (pointer: coarse), (max-width: 600px) {
  #detail .series-detail-shell {
    --detail-safe-x: 16px;
    --detail-action-gap: 8px;
    --detail-button-height: 44px;
    --detail-control-size: 44px;
    --detail-title-size: 28px;
    --detail-section-title-size: 18px;
    --detail-label-size: 14px;
    --detail-body-size: 15px;
    --detail-caption-size: 12px;
    --detail-episode-radius: 10px !important;
    width: 100%;
    height: 100%;
  }

  #detail .series-detail-content { width: 100%; max-width: none; height: 100%; padding: 0 0 32px; }
  #detail .detail-hero-section {
    min-height: min(440px, 72dvh);
    height: auto;
    width: 100%;
    padding: 52px var(--detail-safe-x) 16px;
  }

  #detail .detail-hero-brand { min-height: 64px; }
  #detail .detail-hero-body { width: 100%; max-width: none; }
  #detail .series-detail-logo {
    width: min(65%, 220px);
    height: 86px;
    max-height: 86px;
    padding: 0 0 10px;
  }

  #detail .series-detail-vignette {
    background: linear-gradient(0deg, var(--bg-color) 22%, rgba(13, 13, 13, 0.78) 58%, rgba(13, 13, 13, 0.2));
  }

  #detail .series-detail-actions { flex-wrap: wrap; margin: 6px 0 14px; }
  #detail :is(.series-primary-btn, .series-secondary-btn) {
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 0 14px;
    line-height: 1.2;
    font-size: 14px;
    gap: 6px;
  }

  #detail .series-circle-btn { width: 44px; height: 44px; font-size: 20px; }
  #detail :is(.series-primary-btn, .series-circle-btn) .series-btn-svg { width: 20px; height: 20px; }
  #detail :is(.series-detail-support, .series-detail-description) {
    width: auto;
    max-width: 100%;
    margin: 0 0 10px;
    line-height: 1.45;
  }

  #detail .detail-synopsis-more { font-size: 14px; }
  #detail .detail-meta-stack { gap: 6px; }
  #detail .detail-meta-row { gap: 8px; line-height: 1.4; }
  #detail .detail-meta-row .series-imdb-badge img { width: 28px; height: auto; }
  #detail .series-season-row { gap: 8px; padding-block: 12px; }
  #detail .series-season-btn { min-height: 44px; padding: 8px 12px; font-size: 15px; line-height: 1.2; }
  #detail .series-episode-track { gap: 10px; padding: 10px var(--detail-safe-x); }
  #detail .series-episode-card { width: min(76vw, 260px); flex-basis: min(76vw, 260px); }
  #detail .series-episode-thumb { height: auto; aspect-ratio: 16 / 9; }
  #detail .series-episode-copy { padding: 10px; gap: 6px; }
  #detail .series-episode-title { min-height: 0; font-size: 16px; line-height: 1.25; }
  #detail .series-episode-overview { font-size: 13px; line-height: 1.4; }
  #detail .series-episode-meta { font-size: 12px; gap: 8px; }
  #detail .series-insight-tabs { padding-top: 16px; }
  #detail .series-insight-tab { line-height: 1.3; }
  #detail :is(.movie-cast-card, .series-cast-card, .detail-morelike-card) {
    width: 112px;
    flex-basis: 112px;
  }

  #detail :is(.movie-cast-avatar, .series-cast-avatar) {
    width: min(100%, 84px);
    height: auto;
    aspect-ratio: 1;
    font-size: 24px;
  }

  #detail :is(.movie-cast-name, .movie-cast-character, .series-cast-name, .series-cast-character) {
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  #stream .stream-screen-panel {
    inset: 12px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    padding: 12px;
  }

  #stream .stream-screen-left { padding-bottom: 6px; }
  #stream .stream-route-autoplay-card { min-width: 0; max-width: calc(100% - 24px); padding: 14px; }
}
