:root {
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --bg: #212121;
  --surface: #262626;
  --surface-2: #2e2e2e;
  --fg1: #ffffff;
  --fg2: rgba(255, 255, 255, 0.64);
  --fg3: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.28);
  --field: rgba(255, 255, 255, 0.06);
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--fg1);
  text-underline-offset: 3px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.auth-brand {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  padding: 48px clamp(32px, 7vw, 96px);
}

.brand-lockup {
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.98;
}

.brand-copy {
  max-width: 360px;
  margin: 28px 0 0;
  color: var(--fg2);
  font-size: 17px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(24px, 5vw, 72px);
}

.auth-card {
  width: 100%;
  max-width: 390px;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--fg3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.auth-title {
  margin: 0 0 28px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--fg3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--fg3);
  font-size: 13px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--field);
  color: var(--fg1);
  font: 400 16px var(--font-sans);
  padding: 14px 16px;
  transition: border-color 120ms var(--ease-standard), box-shadow 120ms var(--ease-standard);
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 22px;
  color: var(--fg2);
  font-size: 14px;
}

.check-field input {
  accent-color: #ffffff;
}

.actions {
  margin-top: 22px;
}

.button,
input[type="submit"],
button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #212121;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 15px var(--font-sans);
  min-height: 48px;
  padding: 13px 24px;
  text-decoration: none;
  transition: background 120ms var(--ease-standard), border-color 120ms var(--ease-standard);
}

/* Gate behind a real pointer: touch devices have no true hover, and mobile
   Safari otherwise leaves the last-tapped button in a stuck `:hover` state. */
@media (hover: hover) {
  .button:hover,
  input[type="submit"]:hover,
  button:hover {
    background: rgba(255, 255, 255, 0.86);
  }
}

.button-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--fg1);
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: center;
  margin-top: 22px;
  color: var(--fg3);
  font-size: 13px;
}

.auth-links p {
  margin: 0;
}

.error-panel {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  margin: 0 0 22px;
  padding: 16px;
}

.error-panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.error-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--fg2);
}

/* Flash notices flow above the page content (not fixed over it) and respect the
   iOS safe-area inset, so they never cover the heading/nav (issue #106). */
.flash-stack {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0;
}

.flash {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(33, 33, 33, 0.94);
  color: var(--fg1);
  margin: 0 0 8px;
  padding: 10px 16px;
}

.flash__text {
  flex: 1;
}

.flash-alert {
  border-color: rgba(255, 255, 255, 0.44);
}

.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 18px clamp(20px, 5vw, 56px);
}

.topbar-title {
  color: var(--fg3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-actions form {
  margin: 0;
}

/* Top-right profile menu: a compact avatar button that opens a popover with
   the account identity and actions, so the controls sit consistently in the
   corner instead of stacking under the title on mobile. */
.profile-menu {
  position: relative;
}

.profile-menu form {
  margin: 0;
}

.profile-trigger {
  width: 38px;
  min-height: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--fg1);
}

.profile-avatar {
  font: 600 14px var(--font-sans);
  line-height: 1;
  letter-spacing: 0;
}

.profile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.profile-panel[hidden] {
  display: none;
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.profile-handle {
  color: var(--fg1);
  font-weight: 600;
  font-size: 14px;
}

.profile-email {
  color: var(--fg3);
  font-size: 13px;
  word-break: break-word;
}

.profile-item {
  width: 100%;
  min-height: auto;
  display: block;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg2);
  font: 500 14px var(--font-sans);
  text-align: left;
  text-decoration: none;
}

/* Override the global white-pill button:hover for the menu surfaces. */
@media (hover: hover) {
  .profile-trigger:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
  }

  .profile-item:hover {
    background: var(--surface-2);
    color: var(--fg1);
  }
}

.dashboard-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 64px clamp(24px, 6vw, 80px);
}

.empty-dashboard {
  max-width: 720px;
  width: 100%;
}

.empty-dashboard h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.98;
}

.empty-dashboard p {
  max-width: 520px;
  margin: 28px 0 0;
  color: var(--fg2);
  font-size: 18px;
}

.empty-dashboard__copy {
  max-width: 520px;
  margin: 20px 0 0;
  color: var(--fg2);
  font-size: 18px;
}

@media (max-width: 760px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    align-items: flex-end;
    border-bottom: 1px solid var(--border);
    border-right: 0;
    min-height: 36vh;
  }

  .auth-panel {
    align-items: flex-start;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-actions {
    align-items: flex-start;
  }
}

/* ============================================================
   Configuration Conversation — chat surface
   Charcoal + white, Inter, calm motion (design-system tokens).
   ============================================================ */

.chat,
.configuration-flow {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.chat-scroll,
.configuration-stage {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4, 16px);
}

.configuration-step {
  max-width: 760px;
  min-height: 42vh;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.configuration-step__nav {
  margin-bottom: 24px;
}

.configuration-step__back,
.configuration-review__change {
  color: var(--fg2);
  font-size: 14px;
  text-decoration: none;
}

.configuration-step__back:hover,
.configuration-review__change:hover {
  color: var(--fg1);
}

.configuration-step__title {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.16;
  letter-spacing: 0;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.configuration-step__title p {
  margin: 0;
}

.configuration-step__description {
  color: var(--fg2);
  font-size: 16px;
  margin: 16px 0 28px;
  max-width: 56ch;
}

.configuration-step__suggestions {
  margin-top: 28px;
}

.configuration-review {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 32px;
}

.configuration-review__header {
  margin: 18px 0 28px;
}

.configuration-review__eyebrow,
.configuration-review__label {
  color: var(--fg2);
  font-size: 13px;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.configuration-review__title {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
  margin: 0;
}

.configuration-review__description,
.configuration-review__overview {
  color: var(--fg2);
  max-width: 64ch;
}

.configuration-review__summary,
.configuration-review__episodes,
.configuration-review__threads {
  border-top: 1px solid var(--border);
  padding: 22px 0;
}

.configuration-review__podcast-title {
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
  margin: 0 0 8px;
}

.configuration-review__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 12px;
}

.configuration-review__meta dt {
  color: var(--fg2);
  font-size: 13px;
  margin-bottom: 4px;
}

.configuration-review__meta dd {
  margin: 0;
}

.configuration-review__section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.configuration-review__section-heading h2 {
  margin: 0;
}

.configuration-review__episodes ol {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.configuration-review__episodes li {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.configuration-review__episodes strong,
.configuration-review__episodes span {
  display: block;
}

.configuration-review__episodes span {
  color: var(--fg2);
  margin-top: 4px;
}

.configuration-review__covers {
  color: var(--fg2);
  font-size: 13px;
  margin: 8px 0 0;
}

.configuration-review__covers-label {
  font-weight: 600;
  margin-right: 6px;
}

.configuration-review__threads ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.configuration-review__threads li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.configuration-review__thread-coverage {
  color: var(--fg2);
  font-size: 13px;
  white-space: nowrap;
}

.configuration-review__approve {
  margin-top: 12px;
}

.chat-messages {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.chat-empty {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chat-empty-title {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}

.chat-empty-sub {
  color: var(--fg2);
  font-size: 16px;
  margin: 16px 0 28px;
  max-width: 48ch;
}

.message {
  display: flex;
  margin: 10px 0;
}

.message-user {
  justify-content: flex-end;
}

.message-assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: 76%;
  padding: 13px 17px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.55;
}

.message-user .bubble {
  background: #fff;
  color: #212121;
  border-bottom-right-radius: 6px;
}

.message-assistant .bubble {
  background: var(--surface);
  color: var(--fg1);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.bubble p {
  margin: 0 0 0.6em;
}

.bubble p:last-child {
  margin-bottom: 0;
}

/* Suggestion chips */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestions-tray {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--space-4, 16px);
}

.suggestions-tray:not(:empty) {
  padding-bottom: 12px;
}

.suggestion {
  font-size: 14px;
  font-weight: 400;
  color: var(--fg2);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  cursor: pointer;
  justify-content: flex-start;
  text-align: left;
  transition: background var(--dur-fast, 120ms) var(--ease-standard);
  width: auto;
}

/* Gate hover behind a real pointer so mobile Safari doesn't leave the last
   tapped option in a stuck `:hover` state that reads as pre-selected. */
@media (hover: hover) {
  .suggestion:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--fg1);
  }
}

.suggestion-option {
  padding-left: 12px;
}

/* Only multiple-answer suggestions carry a checkbox; single-answer suggestions
   submit on tap, so they're plain exclusive pills with no indicator. */
.suggestion-toggle::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
}

.suggestion-toggle.is-selected {
  color: var(--fg1);
  border-color: var(--border-strong);
}

.suggestion-toggle.is-selected::before {
  background: var(--fg1);
  border-color: var(--fg1);
}

.suggestion-other-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.suggestion-other-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(360px, 100%);
}

.suggestion-other-entry.is-hidden {
  display: none;
}

.suggestion-other-input {
  min-height: 44px;
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--field);
  color: var(--fg1);
  /* >=16px so iOS Safari doesn't auto-zoom the page when the field is focused. */
  font: 400 16px var(--font-sans);
  padding: 10px 12px;
}

.suggestion-other-submit,
.suggestion-submit {
  width: auto;
  min-height: 44px;
  padding: 10px 16px;
}

.suggestion-other-submit {
  width: 44px;
  border-radius: var(--radius-pill);
  padding: 0;
}

/* Examples (issue #116): inspiration on the opening step. Deliberately quieter
   than suggestion pills — they pre-fill the box, they aren't answers. */
.configuration-examples {
  margin-top: 24px;
}

.configuration-examples__label {
  font-size: 13px;
  color: var(--fg2);
  margin: 0 0 10px;
}

.configuration-examples__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.configuration-example {
  font: 400 15px var(--font-sans);
  color: var(--fg2);
  background: transparent;
  border: none;
  border-left: 2px solid var(--border);
  border-radius: 0;
  padding: 4px 0 4px 12px;
  text-align: left;
  cursor: pointer;
  transition: color var(--dur-fast, 120ms) var(--ease-standard),
              border-color var(--dur-fast, 120ms) var(--ease-standard);
}

@media (hover: hover) {
  .configuration-example:hover {
    color: var(--fg1);
    border-left-color: var(--border-strong);
  }
}

@media (max-width: 640px) {
  .suggestions {
    flex-direction: column;
    align-items: stretch;
  }

  .suggestion {
    width: 100%;
    border-radius: var(--radius-md);
  }

  .configuration-step {
    min-height: 44vh;
  }

  .configuration-review__meta {
    grid-template-columns: 1fr;
  }

  .configuration-review__section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Composer */
.composer {
  flex: none;
  padding: 12px var(--space-4, 16px) 22px;
}

.composer.is-hidden {
  display: none;
}

.composer-box {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer-input {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  max-height: 160px;
  padding: 8px 0;
}

.composer-send {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--radius-pill);
  border: none;
  background: #fff;
  color: #212121;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast, 120ms) var(--ease-standard);
}

.composer-send:hover {
  background: rgba(255, 255, 255, 0.85);
}

/* Duration choices (issues #170, #171): bounded episode-length cards rendered
   inline in the step body — not the bottom composer — so nothing is clipped
   against the iPhone safe area. */
.duration-choices {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.duration-choices__group {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.duration-choices__legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--fg2);
}

.duration-choices__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Each card wraps its native radio so the whole tile is a large touch target
   with proper radio-group semantics and keyboard support. */
.duration-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  border-radius: var(--radius-3, 14px);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.duration-choice__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.duration-choice__duration {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg1);
}

.duration-choice__credits {
  font-size: 13px;
  color: var(--fg2);
}

/* Strong, accessible selected state. */
.duration-choice:has(.duration-choice__input:checked) {
  border-color: var(--fg1);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--fg1);
}

.duration-choice:has(.duration-choice__input:focus-visible) {
  outline: 2px solid var(--fg1);
  outline-offset: 2px;
}

.duration-choices__submit {
  align-self: flex-start;
  width: auto;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
}

/* Thinking indicator: pulsing dots + shimmering label */
.thinking {
  max-width: 760px;
  margin: 4px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg2);
  font-size: 15px;
  padding: 6px 2px;
}

.thinking[hidden] {
  display: none;
}

.thinking-dots {
  display: flex;
  gap: 6px;
}

.thinking-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  display: block;
  animation: shd-pulse 1.2s var(--ease-standard) infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

.thinking-label {
  background: linear-gradient(90deg, var(--fg3) 0%, var(--fg1) 50%, var(--fg3) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shd-shimmer 1.6s linear infinite;
}

@keyframes shd-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes shd-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Written pipeline: podcast list + episode status (issue #7) ────────────── */

.dashboard-podcasts {
  align-self: start;
  max-width: 860px;
  width: 100%;
  /* A grid item's min-width:auto would let a long nowrap row title inflate the
     whole column past the viewport instead of ellipsizing (#155 rows). */
  min-width: 0;
}

.dashboard-podcasts h1 {
  margin: 0 0 28px;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 700;
  line-height: 1;
}

/* The Library is a dense list of rows (#155, ADR 0019): flush single column,
   hairline separators, no card chrome. */
.podcast-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.podcast-card {
  border-bottom: 1px solid var(--border);
}

.podcast-card:first-child {
  border-top: 1px solid var(--border);
}

/* A completed show's whole row is a link to its public page; in-progress and
   failed rows reuse this layout but are rendered as a plain (non-link) row. */
.podcast-card__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  text-decoration: none;
  color: inherit;
}

.podcast-card__art {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

/* #172: neutral shimmer holds the artwork slot while cover art is fetched —
   the generic question-mark asset never poses as a generating show's art. */
.podcast-card__art--pending {
  display: block;
  background: var(--field);
}

@media (prefers-reduced-motion: no-preference) {
  .podcast-card__art--pending {
    animation: podcast-card-generating 1.6s ease-in-out infinite;
  }
}

/* Title over lifecycle line, both truncating rather than wrapping. */
.podcast-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.podcast-card__title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Second line: "2 episodes · 1h 24m" on published rows… */
.podcast-card__summary {
  font-size: 13px;
  color: var(--fg2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* …or the lifecycle status copy ("Generating", "Generation failed") in the
   same slot; completed shows render none. */
.podcast-card__state {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg2);
}

.podcast-card__chevron {
  margin-left: auto;
  color: var(--fg2);
  font-size: 20px;
  flex-shrink: 0;
}

/* A library of shows: completed Podcasts read at full contrast, while shows
   still being made (or failed) sit back at lower contrast. */
.podcast-card--writing_episodes,
.podcast-card--generating_audio,
.podcast-card--failed {
  opacity: 0.65;
}

/* A show still being made pulses its status copy so the Library reads as
   actively working. Failed shows are terminal, so they do not animate. */
@media (prefers-reduced-motion: no-preference) {
  .podcast-card--writing_episodes .podcast-card__state,
  .podcast-card--generating_audio .podcast-card__state {
    animation: podcast-card-generating 1.6s ease-in-out infinite;
  }
}

@keyframes podcast-card-generating {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.episodes h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 16px;
}

.episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.episode {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

/* ---- Public site (unauthenticated) ---- */
.public-site {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) 24px 96px;
}

.public-podcast__header {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}

.public-podcast__artwork {
  margin: 0;
}

.public-podcast__header--centered {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.public-podcast__art {
  width: min(220px, 68vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.public-podcast__art-credit {
  max-width: 200px;
  margin-top: 8px;
  color: var(--fg3);
  font-size: 12px;
  line-height: 1.35;
}

.public-podcast__eyebrow {
  margin: 0 0 8px;
  color: var(--fg3);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.public-podcast__title {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.04;
}

.public-podcast__overview {
  color: var(--fg2);
  margin: 16px 0 0;
  max-width: 52ch;
}

.public-podcast__header--centered .public-podcast__overview {
  margin-left: auto;
  margin-right: auto;
}

/* Subscribe affordance (issue #112). */
.public-subscribe {
  margin: 40px 0 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.public-subscribe__heading {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.public-subscribe__hint {
  color: var(--fg2);
  font-size: 14px;
  margin: 6px 0 16px;
}

.public-subscribe__apps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-subscribe__app {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--fg1);
  text-decoration: none;
  font-size: 14px;
}

@media (hover: hover) {
  .public-subscribe__app:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

.public-subscribe__feed {
  display: flex;
  gap: 8px;
}

.public-subscribe__feed-url {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--fg2);
  font: 400 13px var(--font-sans);
  padding: 8px 12px;
}

.public-subscribe__copy {
  flex: none;
  width: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg1);
  font-size: 14px;
  min-height: 0;
  padding: 8px 16px;
  cursor: pointer;
}

.public-episodes__heading {
  font-size: 22px;
  font-weight: 600;
  margin: 48px 0 16px;
}

.public-episodes__empty {
  color: var(--fg2);
}

/* Episode Rows (#156, ADR 0019): flush dense list, the row is the tap target. */
.public-episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.public-episode {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.public-episode:first-child {
  border-top: 1px solid var(--border);
}

.public-episode__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 4px;
  width: 100%;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  text-decoration: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.public-episode__row-art {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.public-episode__row-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.public-episode__row-meta {
  color: var(--fg3);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.public-episode__row-title {
  font-size: 17px;
  font-weight: 600;
}

/* The angle is the row description, clamped to a teaser per the glossary. */
.public-episode__row-angle {
  color: var(--fg2);
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ⓘ — the route to the episode's own page once the row body plays (#158). */
.public-episode__info {
  flex-shrink: 0;
  padding: 12px;
  color: var(--accent, var(--fg2));
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

.public-episode__back {
  margin: 0 0 20px;
  font-size: 14px;
}

/* #163: compact circular play control beside the episode title — the same
   visual language as the Full-Screen Player's transport, scaled down. */
.public-episode__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 0;
  min-width: 0;
}

.public-episode__title-row .public-episode__title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.public-episode__play {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--fg1);
  color: var(--bg, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Same SVG play/pause glyph as the transport buttons (#167): the old
   CSS-gradient pause bars never rendered inside the iOS WebView, leaving an
   empty circle while this episode was playing. */
.public-episode__play .player-glyph {
  width: 20px;
  height: 23px;
  margin-left: 2px;
}

.public-episode__play.is-playing .player-glyph {
  margin-left: 0;
}

.public-episode__header {
  display: grid;
  grid-template-columns: minmax(104px, 160px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.public-episode__art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* The audio element is the hidden engine (#157, ADR 0019) — the Full-Screen
   Player is the visible UI. Audio keeps playing while display: none. */
.public-player--engine {
  display: none;
}

.public-player__open {
  margin-top: 16px;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: var(--fg1);
  color: var(--bg, #fff);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Now Playing Bar (#158, ADR 0019): the compact view over the persistent audio
   engine. The details re-open the overlay; play/pause is its only control. */
.now-playing-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 40;
  width: min(calc(100vw - 32px), 680px);
  min-height: 68px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg, #fff);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}

.now-playing-bar[hidden] {
  display: none;
}

/* A real <button> (keyboard-expandable), reset to read as plain bar content. */
.now-playing-bar__details {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
}

.now-playing-bar__art {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.now-playing-bar__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.now-playing-bar__title,
.now-playing-bar__podcast {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-bar__title {
  font-size: 15px;
  font-weight: 600;
}

.now-playing-bar__podcast {
  color: var(--fg2);
  font-size: 13px;
}

.now-playing-bar__play {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--fg1);
  color: var(--bg, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* The global button rule's 24px inline padding exceeds this 44px circle,
     leaving zero content width — the glyph (a flex item) was crushed to 0
     and the button rendered as an empty circle. Its min-height: 48px also
     stretched the 44px circle into an oval. */
  padding: 0;
  min-height: 0;
}


/* #169: the player is a media transport surface — rapid taps are control
   interaction, not double-tap zoom. Scoped to the player UI (overlay, its
   controls, and the bar) so pinch/double-tap zoom stays available on the rest
   of the page; never user-scalable=no on the viewport. */
.full-screen-player,
.full-screen-player button,
.full-screen-player input,
.now-playing-bar,
.now-playing-bar button {
  touch-action: manipulation;
}

/* Full-Screen Player overlay: slides over the page, never a navigation. */
.full-screen-player {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--bg, #fff);
}

.full-screen-player[hidden] {
  display: none;
}

/* In the shell the native Back button is the collapse control (#168) — hide
   the web chevron so there aren't two competing exits. */
.full-screen-player--native .full-screen-player__collapse {
  display: none;
}

.full-screen-player__collapse {
  position: absolute;
  top: 16px;
  left: 16px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--fg2);
  cursor: pointer;
  padding: 8px;
}

.full-screen-player__art {
  width: min(70vw, 320px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.full-screen-player__title {
  margin: 12px 0 0;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.full-screen-player__podcast {
  margin: 0;
  color: var(--fg2);
  font-size: 14px;
  text-align: center;
}

.full-screen-player__scrub {
  width: min(80vw, 420px);
  margin-top: 12px;
}

.full-screen-player__scrubber {
  --scrubber-progress: 0%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.full-screen-player__scrubber::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    to right,
    var(--fg1) 0 var(--scrubber-progress),
    var(--fg2) var(--scrubber-progress) 100%
  );
}

.full-screen-player__scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7.5px;
  border: none;
  border-radius: 50%;
  background: var(--fg1);
}

.full-screen-player__scrubber::-moz-range-track {
  height: 5px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--fg2);
}

.full-screen-player__scrubber::-moz-range-progress {
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--fg1);
}

.full-screen-player__scrubber::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--fg1);
}

.full-screen-player__times {
  display: flex;
  justify-content: space-between;
  color: var(--fg2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.full-screen-player__transport {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-top: 8px;
}

/* Skip buttons wear the podcast-app arrow ring: an SVG arc sweeping in the
   skip direction, arrowhead at the top, seconds centered inside. */
.full-screen-player__skip {
  position: relative;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--fg1);
  cursor: pointer;
  padding: 0;
  /* Center the seconds label explicitly (#162): UA-default button content
     alignment differs between WebKit and Blink, drifting the label on iOS. */
  display: flex;
  align-items: center;
  justify-content: center;
}

.full-screen-player__skip-ring {
  position: absolute;
  inset: 4px;
  /* The arrowhead pokes just above the arc's viewBox. */
  overflow: visible;
}

.full-screen-player__skip-seconds {
  position: absolute;
  inset: 4px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  transform: translateY(1px);
}

.full-screen-player__play {
  width: 72px;
  height: 72px;
  border: none;
  border-radius: 50%;
  background: var(--fg1);
  color: var(--bg, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0; /* the global button padding squeezed the 26px glyph to 24px */
}

/* #167: crisp SVG glyphs (like the skip rings) instead of CSS-gradient bars
   that blur on a physical display. Play and pause are separate SVG elements:
   toggling a child <g> is unreliable in the iOS WebView. */
.player-glyph {
  position: relative;
  display: block;
}

.full-screen-player__play .player-glyph {
  width: 26px;
  height: 30px;
  margin-left: 3px;
}

.full-screen-player__play.is-playing .player-glyph {
  margin-left: 0;
}

.now-playing-bar__play .player-glyph {
  width: 18px;
  height: 21px;
  margin-left: 2px;
}

.now-playing-bar__play.is-playing .player-glyph {
  margin-left: 0;
}

.player-glyph svg {
  width: 100%;
  height: 100%;
}

.player-glyph__play {
  display: block;
}

.player-glyph__pause {
  display: none;
}

.is-playing .player-glyph__play {
  display: none;
}

.is-playing .player-glyph__pause {
  display: block;
}

.public-player__duration {
  margin: 6px 0 0;
  color: var(--fg3);
  font-size: 13px;
}

@media (max-width: 640px) {
  .public-site {
    padding-inline: 20px;
  }

  .public-subscribe__feed {
    flex-direction: column;
  }

  .public-episode {
    padding: 18px;
  }

  .public-episode__header {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }

  .public-episode__art {
    width: min(180px, 64vw);
    margin-inline: auto;
  }

  .public-subscribe__copy {
    width: 100%;
  }
}
