/*
 * App styles. Primitives (buttons, chips, nav, icons) come from Beer CSS
 * (vendor/beercss/beer.min.css) and colors from theme.css; this file adds the
 * layout and type from the "Bottlenose" Claude Design artifact.
 */

/* Self-hosted fonts (copied into vendor/fonts/ by the build). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(vendor/fonts/inter-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(vendor/fonts/space-grotesk-latin-wght-normal.woff2) format("woff2");
}

:root {
  color-scheme: light dark;
  --font: Inter, Roboto, system-ui, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  /* Brightest text (titles); falls back to on-surface in light mode. */
  --on-surface-strong: var(--on-surface);
  /* Space above every screen's first row, below the status bar. */
  --page-top: calc(env(safe-area-inset-top) + 0.5rem);
}
body.dark {
  --on-surface-strong: #f3f7fa;
}
@media (prefers-color-scheme: dark) {
  body:not(.light) {
    --on-surface-strong: #f3f7fa;
  }
}

/*
 * The page is exactly the window and never scrolls; the lists inside it do.
 * Its height comes down from the window as 100%, not 100dvh: installed from
 * Chrome on Android and reloaded (a pull down does that), the app found
 * 100dvh to be taller than its window by the status bar, so the page scrolled
 * and either the header or the tabs were out of sight.
 */
html,
body {
  height: 100%;
}
body {
  background: var(--surface);
  overflow: hidden;
}

/* Screen layout: header, chips, scrolling list, then mini player + nav. */
#app {
  position: relative; /* sheets and their scrims cover it */
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0; /* over Beer's 100dvh for anything holding a main */
  overflow: hidden;
}
#app > main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 0.75rem;
}

/* Header */
.screen-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: calc(var(--page-top) + 0.25rem) 0.75rem 0.5rem 1.25rem;
}
.screen-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface-strong);
}
.screen-header > .max {
  flex: 1;
}
.screen-header > button {
  margin: 0;
  --_size: 2.75rem;
  color: var(--on-surface);
}
/* No tint behind an icon after it's pressed (Beer's hover and focus layer,
   which stays on after a tap on touch screens), and no squaring while it
   is. The icon pulses instead (pulseTappedIcon in ui/pulse.ts). */
.screen-header > button::after {
  display: none;
}
.screen-header > button:not(.chip):is(:active, .active) {
  border-radius: 50% !important;
}
.screen-header > button + button {
  margin-inline-start: -0.75rem; /* design: icon buttons sit flush */
}
.new-count {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.1875rem 0.625rem;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 0.5rem;
  padding: 0.375rem 1.25rem 0.875rem;
  overflow-x: auto;
  scrollbar-width: none;
}
:is(.filter-chips, .theme-options) > .chip {
  --_size: 2.25rem;
  --_padding: 1rem;
  margin: 0;
  flex-shrink: 0;
  border-radius: 1.125rem;
  border: 1.5px solid var(--outline-variant);
  font-weight: 600;
  white-space: nowrap;
  color: var(--on-surface);
}
:is(.filter-chips, .theme-options) > .chip.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

/* Episode list */
.group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.875rem 1.25rem 0.375rem;
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
}
.group-heading h2 {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* An Inbox row: artwork and text, then the bar of actions (as .sd-episode). */
.episode {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.875rem 0.5rem 0.5rem 1.25rem;
  margin: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}
.episode + .episode {
  border-top: 1px solid var(--surface-container);
}
.episode-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding-right: 0.75rem;
  color: inherit;
  text-align: start;
}
/* The show's name (cut short if long), the size, and "New". */
.episode-show {
  display: flex;
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  white-space: pre;
}
.episode-show-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artwork {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.artwork.large {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 0.75rem;
  font-size: 1.25rem;
}
.artwork.small {
  width: 3rem;
  height: 3rem;
  border-radius: 0.625rem;
  font-size: 1.0625rem;
}
.episode-text {
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}
.episode-meta {
  font-size: 0.78125rem;
  color: var(--on-surface-variant);
}
.episode-title {
  font-size: 0.96875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-surface-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.episode-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.1875rem;
}
/* Each detail stays on one line; the row doesn't wrap them. */
.episode-meta > span {
  white-space: nowrap;
}
/* Marked new */
/* Played: the title drops to the details' grey and the artwork fades. */
.episode.played .episode-title {
  font-weight: 500;
  color: var(--on-surface-variant);
}
.episode.played .artwork {
  opacity: 0.5;
}
.episode-meta .episode-new {
  color: var(--primary);
  font-weight: 700;
}
/* On the device: a filled check. Downloading: an icon and the percentage. */
.episode-meta .saved {
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.episode-meta .saved > i {
  --_size: 0.9375rem;
}
/* Queued behind other downloads: the same indicator, greyed out. */
.episode-meta .saved.pending {
  color: var(--on-surface-variant);
  opacity: 0.7;
}
.progress-mini {
  width: 2.5rem;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-container-highest);
  overflow: hidden;
}
.progress-mini > span,
.mini-player-progress > span {
  display: block;
  height: 100%;
  background: var(--primary);
}
/* Rows can be pressed and held (to select): no text selection or callout. */
.episode-main {
  -webkit-touch-callout: none;
  user-select: none;
}
/* While selecting, a chosen row is tinted. */
.episode.selected {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
/* The header while searching: the search box, in the header's place. */
.screen-header.searching > .show-search-box {
  flex: 1;
  min-width: 0;
  height: 2.75rem; /* the usual header's height */
  margin-right: 0.5rem;
}
/* The header while selecting: close, the count, and the group's menu. */
.screen-header.selecting {
  padding-left: 0.5rem;
  gap: 0.25rem;
}
.screen-header.selecting h1 {
  font-size: 1.375rem;
  line-height: 2.75rem; /* the usual header's height */
  letter-spacing: -0.01em;
}

/*
 * A sheet of actions that slides up from the bottom, over a scrim that
 * dims the screen (ui/episode_menu.tsx).
 */
.sheet-scrim {
  position: absolute;
  inset: 0;
  z-index: 200; /* over everything, including Beer's bottom nav (100) */
  display: flex;
  align-items: flex-end;
  background: rgb(0 0 0 / 0.5);
  animation: scrim-in 0.2s ease-out;
}
.sheet {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.5rem calc(env(safe-area-inset-bottom) + 0.75rem);
  border-radius: 1.5rem 1.5rem 0 0;
  background: var(--surface-container);
  animation: sheet-up 0.25s cubic-bezier(0.2, 0, 0, 1);
}
.sheet-head {
  /* Beer makes every element inherit its parent's corner radius; without
     this the sheet's rounded corners would clip the title's first letter. */
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.875rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--surface-container-highest);
}
.sheet-head-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.sheet-sub {
  font-size: 0.78125rem;
  color: var(--on-surface-variant);
}
.sheet-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--on-surface-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Not Beer's .transparent: it forces color: inherit. */
button.sheet-action {
  --_size: 3.25rem;
  --_padding: 0.75rem;
  margin: 0;
  justify-content: flex-start;
  gap: 1rem;
  border-radius: 0.875rem;
  background: none;
  box-shadow: none;
  color: var(--on-surface);
  font-size: 1rem;
  font-weight: 500;
}
button.sheet-action:disabled {
  opacity: 0.6;
}
@keyframes scrim-in {
  from {
    opacity: 0;
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sheet-scrim,
  .sheet {
    animation: none;
  }
}
/* A message floating above the bottom navigation (ui/toast.tsx) */
.toast-anchor {
  position: relative;
  flex-shrink: 0;
  height: 0;
  z-index: 201; /* over sheets and their scrims (200) */
  pointer-events: none;
}
.toast {
  position: absolute;
  inset: auto 1rem 0.75rem;
  width: fit-content;
  margin: 0 auto;
  max-width: 28rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  /* Muted: close to the screen's own colors rather than their inverse. */
  background: var(--surface-container-highest);
  color: color-mix(in srgb, var(--on-surface) 80%, var(--on-surface-variant));
  font-size: 0.875rem;
  line-height: 1.35;
  box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 0.25);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}
button.show-older {
  display: flex;
  margin: 0.75rem auto 0.5rem;
  border: 1.5px solid var(--outline);
  color: var(--on-surface);
}
/*
 * While feeds are loading: a ring round the refresh icon, with an arc of it
 * lit that goes round. The icon itself keeps still.
 */
/* The button is out of use meanwhile: its icon greys, the ring doesn't. */
.screen-header > button:disabled:has(> .refresh-ring) {
  opacity: 1;
}
.screen-header > button:disabled:has(> .refresh-ring) > i {
  opacity: 0.38;
}
.refresh-ring {
  position: absolute;
  inset: 0.3125rem;
  border: 0.125rem solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-top-color: var(--primary);
  border-radius: 50% !important; /* over the corners Beer hands down */
  pointer-events: none;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .refresh-ring {
    animation: none;
  }
}
.empty {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 0.9375rem;
}

/* Mini player */
.mini-player {
  display: block; /* Beer makes footers grids, which won't truncate the title */
  /* Beer makes footers at least 5rem tall and centers what's inside, which
     put 4px above the row and 4px below the progress bar. */
  min-block-size: 0;
  flex-shrink: 0;
  background: var(--surface-container);
  border-top: 1px solid var(--surface-container-high);
  padding: 0;
}
.mini-player-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.625rem 0.625rem 0.75rem;
}
.mini-player-row > button {
  margin: 0;
  flex-shrink: 0;
}
.mini-player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
}
.mini-player-text {
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.mini-player-title {
  font-size: 0.90625rem;
  font-weight: 600;
  color: var(--on-surface-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-player-sub {
  font-size: 0.78125rem;
  color: var(--on-surface-variant);
}
.mini-player-progress {
  height: 3px;
  background: var(--surface-container-highest);
}

/* Bottom navigation */
nav.bottom {
  flex-shrink: 0;
  background: var(--surface-container-lowest);
}
nav.bottom .badge {
  --_x: 0.25rem;
  background: #ff8a65;
  color: #1a0e0a;
  font-weight: 700;
  min-inline-size: 1.375rem;
  min-block-size: 1.125rem;
}

/*
 * Now Playing (replaces the screen above the bottom nav). It never scrolls:
 * every row has a fixed height except the artwork, which shrinks to fit
 * whatever height is left on the device.
 */
.now-playing {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--on-surface);
  padding: 0 0 1rem;
  overflow: hidden;
  animation: np-slide-up 0.25s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes np-slide-up {
  from {
    transform: translateY(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .now-playing {
    animation: none;
  }
}
.now-playing button {
  margin: 0;
}
.now-playing button.transparent {
  --_size: 2.75rem;
  color: var(--on-surface);
}
.np-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: var(--page-top) 0.5rem 0;
}
.np-top > .max {
  flex: 1;
}
/* No tint behind an icon after a press, as in the screen headers: the icon
   pulses instead (pulseTappedIcon in ui/pulse.ts). */
.np-top > button::after {
  display: none;
}
.np-top > button:is(:active, .active) {
  border-radius: 50% !important;
}
.np-top > button.favorite {
  color: var(--primary);
}
.np-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.np-body > :not(.np-art-slot) {
  flex-shrink: 0;
}
.np-art-slot {
  flex: 1;
  min-height: 0;
  align-self: stretch;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.25rem;
}
.np-art {
  position: relative;
  overflow: hidden;
  /* Square: as big as the slot allows, capped at the design's 300px. */
  width: min(300px, 100cqw - 5rem, 100cqh);
  aspect-ratio: 1;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  container-type: inline-size;
}
.np-art > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
}
.np-art-mono {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24cqi; /* 72px at 300px */
  letter-spacing: -0.03em;
  line-height: 1;
}
.np-art-show {
  position: relative;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: min(0.75rem, 4cqi); /* 12px at 300px, scales down with the art */
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
@container (max-width: 160px) {
  .np-art-show {
    display: none; /* too small to read; the monogram is enough */
  }
}
.np-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 1.375rem 1.75rem 0;
  text-align: center;
}
.np-sub {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
}
.np-meta h1 {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--on-surface-strong);
}
.np-scrubber {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.125rem 1.5rem 0;
}
/*
 * The scrubber: one bar showing how much has played (primary) and, while the
 * audio is still downloading, how much is on the device (a faint neutral
 * fill beyond the played part). `--played` and `--downloaded` are set by
 * NowPlayingScreen as distances along the track. Over those, the stretches
 * where ads were found in the downloaded file are red (`--ads`, a gradient
 * NowPlayingScreen makes).
 */
.np-scrubber > input {
  --ad: #e5484d;
  --_track: 0.375rem;
  --_thumb: 1.125rem;
  appearance: none;
  width: 100%;
  height: 1.75rem;
  margin: 0;
  background: none;
  cursor: pointer;
}
.np-scrubber > input::-webkit-slider-runnable-track {
  height: var(--_track);
  border-radius: var(--_track);
  background:
    var(--ads, linear-gradient(transparent, transparent)),
    linear-gradient(
    to right,
    var(--primary) var(--played),
    color-mix(in srgb, var(--on-surface) 30%, transparent) var(--played)
    max(var(--played), var(--downloaded)),
    var(--surface-container-highest) max(var(--played), var(--downloaded))
  );
}
.np-scrubber > input::-moz-range-track {
  height: var(--_track);
  border-radius: var(--_track);
  background:
    var(--ads, linear-gradient(transparent, transparent)),
    linear-gradient(
    to right,
    var(--primary) var(--played),
    color-mix(in srgb, var(--on-surface) 30%, transparent) var(--played)
    max(var(--played), var(--downloaded)),
    var(--surface-container-highest) max(var(--played), var(--downloaded))
  );
}
.np-scrubber > input::-webkit-slider-thumb {
  appearance: none;
  width: var(--_thumb);
  height: var(--_thumb);
  margin-top: calc((var(--_track) - var(--_thumb)) / 2);
  border: none;
  border-radius: 50%;
  background: var(--primary);
}
.np-scrubber > input::-moz-range-thumb {
  width: var(--_thumb);
  height: var(--_thumb);
  border: none;
  border-radius: 50%;
  background: var(--primary);
}
.np-scrubber > input:focus-visible {
  outline: 0.125rem solid var(--primary);
  outline-offset: 0.125rem;
  border-radius: 0.5rem;
}
.np-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.np-transport {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem 0;
}
/*
 * Speed, skips and next: icon over a small label. All four are the same
 * size, so the row is symmetric about the play button and each has the same
 * hover and press shape.
 */
.np-transport > button.np-ctl {
  --_size: 3.75rem;
  --_padding: 0;
  inline-size: 3.5rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 0.3125rem;
  border-radius: 0.875rem;
  color: var(--on-surface-strong);
}
/*
 * No background on hover, focus or after a tap (Beer's state layer, which
 * lingers after a tap on touch screens): a tap pulses the icon instead (see
 * transport_controls.tsx). Keyboard focus still gets Beer's outline.
 */
.np-transport > button.np-ctl::after {
  display: none;
}
.np-ctl-label {
  min-block-size: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: color-mix(in srgb, var(--on-surface) 60%, var(--on-surface-variant));
  font-variant-numeric: tabular-nums;
}
/*
 * Play/pause: filled like the mini player's, but larger, and raised to line
 * up with the icons, not the labels.
 */
.np-transport > button.np-play {
  --_size: 3.5rem;
  margin: 0 0.5rem 1.0625rem;
  padding: 0;
}
.np-transport > button.np-play > i {
  --_size: 1.75rem;
}

/* Shared */
/* Beer fills every svg with currentColor; keep outline-only icons hollow. */
svg[fill="none"] {
  fill: none;
}
.artwork {
  position: relative;
  overflow: hidden;
}
.artwork-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.5rem 1.25rem 0;
}
.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-surface-strong);
}
.section-empty {
  margin: 0;
  padding: 0.75rem 1.25rem 0.5rem;
  font-size: 0.875rem;
  color: var(--on-surface-variant);
}
#app > .filter-chips,
main .filter-chips {
  padding-top: 0;
}
button.subscribe {
  --_size: 2.75rem;
  margin: 0;
  flex-shrink: 0;
}
button.subscribe.on {
  background: var(--primary);
  color: var(--on-primary);
}
button.subscribe.on-art:not(.on) {
  background: var(--surface);
  color: var(--on-surface-strong);
}
button.subscribe.in-row:not(.on) {
  background: transparent;
  border: 1.5px solid var(--outline);
  color: var(--on-surface);
}

/* Shows tab */
/* A search in progress: results from the search before fade back. */
#app > main.shows-list > * {
  transition: opacity 0.2s;
}
#app > main.shows-list.searching > * {
  opacity: 0.35;
}
.show-search {
  padding: 0.5rem 1.25rem 0.75rem;
}
.show-search-box {
  height: 3rem;
  border-radius: 1.5rem;
  background: var(--surface-container);
  border: 1.5px solid var(--surface-container-high);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 0.375rem 0 1rem;
}
.show-search-box.active,
.show-search-box:focus-within {
  border-color: var(--primary);
}
.show-search-box > i {
  font-size: 1.25rem;
  color: var(--on-surface-variant);
}
.show-search-box > input {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  border: none;
  outline: none;
  background: transparent;
  color: var(--on-surface-strong);
  font: inherit;
  font-size: 0.96875rem;
}
.show-search-box > input::placeholder {
  color: var(--on-surface-variant);
}
.show-search-box > input::-webkit-search-cancel-button {
  display: none; /* we draw our own clear button */
}
.show-search-box > button {
  --_size: 2.25rem;
  margin: 0;
  background: var(--surface-container-highest);
  color: var(--on-surface);
}
.show-search-box > button > i {
  font-size: 1rem;
}
#app > main.shows-list {
  padding-bottom: 1.25rem;
}
.see-all {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.625rem 0;
}
.explore-row {
  display: flex;
  gap: 0.875rem;
  padding: 0 1.25rem 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.explore-card {
  width: 9.25rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.artwork.explore {
  width: 9.25rem;
  height: 9.25rem;
  border-radius: 1rem;
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.375rem;
}
button.subscribe.on-art {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
}
.explore-name,
.explore-cat {
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-name {
  /* A block: Beer lays links out as centred flex rows, which can't truncate. */
  display: block;
  text-align: start;
  font-size: 0.90625rem;
  font-weight: 600;
  color: var(--on-surface-strong);
}
.explore-cat {
  font-size: 0.78125rem;
  color: var(--on-surface-variant);
}
.your-shows {
  padding-top: 1.5rem;
}
.your-shows .section-heading {
  align-items: center;
  padding: 0 0.5rem 0.75rem 1.25rem;
}
.heading-with-count {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}
.heading-with-count > span {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
}
button.sort-button {
  --_size: 2.75rem;
  --_padding: 0.75rem;
  margin: 0;
  gap: 0.375rem;
  color: var(--on-surface);
  font-size: 0.84375rem;
  font-weight: 600;
}
button.sort-button > i {
  font-size: 1.125rem;
}
/* No tint behind it after a tap, as for the other buttons that pulse instead
   (Beer's hover and focus layer, which stays on after a tap on touch
   screens). */
button.sort-button::after {
  display: none;
}
.show-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.125rem 0.75rem;
  padding: 0 1.25rem;
}
.show-tile {
  display: flex;
  flex-direction: column;
  /* Beer centres links both ways, which sinks tiles with one-line names */
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.4375rem;
}
.artwork.tile {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.875rem;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}
.new-badge {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  height: 1.375rem;
  min-width: 1.375rem;
  padding: 0 0.4375rem;
  border-radius: 0.6875rem;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: normal;
  display: flex;
  align-items: center;
  justify-content: center;
}
.show-tile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-surface);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sub-page header (e.g. Featured) */
.sub-header {
  display: flex;
  align-items: center;
  padding: var(--page-top) 0.5rem 0;
}
.sub-header > .max {
  flex: 1;
}
.sub-header > button {
  --_size: 2.75rem;
  margin: 0;
  color: var(--on-surface);
}
/* No tint behind an icon after a press, as in the screen headers: the icon
   pulses instead (pulseTappedIcon in ui/pulse.ts). */
.sub-header > button::after {
  display: none;
}
.sub-header > button:is(:active, .active) {
  border-radius: 50% !important;
}
.sub-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 1.25rem 0.75rem;
}
.sub-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface-strong);
}
.sub-title + .filter-chips {
  padding-top: 0;
  padding-bottom: 0.625rem;
}

/* Featured list */
.featured-list > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.featured-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
}
.featured-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.artwork.featured {
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
  font-size: 1.375rem;
}
.featured-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}
.featured-meta,
.featured-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.featured-meta {
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--on-surface-variant);
}
.featured-name {
  font-size: 0.96875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-surface-strong);
}
.featured-desc {
  font-size: 0.84375rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--on-surface) 70%, var(--on-surface-variant));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/*
 * ShowRowSkeleton: grey shapes where a row's artwork, text and button go.
 * (Names are prefixed: bare ones like "button" are Beer CSS classes.)
 */
.show-row-skeleton,
.sd-episode-skeleton {
  animation: skeleton-pulse 0.9s ease-in-out infinite alternate;
}
/* EpisodeItemSkeleton: lines for the date, title and summary, then the play
   button's circle with the details beside it. */
.sd-episode-skeleton {
  padding-bottom: 0.75rem;
}
/* The (still empty) episode list above the placeholders takes no room. */
.sd-episodes > ul:empty {
  display: none;
}
.sd-episode-skeleton .sd-ep-actions {
  gap: 0.75rem;
}
.sd-episode-skeleton .skeleton-dot {
  width: 2.25rem;
  height: 2.25rem;
}
/* An Explore card to come: the cover's square, then two lines. */
.explore-card-skeleton {
  animation: skeleton-pulse 0.9s ease-in-out infinite alternate;
}
.explore-card-skeleton > .skeleton-art {
  width: 9.25rem;
  height: 9.25rem;
  border-radius: 1rem;
  margin-bottom: 0.375rem;
}
.skeleton-art,
.skeleton-line,
.skeleton-dot {
  display: block;
  flex-shrink: 0;
  background: var(--surface-container-highest);
}
.skeleton-art {
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
}
.skeleton-line {
  height: 0.75rem;
  margin: 0.1875rem 0;
  border-radius: 0.375rem;
}
.skeleton-line.short {
  width: 30%;
  height: 0.625rem;
}
.skeleton-line.medium {
  width: 55%;
}
.skeleton-line.long {
  width: 80%;
}
.skeleton-dot {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}
@keyframes skeleton-pulse {
  to {
    opacity: 0.4;
  }
}
@media (prefers-reduced-motion: reduce) {
  .show-row-skeleton,
  .sd-episode-skeleton {
    animation: none;
  }
}

/* Links that open a show page (src/show_detail.tsx openShow) */
a.show-tile,
a.featured-main,
.explore-card > a.card-link {
  color: inherit;
}
.explore-card {
  position: relative;
}
/*
 * Beer positions everything. Not the link, whose ::after is to be the
 * card's, nor the category, which would otherwise sit on top of it.
 */
.explore-card > :is(a.card-link, .explore-cat) {
  position: static;
}
/* Stretch the name link over the whole card; subscribe stays on top. */
.explore-card > a.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.explore-card button.subscribe.on-art {
  z-index: 1;
}
/* The artwork opens the show; the title opens the episode. */
a.np-art-link {
  display: flex;
  border-radius: 1.5rem;
}
a.np-episode-link {
  display: inline; /* Beer makes links flex boxes, which breaks the clamp */
  color: inherit;
}
a.np-show-link {
  color: inherit;
}

/* Show page */
#app > main.show-detail {
  padding-bottom: 0;
}
.sd-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.25rem 0;
}
.artwork.sd-art {
  width: 8rem;
  height: 8rem;
  border-radius: 1.125rem;
  font-size: 2.375rem;
  letter-spacing: -0.03em;
}
.sd-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.sd-titles h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5625rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--on-surface-strong);
  overflow-wrap: anywhere;
}
.sd-author {
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--on-surface) 85%, var(--on-surface-variant));
}
.sd-meta {
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
}
.sd-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.125rem 1.25rem 0;
}
button.sd-subscribe {
  --_size: 3rem;
  flex: 1;
  margin: 0;
  gap: 0.5rem;
  border: 1.5px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.9375rem;
  font-weight: 700;
}
button.sd-subscribe.on {
  border-color: var(--outline);
  background: transparent;
  color: var(--on-surface);
}
button.sd-subscribe > i {
  --_size: 1.125rem;
}
button.sd-bell {
  --_size: 3rem;
  margin: 0;
  flex-shrink: 0;
  border: 1.5px solid var(--outline);
  background: transparent;
  color: var(--on-surface);
}
button.sd-bell.on {
  border-color: var(--primary);
  color: var(--primary);
}
.sd-description {
  padding: 1rem 1.25rem 0;
}
/* The description, formatted as notes (ui/notes.tsx), cut to three lines. */
.sd-desc-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sd-desc-text.open {
  display: block;
}
.sd-desc-text > .notes {
  font-size: 0.90625rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--on-surface) 60%, var(--on-surface-variant));
}
/* Clamped: plain blocks, so the three lines are counted across them. */
.sd-desc-text:not(.open) > .notes {
  display: block;
}
.sd-desc-text:not(.open) > .notes > * + * {
  margin-top: 0.75rem !important; /* the gap the flex column gives when open */
}
/* Text buttons. Not Beer's .transparent: it forces color: inherit. */
button.sd-desc-toggle,
button.sd-retry {
  background: none;
  box-shadow: none;
}
/* No background on hover, focus or after a tap (Beer's state layer). */
button.sd-desc-toggle::after,
button.sd-retry::after {
  display: none;
}
.sd-description:not([data-overflows]) > .sd-desc-text:not(.open) + button.sd-desc-toggle {
  display: none;
}
button.sd-desc-toggle {
  --_size: 2.25rem;
  --_padding: 0;
  margin: 0.125rem 0 0;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
}
.sd-episodes {
  padding-top: 0.625rem;
}
.sd-episodes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 0.25rem 1.25rem;
}
.sd-episodes-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-surface-strong);
}
.sd-episodes > ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem;
}
.sd-episode {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 0.5rem 0.5rem 1.25rem;
  border-top: 1px solid var(--surface-container);
}
/* The date, title and summary together open the episode's page. */
a.sd-ep-link {
  display: flex;
  flex-direction: column;
  align-items: stretch; /* Beer centers what's inside links */
  gap: 0.25rem;
  color: inherit;
  text-align: start;
}
.sd-ep-date {
  padding-right: 0.75rem;
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--on-surface-variant);
}
.sd-new {
  color: var(--primary);
  font-weight: 700;
}
.sd-new::before {
  content: " · ";
  white-space: pre;
}
.sd-ep-title {
  padding-right: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-surface-strong);
}
.sd-episode.played .sd-ep-title {
  color: color-mix(in srgb, var(--on-surface) 20%, var(--on-surface-variant));
}
.sd-ep-summary {
  padding-right: 0.75rem;
  font-size: 0.84375rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--on-surface) 45%, var(--on-surface-variant));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sd-ep-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
/* How far in and the time left (as on an Inbox row), beside the play button. */
/* Greyed out, and not for pressing (while Inbox rows are being selected). */
.sd-ep-actions.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.sd-ep-actions.disabled > button {
  opacity: 1; /* Beer fades disabled buttons itself: once is enough */
}
.sd-ep-actions > .episode-meta {
  flex: 1;
  min-width: 0;
  margin: 0 0 0 0.375rem;
}
/*
 * 44px tap target around a 36px visible circle (transparent border), pulled
 * left so the circle lines up with the text above.
 */
button.sd-play {
  --_size: 2.75rem;
  margin: 0 0 0 -4px;
  flex-shrink: 0;
  border: 4px solid transparent;
  background-clip: padding-box;
  background-color: var(--surface-container-high);
  color: var(--on-surface);
}
button.sd-play.current {
  background-color: var(--primary);
  color: var(--on-primary);
}
button.sd-play > i {
  --_size: 1.25rem;
}
/*
 * In the Inbox the play circle is tighter around its icon: 36px rather than
 * 44px, inside a 44px tap target, so the bar (and the row) is shorter than
 * on a show's page. The icons are the same size in both.
 */
.episode button.sd-play {
  --_size: 2.25rem;
}
/*
 * Downloaded: a quiet grey disc, close around the tick (28px, in the same
 * 44px tap target).
 */
.episode button.sd-download.on {
  --_size: 1.75rem;
  border-width: 8px;
  background-color: var(--surface-container-highest);
  color: var(--on-surface);
}
.episode .sd-ep-actions {
  margin-top: 0.1875rem;
}
button.sd-inbox,
button.sd-queue,
button.sd-archive,
button.sd-download,
button.sd-ep-more {
  --_size: 2.75rem;
  margin: 0;
  flex-shrink: 0;
}
button.sd-inbox,
button.sd-queue,
button.sd-archive,
button.sd-download {
  color: var(--on-surface);
}
/* In the Inbox, the queue or the archive: the icon takes the accent colour. */
button.sd-inbox.on,
button.sd-queue.on,
button.sd-archive.on {
  color: var(--primary) !important; /* over Beer's .transparent */
}
button.sd-download.on {
  border: 4px solid transparent;
  background: var(--primary);
  background-clip: padding-box;
  color: var(--on-primary);
}
/* No tint behind these icons after a press, as in the screen headers: the
   icon pulses instead (pulseTappedIcon in ui/pulse.ts). */
button.sd-inbox::after,
button.sd-queue::after,
button.sd-archive::after,
button.sd-download::after,
button.sd-ep-more::after {
  display: none;
}
button.sd-inbox:is(:active, .active),
button.sd-queue:is(:active, .active),
button.sd-archive:is(:active, .active),
button.sd-download:is(:active, .active),
button.sd-ep-more:is(:active, .active) {
  border-radius: 50% !important;
}
button.sd-inbox > i,
button.sd-queue > i,
button.sd-archive > i,
button.sd-download > i,
button.sd-ep-more > i {
  --_size: 1.25rem;
}
button.sd-ep-more {
  background: none;
  color: var(--on-surface-variant);
}
button.sd-more {
  display: flex;
  width: fit-content;
  margin: 0.25rem auto 1rem; /* centred */
  border: 1.5px solid var(--outline);
  color: var(--on-surface);
}
button.sd-retry {
  --_size: 2rem;
  --_padding: 0.25rem;
  margin: 0;
  /* On the message's baseline (Beer centres buttons on the line instead). */
  vertical-align: baseline;
  line-height: inherit;
  color: var(--primary);
  font-weight: 600;
}

/* Now Playing on short screens (after the base rules it overrides). */
@media (max-height: 700px) {
  .np-art-slot {
    padding-top: 0.5rem;
  }
  .np-meta {
    padding-top: 0.75rem;
  }
  .np-scrubber {
    padding-top: 0.625rem;
  }
}

/* Episode page */
#app > main.episode-detail {
  padding-bottom: 1.25rem;
}
.ed-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem 0;
}
a.ed-show {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  margin-bottom: 0.25rem; /* a little more room above the title */
  color: inherit;
}
.artwork.ed-art {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.75rem;
  font-size: 1.125rem;
}
.ed-show-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  line-height: 1.3;
}
.ed-show-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--on-surface-strong);
}
.ed-show-sub {
  font-size: 0.78125rem;
  color: var(--on-surface-variant);
}
.ed-head h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--on-surface-strong);
  overflow-wrap: anywhere;
}
.ed-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.84375rem;
  color: var(--on-surface-variant);
}
.ed-new {
  display: inline-flex;
  align-items: center;
  height: 1.375rem;
  padding: 0 0.5rem;
  border-radius: 0.6875rem;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}
.ed-primary {
  display: flex;
  padding: 1.25rem 1.25rem 0;
}
button.ed-play {
  --_size: 3.25rem;
  flex: 1;
  margin: 0;
  gap: 0.625rem;
  font-size: 1rem;
  font-weight: 700;
}
/*
 * Download, queue, played, favorite: icon over a label, tinted when on.
 * (Not Beer's .transparent: it forces color: inherit.)
 */
.ed-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.875rem 0.75rem 0.5rem;
}
.ed-actions > button.ed-action {
  --_size: 4rem;
  --_padding: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 0.375rem;
  border-radius: 0.875rem;
  background: none;
  box-shadow: none;
  color: var(--on-surface);
  font-size: 0.78125rem;
  font-weight: 600;
  white-space: nowrap;
}
.ed-actions > button.ed-action.on {
  color: var(--primary);
}
/* No background on hover or after a tap; the icon pulses instead. */
.ed-actions > button.ed-action::after {
  display: none;
}
.ed-notes {
  padding: 1rem 1.25rem 0;
  border-top: 1px solid var(--surface-container);
}

/* Show notes (ui/notes.tsx): formatted text from a feed. */
.notes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--on-surface) 75%, var(--on-surface-variant));
  overflow-wrap: anywhere;
}
.notes > p {
  white-space: pre-line; /* line breaks within a paragraph */
}
.notes > h3 {
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  color: var(--on-surface-strong);
}
.notes strong {
  font-weight: 700;
  color: var(--on-surface-strong);
}
.notes > ul,
.notes > ol {
  display: block; /* Beer lays lists out as flex columns with no markers */
  padding-inline-start: 1.375rem;
}
.notes > ul {
  list-style: disc;
}
.notes > ol {
  list-style: decimal;
}
.notes li {
  display: list-item;
}
.notes li + li {
  margin-top: 0.25rem;
}
/* Beer makes links flex boxes; in running text they must flow inline. */
.notes a {
  display: inline;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.125em;
}
.notes a strong {
  color: inherit;
}

/*
 * Play/pause toggle (src/play_button.tsx). Beer turns pressed buttons into
 * rounded squares; keep it a circle (selectors outrank Beer's :active rule).
 */
button.play-toggle:not(.chip),
button.play-toggle:not(.chip):is(:active, .active) {
  border-radius: 50% !important;
  overflow: hidden;
}
/*
 * "plain": just the icon, with no filled circle, for tight spots like the
 * mini player. No tap flash either: the icon swap is the feedback.
 */
button.play-toggle.plain {
  --_size: 2.75rem;
  background: none;
  box-shadow: none;
  color: var(--on-surface);
}
button.play-toggle.plain::before {
  display: none;
}
/* The play and pause glyphs are small in their box: sized up to look as big
   as other 24px icons. */
button.play-toggle.plain > i {
  --_size: 2rem;
}
/* Tap flash, animated from JS (Element.animate on ::before). */
button.play-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
/* Pulses while audio is loading or downloading. */
button.play-toggle.buffering {
  animation: play-buffering 1s ease-in-out infinite alternate;
}
@keyframes play-buffering {
  to {
    opacity: 0.45;
  }
}
/*
 * The other buffering look ("spinner"): the filled circle shrinks to a disc
 * and its rim becomes a ring with a brighter arc going round. The ring is
 * drawn on Beer's state layer (::after), which this button doesn't use.
 */
button.play-toggle.buffering-spinner {
  --_ring: 0.1875rem;
  --_gap: 0.1875rem;
  background-color: transparent;
  background-image: radial-gradient(
    closest-side,
    var(--primary) calc(100% - var(--_ring) - var(--_gap) - 0.5px),
    transparent calc(100% - var(--_ring) - var(--_gap))
  );
}
/* With no circle to shrink, the ring simply goes round the icon. */
button.play-toggle.plain.buffering-spinner {
  --_ring: 0.125rem;
  background-image: none;
}
/* `.circle` is only there to outrank Beer's own rule for this layer. */
button.circle.play-toggle.buffering-spinner::after {
  display: block; /* .no-wave hides this layer */
  background: conic-gradient(
    var(--primary) 0 30%,
    color-mix(in srgb, var(--primary) 25%, transparent) 30% 100%
  );
  mask: radial-gradient(
    closest-side,
    transparent calc(100% - var(--_ring) - 0.5px),
    #000 calc(100% - var(--_ring))
  );
  opacity: 1;
  transition: none;
  animation: spin 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  button.circle.play-toggle.buffering-spinner::after {
    animation-duration: 4s;
  }
}
button.play-toggle[data-tapped] > .swap {
  animation: play-icon-in 0.2s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes play-icon-in {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-30deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  button.play-toggle[data-tapped] > .swap {
    animation: none;
  }
}

/*
 * Queue (ui/queue_screen.tsx)
 */
.screen-header.queue-header {
  align-items: flex-start;
}
.queue-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.queue-summary {
  font-size: 0.84375rem;
  color: var(--on-surface-variant);
}
#app > main.queue {
  padding-bottom: 1rem;
}
/* The episode in the player: a card, with its progress along the bottom. */
/* The card, and outside it the X that empties the player, in line with
   the X of each episode below. */
.queue-now {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0.5rem 0.25rem 0 1rem;
}
.queue-now-card {
  flex: 1;
  min-width: 0;
  /* Gently rounded: tighter corners would cut off the start of the progress. */
  border-radius: 0.75rem;
  background: var(--surface-container);
  overflow: hidden;
}
/* Beer makes every element inherit its parent's corner radius; without this
   the card's rounded corners would clip the title's first letters. */
.queue-now-row,
.queue-now-row * {
  border-radius: 0;
}
.queue-now-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 0.75rem 0.875rem 0.875rem;
}
a.queue-now-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Beer centers what's inside links */
  gap: 0.875rem;
  color: inherit;
  text-align: start;
}
.artwork.queue-now-art {
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
  font-size: 1.25rem;
}
.queue-now-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}
.queue-now-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}
.queue-now-title,
.queue-item-title {
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-surface-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.queue-now-title {
  font-size: 0.96875rem;
}
.queue-now-sub,
.queue-item-sub {
  font-size: 0.78125rem;
  color: var(--on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.play-toggle.queue-now-play {
  --_size: 3rem;
  margin: 0;
  flex-shrink: 0;
}
.queue-up-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 1.125rem 0.5rem 0.25rem 1.25rem;
}
.queue-up-next h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-surface-strong);
}
/* A text button. Not Beer's .transparent: it forces color: inherit. */
button.queue-clear {
  --_size: 2.75rem;
  --_padding: 0.75rem;
  margin: 0;
  background: none;
  box-shadow: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
}
button.queue-clear::after {
  display: none;
}
.queue-list {
  list-style: none;
  margin: 0 !important; /* over Beer's space above a list */
  padding: 0;
}
.queue-list > li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.25rem;
  background: var(--surface); /* covers the items it's dragged over */
}
/* While one is dragged (ui/reorder.ts), the others slide out of its way. */
.queue-list.reordering > li:not(.dragging) {
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}
.queue-list > li.dragging {
  position: relative;
  z-index: 1;
  border-radius: 0.75rem;
  background: var(--surface-container-high);
  box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 0.18);
}
button.queue-handle {
  --_size: 2.75rem;
  --_padding: 0;
  width: 2.25rem;
  margin: 0;
  flex-shrink: 0;
  border-radius: 0.625rem !important;
  background: none;
  box-shadow: none;
  color: var(--outline);
  cursor: grab;
  touch-action: none; /* a drag here moves the item, not the page */
}
button.queue-handle::after,
button.queue-item::after,
button.queue-remove::after {
  display: none;
}
button.queue-handle > i,
button.queue-remove > i {
  --_size: 1.25rem;
}
/* The episode itself: a button that plays it now. */
button.queue-item {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0.375rem 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  border-radius: 0.75rem !important;
  background: none;
  box-shadow: none;
  color: inherit;
  text-align: start;
  white-space: normal;
  -webkit-touch-callout: none;
  user-select: none;
}
.artwork.queue-art {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.625rem;
  font-size: 1.125rem;
}
/* Not the button's corners (see .queue-now-row): they'd clip the title's
   first letter. */
.queue-item-text,
.queue-item-sub,
.queue-item-title {
  border-radius: 0;
}
.queue-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1875rem;
}
.queue-item-sub {
  font-weight: 500;
}
.queue-item-title {
  font-size: 0.9375rem;
}
/* Under the title: how far it's been played, and whether it's downloaded. */
.queue-item-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.125rem;
}
.queue-item-status > .progress-mini {
  width: 3rem;
}
/* Downloaded: the Inbox's grey disc and tick, small enough for a line. */
.downloaded-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50% !important; /* over the corners Beer hands down */
  background: var(--surface-container-highest);
  color: var(--on-surface);
}
/* A download under way, there instead: how far it has got, as on the Inbox
   (greyed while it waits behind other downloads). */
.download-percent {
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
  font-size: 0.78125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.125rem;
  color: var(--primary);
}
.download-percent > i {
  --_size: 0.9375rem;
}
.download-percent.pending {
  color: var(--on-surface-variant);
  opacity: 0.7;
}
.downloaded-mark > i {
  --_size: 0.8125rem;
  font-weight: 700;
}
button.queue-remove {
  --_size: 2.75rem;
  margin: 0;
  flex-shrink: 0;
  color: var(--on-surface-variant);
}
button.queue-remove:is(:active, .active) {
  border-radius: 50% !important;
}
.queue-empty,
.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1.5rem 2rem 0.5rem;
  text-align: center;
}
.queue-empty-title,
.inbox-empty-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-surface-strong);
}
.queue-empty > p,
.inbox-empty > p {
  margin: 0 !important; /* over Beer's space above a paragraph */
  font-size: 0.90625rem;
  line-height: 1.5;
  color: var(--on-surface-variant);
}
/*
 * The peaceful dolphin from the design, floating with its eyes shut. It is
 * one drawing: on dark backgrounds, where its dark outline would be lost,
 * it gets a soft blue glow instead.
 */
.peaceful-dolphin {
  width: 7rem;
  height: 7rem;
  background: url("peaceful-dolphin.png") center / contain no-repeat;
}
body.dark :is(.peaceful-dolphin, .margarita-dolphin) {
  filter: drop-shadow(0 0 0.5rem rgb(110 165 225 / 0.55));
}
@media (prefers-color-scheme: dark) {
  body:not(.light) :is(.peaceful-dolphin, .margarita-dolphin) {
    filter: drop-shadow(0 0 0.5rem rgb(110 165 225 / 0.55));
  }
}
/*
 * The Inbox with no episodes at all: the dolphin from the design sipping a
 * margarita, laid out like the empty Queue and lit the same way in the dark.
 */
.inbox-empty {
  padding-top: 3rem;
}
.margarita-dolphin {
  /* Wider than the Queue's dolphin, to look its size: this one is lying down. */
  width: 9rem;
  aspect-ratio: 400 / 241;
  background: url("margarita-dolphin.png") center / contain no-repeat;
}

/* The end of the Inbox's list: the same dolphin, and a word. */
.inbox-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem 2rem;
}
.inbox-end > p {
  margin: 0 !important; /* over Beer's space above a paragraph */
  font-size: 0.90625rem;
  color: var(--on-surface-variant);
}

/*
 * Pulling the Inbox down to refresh (ui/pull_refresh.ts). The list keeps a
 * pull at its top to itself, so the browser neither reloads the page nor
 * stretches the list. The indicator waits out of sight above the list and
 * comes down with the finger, turning; its colour says when to let go.
 */
main.episode-list {
  overscroll-behavior-y: none;
}
.pull-indicator {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.pull-indicator > i {
  position: absolute;
  top: -2.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  box-shadow: 0 0.125rem 0.5rem rgb(0 0 0 / 0.3);
  opacity: var(--pull-show, 0);
  transform: translateY(var(--pull, 0)) rotate(var(--pull-turn, 0deg));
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.pull-indicator.pulling > i {
  transition: none;
}
.pull-indicator.armed > i {
  color: var(--primary);
}

/* More: settings, as sections of rows in cards. */
#app > main.more {
  padding-bottom: 1rem;
}
.more-card {
  margin: 0 1rem;
  border-radius: 1.125rem;
  background: var(--surface-container);
  overflow: hidden;
}
/* Beer makes every element inherit its parent's corner radius. */
.more-card * {
  border-radius: 0;
}
.about-app {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
}
.about-app-text {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  min-width: 0;
}
.about-app-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-surface-strong);
}
.about-app-tagline {
  font-size: 0.84375rem;
  line-height: 1.4;
  color: var(--on-surface-variant);
}
/* The app's icon: the dolphin in its headphones, on its navy badge. */
.about-app-icon {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  background: url("icon-192.png") center / contain no-repeat;
}
.more-rows {
  margin: 0;
}
.more-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0 1rem;
  border-top: 1px solid var(--surface-container-highest);
  font-size: 0.9375rem;
}
.more-row.first {
  border-top: 0;
}
.more-row dt,
.more-row-label {
  font-weight: 500;
  color: var(--on-surface-strong);
}
/* A row with a switch: all of it is the label, so a tap anywhere flips it. */
.more-row.more-switch {
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  cursor: pointer;
}
/* Out of use: what it depends on is turned off. */
.more-row.more-switch.off {
  opacity: 0.5;
  cursor: default;
}
/* The row's name, with small print under it about what it does. */
.more-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  min-width: 0;
}
.more-row-detail {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--on-surface-variant);
}
.more-switch > .switch {
  flex-shrink: 0;
}
/* Back from .more-card's square corners. */
.more-card .switch > span,
.more-card .switch > span::before,
.more-card .switch > span::after {
  border-radius: 2rem;
}
/* A row with a choice to make from a list: the system's own picker. */
.more-row.more-choice > select {
  max-width: 60%;
  padding: 0.375rem 0.25rem 0.375rem 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  text-align: end;
  cursor: pointer;
  /* No ring left round it once a choice is made. */
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.more-row.more-choice > select > option {
  background: var(--surface-container);
  color: var(--on-surface);
}
/* A row that opens a page: all of it is the button. */
.more-card button.more-link {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  margin: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
}
button.more-link > i {
  color: var(--on-surface-variant);
}
/* Backup & restore, and OPML import & export: what the page is for, then
   its two actions as rows of a card. */
.transfer-intro,
.transfer-result {
  margin: 0 !important; /* over Beer's space above a paragraph */
  padding: 0 1.25rem 1rem;
  font-size: 0.90625rem;
  line-height: 1.5;
  color: var(--on-surface-variant);
}
.transfer-result {
  padding-top: 1rem;
  color: var(--on-surface);
}
.more-card .transfer-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.875rem;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 3.25rem;
  margin: 0;
  padding: 0 1rem;
  background: none;
  box-shadow: none;
  color: inherit;
  text-align: start;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}
.more-card .transfer-action + .transfer-action {
  border-top: 1px solid var(--surface-container-highest);
}
.transfer-action:is(:disabled, .busy) {
  opacity: 0.55;
  cursor: default;
}
.transfer-action > i {
  color: var(--primary);
}
/* Asked before a backup takes the place of what's in the app. */
.transfer-confirm {
  margin: 1rem 1rem 0;
  padding: 1rem;
  border-radius: 1.125rem;
  border: 1.5px solid var(--error);
}
.transfer-confirm > p {
  margin: 0 !important; /* over Beer's space above a paragraph */
  font-size: 0.90625rem;
  line-height: 1.5;
  color: var(--on-surface);
}
.transfer-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.875rem;
}
.transfer-confirm-actions > button {
  margin: 0;
  font-weight: 600;
}
button.transfer-confirm-go {
  background: var(--error);
  color: var(--on-error);
}
.transfer-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--on-surface-strong);
}
/* Appearance: the themes, as chips of which one is chosen. */
.theme-options {
  display: flex;
  gap: 0.375rem;
  padding: 0.625rem 0;
}
.more-card .theme-options > .chip {
  --_padding: 0.875rem;
  border-radius: 1.125rem; /* back from .more-card's square corners */
}
.more-row dd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--on-surface-variant);
}
.version-number {
  font-variant-numeric: tabular-nums;
}
.more-row .version-beta {
  padding: 0.125rem 0.5rem;
  border-radius: 0.5625rem;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Home: short versions of the Queue, the Inbox and "Your shows". */
#app > main.home {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding-bottom: 1rem;
}
.section-heading.home-heading {
  align-items: center;
  padding: 0 0.5rem 0 1.25rem;
}
.home-heading > .heading-with-count {
  min-width: 0;
  align-items: center;
}
.home-heading h2 {
  font-size: 1.25rem;
}
.home-heading-detail {
  display: flex;
  font-size: 0.84375rem;
  white-space: nowrap;
}
button.home-see-all {
  --_size: 2.75rem;
  --_padding: 0.75rem;
  margin: 0;
  flex-shrink: 0;
  color: var(--primary) !important; /* over Beer's .transparent */
  font-size: 0.875rem;
  font-weight: 600;
}
.home-episodes {
  list-style: none;
  margin: 0 !important; /* over Beer's space above a list */
  padding: 0;
}
.home-episode {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem 0 1.25rem;
}
a.home-episode-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Beer centers what's inside links */
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: inherit;
  text-align: start;
}
.home-episode .episode-meta {
  margin-top: 0;
}
.home-episode-show {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.home-episode-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-surface-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Under a section's episodes: how many more its list has, which opens it. */
button.home-more {
  --_size: 2.25rem;
  --_padding: 0.75rem;
  display: flex;
  width: fit-content;
  margin: 0 0 0 0.5rem;
  gap: 0.375rem;
  color: var(--on-surface-variant) !important; /* over Beer's .transparent */
  font-size: 0.8125rem;
  font-weight: 600;
}
button.home-more > i {
  --_size: 1.25rem;
}
/* The play button: a 36px circle in a 44px tap target, as in the Inbox. */
.home-episode button.sd-play {
  --_size: 2.25rem;
  margin: 0;
}
/* The shows, in a row that scrolls sideways. */
.home-shows {
  display: flex;
  gap: 0.75rem;
  list-style: none;
  margin: 0 !important; /* over Beer's space above a list */
  padding: 0.375rem 1.25rem 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.home-shows > li {
  flex-shrink: 0;
  width: 5.5rem;
}
.home .section-empty {
  margin: 0 !important; /* over Beer's space above a paragraph */
  padding-top: 0.25rem;
}
