/* v72: one viewport for Rayya's inner scroller and listening sheet. These are
   CSS env values on devices (the QA harness can set explicit synthetic insets). */
:root{
  --ry-view:100vh;
  --ry-safe-t:env(safe-area-inset-top,0px);
  --ry-safe-b:env(safe-area-inset-bottom,0px);
  --ry-safe-l:env(safe-area-inset-left,0px);
  --ry-safe-r:env(safe-area-inset-right,0px);
  --ry-chrome:rgb(var(--rc22));
  --ry-nav-h:calc(62px + var(--ry-safe-b));
  --ry-player-h:0px;
  --ry-top-h:0px;
  --ry-player-gap:6px;
  --ry-dock:var(--ry-nav-h);
}
@supports (height:100dvh){:root{--ry-view:100dvh}}
html.uth69{--ry-chrome:#1e5a43}
html.isc{height:var(--ry-view);background:var(--ry-chrome)}
/* In standalone Safari any page-owned canvas below the fixed layout should
   match the active bottom surface; keep a dark status backing above it. */
html.isc.player-sheet-open72{
  background-color:var(--card);
  background-image:linear-gradient(var(--ry-chrome) 0 50%,transparent 50% 100%);
  background-repeat:no-repeat;
}
html.isc body{
  padding-bottom:var(--ry-dock);
  scroll-padding-top:calc(var(--ry-top-h) + 8px);
  scroll-padding-bottom:calc(var(--ry-dock) + 8px);
}
html.isc body.has-player{--ry-dock:calc(var(--ry-nav-h) + var(--ry-player-gap) + var(--ry-player-h))}
/* The top bar owns the installed status-bar inset. The tab bar paints down to
   the viewport edge; its measured height already includes the bottom inset. */
html .topbar{padding-top:calc(10px + var(--ry-safe-t))}
.tabbar{
  bottom:0;
  padding-left:calc(6px + var(--ry-safe-l));
  padding-right:calc(6px + var(--ry-safe-r));
  padding-bottom:calc(7px + var(--ry-safe-b));
}
.tabbar .p60ind{bottom:calc(5px + var(--ry-safe-b))}
#siteFoot.site-foot{padding-bottom:8px}
#player{bottom:calc(var(--ry-nav-h) + var(--ry-player-gap));left:calc(8px + var(--ry-safe-l));right:calc(8px + var(--ry-safe-r))}
@media(min-width:1000px){
  :root{--ry-nav-h:0px;--ry-player-gap:calc(14px + var(--ry-safe-b))}
}
body.mp-on{--ry-player-gap:calc(6px + var(--ry-safe-b))}
body.mp-on.has-player .mp{padding-bottom:calc(var(--ry-player-h) + var(--ry-player-gap) + 6px)}
@media(max-width:999px){
  /* Fade into the reserved space; do not slide controls through the tabs. */
  #player:not([hidden]){animation-name:fade;animation-duration:.18s}
  #player #plResume{margin:3px 6px 0;padding:0 3px}
  #player #plResGo,#player #plResX{min-height:44px}
  #player #plResX{min-width:44px}
  #player .pl-row{padding-block:4px}
  /* Keep the title readable; only the secondary reciter line can elide. */
  #player #plTitle{white-space:normal;overflow-wrap:anywhere;text-overflow:clip;line-height:1.33;padding-inline-end:0}
  #player .p60eq{top:auto;bottom:0;pointer-events:none}
  body.p60-play #player #plSub{padding-inline-end:20px}
  #mpInfo{white-space:normal;overflow-wrap:anywhere;text-overflow:clip;line-height:1.3}
  #player .pl-top{padding-top:3px}
  #player #plPlay{width:48px;height:48px;min-width:48px}
}
/* A cold resume is one usable row, not a row over an empty transport. A live
   player still shows transport, and either style of resume remains actionable. */
#player.res68-idle :is(.pl-top,.pl-row){display:none}
#player .res68{gap:4px;padding:3px 7px;margin:0}
#player .res68-go,#player .res68-x{min-height:44px;min-width:44px;flex:none}
#player .res68-go{padding-inline:10px}
#player .res72-label,#player .res72-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#player .res72-title{font-size:12px;line-height:1.3}
/* A fixed-height flex dialog gives only the content its own scroll range. The
   controls across the top stay reachable; the bottom inset is sheet padding,
   never a gesture-zone button or extra inset inside the scrollable content. */
#sheetWrap.player-sheet72{height:var(--ry-view);max-height:100%;bottom:auto}
#sheetWrap.player-sheet72 .sheet{
  display:flex;flex-direction:column;
  max-height:calc(100% - var(--ry-safe-t) - 8px);
  overflow:hidden;padding:0 0 var(--ry-safe-b);
}
.player-sheet72 .sheet-grip{display:none}
#playerSheetNav:not([hidden]){
  display:flex;justify-content:space-between;gap:8px;flex:none;
  padding:5px max(12px,var(--ry-safe-r)) 5px max(12px,var(--ry-safe-l));
  border-bottom:1px solid var(--line);
}
#playerSheetNav button{
  min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:1px solid var(--line);border-radius:12px;padding:4px 12px;
  background:var(--card2);color:var(--ink);font:700 14px/1.2 var(--ui);cursor:pointer;
}
html[dir=rtl] #psBack72 .ico{transform:scaleX(-1)}
#playerSheetNav .ico{height:17px;width:17px}
html:not([lang=en]) #playerSheetNav .ry-en,html[lang=en] #playerSheetNav .ry-ar{display:none}
.player-sheet72 #sheetBody{
  min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;
  padding:8px max(18px,var(--ry-safe-r)) 18px max(18px,var(--ry-safe-l));
  scroll-padding-block:8px 18px;
}
