.ps-stream {
  --ps-bg: #f4f0e8;
  --ps-card: rgba(255, 255, 255, 0.84);
  --ps-card-alt: rgba(249, 247, 243, 0.92);
  --ps-ink: #17212b;
  --ps-muted: #5c6b77;
  --ps-line: rgba(23, 33, 43, 0.10);
  --ps-accent: #0e7c86;
  --ps-shadow: 0 1px 2px rgba(16, 18, 26, 0.04), 0 22px 60px rgba(35, 44, 53, 0.10);
  --ps-shadow-lift: 0 6px 20px rgba(35, 44, 53, 0.16);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--ps-ink);
  background: var(--ps-bg);
}

/* Defensive reset -- the widget must never inherit page/theme defaults for these
   properties. Scoped entirely under .ps-stream so it cannot leak out to the rest
   of the page. This is what actually fixes the center-align and mobile-clip bugs:
   both traced back to the surrounding WordPress theme's CSS overriding these
   exact properties on our elements because our old selectors weren't specific
   enough to win the cascade (confirmed via computed-style inspection, not
   guessed). */
.ps-stream, .ps-stream *, .ps-stream *::before, .ps-stream *::after {
  box-sizing: border-box;
}

.ps-stream p,
.ps-stream h2,
.ps-stream h3,
.ps-stream div,
.ps-stream span,
.ps-stream button,
.ps-stream select,
.ps-stream label {
  margin: 0;
  color: inherit;
  text-align: left;
  white-space: normal;
  font-family: inherit;
  line-height: inherit;
}

.ps-stream .ps-stream__shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) 16px;
}

.ps-stream .ps-stream__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 320px);
  align-items: center;
  gap: 20px;
  padding-bottom: 22px;
}

.ps-stream .ps-stream__hero-art-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ps-stream .ps-stream__hero-art {
  width: min(100%, 250px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--ps-line);
  box-shadow: var(--ps-shadow);
  background: linear-gradient(135deg, #dbe7e2, #f5efe6);
}

.ps-stream .ps-stream__eyebrow {
  margin: 0 0 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--ps-accent);
}

.ps-stream .ps-stream__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: .98;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.ps-stream .ps-stream__lead {
  max-width: 42rem;
  margin: 14px 0 0;
  color: var(--ps-muted);
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.ps-stream .ps-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ps-line);
  background: var(--ps-card);
  color: var(--ps-ink);
  border-radius: 18px;
  padding: 12px 16px;
  min-width: 56px;
  min-height: 48px;
  cursor: pointer;
  box-shadow: var(--ps-shadow);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  position: relative;
}

.ps-stream .ps-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.ps-stream .ps-btn:hover,
.ps-stream .ps-btn:focus,
.ps-stream .ps-btn:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ps-accent) 35%, var(--ps-line));
  box-shadow: var(--ps-shadow-lift);
  outline: none;
}

.ps-stream .ps-btn--primary {
  background: var(--ps-ink);
  color: #fff;
  border-color: transparent;
}

.ps-stream .ps-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--ps-shadow);
}

.ps-stream .ps-btn.is-active {
  background: var(--ps-accent);
  color: #fff;
  border-color: transparent;
}

.ps-stream .ps-btn[data-repeat-mode="one"]::after {
  content: "1";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ps-ink);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.ps-stream .ps-stream__status {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ps-card);
  border: 1px solid var(--ps-line);
  color: var(--ps-ink);
  font-size: 14px;
}

.ps-stream .ps-stream__status[hidden] {
  display: none;
}

.ps-stream .ps-stream__player {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--ps-line);
  border-radius: 30px;
  background: var(--ps-card);
  box-shadow: var(--ps-shadow);
  backdrop-filter: blur(14px);
}

.ps-stream .ps-stream__now {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.ps-stream .ps-stream__now-info {
  min-width: 0;
}

.ps-stream .ps-stream__art {
  width: 112px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 22px;
  background: linear-gradient(135deg, #dbe7e2, #f5efe6);
  border: 1px solid var(--ps-line);
}

.ps-stream .ps-stream__podcast {
  margin-bottom: 4px;
  color: var(--ps-accent);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .72rem;
}

.ps-stream .ps-stream__episode {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.ps-stream .ps-stream__podcast-desc {
  margin: 8px 0 0;
  color: var(--ps-muted);
  line-height: 1.45;
  font-size: .94rem;
  max-width: 52rem;
}

/* Progress row: time -- slider -- time, all on one line directly under the
   now-playing row. New in this redesign (Task 2 adds the markup). */
.ps-stream .ps-stream__progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps-stream .ps-stream__time {
  color: var(--ps-muted);
  font-variant-numeric: tabular-nums;
  font-size: .86rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.ps-stream .ps-stream__progress {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

/* Transport row: shuffle -- prev -- back10 -- play -- forward10 -- next -- repeat.
   New in this redesign (Task 2 adds the markup). This replaces the old
   .ps-stream__controls block that used to live in the hero. */
.ps-stream .ps-stream__transport {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.ps-stream .ps-stream__track-label {
  color: var(--ps-muted);
  font-size: .82rem;
  text-align: center;
}

.ps-stream .ps-stream__label {
  display: block;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--ps-muted);
}

.ps-stream .ps-stream__select {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--ps-line);
  background: color-mix(in srgb, var(--ps-card) 86%, white);
  padding: 0 14px;
  color: var(--ps-ink);
}

.ps-stream .ps-stream__episode-list {
  display: grid;
  gap: 12px;
}

.ps-stream .ps-episode-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--ps-line);
  background: var(--ps-card-alt);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ps-stream .ps-episode-item > div {
  min-width: 0;
}

.ps-stream .ps-episode-item:hover,
.ps-stream .ps-episode-item:focus,
.ps-stream .ps-episode-item:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ps-accent) 28%, var(--ps-line));
  box-shadow: var(--ps-shadow-lift);
  outline: none;
  color: inherit;
}

/* The base reset's color:inherit only guards the resting state -- the
   surrounding theme also carries its own :hover/:focus color rules (the
   same bleed-through class of bug as the base-state one), which silently
   won during hover and made the title unreadable. These descendant
   selectors are specific enough to beat any plausible theme selector. */
.ps-stream .ps-episode-item:hover .ps-episode-title,
.ps-stream .ps-episode-item:hover .ps-episode-desc,
.ps-stream .ps-episode-item:focus .ps-episode-title,
.ps-stream .ps-episode-item:focus .ps-episode-desc,
.ps-stream .ps-episode-item:focus-visible .ps-episode-title,
.ps-stream .ps-episode-item:focus-visible .ps-episode-desc {
  color: inherit;
}

.ps-stream .ps-episode-item.is-active {
  background: color-mix(in srgb, var(--ps-accent) 10%, var(--ps-card-alt));
  border-color: color-mix(in srgb, var(--ps-accent) 36%, var(--ps-line));
}

.ps-stream .ps-episode-art {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, #dbe7e2, #f5efe6);
}

.ps-stream .ps-episode-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ps-stream .ps-episode-plays {
  margin: 3px 0 0;
  font-size: .78rem;
  color: var(--ps-muted);
}
.ps-stream .ps-episode-item:hover .ps-episode-plays,
.ps-stream .ps-episode-item:focus .ps-episode-plays,
.ps-stream .ps-episode-item:focus-visible .ps-episode-plays {
  color: inherit;
}
.ps-stream .ps-episode-desc {
  margin: 4px 0 0;
  font-size: .88rem;
  color: var(--ps-muted);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ps-stream audio {
  display: none;
}

.ps-stream-empty {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--ps-line);
  border-radius: 24px;
  background: var(--ps-card);
  box-shadow: var(--ps-shadow);
}

@media (max-width: 920px) {
  .ps-stream .ps-stream__hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-stream .ps-stream__hero-art-wrap {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .ps-stream .ps-stream__shell {
    padding: 20px 14px;
  }

  .ps-stream .ps-btn {
    min-width: 48px;
    padding: 10px 14px;
  }

  /* All 7 transport buttons must fit on one row at mobile widths -- the
     desktop sizing (min-width 56px, 16px padding, 10px gap) doesn't fit
     7 buttons in ~440px of available width, so shrink specifically the
     transport row's own buttons rather than every .ps-btn on the page. */
  .ps-stream .ps-stream__transport {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .ps-stream .ps-stream__transport .ps-btn {
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    flex: 1 1 0;
  }

  .ps-stream .ps-stream__transport .ps-btn[data-action="back10"],
  .ps-stream .ps-stream__transport .ps-btn[data-action="forward10"] {
    font-size: .78rem;
  }

  .ps-stream .ps-stream__now {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .ps-stream .ps-stream__art {
    width: 88px;
  }

  .ps-stream .ps-episode-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }
}

/* Modifier overrides -- must stay below every base rule and media query so
   modifiers always win on equal specificity. */

.ps-stream--show-podcast-desc-off .ps-stream__podcast-desc {
  display: none;
}

.ps-stream--hero-show-art-off .ps-stream__hero-art-wrap {
  display: none;
}

.ps-stream--hero-show-art-off .ps-stream__hero {
  grid-template-columns: minmax(0, 1fr);
}

.ps-stream--hero-show-controls-off .ps-stream__transport {
  display: none;
}

.ps-stream--mode-mobile .ps-stream__hero {
  grid-template-columns: minmax(0, 1fr);
  text-align: left;
}

.ps-stream--mode-mobile .ps-stream__transport {
  flex-wrap: nowrap;
  gap: 6px;
}

.ps-stream--mode-mobile .ps-stream__transport .ps-btn {
  min-width: 0;
  min-height: 40px;
  padding: 8px 6px;
  flex: 1 1 0;
}

.ps-stream--mode-mobile .ps-stream__transport .ps-btn[data-action="back10"],
.ps-stream--mode-mobile .ps-stream__transport .ps-btn[data-action="forward10"] {
  font-size: .78rem;
}

.ps-stream--density-compact .ps-stream__player {
  gap: 14px;
  padding: 18px;
}

.ps-stream--density-compact .ps-stream__hero {
  gap: 16px;
  padding-bottom: 16px;
}

.ps-stream--density-compact .ps-btn {
  min-height: 42px;
  padding: 10px 12px;
}

/* The mobile-width transport-row override (`.ps-stream__transport .ps-btn`,
   in the max-width:720px media query above) is 3 classes deep -- the same
   specificity as `.ps-stream--density-compact .ps-btn` above, but the media
   query loses on source order since modifiers always come last (see the
   comment at the top of this section). That silently pinned transport
   buttons to one fixed size regardless of density at mobile widths. This
   compact-specific transport override matches that same 3-class specificity
   and sits after it, so density is visible on mobile again. */
.ps-stream--density-compact .ps-stream__transport .ps-btn {
  min-height: 36px;
  padding: 6px 4px;
}

.ps-stream--show-episode-desc-off .ps-episode-desc {
  display: none;
}

.ps-stream--show-episode-art-off .ps-episode-art,
.ps-stream--show-episode-art-off .ps-stream__art {
  display: none;
}

.ps-stream--show-episode-art-off .ps-episode-item {
  grid-template-columns: minmax(0, 1fr);
}

.ps-stream--show-episode-art-off .ps-stream__now {
  grid-template-columns: minmax(0, 1fr);
}

.ps-stream--density-compact .ps-episode-item {
  padding: 10px;
  gap: 12px;
}

.ps-stream--mode-mobile .ps-stream__lead {
  display: none;
}

.ps-stream--mode-mobile .ps-stream__player {
  border-radius: 24px;
  padding: 16px;
}

.ps-stream--mode-mobile .ps-stream__now {
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ps-stream--mode-mobile .ps-stream__art {
  width: 88px;
}

.ps-stream--mode-mobile .ps-episode-item {
  grid-template-columns: 48px minmax(0, 1fr);
}

.ps-stream--mode-mobile .ps-episode-desc,
.ps-stream--mode-mobile .ps-stream__podcast-desc {
  display: none;
}

/* Combined-modifier overrides: show-episode-art-off's single-column grids
   (above) share specificity with mode-mobile's own 2-column grids, and
   mode-mobile's rules sit later in this file -- so with both modifiers
   active, mode-mobile silently won and reintroduced the empty art column
   show-episode-art-off was supposed to remove. These compound selectors
   only match the intersection, so they don't affect either modifier alone. */
.ps-stream--show-episode-art-off.ps-stream--mode-mobile .ps-stream__now {
  grid-template-columns: minmax(0, 1fr);
}

.ps-stream--show-episode-art-off.ps-stream--mode-mobile .ps-episode-item {
  grid-template-columns: minmax(0, 1fr);
}
