/* The Little Stream. All colour, type and corner choices live in the tokens below;
   a theme is just a different set of tokens (see site/design/themes/). */
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/newsreader.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400 600; font-display: swap; src: url("fonts/newsreader-italic.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/public-sans.woff2") format("woff2"); }

:root {
  /* surface */
  --bg: #f0f2ee;
  --surface: #fafbf8;
  --ink: #171c19;
  --muted: #59645d;
  --line: #d3d9d2;
  --hover: #e5eae3;
  --accent: #1d5c43;          /* links, selected filter, focus */
  --gold: #b98f33;            /* contrast colour: rules and borders for emphasis only, never text */
  --error: #9b1c1c;
  /* header + hero (flat, same family as the page) */
  --head-bg: var(--bg);
  --head-ink: var(--ink);
  --head-rule: var(--line);
  --hero-bg: var(--bg);
  --hero-ink: var(--ink);
  --hero-muted: var(--muted);
  --hero-line: var(--line);
  /* buttons */
  --btn-bg: var(--ink);
  --btn-ink: var(--bg);
  --btn-hover: var(--accent);
  /* shape + type */
  --r: 3px;
  --portrait-r: 3px;
  --portrait-bg: #cfd8cf;
  --portrait-ink: #59645d;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: var(--sans);
  --h-weight: 500;
  --h-track: -0.015em;
  /* fixed brand colours: the logo and the player keep these in every theme */
  --player-h: 7.5rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --surface: #151d19;
    --ink: #e9eee6;
    --muted: #9aa89e;
    --line: #25332b;
    --hover: #1a251f;
    --accent: #8fcf9f;
    --gold: #c39a3d;
    --error: #f19c9c;
    --btn-bg: var(--accent);
    --btn-ink: #0f1512;
    --portrait-bg: #25332b;
    --portrait-ink: #9aa89e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom));
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: var(--h-weight); letter-spacing: var(--h-track); line-height: 1.2; }
.muted { color: var(--muted); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.container { max-width: 64rem; margin: 0 auto; padding: 0 16px; }
.view[hidden] { display: none; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* -- top bar ------------------------------------------------------------ */
.topbar { position: relative; z-index: 25; background: var(--head-bg); color: var(--head-ink); border-bottom: 1px solid var(--head-rule); box-shadow: 0 2px 0 var(--gold); }
.topbar-inner {
  max-width: 64rem; margin: 0 auto; padding: 0.6rem 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.brand-mark { width: 46px; height: 46px; color: currentColor; flex: none; }
.brand-text { font-family: var(--serif); font-size: 1.6rem; font-weight: var(--h-weight); white-space: nowrap; letter-spacing: var(--h-track); }
.brand-text em { font-style: italic; font-weight: 400; }
.topnav { display: flex; gap: 1.4rem; font-size: 0.95rem; margin-left: auto; }
.topnav a { text-decoration: none; color: var(--muted); padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--head-ink); }
.topnav a[aria-current="page"] { color: var(--head-ink); border-bottom-color: var(--accent); }
@media (max-width: 700px) {   /* 700px, not 520: with the Topics link the full bar needs ~700px */
  .brand-text { font-size: 1.15rem; }
  .brand-mark { width: 38px; height: 38px; }
  .topnav a[data-nav="home"] { display: none; }
}

/* -- account --------------------------------------------------------------- */
.account-btn {
  font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; flex: none; max-width: 10rem;
  color: inherit; background: transparent; border: 1px solid var(--line); border-radius: var(--r);
  padding: 0.35rem 0.9rem; min-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { border-color: var(--accent); }
.account-btn[hidden] { display: none; }
.account-icon { width: 20px; height: 20px; display: none; }
@media (max-width: 520px) { .account-icon { display: block; } }
.account-btn.signed-in { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.account-panel {
  position: absolute; top: calc(100% + 6px); right: max(16px, calc(50% - 32rem + 16px)); width: min(22rem, calc(100% - 32px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.18); padding: 1rem 1.1rem;
}
.account-panel[hidden] { display: none; }
.account-panel h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.account-panel p { margin: 0 0 0.75rem; font-size: 0.92rem; }
.account-panel .fine { font-size: 0.75rem; color: var(--muted); margin: 0.75rem 0 0; }
/* Google's button is an iframe with a light color scheme; matching it here keeps Chrome
   from painting an opaque white box behind it when the page is dark. */
.gsi-button { min-height: 44px; display: flex; justify-content: center; color-scheme: light; margin: 0.25rem 0 0.5rem; }
.gsi-button iframe { color-scheme: light; }
/* Until Google's iframe is in, its placeholder is unstyled (a huge "G"): keep the space, hide the content. */
.gsi-button:not(.gsi-ready) > * { visibility: hidden; max-height: 44px; overflow: hidden; }
.account-error { color: var(--error); }
.account-error[hidden] { display: none; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
@media (max-width: 520px) {
  /* Icon only on phones: the bar has no room for a label. */
  .account-btn { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }
  .account-btn #account-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .account-panel { left: 16px; right: 16px; width: auto; }
  .topnav { gap: 1rem; }
}

/* -- buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font: inherit; font-weight: 600;
  min-height: 46px; padding: 0.6rem 1.3rem; border-radius: var(--r); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-solid, .btn-gold { background: var(--btn-bg); color: var(--btn-ink); }
.btn-solid:hover, .btn-gold:hover { background: var(--btn-hover); }
.btn[hidden] { display: none; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); margin: 0 auto 2rem; display: flex; }
.btn-outline:hover { border-color: var(--ink); }
.btn-outline[hidden] { display: none; }
.link-btn { font: inherit; font-size: 0.88rem; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; min-height: 42px; justify-self: start; }

/* -- hero / search ------------------------------------------------------- */
.hero { background: var(--hero-bg); color: var(--hero-ink); border-bottom: 1px solid var(--hero-line); }
.hero-inner {
  max-width: 64rem; margin: 0 auto; padding: 3rem 16px 3.4rem; display: grid; gap: 3rem 4rem; align-items: center;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); min-height: calc(100svh - 70px - var(--player-h));
}
.hero-main { min-width: 0; }
/* The two halves of the headline sit on separate lines, the second stepped in. */
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.2rem); margin: 0 0 1.3rem; line-height: 1.06; }
.hero h1 span { display: block; }
.hero h1 .h1-b { padding-left: 1.1em; }
.hero-sub { margin: 0 0 1.9rem; max-width: 30rem; color: var(--hero-muted); font-size: 1.15rem; line-height: 1.5; }
.hero-browse { display: flex; align-items: center; gap: 0.9rem; margin: 1rem 0 0; color: var(--hero-muted); }
.hero-browse .btn { min-height: 44px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 2rem; }
  .hero h1 .h1-b { padding-left: 0.8em; }
}
.eyebrow { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--muted); }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.search { position: relative; min-width: 0; max-width: 34rem; }
.search-icon { position: absolute; left: 0.9rem; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 56px; font: inherit; font-size: 1.08rem; color: var(--ink);
  padding: 0.7rem 1rem 0.7rem 2.8rem; border: 1px solid var(--muted); border-radius: var(--r); background: var(--surface);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.search input::placeholder { color: var(--muted); }
.search-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 0.4rem);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.16); overflow: hidden; max-height: 26rem; overflow-y: auto;
}
.sr-group { padding: 0.6rem 1rem 0.25rem; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.sr-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 1rem; text-decoration: none; }
.sr-item:hover, .sr-item.active { background: var(--hover); }
.sr-item small { display: block; color: var(--muted); }
.sr-empty { padding: 0.9rem 1rem; color: var(--muted); }
.sr-all { display: block; padding: 0.7rem 1rem; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.sr-all:hover { background: var(--hover); }

/* -- today's highlights: a large portrait with the talk's details laid over it ---- */
.highlights { justify-self: end; width: 100%; max-width: 27rem; }
.highlights[hidden] { display: none; }
.hl-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 1.1rem; }
.hl-head h2 { margin: 0; font-size: 0.95rem; font-family: var(--sans); font-weight: 600; color: var(--hero-muted); letter-spacing: 0; }
.hl-dots { display: flex; gap: 0.1rem; }
.hl-dot { width: 26px; height: 26px; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.hl-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--hero-muted); transition: background 0.2s; }
.hl-dot[aria-current="true"]::before { background: var(--gold); border-color: var(--gold); }
.hl-frame { background: var(--ink); color: #fff; outline: 2px solid var(--gold); outline-offset: 7px; border-radius: var(--r); overflow: hidden; }
.hl-cards { display: grid; }
.hl-card { grid-area: 1 / 1; position: relative; aspect-ratio: 4 / 5; transition: opacity 0.5s; }
.hl-card[hidden] { display: block; visibility: hidden; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .hl-card { transition: none; } }
.hl-photo { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 5rem; color: var(--portrait-ink); background: var(--portrait-bg); }
.hl-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
.hl-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 4.5rem 1.2rem 1.2rem; color: #fff;
  background: linear-gradient(to top, rgb(8 12 10 / 0.93) 0%, rgb(8 12 10 / 0.78) 55%, transparent 100%); }
.hl-body p { margin: 0; }
.hl-speaker { font-weight: 600; font-size: 0.95rem; }
.hl-role { font-size: 0.82rem; color: rgb(255 255 255 / 0.78); }
.hl-title { margin: 0.55rem 0 0.2rem; font-family: var(--serif); font-size: 1.65rem; font-weight: var(--h-weight); line-height: 1.15; overflow-wrap: anywhere; }
.hl-meta { font-size: 0.85rem; color: rgb(255 255 255 / 0.78); }
.hl-actions { display: flex; align-items: center; gap: 0.5rem 1.1rem; flex-wrap: wrap; margin-top: 0.9rem; }
.hl-actions .btn { min-height: 42px; padding: 0.4rem 1.1rem; background: #fff; color: #171c19; }
.hl-actions .btn:hover { background: var(--gold); }
.hl-link { font-size: 0.9rem; color: #fff; text-underline-offset: 3px; }
.hl-link:hover { color: var(--gold); }
@media (max-width: 820px) { .highlights { justify-self: stretch; max-width: none; } .hl-frame { outline-offset: 5px; margin: 0 6px; } .hl-card { aspect-ratio: 1 / 1.05; } }

/* -- blocks / filters ------------------------------------------------------- */
.block { margin: 2.4rem 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.block-head h2 { margin: 0; font-size: 1.5rem; }
.block-head p { margin: 0; }
/* Filters are plain text with an underline for the current choice, not a row of pills. */
.chips { display: flex; flex-wrap: wrap; gap: 0.1rem 1.25rem; }
.chip {
  font: inherit; font-size: 0.95rem; cursor: pointer; min-height: 36px; padding: 0.3rem 0;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted);
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.chip .count { color: var(--muted); margin-left: 0.35rem; font-size: 0.82rem; font-weight: 400; font-family: var(--mono); }
.chip:disabled { opacity: 0.35; cursor: default; }
.chips[hidden] { display: none; }

/* -- portraits (square-ish, no ring) ------------------------------------------ */
.portrait {
  flex: none; border-radius: var(--portrait-r); overflow: hidden; background: var(--portrait-bg); color: var(--portrait-ink);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
.portrait-sm { width: 44px; height: 44px; font-size: 1rem; }
.portrait-md { width: 48px; height: 48px; font-size: 1.1rem; }
.portrait-lg { width: 112px; height: 112px; font-size: 2.2rem; }
.portrait-xl { width: 152px; height: 152px; font-size: 3rem; outline: 2px solid var(--gold); outline-offset: 4px; }
.sr-item .portrait { width: 36px; height: 36px; font-size: 0.9rem; }

/* -- authorities list: uniform rows, hairlines, no cards ------------------------ */
.page-head { padding: 2.6rem 0 0.4rem; }
.page-head h1 { margin: 0 0 0.3rem; font-size: clamp(1.9rem, 4vw, 2.5rem); }
.page-head p { margin: 0; }
.all-tools { display: grid; gap: 0.1rem; margin: 1.4rem 0 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.filter-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: baseline; gap: 0 1rem; }
.filter-row[hidden] { display: none; }
.filter-label { font-size: 0.85rem; color: var(--muted); }
.all-count { margin: 0.4rem 0 0; font-size: 0.88rem; font-family: var(--mono); }
@media (max-width: 600px) { .filter-row { grid-template-columns: minmax(0, 1fr); } .filter-label { margin-top: 0.4rem; } }
.leader-list { list-style: none; margin: 0 0 3rem; padding: 0; border-top: 1px solid var(--ink); }
.leader-row {
  display: grid; align-items: center; gap: 0 1.1rem; min-height: 4.4rem; padding: 0.55rem 0.5rem;
  grid-template-columns: 48px minmax(0, 1.2fr) minmax(0, 1.6fr) 7.5rem 7rem;
  border-bottom: 1px solid var(--line); text-decoration: none;
}
.leader-row:hover { background: var(--hover); }
.lr-name { font-family: var(--serif); font-size: 1.12rem; font-weight: var(--h-weight); letter-spacing: var(--h-track); }
.leader-row:hover .lr-name { color: var(--accent); }
.lr-role { font-size: 0.88rem; color: var(--muted); }
.lr-years { font-size: 0.85rem; color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lr-talks { font-size: 0.85rem; color: var(--muted); font-family: var(--mono); text-align: right; white-space: nowrap; }
.lr-talks small { display: block; color: var(--accent); font-family: var(--sans); font-size: 0.75rem; white-space: normal; }
.lr-letter { position: relative; padding: 1.4rem 0.5rem 0.3rem; font-family: var(--serif); font-size: 1.5rem; font-weight: var(--h-weight); color: var(--accent); border-bottom: 1px solid var(--line); }
.lr-letter::after { content: ""; position: absolute; left: 0.5rem; bottom: -1px; width: 1.6rem; height: 2px; background: var(--gold); }
.lr-letter:first-child { padding-top: 0.8rem; }
@media (max-width: 760px) {
  .leader-row { grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "p name talks" "p role role" "p years years"; row-gap: 0.1rem; padding: 0.75rem 0.25rem; }
  .leader-row .portrait { grid-area: p; align-self: start; }
  .lr-name { grid-area: name; } .lr-role { grid-area: role; } .lr-years { grid-area: years; } .lr-talks { grid-area: talks; }
}
.leader-prog { color: var(--accent); }

/* -- speaker page ---------------------------------------------------------- */
.speaker-hero { background: var(--hero-bg); color: var(--hero-ink); border-bottom: 1px solid var(--hero-line); }
.speaker-hero-inner { display: flex; gap: 2rem; align-items: center; padding-top: 2.4rem; padding-bottom: 2.4rem; }
.speaker-info { min-width: 0; }
.speaker-info h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 0.35rem; }
.speaker-service { margin: 0; color: var(--hero-muted); font-size: 1.02rem; }
.speaker-summary { margin: 0.3rem 0 1.2rem; color: var(--hero-muted); font-size: 0.95rem; }
.speaker-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; }
@media (max-width: 600px) {
  .speaker-hero-inner { flex-direction: column; text-align: center; gap: 1.2rem; padding-top: 2rem; }
  .speaker-actions { justify-content: center; }
  .portrait-xl { width: 128px; height: 128px; }
}

/* order toggles: two text options, one underlined */
.seg { display: inline-flex; gap: 1.1rem; }
.seg-btn {
  font: inherit; font-size: 0.92rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--hero-muted);
  min-height: 38px; padding: 0.3rem 0; cursor: pointer; white-space: nowrap;
}
.seg-btn:hover { color: var(--hero-ink); }
.seg-btn[aria-pressed="true"] { color: var(--hero-ink); border-bottom-color: var(--accent); font-weight: 600; }
.seg-light .seg-btn { color: var(--muted); }
.seg-light .seg-btn:hover, .seg-light .seg-btn[aria-pressed="true"] { color: var(--ink); }

/* -- talk list (episodes) ------------------------------------------------- */
.talk-list { list-style: none; margin: 1.6rem 0 1rem; padding: 0; }
.talk {
  display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1rem; align-items: start;
  padding: 1rem 0.75rem; border-bottom: 1px solid var(--line);
}
.talk:hover { background: var(--hover); }
.talk.current { background: var(--hover); box-shadow: inset 3px 0 0 var(--gold); }
.talk-num { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; font-family: var(--mono); }
.talk-btn {
  grid-row: span 3; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink);
  background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.talk-btn svg { width: 18px; height: 18px; }
.talk-btn:hover { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.talk.current .talk-btn { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
a.talk-btn { text-decoration: none; border-style: dashed; color: var(--muted); border-color: var(--muted); }
a.talk-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--muted); }
.talk-title { font-family: var(--serif); font-size: 1.12rem; font-weight: var(--h-weight); overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.talk-meta { font-size: 0.88rem; color: var(--muted); }
.talk-meta .dot { margin: 0 0.35rem; }
.talk-links { font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin-top: 0.25rem; align-items: center; }
.src-link, .share-link {
  display: inline-flex; align-items: center; gap: 0.3rem; text-decoration: underline; text-underline-offset: 3px; color: var(--muted);
  font: inherit; font-size: 0.82rem; background: transparent; border: 0; padding: 0; cursor: pointer;
}
.src-link:hover, .share-link:hover { color: var(--accent); }
.src-link svg { width: 12px; height: 12px; }
.share-link svg { width: 13px; height: 13px; }
.badge { font-size: 0.75rem; color: var(--muted); font-style: italic; }
.prog { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; white-space: nowrap; border-radius: var(--r); padding: 0.1rem 0.5rem; }
.prog-done { background: var(--ink); color: var(--bg); }
.prog-started { background: var(--hover); color: var(--ink); border: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--player-h) + 1rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 40; background: var(--ink); color: var(--bg); padding: 0.6rem 1.1rem; border-radius: var(--r);
  font-size: 0.9rem; box-shadow: 0 8px 24px rgb(0 0 0 / 0.25); max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }

/* equalizer on the playing row */
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.paused .eq i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 70%; } }

.credit { font-size: 0.8rem; margin: 1rem 0 2rem; }
.credit a { color: inherit; }

/* Talks page filters: an open form on a hairline, not a boxed card */
.filters {
  display: grid; gap: 0.75rem 1rem; align-items: end; margin: 1.4rem 0 1rem; padding: 1rem 0 0.4rem; border-top: 1px solid var(--line);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
}
.filters label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.filters .f-wide { grid-column: 1 / -1; }
.filters input[type="search"], .filters input[type="number"], .filters select {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--surface); min-height: 42px;
  border: 1px solid var(--line); border-radius: var(--r); padding: 0.45rem 0.7rem; width: 100%;
}
.filters .f-check { flex-direction: row; align-items: center; gap: 0.5rem; min-height: 42px; font-weight: 400; color: var(--ink); font-size: 0.9rem; }
.filters .f-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.filters .f-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; }
@media (max-width: 600px) {
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem 0.75rem; }
  .filters .f-pick { grid-column: 1 / -1; }
}
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.results-head p { margin: 0; }
.talk-speaker { font-weight: 600; color: var(--ink); text-decoration: none; }
.talk-speaker:hover { text-decoration: underline; }

.site-footer { font-size: 0.82rem; padding-top: 1rem; padding-bottom: 2.5rem; border-top: 1px solid var(--line); margin-top: 2rem; }
.site-footer a { color: inherit; }

/* -- player ---------------------------------------------------------------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); color: var(--ink); border-top: 2px solid var(--gold);
  padding: 0 16px calc(0.4rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgb(0 0 0 / 0.08);
}
.player[hidden] { display: none; }
.seek {
  --p: 0%;
  -webkit-appearance: none; appearance: none; display: block; width: calc(100% + 32px); margin: 0 -16px;
  height: 14px; background: transparent; cursor: pointer;
}
.seek::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--gold) var(--p), var(--line) var(--p)); }
.seek::-moz-range-track { height: 4px; background: linear-gradient(to right, var(--gold) var(--p), var(--line) var(--p)); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }
.seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }

.player-inner {
  max-width: 64rem; margin: 0 auto; display: grid; align-items: center; gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding-top: 0.35rem;
}
.np { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.np-text { min-width: 0; }
.np-title { font-family: var(--serif); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport { display: flex; align-items: center; gap: 0.35rem; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn-sm { width: 36px; height: 36px; }
.icon-btn-sm svg { width: 20px; height: 20px; }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
/* Honeycomb cell play button (a nod to the beehive). */
.play-btn {
  width: 52px; height: 60px; border: 0; border-radius: 0; color: #171c19;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 60'%3E%3Cpolygon fill='%23c39a3d' points='26,1 50.2,15 50.2,45 26,59 1.8,45 1.8,15'/%3E%3Cpolygon fill='none' stroke='%2313223a' stroke-opacity='.35' stroke-width='1.4' points='26,6.5 45.4,17.75 45.4,42.25 26,53.5 6.6,42.25 6.6,17.75'/%3E%3C/svg%3E");
  display: grid; place-items: center; cursor: pointer; padding: 0; margin: 0 0.25rem;
}
.play-btn svg { width: 24px; height: 24px; }
.play-btn:hover { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 60'%3E%3Cpolygon fill='%23d4ad55' points='26,1 50.2,15 50.2,45 26,59 1.8,45 1.8,15'/%3E%3Cpolygon fill='none' stroke='%2313223a' stroke-opacity='.35' stroke-width='1.4' points='26,6.5 45.4,17.75 45.4,42.25 26,53.5 6.6,42.25 6.6,17.75'/%3E%3C/svg%3E"); }
.player-side { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; }
.time { font-size: 0.8rem; color: var(--muted); font-family: var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.speed-btn {
  font: inherit; font-size: 0.82rem; font-weight: 700; min-width: 52px; min-height: 36px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: var(--r); cursor: pointer;
}
.speed-btn:hover { border-color: var(--ink); }
.player-foot { max-width: 64rem; margin: 0 auto; display: flex; align-items: center; gap: 0.5rem 1rem; font-size: 0.75rem; color: var(--muted); min-height: 1rem; }
.queue-info { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-tools { margin-left: auto; display: flex; gap: 0.25rem; flex: none; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 0.3rem; font: inherit; font-size: 0.78rem; cursor: pointer;
  color: var(--muted); background: transparent; border: 0; border-radius: var(--r); padding: 0.3rem 0.6rem; min-height: 32px;
}
.tool-btn svg { width: 16px; height: 16px; }
.tool-btn:hover, .tool-btn[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.tool-btn.active { color: var(--accent); }
@media (max-width: 520px) { .tool-btn span { display: none; } .tool-btn.active span { display: inline; } }

.pop-menu, .queue-panel {
  position: fixed; z-index: 35; bottom: calc(var(--player-h) + 0.5rem + env(safe-area-inset-bottom));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.3);
}
.pop-menu { right: max(16px, calc(50% - 32rem)); display: flex; flex-direction: column; padding: 0.35rem; min-width: 12rem; }
.pop-menu[hidden], .queue-panel[hidden] { display: none; }
.pop-menu button {
  font: inherit; text-align: left; border: 0; background: transparent; color: inherit; cursor: pointer;
  padding: 0.55rem 0.8rem; border-radius: 8px; min-height: 40px;
}
.pop-menu button:hover, .pop-menu button:focus-visible { background: var(--hover); }
.pop-menu button[aria-checked="true"] { font-weight: 700; color: var(--accent); }
.queue-panel {
  right: max(16px, calc(50% - 32rem)); width: min(26rem, calc(100% - 32px));
  max-height: min(60vh, 32rem); display: flex; flex-direction: column;
}
.queue-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.6rem 0.4rem 1rem; border-bottom: 1px solid var(--line); }
.queue-head h2 { margin: 0; font-size: 1.1rem; }
.queue-head .muted { font-size: 0.82rem; }
.queue-head .icon-btn { margin-left: auto; color: var(--muted); font-size: 1.5rem; }
.queue-head .icon-btn:hover { background: var(--hover); color: var(--ink); }
.queue-list { list-style: none; margin: 0; padding: 0.35rem; overflow-y: auto; }
.queue-list button {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.1rem 0.5rem; width: 100%; text-align: left; font: inherit;
  border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0.5rem; border-radius: 8px;
}
.queue-list button:hover { background: var(--hover); }
.queue-list .q-num { grid-row: span 2; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.queue-list .q-title { font-family: var(--serif); font-weight: 600; }
.queue-list .q-meta { font-size: 0.8rem; color: var(--muted); }
.queue-list .q-current button { background: var(--hover); box-shadow: inset 3px 0 0 var(--gold); }
.queue-list .q-done .q-title { color: var(--muted); }
.queue-keys { margin: 0; padding: 0.5rem 1rem 0.7rem; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); }
kbd { font: inherit; font-size: 0.72rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3rem; }
.np-error { color: var(--error); }
.np-error[hidden] { display: none; }

@media (max-width: 760px) {
  :root { --player-h: 9.6rem; }
  .player-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "np side" "transport transport"; row-gap: 0.25rem; }
  .np { grid-area: np; }
  .player-side { grid-area: side; }
  .transport { grid-area: transport; justify-content: center; }
}



/* Top bar on phones: shorter nav label so logo, nav and account fit on one line. */
.topnav a { white-space: nowrap; }
.nav-short { display: none; }
@media (max-width: 700px) {
  .nav-long { display: none; }
  .nav-short { display: inline; }
}

/* -- document pages (privacy policy) ------------------------------------- */
.doc-page { padding-bottom: 0; }
.doc { max-width: 44rem; padding-top: 2.2rem; padding-bottom: 3rem; }
.doc h1 { font-size: 2.2rem; margin: 0 0 0.2rem; }
.doc h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.doc p, .doc li { line-height: 1.65; }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 0.4rem 0; }
.doc a { color: var(--accent); }

/* -- now playing link -------------------------------------------------------- */
a.np { text-decoration: none; color: inherit; border-radius: var(--r); }
a.np:hover .np-title { text-decoration: underline; }

/* -- continue listening (home) ------------------------------------------------ */
.continue { margin-top: 2rem; }
.continue .block-head a { text-decoration: none; font-size: 0.92rem; color: var(--accent); }
.continue .block-head a:hover { text-decoration: underline; }
.continue-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; border-top: 2px solid var(--gold); border-bottom: 1px solid var(--line); }
.continue-text { flex: 1 1 14rem; min-width: 0; }
.continue-label { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.continue-text h3 { margin: 0.15rem 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.continue-text p.muted { margin: 0; font-size: 0.88rem; }
.continue-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.continue-actions .hl-link { color: var(--accent); }

/* -- my listening ------------------------------------------------------------- */
.me-sync { font-size: 0.9rem; }
.me-section { margin: 1.6rem 0 2.4rem; }
.me-section h2 { margin: 0; font-size: 1.35rem; display: flex; align-items: baseline; gap: 0.5rem; }
.me-section h2 .count { font-family: var(--mono); font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.me-section > p { margin: 0.2rem 0 0.9rem; font-size: 0.9rem; }
.me-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.me-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding: 0.85rem 0.25rem;
}
.me-who { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; flex: 1 1 18rem; min-width: 0; }
.me-who h3 { margin: 0; font-size: 1.1rem; }
.me-who p { margin: 0.1rem 0 0.35rem; font-size: 0.85rem; }
.me-who:hover h3 { text-decoration: underline; }
.me-bar { height: 4px; background: var(--line); overflow: hidden; width: min(16rem, 100%); }
.me-bar span { display: block; height: 100%; background: var(--accent); }
.me-next { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; flex: 0 1 18rem; min-width: 0; }
.me-next p { margin: 0; font-size: 0.82rem; color: var(--muted); }
.me-next .btn { max-width: 100%; min-height: 40px; padding: 0.45rem 1rem; }
.me-next .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link { font-weight: 600; color: var(--accent); }

/* -- My Listening tabs and Account tab ---------------------------------------- */
.me-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin: 0.6rem 0 1.2rem; }
.me-tabs a { padding: 0.6rem 0; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.me-tabs a:hover { color: var(--ink); }
.me-tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.acct-card { border-top: 1px solid var(--ink); padding: 1rem 0; margin: 0 0 1rem; max-width: 40rem; }
.acct-card[hidden] { display: none; }
.acct-card h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.acct-card p { margin: 0 0 0.9rem; }
.acct-danger { border-top-color: var(--error); }
.btn-outline-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-outline-danger:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }
.btn-outline-danger[hidden] { display: none; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }
@media (prefers-color-scheme: dark) { .btn-danger { color: #10161f; } }
.delete-confirm { display: grid; gap: 0.8rem; margin-top: 0.4rem; }
.delete-confirm[hidden] { display: none; }
.delete-confirm .f-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.delete-confirm .f-check input { width: 18px; height: 18px; margin-top: 0.2rem; accent-color: var(--error); flex: none; }
.acct-privacy { font-size: 0.85rem; }

/* -- topics: sections of hairline rows, decade bars, essentials -------------------- */
.crumb { margin: 0 0 0.5rem; font-size: 0.9rem; }
.crumb a { color: var(--muted); }
.eyebrow-dark { margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--muted); }
.topic-group { margin: 1.8rem 0 2.4rem; }
.topic-group-title { position: relative; margin: 0; padding: 0 0 0.45rem; font-size: 1.5rem; color: var(--accent); border-bottom: 1px solid var(--ink); }
.topic-group-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 1.6rem; height: 2px; background: var(--gold); }
.topic-grid { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); column-gap: 2rem; }
.topic-group .topic-grid { margin: 0; }
.topic-card { display: flex; flex-direction: column; gap: 0.25rem; height: 100%; box-sizing: border-box; padding: 0.9rem 0.25rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.topic-card:hover { background: var(--hover); }
.topic-card h3 { margin: 0; font-size: 1.15rem; }
.topic-card:hover h3, .topic-card:focus-visible h3 { color: var(--accent); }
.topic-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.topic-card p:nth-of-type(2) { font-family: var(--mono); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.mini-bars { display: flex; align-items: flex-end; gap: 2px; height: 2.8rem; margin-top: auto; padding-top: 0.5rem; }
.mini-bars span { flex: 1; background: color-mix(in srgb, var(--accent) 55%, transparent); min-height: 2px; }
.timeline { margin: 1rem 0 1.25rem; }
.timeline figcaption { font-size: 0.85rem; }
.timeline-bars { display: flex; align-items: flex-end; gap: 0.4rem; height: 8rem; margin-top: 0.5rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--line); }
.tl-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 0.25rem; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--muted); font-size: 0.78rem; text-align: center; }
.tl-bar:disabled { cursor: default; }
.tl-bar .fill { background: color-mix(in srgb, var(--accent) 45%, transparent); min-height: 2px; }
.tl-bar:hover .fill, .tl-bar:focus-visible .fill, .tl-bar[aria-pressed="true"] .fill { background: var(--accent); }
.tl-bar[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.tl-bar .lbl { display: block; flex: none; height: 1.1rem; line-height: 1.1rem; font-family: var(--mono); font-size: 0.7rem; white-space: nowrap; overflow: hidden; }   /* same height with or without text, so bars share a baseline */
.tl-bar.thin .fill, .mini-bars span.thin { opacity: 0.4; }
.tl-bar .fill { max-height: calc(100% - 1.4rem); }   /* room for the span label below */
.timeline-bars { gap: 0.25rem; }
.tl-bar .lbl-short { display: none; }
@media (max-width: 760px) {
  .tl-bar .lbl-long { display: none; }
  .tl-bar .lbl-short { display: inline; }
}
.results-actions { display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; }
.btn-outline-inline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline-inline:hover { border-color: var(--ink); }
.btn-outline-inline[hidden] { display: none; }
.skip-heard { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; color: var(--muted); cursor: pointer; min-height: 42px; }
.skip-heard input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); margin: 0; }
.ess-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.5rem; margin: 1rem 0 1.2rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.ess-progress p { margin: 0 0 0.45rem; font-family: var(--mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ess-progress .btn { max-width: 100%; }
.ess-progress .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-topic-mark { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--portrait-r); background: var(--portrait-bg); color: var(--portrait-ink); font-family: var(--serif); font-size: 1.4rem; }

/* Phones: with the Topics link the top bar has four items; tighten it so it fits a 375px screen. */
@media (max-width: 430px) {
  .topbar-inner { gap: 0.55rem; }
  .brand { gap: 0.35rem; }
  .brand-text { font-size: 0.92rem; }
  .brand-mark { width: 30px; height: 30px; }
  .topnav { gap: 0.6rem; font-size: 0.85rem; }
  .account-btn { width: 34px; height: 34px; }
}

/* -- playlists by topic on a leader's page ----------------------------------------- */
.sp-topics { margin: 2rem 0 1rem; }
.sp-topics h2, .sp-all-title { margin: 0; font-size: 1.5rem; }
.sp-topics > p { margin: 0.2rem 0 0.8rem; font-size: 0.9rem; }
.sp-all-title { margin-top: 2.2rem; }
.sp-all-title + .talk-list { margin-top: 0.6rem; }
.sp-topic-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.sp-topic { border-bottom: 1px solid var(--line); }
.sp-topic-head { display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; padding: 0.55rem 0.25rem; }
.sp-topic-toggle { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
  background: none; border: 0; padding: 0.3rem 0 0.3rem 1.4rem; cursor: pointer; font: inherit; color: var(--ink); text-align: left; position: relative; min-height: 44px; justify-content: center; }
.sp-topic-toggle::before { content: ""; position: absolute; left: 0.2rem; top: 50%; width: 0.45rem; height: 0.45rem; margin-top: -0.3rem;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.sp-topic-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .sp-topic-toggle::before { transition: none; } }
.sp-topic-title { font-family: var(--serif); font-size: 1.15rem; font-weight: var(--h-weight); letter-spacing: var(--h-track); }
.sp-topic-toggle:hover .sp-topic-title { color: var(--accent); }
.sp-topic-meta { font-size: 0.82rem; color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sp-topic-all { font-size: 0.85rem; color: var(--muted); }
.sp-topic-play { min-height: 40px; padding: 0.4rem 1rem; }
.sp-talks { margin: 0 0 0.8rem 1.4rem; }
.sp-talks[hidden] { display: none; }
