/* One size for labelled movie and series Back buttons. */
@layer uno-detail-back {
 html body:is([data-library='movies'],[data-library='series']) :is(.movie-detail-back,.series-detail-back) {display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;flex:0 0 auto!important;width:128px!important;min-width:128px!important;max-width:128px!important;height:44px!important;min-height:44px!important;max-height:44px!important;aspect-ratio:auto!important;padding:8px 14px!important;gap:10px!important;border:1px solid #343126!important;border-radius:999px!important;background:#151515!important;color:#F7F5EF!important;font-size:16px!important;font-weight:400!important;line-height:1!important;box-shadow:none!important}
 html body:is([data-library='movies'],[data-library='series']) :is(.movie-detail-back,.series-detail-back) span {display:inline!important;position:static!important;width:auto!important;height:auto!important;opacity:1!important;visibility:visible!important;clip:auto!important;clip-path:none!important;overflow:visible!important;white-space:nowrap!important;font:inherit!important;color:inherit!important}
 html body:is([data-library='movies'],[data-library='series']) :is(.movie-detail-back,.series-detail-back) svg {width:18px!important;height:18px!important;flex:0 0 18px!important;margin:0!important;fill:currentColor!important;stroke:none!important}
}
/* Unified back controls across player, catalogue details and settings. */
html body .series-detail-back ,
html body [data-movie-back] ,
html body .back-pill ,
html body #shellSettingsBack ,
html body #playerBackBtn ,
html body .player-back ,
html body .multiscreen-card.is-fullscreen .multiscreen-exit {display:grid!important;place-items:center!important;box-sizing:border-box!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;border:1px solid #343126!important;border-radius:50%!important;background:#151515!important;color:#F7F5EF!important;box-shadow:none!important;line-height:1!important}
html body .series-detail-back span ,
html body [data-movie-back] span ,
html body .back-pill span ,
html body #shellSettingsBack span ,
html body #playerBackBtn span ,
html body .player-back span  {display:none!important}
html body .series-detail-back svg ,
html body [data-movie-back] svg ,
html body .back-pill svg ,
html body #shellSettingsBack svg ,
html body #playerBackBtn svg ,
html body .player-back svg ,
html body .multiscreen-card.is-fullscreen .multiscreen-exit svg {width:20px!important;height:20px!important;margin:0!important}
/* A single viewport anchor for Home and Back. */
html body {--uno-back-left:12px;--uno-back-top:8px;--uno-back-size:44px}
html body .series-detail-back ,
html body [data-movie-back] ,
html body .back-pill ,
html body #shellSettingsBack ,
html body #settingsShellBack ,
html body #playerBackBtn ,
html body #playerCloseBtn ,
html body .player-back ,
html body .multiscreen-card.is-fullscreen .multiscreen-exit {position:fixed!important;left:calc(var(--uno-back-left) + var(--uno-back-safe-left, env(safe-area-inset-left, 0px)))!important;top:calc(var(--uno-back-top) + var(--uno-back-safe-top, env(safe-area-inset-top, 0px)))!important;right:auto!important;bottom:auto!important;transform:none!important;margin:0!important;width:var(--uno-back-size)!important;height:var(--uno-back-size)!important;min-width:var(--uno-back-size)!important;min-height:var(--uno-back-size)!important;z-index:100!important}
html body #playerCloseBtn ,
html body #settingsShellBack  {display:grid!important;place-items:center!important;padding:0!important;border:1px solid #343126!important;border-radius:50%!important;background:#151515!important;color:#F7F5EF!important;box-shadow:none!important}
html body #playerCloseBtn svg ,
html body #settingsShellBack svg  {width:20px!important;height:20px!important;margin:0!important}

/* Dialog opening moves focus to Back. Keep one circular edge on touch and
   show keyboard focus inside that edge instead of the detail view's white halo. */
html body :is(.series-detail-back,[data-movie-back],.back-pill,#shellSettingsBack,#settingsShellBack,#playerBackBtn,#playerCloseBtn,.player-back,.zen-player-back,.recording-player-back,.multiscreen-card.is-fullscreen .multiscreen-exit) {
  --uno-back-focus: #f6b336;
  outline: none !important;
  outline-offset: 0 !important;
}
html[data-appearance='light'] body :is(.series-detail-back,[data-movie-back],.back-pill,#shellSettingsBack,#settingsShellBack,#playerBackBtn,#playerCloseBtn,.player-back,.zen-player-back,.recording-player-back,.multiscreen-card.is-fullscreen .multiscreen-exit) {
  --uno-back-focus: #245e53;
}
html body :is(.series-detail-back,[data-movie-back],.back-pill,#shellSettingsBack,#settingsShellBack,#playerBackBtn,#playerCloseBtn,.player-back,.zen-player-back,.recording-player-back,.multiscreen-card.is-fullscreen .multiscreen-exit):focus-visible {
  border-color: var(--uno-back-focus) !important;
  box-shadow: inset 0 0 0 1px var(--uno-back-focus) !important;
}
@media (forced-colors: active) {
  html body :is(.series-detail-back,[data-movie-back],.back-pill,#shellSettingsBack,#settingsShellBack,#playerBackBtn,#playerCloseBtn,.player-back,.zen-player-back,.recording-player-back,.multiscreen-card.is-fullscreen .multiscreen-exit):focus-visible {
    outline: 2px solid Highlight !important;
    outline-offset: -2px !important;
  }
}
html body.cinematic-library[data-library] .series-detail-overlay .series-detail-hero .series-detail-back,
html body.cinematic-library[data-library] .movie-detail-copy > [data-movie-back] {position:fixed!important;left:calc(var(--uno-back-left) + var(--uno-back-safe-left, env(safe-area-inset-left, 0px)))!important;top:calc(var(--uno-back-top) + var(--uno-back-safe-top, env(safe-area-inset-top, 0px)))!important}
/* Align actions with Home while preserving the menu capsule position. */
@media(max-width:900px) and (orientation:landscape){
 html body.player-app-shell[data-shell-mode='library'][data-library='movies'] .app-shell-header .nav-capsule ,
 html body.player-app-shell[data-shell-mode='library'][data-library='series'] .app-shell-header .nav-capsule  {height:60px!important;padding-top:0!important;padding-bottom:0!important;align-items:center!important}
 html body.player-app-shell[data-shell-mode='library'][data-library='movies'] .app-shell-header .library-tabs ,
 html body.player-app-shell[data-shell-mode='library'][data-library='series'] .app-shell-header .library-tabs  {height:44px!important;align-items:center!important;align-self:center!important}
 html body.player-app-shell[data-shell-mode='library'][data-library='movies'] .app-shell-header .library-tabs a.library-tab ,
 html body.player-app-shell[data-shell-mode='library'][data-library='series'] .app-shell-header .library-tabs a.library-tab  {height:44px!important;min-height:44px!important;margin-block:0!important}
 html body.player-app-shell[data-shell-mode='library'][data-library='movies'] .app-shell-header .header-right ,
 html body.player-app-shell[data-shell-mode='library'][data-library='series'] .app-shell-header .header-right  {position:fixed!important;top:calc(4px + env(safe-area-inset-top, 0px))!important;bottom:auto!important;height:44px!important;align-items:center!important;transform:none!important;margin:0!important}
 html body.player-app-shell[data-shell-mode='library'][data-library='movies'] .app-shell-header .header-right .round-control ,
 html body.player-app-shell[data-shell-mode='library'][data-library='movies'] .app-shell-header .header-right .profile-control ,
 html body.player-app-shell[data-shell-mode='library'][data-library='movies'] .app-shell-header .header-right .uno-header-control ,
 html body.player-app-shell[data-shell-mode='library'][data-library='series'] .app-shell-header .header-right .round-control ,
 html body.player-app-shell[data-shell-mode='library'][data-library='series'] .app-shell-header .header-right .profile-control ,
 html body.player-app-shell[data-shell-mode='library'][data-library='series'] .app-shell-header .header-right .uno-header-control  {box-sizing:border-box!important;flex:0 0 44px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important;border-radius:50%!important;margin-block:0!important;align-self:center!important;transform:none!important}
}

@media(max-width:900px) and (orientation:landscape){
 html body {--uno-back-left:24px;--uno-back-top:14px}
}

/* Phone playback uses the catalogue Home's top-left anchor. The embedded
   bridge can measure Live's middle rail Home, so these values must win over
   its inline variables. Settings sidebar navigation keeps its own anchor. */
@media(max-width:1024px) and (max-height:520px) and (orientation:landscape) {
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body:is(.live-tv-page,.cinematic-library,.multiscreen-fullscreen) {
  --uno-back-left:12px!important;
  --uno-back-top:8px!important;
  --uno-back-size:44px!important;
  --uno-back-safe-left:env(safe-area-inset-left,0px)!important;
  --uno-back-safe-top:env(safe-area-inset-top,0px)!important;
 }
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.cinematic-library[data-library] .zen-player-back,
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.uno-settings.settings-mobile .recording-player-overlay .recording-player-back {
  position:fixed!important;
  left:calc(var(--uno-back-left) + var(--uno-back-safe-left))!important;
  top:calc(var(--uno-back-top) + var(--uno-back-safe-top))!important;
  right:auto!important;
  bottom:auto!important;
  display:grid!important;
  place-items:center!important;
  box-sizing:border-box!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  max-width:44px!important;
  max-height:44px!important;
  padding:0!important;
  margin:0!important;
  border:1px solid #343126!important;
  border-radius:50%!important;
  background:#151515!important;
  color:#F7F5EF!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  line-height:1!important;
  transform:none!important;
  z-index:100!important;
 }
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.cinematic-library[data-library] .zen-player-back svg,
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.uno-settings.settings-mobile .recording-player-overlay .recording-player-back svg {
  width:20px!important;
  height:20px!important;
  margin:0!important;
 }
 /* Scope the playback anchor to the overlay; the Settings sidebar retains its
    existing Back variables and position underneath it. */
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.uno-settings.settings-mobile .recording-player-overlay {
  --uno-back-left:12px;
  --uno-back-top:8px;
  --uno-back-safe-left:env(safe-area-inset-left,0px);
  --uno-back-safe-top:env(safe-area-inset-top,0px);
 }
 /* The fixed Back no longer occupies a flex slot in the playback header. */
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.cinematic-library[data-library] .zen-player-top {
  box-sizing:border-box!important;
  padding-top:calc(var(--uno-back-top) + var(--uno-back-safe-top))!important;
  padding-left:calc(var(--uno-back-left) + var(--uno-back-safe-left) + var(--uno-back-size) + 12px)!important;
  padding-right:calc(12px + env(safe-area-inset-right,0px))!important;
  transform:none!important;
 }
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.cinematic-library[data-library] .zen-player-meta {
  min-width:0;
  max-width:100%;
 }
 html:not([data-device-family='tv']):not([data-device-family='tablet']) body.cinematic-library[data-library] [data-playback-speed] {
  font-size:12px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
  line-height:1;
 }
}
