/* Elite Media Center v0.10.5.50: automatic sidebar, two-hour Live TV guide,
   no repeated page headings, sign-out confirmation, Admin change status.
   Loaded after every other stylesheet. */

/* ------------------------------------------------------------------ */
/* 1. Automatic sidebar (app.js + elite_sidebar.js).                    */
/* The header ☰ is gone; a hidden stand-in keeps the installed Android  */
/* app from drawing its own drawer. From 641 px the sidebar is an icon  */
/* rail; it opens OVER the page, so the page keeps its width and never  */
/* jumps. 640 px and narrower keep the bottom navigation bar.          */
/* ------------------------------------------------------------------ */
#eliteSidebarToggle,#appBox .eliteSidebarClose,#appBox .eliteSidebarBackdrop{display:none!important}
@media (min-width:641px){
  #appBox .appShell.eliteSidebarRail{grid-template-columns:76px minmax(0,1fr)!important;transition:grid-template-columns .22s ease}
  #appBox .appShell.eliteSidebarRail>.sideNav{
    display:flex!important;position:sticky!important;top:0;left:auto!important;bottom:auto!important;z-index:60;
    width:76px;min-width:76px;max-width:none;justify-self:start;
    height:100vh;height:100dvh;
    transition:width .2s ease,box-shadow .2s ease,padding .2s ease}
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded>.sideNav{
    width:230px;padding:18px 14px;background:#0d141d;box-shadow:18px 0 44px #000b,1px 0 0 #253142}
  /* Labels never wrap while the menu slides open or closed. */
  #appBox .appShell.eliteSidebarRail .sideNavButton{white-space:nowrap;overflow:hidden}
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded #eliteSidebarAccount{flex-direction:row;align-items:center;min-height:44px}
}
/* 641-820 px: styles.css hides the labels and centres the icons there (its old
   narrow rail); the open menu shows them like on a wide screen. */
@media (min-width:641px) and (max-width:820px){
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded .sideNavButton span:last-child{display:inline!important}
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded .sideNavButton{justify-content:flex-start;padding:12px 13px}
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded .sideBrand{justify-content:flex-start;padding:4px 8px 18px}
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded .sideBrand .brand,
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded .sideBrand .tagline{display:block}
  #appBox .appShell.eliteSidebarRail.eliteSidebarExpanded #eliteSidebarAccount #profileName{display:inline!important}
}
@media (min-width:641px) and (prefers-reduced-motion:reduce){
  #appBox .appShell.eliteSidebarRail,#appBox .appShell.eliteSidebarRail>.sideNav{transition:none}
}

/* ------------------------------------------------------------------ */
/* 2. Less space above page content (no repeated headings any more).   */
/* ------------------------------------------------------------------ */
html[data-elite-page]:not([data-elite-page="Home"]) #appBox .workspaceHeader{margin-bottom:10px}
html[data-elite-page="Live TV"]:not([data-elite-page="Home"]) #appBox .workspaceHeader{margin-bottom:6px}
#libraryHeadingTitle[hidden],#libraryCount[hidden],#liveTvStatus[hidden]{display:none!important}
/* Movies / TV Shows: the poster-size buttons moved into the "Browse genres" row; the old heading row is empty. */
#appBox #libraryPage .libraryHeading.eliteLibraryTools{margin:0;min-height:0;padding:0}
#appBox #libraryPage .genreHead{flex-wrap:wrap;row-gap:8px}
#appBox #libraryPage .genreHead .densityControls{margin-left:auto}
#appBox #libraryPage .genreBrowser{padding-top:2px}
#appBox #historyPage .eliteHistoryNote{margin:0 2px 10px;font-size:12px}
#appBox #adminPanel .adminPageHeader.eliteAdminCompactHeader{padding:0 0 2px;margin:0 0 4px;border-bottom:0}
#appBox #adminPanel .eliteAdminCompactHeader .eliteAdminVersion{font-size:12px;margin-left:0}

/* ------------------------------------------------------------------ */
/* 3. Live TV guide: filters right under the header divider, exactly   */
/* two hours across the width, titles on up to two lines.             */
/* ------------------------------------------------------------------ */
#appBox #livePage .liveTvPanel{margin-bottom:6px}
#appBox #livePage .liveTvHeader{justify-content:flex-end;align-items:center;margin:0 0 6px;min-height:0}
#appBox #livePage .liveTvHeader .liveTvFilters{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;margin-left:auto}
/* The guide fills the screen below its filters (app.js sets --elite-guide-fit). */
html #appBox #livePage .guideScroller{max-height:var(--elite-guide-fit,calc(100dvh - 160px));min-height:min(var(--elite-guide-fit,520px),360px)}
/* --elite-guide-ppm: pixels per minute (two hours = the programme area's width). */
.liveGuideGrid .guideInner.eliteTwoHourGuide{position:relative}
.liveGuideGrid .eliteTwoHourGuide .guideTimeLane,
.liveGuideGrid .eliteTwoHourGuide .guideProgramLane{
  flex:0 0 auto;
  background-size:120px 100%}

.liveGuideGrid .eliteTwoHourGuide .guideProgram{


  /* A programme that started before the visible window: its text starts at the window's edge. */
  padding-left:9px;padding-right:7px;
  justify-content:flex-start;gap:2px}
/* Room for the "Play from Library" button only on programmes that have one. */
.liveGuideGrid .eliteTwoHourGuide .guideProgram.hasQuickPlay{padding-right:30px}
@media (max-width:700px){
  .liveGuideGrid .eliteTwoHourGuide .guideProgram{padding-left:6px;padding-right:4px}
  .liveGuideGrid .eliteTwoHourGuide .guideProgram.hasQuickPlay{padding-right:28px}
  .liveGuideGrid .eliteTwoHourGuide .guideProgram strong{font-size:12px}
}
.liveGuideGrid .eliteTwoHourGuide .guideProgram strong{
  white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;
  overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere;line-height:1.22;flex:none;width:100%}
.liveGuideGrid .eliteTwoHourGuide .guideProgram .guideProgramMeta{
  display:block;width:100%;flex:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-size:10.5px;line-height:1.3;color:#9aa8bb}
.liveGuideGrid .eliteTwoHourGuide .guideProgram .guideProgramMeta>*{display:inline;width:auto;overflow:visible;white-space:nowrap}
.liveGuideGrid .eliteTwoHourGuide .guideProgram .guideProgramMeta small{font-size:inherit;color:#c0cada}

/* ------------------------------------------------------------------ */
/* 4. Sign-out confirmation (one dialog for every Sign Out).           */
/* Above every other overlay, including the first-sign-in password one. */
/* ------------------------------------------------------------------ */
#eliteSignOutModal{z-index:2600}
#eliteSignOutModal .eliteSignOutCard{width:min(430px,100%);padding:26px 24px 22px;text-align:center}
#eliteSignOutModal h2{font-size:20px;line-height:1.3;margin:0 0 20px}
#eliteSignOutModal .eliteSignOutActions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
#eliteSignOutModal .eliteSignOutActions button{min-width:132px;min-height:46px;padding:0 18px;border-radius:11px;font-size:16px;font-weight:700}
#eliteSignOutModal .eliteSignOutCancel{position:static;width:auto;height:auto;top:auto;right:auto}
#eliteSignOutModal .eliteSignOutConfirm{background:#5d2430;border-color:#984e5b!important;color:#fff!important}
#eliteSignOutModal button:focus-visible{outline:3px solid #6ec1ff;outline-offset:3px}

/* ------------------------------------------------------------------ */
/* 5. Admin > Now Playing: Pending / Applied / Failed for Admin changes. */
/* ------------------------------------------------------------------ */
.eliteNowChips .eliteControlChip{font-weight:700}
.eliteNowChips .eliteControlChip.eliteControl-pending{background:#3a3112;border-color:#9a7b2c;color:#ffe3a3}
.eliteNowChips .eliteControlChip.eliteControl-applied{background:#123a24;border-color:#2f8a57;color:#b9f5cf}
.eliteNowChips .eliteControlChip.eliteControl-failed{background:#3d161b;border-color:#a3434f;color:#ffc4ca}
.eliteControlStatus strong{font-weight:700}
/* The A-Z rail must not cover the genre row's buttons either. */
body.hasAlphabetRail #appBox #libraryPage .genreBrowser{padding-right:44px;box-sizing:border-box}
/* Admin > Overview: how this server started (item 10). Neutral unless something is wrong. */
#appBox .eliteLiveStartup:not(.eliteLiveStartupWarn){color:#9fb3c8}


/* Elite guide visible-title fix: the programme keeps its real timeline
   position; only its title and metadata follow the left edge of the
   currently visible portion. Preserve room for the library Play icon. */
.liveGuideGrid .eliteTwoHourGuide .guideProgram > strong,
.liveGuideGrid .eliteTwoHourGuide .guideProgram > .guideProgramMeta {
  position: relative;
  left: var(--elite-guide-shift, 0px);
  width: max(0px, calc(100% - var(--elite-guide-shift, 0px))) !important;
  min-width: 0;
}
