/* Unified player shell.
 *
 * Dark is the default palette: cover art can be any colour, and a standalone
 * host that never maps these tokens still reads. The app's Day theme remaps
 * the chrome tokens below (app.css) so Now Playing uses the same paper and
 * navy as every other screen. Artwork, video, and scrims that sit on them
 * stay dark — those are the media, not the chrome.
 */

:root {
  /* Content column inside the full player. The shell fills the viewport
   * (minus the host's docks); what it holds should not — a title row or a
   * transport stretched across a 1600px monitor is a line nobody's eye
   * tracks back from. The stage gets its own, wider cap: video is the one
   * stage that benefits from width, and 56rem keeps a 16:9 embed at a
   * watchable size without turning the whole shell into a cinema. */
  --pk-shell-maxw: 40rem;
  --pk-shell-stage-maxw: 56rem;
}

.ps {
  /* The closed extras drawer's height (#1376). It holds one line of tab text,
   * so it must grow with the text: 23px of fixed chrome (padding, tab
   * underline, head gap) + 1.0625rem for the line (12.5px type at the 1.36
   * leading Geist resolves to). That is exactly 40px at the design size; a
   * flat 40px clipped the tab labels by 3px at the 1.35 Dynamic Type ceiling. */
  --ps-lip: calc(23px + 1.0625rem);
  /* The shell's two flat surfaces, as tokens. They were hardcoded #08090d and
   * #14171e, so a host on a lighter palette (the app's Dusk) got a near-black
   * deck and drawer over its own gray tab bar: four tones in the bottom 40% of
   * the screen. Defaults are the dark values, so nothing changes until a host
   * maps them; the kit's own --color-* defaults are LIGHT, which is why these
   * do not read those directly. --ps-deck is the control deck and the base under
   * the art wash; --ps-drawer is the extras drawer, and a host can set it equal
   * to its tab bar so the two read as one object. */
  --ps-deck: #08090d;
  --ps-drawer: #14171e;
  /* Ink and washes on that deck. Defaults are the dark palette. A Day host
   * overrides them; they are not --color-* because the kit's own defaults
   * for those tokens are the light palette and would vanish on this deck. */
  --ps-ink: #edeff4;
  --ps-ink-dim: #c8cdd8;
  --ps-muted: #8a91a0;
  --ps-wash: #ffffff12;
  --ps-wash-strong: #ffffff26;
  --ps-line: #ffffff17;
  --ps-track: #ffffff1a;
  --ps-on-accent: #12161f;
  position: fixed;
  top: 0;
  /* --pk-dock-left, not 0: a host whose navigation is a side rail (the
   * desktop layout) needs the shell to start right of it, or the full
   * player covers the rail and the only way out is the close chevron —
   * which the turntable skin hides. The mini bar already docks on the
   * same variable (player.css); the shell was the one surface that did
   * not. */
  left: var(--pk-dock-left, 0px);
  right: 0;
  /* Stop short of the host's own bottom nav rather than covering it —
   * reported: opening the full player hid the tab bar entirely, with no way
   * back to another screen short of closing the player first. --pk-dock-bottom
   * is the same hook the docked mini-player already docks above (see
   * player.css's --pk-dock-bottom note); the full shell reserves the
   * identical strip instead of introducing a second one. Default 0px keeps a
   * host with no bottom nav (or the desktop sidebar layout, which sets this
   * to 0) covering the full screen exactly as before. z-index alone doesn't
   * uncover a bar underneath — see .tts-text-panel's identical note in
   * player.css — so the box itself has to stop there, not just paint above it. */
  bottom: calc(var(--pk-dock-bottom, 0px) + env(safe-area-inset-bottom, 0px));
  /* Above every docked surface it has to cover — the player bar and the
   * ambience bar both sit at the tab-bar layer (~70-90), and the sheets that
   * open FROM this shell (queue, chapters) deliberately sit higher still at
   * 1100+. A hardcoded literal because the kit can't reach app.css's z-index
   * tokens; the value is documented in app.css's own token block so the two
   * stay legible together. (This used to read "above .hp-full (1000) and
   * .tts-full (1001), which still exist while the migration is mid-flight" —
   * that migration is now finished and both surfaces are gone.) */
  z-index: 1005;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ps-rise 0.22s ease-out;
}
.ps[hidden] {
  display: none;
}

/* The mini-player is the same item in miniature; while the full shell is up
 * it would just be the surface duplicating itself under its own backdrop.
 * `.tts-mini` carries `.hp-mini` too, so this covers both docked bars. */
body.ps-open .hp-mini {
  display: none;
}

@keyframes ps-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ps {
    animation: none;
  }
  /* Cover Flow 3D transforms are motion — flatten to the old 2D look. */
  .ps-stage-clip {
    perspective: none;
  }
  .ps-stage-row {
    transform-style: flat;
  }
  .ps-stage-prev {
    transform: translateY(-50%) scale(0.88);
  }
  .ps-stage-next {
    transform: translateY(-50%) scale(0.88);
  }
  .ps-stage::after {
    content: none;
  }
}

/* The gradient must sit on an opaque base — a gradient alone leaves the top of
 * the overlay translucent and the screen beneath shows through. Kind colour
 * tints the blur; the #08090d layer is a scrim on that blur, not the cover. */
.ps-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--ps-deck);
}
.ps-backdrop-art {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  object-fit: cover;
  filter: blur(48px) saturate(1.15);
  opacity: 0.45;
  pointer-events: none;
}
.ps-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    var(--ps-fade, linear-gradient(transparent, transparent)),
    radial-gradient(
      120% 70% at 50% 0%,
      color-mix(in srgb, var(--ps-kind, #f2a113) 12%, transparent),
      transparent 62%
    ),
    #08090da6;
}
/* Portrait: the blurred art washes into the deck's own colour over the last
 * stretch above it, instead of meeting it at a hard edge (a warm tint against
 * the deck's flat gray). On the backdrop, behind the content, so no title or
 * byline is dimmed by it; a strip painted ON TOP of the title would be. The
 * deck's height is a layout fact, so this is sized in rem from the bottom (the
 * deck is about 14rem plus the closed drawer and its gap, so it is deck-coloured
 * from 15rem up) and runs 12rem past that:
 * off by a few px it still reads as a fade, never as an edge. Landscape lays the
 * deck out in a column, where a full-width bottom fade would wash the art, so it
 * is portrait-only, and not under .ps-no-extras, whose deck is deliberately
 * transparent so the art runs behind the controls. */
@media (orientation: portrait) {
  .ps:not(.ps-no-extras) {
    --ps-fade: linear-gradient(
      to top,
      var(--ps-deck) calc(var(--ps-lip) + 25px + 15rem),
      transparent calc(var(--ps-lip) + 25px + 27rem)
    );
  }
}

/* The player stays; the extras panel is what scrolls.
 *
 * This was one scrolling block: artwork, title, transport and the chapters /
 * transcript / queue panel all inside `.ps-inner`, with the panel capped at
 * 46vh. Reading a transcript therefore scrolled the artwork, the title and
 * the transport up and off the top of the screen — reported twice, the second
 * time as "the tabs are supposed to scroll on top of the player, but instead
 * it scrolls the player up off the screen."
 *
 * A column instead: everything above the panel keeps its natural height
 * (`flex: none`, or a flex parent would compress it), and `.ps-extras` takes
 * whatever is left, with `.ps-extras-body` scrolling inside that. The panel
 * is now as tall as the screen allows rather than a fixed 46vh, which is also
 * more transcript on screen than before.
 *
 * `overflow-y: auto` stays on this element as a fallback and nothing more: on
 * a screen too short to fit the fixed part at all, scrolling it is better than
 * clipping it. In the normal case there is nothing to scroll here, so a drag
 * over the transcript cannot move the player even if it reaches the end of
 * the list. */
.ps-inner {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Swipe-down-to-close is wired on the whole panel (player-shell.js
   * _wireStageSwipe), so the browser must not claim a downward drag as its
   * own overscroll before the gesture's slop check runs. Scrolling still
   * works: the handler replicates it on the y-scroll axis, and the extras
   * drawer's own scrollable body keeps pan-y below. */
  touch-action: none;
  color: var(--ps-ink);
  font-family: var(--font-body, inherit);
  /* #659 / #1535: the extras lip (--ps-lip, 40px at the design size) + 25px
   * under the control deck. The deck itself is sticky at the same distance,
   * so this padding is what keeps the natural (non-overflow) layout identical
   * to the pinned one. */
  padding-bottom: calc(var(--ps-lip) + 25px);
}
.ps-inner > *,
.ps-col-art > *,
.ps-col-main > * {
  flex: none;
  /* Centre the column on wide screens; on a phone the cap never binds. */
  width: 100%;
  max-width: var(--pk-shell-maxw);
  margin-inline: auto;
}
.ps-inner > .ps-stack-gap,
.ps-col-main .ps-stack-gap {
  flex: 1 1 auto;
  min-height: 0;
}
.ps-inner > .ps-stage-clip,
.ps-col-art .ps-stage-clip {
  /* 298 = 290px square + 8px padding-top. `auto` collapses to the 140px
   * row floor: container-type:size ignores the child, overflow:hidden
   * shears the album. Do not shrink below that — extras overlay the art
   * now, so a short window must scroll rather than crop. */
  flex: 1 0 298px;
  min-height: 298px;
}
.ps[data-stage='cover'] .ps-inner > .ps-stage-clip,
.ps[data-stage='cover'] .ps-col-art .ps-stage-clip {
  flex-basis: 338px;
  min-height: 338px;
}
/* Full-bleed children that must NOT be constrained to the content column. */
.ps-inner > .ps-backdrop,
.ps-inner > .ps-extras,
.ps-inner > .ps-controls,
.ps-col-main > .ps-extras,
.ps-col-main > .ps-controls {
  width: auto;
  max-width: none;
  margin: 0;
}
/* The deck is full-bleed so its background reaches the backdrop edge — a
 * constrained solid deck read as a hard-edged box floating over the
 * gradient. Its children keep the content column instead. */
.ps-controls > :not(.ps-pop) {
  width: 100%;
  max-width: var(--pk-shell-maxw);
  margin-inline: auto;
}
.ps-inner > .ps-stage-clip,
.ps-col-art .ps-stage-clip {
  /* Wider than the text column: video is the one stage that benefits from
   * width. Square and cover stages are fixed-size inside it, so this only
   * ever binds for video. */
  max-width: var(--pk-shell-stage-maxw);
}

/* Portrait (and tall windows): these wrappers do not exist for layout.
 * Phone landscape makes them real columns — art left, chrome right. */
.ps-col-art,
.ps-col-main {
  display: contents;
}

/* ── 1 · Context line ─────────────────────────────────────────────────────── */

.ps-context {
  display: flex;
  align-items: center;
  gap: 10px;
  /* --safe-top when the host sets it (app.css); env() alone is 0 in WKWebView. */
  padding: calc(20px + var(--safe-top, env(safe-area-inset-top, 0px))) 14px 8px;
  /* Swipe-down-to-close (player-shell.js) owns vertical drags here; without
   * this the browser's own pan/scroll gesture recognition can beat our
   * pointer handlers to a touch, so the JS-driven transform never starts
   * smoothly — the same reason VideoSurface's .vs-head sets this. */
  touch-action: none;
}
/* The header sits on the art scrim (#08090da6), not on the paper deck. Day
 * remaps --ps-ink on .ps to navy; navy on that veil fails contrast for the
 * minimize control. Keep the dark-palette chrome tokens on scrim / cabinet
 * chrome only — never on .ps-extras or .ps-pop, which paint --ps-drawer. */
.ps-context,
.ps-skin-close,
.ps-no-extras .ps-controls > :not(.ps-pop) {
  --ps-ink: #edeff4;
  --ps-ink-dim: #c8cdd8;
  /* Brighter than the deck's --ps-muted: the art scrim lifts over pale cover
   * art, and #8a91a0 on that composite was ~2:1 for the "Playing" label. */
  --ps-muted: #c8cdd8;
  --ps-wash: #ffffff12;
  --ps-wash-strong: #ffffff26;
  --ps-line: #ffffff17;
  --ps-track: #ffffff1a;
  --color-primary-text: #f2a113;
  /* .ps-title uses color: inherit; without this it keeps .ps-inner's Day navy. */
  color: var(--ps-ink);
}
.ps-round {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--ps-wash);
  color: var(--ps-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}
@media (hover: hover) {
  .ps-round:hover {
    background: var(--ps-wash-strong);
  }
}
/* Portrait phones cannot fit the machine — hide the disc. Landscape
 * phones keep it (JS also hides it once the turntable is already on). */
@media (orientation: portrait) and (max-width: 700px) {
  .ps-context .ps-skin-toggle {
    display: none;
  }
}
.ps-fail {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}
.ps-fail[hidden] {
  display: none;
}
.ps-fail-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--ps-ink, #edeff4);
  white-space: normal;
}
.ps-fail-retry {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ps-line, #ffffff17);
  border-radius: 8px;
  background: transparent;
  color: var(--ps-ink, #edeff4);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.ps-context-label {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.65625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ps-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 2 · Stage ────────────────────────────────────────────────────────────── */

.ps-stage-clip {
  overflow: hidden;
  display: flex;
  flex-direction: column;

  /* touch-action is auto here; non-video stages override to none below.
   * The stage clip owns horizontal (Cover Flow) and downward (close) drags
   * for audio/book/podcast — none stops the browser racing JS with its
   * own pan. Video doesn't use the stage clip for gestures (the titleblock
   * below handles those; nothing of the app's is layered over the embed),
   * and the inner is overflow:hidden for video, so auto avoids dead zones. */
  touch-action: auto;
  padding: 8px 0 0;
  /* Tighter perspective than a card carousel — the vanishing point sits a
   * little above centre so sleeves read as records in a crate, not tiles
   * on a rail. Keep in sync with COVER_FLOW in player-shell.js. */
  perspective: 820px;
  perspective-origin: 50% 40%;
}
/* Non-video stages need touch-action: none on the stage clip so the
 * browser doesn't race JS with its own pan/scroll — downward drags close
 * the shell and horizontal drags do Cover Flow, both JS-driven. Video
 * doesn't use the stage clip for gestures — the titleblock below handles
 * those, and the embed owns every pixel of its own rect — and the inner is
 * overflow:hidden for video anyway, so auto just avoids dead zones where
 * touch-action:none swallowed taps on empty space around the embed. */
.ps:not([data-stage='video']) .ps-stage-clip {
  touch-action: none;
}
.ps-stage-row {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 140px;
  /* Floor is the clip's 298px basis, not this 140. Leftover height
   * still lands here so the 290px square can sit in a taller stage. */
}
/* Extras overlay the art rather than stealing its pixels. */
.ps-stage-row {
  /* Preserve 3D so children's rotateY/translateZ render in perspective. */
  transform-style: preserve-3d;
  /* Size container for the video stage's cqw/cqh fit. Children cannot
   * size this row — `flex: 1` and the clip's 298px basis decide it. */
  container-type: size;
}
/* A 16:9 video is width-bound on a phone — measured 390x219 inside a 346px
 * row — so centring it left a 63px dead band above and 64 below, and the
 * picture floated in the middle of the screen. Top-align it: the video
 * starts directly under the context row, which is where the eye already is.
 *
 * Video only. The square (290px) and cover (220x330) stages are fixed-size,
 * and centring is what keeps Cover Flow's rotated neighbours symmetric about
 * the current art. Alignment, not sizing: the row keeps `flex: 1` so its
 * height stays definite, which the @supports 100cqh rule below depends on —
 * shrinking the row to the picture instead would make cqh indefinite and
 * collapse the very box it is meant to size. */
.ps[data-stage='video'] .ps-stage-row {
  align-items: flex-start;
}
.ps-stage {
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 28px 50px -22px #000,
    0 0 0 1px rgba(255, 255, 255, 0.04);
  background: var(--ps-drawer);
  display: grid;
  place-items: center;
  color: var(--ps-muted);
  /* Cover Flow: GPU-accelerated 3D transforms. */
  will-change: transform;
  backface-visibility: hidden;
}
/* Specular wash that tracks --ps-flip-light (0 face-on, ~0.7 edge-on).
 * JS writes the variable during a drag; rest poses set it in CSS. */
.ps-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
  background: linear-gradient(
    var(--ps-flip-az, 90deg),
    rgba(0, 0, 0, 0.5),
    rgba(255, 255, 255, 0.1) 46%,
    rgba(0, 0, 0, 0.42)
  );
  opacity: var(--ps-flip-light, 0);
  mix-blend-mode: overlay;
}
.ps[data-stage='video'] .ps-stage::after {
  content: none;
}
.ps-stage-cur {
  position: relative;
  flex: none;
  transform-origin: center center;
  /* Cover Flow: heavier than --transition; a sleeve has mass. */
  transition:
    transform 0.38s cubic-bezier(0.22, 0.8, 0.2, 1),
    filter 0.38s cubic-bezier(0.22, 0.8, 0.2, 1);
}
.ps-stage-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Exactly one of art/fallback is visible at a time; the stage is a grid, so a
 * stray second child gives it two rows and neither lands where it should.
 * Both get an explicit `[hidden]` rule: `display: block` above already
 * outranks the UA sheet's `[hidden] { display: none }` for the art, and the
 * fallback only survives on the UA rule today — one later `display:` on it
 * would silently reintroduce the same bug. */
.ps-stage-art[hidden],
.ps-stage-fallback[hidden] {
  display: none;
}

/* Stage shapes — the one zone whose geometry varies by kind. */
.ps[data-stage='square'] .ps-stage-cur {
  width: 290px;
  height: 290px;
}
.ps[data-stage='cover'] .ps-stage-cur {
  width: 220px;
  height: 330px;
}
.ps[data-stage='video'] .ps-stage-cur {
  /* BASE: the pre-container-query sizing, and it must stay first.
   *
   * A video stage has no intrinsic content — both .ps-stage-art and
   * .ps-stage-fallback are hidden, the picture is a parked iframe — so a rule
   * that gives it neither a width nor a height computes to 0×0, and
   * _parkVideo's `if (!box.width || !box.height) return;` then bails on every
   * repaint tick. The video would never appear at all, on any engine without
   * container queries. This app's floor is iOS 15 (IOS-BUILD-PRD.md); cqw/cqh
   * need Safari 16. `aspect-ratio` shipped in Safari 15, which is why THIS
   * rule is safe there.
   *
   * Height-bound, so on a tall narrow row it is squarer than 16:9 rather than
   * a band — imperfect, and the reason for the override below — but never
   * zero. */
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}
/* ENHANCEMENT: an actual 16:9 band, bound by whichever dimension runs out
 * first.
 *
 * `width: auto; height: 100%` above cannot do that: an explicit height makes
 * `aspect-ratio` inert, so a tall row grew the box tall and `max-width`
 * clamped the width — 390×389 on a phone, 834×657 on a tablet. It only looked
 * right on a laptop, where the row happens to be short and wide enough for
 * height to be the binding dimension.
 *
 * min() against the row's own two dimensions picks the binding one explicitly.
 * Gated on @supports rather than applied unconditionally so the base rule above
 * survives on engines that would drop these declarations at parse time.
 * `container-type: size` on .ps-stage-row needs no guard — it is simply ignored
 * where unsupported. */
@supports (container-type: size) {
  .ps[data-stage='video'] .ps-stage-cur {
    width: min(100cqw, calc(100cqh * 16 / 9));
    height: auto;
  }
}

/* A video stage is the live embed, parked over this rect by the surface that
 * owns it (it cannot be moved into this DOM — re-parenting an iframe reloads
 * it on iOS). Parked means position:fixed against the viewport, so the panel
 * must not scroll underneath it or the video would sit still while everything
 * around it moved. The extras drawer overlays the inner area when open, so
 * the video stays parked and the drawer covers it. */
.ps[data-stage='video'] .ps-inner {
  overflow: hidden;
}

.ps-stage-prev,
.ps-stage-next {
  position: absolute;
  top: 50%;
  width: 200px;
  height: 200px;
  opacity: 0.7;
  --ps-flip-light: 0.55;
  transform: translateY(-50%) scale(0.88);
  pointer-events: none;
  /* Cover Flow: neighbours rest crate-steep (66° / −140px Z), hinged on
     the edge that faces the current sleeve. Keep in sync with COVER_FLOW.
     JS writes the live pose during a drag; this transition is the snap-back. */
  transition:
    transform 0.38s cubic-bezier(0.22, 0.8, 0.2, 1),
    opacity 0.38s cubic-bezier(0.22, 0.8, 0.2, 1),
    filter 0.38s cubic-bezier(0.22, 0.8, 0.2, 1);
}
.ps-stage-prev {
  right: calc(50% + var(--ps-half-stage, 140px));
  margin-right: 0;
  transform-origin: right center;
  --ps-flip-az: 270deg;
  transform: translateY(-50%) scale(0.88) rotateY(66deg) translateZ(-140px);
}
.ps-stage-next {
  left: calc(50% + var(--ps-half-stage, 140px));
  margin-left: 0;
  transform-origin: left center;
  --ps-flip-az: 90deg;
  transform: translateY(-50%) scale(0.88) rotateY(-66deg) translateZ(-140px);
}
.ps-stage-prev[hidden],
.ps-stage-next[hidden] {
  display: none;
}

.ps-kind-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  background: #08090dcc;
  color: var(--ps-kind, #f2a113);
  font-size: 0.59375rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ps-track-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  min-height: 22px;
}
/* _paintDots sets `hidden` on this row for a queue with nothing to move to,
 * and `display: flex` above outranks the UA sheet's `[hidden] {display:none}`
 * — so a single-item queue (a radio station, an archive track) showed a ‹ ›
 * pair with no dots between them and nothing on either side of it. Same trap
 * .ps-stage-art[hidden] already carries a rule for; the JS was right and the
 * stylesheet was quietly ignoring it. */
.ps-track-nav-row[hidden] {
  display: none;
}
.ps-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-height: 5px;
}
.ps-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--ps-wash-strong);
  transition:
    width 0.18s,
    background 0.18s;
}
.ps-dot.is-on {
  width: 14px;
  background: var(--color-primary, #f2a113);
}

/* ── 3 · Title block ──────────────────────────────────────────────────────── */

.ps-titleblock {
  text-align: center;
  margin-top: 8px;
  padding: 0 14px;
}
/* One line, then ellipsis. Two-line -webkit-line-clamp on a <button> is
 * ignored on iOS, so a wrapping title ran into the remaining-time rail —
 * worst on video, where .ps-inner cannot scroll. Tap (or Enter) opens the
 * full title and description — #813's sheet.
 *
 * A button, not a div: truncating makes that tap the only way to read the
 * full text, so it has to be reachable by keyboard and AT too. Chrome reset
 * the same way .ps-source-link does below — a bare <button> here paints the
 * host's grey fill and an outset border. */
.ps-title {
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  /* font: inherit, not a re-declared family/size — the same reset
   * .ps-source-link uses below. A bare <button> carries the UA's
   * `font: 400 …` shorthand, which would silently decouple the title from
   * any weight the shell later sets. The title's own size/leading/tracking
   * stay explicit because they are the design, not the reset. */
  font: inherit;
  font-family: var(--font-display, inherit);
  font-size: calc(1.3125rem * 0.9);
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-align: center;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
/* The title block is a swipe-down-to-close surface for ALL track kinds
 * (_wireStageSwipe wires it with allowFor: () => true). Needs touch-action:
 * none for the same reason the art does: a browser free to start its own
 * vertical pan can win the race against JS before pointerdown ever fires.
 * Taps still pass through to source/author links because setPointerCapture
 * is deferred until after the slop threshold. */
.ps-titleblock {
  touch-action: none;
}
.ps-source {
  margin-top: 4px;
  font-size: 0.78125rem;
  color: var(--color-primary-text, #f2a113);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* A link at rest, not only on hover: the date sits beside it in the same
 * line and the two must never look alike (§8). */
.ps-source-link,
.ps-author-link {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #f2a11359;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .ps-source-link:hover,
  .ps-author-link:hover {
    text-decoration-color: currentColor;
  }
}
.ps-source-date {
  color: var(--ps-muted);
}
.ps-pos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}
.ps-pos {
  font-size: 0.71875rem;
  color: var(--ps-muted);
  /* Podcast/YouTube chapter titles can be a paragraph. Two lines, then
   * ellipsis — otherwise the title block shoves transport off the screen. */
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-align: center;
}
/* Jump to the previous/next chapter boundary — a different action from
 * rew/ff's fixed-duration skip, so it lives beside the chapter name rather
 * than in the transport row with them. Only chapters (podcast/video) get
 * this; a book's sections switch via the Reader screen's own Previous/Next
 * instead of a seek within the same track (see _paintTitle, player-shell.js). */
.ps-chapter-nav {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ps-muted);
  cursor: pointer;
}
@media (hover: hover) {
  .ps-chapter-nav:hover:not(:disabled) {
    color: var(--ps-ink);
    background: var(--ps-wash);
  }
}
.ps-source[hidden],
.ps-pos-row[hidden],
.ps-chapter-nav[hidden] {
  display: none;
}
/* ── 3.5 · Control deck ────────────────────────────────────────────────────
 *
 * Scrubber, transport, pops and the five keys ride in one sticky deck pinned
 * to the bottom of .ps-inner's scroll area. A wrapping episode title used to
 * grow .ps-titleblock and shove these rows down under the extras strip and
 * off the screen; now the title scrolls behind them instead. `bottom: 0`
 * lands the deck on the content-box edge — the padding-bottom on
 * .ps-inner (--ps-lip + 25px) is what leaves 25px between the keys and the drawer, and it
 * makes the natural (non-overflow) layout identical to the pinned one, so
 * nothing moves on a screen that already fits. Sticky, not absolute:
 * absolute children of a scroller ride the content and would drift with it. */
.ps-controls {
  position: sticky;
  bottom: 0;
  /* Opaque, and it has to be. The deck is the one thing that sits over the
   * scrolling title, and a transparent deck let the title and byline show
   * through the "X min left" readout at large text sizes (reproduced at 200%
   * on dev and main). The backdrop is #08090d under a dimmed art wash, so the
   * deck still meets that wash at an edge; the fade strip below softens it. */
  background: var(--ps-deck);
  /* The 25px below the deck, down to the closed drawer, is .ps-inner's bottom
   * padding, so it showed the blurred art wash: a third, lighter gray between
   * two flat ones. Paint it in the deck's own colour. It lives on the deck, not
   * on the drawer: the deck is sticky and moves with the scroll, so the fill
   * always sits directly under it and the opaque drawer (z-index 10) covers
   * whatever of it the drawer overlaps. The first version put it on the drawer
   * as a shadow reaching UP 25px, which painted over the bottom of the key row
   * in landscape (no padding there) and over the transport row when a short
   * portrait screen scrolls. */
  box-shadow: 0 25px 0 0 var(--ps-deck);
}

/* The deck is opaque, so it cut a hard horizontal edge across the blurred
 * artwork behind it: art wash above, flat #08090d from the scrubber down,
 * art wash again below the keys. Visible on every track that has artwork.
 *
 * The blend goes ABOVE the deck rather than into it. A gradient on the deck
 * itself would put its transparent end exactly where `.ps-left` ("X min
 * left") sits, just under its top edge (.ps-scrub's margin-top): the very
 * text the title was reported colliding with — so the fade would reintroduce
 * the bleed it exists to hide. A strip
 * on top of the deck's own edge blends the art into it and leaves every
 * pixel the deck actually draws on fully opaque. */
.ps-controls::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 24px;
  background: linear-gradient(to top, var(--ps-deck), transparent);
  /* The title is a swipe-down-to-close surface and sits under this strip;
   * without it the fade would eat those drags. */
  pointer-events: none;
}

/* No drawer, nothing to stay clear of — drop the pin. `relative`, not
 * `static`: it lays out identically (zero offsets) but keeps .ps-controls a
 * containing block for .ps-pop, whose `bottom: calc(100% + 8px)` would
 * otherwise resolve against .ps-inner and float the speed/sleep ladder
 * above the whole shell instead of above the deck (#1654). */
.ps-no-extras .ps-controls {
  box-shadow: none;
  position: relative;
  /* Unpinned, so nothing scrolls under the deck: the panel would hide
   * nothing and only cut a hard edge across the artwork. Same for the strip
   * that fades into it. */
  background: none;
}
.ps-no-extras .ps-controls::before {
  display: none;
}

/* ── 4 · Scrubber ─────────────────────────────────────────────────────────── */

.ps-scrub {
  padding: 0 14px;
  /* +3 of the 10px leftover from the smaller square: lifts remaining-time. */
  margin-top: 11px;
}
.ps-left {
  text-align: right;
  color: var(--color-primary-text, #f2a113);
  font-family: var(--font-display, inherit);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.ps-left[hidden] {
  display: none;
}
.ps-scrub-track {
  position: relative;
}
.ps-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  /* 44px hit target; the gradient is a 4px rail centered in that box so a
   * tap anywhere on the timeline seeks. padding:0 kills the app-wide input
   * padding that used to inflate height. */
  height: 44px;
  padding: 0;
  /* app-wide input border leaks here — a 1px box around the 44px hit
   * target read as a faint outline around the time bar. */
  border: 0;
  margin: 0;
  border-radius: 0;
  background: linear-gradient(
      to right,
      var(--color-primary, #f2a113) 0 var(--pct, 0%),
      var(--ps-track) var(--pct, 0%) 100%
    )
    no-repeat center / 100% 4px;
  background-color: transparent;
  outline: none;
  box-shadow: none;
  cursor: pointer;
}
.ps-seek:focus {
  outline: none;
  box-shadow: none;
}
.ps-seek:focus-visible {
  outline: none;
  box-shadow: none;
}
.ps-seek:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--color-primary, #f2a113);
}
.ps-seek:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--color-primary, #f2a113);
}
.ps-seek::-webkit-slider-runnable-track {
  background: transparent;
  border: 0;
  height: 4px;
}
.ps-seek::-moz-range-track {
  background: transparent;
  border: 0;
  height: 4px;
}
.ps-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  /* (4px track − 12px thumb) / 2. WebKit top-aligns the thumb to the
   * runnable track, which hangs the square under the painted rail. The
   * thumb stays 12px on purpose: the 44px-tall input is the hit target —
   * a wider thumb would only shrink the travel range and pull the square
   * away from the fill (#977, #1880). */
  margin-top: -4px;
  border-radius: 2px;
  border: 0;
  background: var(--color-primary, #f2a113);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary, #f2a113) 15%, transparent);
  cursor: pointer;
}
.ps-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 0;
  background: var(--color-primary, #f2a113);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary, #f2a113) 15%, transparent);
  cursor: pointer;
}
.ps-seek:disabled {
  cursor: default;
}
.ps-seek:disabled::-webkit-slider-thumb {
  display: none;
}
.ps-seek:disabled::-moz-range-thumb {
  visibility: hidden;
}
.ps-chapter-ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  pointer-events: none;
}
.ps-chapter-ticks i {
  position: absolute;
  top: 0;
  width: 2px;
  height: 4px;
  background: #08090d99;
}
.ps-times {
  display: flex;
  justify-content: space-between;
  /* The seek's 44px is hit slop — the painted rail is the middle 4px, so a
   * positive margin here measures from the bottom of the slop and leaves a
   * ~28px gap under the rail. Pull the times up to just under the rail; the
   * slop is transparent, so nothing visible is overlapped. */
  margin-top: -12px;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ps-muted);
}

/* ── 5 · Transport ────────────────────────────────────────────────────────── */

/* Every control here is square. It is the app's signature, and the reason the
 * transport reads as a machine rather than a media widget. Geometry is
 * identical for every kind — a control that can't work for the current source
 * is disabled in place, never removed, so nothing shifts between items. */
.ps-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
  /* +4 of the 10px leftover: space between the rail and 15 / play / 30. */
  margin-top: 12px;
}
.ps-sq {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: 1px solid var(--ps-line);
  color: var(--ps-ink);
  cursor: pointer;
  /* A hold opens the speed ladder — without these the same hold also selects
   * the label and raises the copy/paste callout over the picker. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* Sit 5px below the play button's centre line. */
  margin-top: 5px;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.ps-sq-sm {
  width: 48px;
  height: 48px;
  border-radius: 5px;
  font-size: 0.78125rem;
  font-weight: 500;
}
.ps-sq-md {
  width: 57px;
  height: 57px;
  border-radius: 6px;
}
/* #813: Speed and Sleep Timer lose their box outline — only <<, >> and
 * Play/Pause keep the bordered shape in the transport row. */
.ps-sq-bare {
  border: 0;
}
.ps-sq-bare:focus-visible:not(:disabled) {
  border-color: transparent;
}
@media (hover: hover) {
  .ps-sq-bare:hover:not(:disabled) {
    border-color: transparent;
  }
}
.ps-sq:focus-visible:not(:disabled) {
  border-color: var(--color-primary, #f2a113);
  color: var(--color-primary-text, #f2a113);
}
@media (hover: hover) {
  .ps-sq:hover:not(:disabled) {
    border-color: var(--color-primary, #f2a113);
    color: var(--color-primary-text, #f2a113);
  }
}
.ps-sq:disabled {
  opacity: 0.32;
  cursor: default;
}
.ps-sq.is-on {
  border-color: var(--color-primary, #f2a113);
  color: var(--color-primary-text, #f2a113);
}
.ps-sq-num {
  font-size: 0.59375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.ps-sleep-count {
  font-size: 0.59375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ps-play {
  flex: none;
  width: 65px;
  height: 65px;
  border: 0;
  border-radius: 8px;
  background: var(--color-primary, #f2a113);
  color: var(--ps-on-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--color-primary, #f2a113) 50%, transparent);
}
.ps-play:active {
  transform: scale(0.96);
}

/* When the source genuinely can't scrub (a bare Rumble iframe has no API at
 * all), the track stays for layout but stops pretending to be interactive. */
.ps-no-seek .ps-seek {
  opacity: 0.4;
}

/* ── Popovers ─────────────────────────────────────────────────────────────── */

/* Above .ps-extras (z-index 10). Absolute so opening the ladder is a
 * popup over the artwork, not a reflow that shrinks the stage. The extras
 * strip is absolute on the bottom of .ps-inner; without the z-index the
 * speed / sleep chips paint under Queue / Chapters / Transcript. */
.ps-pop {
  position: absolute;
  z-index: 11;
  inset: auto 14px calc(100% + 8px) 14px;
  width: auto;
  max-width: var(--pk-shell-maxw);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: var(--ps-drawer);
  box-shadow: 0 16px 40px #00000073;
}
.ps-pop[hidden] {
  display: none;
}
.ps-pop-label {
  font-size: 0.65625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ps-muted);
  margin-bottom: 8px;
}
.ps-pop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ps-pop-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--ps-line);
  background: none;
  color: var(--ps-ink-dim);
  font-size: 0.71875rem;
  cursor: pointer;
}
@media (hover: hover) {
  .ps-pop-chip:hover {
    border-color: var(--color-primary, #f2a113);
    color: var(--color-primary-text, #f2a113);
  }
}

/* ── The five action keys (§10) ────────────────────────────────────────────
 *
 * One row under the transport, five equal children capped at 62px: Star,
 * Played, Clip, List, More. Star and Played are stateful and show it — the
 * label changes as well as the fill, so nothing depends on reading a colour.
 */

.ps-chips {
  display: flex;
  justify-content: center;
  gap: 6px;
  /* +3 of the 10px leftover: space between transport and the five keys. */
  margin-top: 16px;
  padding: 0 14px;
}
.ps-key {
  flex: 1;
  max-width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  border-radius: 7px;
  border: 0;
  background: none;
  color: var(--ps-ink-dim);
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}
.ps-key-label {
  display: block;
  font-size: 0.75rem;
  line-height: 1.15;
  color: inherit;
}
/* #813: No border on action keys — hover just changes color, and the on-state
 * uses a subtle background tint instead of a border. */
@media (hover: hover) {
  .ps-key:not(.is-on):hover {
    color: var(--color-primary-text, #f2a113);
  }
}
.ps-key.is-on {
  background: #f2a11317;
  color: var(--color-primary-text, #f2a113);
}
/* Still a pill wherever one is genuinely a chip rather than a key — the
 * about panel's own row keeps its shape. */
.ps-chip {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--ps-line);
  background: none;
  color: var(--ps-ink-dim);
  font-size: 0.71875rem;
  cursor: pointer;
}
@media (hover: hover) {
  .ps-chip:hover {
    border-color: var(--color-primary, #f2a113);
    color: var(--color-primary-text, #f2a113);
  }
}

/* ── 6 · Extras drawer ─────────────────────────────────────────────────────── */

/* Closed: a thin tab strip docked at the bottom. Open: that same box
 * grows UP to --ps-extras-top (the art). Height + bottom:0, never top:
 * pinning `top` on open leaves a gap where the strip was. column-reverse
 * keeps the labels on that bottom edge, in reach of the thumb. */
.ps-extras {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  /* Full-bleed closed strip — the old 14px side inset read as a floating
   * card, not the lip of a drawer. */
  margin: 0;
  border-top: 1px solid var(--ps-line);
  padding-top: 6px;
  display: flex;
  flex-direction: column-reverse;
  background: var(--ps-drawer);
  border-radius: 0;
  /* Closed: only the head strip shows. The body is hidden so the artwork
   * above is fully visible and never shrinks. */
  height: var(--ps-lip);
  overflow: hidden;
  transition: height 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
.ps-no-extras .ps-extras {
  display: none;
}
/* Open: fill from the art to the bottom. No `top` — height + bottom:0
 * is what makes the strip rise instead of jump. --ps-extras-top is
 * .ps-stage-clip.offsetTop so Close / Playing from stay clear. */
.ps.ps-extras-open .ps-extras {
  height: calc(100% - var(--ps-extras-top, 0px));
  bottom: 0;
  margin: 0;
  border-radius: 0;
  border-top: 0;
  background: var(--ps-drawer);
}
/* Tabs sit on the right for the thumb, with 14px of edge padding. They
 * scroll horizontally rather than squeezing, so the grow button keeps
 * its width whatever the tab set is. */
.ps-extras-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: none;
  padding: 0 14px 4px;
  cursor: pointer;
  /* Own stacking context and opaque fill so extras-body text cannot paint
   * through the tab labels or out over the host tab bar. column-reverse
   * puts the body earlier in paint order's sibling list otherwise. */
  position: relative;
  z-index: 2;
  background: var(--ps-drawer);
}
.ps-ask {
  padding: 18px 12px 8px;
}
.ps-ask p {
  margin: 0 0 14px;
  color: var(--ps-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}
.ps-ask-act {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #f2a113;
  color: var(--ps-on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ps-extras-tabs {
  display: flex;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
/* Right-align when there is room; when tabs overflow, flex-start + scroll
 * keeps every label reachable. justify-content:flex-end clips the start side
 * with no scroll range (scrollWidth stays equal to clientWidth). */
.ps-extras-tabs .ps-tab:first-child {
  margin-left: auto;
}
.ps-extras-tabs::-webkit-scrollbar {
  display: none;
}
.ps-extras-grow {
  flex: none;
  width: 32px;
  height: 32px;
  margin-top: -6px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ps-muted);
  cursor: pointer;
  transition:
    color 0.15s,
    transform 0.2s;
}
@media (hover: hover) {
  .ps-extras-grow:hover {
    color: var(--ps-ink);
  }
}
.ps-extras-open .ps-extras-grow {
  transform: rotate(180deg);
  color: var(--ps-ink);
}
.ps-tab {
  background: none;
  border: 0;
  padding: 0 0 8px;
  font: inherit;
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--ps-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.ps-tab.is-on {
  color: var(--ps-ink);
  border-bottom-color: var(--color-primary, #f2a113);
}
/* The body is hidden when the drawer is closed and scrolls when open. */
.ps-extras-body {
  margin-bottom: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* .ps-inner is touch-action: none now (the panel-wide close swipe), which
   * would otherwise swallow this body's own scroll. */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  /* No env(safe-area-inset-bottom) term here: .ps's own bottom inset already
   * stops above that safe area (see .ps's --pk-dock-bottom note) rather than
   * reaching into it, so double-counting it here would just pad the last row
   * away from the tab bar for no reason. */
  padding: 0 4px 22px;
}
/* Closed: the body is hidden so the strip is just the tab row. */
.ps:not(.ps-extras-open) .ps-extras-body {
  display: none;
}
.ps-row {
  display: flex;
  align-items: baseline;
  gap: 11px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--ps-line);
  background: none;
  color: var(--ps-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ps-row-lead {
  flex: none;
  min-width: 42px;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ps-muted);
}
.ps-row-text {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.ps-row.is-on .ps-row-lead,
.ps-row.is-on .ps-row-text {
  color: var(--color-primary-text, #f2a113);
}
.ps-row-art {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
}
.ps-row-art[data-ch-art] {
  cursor: zoom-in;
}
.ps-row-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  border-top: 1px solid var(--ps-line);
}
.ps-row-wrap .ps-row {
  border-top: 0;
  flex: 1;
  min-width: 0;
}
.ps-row-wrap.is-on .ps-row-lead,
.ps-row-wrap.is-on .ps-row-text {
  color: var(--color-primary-text, #f2a113);
}
.ps-row-act {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ps-muted);
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}
@media (hover: hover) {
  .ps-row-act:hover {
    color: var(--ps-ink);
    background: var(--ps-wash);
  }
}
.ps-row-act:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Read along. Prose rather than rows: no lead column, no rules between, and a
 * measure that stays readable — this is the one tab you look at for minutes
 * rather than glance at. Dimmed by default so the paragraph being spoken is
 * findable at a glance without the rest becoming unreadable if you want to
 * read ahead. */
.ps-read-para {
  margin: 0 0 12px;
  /* The gutter the active paragraph's bar sits in, reserved on EVERY
   * paragraph. The active one used to claim it with `margin-left: -12px`,
   * which put the bar outside the extras panel's overflow clip — so the bar
   * never appeared at all, and the two pixels of text that had moved past the
   * clip edge were shaved off the first glyph of every line. Reserving it
   * here costs 12px of measure and means nothing shifts as the highlight
   * moves down the column. */
  padding-left: 12px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ps-muted);
  transition: color 0.2s;
}
.ps-read-para.is-on {
  color: var(--ps-ink);
  /* The bar carries the highlight rather than a background fill: a block of
   * colour behind running text is what makes long-form unreadable. Amber is
   * the player's way of saying "here" — kind colour stays on the backdrop
   * and the stage badge. */
  box-shadow: inset 2px 0 var(--color-primary, #f2a113);
}
@media (prefers-reduced-motion: reduce) {
  .ps-read-para {
    transition: none;
  }
}

/* About's meta lines are facts, not controls — same two-column rhythm as the
 * rest of the strip, but nothing about them is tappable. */
.ps-row.is-static {
  cursor: default;
}
/* A transcript the publisher shipped as prose rather than timed cues: still
 * worth reading, but there is no timestamp to send you to. */
.ps-row:disabled {
  cursor: default;
}

/* Splits a list that has real groups in it — the two narration providers,
 * which are a genuine choice (server-synthesized vs. downloaded to the
 * device) rather than one long roster. */
.ps-group-label {
  padding: 14px 0 2px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ps-muted);
}
.ps-group-label:first-child {
  padding-top: 4px;
}

.ps-about-desc {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ps-ink-dim);
  white-space: pre-wrap;
}
.ps-about-desc a {
  color: var(--color-primary-text, #f2a113);
}
.ps-about-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.ps-about-acts .ps-chip.is-on {
  border-color: var(--color-primary, #f2a113);
  color: var(--color-primary-text, #f2a113);
}

/* Phone landscape: when portrait lock is ignored, do not squash the
 * stacked player. Art / video on the left, chrome on the right. Tall
 * windows (desktop, tablet landscape) keep the portrait column. */
@media (orientation: landscape) and (max-height: 500px) {
  .ps:not(.ps-skinned) .ps-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: stretch;
    overflow: hidden;
    padding-bottom: 0;
  }
  .ps:not(.ps-skinned) .ps-inner > .ps-context {
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    padding: 8px 14px;
  }
  .ps:not(.ps-skinned) .ps-col-art,
  .ps:not(.ps-skinned) .ps-col-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    width: auto;
    max-width: none;
    margin: 0;
  }
  .ps:not(.ps-skinned) .ps-col-art {
    /* The picture owns the left half — a video is the reason to rotate. */
    flex: 1 1 55%;
    justify-content: center;
    padding: 0 0 8px 12px;
  }
  .ps:not(.ps-skinned) .ps-col-main {
    /* The chrome keeps its portrait column width — the controls are the
     * same size they are upright, not stretched across the leftover. */
    flex: 0 1 45%;
    position: relative;
    max-height: 100%;
    min-height: 0;
    padding: 0 12px 0 6px;
  }
  /* Landscape has no opaque deck: title and transport sit on the art scrim.
   * Scope dark ink to those nodes only — .ps-extras is the paper drawer. */
  .ps:not(.ps-skinned) .ps-col-main .ps-titleblock,
  .ps:not(.ps-skinned) .ps-col-main .ps-track-nav-row,
  .ps:not(.ps-skinned) .ps-col-main .ps-controls > :not(.ps-pop) {
    --ps-ink: #edeff4;
    --ps-ink-dim: #c8cdd8;
    --ps-muted: #c8cdd8;
    --ps-wash: #ffffff12;
    --ps-wash-strong: #ffffff26;
    --ps-line: #ffffff17;
    --ps-track: #ffffff1a;
    --color-primary-text: #f2a113;
    color: var(--ps-ink);
  }
  .ps:not(.ps-skinned) .ps-col-main .ps-extras {
    position: relative;
    left: auto;
    right: auto;
    height: var(--ps-lip);
  }
  .ps:not(.ps-skinned) .ps-stage-clip {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    width: 100%;
    padding-top: 0;
  }
  /* Video is top-aligned in its row, so zeroing the clip's padding left the
   * picture flush under the context row. The centred square and cover art
   * get their gap from centring; video gets the same 8px portrait has. */
  .ps:not(.ps-skinned)[data-stage='video'] .ps-stage-clip {
    padding-top: 8px;
  }
  .ps:not(.ps-skinned)[data-stage='square'] .ps-stage-cur {
    width: auto;
    height: min(100%, 260px);
    max-width: 100%;
    aspect-ratio: 1;
  }
  .ps:not(.ps-skinned)[data-stage='cover'] .ps-stage-cur {
    width: auto;
    height: min(330px, 100%);
    max-width: 100%;
    aspect-ratio: 2 / 3;
  }
  .ps:not(.ps-skinned) .ps-stage-prev,
  .ps:not(.ps-skinned) .ps-stage-next {
    display: none;
  }
  .ps:not(.ps-skinned) .ps-col-main .ps-stack-gap {
    flex: 1 1 auto;
    min-height: 0;
  }
  .ps:not(.ps-skinned) .ps-controls {
    position: static;
    /* Static here, and .ps-inner does not scroll: nothing passes under the
     * deck, so it paints no panel. The strip goes too: with the deck static,
     * `bottom: 100%` resolved against .ps-col-main and laid the fade across
     * the header queue and turntable buttons (#2481). */
    background: none;
  }
  .ps:not(.ps-skinned) .ps-controls::before {
    display: none;
  }
  .ps:not(.ps-skinned) .ps-controls > * {
    max-width: none;
  }
  .ps:not(.ps-skinned) .ps-scrub {
    margin-top: 4px;
  }
  .ps.ps-extras-open:not(.ps-skinned) .ps-extras {
    height: 100%;
  }
}

/* ── The turntable skin ─────────────────────────────────────────────────── */
/*
 * The machine sits over the standard chrome rather than replacing the shell:
 * open(), close(), the swipe-to-close and the 250ms poll all keep working, and
 * none of them knows the skin exists. Hiding .ps-inner rather than not
 * rendering it means switching back is a class change, not a rebuild.
 *
 * The 1144x560 drawing is never re-laid-out, only scaled (TURNTABLE.md 0), so
 * it is centred and left to its own dimensions here. */
/* `.ps.ps-skinned`, not `.ps-skinned` — one extra class, kept deliberately.
 *
 * The video block up the file used to carry
 * `.ps[data-stage='video'] .ps-inner { display: flex }`, which outweighs a
 * bare `.ps-skinned .ps-inner` — three compound selectors to two. So the
 * standard chrome went on rendering underneath the machine for exactly one
 * stage: video. That is the stage where the embed then parked itself over the
 * shell's full-width 16:9 stage box and buried the turntable.
 *
 * The extras-drawer rework has since dropped that `display: flex`, so the
 * weights no longer collide today. The extra class stays anyway: this rule
 * has to beat whatever any stage decides `.ps-inner`'s display should be, and
 * the last time that was left to chance it cost a buried machine and a
 * check-run to find. */
.ps.ps-skinned .ps-inner {
  display: none;
}
/* Skinned, the shell takes the bottom of the screen too.
 *
 * `.ps` normally stops short of it — `bottom: calc(var(--pk-dock-bottom) +
 * env(safe-area-inset-bottom))` — reserving whatever docks along the bottom
 * of the app (the tab bar, a mini player) plus the home indicator. That is
 * right for the standard player, which is a panel with the app still around
 * it. The machine is not a panel: it is the whole presentation, and the
 * reserve was the last of the dead space around it.
 *
 * Measured at the reporting device's 932×430 with its 20pt home-indicator
 * inset. Reclaiming it takes the machine from 838×410 to 878×430 — scale
 * 0.732 to 0.768 — and, because the fit is height-bound, the side bands fall
 * from 47pt to 27pt at the same time. The remaining 27pt each side is
 * irreducible: the drawing is 2.043:1 against a 2.167:1 screen, so the
 * leftover width has nowhere to go that does not stretch it.
 *
 * The cost, stated plainly: the bottom row of the machine — the transport
 * keys and RECORD — now sits inside the home indicator's gesture strip, and
 * whatever was docked under the shell is covered for as long as the machine
 * is up. Rotating to portrait takes the machine down and brings both back. */
.ps.ps-skinned {
  bottom: 0;
}
.ps-skin {
  position: absolute;
  /* The whole viewport, deliberately — including whatever the notch covers.
   *
   * This used to reserve the safe area: `left/right: max(12px,
   * env(safe-area-inset-left/right))`, to keep the machine clear of the notch
   * in landscape. It worked, and the cost was worse than the problem. iOS
   * reports 59pt on BOTH sides in landscape (measured on the reporting
   * device, via the placement diagnostic), so the machine lost 118 of 932
   * points — 13% of the width — and scaled down to suit, leaving a visible
   * band of dead space down each side.
   *
   * The owner's call, made looking at it: expand to fill, and let the notch
   * cover part of the chassis. That is the right trade for this particular
   * drawing. The outer edge of the machine is bezel — the deck's controls,
   * the monitor and the receiver all sit well inboard of it — so what the
   * notch actually eats is a corner of the casing, not a control.
   *
   * INSET, not padding, and that distinction stays load-bearing whatever the
   * numbers are. The machine is centred by `left: 50%` on an absolutely
   * positioned child, and percentages there resolve against the PADDING box —
   * so padding here would be inside the box being halved and would be
   * silently ignored, which is exactly how the original notch reserve failed
   * before it was rewritten as an inset. _fitSkin measures this same box, so
   * the scale and the centring agree about what "available" means.
   *
   * Kept as four explicit longhands rather than `inset: 0` so that anything
   * reserved here later is written in the one place that already carries the
   * reasoning. */
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  /* hidden, not auto. The machine is scaled to fit now, so there is nothing
   * to scroll to — and a scroll container here let a phone pan around a
   * machine that was too big instead of showing all of it. */
  overflow: hidden;
}
/* The skin's own close — .ps-inner (and its chevron) is display:none while
 * the machine is up, so this is the only visible exit. Top-left, where the
 * standard shell's close sits; z-index 1 keeps it under the extras drawer's
 * scrim (z-index 2 on .ps-inner) when MORE is open. */
.ps-skin-close {
  position: absolute;
  top: calc(14px + var(--safe-top, env(safe-area-inset-top, 0px)));
  left: calc(14px + env(safe-area-inset-left, 0px));
  z-index: 1;
}
/* The extras drawer, opened over the machine by its MORE key.
 *
 * `.ps.ps-skinned .ps-inner { display: none }` above is what takes the
 * standard chrome away; this is the one documented exception to it. Only the
 * drawer comes back — every other child of .ps-inner is a thing the machine
 * has already replaced, and showing the transport twice is worse than not
 * showing it at all. */
.ps.ps-skinned.ps-skin-extras .ps-inner {
  display: flex;
  padding-bottom: 0;
  /* Above .ps-skin, which is appended AFTER .ps-inner and so paints over it
   * by document order. Without this the scrim below went under the machine
   * and dimmed nothing — the panel still showed, because .ps-extras carries
   * its own z-index, which is exactly the kind of half-working that hides the
   * problem. */
  z-index: 2;
  /* A scrim rather than nothing. The panel below is opaque and sits over a
   * machine with two animating needles and a turning platter, and without
   * this the eye keeps being pulled back to the movement around it. It is
   * also the dismiss target — tapping off the panel closes it, which is the
   * gesture every sheet in this app already answers to. */
  background: #05060ac2;
}
.ps.ps-skinned.ps-skin-extras .ps-col-main {
  /* Unwrap so extras positions against .ps-inner the way the drawer
   * geometry already assumes. */
  display: contents;
}
.ps.ps-skinned.ps-skin-extras .ps-inner > .ps-context,
.ps.ps-skinned.ps-skin-extras .ps-inner > .ps-col-art,
.ps.ps-skinned.ps-skin-extras .ps-col-main > *:not(.ps-extras) {
  display: none;
}
/* A panel over the machine, not a screen instead of it. Full-bleed here read
 * as having navigated somewhere else; leaving the chassis showing round the
 * edges is what makes MORE feel like a drawer in the thing you are looking
 * at. Outranks .ps.ps-extras-open's own full-bleed geometry on class count,
 * which is deliberate — that rule is right everywhere the machine is not. */
.ps.ps-skinned.ps-skin-extras .ps-extras {
  pointer-events: auto;
  top: 6%;
  bottom: 6%;
  /* Let top/bottom size this overlay; the open rule's height would
   * otherwise win and ignore bottom. */
  height: auto;
  left: 50%;
  right: auto;
  width: min(720px, 86%);
  margin: 0;
  transform: translateX(-50%);
  border: 1px solid var(--ps-line);
  border-radius: 12px;
  box-shadow: 0 26px 64px -22px #000;
}
/* The machine is a fixed 1144×560 drawing and scales with transform only —
 * so one transform on the stage carries the whole thing, and every gesture,
 * hit target and animation inside keeps working in the machine's own
 * coordinate space. --bp-scale is set by _fitSkin from the holder's measured
 * box; the fallback of 1 is what a window big enough gets anyway. */
.ps-skin .bp-stage {
  /* Centred by absolute positioning, not by the grid.
   *
   * place-items: center looks like it should do this, and does not: the
   * machine is laid out at its full 1144×560 before the transform, so it is
   * an item bigger than its container, and a scroll container (which
   * overflow: hidden makes this) clamps overflow alignment to start. The
   * result was a machine correctly scaled and then anchored to the top-left,
   * hanging 114px off the right of a phone. */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--bp-scale, 1));
  transform-origin: center center;
}
@media (prefers-reduced-motion: no-preference) {
  .ps-skin .bp-stage {
    transition: transform 0.18s ease;
  }
}
