.pm-player-strip{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;color:#f2f5ff;background:#101a32;padding:.25rem clamp(.5rem,2vw,1rem);font:inherit;position:relative;z-index:2;min-width:0}
.pm-player-strip[hidden],.pm-player-strip [hidden]{display:none!important}
.pm-message{font-size:.94rem;flex:1;min-width:0;line-height:1.35;overflow-wrap:anywhere}
.pm-busy::before{content:"";display:inline-block;width:.75em;height:.75em;margin-right:.55em;border:2px solid #91a4ca;border-top-color:#ffda88;border-radius:50%;vertical-align:-.08em;animation:pm-spin 1s linear infinite}
@keyframes pm-spin{to{transform:rotate(360deg)}}
.pm-choices{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.pm-audio{position:relative;margin-inline-start:auto}
.pm-audio summary,.pm-choices button{cursor:pointer;color:#f6f6ff;background:#182743;border:1px solid #546785;border-radius:.5rem;min-height:44px;padding:.45rem .8rem;font:inherit;display:inline-flex;align-items:center;justify-content:center}
.pm-audio summary{list-style:none}.pm-audio summary::-webkit-details-marker{display:none}
.pm-audio[open]{width:100%}.pm-audio[open]>div{display:flex;gap:.5rem 1.25rem;align-items:center;flex-wrap:wrap;padding:.65rem .15rem}
.pm-audio label{display:inline-flex;align-items:center;gap:.5rem;min-height:44px}.pm-audio input[type=range]{width:min(10rem,45vw)}.pm-audio-note{font-size:.9rem;color:#cedaf1}
.pm-fade{transition:opacity 250ms ease}.pm-idle .pm-fade{opacity:0;pointer-events:none}
.pm-player-strip :focus-visible{outline:3px solid #ffdd83;outline-offset:2px}
#station-picker,#picker,#broadcast-picker{color:#f4f7ff;background:rgba(13,29,53,.87);border:1px solid #7284a5;border-radius:.8rem}
#station-picker::backdrop,#picker::backdrop,#broadcast-picker::backdrop{background:rgba(4,9,18,.25)}
#station-options button,#rows button,#broadcast-options button{background:rgba(23,52,84,.89)}
#watch .pm-player-strip{grid-column:1/-1}
#player.immersive .pm-player-strip{flex:0 0 auto}
#watch.pm-embedded #station-picker[open],#tuner.pm-embedded #broadcast-picker[open]{position:relative;inset:auto;margin:.3rem auto;max-height:40dvh;flex-shrink:0;width:min(100%,44rem);z-index:3}
#watch.pm-embedded #station-picker[open] .picker-inner{max-height:38dvh}
#watch.pm-embedded .sheet:has(#station-picker[open]) #media>*{max-height:36dvh}
#tuner.expanded{display:flex;flex-direction:column}
#tuner.expanded[hidden]{display:none}
#tuner.expanded #screen{min-height:0;flex:1;height:auto}
#tuner.expanded #screen iframe{max-height:100%;height:100%}
#tuner.expanded .remote{position:static;display:flex;justify-content:flex-end;gap:.45rem}
#tuner.expanded .remote>.remote-actions{display:flex}
#tuner.expanded:not(.youtube-remote) .remote-actions #official{display:none}
#tuner.youtube-remote #official{grid-column:1/-1;color:#b7f2ff;border-color:#638e9e}
#tuner.expanded.youtube-remote .remote,#tuner.expanded.youtube-remote .remote-actions{flex-wrap:wrap}
#broadcast-picker .picker-body{display:flex;flex-direction:column;gap:.45rem;padding:.6rem;max-height:38dvh}
#broadcast-picker .picker-head{display:flex;justify-content:space-between;align-items:center}
#broadcast-options{overflow:auto;display:grid;gap:.25rem}
#broadcast-options button{text-align:left;min-height:44px}
#tuner #open-broadcast-guide{min-height:44px}
@media(max-width:42rem){#player .caption{flex-wrap:wrap}#watch .player-head{flex-wrap:wrap}#watch .play-tools{flex-wrap:wrap}}
@media(max-height:32rem) and (orientation:landscape){#watch .sheet:has(#media:not(:empty)){display:flex;flex-direction:column}#watch #media>*{max-height:50dvh}}
@media(prefers-reduced-motion:reduce){.pm-fade{transition:none}.pm-busy::before{animation:none}}
#watch.pm-embedded .sheet:has(#station-picker[open]){display:flex;flex-direction:column}
#watch.pm-embedded .sheet:has(#station-picker[open]) :is(.tune,article){order:2}
#watch.pm-embedded .sheet:has(#station-picker[open]) #station-picker{order:1}
:is(#station-picker,#picker,#broadcast-picker) :focus-visible{outline:3px solid #ffda88;outline-offset:-3px}
@keyframes pm-arrival{from{opacity:.78}to{opacity:1}}
@media(prefers-reduced-motion:no-preference){#media>video,#media>iframe,#tuner #screen>iframe,#player:not(.is-game) #screen>iframe:not([data-channel-standby]){animation:pm-arrival .25s ease-out}}
.voice-controls [hidden]{display:none!important}
#watch #directory-player-voice,#directory-voice-home{min-width:0;padding:.25rem .65rem;background:#14243a;color:#edf5ff}
#watch #directory-player-voice{grid-column:1/-1}
.voice-controls #voice-key{display:inline-flex;align-items:center;gap:.45rem;min-height:44px;padding:.35rem .8rem;border:1px solid #7287a0;border-radius:.5rem;background:#233a53;color:#fff;font:inherit;cursor:pointer}
.voice-controls #voice-key[aria-pressed=true]{border-color:#89eff3;background:#194654}
.voice-controls :focus-visible{outline:3px solid #ffdc89;outline-offset:1px}
.voice-controls #voice-status{font-size:.95rem;line-height:1.3;color:#e4efff;margin:.25rem 0}
.voice-controls #voice-status:empty{display:none}
.voice-controls #voice-entry:not([hidden]){display:flex;align-items:center;gap:.3rem;flex-wrap:wrap}
.voice-controls #voice-command{flex:1 1 9rem;min-width:0;max-width:32rem;padding:.5rem;background:#071525;color:#fff;border:1px solid #8195ad;border-radius:.4rem;font:inherit}
.voice-controls #voice-entry button{min-height:44px}
#tuner.expanded .remote>.voice-controls{display:block;flex:1;min-width:0}
#tuner.expanded .remote:has(#voice-entry:not([hidden])){flex-wrap:wrap}

.pm-spotlight{font-weight:700;color:#ffda88;border-inline-start:.2rem solid currentColor;padding-inline-start:.55rem;line-height:1.3;overflow-wrap:anywhere}

#tuner > :is(.remote, .pm-player-strip, .tuner-title, #now, #up-next) {
  transition: opacity 250ms ease;
}
body.tv-fading-controls #tuner > :is(.remote, .pm-player-strip, .tuner-title, #now, #up-next) {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  #tuner > :is(.remote, .pm-player-strip, .tuner-title, #now, #up-next) { transition: none; }
}

/* Auto Clean Screen keeps the same player mounted and the provider controls reachable. */
body:is(.tv-clean-screen, .tv-player-only) { overflow: hidden; background: #000; }
body:is(.tv-clean-screen, .tv-player-only) > header, body:is(.tv-clean-screen, .tv-player-only) main > :not(#tuner),
body:is(.tv-clean-screen, .tv-player-only) #tuner > :not(#screen, #restore-player-controls) { display: none !important; }
body:is(.tv-clean-screen, .tv-player-only) #tuner {
  position: fixed; inset: 0; z-index: 100; display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr); margin: 0; padding: 0;
  width: 100%; height: 100%; border: 0; border-radius: 0; background: #000;
}
body:is(.tv-clean-screen, .tv-player-only) #tuner #screen {
  grid-row: 1; display: grid; place-items: center; container-type: size;
  width: 100%; height: 100%; margin: 0; border-radius: 0; background: #000;
}
body:is(.tv-clean-screen, .tv-player-only) #tuner #screen iframe {
  width: 100%; height: 100%; max-height: none; border: 0;
}
/* Fit each picture inside the available screen, leaving the margins available to wake the remote. */
@supports (width: 1cqh) {
  body.tv-clean-screen #tuner #screen iframe { width: min(100%, 177.7778cqh); height: auto; aspect-ratio: 16 / 9; }
  body.tv-clean-screen #tuner #screen.portrait-video iframe { width: min(100%, 56.25cqh); aspect-ratio: 9 / 16; }
}
@media (orientation: portrait) {
  #watch:not(.expanded) .sheet:not(:fullscreen) #media.portrait-video iframe,
  body:not(.tv-clean-screen, .tv-player-only) #tuner:not(.expanded) #screen.portrait-video iframe {
    width: 100%; height: auto; aspect-ratio: 9 / 16; max-height: calc(100dvh - 6rem);
  }
  #player:not(.immersive) #screen.portrait-video { aspect-ratio: 9 / 16; max-height: calc(100dvh - 6rem); }
  #watch.expanded:has(#media:is(.book-channel, .portrait-video)) { max-width: none; }
  /* Keep the picture and one row of remote keys; the guide still opens from this row. */
  :is(#watch.expanded .sheet, #watch .sheet:fullscreen):has(#media:is(.book-channel, .portrait-video)):not(:has(#station-picker[open])) {
    display: flex;
    flex-direction: column;
  }
  :is(#watch.expanded .sheet, #watch .sheet:fullscreen):has(#media:is(.book-channel, .portrait-video)):not(:has(#station-picker[open])) > :not(#media, .player-head) { display: none; }
  :is(#watch.expanded .sheet, #watch .sheet:fullscreen):has(#media:is(.book-channel, .portrait-video)) .player-head { order: 1; justify-content: center; padding: .25rem .25rem max(.25rem, env(safe-area-inset-bottom)); }
  :is(#watch.expanded .sheet, #watch .sheet:fullscreen):has(#media:is(.book-channel, .portrait-video)) #channel-label { display: none; }
  :is(#watch.expanded .sheet, #watch .sheet:fullscreen):has(#media:is(.book-channel, .portrait-video)) #media { width: 100%; }
}
/* The Galaxy pop-up can be resized at any aspect ratio. Let the provider fit its own video. */
body.tv-player-only #tuner #screen iframe { width: 100%; height: 100%; aspect-ratio: auto; }
body.tv-player-only #restore-player-controls { display: none !important; }
/* The black margins wake the remote. The actual picture still receives provider input. */
body.tv-clean-screen #tuner #screen { position: relative; z-index: 1; pointer-events: none; }
body.tv-clean-screen #tuner #screen iframe { pointer-events: auto; }
body.tv-clean-screen #restore-player-controls {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  padding: 0; border: 0; opacity: 0; touch-action: manipulation;
}

.remote-course-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: .65rem .85rem;
  border: 1px solid #536986;
  border-radius: .65rem;
  background: #173a5c;
  color: #fff;
  font-size: 1rem;
  text-decoration: underline;
}
.remote-course-link:focus-visible { outline: 3px solid #ffe29c; outline-offset: -3px; }

/* The dial, broadcast guide and remote use the same button states. */
:root {
  --tv-key: linear-gradient(165deg,#2d4058,#182a40 68%,#122034);
  --tv-key-line: #657a94;
  --tv-legend: #f6f4ec;
  --tv-gold: #f4d294;
}
:is(.filter-feedback,.filters) #clear-filters,
:is(#station-picker,#broadcast-picker,#picker) :is(#dismiss,#dismiss-broadcast,#close-stations),
#player header nav :is(a,button),#player .caption :is(#quick-guide,#expand,#return-tv,#leave),
#guide-top-nav > :is(a,button):not(#watch),
:is(#tuner .remote-actions,#watch .play-tools) :is(button,a[href]) {
  min-height: 44px;
  padding: .52rem .78rem;
  border: 1px solid var(--tv-key-line);
  border-radius: .62rem;
  background: var(--tv-key);
  color: var(--tv-legend);
  font: 650 1rem/1.2 system-ui,sans-serif;
  text-decoration: none;
  box-shadow: inset 0 1px 0 #ffffff1f;
}
#clear-filters[hidden] { display: none; }
#guide-top-nav #watch { border-radius: .62rem; }
#listings .filters { gap: .6rem; }
#listings .filters label { margin: 0; }
#listings #clear-filters { align-self: end; justify-self: start; margin: 0; }
#list .row { min-height: 52px; border-left-color: #536d86; }
#list .row .num { color: var(--tv-gold); font-variant-numeric: tabular-nums; }
#list .row[aria-current=true] { background: #233c54; border-left-color: var(--tv-gold); }
#list .row[aria-current=true] .num::before { color: var(--tv-gold); }
:is(#station-picker,#broadcast-picker,#picker) {
  border: 1px solid #7d8da0;
  border-radius: .9rem;
  background: #102239;
  box-shadow: 0 .65rem 2.2rem #02071090;
}
:is(#station-picker,#broadcast-picker,#picker) :is(.sheet-head,.picker-head) {
  gap: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #42546a;
}
:is(#station-picker,#broadcast-picker,#picker) input[type=search] {
  min-height: 46px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #768aa2;
  border-radius: .5rem;
  background: #091727;
  color: #fff;
  font: 500 1rem/1.25 system-ui,sans-serif;
  padding: .55rem .72rem;
}
:is(#station-options,#broadcast-options,#rows) :is(button,a) {
  min-height: 48px;
  margin: 0;
  text-align: start;
  border: 1px solid #3f5570;
  border-radius: .45rem;
  background: #1b324a;
  color: #f4f7fb;
}
:is(#station-options,#broadcast-options,#rows) [aria-current=true] {
  color: #fff5d9;
  background: #2c4153;
  border-left: 4px solid var(--tv-gold);
}
#rows button small,#rows button[aria-current=true] small { color: var(--tv-gold); font-variant-numeric: tabular-nums; }
:is(#guide-top-nav,#list,#station-picker,#broadcast-picker,#picker,#player header,.caption,.remote-actions,.play-tools,.filter-feedback,.filters) :is(button,a,summary,input,select):focus-visible {
  outline: 3px solid #ffe4a2;
  outline-offset: -3px;
}
:is(#guide-top-nav,#player header,.caption,.remote-actions,.play-tools) button:disabled { opacity: .55; cursor: default; }
@media (hover:hover) {
  :is(#guide-top-nav,#list,#station-options,#broadcast-options,#rows,.filter-feedback,.remote-actions,.play-tools) :is(a,button):not(:disabled):hover { border-color: var(--tv-gold); }
}
@media (prefers-reduced-motion:no-preference) {
  :is(#guide-top-nav,#list,#station-options,#broadcast-options,#rows,.remote-actions,.play-tools) :is(a,button):not(:disabled):active { filter: brightness(.9); }
}
@media (max-width: 36rem) {
  #player .caption :is(#quick-guide,#expand,#return-tv,#leave), #guide-top-nav > :is(a,button):not(#watch) { font-size: .9375rem; padding-inline: .52rem; }
}
@media (forced-colors:active) {
  :is(#guide-top-nav,#list,#station-picker,#broadcast-picker,#picker,.remote-actions,.play-tools) :focus-visible { outline-color: Highlight; }
}

/* Put the remote beside Channel 888 on a landscape phone. Its controls can scroll while the picture stays in view. */
@media (orientation: landscape) and (max-height: 36rem) {
  #watch.expanded:has(#media.book-channel) { max-width: none; }
  :is(#watch.expanded .sheet, #watch .sheet:fullscreen):has(#media.book-channel):not(:has(#station-picker[open])) {
    display: grid !important; /* Overrides the small-landscape fullscreen flex layout. */
    grid-template:
      "picture head" auto
      "picture status" auto
      "picture voice" auto
      "picture tune" minmax(min-content, 1fr)
      / minmax(0, 1fr) clamp(10rem, 24vw, 14rem);
    overflow: auto;
    background: #000;

    & > .player-head { grid-area: head; position: static; }
    & > .pm-player-strip { grid-area: status; }
    & > #directory-player-voice { grid-area: voice; }
    & > .tune { grid-area: tune; align-content: start; }
    & > #media {
      grid-area: picture;
      align-self: start;
      position: sticky;
      top: 0;
      height: 100vh;
      height: 100dvh;
      & > iframe { max-height: none; }
    }
  }
}

/* Give the Shorts player the exact uncropped rectangle within the available picture area. */
@supports (width: 1cqh) {
  :is(#watch.expanded .sheet, #watch .sheet:fullscreen):not(:has(#station-picker[open])) #media.portrait-video {
    container-type: size;
    place-items: center;
    background: #000;
    & > iframe {
      width: min(100%, 56.25cqh);
      height: min(100%, 177.7778cqw);
      max-height: none;
    }
  }
}
