/*
 * Expanded phone screens: a compact touch layout in either orientation.
 * pwa-core owns these classes and removes them when the cover screen is used.
 * The extra root specificity is intentional: section styles load asynchronously.
 * Browsing offsets never apply to immersive players or their fullscreen surfaces.
 */
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] {
  --cinema-pad: max(18px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --cinema-top: calc(62px + env(safe-area-inset-top, 0px));
  --cinema-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  --cinema-rail: 0px;
  --foldable-content-width: calc(100vw - var(--cinema-rail));
  --foldable-card-gap: 12px;
  --foldable-hero-height: clamp(250px, 34vh, 330px);
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-page-title {
  max-width: 42%;
  font-size: 23px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-search {
  flex: 0 1 250px;
  max-width: 43%;
  height: 44px;
  gap: 9px;
  padding-inline: 12px;
  font-size: 13px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .topbar .profile-switcher {
  top: calc(env(safe-area-inset-top, 0px) + 9px) !important;
}

/* The Duo's compact portrait viewport also opens the phone profile picker. */
@media (min-width: 440px) and (min-aspect-ratio: 3/5) {
  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) {
    overflow: clip !important;
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) .profile-list {
    --profile-column-gap: clamp(12px, 2.5vw, 22px);
    --profile-side-padding: max(18px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    height: 100dvh !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: clamp(10px, 2vh, 20px);
    padding: max(14px, env(safe-area-inset-top, 0px)) var(--profile-side-padding) max(14px, env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto;
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) .profile-brand {
    position: static !important;
    transform: none !important;
    flex: none;
    margin: auto 0 0 !important;
    height: clamp(36px, 6vh, 56px) !important;
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) .profile-slide-info {
    position: static;
    transform: none;
    flex: none;
    width: 100%;
    min-height: calc(clamp(32px, 6.5vh, 56px) + 28px);
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 4px;
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate .profile-slide-title-logo {
    max-width: min(100%, 280px);
    max-height: clamp(32px, 6.5vh, 56px);
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate .profile-slide-title-text {
    font-size: clamp(18px, 3vh, 26px);
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) .profile-list-layout {
    flex: none;
    max-width: 640px;
    margin-bottom: auto;
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) .profile-grid {
    width: 100% !important;
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: center !important;
    gap: clamp(10px, 2vh, 20px) var(--profile-column-gap) !important;
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) .profile-stack-item {
    flex: 0 0 calc((100% + var(--profile-column-gap)) / var(--profile-columns, 3) - var(--profile-column-gap));
  }

  html:is(.vuebox-foldable-layout, .vuebox-phone-layout[data-orientation="portrait"]) #profileGate:not(.is-form) .profile-card :is(.profile-avatar, .profile-add-icon) {
    width: min(100%, clamp(62px, 11.8vh, 112px)) !important;
    height: auto !important;
    aspect-ratio: 1;
  }
}

@media (orientation: landscape) {
  html.vuebox-foldable-layout #profileGate:not(.is-form) .profile-list {
    --profile-columns: 4;
  }
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-nav {
  gap: 8px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-nav-button {
  flex: 1 1 0;
  min-height: 52px;
  max-width: 124px;
  padding: 6px 4px;
  border-radius: 14px;
  font-size: 11px;
}

/* Reserve the navigation rail consistently, including dynamically mounted apps. */
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] body:not(.vuebox-cinema-immersive) :is(#moviesApp, #tvShowsApp, #reelShortsApp, #livetvApp, #sportsApp, #sportsClassicsApp, #gamingApp, #musicApp, #downloadsApp, #settingsApp, #app.showcase-app) {
  top: var(--cinema-top) !important;
  left: var(--cinema-rail) !important;
  right: 0 !important;
  bottom: var(--cinema-bottom) !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

/* A swipeable feature row keeps artwork and labels readable on a square screen. */
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-dashboard {
  padding: calc(var(--cinema-top) + 8px) var(--cinema-pad) 28px !important;
  gap: 24px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid,
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid[data-cinema-count] {
  display: flex !important;
  height: auto !important;
  gap: var(--foldable-card-gap) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  -webkit-overflow-scrolling: touch;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-card,
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-card.is-primary {
  flex: 0 0 78% !important;
  width: 78% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  min-height: 0 !important;
  border-radius: 16px !important;
  scroll-snap-align: start;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid[data-cinema-count="1"] .home-promo-card {
  flex-basis: 100% !important;
  width: 100% !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-copy {
  left: 18px !important;
  right: 18px !important;
  bottom: 18px !important;
  gap: 8px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-title {
  font-size: clamp(23px, 3.4vw, 32px) !important;
  line-height: 1.12 !important;
  -webkit-line-clamp: 2;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-card .cinema-meta {
  display: flex;
  flex-wrap: wrap;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-card .home-promo-action {
  width: max-content;
  max-width: 100%;
  align-self: flex-start;
  height: auto;
  min-height: 36px !important;
  padding: 8px 13px !important;
  gap: 7px;
  font-size: 12px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-dashboard-row-title {
  font-size: clamp(21px, 2.8vw, 25px) !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-dashboard-row .home-dashboard-card {
  --home-dashboard-card-width: calc((var(--foldable-content-width) - (2 * var(--cinema-pad)) - 24px) / 3);
  height: clamp(130px, 19vw, 180px) !important;
  border-radius: 12px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-dashboard-track {
  gap: var(--foldable-card-gap) !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-dashboard-card-title {
  font-size: 14px !important;
}

/* Duo-style compact portrait screens need a clear preview of the next card,
 * plus a single discovery row instead of a tall group of wrapped pills. */
@media (orientation: portrait) and (max-width: 619px) {
  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-dashboard {
    gap: 18px !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-card,
  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid .home-promo-card.is-primary {
    flex-basis: 86% !important;
    width: 86% !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .home-promo-grid[data-cinema-count="1"] .home-promo-card {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .discovery-entry-bar {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .discovery-entry {
    flex: 0 0 auto;
  }
}

/* Some Duo WebViews report the compact portrait half as a wide phone until
 * the second display is fully opened. Give that posture the same balanced
 * Home treatment without changing regular phones below 440px. */
@media (orientation: portrait) and (min-width: 440px) and (max-width: 619px) and (min-aspect-ratio: 3/5) {
  /* The compact Duo cover reports its top-right system cluster as a right
   * safe-area inset. Keep header actions out of that cluster, but do not
   * reserve the same top-only space across the bottom navigation. */
  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] {
    --cinema-cover-status-inset: env(safe-area-inset-right, 0px);
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .topbar {
    padding-right: max(var(--cinema-pad), var(--cinema-cover-status-inset)) !important;
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .topbar .profile-switcher {
    right: max(var(--cinema-pad), var(--cinema-cover-status-inset)) !important;
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .cinema-nav {
    padding-right: 10px;
    padding-left: 10px;
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .home-dashboard {
    gap: 18px !important;
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .home-promo-grid .home-promo-card,
  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .home-promo-grid .home-promo-card.is-primary {
    flex: 0 0 86% !important;
    width: 86% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .home-promo-grid[data-cinema-count="1"] .home-promo-card {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .discovery-entry-bar {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  html.vuebox-theme-cinema.vuebox-phone-layout[data-orientation="portrait"] .discovery-entry {
    flex: 0 0 auto;
  }
}

/* Catalog proportions depend on usable width, not a large tablet viewport. */
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-row {
  min-height: 0 !important;
  padding-bottom: 22px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-row-head {
  padding-inline: var(--cinema-pad) !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-row-title {
  height: auto !important;
  font-size: 22px !important;
  line-height: 1.3 !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .row-track {
  gap: 12px !important;
  padding: 12px var(--cinema-pad) 16px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-card:not(.is-focused):not(.is-ranked) {
  width: clamp(116px, calc(var(--foldable-content-width) * .2), 170px) !important;
  min-width: clamp(116px, calc(var(--foldable-content-width) * .2), 170px) !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-card:is(.is-landscape, .is-continue):not(.is-focused):not(.is-ranked) {
  width: clamp(190px, calc(var(--foldable-content-width) * .31), 280px) !important;
  min-width: clamp(190px, calc(var(--foldable-content-width) * .31), 280px) !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-card.is-focused {
  width: clamp(240px, calc(var(--foldable-content-width) * .45), 360px) !important;
  min-width: clamp(240px, calc(var(--foldable-content-width) * .45), 360px) !important;
  max-width: calc(var(--foldable-content-width) - 2 * var(--cinema-pad)) !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-card:is(.is-focused, .is-continue) .poster-frame {
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-card :is(.card-copy, .card-desc) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 0 !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-card.is-large-portrait.is-focused {
  width: min(620px, calc(var(--foldable-content-width) - 2 * var(--cinema-pad))) !important;
  min-width: min(620px, calc(var(--foldable-content-width) - 2 * var(--cinema-pad))) !important;
  gap: 18px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] :is(#moviesApp, #tvShowsApp, #reelShortsApp) .movie-card.is-large-portrait.is-focused .poster-frame {
  flex: 0 0 clamp(130px, 22vw, 180px) !important;
  width: clamp(130px, 22vw, 180px) !important;
  height: auto !important;
  aspect-ratio: 2 / 3 !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-search-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 14px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-destinations {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-destination {
  min-height: clamp(125px, 20vw, 165px);
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-destination > span {
  font-size: 19px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] #settingsApp.settings-cinema .settings-shell {
  padding: 18px var(--cinema-pad) calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  gap: 18px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] #settingsApp.settings-cinema .settings-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] #settingsApp.settings-cinema .settings-control-section {
  min-width: 0;
  padding: 16px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] #settingsApp.settings-cinema .settings-quick-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] #settingsApp.settings-cinema .settings-quick-nav button:last-child {
  grid-column: auto;
}

/* A two-screen device keeps the station and directory on opposite sides of its hinge. */
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp {
  --cinema-live-row-height: 88px;
  --cinema-live-toolbar-height: 110px;
  --cinema-live-tabs-height: 42px;
  --cinema-live-filter-height: 44px;
  display: flex;
  gap: 16px;
  padding: 14px var(--cinema-pad) 12px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .live-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .hero-art {
  max-height: 210px;
  border-radius: 12px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .hero-copy {
  min-width: 0;
  padding: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title favorite" "channel favorite" "description description" "progress progress" "time remaining" "actions actions";
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv #livetvApp .cinema-live-logo {
  display: none;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .hero-title {
  font-size: 21px !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv #livetvApp .cinema-live-toolbar button {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 14px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv #livetvApp .cinema-live-actions {
  display: flex;
  flex-wrap: wrap;
  padding-top: 10px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv #livetvApp .cinema-live-actions button {
  min-height: 44px;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .guide-viewport {
  left: 0 !important;
  right: 0 !important;
}

html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .guide-label,
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-cinema-live-tv #livetvApp :is(#liveCinemaFilters, #liveCinemaCount) {
  padding-inline: 0 !important;
}

/* The landscape rail gives the guide and catalog more height without tiny tabs. */
@media (min-width: 740px) {
  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape {
    --cinema-rail: calc(76px + env(safe-area-inset-left, 0px));
    --cinema-bottom: 0px;
    --foldable-hero-height: clamp(240px, 40vh, 310px);
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape .cinema-nav {
    inset: 0 auto 0 0;
    width: var(--cinema-rail);
    height: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: max(16px, env(safe-area-inset-top, 0px)) 7px max(16px, env(safe-area-inset-bottom, 0px)) calc(7px + env(safe-area-inset-left, 0px));
    border-top: 0;
    border-right: 1px solid rgba(255, 255, 255, .12);
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape .cinema-nav-button {
    flex: 0 0 62px;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 62px;
    font-size: 10px;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape .home-promo-grid .home-promo-card {
    flex-basis: 68% !important;
    width: 68% !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape .home-promo-grid[data-cinema-count="1"] .home-promo-card {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-foldable-landscape.vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp {
    display: grid;
    grid-template-columns: minmax(265px, 46%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 18px;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-foldable-landscape.vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .live-hero {
    display: flex !important;
    grid-column: 2;
    grid-row: 1;
    gap: 16px !important;
    overflow-y: auto !important;
    align-items: stretch;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"][data-foldable-segments="vertical"].vuebox-foldable-landscape.vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp .guide-shell {
    grid-column: 1;
    grid-row: 1;
  }
}

/* Separate detail panes are reserved for displays with a physical hinge. */
@media (min-width: 780px) {
  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"] .home-episodes-layout {
    display: grid !important;
    grid-template-columns: 40% minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"] #homeLibraryEpisodesModal :is(.details-backdrop, .details-shade) {
    width: 40% !important;
    height: 48% !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"] .home-episodes-head {
    min-height: 0;
    overflow: hidden auto !important;
    padding: 0 22px 28px;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"] .cinema-home-series-identity {
    min-height: 32vh;
    padding-top: 76px;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"] .home-episodes-main {
    min-height: 0;
    overflow-y: auto;
    padding: 78px 22px 28px;
  }
}

/* The smallest inner displays still need comfortable controls in Settings. */
@media (max-width: 619px) {
  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] {
    --cinema-pad: max(14px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] #settingsApp.settings-cinema .settings-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"] .cinema-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A physical gap is reported only for a browser spanning two display segments.
 * Keep each Live TV/detail pane within its screen; ordinary folds have no gap.
 * Fullscreen playback deliberately remains owned by the player stylesheets. */
@media (min-width: 780px) {
  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"].vuebox-cinema-live-tv body:not(.vuebox-cinema-immersive) #livetvApp {
    grid-template-columns: minmax(0, calc(var(--vuebox-hinge-left) - var(--cinema-rail) - 2 * var(--cinema-pad))) minmax(0, 1fr);
    column-gap: calc(var(--vuebox-hinge-width) + 2 * var(--cinema-pad));
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"] .home-episodes-layout {
    grid-template-columns: var(--vuebox-hinge-left) minmax(0, 1fr) !important;
    column-gap: var(--vuebox-hinge-width) !important;
  }

  html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout[data-device-profile="foldable"].vuebox-foldable-landscape.vuebox-foldable-spanned[data-foldable-segments="vertical"] #homeLibraryEpisodesModal :is(.details-backdrop, .details-shade) {
    width: var(--vuebox-hinge-left) !important;
  }
}

/* Preserve the complete image on physical dual-screen devices as well. */
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout.vuebox-foldable-spanned[data-foldable-segments="vertical"] #homeLibraryEpisodesModal .details-backdrop {
  object-fit: contain !important;
  object-position: center !important;
}
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout.vuebox-foldable-spanned[data-foldable-segments="vertical"] #tvShowsApp .cinema-series-art img {
  object-fit: contain;
  object-position: center;
}
html.vuebox-theme-cinema.vuebox-tablet-layout.vuebox-foldable-layout.vuebox-foldable-spanned[data-foldable-segments="vertical"] #homeLibraryEpisodesModal .details-shade {
  display: none !important;
}

/* A spanned movie has two independent canvases. The artwork and its
 * identification stay together on the first screen, including during resume. */
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) {
  --duo-inset: clamp(20px, 3vw, 40px);
  --duo-art-height: min(49vh, calc(var(--vuebox-hinge-left) * .5625));
  --duo-title-height: clamp(56px, 8vh, 78px);
  --duo-hero-top: max(64px, calc((100% - var(--duo-art-height) - var(--duo-title-height) - 90px) / 2));
  --duo-title-top: calc(var(--duo-hero-top) + var(--duo-art-height) + 16px);
  --duo-right-start: calc(var(--vuebox-hinge-left) + var(--vuebox-hinge-width));
  box-sizing: border-box;
  overflow: hidden !important;
  padding: 0 !important;
  background: linear-gradient(110deg, #0b0d11, #111318 70%) !important;
}

html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.details-shade, :is(#detailsClose, #reelDetailsClose), #homeLibraryDetailsClose, .cinema-movie-kicker) {
  display: none !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.details-copy, .home-library-details-copy) {
  display: contents !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) .details-backdrop {
  position: absolute !important;
  inset: var(--duo-hero-top) auto auto 0 !important;
  -webkit-mask-image: linear-gradient(0deg, transparent, #000 14%, #000 95%, transparent);
  mask-image: linear-gradient(0deg, transparent, #000 14%, #000 95%, transparent);
  width: var(--vuebox-hinge-left) !important;
  height: var(--duo-art-height) !important;
  object-fit: contain !important;
  object-position: center !important;
  opacity: 1 !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-art, .cinema-home-identity) {
  position: absolute;
  inset: var(--duo-title-top) auto auto var(--duo-inset);
  display: flex !important;
  justify-content: center;
  align-items: flex-start;
  width: calc(var(--vuebox-hinge-left) - 2 * var(--duo-inset));
  height: var(--duo-title-height);
  min-height: 0;
  padding: 0;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.details-title, .home-library-title) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: clamp(25px, 3vw, 40px) !important;
  line-height: 1.05 !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.details-logo, .home-library-logo) {
  max-height: var(--duo-title-height) !important;
  max-width: 96% !important;
  object-fit: contain;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-meta, .cinema-home-metadata, .cinema-movie-genres, .cinema-home-genres) {
  position: fixed;
  left: var(--duo-inset);
  width: calc(var(--vuebox-hinge-left) - 2 * var(--duo-inset));
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.45;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-meta, .cinema-home-metadata) {
  top: calc(var(--duo-title-top) + var(--duo-title-height) + 8px);
  font-size: 16px;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-genres, .cinema-home-genres) {
  top: calc(var(--duo-title-top) + var(--duo-title-height) + 34px);
  color: #afb3bc;
  font-size: 14px;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-body, .cinema-home-reading) {
  position: absolute;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  inset: max(22px, env(safe-area-inset-top, 0px)) max(var(--duo-inset), env(safe-area-inset-right, 0px)) max(22px, env(safe-area-inset-bottom, 0px)) calc(var(--duo-right-start) + var(--duo-inset));
  align-content: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
  background: none;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) .tablet-movie-summary {
  grid-column: 1 / -1;
  order: 1;
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 8px;
  margin-bottom: clamp(16px, 3vh, 30px);
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) .cinema-movie-story {
  display: contents;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-story-title, .cinema-home-story) {
  grid-area: 1 / 1;
  margin: 0 !important;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.18;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(:is(#detailsDesc, #reelDetailsDesc), #homeLibraryDetailsDesc) {
  grid-area: 2 / 1 / 3 / -1;
  -webkit-line-clamp: 4;
  font-size: 16px !important;
  line-height: 1.5 !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(#cinemaHomeMovieRead, :is(#cinemaMovieReadMore, #cinemaReelReadMore)) {
  grid-area: 1 / 2;
  justify-self: end;
  min-height: 44px;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-facts, .cinema-home-facts) {
  grid-area: 3 / 1 / 4 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  color: #b5bac3;
  font-size: 13px;
  line-height: 1.4;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(.cinema-movie-facts, .cinema-home-facts):empty {
  display: none !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) .cinema-movie-facts > div {
  display: flex;
  flex: none;
  gap: 5px;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) .cinema-movie-facts dd {
  margin: 0;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) .detail-actions {
  order: 5;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px 8px !important;
  margin: 0;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(:is(#cinemaMovieProgress, #cinemaReelProgress), #cinemaHomeMovieProgress) {
  order: 6;
  margin: 0 0 8px;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(:is(#detailsPlay, #reelDetailsPlay), #homeLibraryDetailsPlay) {
  order: 7;
  min-height: 48px !important;
  border-radius: 10px !important;
  margin: 0 !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(:is(#detailsRestart, #reelDetailsRestart), #homeLibraryDetailsRestart) {
  order: 8;
  min-height: 44px !important;
  margin: 0 !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) button:is([data-action="watch_later"], [data-action="download"], [data-action="trailer"], [data-action="discovery"]) {
  order: 9 !important;
}
html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(:is(#cinemaMovieInfo, #cinemaReelInfo), .cinema-tv-home-info) {
  left: var(--duo-right-start) !important;
  padding: 16px;
}
@media (max-height: 610px) {
  html.vuebox-theme-cinema.vuebox-foldable-spanned[data-foldable-segments="vertical"] :is(:is(#moviesApp, #reelShortsApp) :is(#movieDetailsModal, #reelShortsDetails), #homeLibraryDetailsModal) :is(:is(#detailsDesc, #reelDetailsDesc), #homeLibraryDetailsDesc) {
    -webkit-line-clamp: 2;
  }
}
