/* Podcast player: featured controls, episode rows and the floating dock. */
.pp {
  --pp-progress: 0;
  --pp-fill: #ffda3e;
  --pp-track: rgb(255 255 255 / 18%);
  --pp-thumb: #ffffff;
  --pp-ease: cubic-bezier(.22, 1, .36, 1);
  --pp-spring: cubic-bezier(.34, 1.56, .64, 1);
}
.pp button, .pp-dock button, .pp-thumb-play { font-family: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ---- Seek bar (fills from the right, like the page) ---- */
.pp-timeline { min-width: 0; }
.pp-seek {
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  direction: rtl;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.pp-seek:disabled { cursor: default; }
/* Undo the site-wide text-field look for these sliders. */
body.premium-site.reference-site input.pp-seek[type="range"],
body.premium-site.reference-site input.pp-seek[type="range"]:focus {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.pp-seek::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to left, var(--pp-fill) calc(var(--pp-progress) * 100%), var(--pp-track) 0);
}
.pp-seek::-moz-range-track { height: 6px; border-radius: 6px; background: var(--pp-track); }
.pp-seek::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--pp-fill); }
.pp-seek::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--pp-thumb);
  box-shadow: 0 0 0 4px rgb(255 218 62 / 28%), 0 2px 6px rgb(0 0 0 / 25%);
  transition: scale .25s var(--pp-spring);
  -webkit-appearance: none;
  appearance: none;
}
.pp-seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--pp-thumb); box-shadow: 0 0 0 4px rgb(255 218 62 / 28%); }
.pp-seek:is(:hover, :active, :focus-visible):not(:disabled)::-webkit-slider-thumb { scale: 1.25; }
.pp-seek:disabled::-webkit-slider-thumb { scale: 0; }
.pp-seek:disabled::-moz-range-thumb { opacity: 0; }
body.premium-site.reference-site .pp-seek:focus-visible { outline: 2px solid var(--pp-fill); outline-offset: 4px; }
.pp-times {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  color: rgb(255 255 255 / 72%);
}

/* ---- Shared buttons ---- */
.pp-play {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffda3e;
  color: #171943;
  cursor: pointer;
  transition: scale .3s var(--pp-spring), box-shadow .4s var(--pp-ease), background-color .25s ease;
}
.pp-play svg { grid-area: 1 / 1; width: 46%; height: 46%; transition: opacity .2s ease, scale .3s var(--pp-spring); }
.pp-play .pp-icon-play { translate: 1.5px 0; }
.pp-play .pp-icon-pause, .is-playing .pp-play .pp-icon-play,
.pp-host.is-playing .pp-thumb-play .pp-icon-play { opacity: 0; scale: .4; }
.is-playing .pp-play .pp-icon-pause,
.pp-host.is-playing .pp-thumb-play .pp-icon-pause { opacity: 1; scale: 1; }
.pp-play:hover { background: #ffe36c; }
.pp-play:active { scale: .92; }
body.premium-site.reference-site :is(.pp-play, .pp-skip, .pp-speed, .pp-file, .pp-close):focus-visible { outline: 3px solid #ffda3e; outline-offset: 3px; }
.pp-spinner {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: currentColor;
  opacity: 0;
  pointer-events: none;
}
.is-loading .pp-play .pp-spinner, .pp-host.is-loading .pp-thumb-play .pp-spinner { opacity: 1; animation: pp-spin .8s linear infinite; }
@keyframes pp-spin { to { rotate: 1turn; } }
.pp-skip, .pp-file, .pp-close {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color .25s ease, scale .3s var(--pp-spring), rotate .45s var(--pp-ease);
}
.pp-skip svg, .pp-file svg, .pp-close svg { width: 26px; height: 26px; }
.pp-close svg { width: 18px; height: 18px; }
.pp-skip > span { position: absolute; font-size: 9px; font-weight: 800; line-height: 1; padding-top: 2px; }
.pp-skip:hover, .pp-file:hover, .pp-close:hover { background: rgb(255 255 255 / 10%); }
.pp-skip:active, .pp-file:active, .pp-close:active { scale: .9; }
.pp-skip[data-skip^="-"]:active { rotate: 25deg; }
.pp-skip:not([data-skip^="-"]):active { rotate: -25deg; }
.pp-speed {
  flex: none;
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, scale .3s var(--pp-spring);
}
.pp-speed:hover { background: rgb(255 255 255 / 10%); border-color: #ffda3e; }
.pp-speed:active { scale: .92; }
span.pp-file { pointer-events: none; }

/* ---- Featured card (podcasts page and home) ---- */
.pp-feature { color: #ffffff; margin-top: 4px; }
.pp-feature .pp-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 360px; margin: 14px auto 0; }
.pp-feature .pp-play-lg { width: 66px; height: 66px; box-shadow: 0 12px 28px -10px rgb(255 218 62 / 65%); }
.pp-host.is-playing .pp-feature .pp-play-lg { animation: pp-breathe 2.4s ease-in-out infinite; }
@keyframes pp-breathe { 50% { box-shadow: 0 0 0 10px rgb(255 218 62 / 0), 0 0 0 0 rgb(255 218 62 / 0), 0 12px 28px -10px rgb(255 218 62 / 65%); } 0%, 100% { box-shadow: 0 0 0 0 rgb(255 218 62 / 35%), 0 12px 28px -10px rgb(255 218 62 / 65%); } }
/* The featured episode becomes a dark "now playing" card. */
body.premium-site.reference-site .listening-feature.pp-host {
  border-color: #2b3061;
  background:
    radial-gradient(120% 80% at 100% 0%, rgb(255 218 62 / 14%), transparent 55%),
    linear-gradient(160deg, #262b63, #171943 62%);
  color: #ffffff;
  box-shadow: 0 30px 60px -30px rgb(23 25 67 / 60%);
}
body.premium-site.reference-site .listening-feature.pp-host .listening-feature-top { color: #ffda3e; border-color: rgb(255 255 255 / 14%); }
body.premium-site.reference-site .listening-feature.pp-host h2 { color: #ffffff; }
body.premium-site.reference-site .listening-feature.pp-host .listening-feature-main p { color: #c4c7df; }
body.premium-site.reference-site .listening-feature.pp-host .listening-feature-category { color: #ffda3e; }
body.premium-site.reference-site .listening-feature.pp-host .listening-art { box-shadow: 0 14px 30px -14px rgb(0 0 0 / 55%); }
.listening-feature .pp-feature { padding-top: 6px; }
.academy-podcast-player .pp-feature { margin-top: 22px; }

/* ---- Episode rows ---- */
.listening-row.pp-host .listening-thumb { position: relative; }
.pp-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  padding: 0;
  background: rgb(23 25 67 / 18%);
  color: #171943;
  cursor: pointer;
  transition: background-color .3s ease;
}
.pp-thumb-play::before {
  content: '';
  grid-area: 1 / 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffda3e;
  box-shadow: 0 6px 16px -4px rgb(23 25 67 / 45%);
  transition: scale .35s var(--pp-spring);
}
.pp-thumb-play svg { grid-area: 1 / 1; position: relative; width: 18px; height: 18px; transition: opacity .2s ease, scale .3s var(--pp-spring); }
.pp-thumb-play .pp-icon-play { translate: 1px 0; }
.pp-thumb-play .pp-icon-pause { opacity: 0; scale: .4; }
.pp-thumb-play .pp-spinner { inset: auto; width: 48px; height: 48px; grid-area: 1 / 1; position: relative; border-top-color: #ffda3e; }
.pp-thumb-play:hover { background: rgb(23 25 67 / 32%); }
.pp-thumb-play:hover::before { scale: 1.1; }
.pp-thumb-play:active::before { scale: .9; }
body.premium-site.reference-site .pp-thumb-play:focus-visible { outline: 3px solid #171943; outline-offset: 3px; }
.pp-host.is-playing .pp-thumb-play::before { animation: pp-thumb-pulse 1.8s ease-in-out infinite; }
@keyframes pp-thumb-pulse { 50% { box-shadow: 0 0 0 7px rgb(255 218 62 / 30%), 0 6px 16px -4px rgb(23 25 67 / 45%); } }
.pp-row {
  --pp-fill: #171943;
  --pp-track: #e2e3ea;
  --pp-thumb: #171943;
  display: none;
  max-width: 640px;
  margin-top: 12px;
}
.pp-row .pp-seek::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgb(255 218 62 / 55%); }
.pp-row .pp-times { color: var(--muted, #4b4e6c); }
.listening-row.pp-host:is(.is-current, .has-progress) .pp-row { display: block; animation: pp-row-in .45s var(--pp-ease) both; }
.listening-row.pp-host.has-progress:not(.is-current) .pp-row { opacity: .7; }
@keyframes pp-row-in { from { opacity: 0; translate: 0 -6px; } }
.listening-row.pp-host.is-current h3 { color: #171943; }
.listening-row.pp-host .listening-row-meta { align-items: center; }
.pp-meta-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  color: var(--muted, #4b4e6c);
  font-size: 12px;
  text-decoration: none;
  transition: color .25s ease;
}
.pp-meta-file svg { width: 16px; height: 16px; }
.pp-meta-file:hover { color: #171943; text-decoration: underline; text-underline-offset: 4px; }
.listening-row.pp-host .listening-row-main > h3 { margin-bottom: 6px; }

/* ---- Dock ---- */
.pp-dock {
  position: fixed;
  z-index: 85;
  inset-inline: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  padding-inline: 16px;
  pointer-events: none;
  --pp-ease: cubic-bezier(.22, 1, .36, 1);
  --pp-spring: cubic-bezier(.34, 1.56, .64, 1);
}
.pp-dock[hidden] { display: none; }
.pp-dock-inner {
  --pp-fill: #ffda3e;
  --pp-track: rgb(255 255 255 / 18%);
  --pp-thumb: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(700px, 100%);
  padding: 9px 12px 9px 10px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 22px;
  background: rgb(23 25 67 / 96%);
  color: #ffffff;
  box-shadow: 0 22px 50px -18px rgb(10 12 40 / 65%);
  pointer-events: auto;
}
.pp-dock-art {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 12px;
  background: #ffda3e;
  color: #171943;
}
.pp-dock-art img { width: 100%; height: 100%; object-fit: cover; }
.pp-dock-art svg { width: 24px; height: 24px; }
.pp-dock.is-playing .pp-dock-art { animation: pp-art 6s ease-in-out infinite; }
@keyframes pp-art { 50% { rotate: -4deg; scale: 1.04; } }
.pp-dock-text { flex: 1; min-width: 0; }
.pp-dock-title { display: block; overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.7; white-space: nowrap; text-overflow: ellipsis; }
.pp-dock .pp-timeline { display: flex; align-items: center; gap: 10px; }
.pp-dock .pp-seek { flex: 1; height: 18px; }
.pp-dock .pp-seek::-webkit-slider-runnable-track { height: 4px; }
.pp-dock .pp-seek::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; }
.pp-dock .pp-times { flex: none; margin: 0; font-size: 11px; gap: 4px; }
.pp-dock .pp-times .pp-current::after { content: ' /'; }
.pp-dock .pp-play-dock { width: 46px; height: 46px; }
.pp-dock .pp-speed { min-width: 44px; height: 30px; font-size: 12px; }
.pp-dock .pp-close { width: 38px; height: 38px; color: #c4c7df; }
.pp-dock:not([hidden]) { animation: pp-dock-in .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.pp-dock.is-leaving { animation: pp-dock-out .26s ease both; }
@keyframes pp-dock-in { from { opacity: 0; translate: 0 26px; scale: .96; } }
@keyframes pp-dock-out { to { opacity: 0; translate: 0 22px; } }
body.premium-site.reference-site.pp-dock-on { padding-bottom: 104px; }
body.pp-dock-on .m-top { bottom: 104px; }
body.pp-dock-on .toast { bottom: 108px; }

@media (max-width: 600px) {
  .pp-feature .pp-controls { gap: 2px; margin-top: 10px; }
  .pp-feature .pp-play-lg { width: 62px; height: 62px; }
  .pp-thumb-play::before { width: 36px; height: 36px; }
  .pp-row { margin-top: 10px; }
  .pp-dock { bottom: calc(74px + env(safe-area-inset-bottom)); padding-inline: 10px; }
  .pp-dock-inner { gap: 6px; padding: 8px 10px 8px 8px; border-radius: 18px; }
  .pp-dock .pp-skip, .pp-dock .pp-speed { display: none; }
  .pp-dock-art { width: 42px; height: 42px; border-radius: 11px; }
  .pp-dock .pp-play-dock { width: 44px; height: 44px; }
  body.premium-site.reference-site.pp-dock-on { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
  body.pp-dock-on .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .pp *, .pp-dock, .pp-dock *, .pp-thumb-play, .pp-thumb-play::before { animation: none !important; transition: none !important; }
  .is-loading .pp-play .pp-spinner, .pp-host.is-loading .pp-thumb-play .pp-spinner { animation: pp-spin 1.6s linear infinite !important; }
}
