/* 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; }
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: the ops module hides its tab whenever the CHAT shelf
   reports open (a 400ms poll) — a proxy that strands the tab in Globe View.
   Outside Stage mode the tab stays available; in Stage mode the module's
   own lobby behaviour is untouched. */
body:not(.esc-stage-mode) #escOpsShelf.lobby-hide #escOpsTab { display: block !important; }

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

/* Desk tab placement (Corey, 2026-10-21): with the other pull-tabs on the
   right edge, below the Requests tab — one tab rail for the whole app.
   The Desk panel itself still opens in the left workspace zone. */
@media (min-width: 821px) {
  #escOpsTab {
    left: auto !important; right: 0 !important; top: 42% !important;
    border-left: 1px solid var(--gold, #d4af37) !important; border-right: 0 !important;
    border-radius: 10px 0 0 10px !important;
  }
}

/* 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: 80px !important; }
}


/* pf14: the web browser pane gets a real frame (Corey, 2026-10-21) - clear of
   the left rail, below the header, clear of the right pull-tabs; it slides
   right when the left panel is open and goes full-bleed on phones. */
#escBrowsePane{left:104px!important;right:56px!important;top:84px!important;bottom:16px!important;transition:left .25s ease}
@media (min-width:821px){body[data-left="open"] #escBrowsePane{left:484px!important}}
@media (max-width:820px){#escBrowsePane{left:8px!important;right:8px!important;top:76px!important;bottom:8px!important}}

/* pf15: the browse pane also slides for the panel's own open state directly */
@media (min-width:821px){
  body:has(#leftPanel.open) #escBrowsePane,
  body:has(#leftPanel.show) #escBrowsePane,
  body:has(#leftPanel[data-open="1"]) #escBrowsePane{left:484px!important}
}
