/* esc-polish-fix.css — Ikarus, 2026-10-20.
 * Viewport containment + header alignment, from Corey's screenshot review:
 * the floating video card and stray wide elements could crowd/bleed past the
 * right edge, and the header now-playing cluster sat low against the buttons. */

html { overflow-x: clip; }

/* Header: buttons align centrally (the player no longer lives up here). */
header.top { align-items: center !important; }

/* UPPER-RIGHT PLAYER REMOVED (Corey, 2026-10-21): the lower-left player is
   the app's player. #nowPlaying (the header-docked cluster) is hidden in
   every mode; its sibling video host is unaffected and docks bottom-left.
   The header keeps only its passive title readout; the space the docked
   mode reserved up top stays returned. */
html body #nowPlaying { display: none !important; }
/* Corey, 2026-10-21 (late): the upper-right player STILL showed - the base
   rule above loses to index.html's `#nowPlaying.show`/`.docked` flex rule
   (higher specificity), and the element ships with both classes. Cover every
   state so the removal actually holds; #npPlayerHost (video, bottom-left)
   is a sibling and stays untouched. */
html body #nowPlaying.show,
html body #nowPlaying.docked,
html body #nowPlaying.now-playing,
html body #nowPlaying.show.docked { display: none !important; }
html.player-docked header.top { padding-right: 16px !important; }

/* Floating video card: never wider/taller than the viewport allows. */
#npPlayerHost {
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 32px) !important;
}
#npPlayerHost iframe { max-width: 100% !important; }

/* Desk shelf: it anchors at left:0 with a 36px tab offset, blind to the
   ~86px icon rail — its text slid under the rail exactly like the roster did.
   At desktop sizes with the rail present, move shelf + tab right of the rail;
   the dock's own 36px margin then lands it beside its tab, fully clear. */
@media (min-width: 821px) and (min-height: 501px) {
}

/* Desk tab rescue: REMOVED 2026-10-22. The rule existed only to keep the
   floating Desk tab visible while the chat shelf was open. The tab has
   retired into the left panel (esc-ui4-nav 'Desk' clicks it) and is
   display:none at its source (esc-ops-panel.js), so nothing here may
   resurrect it. The shelf/dock open-close behaviour is unchanged. */

/* Text never clips silently in the chrome we manage: labels ellipsize. */
#escOpsTab { overflow: hidden; text-overflow: ellipsis; }

/* Desk tab placement: REMOVED 2026-10-22. The 2026-10-21 right-edge pin was
   superseded by the all-left tab rail (esc-leftstack) but kept winning the
   cascade (this body stylesheet loads after esc-leftstack.js's head style),
   stranding the Desk tab on the right. The tab's left placement now comes
   from esc-ops-panel.js base styles + esc-leftstack.js. */

/* Desk on the right (Corey, 2026-10-21): the whole Desk — shelf, tab and the
   Messages/Tools dock — lives on the right edge with the other tabs. The
   dock flips its margin and corner radius to sit beside its tab. */
@media (min-width: 821px) {
  #escOpsShelf { left: auto !important; right: 0 !important; }
  #escOpsDock {
    margin-left: 0 !important; margin-right: 36px !important;
    border-radius: 14px !important;
  }
}

/* Free radio player sits flush in the corner: square off the screen-side
   corners, keep the free corner rounded. In-drawer keeps its own look. */
#escRadioPlayer:not(.erp-indrawer) { border-radius: 0 14px 0 0 !important; }

/* Primary-button labels restored (Corey, 2026-10-21): the theme-fix layer
   recolors ALL buttons' text to the theme accent with !important, and fills
   .pri buttons with that same accent - accent text on an accent fill is
   invisible (the blank orange buttons in Scene cards and the Stage Lobby).
   Primary buttons get a fixed dark label on their filled background. */
html[data-theme] #escSceneCard .scc-btns button.pri { color: #14110a !important; }
html[data-theme] .es-btn.pri { color: #14110a !important; }
html[data-theme] #escPlayBanner .epb-b.pri { color: #14110a !important; }
html[data-theme] #escIv button.iv-b.pri { color: #14110a !important; }

/* Left panel clears the FULL header (nav row + ticker strip ~72px), not
   just the nav row - a legacy rule pinned its top at 44px and it slid
   under the ticker. The coordinator refines this to the measured height. */
@media (min-width: 821px) and (min-height: 501px) {
  body.ui4-nav #leftPanel.left-panel { top: var(--esc-chrome-top,72px) !important; bottom: 8px !important; max-height: calc(100vh - var(--esc-chrome-top,72px) - 8px) !important; }
  /* Partner roster / artist detail panel (Corey, 2026-10-22): same two
     lines as every other docked panel - top on the header's bottom line,
     bottom on the bar's bottom line (8px). It used to sit in the layout
     grid (column 3, row 3, 12px top margin, content height), so its top
     floated below the header line and its bottom ended wherever the
     content did. The grid column is template-fixed at 380px, so pinning
     the panel fixed leaves the layout untouched. */
  body.ui4-nav #detailPanel.detail-panel { position: fixed !important; top: var(--esc-chrome-top,72px) !important; bottom: 8px !important; right: 12px !important; margin: 0 !important; max-height: calc(100vh - var(--esc-chrome-top,72px) - 8px) !important; z-index: 96; }
}


/* pf14/pf15 retired (Builds 6+7, 2026-10-22): the Browse pane's box is owned by esc-browser.js - one exact area box (left at the bar's right edge or docked to the open panel's measured right edge, top at --esc-chrome-top, right 0, bottom 8). The !important frame rules that lived here (104/84/56/16 + hardcoded 484) fought both the stylesheet and park(). */
