/* Labs preview pages: formats, experiments, landing (/labs/home), episode and week. Uses the shared variables from
   main.css. */

/* Tokens. labs.css loads only on labs pages, so they live on :root and reach the nav and the bottom player,
   which sit outside the page container. */
:root {
  --home-briefing-width: 260px;
  --home-width: 1120px;
  /* The longest a line of text may run, about 70 characters. In em, so it scales with each element's font size. */
  --labs-measure: 30em;
  /* Type scale: every font size on a labs page is one of these. Base is reading text. */
  --text-xs: 13px;
  --text-sm: 15px;
  --text-base: 17px;
  --text-md: 20px;
  --text-lg: 24px;
  --text-xl: 28px;
  --text-2xl: 34px;
  --text-3xl: 40px;
  --text-4xl: 48px;
  /* Darker than the site's gray: the site gray falls under 4.5:1 contrast on the tinted cards. */
  --color-muted: #4B5563;
  --home-section-gap: 96px;
  --home-cover-width: 260px;
  --home-show-size: 80px;
  --home-flagship-size: 132px;
  --home-show-chip-size: 76px;
  --home-gallery-columns: 5;
  --home-radius: 20px;
  --home-radius-small: 10px;
  --home-tap: 44px;
  --home-play-size: 36px;
  --home-pill: 999px;
  --home-cta-height: 48px;
  --home-player-height: 76px;
  /* The now playing panel: its width and cover width when centered, and the dimmed page behind it (the ink color). */
  --now-playing-width: 680px;
  --now-playing-cover-width: 240px;
  --now-playing-backdrop: rgba(3, 49, 75, 0.55);
  /* Borrowed from Blinkist: navy ink, a mint call to action, pastel tiles. */
  --home-ink: #03314B;
  --home-heart: #D62D5B;
  --home-mint: #2CE080;
  --home-mint-dark: #1FC46D;
  --home-sun: #FFF1C2;
  --home-sky: #EAF6FB;
  --home-tile-0: #FFE8A3;
  --home-tile-1: #FDCFC1;
  --home-tile-2: #C9EAF7;
  --home-tile-3: #DCF5BE;
  --home-tile-4: #E6DCFB;
  --home-tile-5: #FFD9EA;
  /* The hero's three stakes: a dark shade of each color on a light background of the same color. */
  --home-stake-health: #0B7A44;
  --home-stake-health-bg: #C8F2DA;
  --home-stake-money: #8A5A00;
  --home-stake-money-bg: #FFE7A3;
  --home-stake-future: #135E99;
  --home-stake-future-bg: #CDE9F8;
}

.labs-page {
  max-width: var(--home-width);
  margin: 0 auto;
  font-size: var(--text-base);
}

.labs-page h1 {
  font-size: var(--text-2xl);
}

.labs-page h2 {
  font-size: var(--text-lg);
}

.labs-page small {
  font-size: var(--text-sm);
}

/* Text never runs the full page width. Classed list items are cards or rows, so they keep their layout width.
   :where keeps this rule weak, so a component can set its own width. */
.labs-page :where(p, h1, h2, h3, h4, summary, li:not([class])) {
  max-width: var(--labs-measure);
}

/* Sections */
.labs-section {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

.labs-section h2 {
  font-size: var(--text-lg);
  font-weight: 600;
}

.labs-section__intro {
  color: var(--color-muted);
}

.labs-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;  /* one script per row */
}

/* Cards */
.labs-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.labs-card h3 {
  font-size: var(--text-md);
  font-weight: 600;
}

.labs-card audio {
  width: 100%;
}

.labs-note {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.labs-note__label {
  display: block;
  margin-bottom: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
}

.labs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.labs-meta b {
  font-weight: 500;
  color: var(--color-text);
}

/* Transcript */
.labs-transcript {
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.labs-transcript summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-brand);
}

.labs-transcript__lines {
  display: grid;
  gap: 8px;
  max-height: 420px;
  margin-top: 10px;
  padding-right: 6px;
  overflow-y: auto;
  font-size: var(--text-sm);
}

.labs-line--dialogue {
  display: grid;
  grid-template-columns: 2em 1fr;
}

.labs-line__speaker {
  font-weight: 600;
  color: var(--color-brand);
}

.labs-line__speaker--b {
  color: var(--color-muted);
}

/* Voice cast audition (labs-cast.js): one card per voice with play, Yes and No. Buttons are scoped under
   .labs-page to outweigh main.css's base button rule, including its hover and press colors. */
.cast-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.cast-filters,
.cast-choices {
  display: flex;
  gap: 8px;
}

.labs-page button.cast-filter,
.labs-page button.cast-choice {
  min-height: var(--home-tap);
  padding: 0 16px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-tap);
  font-size: var(--text-sm);
}

.labs-page button.cast-filter:hover,
.labs-page button.cast-choice:hover {
  background: var(--home-sky);
}

.labs-page button.cast-filter[aria-pressed="true"] {
  background: var(--home-ink);
  border-color: var(--home-ink);
  color: var(--color-surface);
}

.labs-page button.cast-choice[data-cast-choice="yes"][aria-pressed="true"] {
  background: var(--home-mint);
  border-color: var(--home-mint-dark);
  color: var(--home-ink);
}

.labs-page button.cast-choice[data-cast-choice="no"][aria-pressed="true"] {
  background: var(--color-border);
  border-color: var(--color-border-strong);
  color: var(--color-muted);
}

.cast-tally {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.labs-page button.cast-copy {
  min-height: var(--home-tap);
  margin-left: auto;
  background: var(--home-ink);
  border-radius: var(--home-tap);
  font-size: var(--text-sm);
}

.cast-status {
  min-height: 1.5em;
  font-size: var(--text-xs);
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.cast-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  padding: 0;
  list-style: none;
}

.cast-card {
  display: grid;
  grid-template-columns: var(--home-tap) 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.cast-card[hidden] {
  display: none;
}

.cast-card[data-choice="yes"] {
  border-color: var(--home-mint-dark);
  box-shadow: inset 0 0 0 1px var(--home-mint-dark);
}

.cast-card[data-choice="no"] {
  opacity: 0.6;
}

.cast-card__name h3 {
  font-size: var(--text-md);
  font-weight: 600;
}

.cast-card__name p {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.cast-card .cast-choices {
  grid-column: 1 / -1;
}

.cast-card .cast-choice {
  flex: 1;
}

.labs-page button.cast-play {
  width: var(--home-tap);
  height: var(--home-tap);
  padding: 0;
  background: var(--home-ink);
  border-radius: 50%;
  font-size: var(--text-sm);
}

.labs-page button.cast-play::before {
  content: "\25B6";
}

.labs-page button.cast-play[aria-pressed="true"] {
  background: var(--home-mint);
  color: var(--home-ink);
}

.labs-page button.cast-play[aria-pressed="true"]::before {
  content: "\275A\275A";
}

/* Show narrators: one column per cast voice, its card on top and the shows it reads below, each opening to the
   listener and the reason for the pick. */
.narrator-grid {
  display: grid;
  gap: 24px 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  align-items: start;
}

.narrator-shows {
  padding: 0;
  list-style: none;
}

.narrator-shows li {
  border-bottom: 1px solid var(--color-border);
}

/* Scoped under .labs-page to outweigh its centered flex summary; main.css's open marker sits left of both lines. */
.labs-page .narrator-shows summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 8px 4px;
}

.narrator-shows summary::before {
  grid-row: 1 / span 2;
}

.narrator-shows summary b {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.narrator-shows summary span,
.narrator-shows details p {
  padding: 0 4px 8px;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.narrator-shows details p b {
  color: var(--color-text);
}

/* Edition experiments: key ideas, 7 day plan, cover styles */
.labs-edition__head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.labs-edition__titles {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.labs-edition__cover {
  flex: 0 0 auto;
  width: 120px;
  height: 180px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.labs-step {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.labs-step h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.labs-step__number {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 8px;
  color: var(--color-brand);
}

.labs-ideas,
.labs-recall,
.labs-sources,
.labs-cover-key {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.labs-sources {
  gap: 2px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.labs-cover-key {
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.labs-recall__card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.labs-recall__card summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text);
}

.labs-recall__card details p {
  margin-top: 8px;
  font-size: var(--text-sm);
}

.labs-covers {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.labs-covers img,
.labs-covers__framed svg {
  display: block;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.labs-covers__square,
.labs-covers__framed svg {
  width: 220px;
  height: 220px;
}

.labs-covers__portrait {
  width: auto;  /* keeps the 2:3 portrait ratio */
  height: 220px;
}

/* Check results: claim and stance checks on answers and reviews */
.labs-status {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-brand);
}

.labs-status--fail {
  color: var(--color-danger);
}

.labs-stance {
  display: inline-block;
  padding: 0 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-brand);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--home-pill);
}

/* Onboarding: goal chips and first shelves */
.labs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.labs-chip {
  display: inline-block;
  padding: 6px 14px;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-pill);
}

.labs-chip:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.labs-shelf {
  display: flex;
  gap: 16px;
  padding: 0 0 6px;
  overflow-x: auto;
  list-style: none;
}

.labs-shelf__item {
  display: grid;
  flex: 0 0 140px;
  gap: 4px;
  align-content: start;
}

.labs-shelf__cover {
  width: 140px;
  height: 210px;  /* 2:3, the portrait cover ratio */
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.labs-shelf__tile {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  overflow: hidden;
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-background);
  border: 1px solid var(--color-border);
}

.labs-shelf__title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

/* Landing page (/labs/home): Headway's hero and Blinkist's look, then shelves to explore. Buttons are scoped as
   ".home button.x" because main.css styles every button at higher specificity, including hover and press colors. */

/* labs-player.js measures the open player into --player-space. */
body.home-has-player {
  padding-bottom: var(--player-space, var(--home-player-height));
}

/* One heading style on every labs page: the sans body font in the ink color. */
.labs-page h1,
.labs-page h2,
.labs-page h3 {
  font-family: var(--font-body);
  color: var(--home-ink);
}

.home-eyebrow,
.episode-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-eyebrow {
  color: var(--color-brand);
}

/* Clamped text: each rule below sets its own line count. */
.home-screen__title a,
.home-screen__cross,
.home-card__title,
.home-show__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hero (Headway): the promise and one button on the left, the product itself on the right as two live screens,
   now playing and up next, built from real episodes. */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 48px;
}

.home-hero__pitch {
  display: grid;
  gap: 20px;
}

.home-hero h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Proof strip under the hero, Headway's stats row: a big figure over a short line, divided columns. */
.home-proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--home-section-gap);
  padding: 24px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius);
  background: var(--color-surface);
}

.home-proof__item {
  padding: 0 20px;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--color-muted);
  text-align: center;
}

.home-proof__item + .home-proof__item {
  border-left: 1px solid var(--color-border);
}

.home-proof__item strong {
  display: block;
  margin-bottom: 4px;
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.1;
  color: var(--home-ink);
}

/* Tabular digits so the count does not jitter while it rolls up. */
.home-count {
  font-variant-numeric: tabular-nums;
  color: var(--color-brand);
}

.home-hero h1 em {
  font-family: var(--font-heading);
  font-weight: 500;
}

/* A phrase that reads wrong split across lines, such as "3 hour podcast." */
.home-hero__unbroken {
  white-space: nowrap;
}

/* Blinkist's pills: each stake the hero names is a badge in its own color. The headline's line height leaves room for the
   pill, which covers the font's full height, so pills on neighboring lines never touch. */
.home-hero h1:has(.home-stake) {
  line-height: 1.55;
}

/* Italic letters lean right, so the right side gets more padding to look even. */
.home-stake {
  padding: 0.04em 0.22em 0.04em 0.14em;
  border-radius: 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.home-stake--health {
  background: var(--home-stake-health-bg);
  color: var(--home-stake-health);
}

.home-stake--money {
  background: var(--home-stake-money-bg);
  color: var(--home-stake-money);
}

.home-stake--future {
  background: var(--home-stake-future-bg);
  color: var(--home-stake-future);
}

/* Each benefit stays on one line, so the strip only wraps between them. */
.home-hero__sub {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
}

/* The proof figure under the hero button, TLDR's "8,000,000+ readers" line. */
.home-hero__proof {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* The shows people already know, right under the main button: tap one to catch up on it. */
.home-show-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--home-show-chip-size);
  justify-content: start;
  justify-self: stretch;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

/* A mouse cannot swipe, so wider screens show every show at once. */
@media (min-width: 641px) {
  .home-show-strip {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, var(--home-show-chip-size));
    overflow-x: visible;
  }
}

.home-screen__listen {
  width: 100%;
}

.home-show-strip::-webkit-scrollbar {
  display: none;
}

.home-show-chip {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: var(--home-tap);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.home-show-chip img {
  width: var(--home-show-chip-size);
  height: var(--home-show-chip-size);
  object-fit: cover;
  border-radius: var(--home-radius-small);
}

.home-streak {
  justify-self: start;
  padding: 6px 12px;
  border-radius: var(--home-pill);
  background: var(--home-sun);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--home-ink);
}

.home-streak[hidden] {
  display: none;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.home-hero__demo {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
}

.home-screen {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.home-screen__bar {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
  text-align: center;
}

.home-screen__cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--home-radius-small);
}

.home-screen__show {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.home-hero .home-screen__title {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.3;
}

.home-screen__title a {
  -webkit-line-clamp: 2;
  color: var(--home-ink);
  text-decoration: none;
}

.home-screen__idea,
/* A pick without a written headline falls back to its intro, so long text stops at three lines. */
.home-screen__teaser {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--home-ink);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-screen__cross {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--home-sun);
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--home-ink);
  -webkit-line-clamp: 3;
}

.home .home-cta,
.home button.home-button {
  min-height: var(--home-cta-height);
  padding: 12px 28px;
  border: 0;
  border-radius: var(--home-radius-small);
  background: var(--home-mint);
  color: var(--home-ink);
  font: 700 var(--text-base) var(--font-body);
  cursor: pointer;
}

.home .home-cta:hover,
.home .home-cta:active,
.home button.home-button:hover,
.home button.home-button:active {
  background: var(--home-mint-dark);
}

/* A link styled as the call to action, such as the signup at the end of the home page */
.home a.home-cta {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  text-decoration: none;
}

.home button.home-link,
.home button.home-link:hover,
.home button.home-link:active {
  padding: 0;
  border: 0;
  background: none;
  color: var(--home-ink);
  font: 600 var(--text-base) var(--font-body);
  text-decoration: underline;
  cursor: pointer;
}

.home-cross {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-brand) 12%, var(--color-surface));
  font-size: var(--text-xs);
  color: var(--color-brand-darker);
}

/* Generated illustrations */
.home-art {
  width: 120px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
}

.home-art--step {
  width: 160px;
}

/* Sections. minmax(0, 1fr) keeps a sideways shelf from widening its section, so only the shelf scrolls. */
.home-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin-bottom: var(--home-section-gap);
  min-width: 0;
}

.home-section h2 {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.home-section--center > h2 {
  margin-inline: auto;
  text-align: center;
}

/* The sections above the fold: smaller headings and covers, closer together, so several fit the first screen. */
.home-section--tight {
  --home-cover-width: 180px;
  gap: 16px;
  margin-bottom: 48px;
}

.home-section.home-section--tight h2 {
  font-size: var(--text-xl);
}

/* Weekly catch up tiles, one per genre with an edition */
.home-weeks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.home-week {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px;
  border-radius: var(--home-radius);
  background: var(--home-sky);
}

.home-week__art {
  display: flex;
}

.home-week__art img {
  width: 48px;
  height: 48px;
  margin-right: -8px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  object-fit: cover;
}

/* Briefing tile: a collage of its episode covers, the lead one large */
.home-briefing {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-radius: var(--home-radius);
  background: var(--home-sky);
}

.home-briefing__art {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--home-radius);
}

.home-briefing__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-briefing__art img:first-child {
  grid-row: 1 / -1;
}

.home-briefing__art img:only-child {
  grid-column: 1 / -1;
}

.home-briefing__shows {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-muted);
}

.home-briefing__shows b {
  font-weight: 600;
  color: var(--home-ink);
}

.home-briefing__label {
  display: block;
  margin-bottom: 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-week__title {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--home-ink);
  text-decoration: none;
}

/* main.css gives sections a display, which beats the browser's own [hidden] rule. */
.home-section[hidden] {
  display: none;
}

/* A shelf heading with its sort tabs beside it, wrapping under it on a phone. */
.home-section__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}

.home-section__head .home-goals {
  flex-wrap: nowrap;
  margin: 0;
}

.home-section__lead {
  max-width: 720px;
  justify-self: start;
  font-size: var(--text-base);
  line-height: 1.6;
  text-align: left;
  color: var(--color-muted);
}

.home-section__lead a {
  font-weight: 600;
  color: var(--home-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* A long run of tiles (the weekly catch ups) swipes sideways at every width instead of wrapping into rows */
.home-weeks--row {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: var(--home-briefing-width);
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.home-week,
.home-briefing {
  scroll-snap-align: start;
}

.home-card__meta b {
  font-weight: 600;
  color: var(--home-ink);
}

/* How it works */
.home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  list-style: none;
}

.home-step {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: center;
  text-align: center;
}

.home-step__number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--home-mint);
  font: 800 var(--text-md) var(--font-body);
  color: var(--home-ink);
}

.home-step h3 {
  font-size: var(--text-md);
  font-weight: 700;
}

.home-step p {
  line-height: 1.6;
  color: var(--color-muted);
}

.home-section--center .home-goals {
  justify-content: center;
}

/* Topic pills */
.home-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home button.home-goal {
  min-height: var(--home-tap);
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--home-ink);
  font: var(--text-sm) var(--font-body);
  cursor: pointer;
}

/* Blinkist marks the selected topic in yellow. */
.home button.home-goal:hover,
.home button.home-goal:active {
  background: var(--home-sky);
  border-color: var(--color-border-strong);
  color: var(--home-ink);
}

.home button.home-goal[aria-selected="true"] {
  background: var(--home-sun);
  border-color: transparent;
  font-weight: 700;
}

/* Shelves scroll sideways; arrows appear on wide screens. */
.home-shelf-wrap {
  position: relative;
  min-width: 0;
}

.home-shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--home-cover-width);
  gap: 24px;
  /* Sideways only: with overflow-y left to auto, a row a few pixels taller than its box also scrolls up and down. */
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.home button.home-shelf__nav {
  position: absolute;
  top: calc(var(--home-cover-width) * 9 / 32);
  z-index: var(--z-base);
  width: var(--home-tap);
  height: var(--home-tap);
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  font-size: var(--text-lg);
  color: var(--home-ink);
  cursor: pointer;
}

.home button.home-shelf__nav:hover,
.home button.home-shelf__nav:active {
  background: var(--home-sky);
}

.home button.home-shelf__nav--prev {
  left: -22px;
}

.home button.home-shelf__nav--next {
  right: -22px;
}

.home-card {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
  scroll-snap-align: start;
  text-align: left;
}

.home-tile {
  padding: 10px;
  border-radius: var(--home-radius-small);
}

.home-tile--0 { background: var(--home-tile-0); }
.home-tile--1 { background: var(--home-tile-1); }
.home-tile--2 { background: var(--home-tile-2); }
.home-tile--3 { background: var(--home-tile-3); }
.home-tile--4 { background: var(--home-tile-4); }
.home-tile--5 { background: var(--home-tile-5); }

/* Episode artwork is the YouTube thumbnail at 16:9. */
.home-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
}

.home-cover__art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* The cover play. Where a pointer can hover it shows on hover, centered and small so it never sits on faces for long.
   On a touch screen it stays in the cover's corner: a full size tap target around the same small circle. */
.home-cover button.home-play {
  position: absolute;
  display: grid;
  place-items: center;
  width: var(--home-play-size);
  height: var(--home-play-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--home-mint);
  color: var(--home-ink);
  font-size: var(--text-xs);
  cursor: pointer;
}

@media (hover: none) {
  .home-cover button.home-play {
    right: 0;
    bottom: 0;
    width: var(--home-tap);
    height: var(--home-tap);
    padding: calc((var(--home-tap) - var(--home-play-size)) / 2);
    background-clip: content-box;
  }
}

@media (hover: hover) {
  .home-cover button.home-play {
    inset: 0;
    margin: auto;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.15s;
  }

  .home-cover:hover button.home-play,
  .home-cover:focus-within button.home-play {
    opacity: 1;
  }

  .home-cover button.home-play:hover {
    background: var(--home-mint-dark);
  }
}

.home-card__title {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.35;
  /* Short titles take 2 or 3 lines on a phone card; a fourth line catches one with long words instead of cutting it. */
  -webkit-line-clamp: 4;
}

.home-card__title a {
  color: var(--color-text);
  text-decoration: none;
}

.home-card__show,
.home-card__meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.home-card__guest {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* A run of text that never breaks inside, such as each side of a card's "2 hr 27 min → 4:22". */
.home-nowrap {
  white-space: nowrap;
}

.home-card__intro {
  margin-top: 6px;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-text);
}

/* The show name gets its own line and wraps, so a long name is never cut. */
.home-card__show {
  font-weight: 500;
  color: var(--home-ink);
}

/* Save stays a quiet secondary control */
.home button.home-save,
.home button.home-save:hover,
.home button.home-save:active {
  justify-self: start;
  min-width: var(--home-tap);
  min-height: var(--home-tap);
  padding: 0;
  border: 0;
  background: none;
  font: var(--text-xs) var(--font-body);
  color: var(--color-muted);
  text-decoration: underline;
  cursor: pointer;
}

/* Save is a heart: an outline, filled in once saved. */
.home button.home-save[data-save] {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  text-decoration: none;
}

.home-save__heart {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.home button.home-save[aria-pressed="true"] {
  color: var(--home-heart);
  font-weight: 600;
}

.home-save[aria-pressed="true"] .home-save__heart {
  fill: currentColor;
}

/* On a card the heart ends the show line, clear of the artwork; a long show name gives way to it. Its tap area
   overhangs the line rather than making the card taller. */
.home-card__foot {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.home .home-card__foot button.home-save {
  flex-shrink: 0;
  justify-content: flex-end;
  margin-block: calc((22px - var(--home-tap)) / 2);
}

/* Top shows: the flagship shows as large square artwork with their full name and newest episode's date. */
.home-flagships {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--home-flagship-size);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.home-flagship {
  display: grid;
  align-content: start;
  gap: 6px;
  text-decoration: none;
  color: var(--color-text);
}

.home-flagship__art {
  width: var(--home-flagship-size);
  height: var(--home-flagship-size);
  border-radius: var(--home-radius-small);
  object-fit: cover;
  background: var(--home-sky);
}

.home-flagship__name {
  font: 700 var(--text-sm)/1.25 var(--font-body);
}

.home-flagship__new {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* The home page's show gallery: every flagship show at once, art filling its column. */
.home-flagships--grid {
  grid-auto-flow: row;
  grid-template-columns: repeat(var(--home-gallery-columns), minmax(0, 1fr));
  gap: 24px 16px;
  overflow: visible;
}

.home-flagships--grid .home-flagship__art {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

/* Browse by show */
.home-shows {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(var(--home-show-size) + 12px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.home-show {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-decoration: none;
}

.home-show__art {
  width: var(--home-show-size);
  height: var(--home-show-size);
  border: 3px solid transparent;
  border-radius: 50%;
  object-fit: cover;
}

.home-show:hover .home-show__art {
  border-color: var(--color-border-strong);
}

/* main.css buttons do not wrap; show names need two lines under the artwork. */
.home-show__name {
  width: 100%;
  white-space: normal;
  font: 600 var(--text-sm)/1.3 var(--font-body);
  color: var(--color-text);
  text-align: center;
  -webkit-line-clamp: 2;
}

/* FAQ: Headway's open list, a divider between questions and a plus that turns into a cross when open. On desktop
   the heading sits beside the questions. */
.home-faq-section {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: 48px;
}

.home-faq-section__intro p {
  margin-top: 12px;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-muted);
}

.home-faq {
  border-top: 1px solid var(--color-border);
}

.home-faq details {
  border-bottom: 1px solid var(--color-border);
}

.home-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--home-tap);
  padding: 22px 0;
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.35;
  color: var(--home-ink);
  list-style: none;
  cursor: pointer;
}

.home-faq summary::-webkit-details-marker {
  display: none;
}

/* main.css puts a small triangle before every summary; the plus on the right replaces it here. */
.home-faq summary::before {
  content: none;
}

.home-faq summary::after {
  content: "+";
  flex: none;
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1;
  color: var(--home-ink);
  transition: transform 0.2s;
}

.home-faq details[open] summary::after {
  transform: rotate(45deg);
}

.home-faq p {
  padding-bottom: 24px;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-muted);
}

.home-labs-note {
  margin-bottom: 32px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Bottom player */
.home-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 2fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: var(--home-player-height);
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

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

.home-player__cover {
  width: 64px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.home-player__title {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* One line under the title: a long show name shortens so the release date always shows in full. */
.home-player__byline {
  display: flex;
  min-width: 0;
  white-space: nowrap;
}

.home-player__show {
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-player__byline > :last-child {
  flex-shrink: 0;
  white-space: pre;
}

.home-player__audio {
  width: 100%;
}

/* Offered while a short plays and after it ends; the player sits outside .home, so it is styled here. */
.home-player button.home-player__full,
.home-player button.home-player__full:hover,
.home-player button.home-player__full:active {
  min-height: var(--home-tap);
  padding: 8px 16px;
  border: 0;
  border-radius: var(--home-radius-small);
  background: var(--home-mint);
  color: var(--home-ink);
  font: 700 var(--text-sm) var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}

.home-player button.home-player__full:hover {
  background: var(--home-mint-dark);
}

/* Reopens the now playing panel on the pages that have one; it takes one more column after the speed. */
.home-player:has(.home-player__open:not([hidden])) {
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 2fr) auto auto auto;
}

.home-player button.home-player__open,
.home-player button.home-player__open:hover,
.home-player button.home-player__open:active {
  width: var(--home-tap);
  height: var(--home-tap);
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--home-ink);
  font: 700 var(--text-md) var(--font-body);
  cursor: pointer;
}

/* main.css gives every button and image a display value, which beats the hidden attribute, so hidden is restated
   at a higher specificity. */
.home-player button.home-player__full[hidden],
.home-player button.home-player__open[hidden],
.home-player img.home-player__cover[hidden] {
  display: none;
}

/* Now playing panel (labs-now-playing.js): centered over the dimmed page here, the whole screen on a phone. The
   dialog scrolls; the sheet inside it fills it, so a click on the dialog itself is on the backdrop. */
.now-playing {
  width: min(calc(100% - 32px), var(--now-playing-width));
  max-width: none;
  max-height: calc(100% - 64px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--home-radius);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.now-playing::backdrop {
  background: var(--now-playing-backdrop);
}

.now-playing__sheet {
  display: grid;
  grid-template-columns: var(--now-playing-cover-width) minmax(0, 1fr);
  grid-template-areas: "head head" "cover intro" "next next" "ideas ideas" "read read";
  gap: 16px 24px;
  padding: 24px;
}

.now-playing__head {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.now-playing__cover {
  grid-area: cover;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--home-radius-small);
}

.now-playing__intro {
  grid-area: intro;
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.now-playing__title {
  font: 700 var(--text-md) / 1.3 var(--font-body);
  color: var(--home-ink);
}

.now-playing__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.now-playing button.now-playing__close,
.now-playing button.now-playing__close:hover,
.now-playing button.now-playing__close:active,
.now-playing button.now-playing__toggle,
.now-playing button.now-playing__toggle:hover,
.now-playing button.now-playing__toggle:active {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--home-tap);
  height: var(--home-tap);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--home-ink);
  font: 700 var(--text-md) var(--font-body);
  cursor: pointer;
}

.now-playing button.now-playing__close,
.now-playing button.now-playing__close:hover,
.now-playing button.now-playing__close:active {
  background: var(--home-sky);
}

.now-playing button.now-playing__toggle,
.now-playing button.now-playing__toggle:hover,
.now-playing button.now-playing__toggle:active {
  background: var(--home-mint);
}

.now-playing__seek {
  flex: 1;
  min-width: 0;
  min-height: var(--home-tap);
  accent-color: var(--home-ink);
}

.now-playing__time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.now-playing.home .episode-format {
  justify-self: start;
}

.now-playing__next {
  grid-area: next;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--home-radius-small);
  background: var(--home-sky);
}

.now-playing__up-next {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-weight: 600;
  color: var(--home-ink);
}

.now-playing__ideas {
  grid-area: ideas;
}

.now-playing__ideas ol {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-left: 24px;
  font-weight: 600;
  color: var(--home-ink);
}

.now-playing__read {
  grid-area: read;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  font-weight: 600;
  color: var(--home-ink);
  text-decoration: underline;
}

/* Parts the panel hides for an episode: main.css display values beat the hidden attribute here too. */
.now-playing img[hidden],
.now-playing .now-playing__next[hidden],
.now-playing.home .episode-format[hidden] {
  display: none;
}

.home-player__speed {
  min-height: var(--home-tap);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  font: var(--text-sm) var(--font-body);
}

/* Episode page (/labs/episode/{id}): Blinkist's hero and sticky key ideas outline, Headway's "You'll learn",
   numbered key points and "Did you know?" callouts. It sits inside .home, so it reuses the landing tokens and
   button styles. */
.episode {
  --episode-rail-width: 260px;
  --episode-reading-width: 600px;
  --episode-sticky-top: 24px;
}

.episode-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 8px 0 24px;
  list-style: none;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* The separator sits beside its crumb, and a long show name wraps within its own crumb. */
.episode-crumbs li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.episode-crumbs li + li::before {
  content: "/";
  flex: none;
  margin-right: 8px;
}

/* A one word crumb such as Home is narrower than a finger. */
.episode-crumbs a {
  min-width: var(--home-tap);
  color: var(--home-ink);
}

.episode-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 40px;
  align-items: center;
  padding: 40px;
  margin-bottom: 48px;
  border-radius: var(--home-radius);
  background: var(--home-sky);
}

.episode-hero__art {
  position: relative;
}

.episode-hero__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--home-radius-small);
}

.episode-hero__badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 56px;
  height: 56px;
  border: 3px solid var(--color-surface);
  border-radius: 50%;
}

.episode-hero h1 {
  margin: 4px 0 8px;
  font-size: var(--text-2xl);
  line-height: 1.2;
}

.episode-eyebrow {
  margin: 0;
  color: var(--color-muted);
}

.episode-hero__show {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--home-ink);
}

.week-hero__squeeze {
  margin: 0 0 8px;
  font-size: var(--text-md);
  line-height: 1.4;
}

.week-hero .episode-hero__intro {
  margin-bottom: 12px;
}

.week-hero__squeeze strong {
  color: var(--color-brand);
}

.episode-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 16px;
  font-size: var(--text-sm);
}

.episode-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 20px 0;
}

.episode-hero__read {
  color: var(--home-ink);
  font-weight: 600;
}

.episode-hero__intro {
  margin: 0;
  line-height: 1.6;
}

.episode-compare-preview {
  display: grid;
  gap: 8px;
  max-width: var(--episode-reading-width);
  padding: 16px 20px;
  margin: -24px auto 40px;
  border: 2px solid var(--home-mint);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--home-ink);
  text-decoration: none;
  line-height: 1.5;
}

.episode-learn {
  max-width: var(--episode-reading-width);
  margin: 0 auto 48px;
}

.episode-learn ul {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.episode-learn li {
  padding-left: 32px;
  position: relative;
  font-size: var(--text-base);
}

.episode-learn li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--home-mint-dark);
  font-weight: 700;
}

.episode-body {
  display: grid;
  grid-template-columns: var(--episode-rail-width) minmax(0, var(--episode-reading-width));
  gap: 48px;
  justify-content: center;
  margin-bottom: 48px;
}

.episode-main > :last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.episode-reading {
  max-width: var(--episode-reading-width);
  margin-inline: auto;
  margin-bottom: 40px;
}

/* Keep the first three ideas close to Listen on phones. */
.episode-hero:has(+ .episode-reading) {
  margin-bottom: 24px;
}

.episode-hero:has(+ .episode-reading) .episode-hero__actions {
  margin-bottom: 0;
}

.episode .episode-said {
  padding-bottom: 0;
  border-bottom: 0;
}

/* One steady page: the episode and its player stay at the left while the reading runs down one column. */
.episode-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  margin-bottom: 48px;
}

.episode-layout .episode-hero {
  position: sticky;
  top: var(--episode-sticky-top);
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: none;
  padding: 20px;
  margin: 0;
}

/* The episode card with its overview runs about 730 px; a shorter window scrolls it with the page so its end stays readable. */
@media (max-height: 760px) {
  .episode-layout .episode-hero {
    position: static;
  }
}

.episode-layout .episode-hero h1 {
  font-size: var(--text-xl);
}

.episode-layout .episode-hero__actions {
  gap: 12px;
  margin-bottom: 0;
}

.episode-layout .episode-reading {
  max-width: 680px;
  margin: 0;
}

/* Every key idea can be read as it stands: its claim, what was said and the moment to hear it. */
.episode-said__idea {
  padding: 20px 0;
  border-top: 1px solid var(--color-border);
}

.episode-said__idea h3 {
  margin-bottom: 8px;
  color: var(--home-ink);
  font-size: var(--text-md);
  line-height: 1.3;
}

.episode-said__idea > p:not([class]) {
  max-width: none;
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.55;
}

.episode-said__idea .episode-moment {
  margin-top: 0;
}

.episode-rail__menu {
  position: sticky;
  top: var(--episode-sticky-top);
}

.episode-rail summary {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--home-ink);
  font-weight: 700;
  cursor: pointer;
}

.episode-rail summary span {
  margin-left: auto;
}

.episode-rail__more {
  padding: 12px 4px 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.episode-rail .episode-rail__more a {
  padding: 12px 4px;
  color: var(--home-ink);
  font-weight: 600;
}

.episode-rail .episode-rail__more a::before {
  content: none;
}

.episode-rail ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: idea;
}

.episode-rail li {
  counter-increment: idea;
  border-bottom: 1px solid var(--color-border);
}

.episode-rail a {
  display: flex;
  gap: 12px;
  padding: 12px 4px;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
  text-decoration: none;
}

.episode-rail a::before {
  content: counter(idea);
  color: var(--home-ink);
  font-weight: 700;
}

.episode-rail a[aria-current] {
  color: var(--home-ink);
  font-weight: 600;
  background: var(--home-sky);
}

.episode-idea,
.episode-section {
  scroll-margin-top: var(--episode-sticky-top);
}

.episode-section {
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.episode-section h2 {
  margin-bottom: 16px;
}

/* Every key idea, on episode and briefing pages alike, is one tinted card. */
.episode-idea {
  padding: 24px;
  margin-bottom: 20px;
  border-radius: var(--home-radius);
  background: var(--home-stake-health-bg);
}

.episode-idea > :last-child {
  margin-bottom: 0;
}

.episode-quote__source a {
  color: var(--home-ink);
  font-weight: 600;
}

.episode-idea h2 {
  margin: 6px 0 12px;
  font-size: var(--text-lg);
  line-height: 1.3;
}

/* Reading text, one style on every page: labels, captions and quote sources carry a class and keep their own size. */
.episode-idea > p:not([class]),
.episode-section > p:not([class]),
.episode-quote > p:not([class]),
.week-position,
.key-points {
  font-size: var(--text-base);
  line-height: 1.55;
}

/* A narration script (an episode's read along, a briefing part's full script), set like a podcast transcript page:
   body size serif in a white panel, so it reads as the spoken words and not as more of the summary. */
.episode-script {
  margin-top: 16px;
  padding: 0 24px;
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
}

.episode-script > p {
  margin-top: 16px;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  line-height: 1.65;
}

.episode-script > p:last-child {
  margin-bottom: 24px;
}

.episode-fact {
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: var(--home-radius-small);
  background: var(--home-sun);
  line-height: 1.5;
}

/* Standalone links, so each one reaches the 44 px tap size. */
.episode-moment,
.episode-quote__source a,
.episode-hero__show a {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
}

.episode-moment {
  color: var(--home-ink);
  font-size: var(--text-sm);
  font-weight: 600;
}

.episode-cross h2 {
  margin-bottom: 16px;
}

.episode-cross ul {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.episode-cross li {
  line-height: 1.5;
}

.episode-cross__list {
  gap: 12px;
}

.episode-cross__item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  overflow-wrap: break-word;
}

.episode-cross__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.episode-cross__head .episode-stance {
  margin-right: 0;
}

.episode-cross__show {
  color: var(--home-ink);
  font-size: var(--type-meta);
  font-weight: 700;
  line-height: 1.3;
}

.episode-cross__episode {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: break-word;
}

a.episode-cross__episode {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  color: var(--home-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.episode-cross__episode:hover {
  color: var(--color-brand);
}

.episode-cross__body {
  margin: 0;
  color: var(--color-text);
  font-size: var(--type-body);
  line-height: 1.55;
}

.episode-stance {
  display: inline-block;
  padding: 2px 10px;
  margin-right: 6px;
  border-radius: var(--home-pill);
  font-size: var(--text-xs);
  font-weight: 700;
}

.episode-stance--agrees {
  background: var(--home-tile-3);
}

.episode-stance--differs {
  background: var(--home-tile-1);
}

.episode-stance--adds {
  background: var(--home-tile-2);
}

.episode-quote {
  margin: 20px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--home-mint);
}

.episode-quote p {
  margin: 0 0 6px;
}

.episode-quote .episode-quote__source {
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.episode-card {
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: var(--home-radius-small);
  background: var(--home-tile-4);
}

.episode-card summary {
  justify-content: space-between;
  gap: 16px;
  max-width: none;
  color: var(--home-ink);
  font-weight: 600;
  cursor: pointer;
}

/* "Show answer" on the right replaces main.css's small triangle. */
.episode-card summary::before {
  content: none;
}

.episode-card summary::after {
  content: "Show answer";
  flex: none;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
}

.episode-card[open] summary::after {
  content: "Hide";
}

.episode-card > p {
  margin-top: 12px;
}

.episode-card:last-child {
  margin-bottom: 0;
}

.episode-script summary {
  color: var(--home-ink);
  font-weight: 700;
  cursor: pointer;
}

.episode-watch__link {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  color: var(--home-ink);
  font-weight: 600;
}

.episode-watch__link img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--home-radius-small);
}

/* Summary length toggle on the episode page: 1 min short or the full summary. */
.episode-format {
  display: inline-flex;
  margin-top: 4px;
  border: 1px solid var(--home-ink);
  border-radius: var(--home-pill);
  overflow: hidden;
}

.home .episode-format button,
.home .episode-format button:hover,
.home .episode-format button:active {
  min-height: var(--home-tap);
  padding: 6px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--home-ink);
  font: 600 var(--text-sm) var(--font-body);
  cursor: pointer;
}

.home .episode-format button[aria-pressed="true"] {
  background: var(--home-ink);
  color: var(--color-surface);
}

/* Episode page strip when the episode is in a weekly catch up. */
.week-strip {
  max-width: var(--episode-reading-width);
  margin: -24px auto 32px;
  padding: 12px 16px;
  border-radius: var(--home-radius-small);
  background: var(--home-sun);
  color: var(--home-ink);
  font-size: var(--text-sm);
}

.week-strip a {
  color: var(--home-ink);
  font-weight: 600;
}

/* This week in {sector} (/labs/week/{sector}): the episode page layout with a show collage, a chapter list that
   seeks the catch up, and one card per show. */
/* Show page */
.show-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 32px;
}

.show-hero__art {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.show-hero__meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* The newest episode leads the show page, with its play buttons on the first screen. */
.show-newest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding: 24px;
  margin-bottom: 40px;
  border-radius: var(--home-radius);
  background: var(--home-sky);
}

/* Listen is the main action; the 1 minute version sits beside it as the lighter choice. */
.home .show-newest__actions button.home-button {
  border: 1px solid var(--home-ink);
  background: transparent;
  color: var(--home-ink);
}

.show-newest__things h3 {
  margin-bottom: 6px;
  font-size: var(--text-sm);
}

.show-newest__things ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
}

.show-episode-row__guest {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.show-all summary {
  padding: 12px 0;
  font-weight: 700;
  color: var(--home-ink);
  cursor: pointer;
}

.show-newest__text {
  display: grid;
  gap: 12px;
}

.show-newest__cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--home-radius-small);
  object-fit: cover;
}

.show-newest__title {
  font-size: var(--text-lg);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.show-newest__title a {
  display: inline-flex;
  align-items: center;
  min-width: var(--home-tap);
  min-height: var(--home-tap);
  color: var(--home-ink);
  text-decoration: none;
}

.show-newest__intro {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-muted);
}

.show-newest__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Both lengths share one row on a phone. */
.home .show-newest__actions button {
  flex: 1 1 auto;
  padding-inline: 12px;
}

.show-earlier {
  margin-bottom: 16px;
  font-size: var(--text-md);
}

.show-episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px 20px;
}

.show-episode-list {
  display: block;
  padding: 0;
  margin: 0;
  list-style: none;
}

.show-episode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--color-border);
}

.show-episode-row__link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: var(--home-tap);
  padding: 8px 0;
  color: var(--home-ink);
  text-decoration: none;
}

.show-episode-row__link:hover .show-episode-row__title {
  text-decoration: underline;
}

.show-episode-row__link img {
  flex: 0 0 64px;
  width: 64px;
  height: var(--home-tap);
  border-radius: var(--home-radius-small);
}

.show-episode-row__text {
  display: grid;
  min-width: 0;
  gap: 2px;
  overflow-wrap: anywhere;
}

.show-episode-row__title {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
}

.show-episode-row__meta {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.home .show-episode-row button.home-play {
  flex: none;
  width: var(--home-tap);
  height: var(--home-tap);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--home-mint);
  color: var(--home-ink);
  font-size: var(--text-xs);
}

.home .library-row button.home-play {
  flex: none;
  min-width: var(--home-tap);
  min-height: var(--home-tap);
}

.home .show-episode-row button.home-play:hover,
.home .show-episode-row button.home-play:active {
  background: var(--home-mint-dark);
}

/* One quiet play control per row, so a long list does not read as a column of green buttons. */
.home .show-episode-row button.home-play,
.home .show-episode-row button.home-play:hover,
.home .show-episode-row button.home-play:active {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.week-hero__art {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.week-hero__art img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-surface);
}

.home .week-chapters button,
.home .week-chapters button:hover,
.home .week-chapters button:active {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 4px;
  border: 0;
  background: none;
  color: var(--color-muted);
  font: var(--text-sm) var(--font-body);
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.home .week-chapters button:hover {
  color: var(--home-ink);
}

.week-chapters b {
  color: var(--home-ink);
  font-variant-numeric: tabular-nums;
}

.week-learn {
  margin: 0 0 32px;
}

/* Show identity row: small art and the show name, so the headline below gets the full column width. */
.week-show__id {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.week-show__id b {
  color: var(--home-ink);
}

.week-show__art {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.episode-compare-preview.week-compare {
  max-width: none;
  padding: 12px 16px;
  margin: 0 0 24px;
}

.week-show__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.week-show__actions a {
  color: var(--home-ink);
  font-weight: 600;
}

.home button.week-small {
  min-height: var(--home-tap);
  padding: 8px 18px;
  font-size: var(--text-sm);
}

.week-connection {
  margin-bottom: 24px;
}

.week-connection h3 {
  margin: 0 0 8px;
  font-size: var(--text-base);
}

/* One answer to a comparison's question, with the shows that give it */
.week-position {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--home-tile-2);
}

.week-position__claim {
  margin: 0 0 4px;
  font-weight: 700;
}

.week-position ul {
  margin: 0;
}

.week-unknown {
  color: var(--color-muted);
}

.week-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.week-pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  padding: 0 16px;
  white-space: nowrap;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-pill);
  color: var(--home-ink);
  font-weight: 600;
  text-decoration: none;
}

.week-pill[aria-current="page"] {
  background: var(--home-ink);
  color: var(--color-surface);
}

/* Phone sized tap targets: text style actions and fold rows get a 44 px tall hit area without looking bigger. */
.home button.home-link,
.home-actions a,
.episode-hero__read,
.episode-moment,
.episode-crumbs a,
.week-strip a,
.week-show__actions a {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
}

.labs-page summary {
  display: flex;
  align-items: center;
  min-height: var(--home-tap);
}

/* Slim header on labs pages: brand, search box and shows link; it sits above the page container. */
nav.labs-nav {
  padding: 6px 0;
}

nav.labs-nav .brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
  min-height: var(--home-tap);
  font-size: var(--text-lg);
}

.labs-nav__mark {
  width: 26px;
  height: 26px;
}

.labs-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.labs-nav__search {
  flex: 1 1 120px;
  min-width: 0;
  max-width: 320px;
  margin-left: auto;
}

.labs-nav__search input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: var(--home-tap);
  padding: 8px 14px;
  border-radius: var(--home-pill);
  font-size: var(--text-sm);
}

.labs-nav__links {
  display: flex;
  flex: none;
  gap: 18px;
}

.labs-nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  white-space: nowrap;
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

/* Narrow screens. Kept together at the end so they follow every base rule they adjust. */
@media (max-width: 900px) {
  /* Landing */
  .home-hero,
  .home-steps,
  .home-faq-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-faq-section {
    gap: 16px;
  }

  /* Episode and week pages */
  .episode-body {
    grid-template-columns: minmax(0, var(--episode-reading-width));
    gap: 24px;
    justify-content: start;
  }

  .episode-rail__menu {
    position: static;
  }

  /* Tablets stack the hero too: the art above the title at a size that leaves the title room. */
  .episode-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 32px;
  }

  .episode-layout .episode-hero {
    position: static;
    padding: 24px;
  }

  .episode-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    max-width: var(--episode-reading-width);
    padding: 32px;
  }

  /* One left edge on a stacked page: these blocks center on desktop, under the hero. */
  .episode-learn,
  .episode-compare-preview,
  .episode-reading,
  .week-strip {
    margin-inline: 0;
  }

  .episode-hero h1 {
    font-size: var(--text-xl);
  }

  .episode-hero__art,
  .series-mosaic {
    max-width: 280px;
  }
}

@media (max-width: 640px) {
  /* Landing */
  :root {
    --home-section-gap: 56px;
    --home-cover-width: 220px;
    --home-briefing-width: 290px;
    --home-step-art: 96px;
    --home-show-size: 60px;
    --home-player-height: 120px;
    --home-gallery-columns: 2;
    --home-cta-height-phone: 52px;
  }

  /* Briefing and weekly tiles swipe sideways like the episode shelf, so stacked cards never push episodes off the
     first screens */
  .home-weeks {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: var(--home-briefing-width);
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  /* How it works: each step a row, picture beside the words, so the three steps fit about one screen */
  .home-steps {
    gap: 24px;
  }

  .home-step {
    grid-template-columns: var(--home-step-art) minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 4px;
    justify-items: start;
    text-align: left;
  }

  .home-step .home-art--step {
    grid-row: 1 / span 3;
    width: var(--home-step-art);
  }

  .home-step__number {
    width: 32px;
    height: 32px;
    font-size: var(--text-base);
  }

  .home-step h3 {
    font-size: var(--text-base);
  }

  .home-step p {
    font-size: var(--text-sm);
    line-height: 1.5;
  }

  /* Blinkist's phone hero: centered promise, a full width button, then the product right under it. The preview keeps
     only the pick's cover, show and title, since the button above already plays it. */
  .home-hero {
    gap: 20px;
    margin-bottom: 20px;
  }

  .home-hero__pitch {
    gap: 16px;
    justify-items: center;
    text-align: center;
  }

  .home-streak {
    justify-self: center;
  }

  .home-actions {
    width: 100%;
  }

  .home .home-actions .home-cta {
    width: 100%;
    min-height: var(--home-cta-height-phone);
  }

  /* With the show covers above it, the pick is a compact row so episodes come sooner. */
  .home-hero:has(.home-show-strip) .home-screen {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 4px 12px;
    align-items: start;
  }

  .home-hero:has(.home-show-strip) .home-screen > * {
    grid-column: 2;
    margin: 0;
  }

  .home-hero:has(.home-show-strip) .home-screen__bar,
  .home-hero:has(.home-show-strip) .home-screen__teaser,
  .home-hero:has(.home-show-strip) .home-screen__listen {
    grid-column: 1 / -1;
  }

  .home-hero:has(.home-show-strip) .home-screen__listen {
    margin-top: 8px;
  }

  .home-hero:has(.home-show-strip) .home-screen__cover {
    grid-column: 1;
    grid-row: 2 / span 2;
  }

  .home-hero__pitch {
    min-width: 0;
  }

  .home-screen {
    padding: 12px;
    background: var(--home-sky);
  }

  .home-screen__idea-label,
  .home-screen__idea,
  .home-screen__cross,
  .home button.home-screen__play {
    display: none;
  }

  /* Touch screens swipe rows sideways without a visible scrollbar. */
  .home-shows,
  .home-flagships,
  .home-shelf,
  .home-goals {
    scrollbar-width: none;
  }

  .home-shows::-webkit-scrollbar,
  .home-flagships::-webkit-scrollbar,
  .home-shelf::-webkit-scrollbar,
  .home-goals::-webkit-scrollbar {
    display: none;
  }

  .home-section--tight {
    --home-cover-width: 132px;
    margin-bottom: 32px;
  }

  .home-section.home-section--tight h2 {
    font-size: var(--text-lg);
  }

  .home-hero h1 {
    font-size: var(--text-xl);
  }

  .home-hero__sub {
    font-size: var(--text-sm);
  }

  .home-faq summary {
    padding: 16px 0;
    font-size: var(--text-base);
  }

  .home-faq p {
    font-size: var(--text-sm);
  }

  .home-proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 20px;
    padding: 20px 0;
  }

  .home-proof__item:nth-child(3) {
    border-left: none;
  }

  .home-proof__item strong {
    font-size: var(--text-lg);
  }

  .home-section h2 {
    font-size: var(--text-xl);
  }

  /* One sideways row of topics, so the shelf it controls stays close. */
  .home-goals,
  .home-section--center .home-goals {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .home button.home-goal {
    flex: none;
  }

  .home button.home-shelf__nav {
    display: none;
  }

  /* Bottom player */
  .home-player {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .home-player:has(.home-player__open:not([hidden])) {
    grid-template-columns: 56px minmax(0, 1fr) auto auto;
  }

  /* The now playing panel takes the whole screen, one column, and the page under it stays put. */
  .now-playing {
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .now-playing__sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "cover" "intro" "next" "ideas" "read";
    padding: 16px;
  }

  :root:has(.now-playing[open]) {
    overflow: hidden;
  }

  .home-player__audio {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .home-player button.home-player__full {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  /* Episode and week pages */
  .episode-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
  }

  .episode-hero h1 {
    font-size: var(--text-lg);
  }

  /* Phones show only the topic as a back link, so the breadcrumb stays one line. */
  .episode-crumbs--back li:not(:nth-child(2)) {
    display: none;
  }

  .episode-crumbs--back li:nth-child(2)::before {
    content: "\2190";
  }

  .episode-hero__meta {
    gap: 4px 12px;
    font-size: var(--text-sm);
  }

  /* Phones put a small cover beside the eyebrow and show line, then the title full width below, so the cover does not
     sit alone in its own row and Listen stays on the first screen. */
  .episode-hero:has(.episode-hero__art) {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 4px 14px;
    align-items: center;
  }

  .episode-hero:has(.episode-hero__art) .episode-hero__text {
    display: contents;
  }

  .episode-hero:has(.episode-hero__art) .episode-hero__art {
    grid-row: 1 / span 2;
    width: 96px;
  }

  .episode-hero:has(.episode-hero__art) .episode-eyebrow,
  .episode-hero:has(.episode-hero__art) .episode-hero__show {
    grid-column: 2;
    margin: 0;
  }

  .episode-hero:has(.episode-hero__art) .episode-hero__text > :not(.episode-eyebrow, .episode-hero__show) {
    grid-column: 1 / -1;
  }

  .episode-hero:has(.episode-hero__art) .episode-format {
    justify-self: start;
  }

  .episode-hero:has(.episode-hero__art) h1 {
    grid-row: 3;
    margin-top: 12px;
  }

  .episode-hero__badge {
    width: 32px;
    height: 32px;
    right: 4px;
    bottom: 4px;
    border-width: 2px;
  }

  .episode-compare-preview {
    margin-top: -32px;
  }

  .episode-hero__actions .home-cta {
    flex: 1 1 100%;
  }

  .episode .episode-hero__actions {
    margin-top: 12px;
  }

  .episode .episode-hero__actions .home-cta {
    flex-basis: auto;
  }

  .episode-watch__link {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Week page */
  .week-hero__art {
    display: flex;
  }

  .show-hero {
    gap: 12px;
    margin-bottom: 16px;
  }

  .show-hero__art {
    width: 56px;
    height: 56px;
  }

  /* Phones keep the latest episode to one card: a small cover beside its title, then Listen. */
  .show-newest {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px;
    margin-bottom: 32px;
  }

  .show-newest__text {
    display: contents;
  }

  .show-newest__actions,
  .show-newest__things,
  .show-newest__intro,
  .show-newest__more {
    grid-column: 1 / -1;
  }

  .home .show-newest__actions button {
    flex: 1;
  }

  .show-newest__title {
    font-size: var(--text-base);
  }

  .show-hero h1 {
    font-size: var(--text-lg);
  }

  .week-hero__art img {
    width: 48px;
    margin-right: -12px;
  }

  /* Nav */
  .labs-nav .container {
    gap: 10px;
    padding-inline: 12px;
  }

  nav.labs-nav .brand {
    gap: 6px;
    font-size: var(--text-md);
  }

  .labs-nav__search {
    flex: 1 1 80px;
  }

  .labs-nav__links {
    gap: 14px;
  }

  .labs-nav__links a {
    font-size: var(--text-sm);
  }

  /* Phones keep the two main destinations; Formats stays linked from the landing page footer. */
  .labs-nav__links a.labs-nav__wide {
    display: none;
  }
}

/* Flagship review: one row per show, cover beside the show, title and both plays. */
.review-hero {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.review-list {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-row {
  display: grid;
  grid-template-columns: var(--review-cover-width) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  --review-cover-width: 200px;
}

.review-row__cover img {
  width: 100%;
  border-radius: var(--home-radius-small);
}

.review-row__meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.review-row__title {
  margin: 4px 0 10px;
  font-size: var(--text-base);
}

.review-row__title a {
  color: var(--home-ink);
  text-decoration: none;
}

.review-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 640px) {
  .review-row {
    --review-cover-width: 112px;
    align-items: start;
  }

  .home .review-row__actions .home-button {
    padding: 8px 14px;
    font-size: var(--text-sm);
  }
}

/* Voice finalists: each voice's takes stacked, the player full width so it fits a phone. */
.voices-passage {
  font-style: italic;
  color: var(--color-muted);
}

.voices-row {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.voices-take {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: var(--text-sm);
}

.voices-take audio {
  width: 100%;
}

/* 7 day series: the episode page layout, with a mosaic of the shows in the hero and each day as a tinted card. */
.series-mosaic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.series-mosaic img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--home-radius-small);
}

.episode-idea.series-day--compare {
  background: var(--home-sun);
}

.series-day--compare .episode-fact {
  background: var(--color-surface);
}

.series-day__head {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.series-day__head img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--home-radius-small);
}

.series-day__shows {
  margin: 0;
  font-weight: 600;
  color: var(--home-ink);
}

.series-day__actions {
  margin: 16px 0;
}

.series-sources {
  display: grid;
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Small covers beside each title, so 6 episodes stay a short list on a phone too. */
.series-sources .episode-watch__link {
  grid-template-columns: 120px minmax(0, 1fr);
}

.series-sources small {
  font-weight: 400;
  color: var(--color-muted);
}

@media (max-width: 640px) {
  .series-day__head {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .episode-idea {
    padding: 20px 16px;
  }

  .episode-script {
    padding: 0 16px;
  }
}

/* Key points idea: a lede, why it matters and labeled bullets, used by episode ideas and series cards. */
.key-points {
  display: grid;
  gap: 10px;
}

.key-points p {
  margin: 0;
}

.key-points ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

/* Each installment ends on the episodes it came from, so a reader can open the full summary. */
.series-deeper {
  margin-top: 20px;
}

.series-deeper h3 {
  margin-bottom: 12px;
  font-size: var(--text-sm);
}

.episode-watch__more {
  margin: 12px 0 0;
}

/* Type roles for the home, show and episode pages. Each level is clearly smaller than the one above it, so a page reads
   title, section, item, text. Phones use the same order at a tighter size. */
:root {
  --type-title: 38px;
  --type-section: 26px;
  --type-item: 20px;
  --type-body: 17px;
  --type-meta: 14px;
  --type-label: 12px;
}

@media (max-width: 640px) {
  :root {
    --type-title: 30px;
    --type-section: 22px;
    --type-item: 18px;
    --type-body: 16px;
    --type-meta: 14px;
  }
}

.episode-layout .episode-hero h1,
.show-hero h1 {
  font-size: var(--type-title);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.episode-layout .episode-hero h1 {
  font-size: calc(var(--type-title) - 6px);
}

.home-section h2,
.episode-said h2,
.episode-cross h2,
.show-earlier {
  font-size: var(--type-section);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.episode-said__idea h3,
.show-newest__title,
.home-screen__title {
  font-size: var(--type-item);
  font-weight: 700;
  line-height: 1.28;
}

.episode-said__idea > p:not([class]),
.episode-quote > p:not([class]),
.home-hero__sub,
.show-newest__intro,
.show-newest__things ul {
  font-size: var(--type-body);
  line-height: 1.6;
}

.home-card__title,
.show-episode-row__title {
  font-size: var(--type-body);
  font-weight: 700;
  line-height: 1.3;
}

.episode-hero__show,
.episode-hero__meta,
.home-card__guest,
.home-card__show,
.home-card__meta,
.home-screen__show,
.home-screen__teaser,
.show-hero__meta,
.show-episode-row__guest,
.show-episode-row__meta,
.episode-quote .episode-quote__source {
  font-size: var(--type-meta);
  line-height: 1.4;
}

.episode-eyebrow,
.home-screen__bar {
  font-size: var(--type-label);
  line-height: 1.3;
}

/* Contrast between voices: the serif carries titles, sections and quotes, the sans carries claims and reading text. */
.episode-layout .episode-hero h1,
.show-hero h1,
.home-section h2,
.episode-said h2,
.episode-cross h2,
.show-earlier {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.episode-hero__show,
.home-screen__bar {
  font-weight: 700;
}

.episode-eyebrow,
.home-screen__bar {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.episode-said h2 {
  margin-bottom: 16px;
}

/* The three things to know are numbered cards, each with its own tint. */
.episode-said--top .episode-said__idea {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 8px;
  padding: 24px;
  margin-bottom: 14px;
  border: 0;
  border-radius: var(--home-radius);
  background: var(--home-stake-health-bg);
}

.episode-said--top .episode-said__idea:nth-of-type(2) {
  background: var(--home-tile-1);
}

.episode-said--top .episode-said__idea:nth-of-type(3) {
  background: var(--home-sky);
}

.episode-said--top .episode-said__idea > :not(.episode-said__number) {
  grid-column: 2;
}

.episode-said__number {
  grid-row: 1 / span 2;
  color: var(--home-ink);
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-style: italic;
  line-height: 1;
}

/* The other ideas are quieter: smaller, unnumbered and side by side where there is room. */
.episode-said--more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
}

.episode-said--more h2 {
  grid-column: 1 / -1;
}

.episode-said--more .episode-said__number {
  display: none;
}

.episode-said--more .episode-said__idea h3 {
  font-size: var(--type-body);
}

.episode-said--more .episode-said__idea > p:not([class]),
.episode-said--more .episode-fold p:not([class]) {
  font-size: var(--type-meta);
  line-height: 1.55;
}

/* Text that waits until asked for: the rest of an idea card and the extra quotes. */
.episode-fold {
  margin-top: 8px;
}

.episode-fold summary {
  color: var(--home-ink);
  font-size: var(--type-meta);
  font-weight: 700;
  cursor: pointer;
}

.episode-fold p:not([class]) {
  margin-top: 8px;
  font-size: var(--type-body);
  line-height: 1.55;
}

/* One line on what the episode covers, in the episode card under Listen, so the three things to know lead the reading. */
.episode-intro {
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.episode-intro h2 {
  margin-bottom: 6px;
}

.episode-intro p {
  color: var(--home-ink);
  font-size: var(--type-meta);
  line-height: 1.55;
}

.episode-quotes .episode-quote > p:not([class]) {
  font-size: var(--type-body);
  line-height: 1.55;
}

.episode-quotes .episode-quote {
  border-left-color: var(--home-ink);
}

@media (max-width: 640px) {
  .episode-said--top .episode-said__idea {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 18px 16px;
  }

  .episode-said__number {
    font-size: var(--text-xl);
  }

  .episode-said--more {
    grid-template-columns: minmax(0, 1fr);
  }
}

.episode-layout .episode-hero__text {
  display: grid;
  gap: 10px;
}

.episode-layout .episode-hero__text > * {
  margin: 0;
}

.episode-layout .episode-hero h1 {
  margin-top: 2px;
}

.episode-layout .episode-format {
  justify-self: start;
}

.episode-layout .episode-hero__actions {
  margin-top: 8px;
}

/* The read along sits on the page itself: a white panel on the cream background was harsh to read against. */
.episode-layout .episode-script {
  border: 1px solid var(--color-border);
  background: transparent;
  box-shadow: none;
}

/* The full episode plays on the page; quote and moment links start it at the right place. */
.episode-embed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--home-radius-small);
}

.episode-watch h2 {
  margin-bottom: 14px;
  font-family: var(--font-heading);
  font-size: var(--type-section);
  font-weight: 500;
  line-height: 1.2;
}

.episode-watch h2 span {
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--type-meta);
  font-weight: 500;
}

/* The small labels above the overview and the numbered cards. */
.episode-intro h2,
.episode-said--top h2 {
  font-family: var(--font-body);
  font-size: var(--type-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The full stored summary sits closed above the episode embed, styled like the read along fold. */
.episode-summary {
  margin: 0 0 32px;
}

.episode-summary__body {
  padding: 8px 0 24px;
  font-size: var(--type-body);
  line-height: 1.6;
}

.episode-summary__body h2 {
  margin: 24px 0 10px;
  font-size: var(--type-item);
  font-weight: 700;
  line-height: 1.3;
}

.episode-summary__body h2:first-child {
  margin-top: 8px;
}

.episode-summary__body h3 {
  margin: 18px 0 8px;
  font-size: var(--type-body);
  font-weight: 700;
}

.episode-summary__body p,
.episode-summary__body ul,
.episode-summary__body ol {
  margin: 0 0 14px;
}

.episode-summary__body ul,
.episode-summary__body ol {
  padding-left: 20px;
}

.episode-summary__body li {
  margin-bottom: 8px;
}

.episode-summary__body > :last-child {
  margin-bottom: 0;
}

/* All-shows directory, show YouTube link, pagination and labs search. */
.shows-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--home-radius-small);
  background: var(--home-sky);
  color: var(--home-ink);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
}

.show-hero__info {
  min-width: 0;
}

.show-hero__youtube {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  color: var(--home-ink);
  font-size: var(--type-meta);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.show-episode-row__show {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted);
}

.labs-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: none;
}

.labs-pagination__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  padding: 0 18px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--home-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.labs-pagination__link:hover {
  background: var(--home-sky);
}

.labs-pagination__status {
  color: var(--color-muted);
  font-size: var(--type-meta);
}

/* "Search for … instead" under a corrected search. */
.search-instead {
  color: var(--home-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Search summaries on desktop scroll inside a capped list, so Shows and YouTube episodes stay close below. */
@media (min-width: 900px) {
  .search-summaries {
    max-height: 640px;
    padding-right: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* The Get summary button beside a YouTube episode in search. */
.search-summarize {
  flex: none;
  margin: 0;
}

.labs-search__status {
  color: var(--color-muted);
  font-size: var(--type-body);
}

/* ============================================================================
   Listener accounts: nav tightening on phones, follow button, sign in,
   paste a link, library and loading state.
   ============================================================================ */

.labs-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Follow button on show pages, episode pages and the library. */
.home .home-follow,
.home button.home-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--home-tap);
  padding: 0 18px;
  border: 1px solid var(--home-ink);
  border-radius: var(--home-pill);
  background: var(--color-surface);
  color: var(--home-ink);
  font: 600 var(--text-sm) var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.home .home-follow:hover,
.home button.home-follow:hover {
  background: var(--home-sky);
}

.home button.home-follow[aria-pressed="true"] {
  background: var(--home-ink);
  border-color: var(--home-ink);
  color: var(--color-surface);
}

.show-hero__info {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
}

.episode-hero__show-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.episode-hero__show-row .episode-hero__show {
  margin: 0;
}

.episode-hero__show-row .episode-hero__show a {
  color: inherit;
  text-decoration: none;
}

.episode-hero__show-row .episode-hero__show a:hover {
  text-decoration: underline;
}

/* Sign in page (/auth/login) */
.auth-page {
  display: flex;
  justify-content: center;
  padding: 24px 0 48px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 20px;
}

.auth-card__head {
  display: grid;
  gap: 6px;
}

.auth-card__head h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 500;
  line-height: 1.15;
  color: var(--home-ink);
}

.auth-card__head p {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  background: var(--home-sky);
  border-radius: var(--home-radius-small);
}

.home button.auth-tab {
  min-height: var(--home-tap);
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--home-ink);
  font: 600 var(--text-sm) var(--font-body);
  cursor: pointer;
}

.home button.auth-tab[aria-selected="true"] {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--home-ink);
}

.auth-field input,
.labs-find__input {
  width: 100%;
  min-height: var(--home-cta-height);
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--color-text);
  font: 400 var(--text-base) var(--font-body);
}

.auth-field input:focus,
.labs-find__input:focus {
  outline: 2px solid var(--home-ink);
  outline-offset: 1px;
}

.home button.auth-text-action {
  justify-self: end;
  min-height: var(--home-tap);
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--home-ink);
  font: 600 var(--text-xs) var(--font-body);
  text-decoration: underline;
  cursor: pointer;
}

.home .auth-submit {
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.home button.auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: var(--home-cta-height);
  padding: 10px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--home-ink);
  font: 600 var(--text-base) var(--font-body);
  cursor: pointer;
}

.home button.auth-google:hover {
  background: var(--home-sky);
}

.auth-back {
  text-align: center;
  font-size: var(--text-sm);
}

.auth-back a {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  color: var(--color-muted);
  text-decoration: none;
}

.auth-back a:hover {
  color: var(--home-ink);
  text-decoration: underline;
}

.auth-message {
  padding: 12px 14px;
  border-radius: var(--home-radius-small);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.auth-message--error {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.auth-message--success {
  background: var(--home-stake-health-bg);
  color: var(--home-stake-health);
}

/* Native modal dialog shared by password reset and delete account */
dialog.labs-dialog {
  width: min(100% - 32px, 440px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--home-radius);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}

dialog.labs-dialog::backdrop {
  background: var(--now-playing-backdrop);
}

.labs-dialog__sheet {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.labs-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.labs-dialog__head h2 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--home-ink);
}

.home button.labs-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--home-tap);
  min-height: var(--home-tap);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--home-ink);
  font-size: var(--text-lg);
  cursor: pointer;
}

.home button.labs-dialog__close:hover {
  background: var(--home-sky);
}

.labs-dialog__copy {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.labs-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

/* The search box for shows and episodes on home and the library */
.labs-find {
  display: grid;
  gap: 10px;
  padding: 24px;
  margin-bottom: 40px;
  border-radius: var(--home-radius);
  background: var(--home-sky);
}

.labs-find h2 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--home-ink);
}

.labs-find__lead {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.labs-find__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.labs-find__input {
  flex: 1 1 240px;
  min-width: 0;
}

.home .labs-find__submit {
  flex: 0 0 auto;
}

/* Library page (/labs/library) */
.library-head {
  display: grid;
  gap: 6px;
  padding: 32px;
  margin-bottom: 32px;
  border-radius: var(--home-radius);
  background: var(--home-sun);
}

/* The library's counts as tinted pills: subscriptions in mint, favorites in the heart's pink. */
.library-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.library-stat {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--home-pill);
  color: var(--home-ink);
  font-size: var(--text-sm);
  font-weight: 700;
}

.library-stat--subscriptions {
  background: var(--home-tile-3);
}

.library-stat--favorites {
  background: var(--home-tile-5);
}

@media (max-width: 640px) {
  .library-head {
    padding: 24px 20px;
  }
}

.library-head h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--home-ink);
}

.library-head__sub {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.library-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.library-row {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.library-section--summaries .library-row {
  border-left: 4px solid var(--home-mint);
}

.library-section--favorites .library-row {
  border-left: 4px solid var(--home-heart);
}

.library-row__main {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.library-row__link {
  display: flex;
  gap: 14px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.library-row__thumb {
  width: 96px;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
}

.library-row__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.library-row__title {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.3;
  color: var(--home-ink);
}

.library-row__link:hover .library-row__title {
  text-decoration: underline;
}

.library-row__meta {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.library-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.home button.library-action {
  min-height: var(--home-tap);
  padding: 0 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-pill);
  background: var(--color-surface);
  color: var(--home-ink);
  font: 600 var(--text-xs) var(--font-body);
  cursor: pointer;
}

.home button.library-action:hover {
  background: var(--home-sky);
}

.library-action__status {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.library-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--home-pill);
  background: var(--home-sun);
  color: var(--home-ink);
  font-size: var(--text-xs);
  font-weight: 600;
}

.library-badge--error {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.library-shows {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* On tablets and desktops the library's episodes and subscriptions sit in a grid of cards, actions at the bottom. */
@media (min-width: 768px) {
  .library-list,
  .library-shows {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .library-row {
    align-content: space-between;
  }
}

/* The library's lists set a display, which beats the browser's own [hidden] rule. */
.library-shows[hidden],
.library-show[hidden],
.library-row[hidden],
.library-empty[hidden] {
  display: none;
}

/* Search shows sit two to a row once there is room, so the episodes still reach the first screen. */
@media (min-width: 900px) {
  .library-shows--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.library-show {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.library-shows .library-show:nth-child(6n + 1) { background: var(--home-tile-0); }
.library-shows .library-show:nth-child(6n + 2) { background: var(--home-tile-1); }
.library-shows .library-show:nth-child(6n + 3) { background: var(--home-tile-2); }
.library-shows .library-show:nth-child(6n + 4) { background: var(--home-tile-3); }
.library-shows .library-show:nth-child(6n + 5) { background: var(--home-tile-4); }
.library-shows .library-show:nth-child(6n) { background: var(--home-tile-5); }

.library-shows .library-show {
  border-color: transparent;
}

.library-show__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 180px;
}

.library-show__art,
.library-show__fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.library-show__art {
  object-fit: cover;
}

.library-show__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--home-sky);
  color: var(--home-ink);
  font-weight: 700;
}

.library-show__name {
  font-weight: 600;
  color: var(--home-ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.library-show__name {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
}

a.library-show__name:hover {
  text-decoration: underline;
}

.home button.library-show-all {
  margin-top: 12px;
}

.library-show__text {
  display: grid;
  min-width: 0;
}

.library-show__note {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* The episodes heading with its two sort links, side by side when they fit. */
.library-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.library-sort {
  display: flex;
  gap: 4px;
}

.library-sort__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  padding: 0 12px;
  border-radius: 999px;
  color: var(--home-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.library-sort__link[aria-current="true"] {
  background: var(--home-mint);
}

.library-empty {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 24px;
  background: var(--home-sun);
  border: 1px solid transparent;
  border-radius: var(--home-radius-small);
}

.library-account {
  padding: 24px;
  border-radius: var(--home-radius);
  background: var(--home-tile-4);
}

.library-account__email {
  margin-bottom: 16px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.library-account__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.home a.library-signout,
.home button.library-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--home-tap);
  padding: 0 20px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--home-ink);
  font: 600 var(--text-sm) var(--font-body);
  text-decoration: none;
  cursor: pointer;
}

.home a.library-signout:hover,
.home button.library-signout:hover {
  background: var(--home-sky);
}

.home button.library-danger {
  min-height: var(--home-tap);
  padding: 0 20px;
  border: 1px solid var(--color-danger);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--color-danger);
  font: 600 var(--text-sm) var(--font-body);
  cursor: pointer;
}

.home button.library-danger:hover {
  background: var(--color-danger-soft);
}

.home button.library-danger--solid {
  background: var(--color-danger);
  color: var(--color-surface);
}

.home button.library-danger--solid:hover {
  background: var(--color-danger);
  opacity: 0.9;
}

/* Loading page (/labs/submit) */
.labs-loading {
  display: flex;
  justify-content: center;
  padding: 32px 0 64px;
}

.labs-loading__panel {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  width: 100%;
  max-width: 520px;
}

.labs-loading__spinner {
  width: 52px;
  height: 52px;
  border: 5px solid var(--home-sky);
  border-top-color: var(--home-ink);
  border-radius: 50%;
  animation: labs-spin 0.8s linear infinite;
}

@keyframes labs-spin {
  to {
    transform: rotate(360deg);
  }
}

.labs-loading__lead {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.labs-loading__card {
  width: 100%;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
  display: grid;
  gap: 6px;
}

.labs-loading__title {
  font-weight: 700;
  color: var(--home-ink);
}

.labs-loading__channel {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.labs-loading__status {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--home-ink);
}

.labs-loading__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.labs-loading__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--home-ink);
}

@media (max-width: 640px) {
  /* Phones put the search box on its own full width row, so the brand and account links never squeeze it. */
  .labs-nav .container {
    flex-wrap: wrap;
    gap: 8px;
  }

  .labs-nav__search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }

  .labs-nav__links {
    gap: 12px;
    font-size: var(--text-sm);
  }

  .auth-card {
    padding: 24px 18px;
  }

  .labs-find {
    padding: 18px 16px;
  }

  .home .labs-find__submit {
    width: 100%;
  }

  .library-row__thumb {
    width: 80px;
  }
}

/* Error and 404 pages */
.labs-error {
  display: flex;
  justify-content: center;
  padding: 48px 0 80px;
}

.labs-error__panel {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  width: 100%;
  max-width: 520px;
}

.labs-error__code {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-muted);
}

.labs-error__title--danger {
  color: var(--color-danger);
}

.labs-error__message {
  color: var(--color-muted);
  font-size: var(--text-base);
}

.labs-error__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* Legal pages (/terms, /privacy) */
.legal-document {
  max-width: 760px;
  padding: 24px 0 64px;
}

.legal-document h1 {
  font-family: var(--font-heading);
  margin-bottom: 8px;
}

.legal-document .last-updated {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-bottom: 32px;
}

.legal-document section {
  margin-bottom: 28px;
}

.legal-document h2 {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 10px;
}

.legal-document p {
  margin-bottom: 12px;
}

.legal-document ul {
  margin: 12px 0;
  padding-left: 24px;
}

.legal-document li {
  margin-bottom: 8px;
}

.legal-document a {
  color: var(--color-brand);
  text-decoration: underline;
}

/* Admin page (/admin) */
.admin {
  display: grid;
  gap: 32px;
  padding-bottom: 64px;
}

.admin-head {
  display: grid;
  gap: 6px;
}

.admin-head__sub,
.admin-note {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.admin-section {
  display: grid;
  gap: 16px;
}

.admin-forms {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.admin-card h3 {
  font-size: var(--text-md);
  color: var(--home-ink);
}

.admin-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-card__buttons .home-cta,
.admin-card__buttons .home-button {
  width: auto;
  flex: 1 1 auto;
  min-height: var(--home-tap);
}

.admin-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.admin-stat {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.admin-stat__label {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.admin-stat__value {
  font-size: var(--text-2xl);
  color: var(--home-ink);
  line-height: 1.1;
}

.admin-audit {
  display: grid;
  gap: 12px;
}

.admin-audit__group {
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.admin-audit__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--home-tap);
  cursor: pointer;
  font-weight: 600;
  color: var(--home-ink);
  list-style: none;
  max-width: none;
}

.admin-audit__summary::-webkit-details-marker {
  display: none;
}

.admin-audit__count {
  padding: 2px 10px;
  border-radius: var(--home-pill);
  background: var(--home-sky);
  color: var(--home-ink);
  font-size: var(--text-sm);
}

.admin-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-list__row {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.admin-list__row--action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-list__info {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 220px;
}

.admin-list__link,
.admin-list__title {
  font-weight: 600;
  color: var(--home-ink);
  overflow-wrap: anywhere;
}

.admin-list__link:hover {
  text-decoration: underline;
}

.admin-list__meta {
  font-size: var(--text-xs);
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.admin-table th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table__email {
  overflow-wrap: anywhere;
  font-weight: 500;
  color: var(--home-ink);
}

/* Home onboarding entry point and "Your shows" section header link */
.home-section__link,
.home-pick-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-tap);
  color: var(--home-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-pick-link {
  justify-self: start;
  padding: 0 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--home-pill);
  background: var(--color-surface);
  text-decoration: none;
}

/* A heading link that becomes a full pill button where there is room beside the heading. */
@media (min-width: 641px) {
  .home-section__link--button {
    padding: 0 20px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--home-pill);
    background: var(--color-surface);
    text-decoration: none;
  }

  .home-section__link--button:hover,
  .home-section__link--button:active {
    background: var(--home-sky);
    border-color: var(--home-ink);
  }
}

.home-pick-link:hover,
.home-pick-link:active {
  background: var(--home-sky);
  border-color: var(--home-ink);
}

/* Two-tap onboarding (/start) */
.start-page {
  display: grid;
  gap: 32px;
  padding-bottom: 112px;
}

.start-head {
  display: grid;
  gap: 8px;
}

.start-head h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--home-ink);
}

.start-lead {
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-muted);
}

.start-step {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.start-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.start-step__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--home-ink);
}

.start-step__num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--home-mint);
  color: var(--home-ink);
  font-size: var(--text-sm);
  font-weight: 800;
}

.start-step__count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--home-ink);
}

.start-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.home button.start-topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--home-tap);
  max-width: 100%;
  padding: 8px 14px;
  text-align: left;
  white-space: normal;
}

.home button.start-topic--lead {
  border-color: var(--color-border-strong);
  font-weight: 600;
}

.home button.start-topic[aria-pressed="true"] {
  background: var(--home-ink);
  border-color: var(--home-ink);
  color: var(--color-surface);
  font-weight: 700;
}

.start-empty {
  padding: 20px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.start-empty[hidden],
.start-shows[hidden],
.start-bar__cta[hidden] {
  display: none;
}

.start-shows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  min-width: 0;
}

.start-show-item {
  min-width: 0;
}

.home button.start-show {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--home-radius-small);
  background: var(--color-surface);
  color: var(--home-ink);
  font: inherit;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.home button.start-show:hover {
  background: var(--home-sky);
  border-color: var(--color-border-strong);
}

.home button.start-show[aria-pressed="true"] {
  background: var(--home-sky);
  border-color: var(--home-ink);
  box-shadow: inset 0 0 0 1px var(--home-ink);
}

.home button.start-show--following {
  opacity: 0.85;
  cursor: default;
}

.start-show__art,
.start-show__fallback {
  width: 52px;
  height: 52px;
  border-radius: var(--home-radius-small);
}

.start-show__art {
  object-fit: cover;
}

.start-show__fallback {
  display: grid;
  place-items: center;
  background: var(--home-sun);
  color: var(--home-ink);
  font-size: var(--text-md);
  font-weight: 800;
}

.start-show__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.start-show__name {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  color: var(--home-ink);
  overflow-wrap: break-word;
}

.start-show__meta {
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--color-muted);
}

.start-show__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--home-ink);
  border-radius: var(--home-pill);
  background: var(--color-surface);
  color: var(--home-ink);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.home button.start-show[aria-pressed="true"] .start-show__badge {
  background: var(--home-ink);
  border-color: var(--home-ink);
  color: var(--color-surface);
}

.start-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-sticky);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.start-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  max-width: var(--home-width);
  margin: 0 auto;
  padding: 12px 20px;
}

.start-bar__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.start-bar__summary {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--home-ink);
}

.start-bar__error {
  margin: 0;
}

.start-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

@media (max-width: 640px) {
  .home-pick-link {
    justify-self: center;
  }

  .start-page {
    gap: 24px;
    padding-bottom: 148px;
  }

  .start-head h1 {
    font-size: var(--text-xl);
  }

  .start-lead {
    font-size: var(--text-sm);
  }

  .start-shows {
    grid-template-columns: minmax(0, 1fr);
  }

  .start-bar__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }

  .start-bar__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home .start-bar__cta {
    justify-content: center;
    width: 100%;
  }
}
