/* Allpod, P2: dark, clean, large square art, red accent. No build step. */
:root {
  color-scheme: dark;
  --bg: #141414;
  --bg2: #1d1d1d;
  --bg3: #262626;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --accent: #f43e37;
  --accent-soft: rgba(244, 62, 55, 0.16);
  --line: #333;
  --topbar-bg: rgba(20, 20, 20, 0.97);
  --player-bg: #1b1b1b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.5; padding-bottom: 120px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); }

.layout { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 232px; flex: 0 0 232px;
  padding: 16px 14px; border-right: 1px solid var(--line);
  background: var(--bg); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; padding: 4px 6px 14px; }
.brand em { font-style: normal; color: var(--accent); }
.brand:hover { text-decoration: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { color: var(--text); padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.side-nav a:hover { background: var(--bg3); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-note { color: var(--muted); font-size: 13px; padding: 0 12px; margin: 14px 0 0; }
.main-col { flex: 1; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--topbar-bg); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
/* Bottom tab bar and full player sheet, mobile only. Desktop keeps the
   sidebar and the bottom player bar. */
.tabbar { display: none; }
.cancel-btn { display: none; }
.player-sheet { display: none; }
.player-sheet[hidden] { display: none; }
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 560px; }
.search-wrap input {
  width: 100%; padding: 11px 14px; background: var(--bg3);
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); outline: none;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input { padding-right: 40px; }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-wrap input::-ms-clear { display: none; }
.clear-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; font-size: 22px; color: var(--muted); padding: 4px 8px; line-height: 1;
}
.clear-btn:hover { color: var(--text); }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); max-height: 480px; overflow-y: auto; z-index: 30;
}
.dd-group { padding: 8px 0; border-top: 1px solid var(--line); }
.dd-group:first-child { border-top: 0; }
.dd-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 14px 2px; }
.dd-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 8px 14px; color: var(--text); }
.dd-item:hover, .dd-item:focus-visible { background: var(--bg3); outline: none; }
.dd-item b { font-size: 15px; }
.dd-text { flex: 1; min-width: 0; font-size: 15px; }
.dd-text small { color: var(--muted); display: block; font-size: 13px; }
.dd-clock { color: var(--muted); font-size: 17px; flex: 0 0 auto; }
.dd-thumb {
  position: relative; width: 44px; height: 44px; flex: 0 0 44px;
  background: var(--bg3); border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
}
.dd-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dd-thumb .initials { font-size: 15px; }
.dd-row { display: flex; align-items: center; }
.dd-row .dd-item { flex: 1; }
.dd-remove { background: none; border: 0; color: var(--muted); font-size: 20px; padding: 4px 12px 4px 0; }
.dd-remove:hover { color: var(--text); }
.dd-footer {
  display: block; width: 100%; text-align: right; background: none; border: 0;
  color: var(--muted); font-size: 13px; font-style: italic; padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.dd-footer:hover { color: var(--text); }
.dd-note { padding: 10px 14px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.nav-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.side-nav a { display: flex; align-items: center; gap: 10px; }
.side-nav a .nav-icon { width: 20px; height: 20px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.search-icon .nav-icon { width: 18px; height: 18px; }
.search-wrap input { padding-left: 40px; }
.btn-signin { display: inline-flex; align-items: center; gap: 8px; background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-weight: 600; color: var(--text); }
.btn-signin:hover { border-color: var(--accent); }
.btn-signin .nav-icon { width: 18px; height: 18px; }
.mode-status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pbtn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.pbtn .nav-icon { width: 18px; height: 18px; }
.vote-btn, .mini-btn { display: inline-flex; align-items: center; gap: 6px; }
.vote-btn .nav-icon, .mini-btn .nav-icon { width: 16px; height: 16px; }
.card-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.card-actions .btn .nav-icon { width: 16px; height: 16px; }
.dd-clock { display: inline-flex; color: var(--muted); }
.dd-clock .nav-icon { width: 17px; height: 17px; }
.topnav { display: flex; gap: 18px; margin-left: auto; }
.topnav a { color: var(--text); font-weight: 600; padding: 10px 4px; }
.topnav a.active { color: var(--accent); }

main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.loading, .empty { color: var(--muted); padding: 40px 0; text-align: center; font-size: 18px; }
h1 { font-size: 28px; margin: 4px 0 8px; }
h2 { font-size: 22px; margin: 32px 0 10px; }
h3 { font-size: 17px; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 16px; max-width: 720px; }
.note { color: var(--muted); font-size: 14px; }
.ep-note { color: var(--muted); font-size: 14px; }
.count { color: var(--muted); font-size: 15px; margin: 4px 0 16px; }

/* Home, no hero: topic chips, then content right away */
.tagline-small { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.home-chips { margin-bottom: 12px; }
.home-grid { grid-template-columns: repeat(4, 1fr); }
.topic-card { padding: 0; }
.topic-btn {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; color: var(--text);
}
.topic-btn .card-body { display: block; }
.topic-card .card-title, .topic-card .card-artist { display: block; }
.topic-art { max-height: 160px; }
.topic-art .initials { font-size: 56px; }

/* Comments and votes, local only */
.vote-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.vote-btn {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 15px;
}
.vote-btn.active { background: var(--accent-soft); border-color: var(--accent); }
.comments { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 8px; }
.comment-controls { margin-bottom: 12px; }
.comment-add { display: flex; gap: 8px; margin-bottom: 20px; }
.comment-add input, .comment-input {
  flex: 1; padding: 11px 14px; background: var(--bg3);
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); outline: none;
}
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment { background: var(--bg2); border-radius: var(--radius); padding: 14px; }
.comment.reply { background: var(--bg3); margin-top: 10px; }
.comment-head { display: flex; gap: 10px; align-items: baseline; }
.comment-author { font-weight: 700; }
.comment-time { color: var(--muted); font-size: 13px; }
.comment-text { margin: 6px 0 10px; }
.comment-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reply-box { display: flex; gap: 8px; margin-top: 10px; }
.reply-box input {
  flex: 1; padding: 9px 12px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); outline: none;
}
.try { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.try-btn { padding: 4px 2px; }

.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.sort-label { color: var(--muted); font-size: 14px; white-space: nowrap; }
.controls select { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
/* The result count sits at the right end of the controls row, not in a
   padded block of its own. */
.search-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.controls .search-count { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { padding: 10px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.linkbtn { background: none; border: 0; color: var(--accent); padding: 6px 0; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.results-grid { grid-template-columns: repeat(4, 1fr); }
.card { background: transparent; border: 0; border-radius: var(--radius); overflow: visible; }
.card:hover { border-color: transparent; }
.card a { color: var(--text); display: block; }
.card a:hover { text-decoration: none; }
.card-body { padding: 10px 2px 0; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-artist { color: var(--muted); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 13px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.card-actions .btn { padding: 8px 12px; font-size: 14px; margin: 0; }

/* v4 card: cover with a duration badge, a title in at most 2 lines, and one
   small line with show name, date, and start time. Nothing else. */
.thumb-btn {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: pointer; position: relative; border-radius: var(--radius); overflow: hidden;
}
.thumb-btn .art { width: 100%; aspect-ratio: 1 / 1; }
.thumb-btn .art .initials { font-size: 28px; }
.new-badge {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.duration-badge {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  background: rgba(0, 0, 0, 0.85); color: #fff; font-size: 12px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}
.card-head { display: flex; align-items: flex-start; gap: 6px; }
.card-title-btn {
  flex: 1; min-width: 0; background: none; border: 0; padding: 0;
  color: var(--text); font-weight: 700; font-size: 15px; line-height: 1.3;
  text-align: left; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Search rows: Shows on top, Episodes below, one card per episode. */
.search-section h2 { font-size: 18px; font-weight: 800; margin: 24px 0 12px; }
.search-section:first-child h2 { margin-top: 8px; }
.time-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.time-chip { background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; }
.time-chip.first { background: var(--accent); border-color: var(--accent); color: #fff; }
.time-chip:hover { border-color: var(--accent); }
.time-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Search cards: one chip row, never wrapping, at a fixed height, so
   every card in a row stays the same height. The matches live on the
   episode page, so no list ever grows a card. Approach 1, Nov 11, 2026. */
#search-results .time-chips { flex-wrap: nowrap; height: 44px; align-items: center; overflow: hidden; }
/* The card itself needs min-width 0: the no-wrap chip row makes the
   card's minimum width the sum of the chips, which forces the grid
   columns wider than the page. Without this, the page scrolls sideways. */
#search-results .result-card { min-width: 0; }
/* Chips shrink below their text width: without min-width 0, the
   no-wrap row makes the card's minimum width the sum of the chips,
   which forces the grid columns wider than the page. */
#search-results .time-chip { min-width: 0; overflow: hidden; white-space: nowrap; padding: 7px 10px; }
#search-results .matches-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 4px; }
.matches-count[hidden] { display: none; }
.matches-count { flex: 0 0 auto; background: none; border: 0; color: var(--accent); font-size: 13px; font-weight: 700; padding: 7px 6px; min-height: 36px; cursor: pointer; white-space: nowrap; }
.matches-count:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.matches-list { margin-top: 4px; }
.match-row { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 10px 4px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.match-row:hover { background: var(--bg3); }
.match-row.active { background: var(--bg3); }
.match-time { flex: 0 0 auto; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.match-snippet { flex: 1 1 auto; min-width: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Matches on the episode page: below the player, above the comments.
   Growing is fine here, because the page is one column. */
.ep-matches { margin-top: 24px; }
.ep-matches-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ep-matches-head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.ep-matches-toggle { display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 10px 4px; background: none; border: 0; color: var(--accent); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.ep-matches-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ep-search-form { display: flex; gap: 8px; margin-top: 12px; }
.ep-search-form input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--text); font-size: 15px; }
.card-menu-wrap { position: relative; flex: 0 0 auto; }
.card-menu-btn { background: none; border: 0; color: var(--muted); padding: 2px; line-height: 1; }
.card-menu-btn:hover { color: var(--text); }
.card-menu-btn .nav-icon { width: 18px; height: 18px; }
.card-menu {
  position: absolute; top: 28px; right: 0; z-index: 10; min-width: 180px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.menu-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); padding: 9px 10px; border-radius: 6px; font-size: 14px;
}
.menu-item:hover { background: var(--bg3); }
.quote { color: var(--text); font-size: 15px; margin: 10px 0 0; }
.art { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg3); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.art .initials { font-size: 44px; font-weight: 800; color: #fff; opacity: 0.9; text-align: center; padding: 8px; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.result-card { display: flex; flex-direction: column; }
.result-top { display: flex; gap: 0; flex-direction: column; }
.result-top .art { width: 100%; max-height: 220px; }
.result-body { padding: 14px; }

.row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.row .card { flex: 0 0 300px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf { margin-bottom: 8px; }

.show-head { display: flex; gap: 24px; flex-wrap: wrap; }
.show-art { width: 240px; height: 240px; flex: 0 0 240px; border-radius: 12px; }
.show-art .initials { font-size: 72px; }
.show-info { flex: 1; min-width: 260px; }
.show-info h1 { margin-top: 0; }
.show-desc { color: var(--text); max-width: 720px; }
.btn { display: inline-block; background: var(--bg3); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 10px 16px; font-weight: 600; margin: 4px 6px 4px 0; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.app-btn { display: inline-flex; align-items: center; gap: 8px; }
.ep-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ep-row { display: flex; gap: 12px; align-items: flex-start; background: var(--bg2); border-radius: var(--radius); padding: 12px 14px; flex-wrap: wrap; }
.ep-row .ep-main { flex: 1; min-width: 220px; }
.ep-title { font-weight: 700; }
.ep-meta { color: var(--muted); font-size: 13px; }
.ep-desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
.mini-btn { background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 14px; white-space: nowrap; }

.site-footer { max-width: 1200px; margin: 40px auto 0; padding: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

.player[hidden] { display: none; }
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid;
  grid-template-columns: 56px minmax(200px, 1.5fr) auto minmax(120px, 1fr) auto auto 40px 40px;
  gap: 12px; align-items: center;
  background: var(--player-bg); border-top: 1px solid var(--line); padding: 10px 16px;
  overflow: hidden;
}
.player > * { min-width: 0; }
.player-art { width: 56px; height: 56px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff; overflow: hidden; position: relative; }
.player-titles { display: flex; flex-direction: column; min-width: 0; }
.player-ep-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-show-title { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-started { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-transport { display: flex; gap: 8px; align-items: center; }
.player-progress { display: flex; gap: 8px; align-items: center; min-width: 0; }
.player-error-row { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; }
.player-error-row[hidden] { display: none; }
.pbtn { background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; min-width: 44px; min-height: 36px; padding: 6px 10px; }
.pbtn-play { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 16px; }
.pbtn-icon { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.pbtn-icon .queue-badge { position: absolute; top: -6px; right: -6px; }
.time { color: var(--muted); font-size: 13px; min-width: 36px; text-align: center; }
#seek { flex: 1; min-width: 0; width: 100%; }
.seek-wrap { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
/* Progress-bar marks: one dot per matching time, on the desktop bar and
   the mobile sheet. Dots sit on the track and are for looking only. */
.seek-marks { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; }
.seek-mark { position: absolute; top: -3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 14px; font-weight: 600; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.episode-block { margin-bottom: 28px; border-top: 1px solid var(--line); padding-top: 8px; }
.episode-block h3 { margin: 8px 0 4px; }
.episode-block h4 { margin: 16px 0 8px; font-size: 16px; }
.speed-wrap, .vol-wrap { color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.speed-wrap select { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.queue-badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.player-error { color: #ff8a80; font-size: 13px; margin: 0; }
.queue-panel { position: absolute; right: 20px; bottom: 100%; width: 360px; max-width: calc(100vw - 40px); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.queue-panel ol { margin: 0; padding-left: 20px; }
.queue-panel li { margin: 8px 0; }
.queue-panel li button { background: none; border: 0; color: var(--text); text-align: left; padding: 0; font-weight: 600; }

/* Report search predictions dialog, same shape as YouTube */
.modal-overlay[hidden] { display: none; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
}
.modal {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  width: 560px; max-width: 100%; max-height: calc(100vh - 80px); overflow-y: auto; padding: 20px 24px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-close { background: none; border: 0; font-size: 26px; color: var(--muted); padding: 4px 10px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.report-list { display: flex; flex-direction: column; gap: 4px; margin: 16px 0 8px; }
.report-list label, .report-reasons label { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 15px; }
.report-list input, .report-reasons input { width: 20px; height: 20px; accent-color: var(--accent); }
.report-selected-label { color: var(--muted); margin: 16px 0 4px; }
.report-reasons { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.modal textarea {
  width: 100%; padding: 12px; background: var(--bg3); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); resize: vertical; outline: none;
}
.modal textarea:focus { border-color: var(--accent); }
.report-count { color: var(--muted); font-size: 13px; text-align: right; margin: 4px 0 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .btn[disabled] { opacity: 0.45; cursor: default; }

/* Auth, onboarding, settings */
.auth-box, .onboard-box { max-width: 560px; }
.auth-box input[type="email"], .auth-box input[type="text"], .onboard-box input[type="text"], .onboard-box select {
  width: 100%; padding: 11px 14px; background: var(--bg3);
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); outline: none; margin: 6px 0 12px;
}
.auth-box input:focus, .onboard-box input:focus, .onboard-box select:focus { border-color: var(--accent); }
.auth-box label, .onboard-box label { display: block; font-weight: 600; margin-top: 12px; }
.onboard-step { color: var(--muted); font-size: 13px; }
.skip-link { background: none; border: 0; color: var(--muted); padding: 10px 4px; font-size: 14px; }
.skip-link:hover { color: var(--text); text-decoration: underline; }
.auth-note { color: var(--muted); font-size: 14px; }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.pick { padding: 10px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 14px; min-height: 44px; }
.pick:hover { border-color: var(--accent); }
.pick.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.field-note { color: var(--muted); font-size: 13px; margin-top: -6px; }

/* Signed in avatar, 32px circle, never the email text in the top bar. */
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; }
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 16px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; vertical-align: middle;
}
.avatar-circle img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-menu-wrap { position: relative; margin-left: auto; }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; min-width: 220px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.user-menu-head { padding: 8px 10px; font-size: 14px; color: var(--muted); word-break: break-all; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu a, .user-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); padding: 9px 10px; border-radius: 6px; font-size: 15px; font-weight: 600;
}
.user-menu a:hover, .user-menu button:hover { background: var(--bg3); text-decoration: none; }

@media (max-width: 1280px) {
  .player { grid-template-columns: 56px minmax(200px, 1.5fr) auto minmax(120px, 1fr) auto 40px 40px; }
  .player .vol-wrap { display: none; }
  .player .speed-label { display: none; }
}
@media (max-width: 1100px) {
  .grid, .results-grid, .home-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .grid, .results-grid, .home-grid { grid-template-columns: repeat(3, 1fr); }
  .row .card { flex-basis: 260px; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .menu-btn { display: none; }
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 10px 12px; }
  .search-wrap { min-width: 0; }
  .btn-signin { padding: 9px 12px; flex: 0 0 auto; }
  .cancel-btn:not([hidden]) { display: inline-block; background: none; border: 0; color: var(--accent); font-weight: 600; padding: 10px 4px 10px 8px; flex: 0 0 auto; }
  .tagline-small { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: 12px; padding-bottom: 4px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  /* Search header on phones: one 2x2 grid under the heading. Row 1 holds
     Sort and Length, row 2 holds Date and the count. No dead space. */
  .controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; margin-bottom: 12px; }
  .controls .sort-label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  .controls .sort-label-text { font-size: 12px; line-height: 16px; }
  .controls select { width: 100%; min-width: 0; height: 44px; overflow: hidden; text-overflow: ellipsis; }
  .controls .search-count { margin-left: 0; text-align: right; align-self: center; }
  /* Timestamp chips are full-width rows on phones, 44px tall. */
  .time-chips { flex-direction: column; flex-wrap: nowrap; }
  .time-chip { width: 100%; min-height: 44px; justify-content: flex-start; }
  /* Fable 5.2: on the search page only, one card per row and the chips
     in a single row of 3 equal-width columns, 44px tall: 2 chips plus
     the "+N more" count. No list inside any card. */
  #search-results .results-grid { grid-template-columns: 1fr; }
  #search-results .time-chips { flex-direction: row; flex-wrap: nowrap; gap: 8px; }
  #search-results .time-chip { flex: 1 1 0; min-width: 0; width: auto; min-height: 44px; justify-content: center; padding: 7px 4px; }
  #search-results .matches-count { flex: 1 1 0; min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 4px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.has-player { padding-bottom: calc(260px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--bg); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--muted); font-size: 11px; font-weight: 600; min-height: 48px;
    justify-content: center; padding: 4px 0;
  }
  .tabbar a:hover { text-decoration: none; color: var(--text); }
  .tabbar a.active { color: var(--accent); }
  .tabbar .nav-icon { width: 24px; height: 24px; }
  .tab-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; overflow: hidden; flex: 0 0 auto;
  }
  .tab-avatar .nav-icon { width: 20px; height: 20px; }
  .tab-avatar img { width: 100%; height: 100%; object-fit: cover; }
  /* Mini player, docked above the tab bar. */
  .player { display: flex; bottom: calc(68px + env(safe-area-inset-bottom)); padding: 8px 12px; gap: 10px; align-items: center; }
  .player-art { width: 48px; height: 48px; flex-basis: 48px; }
  .player-titles { display: flex; flex-direction: column; gap: 0; min-width: 0; }
  .player-ep-title, .player-show-title {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 14px;
  }
  .player-show-title { font-size: 12px; }
  .player-started { display: none; }
  .player-transport { display: flex; gap: 8px; align-items: center; }
  .player .player-progress, .player .speed-wrap, .player .vol-wrap,
  .player #btn-queue, .player #btn-start-episode,
  .player #btn-prev, .player #btn-next, .player #btn-fwd15, .player #queue-panel,
  .player .player-error-row { display: none; }
  .player-error { font-size: 13px; }
  /* Full player sheet, slides over the page. */
  .player-sheet {
    display: block; position: fixed; inset: 0; z-index: 60;
    background: var(--bg); overflow-y: auto;
    padding: calc(12px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  }
  .sheet-inner { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .sheet-handle { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 2px 0 10px; flex: 0 0 auto; }
  .sheet-close { align-self: flex-start; background: var(--bg3); border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
  .sheet-art { width: min(78vw, 320px); aspect-ratio: 1; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 800; overflow: hidden; flex: 0 0 auto; }
  .sheet-art img { width: 100%; height: 100%; object-fit: cover; }
  .sheet-title { font-size: 20px; margin: 16px 0 4px; }
  .sheet-show { color: var(--muted); font-size: 15px; margin: 0 0 2px; }
  .sheet-started { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
  .sheet-progress { display: flex; align-items: center; gap: 10px; width: 100%; }
  .sheet-time { color: var(--muted); font-size: 13px; min-width: 40px; }
  .sheet-seek-wrap { flex: 1; }
  .sheet-episode-row { display: flex; gap: 20px; margin: 10px 0 4px; }
  .sheet-controls { display: flex; align-items: center; gap: 28px; margin: 18px 0 10px; }
  .sheet-skip { background: none; border: 0; color: var(--text); font-size: 17px; font-weight: 700; min-width: 44px; min-height: 44px; }
  .sheet-play { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); border: 0; color: #fff; display: flex; align-items: center; justify-content: center; }
  .sheet-play .nav-icon { width: 32px; height: 32px; }
  .sheet-error { color: var(--muted); font-size: 15px; margin: 8px 0; }
  .sheet-actions { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
  .sheet-action { background: none; border: 0; color: var(--text); font-size: 13px; font-weight: 600; min-width: 44px; min-height: 44px; padding: 8px 10px; }
  .sheet-queue, .sheet-more { width: 100%; text-align: left; margin-top: 16px; }
  .sheet-queue ol { margin: 0; padding-left: 20px; }
  .sheet-queue li { margin: 8px 0; }
  .sheet-queue li button, .sheet-more button { background: none; border: 0; color: var(--text); font-size: 15px; padding: 10px 0; text-align: left; width: 100%; }
  /* Show page on mobile: bigger cover, episode rows with Play on the right. */
  .show-art { width: 200px; height: 200px; flex-basis: 200px; }
  .ep-row { display: flex; align-items: flex-start; gap: 12px; }
  .ep-row .ep-info { flex: 1; min-width: 0; }
  .ep-row .ep-info h3 { margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ep-row .btn { flex: 0 0 auto; }
  .show-tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
  .ep-search { width: 100%; padding: 11px 14px; background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; color: var(--text); outline: none; margin-bottom: 16px; }
}
@media (max-width: 720px) {
  .grid, .results-grid, .home-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .mode-status { display: none; }
  .show-art { width: 200px; height: 200px; flex-basis: 200px; }
  .show-art .initials { font-size: 56px; }
  main { padding: 16px; }
}
