/* esc-right-rail.css (2026-11-19; v2 Apps-symbol revision) - the right rail
   (view switcher) + the Apps panel and its left-bar symbol.
   The rail keeps the same look as the left bar #ui4Nav (esc-ui4.css): panel
   background, border, radius 14, gold aria-current. NO backdrop-filter on
   the rail: it would re-anchor fixed descendants (AGENTS.md) - the rail
   has none, but the rule stays simple. Top / height / right are written
   live by esc-right-rail.js from the logo and Talk to the globe boxes.
   z-index 2032: above the full-area views (Sky 2000, Web 2010, Stage /
   Earth 2030) so the switcher is always reachable; below the Scene card
   2050, the radio drawer 2060 (volume slider never covered), the Talk
   panel 2070 and the logo 2100. */
#escRightRail{position:fixed;z-index:2032;right:8px;top:204px;height:400px;display:flex;flex-direction:column;gap:6px;padding:6px;box-sizing:border-box;border-radius:14px;background:var(--panel,rgba(10,10,10,.92));border:1px solid var(--border,rgba(255,255,255,.15));overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;overscroll-behavior:contain}
#escRightRail .rr-sw{display:flex;flex-direction:column;gap:6px}
#escRightRail .rr-sep{flex:none;height:1px;margin:2px 4px;background:var(--border,rgba(255,255,255,.18))}
#escRightRail [data-rk]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;flex:none;min-width:64px;min-height:52px;padding:6px 4px;box-sizing:border-box;border-radius:10px;border:1px solid transparent;background:transparent;color:var(--text,#eee);font:inherit;font-size:12px;line-height:1.15;text-align:center;text-decoration:none;cursor:pointer}
#escRightRail .rr-ic{font-size:18px;line-height:1}
/* rule 7: the longest labels (ES 'Habilidades', 'Escuchando' ~65-73px at 11px bold) fit inside 76px; the rail is at most 92px wide and the push var is measured live */
#escRightRail .rr-tl{display:block;max-width:76px;font-size:11px;hyphens:auto;overflow-wrap:break-word}
#escRightRail{width:auto;max-width:92px}
#escRightRail [data-rk]:hover{border-color:var(--border,rgba(255,255,255,.25))}
#escRightRail [data-rk][aria-current=page]{background:var(--gold,#d4af37);color:var(--bg,#000);font-weight:700}
#escRightRail [data-rk]:focus-visible,#escAppsPanel a:focus-visible,#escAppsPanel button:focus-visible,#escRightRailTab:focus-visible,#ui4Nav #escAppsBtn:focus-visible{outline:3px solid var(--gold,#d4af37);outline-offset:2px}
@media (max-height:640px){#escRightRail [data-rk]{min-height:44px;padding:3px 4px}#escRightRail .rr-ic{font-size:15px}}

/* The Apps symbol in the left bar: the bar's own button styling comes from
   esc-ui4.css (#ui4Nav button); this only marks the open state. */
#ui4Nav #escAppsBtn[aria-expanded=true]{border-color:var(--gold,#d4af37);color:var(--gold,#d4af37)}

/* ESC APPS panel: hangs off the left bar (owner, 2026-11-19: ONE Apps
   symbol on the left sidebar opens a panel with all the apps). Top,
   max-height, width and the anchoring edge (left or right, whichever side
   the bar is on) are written live by esc-right-rail.js, so it can never
   cover the header band, the phone bottom bar, or the radio drawer
   (z 2033 sits below the radio drawer's 2060, so the volume slider stays
   on top). */
#escAppsPanel{position:fixed;z-index:2033;max-width:calc(100vw - 16px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));top:80px;left:84px;width:320px;display:flex;flex-direction:column;box-sizing:border-box;padding:10px;border-radius:14px;background:var(--panel,rgba(10,10,10,.96));border:1px solid var(--border,rgba(255,255,255,.2));color:var(--text,#eee);box-shadow:0 10px 40px rgba(0,0,0,.5)}
#escAppsPanel[hidden]{display:none!important}
#escAppsPanel .rr-dh{display:flex;justify-content:space-between;align-items:center;flex:none;margin-bottom:8px;color:var(--gold,#d4af37);letter-spacing:.06em}
#escAppsPanel .rr-x{min-width:44px;min-height:44px;border-radius:10px;border:1px solid var(--border,rgba(255,255,255,.2));background:transparent;color:var(--text,#eee);cursor:pointer}
/* the Views group at the very top of the panel (App view / Globe view /
   Stage lobby); App view is the panel's home state and reads current */
#escAppsPanel .rr-views{display:flex;flex-direction:column;gap:6px;flex:none;margin-bottom:8px}
#escAppsPanel .rr-views button{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;min-height:48px;padding:7px 10px;border-radius:10px;border:1px solid var(--border,rgba(255,255,255,.18));background:transparent;color:var(--text,#eee);font:inherit;text-align:left;cursor:pointer}
#escAppsPanel .rr-views button:hover{border-color:var(--gold,#d4af37)}
#escAppsPanel .rr-views button[aria-current=page]{background:var(--gold,#d4af37);color:var(--bg,#000);font-weight:700}
#escAppsPanel .rr-views .rr-vtx{display:flex;flex-direction:column;gap:1px;min-width:0}
#escAppsPanel .rr-views b{font-size:13px}
#escAppsPanel .rr-views small{font-size:11px;opacity:.75}
#escAppsPanel .rr-views em{flex:none;font-style:normal;font-size:10px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;opacity:.85}
#escAppsPanel .rr-list{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:6px;scrollbar-width:thin;overscroll-behavior:contain}
#escAppsPanel .rr-list a,#escAppsPanel .rr-list button,#escAppsPanel .rr-soon{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;min-height:48px;padding:7px 10px;border-radius:10px;border:1px solid var(--border,rgba(255,255,255,.18));background:transparent;color:var(--text,#eee);font:inherit;text-align:left;text-decoration:none;cursor:pointer}
#escAppsPanel .rr-list a:hover,#escAppsPanel .rr-list button:hover{border-color:var(--gold,#d4af37)}
#escAppsPanel .rr-list span{display:flex;flex-direction:column;gap:1px;min-width:0}
#escAppsPanel .rr-list b{font-size:13px}
#escAppsPanel .rr-list small{font-size:11px;opacity:.75}
#escAppsPanel .rr-list em{flex:none;font-style:normal;font-size:10px;letter-spacing:.04em;text-transform:uppercase;color:var(--gold,#d4af37);white-space:nowrap}
#escAppsPanel .rr-soon{cursor:default;opacity:.6}
#escAppsPanel .rr-soon em{color:var(--text,#eee);opacity:.8}

/* phone Views tab: hidden on desktop */
#escRightRailTab{display:none}

/* Phones / short screens (the same breakpoints #ui4Nav uses): the rail hides
   behind a small right-edge Views tab and slides in over the globe. */
@media (max-width:820px),(max-height:500px){
 #escRightRail{transform:translateX(calc(100% + 16px));visibility:hidden;transition:transform .22s ease,visibility 0s linear .22s;box-shadow:0 10px 40px rgba(0,0,0,.5)}
 #escRightRail.rr-open{transform:none;visibility:visible;transition:transform .22s ease}
 #escRightRail [data-rk]{min-height:44px}
 #escRightRailTab{display:block;position:fixed;z-index:2031;right:0;top:40vh;writing-mode:vertical-rl;transform:rotate(180deg);min-width:30px;min-height:64px;padding:10px 6px;border:1px solid var(--gold,#d4af37);border-left:0;border-radius:0 10px 10px 0;background:var(--panel,#080808);color:var(--gold,#d4af37);font:600 12px system-ui,sans-serif;letter-spacing:.1em;text-transform:uppercase;cursor:pointer}
 #escRightRailTab[aria-expanded=true]{visibility:hidden}
 #escAppsPanel{width:auto}
}
@media (prefers-reduced-motion:reduce){#escRightRail{transition:none!important}}

/* Folded lower-right originals are hidden only while the rail carries them
   (ABSORB_LOWER_RIGHT); their nodes, handlers and state are untouched. */
.esc-rr-absorbed{visibility:hidden!important;pointer-events:none!important}

/* Desktop: right-flush surfaces positioned by stylesheet keep clear of the
   rail through one measured var (--esc-rail-w = rail width + gap; 0 on phones).
   The inline writers (esc-ui3.js fitRight: Sky shelf, Lobby, Requests) read
   the same var in their own code. Stage and street view are NOT narrowed
   (verified stage composites); the rail floats over their right edge. */
@media (min-width:821px) and (min-height:501px){
 body.esc-rr #escBrowsePane,body.esc-rr #escNfsu2View{right:var(--esc-rail-w,0px)!important}
 body.esc-rr #escArtistHome{right:calc(12px + var(--esc-rail-w,0px))!important}
 body.esc-rr #ui4More,body.esc-rr #ui4Queue,body.esc-rr #ui4Themes{right:calc(12px + var(--esc-rail-w,0px))!important}
 body.esc-rr #ui4More{width:min(560px,calc(100vw - 100px - var(--esc-rail-w,0px)))!important}
 body.esc-rr #showerShelf.open{right:var(--esc-rail-w,0px)!important}
 body.esc-rr #detailPanel.open{margin-right:calc(12px + var(--esc-rail-w,0px))!important}
}
