/* ==========================================================================
 * MILLENOVA GLOBAL PLAYER — STAGE DESKTOP LAYOUT CONTRACT
 *
 * OWNER:
 * This file owns desktop-only expanded Stage composition: Stage grid, center media and black-cinema presentation, Home feed placement, Signal sidebar and desktop queue/sidebar composition.
 *
 * MUST NOT OWN:
 * Do not define mobile Stage behavior, queue-row internals, provider logic or reaction internals. The dated Wilder Ruiz black-cinema override must be preserved. Scrollbar chrome remains owned by
 * Styles/scrollbars.css. JavaScript state/queue/provider semantics stay
 * outside CSS.
 *
 * CASCADE CONTRACT:
 * Segment 3 of 6 for this owner. Phase 11A mechanical split: loaded at manifest position 19, after
 * 18-queue-up-next-and-next-from--part-2-of-3.css. Rule order is unchanged from the former monolith (baseline
 * df93472, lines 3001–3188). New corrections go into the canonical owning
 * rule; never append dated Phase/fix blocks.
 *
 * DEPENDENCIES:
 * Depends on Stage state classes (has-stage-*, is-mplayer-stage-open) and the Home page markup.
 * ========================================================================== */



/* ==========================================================================
 * Phase 7 desktop signal-rail height isolation
 *
 * The right Home signal rail is a passenger in the upper Stage row, never its
 * height authority. Expanding Your Signal may consume the row's spare space
 * and then scroll, but it must not stretch the media or move the combined
 * Now Playing / transport strip downward.
 *
 * `contain: size` removes the rail's content from intrinsic grid-track sizing;
 * the left Stage focus therefore determines the shared row height. The rail
 * then stretches to that resolved row and owns any vertical overflow.
 * ========================================================================== */

@media (min-width: 901px) {
  .floating-playlist:not(.is-minimized).has-stage-home-feed.has-stage-signal-rail
    .floating-playlist__stage-rail {
    align-self: stretch;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    contain: size;
  }

  .floating-playlist:not(.is-minimized).has-stage-home-feed.has-stage-signal-rail
    .floating-playlist__stage-rail .stage-home-rail {
    min-height: 0;
  }
}


/* ==========================================================================
 * Phase 7 contextual Stage actions — NEXT FROM owns playlist/queue controls
 *
 * Stage header is chrome-only: title + collapse chevron. Save/manage/overflow
 * and native-upload expand controls live beside the context they affect.
 * ========================================================================== */

.floating-playlist__context-actions {
  display: none;
}

.floating-playlist__queue-section
  > .floating-playlist__context-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .16rem;
  margin-left: auto;
}

.floating-playlist__queue-section
  > .floating-playlist__context-actions button,
.floating-playlist__queue-section
  > .floating-playlist__context-actions a {
  border: 0;
  background: transparent;
  color: var(--mn-muted);
  cursor: pointer;
}

.floating-playlist__queue-section[data-floating-queue-section="context"] {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.floating-playlist__queue-section-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-playlist__context-viewport
  > .floating-playlist__queue-section[data-floating-queue-section="context"] {
  position: sticky;
  top: 0;
  z-index: 5;
  background:
    linear-gradient(180deg, #08090d 78%, rgba(8,9,13,.95));
  box-shadow: 0 1px 0 rgba(255,255,255,.035);
}

.floating-playlist__queue-section
  .floating-playlist__save-draft,
.floating-playlist__queue-section
  .floating-playlist__manage,
.floating-playlist__queue-section
  .floating-playlist__video-expand,
.floating-playlist__queue-section
  .floating-playlist__more > summary {
  width: 28px;
  height: 28px;
}

.floating-playlist__queue-section
  .floating-playlist__save-draft svg,
.floating-playlist__queue-section
  .floating-playlist__manage svg,
.floating-playlist__queue-section
  .floating-playlist__video-expand svg,
.floating-playlist__queue-section
  .floating-playlist__more > summary svg {
  width: 14px;
  height: 14px;
}

/* The original header action group now contains only the Stage collapse
 * chevron. Keep it compact instead of reserving space for retired actions.
 */
.floating-playlist__header-actions {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .floating-playlist__queue-section[data-floating-queue-section="context"] {
    min-height: 42px;
    padding-right: .2rem;
  }

  .floating-playlist__queue-section
    > .floating-playlist__context-actions {
    gap: .06rem;
  }

  .floating-playlist__queue-section
    .floating-playlist__save-draft,
  .floating-playlist__queue-section
    .floating-playlist__manage,
  .floating-playlist__queue-section
    .floating-playlist__video-expand,
  .floating-playlist__queue-section
    .floating-playlist__more > summary {
    width: 32px;
    height: 32px;
  }
}


/* ==========================================================================
 * Phase 7 global desktop Stage ownership
 *
 * Home is the rich compositional host. Everywhere else, expanded MPlayer owns
 * the desktop viewport directly: the underlying route remains mounted but is
 * presentation-suppressed until Stage collapses.
 * ========================================================================== */

@media (min-width: 901px) {
  body.is-mplayer-global-stage {
    overflow: hidden;
    background: #050608;
  }

  body.is-mplayer-global-stage > .skip-link,
  body.is-mplayer-global-stage > .site-header,
  body.is-mplayer-global-stage > [data-public-section-rail],
  body.is-mplayer-global-stage > [data-mobile-quick-shell],
  body.is-mplayer-global-stage > #main-content,
  body.is-mplayer-global-stage > .site-footer {
    display: none !important;
  }

  body.is-mplayer-global-stage
    > .floating-playlist:not(.is-minimized):not(.is-orientation-fullscreen) {
    position: fixed;
    inset: 0;
    z-index: 4000;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #050608;
    filter: none;
    transform: none;
  }

  body.is-mplayer-global-stage
    > .floating-playlist:not(.is-minimized)
    .floating-playlist__stage {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.is-mplayer-global-stage
    > .floating-playlist:not(.is-minimized)
    .floating-playlist__stage-rail,
  body.is-mplayer-global-stage
    > .floating-playlist:not(.is-minimized)
    .floating-playlist__stage-feed {
    display: none !important;
  }
}
