:root {
  --bg: #fafaf7;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --card: #ffffff;
  --line: #e4e4de;
  --accent: #c8102e;
  --accent-fg: #ffffff;
  --progress: #f0b400;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #ececec;
    --muted: #9a9a9a;
    --card: #1c1c1c;
    --line: #2c2c2c;
    --accent: #ff4d5e;
    --accent-fg: #121212;
    --progress: #f5c518;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 180px; /* room for the player */
}
.top, main { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 32px; }
h1 { margin: 0; font-size: 2rem; letter-spacing: -0.02em; }
.sub { margin: 4px 0 24px; color: var(--muted); }


.status { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 4px 14px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; position: relative; overflow: hidden;
}
.item:hover { border-color: var(--muted); }
.item[aria-current="true"] { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.item .host {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover; align-self: start;
}
.item .text { display: grid; gap: 2px; min-width: 0; }
.item .title { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 0.875rem; }
.item .tagline {
  font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.episode.open .item .tagline { -webkit-line-clamp: unset; display: block; }
.item .badge { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.item .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--progress); }
.item.done .title::after { content: " ✓"; color: var(--muted); font-weight: 400; }

.player {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: grid; gap: 8px;
  grid-template-columns: 44px 1fr auto;
  grid-template-areas: "art now transport" "scrub scrub scrub";
  max-width: 100vw;
}
.now { grid-area: now; min-width: 0; align-self: center; }
.now-art { grid-area: art; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; align-self: center; background: var(--line); }
.now-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-meta { color: var(--muted); font-size: 0.875rem; }
.transport { grid-area: transport; display: flex; align-items: center; gap: 6px; }
.transport button, .transport select {
  font: inherit; font-size: 0.875rem; color: inherit; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
.transport .play {
  width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 1.1rem;
  background: var(--accent); color: var(--accent-fg); border: none;
}
.scrub { grid-area: scrub; display: flex; align-items: center; gap: 10px; }
.scrub input { flex: 1; accent-color: var(--accent); }
.time { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--muted); min-width: 4.5em; }
#dur { text-align: right; }

@media (max-width: 520px) {
  .player { grid-template-columns: 44px 1fr; grid-template-areas: "art now" "transport transport" "scrub scrub"; }
  .item { grid-template-columns: 40px 1fr auto; gap: 4px 10px; }
  .item .host { width: 40px; height: 40px; }
  .transport { justify-content: center; }
}

/* ---- playlist ---- */
.episode { display: grid; gap: 0; }
.episode.open .item { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.playlist {
  list-style: none; margin: 0; padding: 4px 0;
  background: var(--card); border: 1px solid var(--accent); border-top: none;
  border-radius: 0 0 10px 10px;
}
.playlist .note { padding: 10px 14px; color: var(--muted); font-size: 0.875rem; }
.track {
  display: grid; grid-template-columns: 3.6em 40px 1fr; gap: 10px; align-items: center;
  width: 100%; padding: 6px 14px; text-align: left; font: inherit; color: inherit;
  background: transparent; border: none; cursor: pointer;
}
.track:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.track .at { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--muted); }
.track .art {
  width: 40px; height: 40px; border-radius: 4px; object-fit: cover;
  background: var(--line) url(img/no-art.svg) center / cover no-repeat; /* shows until the cover loads */
}
.track .info { min-width: 0; display: grid; }
.track .song { font-weight: 600; font-size: 0.925rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .artist { font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.break { padding-top: 2px; padding-bottom: 2px; }
.track.break .info { font-size: 0.8rem; color: var(--muted); font-style: italic; }
.track.break .art { visibility: hidden; height: 0; }
.track.now { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.track.now .song { color: var(--accent); }
