/* ---- Podcasts Screens & Read-Along Player Styles ---- */

/* Main container */
.podcasts-screen,
.podcast-screen {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 90px);
  min-height: 560px;
}

/* The page-scroll model: it takes over wherever the fixed-height player cannot
   fit its own 560px floor, so the two models never overlap (see the desktop
   block further down, which starts one pixel above this height). */
@media (max-width: 768px), (max-height: 680px) {
  .podcasts-screen,
  .podcast-screen {
    height: auto;
    min-height: calc(100dvh - 84px);
    padding-bottom: calc(var(--sp-8) + 80px);
  }
}

.podcasts-loading,
.podcast-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-4);
  gap: var(--sp-3);
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: center;
  min-height: 240px;
}

.podcast-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.podcasts-catalog-screen {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--sp-1) var(--sp-8);
}

/* ---- Branded Podcasts Hero (Page Header) ---- */
.podcast-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: clamp(var(--sp-6), 4vw, var(--sp-8)) 0 clamp(var(--sp-5), 3vw, var(--sp-6));
  margin-bottom: var(--sp-3);
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
}

.podcast-hero-main {
  flex: 1;
  min-width: 0;
}

.podcast-hero-overline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.podcast-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent-border);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.podcast-series-topic {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.podcast-hero-title.hero-title {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw + 0.8rem, 2.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.podcast-hero-desc.hero-sub {
  margin: 0 0 var(--sp-4);
  font-size: clamp(0.95rem, 0.4vw + 0.85rem, 1.12rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 560px;
}

.podcast-hero-meta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.podcast-host-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  font-weight: 500;
}

.podcast-host-chip strong {
  color: var(--ink);
  font-weight: 700;
}

.podcast-hero-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.podcast-perk-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: var(--shadow-1);
}

/* Desktop Hero Artwork Frame */
.podcast-hero-aside {
  flex: none;
}

.podcast-cover-frame {
  width: 160px;
  height: 160px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 16px 36px -8px color-mix(in oklab, var(--ink) 25%, transparent),
              0 0 0 1px var(--border);
  background: var(--surface-2);
  position: relative;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.podcast-cover-frame:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 40px -8px color-mix(in oklab, var(--ink) 30%, transparent),
              0 0 0 1px var(--accent);
}

.podcast-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* On Mobile Screens: Keep Hero Clean, Typographic & Airy (like Homepage) */
@media (max-width: 640px) {
  .podcast-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-5) 0 var(--sp-3);
  }

  .podcast-hero-aside {
    display: none; /* Hide the disproportionate square thumbnail on mobile */
  }

  .podcast-hero-title.hero-title {
    font-size: clamp(1.65rem, 5vw + 0.5rem, 2.1rem);
    margin-bottom: var(--sp-2);
  }

  .podcast-hero-desc.hero-sub {
    font-size: 0.95rem;
    margin-bottom: var(--sp-3);
  }
}

/* Section Header (Divider between Hero and Episodes) */
.podcast-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--sp-4) 0 var(--sp-3);
  padding: var(--sp-4) 2px 0;
  border-top: 1px solid var(--border);
}

.podcast-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.podcast-season-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--accent-border);
}
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: var(--r-full);
}

/* Featured / Ready Episode Card */
.podcasts-featured-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.podcast-featured-card {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  cursor: pointer;
}

@media (max-width: 640px) {
  .podcast-featured-card {
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-3);
  }
}

.podcast-featured-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.podcast-featured-artwork {
  position: relative;
  flex: none;
  width: 140px;
  height: 140px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 4px 12px color-mix(in oklab, var(--ink) 12%, transparent);
}

@media (max-width: 640px) {
  .podcast-featured-artwork {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

.podcast-featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms var(--ease-out);
}

.podcast-featured-card:hover .podcast-featured-img {
  transform: scale(1.04);
}

.podcast-artwork-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--btn-primary);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.podcast-featured-card:hover .podcast-artwork-play {
  transform: translate(-50%, -50%) scale(1.08);
  opacity: 1;
  background: var(--btn-primary-hover);
}

.podcast-artwork-dur {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.podcast-featured-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.podcast-featured-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.podcast-ep-badge-accent {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.podcast-ep-badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in oklab, var(--success-soft) 85%, var(--surface));
  color: var(--success);
}

.podcast-ep-badge-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.podcast-featured-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw + 0.6rem, 1.38rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.podcast-featured-desc {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.55;
}

.podcast-featured-chapters {
  background: color-mix(in oklab, var(--surface-2) 60%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: var(--sp-3);
}

.podcast-ch-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.podcast-ch-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 12px;
}

.podcast-ch-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 0;
}

.podcast-ch-time {
  flex: none;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.podcast-ch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podcast-featured-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .podcast-featured-foot {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

.podcast-featured-hosts {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 600;
}

.podcast-featured-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 22px;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 700;
  background: var(--btn-primary);
  color: var(--on-accent);
  border: none;
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}

.podcast-featured-card:hover .podcast-featured-play-btn {
  transform: scale(1.03);
  background: var(--btn-primary-hover);
  box-shadow: 0 4px 12px color-mix(in oklab, var(--btn-primary) 35%, transparent);
}

/* Upcoming Episodes Roadmap */
.podcast-upcoming-section {
  margin-top: var(--sp-7);
}

.podcast-upcoming-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.podcast-upcoming-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}

.podcast-upcoming-note {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.podcast-upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
}

.podcast-upcoming-card {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 14px 16px;
  opacity: 0.88;
  transition: opacity 140ms ease, border-color 140ms ease;
}

.podcast-upcoming-card:hover {
  opacity: 1;
  border-color: var(--accent);
}

.podcast-upcoming-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.podcast-upcoming-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: var(--r-full);
}

.podcast-upcoming-title {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.podcast-upcoming-sub {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-strong);
}

.podcast-upcoming-desc {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* ==========================================================================
   Episode Player & Synchronized Transcript View
   ========================================================================== */

/* Top bar nav inside player */
.podcast-nav-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.podcast-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms var(--ease-out);
}

.podcast-back-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.podcast-episodes-count-badge {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 600;
}

/* Header card */
.podcast-header-card {
  flex: none;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
}

.podcast-player-header-main {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  margin-bottom: var(--sp-2);
}

.podcast-player-thumb-wrap {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--ink) 14%, transparent);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.podcast-player-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.podcast-player-header-text {
  flex: 1;
  min-width: 0;
}

.podcast-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.podcast-badge,
.podcast-duration-badge,
.podcast-turns-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-soft);
}

.podcast-badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.podcast-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw + 0.7rem, 1.4rem);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.podcast-sub {
  margin: 0 0 6px;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.4;
}

/* Header Co-Hosts Cluster */
.podcast-player-hosts-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  margin-bottom: var(--sp-2);
  padding: 3px 10px 3px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}

.podcast-avatars-cluster {
  display: inline-flex;
  align-items: center;
}

.podcast-cluster-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--surface);
  margin-left: -6px;
  box-shadow: 0 1px 3px color-mix(in oklab, var(--ink) 20%, transparent);
}

.podcast-cluster-avatar:first-child {
  margin-left: 0;
}

.podcast-cluster-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.podcast-chapters-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.podcast-chapters-nav::-webkit-scrollbar { display: none; }

.podcast-ch-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms var(--ease-out);
  white-space: nowrap;
}

.podcast-ch-pill:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.podcast-ch-pill.is-active {
  background: var(--accent-strong);
  color: var(--on-accent);
  border-color: var(--accent-strong);
}

.podcast-ch-pill .podcast-ch-label {
  font-weight: 700;
}

.podcast-ch-pill .podcast-ch-title {
  font-weight: 400;
  opacity: 0.85;
}

/* YouTube-Style Chapter Dropdown Selector */
.podcast-chapter-picker {
  position: relative;
  margin-bottom: var(--sp-2);
  width: 100%;
}

.podcast-chapter-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms var(--ease-out);
  text-align: left;
}

.podcast-chapter-trigger:hover,
.podcast-chapter-trigger.is-open {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--accent) 15%, transparent);
}

.podcast-chapter-trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.podcast-chapter-icon {
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.podcast-chapter-time-badge {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.podcast-chapter-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-weight: 700;
  color: var(--ink);
}

.podcast-chapter-chevron {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition: transform 180ms ease;
  flex-shrink: 0;
}

.podcast-chapter-trigger.is-open .podcast-chapter-chevron {
  transform: rotate(180deg);
  color: var(--accent-strong);
}

/* Dropdown menu popup */
.podcast-chapter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 290px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px color-mix(in oklab, var(--ink) 18%, transparent);
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  animation: rise-in 140ms var(--ease-out);
}

.podcast-chapter-dropdown[hidden] {
  display: none !important;
}

.podcast-chapter-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.podcast-chapter-dropdown-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.podcast-chapter-dropdown-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.podcast-chapter-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.podcast-chapter-dropdown-item {
  margin: 0;
  padding: 0;
}

.podcast-chapter-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 120ms ease;
  text-align: left;
}

.podcast-chapter-option-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.podcast-chapter-dropdown-item.is-active .podcast-chapter-option-btn {
  background: var(--accent-soft);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
}

.podcast-chapter-opt-time {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 3px 6px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}

.podcast-chapter-dropdown-item.is-active .podcast-chapter-opt-time {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.podcast-chapter-opt-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.podcast-chapter-opt-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.podcast-chapter-dropdown-item.is-active .podcast-chapter-opt-label {
  color: var(--accent-strong);
}

.podcast-chapter-opt-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podcast-chapter-dropdown-item.is-active .podcast-chapter-opt-title {
  font-weight: 800;
  color: var(--accent-strong);
}

.podcast-chapter-opt-indicator {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: var(--accent-strong);
  color: var(--on-accent);
  display: none;
  flex-shrink: 0;
}

.podcast-chapter-dropdown-item.is-active .podcast-chapter-opt-indicator {
  display: inline-block;
}

/* Audio player dock */
.podcast-player-dock {
  flex: none;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  box-shadow: var(--shadow-1);
}

.podcast-scrub-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.podcast-time {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  min-width: 36px;
}

.podcast-scrub-track {
  position: relative;
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  cursor: pointer;
  touch-action: none;
}

.podcast-scrub-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--accent);
  border-radius: var(--r-full);
  pointer-events: none;
}

.podcast-scrub-thumb {
  position: absolute;
  left: 0%;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 2.5px solid var(--accent-strong);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  pointer-events: none;
}

.podcast-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.podcast-transport {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.podcast-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--r-full);
  padding: 6px 12px;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: all 120ms var(--ease-out);
}

.podcast-control-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.podcast-jump-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  position: relative;
  border-radius: 50%;
}

.podcast-jump-text {
  position: absolute;
  font-size: 8px;
  font-weight: 800;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.podcast-play-btn {
  width: 48px;
  height: 48px;
  background: var(--accent-strong);
  color: var(--on-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--accent) 35%, transparent);
  transition: transform 120ms var(--ease-out), filter 120ms var(--ease-out);
}

.podcast-play-btn:hover {
  transform: scale(1.05);
}

.podcast-play-btn:active {
  transform: scale(0.96);
}

.podcast-sync-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* Search bar */
/* Search & Chat Settings Toolbar */
.podcast-chat-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.podcast-search-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--ink) 3%, transparent);
}

.podcast-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  outline: none;
  min-width: 60px;
}

.podcast-search-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Text Size Control Widget */
.podcast-font-widget {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--ink) 4%, transparent);
}

.podcast-font-caption {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
  user-select: none;
}

@media (max-width: 520px) {
  .podcast-font-caption {
    display: none;
  }
}

.podcast-font-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--font-display, sans-serif);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 120ms var(--ease-out);
  user-select: none;
}

.podcast-font-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent);
}

.podcast-font-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.podcast-font-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.podcast-font-btn.is-dec {
  font-size: 11px;
}

.podcast-font-btn.is-inc {
  font-size: 13.5px;
}

.podcast-font-btn .size-sign {
  font-size: 10px;
  margin-left: 1px;
  opacity: 0.85;
}

.podcast-font-size-val {
  min-width: 38px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 2px 4px;
  cursor: pointer;
  border-radius: var(--r-xs);
  user-select: none;
  transition: background 120ms ease, color 120ms ease;
}

.podcast-font-size-val:hover {
  background: var(--surface-2);
  color: var(--accent-strong);
}

/* ==========================================================================
   Telegram-Style Interactive Chat Feed for Podcast Dialogue
   ========================================================================== */

/* Transcript scroll area */
.podcast-transcript-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: color-mix(in oklab, var(--surface) 96%, var(--surface-2) 4%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-3);
  scroll-behavior: smooth;
  box-shadow: inset 0 2px 8px color-mix(in oklab, var(--ink) 3%, transparent);
}

@media (min-width: 769px) {
  .podcast-transcript-wrap {
    padding: var(--sp-4) var(--sp-4);
  }
}

/* Desktop player: the feed is the only scroll surface, so the whole screen has
   to fit the fold. The (min-height) guard leaves short windows on the
   page-scroll model used by mobile. */
@media (min-width: 769px) and (min-height: 681px) {
  /* Anything below the screen box — the footer and main's own bottom padding —
     would put 200px of page scroll under the player and carry the transport out
     of reach. /sources stays in the rail, so the footer stands down here. */
  body:has(.podcasts-screen) .shell-footer,
  body:has(.podcast-screen) .shell-footer {
    display: none;
  }

  body:has(.podcasts-screen) .app-main,
  body:has(.podcast-screen) .app-main {
    padding-bottom: 0;
  }

  .podcasts-screen,
  .podcast-screen {
    /* the bar is as tall as its overline needs, so the offset comes from the
       live token; 24px main padding + 12px air at the fold */
    height: calc(100dvh - var(--topbar-h) - var(--sp-6) - var(--sp-3));
  }

  /* "All Episodes" is the same exit the shell bar already carries, and the
     episode number is in the card's badge: the row gives its height to the feed. */
  .podcast-nav-bar {
    display: none;
  }

  .podcast-header-card,
  .podcast-player-dock {
    padding: var(--sp-2) var(--sp-4);
    margin-bottom: 6px;
  }

  /* The hosts cluster repeats the avatars every message already carries. */
  .podcast-player-hosts-row {
    display: none;
  }

  .podcast-player-thumb-wrap {
    width: 48px;
    height: 48px;
  }

  .podcast-player-header-main,
  .podcast-meta-row,
  .podcast-sub,
  .podcast-scrub-row,
  .podcast-chapter-picker,
  .podcast-chat-toolbar {
    margin-bottom: 4px;
  }

  .podcast-title {
    margin-bottom: 2px;
  }
}

/* The complement of the fixed-height desktop player: here the screen box has no
   height of its own, so the feed cannot scroll inside it and joins the page
   instead — otherwise it grows to the full transcript and pushes the transport
   out of reach. Same condition as the section's `height: auto` above. */
@media (max-width: 768px), (max-height: 680px) {
  .podcast-transcript-wrap {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: var(--sp-2) 0 var(--sp-8) 0 !important;
  }

  /* With the page scrolling, the transport would scroll out of reach and leave
     the listener without controls. Park the dock under the sticky shell topbar
     the way the run screen parks its clock bar (z-index stays below
     --z-topbar = 40). Its top corners go square: a rounded corner is a notch the
     transcript shows through once turns scroll behind the stuck bar. */
  .podcast-player-dock {
    position: sticky;
    top: var(--topbar-h);
    z-index: 30;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}

.podcast-transcript-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: var(--sp-8);
}

/* Individual Telegram Chat Turn */
.podcast-chat-msg,
.podcast-turn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: auto;
  max-width: 82%;
  margin: 0;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  transition: transform 140ms var(--ease-out);
  scroll-margin-top: calc(var(--topbar-h, 73px) + 160px);
}

@media (max-width: 640px) {
  .podcast-chat-msg,
  .podcast-turn {
    max-width: 90%;
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .podcast-chat-msg,
  .podcast-turn {
    max-width: 95%;
    gap: 6px;
  }
}

/* Maya (Woman) on the LEFT: incoming dialogue message */
.podcast-chat-msg.is-maya {
  align-self: flex-start;
  flex-direction: row;
}

.podcast-chat-msg.is-maya .podcast-chat-bubble {
  border-radius: 16px 16px 16px 4px;
}

/* Liam (Man) on the RIGHT: outgoing dialogue message */
.podcast-chat-msg.is-liam {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.podcast-chat-msg.is-liam .podcast-chat-bubble {
  border-radius: 16px 16px 4px 16px;
}

/* Avatar Column */
.podcast-chat-avatar-col {
  flex: none;
  padding-top: 2px;
}

.podcast-chat-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  background: var(--surface-2);
}

@media (max-width: 480px) {
  .podcast-chat-avatar-wrap {
    width: 34px;
    height: 34px;
  }
}

.podcast-chat-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-full);
  border: 2px solid var(--border);
  display: block;
  box-shadow: 0 2px 6px color-mix(in oklab, var(--ink) 12%, transparent);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.podcast-chat-msg:hover .podcast-chat-avatar {
  transform: scale(1.05);
}

/* Maya and Liam avatar accents */
.podcast-chat-msg.is-maya .podcast-chat-avatar {
  border-color: color-mix(in oklab, #8b5cf6 35%, var(--border));
}

.podcast-chat-msg.is-liam .podcast-chat-avatar {
  border-color: color-mix(in oklab, #0284c7 35%, var(--border));
}

/* Live speaking soundwave ring on avatar */
.podcast-chat-speaking-wave {
  display: none;
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 2px 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  align-items: center;
  gap: 1.5px;
  height: 14px;
}

.podcast-chat-msg.is-liam .podcast-chat-speaking-wave {
  right: auto;
  left: -2px;
}

.podcast-chat-speaking-wave .wave-bar {
  width: 2px;
  background: var(--muted);
  border-radius: 1px;
  height: 4px;
}

.podcast-turn.is-active .podcast-chat-avatar {
  transform: scale(1.06);
}

.podcast-turn.is-maya.is-active .podcast-chat-avatar {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px color-mix(in oklab, #8b5cf6 40%, transparent);
}

.podcast-turn.is-liam.is-active .podcast-chat-avatar {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px color-mix(in oklab, #0284c7 40%, transparent);
}

.podcast-turn.is-active .podcast-chat-speaking-wave {
  display: inline-flex;
}

.podcast-turn.is-maya.is-active .podcast-chat-speaking-wave .wave-bar {
  background: #8b5cf6;
}

.podcast-turn.is-liam.is-active .podcast-chat-speaking-wave .wave-bar {
  background: #0284c7;
}

.podcast-turn.is-active .wave-bar.bar-1 {
  animation: wave-bounce 0.6s ease-in-out infinite alternate;
}
.podcast-turn.is-active .wave-bar.bar-2 {
  animation: wave-bounce 0.8s ease-in-out infinite 0.15s alternate;
}
.podcast-turn.is-active .wave-bar.bar-3 {
  animation: wave-bounce 0.5s ease-in-out infinite 0.3s alternate;
}

@keyframes wave-bounce {
  0% { height: 3px; }
  100% { height: 10px; }
}

/* Telegram Speech Bubble */
.podcast-chat-bubble {
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 10px 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px color-mix(in oklab, var(--ink) 4%, transparent);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

@media (max-width: 480px) {
  .podcast-chat-bubble {
    padding: 8px 11px 6px;
  }
}

/* Host-specific subtle Telegram tints */
.podcast-chat-msg.is-maya .podcast-chat-bubble {
  background: color-mix(in oklab, var(--surface) 96%, #8b5cf6 4%);
  border-color: color-mix(in oklab, var(--border) 84%, #8b5cf6 16%);
}

.podcast-chat-msg.is-liam .podcast-chat-bubble {
  background: color-mix(in oklab, var(--surface) 96%, #0284c7 4%);
  border-color: color-mix(in oklab, var(--border) 84%, #0284c7 16%);
}

:root[data-theme="dark"] .podcast-chat-msg.is-maya .podcast-chat-bubble {
  background: #1e1829;
  border-color: rgba(139, 92, 246, 0.28);
}

:root[data-theme="dark"] .podcast-chat-msg.is-liam .podcast-chat-bubble {
  background: #132030;
  border-color: rgba(14, 165, 233, 0.28);
}

.podcast-chat-msg:hover .podcast-chat-bubble {
  box-shadow: 0 3px 10px color-mix(in oklab, var(--ink) 8%, transparent);
}

/* Active Turn Playing Highlight */
.podcast-turn.is-active .podcast-chat-bubble {
  box-shadow: 0 4px 18px color-mix(in oklab, var(--accent) 18%, transparent);
}

.podcast-turn.is-maya.is-active .podcast-chat-bubble {
  border-color: #8b5cf6;
  background: color-mix(in oklab, var(--surface) 91%, #8b5cf6 9%);
  box-shadow: 0 4px 18px color-mix(in oklab, #8b5cf6 24%, transparent);
  transform: translateX(3px);
}

.podcast-turn.is-liam.is-active .podcast-chat-bubble {
  border-color: #0284c7;
  background: color-mix(in oklab, var(--surface) 91%, #0284c7 9%);
  box-shadow: 0 4px 18px color-mix(in oklab, #0284c7 24%, transparent);
  transform: translateX(-3px);
}

/* Header inside Bubble */
.podcast-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.podcast-chat-sender-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.podcast-chat-sender-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.podcast-chat-msg.is-maya .podcast-chat-sender-name {
  color: #7c3aed;
}
:root[data-theme="dark"] .podcast-chat-msg.is-maya .podcast-chat-sender-name {
  color: #a78bfa;
}

.podcast-chat-msg.is-liam .podcast-chat-sender-name {
  color: #0284c7;
}
:root[data-theme="dark"] .podcast-chat-msg.is-liam .podcast-chat-sender-name {
  color: #38bdf8;
}

.podcast-chat-role-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--muted);
}

.podcast-chat-time-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 120ms var(--ease-out);
}

.podcast-chat-time-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent);
}

.podcast-chat-play-mini {
  font-size: 8px;
  opacity: 0.7;
}

/* Dialogue Text */
.podcast-chat-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--chat-font-size, 14px);
  line-height: var(--chat-line-height, 1.58);
  color: var(--ink);
  letter-spacing: -0.005em;
  word-break: break-word;
  transition: font-size 140ms ease, line-height 140ms ease;
}

@media (max-width: 480px) {
  .podcast-chat-text {
    font-size: calc(var(--chat-font-size, 14px) * 0.96);
    line-height: calc(var(--chat-line-height, 1.58) * 0.98);
  }
}

/* Footer row inside Telegram bubble */
.podcast-chat-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--muted);
}

.podcast-chat-ticks {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: -0.05em;
  opacity: 0.7;
}

.podcast-turn.is-active .podcast-chat-ticks {
  color: #0284c7;
  opacity: 1;
}

/* Word-by-word karaoke styling */
.podcast-word {
  display: inline;
  position: relative;
  border-radius: 3px;
  padding: 1px 2px;
  margin: 0 -1px;
  cursor: pointer;
  transition: color 80ms var(--ease-out), background-color 80ms var(--ease-out);
}

.podcast-word:hover {
  background: color-mix(in oklab, var(--accent) 18%, transparent);
}

.podcast-turn:not(.is-active) .podcast-word {
  color: var(--ink);
}

.podcast-turn.is-active .podcast-word.is-word-spoken {
  color: var(--ink);
  font-weight: 500;
  opacity: 0.95;
}

.podcast-turn.is-active .podcast-word.is-word-active {
  background: color-mix(in oklab, var(--accent) 26%, var(--surface-2));
  color: var(--accent-strong);
  font-weight: 800;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: 4px;
}

.podcast-turn.is-active .podcast-word.is-word-upcoming {
  color: var(--muted);
  opacity: 0.72;
}

.podcast-word.is-search-match {
  background: var(--marker) !important;
  color: var(--ink) !important;
  font-weight: 700 !important;
  border-radius: 2px;
}

mark.podcast-search-hit {
  background: var(--marker);
  color: var(--ink);
  padding: 1px 3px;
  border-radius: 2px;
}

/* Floating button to resume follow (fixed above bottom tab bar on mobile & desktop) */
.podcast-resume-follow {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-full);
  background: var(--accent-strong);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 20px color-mix(in oklab, var(--accent-strong) 40%, transparent), 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: -0.01em;
  animation: rise-in 180ms var(--ease-out);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
  white-space: nowrap;
}

.podcast-resume-follow[hidden] {
  display: none !important;
}

.podcast-resume-follow:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 24px color-mix(in oklab, var(--accent-strong) 55%, transparent);
}

.podcast-resume-follow:active {
  transform: translateX(-50%) scale(0.96);
}
