/* podcastdownloader — prototype stylesheet. Mobile first; breakpoints at 640px and 960px. */

:root {
  --bg: #f5f1ea;
  --bg-2: #ede7dc;
  --surface: #fffdf9;
  --surface-2: #f3eee6;
  --ink: #1a1714;
  --ink-2: #3b352e;
  --muted: #6e665b;
  --line: #e2dacd;
  --line-strong: #cfc5b5;
  --accent: #d13c13;           /* 4.6:1 with --on-accent */
  --accent-hover: #b8340f;
  --accent-soft: #fde4d9;
  --accent-ink: #b8340f;
  --on-accent: #fffaf5;
  --ok: #1d7a46;
  --ok-soft: #dcf1e3;
  --danger: #b3261e;
  --danger-soft: #fbe2df;
  --focus: #1f5eff;
  --shadow-sm: 0 1px 2px rgb(40 30 20 / .06), 0 1px 1px rgb(40 30 20 / .04);
  --shadow: 0 1px 2px rgb(40 30 20 / .05), 0 8px 24px -8px rgb(40 30 20 / .14);
  --shadow-lg: 0 24px 60px -16px rgb(40 30 20 / .28);

  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --gutter: 16px;
  --header-h: 60px;
  --dur: 180ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210;
    --bg-2: #1a1816;
    --surface: #1c1a17;
    --surface-2: #252220;
    --ink: #f4efe7;
    --ink-2: #ddd5c9;
    --muted: #a59c8f;
    --line: #2f2b27;
    --line-strong: #433d37;
    --accent: #ff6236;
    --accent-hover: #ff7a54;
    --accent-soft: #3a1d13;
    --accent-ink: #ff9b7c;
    --on-accent: #1a0d07;
    --ok: #5fd08f;
    --ok-soft: #14301f;
    --danger: #ff8a80;
    --danger-soft: #3a1714;
    --focus: #7aa2ff;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -10px rgb(0 0 0 / .6);
    --shadow-lg: 0 24px 60px -16px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131210; --bg-2: #1a1816; --surface: #1c1a17; --surface-2: #252220;
  --ink: #f4efe7; --ink-2: #ddd5c9; --muted: #a59c8f; --line: #2f2b27; --line-strong: #433d37;
  --accent: #ff6236; --accent-hover: #ff7a54; --accent-soft: #3a1d13; --accent-ink: #ff9b7c; --on-accent: #1a0d07;
  --ok: #5fd08f; --ok-soft: #14301f; --danger: #ff8a80; --danger-soft: #3a1714; --focus: #7aa2ff;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 72px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-accent { color: var(--accent); }

/* ------------------------------------------------------------- buttons */

.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; font-size: 15.5px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not([disabled]) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover:not([disabled]) { border-color: var(--ink-2); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover:not([disabled]) { background: var(--surface-2); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-sm { --h: 38px; padding: 0 14px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn .i { width: 19px; height: 19px; }
.btn.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

.btn-link { background: none; border: 0; padding: 4px 0; color: var(--accent-ink); font-weight: 600; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .i { width: 22px; height: 22px; }

.pro-tag, .pro-badge {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 6px;
  font: 800 10.5px/1.2 var(--font); letter-spacing: .06em;
  background: var(--accent-soft); color: var(--accent-ink);
}
.pro-badge { background: var(--accent); color: var(--on-accent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  text-decoration: none; font-size: 14.5px; font-weight: 550; color: var(--ink-2);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip .i { width: 16px; height: 16px; }

/* -------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
  padding-top: env(safe-area-inset-top);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand-mark { width: 32px; height: 32px; }
.brand-word { font: 600 17px/1 var(--display); letter-spacing: -0.02em; color: var(--ink-2); }
.brand-word b { font-weight: 800; color: var(--ink); }
.header-nav { display: none; gap: 4px; margin-left: 20px; }
.header-nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 550; font-size: 15px; transition: color var(--dur), background-color var(--dur); }
.header-nav a:hover { color: var(--ink); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.lang-switch { display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.lang-switch:hover { background: var(--surface-2); color: var(--ink); }
.lang-switch .i { width: 18px; height: 18px; }
.account-btn { --h: 40px; padding: 0 12px; gap: 6px; font-size: 15px; }
.account-btn .i { width: 19px; height: 19px; }
.account-label { display: none; }

.header-search { display: none; position: relative; flex: 1; max-width: 420px; margin-left: 16px; }
.header-search .i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.header-search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 15px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.header-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------------------------------------------------------------- hero */

.hero { padding: 36px 0 28px; }
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-title { margin-top: 18px; font-size: clamp(34px, 9vw, 64px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 15ch; }
.hero-sub { margin-top: 14px; max-width: 54ch; color: var(--muted); font-size: 17px; text-wrap: pretty; }

.search { width: 100%; max-width: 680px; margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.search-field { position: relative; }
.search-icon { position: absolute; left: 18px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 60px; padding: 0 52px 0 52px;
  border-radius: 18px; border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: 17px; box-shadow: var(--shadow);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--muted); opacity: .85; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow); }
.search-clear { position: absolute; right: 8px; top: 50%; translate: 0 -50%; }
.search-btn { --h: 56px; border-radius: 16px; font-size: 17px; }
.search-btn .i { width: 20px; height: 20px; }
.search.is-loading .search-btn span::after { content: "…"; }

.hero-brand { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2.4vw, 18px); font-size: clamp(38px, 10vw, 76px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; flex-wrap: wrap; }
.hero-brand em { font-style: normal; color: var(--accent); }
.hero-mark { width: 1em; height: 1em; flex: none; border-radius: .28em; box-shadow: var(--shadow); }
.hero-tagline { margin-top: 16px; max-width: 46ch; color: var(--ink-2); font-size: clamp(17px, 2.4vw, 20px); font-weight: 500; text-wrap: balance; }
.hero-checks { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; }
.hero-checks li { display: inline-flex; align-items: center; gap: 6px; }
.hero-checks .i { width: 17px; height: 17px; color: var(--ok); }
.hero-try { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 14.5px; }

/* ------------------------------------------------------------- results */

.results { padding-bottom: 24px; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.results-head h2 { font-size: 20px; }
.results-sources { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.src { display: inline-flex; align-items: center; gap: 5px; }
.src::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.src-ok::before { background: var(--ok); }
.src-error::before { background: var(--danger); }

.show-list { display: grid; gap: 10px; }
.show-card {
  display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 14px;
  padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.show-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.show-card:active { transform: scale(.99); }
.show-card img, .art-ph { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.show-card h3 { font: 700 16.5px/1.25 var(--font); letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.show-card .author { margin-top: 2px; font-size: 14.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.show-card .meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.show-card .chev { width: 20px; height: 20px; color: var(--muted); }
.badge-e { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--line-strong); color: var(--surface); font: 800 10px/1 var(--font); vertical-align: 1px; margin-right: 4px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; font-size: 15px;
}
.notice > .i { margin-top: 1px; color: var(--accent); flex: none; }
.notice-error > .i { color: var(--danger); }
.notice-body { flex: 1; display: grid; gap: 8px; justify-items: start; }
.notice p + p { color: var(--muted); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty h3 { color: var(--ink); font-size: 20px; }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--bg-2) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
.sk-line { height: 12px; margin: 8px 0; }
.sk-title { height: 22px; margin: 10px 0; width: 80%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.show-card.is-skeleton { pointer-events: none; }
.show-card.is-skeleton .sk-art { width: 72px; height: 72px; border-radius: 12px; }

/* recent */
.recent { padding-bottom: 8px; }
.section-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.eyebrow-h { font: 700 13px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.recent-list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.recent-list::-webkit-scrollbar { display: none; }
.recent-list li { flex: none; width: 104px; scroll-snap-align: start; }
.recent-list a { display: grid; gap: 6px; text-decoration: none; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.recent-list img, .recent-list .art-ph { width: 104px; height: 104px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow-sm); }
.recent-list span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------- home sections */

.section { padding-block: 48px; border-top: 1px solid var(--line); }
.home-info { margin-top: 24px; }
.section-title { font-size: clamp(26px, 6vw, 38px); max-width: 22ch; }
.section-sub { margin-top: 8px; color: var(--muted); }

.steps { margin-top: 24px; display: grid; gap: 12px; counter-reset: s; }
.steps li { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 800 16px/1 var(--display); }
.steps h3 { margin-top: 14px; font-size: 20px; }
.steps p { margin-top: 6px; color: var(--muted); }

.format-cards { margin-top: 24px; display: grid; gap: 12px; }
.format-card { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.fmt-tag { font: 700 13px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--accent-ink); background: var(--accent-soft); padding: 5px 8px; border-radius: 6px; }
.format-card h3 { margin-top: 14px; font-size: 22px; }
.format-card p { margin-top: 6px; color: var(--muted); }
.fine { margin-top: 16px; font-size: 14px; color: var(--muted); max-width: 70ch; }

.plans { margin-top: 24px; display: grid; gap: 12px; align-items: start; }
.plan-free, .plan-pro { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 16px; }
.plan-pro { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan-free h3, .plan-pro h3 { font-size: 22px; display: flex; align-items: center; gap: 6px; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price b { font: 800 36px/1 var(--display); letter-spacing: -0.03em; color: var(--ink); }
.price span span, .price > span { color: var(--muted); font-size: 15px; }
.checks { display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; }
.checks .i { width: 20px; height: 20px; color: var(--ok); margin-top: 1px; }

.pro-card { display: grid; gap: 16px; }
.billing-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); justify-self: start; }
.billing-toggle button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: 14.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; transition: background-color var(--dur), color var(--dur); }
.billing-toggle button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.save-tag { font-size: 11.5px; font-weight: 750; color: var(--ok); }
.pro-card[data-billing="year"] .price-month, .pro-card[data-billing="month"] .price-year { display: none; }
.pro-card .price > span { display: inline-flex; gap: 6px; align-items: baseline; }

.guides { margin-top: 20px; display: grid; gap: 8px; }
.guides a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 14px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; transition: border-color var(--dur); }
.guides a:hover { border-color: var(--ink-2); }
.guides .i { color: var(--muted); }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { margin-top: 16px; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative; font-weight: 650; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform var(--dur) var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 18px; color: var(--muted); max-width: 70ch; }

/* -------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); margin-top: 32px; }
.footer-row { display: grid; gap: 10px; color: var(--muted); font-size: 14px; }
.brand-sm .brand-mark { width: 26px; height: 26px; }
.brand-sm .brand-word { font-size: 15px; }
.footer-meta { font-size: 12.5px; opacity: .8; }
body[data-page="podcast"] .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------- show page */

.show-page { padding-top: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; margin: 4px 0 12px -6px; padding: 8px 10px 8px 4px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.back-link:hover { color: var(--ink); background: var(--surface-2); }

/* Show header in four groups: who (art, title, author, counts) → description → main actions → utilities.
   Phones: art + identity on one row, the rest full width. From 640px everything sits right of the art. */
.show-hero { display: grid; grid-template: "art info" "body body" / 112px minmax(0, 1fr); gap: 14px 16px; align-items: start; margin-bottom: 28px; }
.show-hero > .show-art { grid-area: art; }
.show-body { grid-area: body; min-width: 0; display: grid; gap: 14px; justify-items: start; }
.show-art { width: 112px; height: auto; aspect-ratio: 1; border-radius: 18px; object-fit: cover; background: var(--surface-2); box-shadow: var(--shadow); }
.show-info { grid-area: info; min-width: 0; display: grid; gap: 4px; align-content: start; }
.show-title { font-size: clamp(22px, 5.6vw, 40px); font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.show-author { color: var(--ink-2); font-weight: 550; }
.show-desc { color: var(--muted); font-size: 15.5px; max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.show-desc.is-open { -webkit-line-clamp: unset; display: block; }
.show-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.show-links { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: -4px; }
.show-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.show-link .i { width: 16px; height: 16px; color: var(--muted); }
.show-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.show-sources { font-size: 12.5px; color: var(--muted); margin-top: -8px; }
.show-stats { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.banner { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; padding: 12px 14px 12px 16px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 15px; }
.banner-actions { display: flex; gap: 6px; }

/* toolbar */
.toolbar {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 20;
  margin: 20px calc(-1 * var(--gutter)) 0; padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur);
}
.toolbar.is-stuck { border-bottom-color: var(--line); }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; min-width: 58px; height: 38px; padding: 0 12px; border-radius: 10px; font-weight: 750; font-size: 14.5px; letter-spacing: .02em; color: var(--muted); transition: background-color var(--dur), color var(--dur), box-shadow var(--dur); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.filter { position: relative; min-width: 0; }
.filter .i { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.filter input { width: 100%; height: 46px; padding: 0 12px 0 38px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; -webkit-appearance: none; appearance: none; }
.filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.toolbar-extra { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.sort-select { height: 38px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23887f73' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; font-size: 14.5px; font-weight: 600; -webkit-appearance: none; appearance: none; color: var(--ink-2); }
.toolbar .btn-sm { --h: 38px; }
.fmt-hint { margin: 10px 0 4px; font-size: 13.5px; color: var(--muted); }
.list-count { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }

/* episodes */
.episodes { display: grid; gap: 10px; margin-top: 10px; }
.ep {
  position: relative; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
  scroll-margin-top: calc(var(--header-h) + 130px);
}
.ep.is-skeleton { padding: 18px; }
.ep.is-focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ep.is-selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.ep.is-playing { border-color: var(--line-strong); box-shadow: var(--shadow); }
.ep-main { display: grid; grid-template-columns: 1fr; gap: 4px; }
.ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ep-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-ok .i { width: 13px; height: 13px; }
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.ep-title { font: 700 17.5px/1.3 var(--font); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ep-desc { margin-top: 2px; font-size: 14.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ep-desc.is-open { -webkit-line-clamp: unset; display: block; }

.ep-check { display: none; }
.select-mode .ep { padding-left: 56px; cursor: pointer; }
.select-mode .ep-check { display: grid; place-items: center; position: absolute; left: 10px; top: 14px; width: 40px; height: 40px; }
.ep-check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; transition: background-color var(--dur), border-color var(--dur); cursor: pointer; }
.ep-check input:checked { background: var(--accent); border-color: var(--accent); }
.ep-check input:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }

.ep-actions { margin-top: 14px; display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
.ep-actions .btn { --h: 46px; padding: 0 12px; }
.ep-actions .size { font-weight: 500; opacity: .75; font-size: 13.5px; }
.select-mode .ep-actions { display: none; }

/* download panel */
.dl { margin-top: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); display: grid; gap: 10px; animation: rise var(--dur) var(--ease); }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dl-label { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.dl-label .i { width: 18px; height: 18px; flex: none; }
.dl-pct { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14.5px; }
.dl-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); border-radius: inherit; transition: width 200ms linear; }
.bar.is-indeterminate > i { width: 35%; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.dl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-actions .btn { --h: 44px; }
.dl.is-ready { background: var(--ok-soft); }
.dl.is-ready .dl-label { color: var(--ok); }
.dl.is-error { background: var(--danger-soft); }
.dl.is-error .dl-label { color: var(--danger); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }

/* player */
.player { margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--ink); color: var(--bg); display: grid; gap: 6px; animation: rise var(--dur) var(--ease); }
.pl-time { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; opacity: .85; }
.pl-seek { --p: 0; --b: 0; --track: color-mix(in srgb, currentColor 16%, transparent); --buffered: color-mix(in srgb, currentColor 32%, transparent); -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
.pl-seek::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(to right, var(--accent) calc(var(--p) * 100%), var(--buffered) calc(var(--p) * 100%), var(--buffered) calc(var(--b) * 100%), var(--track) calc(var(--b) * 100%)); }
.pl-seek::-moz-range-track { height: 5px; border-radius: 99px; background: var(--track); }
.pl-seek::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--accent); }
.pl-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--ink); margin-top: -6.5px; box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.pl-seek::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid var(--ink); border-radius: 50%; background: var(--accent); }
.pl-controls { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 6px; }
.pl-controls .icon-btn { color: inherit; width: 48px; height: 48px; }
.pl-controls .icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.pl-controls .icon-btn .i { width: 26px; height: 26px; }
.pl-play { width: 58px !important; height: 58px !important; background: var(--accent) !important; color: var(--on-accent) !important; }
.pl-play .i { width: 26px !important; height: 26px !important; }
.pl-left, .pl-right { display: flex; gap: 2px; }
.pl-right { justify-content: flex-end; }
.pl-speed { min-width: 48px; height: 36px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, currentColor 35%, transparent); background: transparent; color: inherit; font-weight: 750; font-size: 13.5px; font-variant-numeric: tabular-nums; padding: 0 8px; }
.pl-speed:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.pl-controls .pl-close .i, .pl-controls .pl-mute .i { width: 21px; height: 21px; }
.pl-status { font-size: 12.5px; opacity: .75; text-align: center; }
.pl-status:empty { display: none; }
.player.is-loading .pl-play .i { opacity: 0; }
.player.is-loading .pl-play::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--on-accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.pl-play { position: relative; }

.load-more { margin: 16px auto 0; display: flex; }
.list-end { text-align: center; color: var(--muted); font-size: 14px; padding: 20px 0; }

/* batch bar */
.batch-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -12px rgb(0 0 0 / .25); animation: up var(--dur) var(--ease); }
.batch-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "count all" "go go"; gap: 8px; align-items: center; }
.batch-count { grid-area: count; font-weight: 700; }
[data-batch-all] { grid-area: all; }
[data-batch-go] { grid-area: go; }
@keyframes up { from { transform: translateY(100%); } }

/* -------------------------------------------------------------- dialogs */

.dlg {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 24px; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.dlg::backdrop { background: rgb(20 15 10 / .45); backdrop-filter: blur(3px); }
.dlg[open] { animation: pop var(--dur) var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg h2 { font-size: 26px; display: flex; align-items: center; gap: 8px; }
.dlg-sub { margin: 6px 0 18px; color: var(--muted); }
.dlg-close-form { position: absolute; right: 10px; top: 10px; }
.dlg-reason { margin: 0 40px 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 14.5px; }
.dlg-reason:empty { display: none; }
.dlg .pro-card { margin-bottom: 8px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14.5px; }
.field input { height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 16px; font-weight: 400; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.signin-form { display: grid; gap: 12px; }
.form-msg { font-size: 14px; color: var(--muted); min-height: 0; }
.form-msg.is-error { color: var(--danger); }
.form-msg.is-ok { color: var(--ok); font-weight: 600; }
.demo-toggle { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line-strong); display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; cursor: pointer; }
.demo-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.demo-toggle small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background-color var(--dur); margin-top: 2px; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease); }
.demo-toggle input:checked + .switch { background: var(--accent); }
.demo-toggle input:checked + .switch::after { transform: translateX(18px); }
.demo-toggle input:focus-visible + .switch { outline: 2.5px solid var(--focus); outline-offset: 2px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
body:has(.batch-bar:not([hidden])) .toasts { bottom: calc(120px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; padding: 13px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 550; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: toast-in var(--dur) var(--ease); }
.toast .i { width: 18px; height: 18px; color: var(--accent); }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity var(--dur), transform var(--dur); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------- breakpoints */

@media (min-width: 640px) {
  :root { --gutter: 24px; --header-h: 66px; }
  .hero { padding: 64px 0 40px; }
  .search { flex-direction: row; padding: 6px; border-radius: 22px; background: var(--surface); border: 1.5px solid var(--line-strong); box-shadow: var(--shadow); transition: border-color var(--dur), box-shadow var(--dur); }
  .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow); }
  .search-field { flex: 1; }
  .search input { border: 0; box-shadow: none !important; height: 56px; background: transparent; }
  .search-btn { --h: 56px; padding: 0 24px; }
  .account-label { display: inline; }
  .show-card { grid-template-columns: 88px 1fr auto; padding: 14px; }
  .show-card img, .show-card .art-ph, .show-card.is-skeleton .sk-art { width: 88px; height: 88px; }
  .steps, .format-cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: 1fr 1fr; }
  .show-hero { grid-template: "art info" auto "art body" 1fr / 180px minmax(0, 1fr); gap: 16px 24px; }
  .show-art { width: 180px; border-radius: 22px; }
  .toolbar { grid-template-columns: auto minmax(0, 1fr) auto; margin-inline: 0; padding-inline: 0; }
  .toolbar-extra { grid-column: auto; }
  .ep { padding: 18px 20px; }
  .ep-actions { grid-template-columns: auto auto; justify-content: start; }
  .ep-actions .btn { padding: 0 18px; }
  .batch-row { grid-template-columns: 1fr auto auto; grid-template-areas: "count all go"; }
  .footer-row { grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
  .select-mode .ep { padding-left: 60px; }
}

@media (min-width: 960px) {
  .header-nav { display: flex; }
  .header-search { display: block; }
  .ep { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; }
  .ep > .dl, .ep > .player, .ep > [data-job], .ep > [data-clip] { grid-column: 1 / -1; }
  .ep-actions { margin-top: 2px; grid-template-columns: auto auto; }
  .player { grid-template-columns: 1fr; padding: 10px 16px; }
  .pl-controls { grid-template-columns: auto auto auto 1fr auto; }
  .pl-left { order: 3; justify-content: flex-end; }
  .pl-right { order: 4; }
  .show-hero { grid-template-columns: 220px minmax(0, 1fr); column-gap: 32px; }
  .show-art { width: 220px; }
}


/* phones: six player controls must fit in ~300px */
@media (max-width: 639px) {
  .pl-controls { gap: 2px; }
  .pl-controls .icon-btn { width: 44px; height: 44px; }
  .pl-controls .icon-btn .i { width: 24px; height: 24px; }
  .pl-play { width: 52px !important; height: 52px !important; }
  .pl-speed { min-width: 42px; padding: 0 6px; }
  .pl-controls .pl-close, .pl-controls .pl-mute { width: 40px; height: 40px; }
}

/* listener scenarios (PLAN.md §7) */
.subs { padding-bottom: 12px; }
.subs-list { margin-top: 10px; display: grid; gap: 8px; }
.subs-list li { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.subs-list img, .subs-list .art-ph { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.subs-list b { display: block; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.subs-state { font-size: 13px; color: var(--muted); }
.subs-list li.has-new .subs-state { color: var(--accent-ink); font-weight: 700; }

.fmt-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-top: 10px; }
.fmt-row .fmt-hint { margin: 0; }
.naming { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.name-preview { margin: 4px 0 0; font: 500 12.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); overflow-wrap: anywhere; }
.range-bar { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px dashed var(--line-strong); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.range-bar label { display: inline-flex; align-items: center; gap: 6px; }
.range-bar input { height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 15px; }
.batch-status { margin-top: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-strong); display: grid; gap: 10px; box-shadow: var(--shadow-sm); }
.batch-status.has-failed { border-color: var(--danger); }
.bs-failed { color: var(--danger); }
.dl-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.dl-hint .i { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.dl-file { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.batch-folder { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.batch-row .batch-folder { grid-area: folder; }
.batch-folder input { width: 18px; height: 18px; accent-color: var(--accent); }
.batch-row { grid-template-areas: "count all" "folder folder" "go go"; }
@media (min-width: 640px) {
  .batch-row { grid-template-columns: 1fr auto auto auto; grid-template-areas: "count all folder go"; }
}


/* ---------------------------------------------- ported from mockup/ (compact rows, save card, player) */

/* episode list: one surface, rows separated by hairlines */
.episodes { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ep { border: 0; border-radius: 0; background: transparent; padding: 14px 16px; border-top: 1px solid var(--line); }
.ep:first-child { border-top: 0; }
.ep.is-focus { border-color: var(--line); box-shadow: none; background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.ep.is-selected { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.ep.is-playing { box-shadow: inset 4px 0 0 var(--ink-2); }
.ep.is-skeleton { border-top: 1px solid var(--line); }
.ep-title { font-size: 16.5px; line-height: 1.3; }
.ep-meta { margin-top: 3px; }
.ep-size { font-variant-numeric: tabular-nums; }
.ep-desc { -webkit-line-clamp: unset; display: block; margin-top: 4px; }
.ep-desc[hidden] { display: none; }
.ep-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; grid-template-columns: none; }
.ep-actions .btn { --h: 42px; padding: 0 14px; font-size: 14.5px; }
.fmt-badge { font: 750 11.5px/1 var(--font); letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; background: color-mix(in srgb, var(--on-accent) 22%, transparent); }
@media (min-width: 960px) {
  .ep { padding: 14px 20px; align-items: center; }
  .ep-actions { margin-top: 0; flex-wrap: nowrap; }
}

/* save card: native radios + one wide action */
.dl { gap: 10px; }
.fmt-choices { display: flex; gap: 8px; }
.fmt-choice { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color var(--dur), background-color var(--dur); }
.fmt-choice.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.fmt-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.fmt-choice b { font-size: 16px; }
.fmt-choice small { color: var(--muted); font-size: 12px; font-weight: 600; }
.fmt-choice:has(input:disabled) { opacity: .6; cursor: default; }
.dl-label { justify-content: flex-start; flex-wrap: nowrap; align-items: flex-start; }
.dl-label .i, .dl-label .spin { margin-top: 2px; }
.dl-label .dl-pct { margin-left: auto; }
.dl .btn-block { --h: 50px; font-size: 16px; }
.dl-file { font: 500 12.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); overflow-wrap: anywhere; }
.dl-actions .btn-sm { --h: 40px; }

/* player: transport | timeline | speed | volume; on phones the timeline sits on top */
.player { padding: 8px 14px 10px; gap: 4px; }
.pl-controls { display: flex; align-items: center; gap: 4px; }
.pl-controls .pl-play { margin: 0 2px; }
.pl-controls .icon-btn:disabled { opacity: .4; cursor: default; }
.pl-rate { margin-left: auto; position: relative; display: grid; }
.pl-rate select { -webkit-appearance: none; appearance: none; height: 40px; min-width: 56px; padding: 0 22px 0 10px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, currentColor 35%, transparent); background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; color: inherit; font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.pl-rate select option { color: #1a1714; }
.pl-seek:disabled { opacity: .5; cursor: default; }
@media (min-width: 960px) {
  /* one row on laptops: transport first, then the timeline, then speed and volume */
  .player { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; }
  .player .pl-controls { display: contents; }
  .player .pl-back { order: 1; } .player .pl-play { order: 2; } .player .pl-fwd { order: 3; }
  .player .pl-time { order: 4; flex: 1 1 240px; margin: 0 8px; }
  .player .pl-rate { order: 5; margin-left: 0; }
  .player .pl-mute { order: 6; }
  .player .pl-status { order: 7; flex-basis: 100%; }
}

/* mobile menu (details/summary), only below the desktop nav breakpoint */
.mobile-menu { position: relative; }
.mobile-menu summary { list-style: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary:hover, .mobile-menu[open] summary { background: var(--surface-2); }
.mobile-menu nav { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; z-index: 50; animation: pop var(--dur) var(--ease); }
.mobile-menu nav a, .mobile-menu nav button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: none; text-decoration: none; font-weight: 600; font-size: 15.5px; text-align: left; }
.mobile-menu nav :is(a, button):hover { background: var(--surface-2); }
@media (min-width: 960px) { .mobile-menu { display: none; } }

.all-panel { margin-top: 16px; }
.all-panel .notice-body { gap: 10px; }
.all-panel .dl-actions { margin-top: 2px; }
.all-panel .batch-folder { margin-top: 2px; }

/* Spotify-only result */
.sp-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.sp-card img { width: 88px; height: 88px; border-radius: 14px; object-fit: cover; flex: none; }
.sp-card h2 { font-size: 20px; }
.sp-card p { color: var(--muted); }

/* maintenance page + admin preview strip */
.maintenance-body { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.maintenance { max-width: 520px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.maintenance img { border-radius: 16px; box-shadow: var(--shadow); }
.maintenance h1 { font-size: clamp(30px, 7vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.maintenance-msg { color: var(--muted); font-size: 17px; text-wrap: pretty; }
.admin-preview { position: sticky; top: 0; z-index: 60; padding: 8px 16px; background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; text-align: center; }
.admin-preview a { color: inherit; }


/* hero sizing per review: the search, not the title, carries the first screen */
.hero { padding: 24px 0 20px; }
.hero-brand { display: block; font-size: clamp(30px, calc(14px + 5vw), 56px); line-height: 1.08; letter-spacing: -0.035em; }
.hero-brand em { color: inherit; }
.hero-mark { display: none; }
.hero-tagline { margin-top: 10px; font-size: clamp(16px, 2vw, 18px); line-height: 1.4; }
.hero .search { margin-top: 20px; }
.hero-checks { margin-top: 12px; gap: 6px 12px; font-size: 14px; }
.hero-try { margin-top: 12px; }
@media (max-width: 639px) { .hero-try .chip { min-height: 44px; } }
@media (min-width: 640px) { .hero { padding: 48px 0 32px; } .hero .search { margin-top: 24px; } }

/* -------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .sk { animation: none; }
  .bar.is-indeterminate > i { animation: none; width: 100%; opacity: .4; }
}

/* clip: scissors in the transport row, a row with Start / End / Save, the range under the timeline */
.pl-track { position: relative; display: block; min-width: 0; }
.pl-sel { position: absolute; left: calc(var(--cs, 0) * 100%); width: max(3px, calc((var(--ce, 0) - var(--cs, 0)) * 100%)); bottom: 1px; height: 3px; border-radius: 2px; background: var(--accent); opacity: 0; pointer-events: none; }
.has-clip .pl-sel { opacity: 1; }
.pl-controls .pl-clip .i { width: 21px; height: 21px; }
.pl-controls .pl-clip.is-active { background: color-mix(in srgb, currentColor 14%, transparent); }
.pl-cliprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.pl-cliprow[hidden] { display: none; }
.pl-mark { height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, currentColor 35%, transparent); background: transparent; color: inherit; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.pl-mark b { font-variant-numeric: tabular-nums; margin-left: 4px; }
.pl-mark:hover:not(:disabled) { background: color-mix(in srgb, currentColor 10%, transparent); }
.pl-mark:disabled { opacity: .45; cursor: default; }
.pl-clen { font-size: 12.5px; opacity: .75; flex: 1 1 140px; }
.pl-cliprow .pl-clip-save { margin-left: auto; }
@media (min-width: 960px) {
  .player .pl-clip { order: 7; }
  .player .pl-cliprow { order: 8; flex-basis: 100%; }
  .player .pl-status { order: 9; }
}

/* sign-in: invalid field, busy button, "Check your inbox" panel */
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--danger-soft); }
.form-msg:empty { display: none; }
.btn[aria-busy="true"] { opacity: 1; cursor: progress; }
.btn .spin[hidden] { display: none; }
.signin-sent { display: grid; gap: 8px; justify-items: start; outline: none; }
.signin-sent[hidden] { display: none; }
.sent-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 4px; }
.sent-mark .i { width: 24px; height: 24px; }
.signin-sent h3 { font-size: 19px; }
.sent-body { font-size: 15.5px; overflow-wrap: anywhere; }
.sent-tip { font-size: 14px; color: var(--muted); }
.sent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sent-actions .btn { font-variant-numeric: tabular-nums; }
.dlg.is-sent .dlg-sub, .dlg.is-sent .demo-toggle { display: none; }
.dlg.is-sent > h2 { display: none; }
.auth-body { padding: 24px 16px; justify-content: center; align-items: center; }
.auth-card { flex: none; width: min(100%, 440px); padding: 28px; display: grid; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.auth-card h1 { font-size: 28px; }
.tag .i { width: 13px; height: 13px; }

/* --------------------------------------------------------------- library */

.lib-link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.lib-link:hover, .lib-link.is-current { background: var(--surface-2); color: var(--ink); }
.lib-link .i { width: 19px; height: 19px; }
@media (max-width: 639px) { .lib-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .lib-link { padding: 0 10px; } }

.lib-page { padding-top: 24px; padding-bottom: 56px; }
.lib-page > * { max-width: 880px; }
.lib-head { display: grid; gap: 6px; justify-items: start; margin-bottom: 8px; }
.lib-head h1 { font-size: clamp(30px, 6vw, 44px); letter-spacing: -0.03em; }
.lib-sub { color: var(--muted); max-width: 60ch; }
.lib-head .btn-link { font-size: 15px; }
.lib-sec { padding-block: 32px; }
.lib-sec + .lib-sec { border-top: 1px solid var(--line); }
.lib-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.lib-sec-head h2 { font-size: 24px; letter-spacing: -0.02em; }
.lib-sec-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.lib-sec-tools .seg button { min-width: 52px; height: 34px; }
.lib-total { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-loading { display: grid; place-items: center; padding: 32px; color: var(--muted); }
.lib-checking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14.5px; margin-bottom: 12px; }

.lib-card { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.lib-promo { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; }
.lib-promo h3 { font-size: 18px; }
.lib-promo p { color: var(--muted); margin-top: 2px; }
.lib-promo .btn { grid-column: 2; justify-self: start; }
.lib-promo-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); }
.lib-promo-mark .i { width: 22px; height: 22px; }
@media (min-width: 640px) { .lib-promo { grid-template-columns: auto 1fr auto; } .lib-promo .btn { grid-column: auto; } }

.lib-empty { display: grid; gap: 6px; justify-items: start; padding: 4px 0 8px; color: var(--muted); }
.lib-empty-t { color: var(--ink); font-weight: 650; font-size: 16px; }
.lib-empty .btn { margin-top: 8px; }
.lib-empty-ok { grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.lib-empty-ok > .i { width: 20px; height: 20px; color: var(--ok); grid-row: span 2; }
.lib-note { display: flex; align-items: center; gap: 6px; font-size: 14px; }

.new-group { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.new-group + .new-group { margin-top: 12px; }
.new-group-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.new-group-head img, .new-group-head .art-ph { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.new-group-t { display: grid; min-width: 0; }
.new-group-t a { font-weight: 700; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-group-t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.new-group-t span { font-size: 13px; color: var(--accent-ink); font-weight: 650; }
.new-list { list-style: none; margin: 0; padding: 0; }
.new-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; }
.new-row + .new-row { border-top: 1px solid var(--line); }
.new-row-t { font-weight: 600; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.new-row-m { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.new-row-state { display: flex; justify-content: flex-end; min-width: 92px; }
.new-prog { display: grid; gap: 4px; width: 110px; justify-items: end; }
.new-prog .bar { width: 100%; height: 5px; }
.new-pct { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.new-err { display: inline-flex; align-items: center; gap: 5px; color: var(--danger); font-size: 13.5px; font-weight: 600; }
.new-err .i { width: 16px; height: 16px; }
[data-new-status] .batch-status { margin-top: 16px; }

.lib-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.lib-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; min-height: 72px; }
.lib-item + .lib-item { border-top: 1px solid var(--line); }
.lib-item img, .lib-item .art-ph { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.lib-history .lib-item { grid-template-columns: 40px minmax(0, 1fr) auto; min-height: 64px; }
.lib-history .lib-item img, .lib-history .lib-item .art-ph { width: 40px; height: 40px; border-radius: 9px; }
.lib-item-main { min-width: 0; }
.lib-item-t { display: block; font-weight: 650; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item-t:hover { text-decoration: underline; text-underline-offset: 3px; }
.lib-item-m { font-size: 13.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta-new { color: var(--accent-ink); font-weight: 650; }
.lib-meta-err { color: var(--danger); }
.lib-item-actions { display: flex; gap: 6px; }
.lib-item.is-confirm { grid-template-columns: minmax(0, 1fr) auto; background: var(--danger-soft); }
.lib-confirm-q { font-weight: 600; overflow-wrap: anywhere; }
.lib-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
@media (max-width: 479px) {
  .lib-item.is-confirm { grid-template-columns: 1fr; }
  .new-row { grid-template-columns: 1fr; }
  .new-row-state { justify-content: flex-start; }
}

.lib-alerts { display: grid; gap: 0; padding: 4px 18px; }
.lib-alerts-sub { color: var(--muted); padding: 12px 0 4px; }
.lib-pref { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 16px 0; }
.lib-pref + .lib-pref { border-top: 1px solid var(--line); }
.lib-pref > div:first-child { flex: 1 1 260px; min-width: 0; }
.lib-pref-t { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.lib-pref-t .i { width: 18px; height: 18px; color: var(--muted); }
.lib-pref-h { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.lib-pref-h.is-error { color: var(--danger); }
.lib-pref-ctl { display: flex; align-items: center; gap: 10px; }
.lib-pref .seg button { min-width: 0; height: 34px; padding: 0 12px; }
.switch-row { display: inline-flex; cursor: pointer; position: relative; }
.switch-row input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.switch-row.is-disabled { cursor: not-allowed; opacity: .5; }
.switch-row .switch { margin-top: 0; }
.new-group-t span.is-done { color: var(--ok); }

/* ------------------------------------------------------------- motion */
/* A utility: short, plain entrances only where new content appears; no blur, stagger or lift. */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes check-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.reveal { animation: enter .3s var(--ease-out) both; }
.results > .results-head, .results > .notice, .results > .empty, .results > .sp-card { animation: enter .4s var(--ease-out) both; }
.signin-sent, .dl-clip { animation: enter .3s var(--ease-out) both; }
.tag-ok .i, .dl.is-ready .dl-label > .i { animation: check-pop .45s var(--ease-out) both; }
.show-card { transition: border-color var(--dur), background-color var(--dur); }
.show-card:hover .chev { transform: translateX(3px); }
.show-card .chev { transition: transform var(--dur) var(--ease); }
.dlg::backdrop { animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }

.opening-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; padding: 4px 2px; }
.opening-line .spin { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .signin-sent, .dl-clip, .results > * { animation: none !important; }
}

/* top podcasts now: a grid of covers with the chart position */
.top { padding-top: 20px; padding-bottom: 12px; }
.top-where { font-size: 13px; color: var(--muted); }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 18px 14px; }
.top-list a { display: grid; gap: 3px; text-decoration: none; color: var(--ink); }
.top-art { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); margin-bottom: 6px; }
.top-art img, .top-art .art-ph { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease-out); }
.top-rank { position: absolute; left: 6px; bottom: 6px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 9px; display: grid; place-items: center; background: rgb(15 12 10 / .78); color: #fff; font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; backdrop-filter: blur(6px); }
.top-t { font-weight: 650; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.top-a { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 479px) { .top-t { font-size: 13px; } }

/* ---------------------------------------------------------------- guides */
.guide-page { padding-top: 8px; padding-bottom: 56px; }
.guide { max-width: 680px; }
.guide h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; margin-top: 8px; }
.guide-intro { margin-top: 16px; font-size: 18px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.guide-steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 0; counter-reset: none; }
.guide-steps li { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding-bottom: 22px; }
.guide-steps li:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--line); }
.guide-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font: 750 15px/1 var(--font); font-variant-numeric: tabular-nums; }
.guide-steps p { font-size: 17px; line-height: 1.55; padding-top: 5px; text-wrap: pretty; }
.guide-notes { margin-top: 12px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.guide-notes h2 { font-size: 16px; margin-bottom: 8px; }
.guide-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); line-height: 1.5; }
.guide-cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.guide-cta p { font-weight: 600; }
.guide-more { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); max-width: 680px; }
.guide-more h2 { font-size: 20px; margin-bottom: 12px; }
.guide-notes ul { list-style: disc; }
.guide-notes li::marker { color: var(--muted); }
/* 24 shows: 8 × 3 on laptops, 6 × 4 on tablets, one swipeable row on phones */
.top-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (min-width: 960px) { .top-list { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .top-list { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .top-list::-webkit-scrollbar { display: none; }
  .top-list li { flex: none; width: 116px; scroll-snap-align: start; }
}
/* phones: the language moves into the menu so the header keeps brand, library, account and menu */
.menu-lang { border-top: 1px solid var(--line); margin-top: 4px; }
.menu-lang .i { width: 18px; height: 18px; color: var(--muted); }
@media (min-width: 640px) { .menu-lang { display: none !important; } }
@media (max-width: 639px) {
  .header-actions .lang-switch { display: none; }
  .header-actions { gap: 0; }
}
.results.no-anim > *, .results.no-anim .reveal { animation: none; }
/* guide screenshots: iPhone frames captured in the simulator, light/dark by the visitor's theme */
.guide-step { min-width: 0; }
.guide-shots { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.guide-shots img { display: block; width: min(240px, 100%); height: auto; aspect-ratio: 1206 / 2622; border-radius: 28px; border: 1px solid var(--line-strong); box-shadow: var(--shadow); background: var(--surface-2); }
@media (max-width: 479px) { .guide-shots img { width: min(200px, 100%); } .guide-shots { gap: 10px; } }

/* batch item: one quiet line under the episode instead of the full save card */
.dl-mini { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.dl-mini .spin { width: 14px; height: 14px; color: var(--accent); }
.dl-mini > .i { width: 16px; height: 16px; }
.dl-mini-t { font-weight: 600; white-space: nowrap; }
.dl-mini .dl-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-mini .dl-pct { font-variant-numeric: tabular-nums; color: var(--muted); }
.dl-mini-x { width: 30px; height: 30px; color: var(--muted); }
.dl-mini-x .i { width: 16px; height: 16px; }
.dl-mini .bar { grid-column: 1 / -1; height: 3px; }
.dl-mini.is-ok { grid-template-columns: auto auto minmax(0, 1fr); color: var(--ok); }
.dl-mini.is-error { grid-template-columns: auto minmax(0, 1fr) auto; color: var(--danger); }
.dl-mini.is-error .dl-mini-t { white-space: normal; font-weight: 550; }
@media (max-width: 479px) { .dl-mini .dl-sub { display: none; } .dl-mini { grid-template-columns: auto minmax(0, 1fr) auto auto; } }

/* batch destination choice (folder / ZIP / files) and ZIP parts in the batch box */
.batch-modes { display: grid; gap: 8px; width: 100%; max-width: 560px; }
.batch-mode { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color var(--dur), background-color var(--dur); }
.batch-mode:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.batch-mode input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.batch-mode b { display: block; font-size: 15px; }
.batch-mode small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }
.zip-parts { display: grid; gap: 6px; }
.zip-parts li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.zip-parts li.is-done { color: var(--ink-2); }
.zip-parts li.is-done > .i { width: 16px; height: 16px; color: var(--ok); }
.zip-parts .btn-link { font-size: 13.5px; }
.zip-blocked { font-size: 13.5px; color: var(--accent-ink); font-weight: 600; }
/* episode meta: size and Saved tags are items of the same line (one gap, one baseline, dot separators) */
.ep-meta [data-saved] { display: contents; }
.ep-meta .tag { line-height: 1.5; }
.ep-meta [data-saved] .tag:first-of-type { margin-left: 2px; }

/* episode notes: a small disclosure at the end of the meta line instead of a "More" line of its own */
.ep-notes { display: inline-flex; align-items: center; gap: 3px; min-height: 28px; margin: -6px 0 -6px 2px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.ep-notes:hover { background: var(--surface-2); color: var(--ink); }
.ep-notes .i { width: 14px; height: 14px; transform: rotate(180deg); transition: transform var(--dur) var(--ease); }
.ep-notes[aria-expanded="true"] .i { transform: none; }
.ep-desc { margin-top: 6px; max-width: 72ch; line-height: 1.5; }
.select-mode .ep-notes, .select-mode .ep-desc { display: none; }
@media (pointer: coarse) { .ep-notes { min-height: 36px; margin-block: -10px; } }
.ep-desc { white-space: pre-line; }
.ep-desc[aria-busy="true"] { opacity: .6; }
@media (min-width: 960px) { .ep > .ep-actions { align-self: start; } }   /* stay beside the title when notes open */

/* footer legal links */
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* legal pages: a reading column */
.legal-page { padding-top: 32px; padding-bottom: 64px; }
.legal { max-width: 680px; }
.legal h1 { font-size: clamp(30px, 6vw, 44px); letter-spacing: -0.03em; line-height: 1.1; }
.legal-updated { margin-top: 8px; color: var(--muted); font-size: 14px; }
.legal-intro { margin-top: 20px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.legal section { margin-top: 28px; }
.legal h2 { font-size: 19px; letter-spacing: -0.01em; }
.legal section p { margin-top: 8px; line-height: 1.6; color: var(--ink-2); }

/* account dialog: data rights */
.acc-danger { color: var(--danger); }
.acc-delete { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border-radius: var(--r); background: var(--danger-soft); }
.acc-delete[hidden] { display: none; }
.acc-delete p { font-size: 14px; line-height: 1.5; }
.acc-danger-btn { background: var(--danger); color: #fff; border-color: transparent; }

/* Turnstile card: only shown when Cloudflare asks for an interaction */
.human-check { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 70; display: grid; gap: 10px; justify-items: center; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 14.5px; text-align: center; max-width: calc(100vw - 24px); }
.human-check[hidden] { display: none; }

/* toast action (Undo) */
.toast-act { margin-left: auto; padding: 6px 10px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); font: inherit; font-weight: 700; cursor: pointer; }
.toast-act:hover { background: color-mix(in srgb, var(--bg) 24%, transparent); }

/* account dialog: plan card, primary action, quiet data rows */
.dlg h2[tabindex="-1"]:focus { outline: none; }
.acc-plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 10px; }
.acc-plan.is-pro { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.acc-plan > div { display: grid; flex: 1; min-width: 0; }
.acc-plan b { font-size: 15.5px; }
.acc-plan small { color: var(--muted); font-size: 13.5px; }
.acc-note { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.dlg .btn-block + .btn-block { margin-top: 6px; }
.acc-rows { list-style: none; margin: 14px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.acc-rows a, .acc-rows button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14.5px; text-decoration: none; cursor: pointer; border-radius: 8px; }
.acc-rows a:hover, .acc-rows button:hover { background: var(--surface-2); }
.acc-rows .i { width: 17px; height: 17px; color: var(--muted); }
.acc-rows small { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.acc-rows .acc-danger, .acc-rows .acc-danger .i { color: var(--danger); }

/* ---------------------------------------------------------- library tabs */
.lib-sub { display: flex; align-items: flex-start; gap: 8px; min-height: 24px; }
.lib-sub > span:not(.spin) { min-width: 0; }
.lib-sub .i { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: .2em; }
.lib-sub .spin { width: 14px; height: 14px; margin-top: .25em; }
.lib-sub.is-error { color: var(--danger); }
.lib-sub.is-error .i { color: var(--danger); }
.lib-sub .btn-link { font-size: inherit; }
.lib-tabs { display: flex; gap: 4px; margin: 18px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tab { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.lib-tab:hover { color: var(--ink); }
.lib-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.lib-tab:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: -4px; border-radius: 8px 8px 0 0; }
.lib-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.lib-count[hidden] { display: none; }
@media (max-width: 430px) { .lib-tabs { gap: 0; } .lib-tab { padding: 0 9px; font-size: 14.5px; gap: 5px; } }
#tab-new .lib-count { background: var(--accent-soft); color: var(--accent-ink); }
.lib-page .lib-sec { padding-block: 22px 32px; }
.lib-page .lib-sec + .lib-sec { border-top: 0; }
.lib-page .lib-sec-head:has(> .visually-hidden:only-child) { display: none; }
.lib-lead { color: var(--muted); font-size: 14.5px; max-width: 62ch; }

/* two lines of title instead of one cut-off line */
.lib-item-t, .new-group-t a { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }

/* New: per-episode actions */
.new-row-state { gap: 6px; align-items: center; }
.new-row-state .icon-btn { width: 36px; height: 36px; }
.new-row-state .icon-btn .i { width: 18px; height: 18px; }

/* Subscriptions: ⋯ menu */
.lib-list.lib-subs { overflow: visible; }
.lib-subs > .lib-item:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.lib-subs > .lib-item:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.lib-subs .lib-item-actions { position: relative; }
.lib-subs [data-sub-menu] { width: 40px; height: 40px; }
.lib-subs [data-sub-menu] .i { width: 20px; height: 20px; }
.lib-subs [data-sub-menu][aria-expanded="true"] { background: var(--surface-2); }
.lib-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; padding: 6px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; animation: toast-in var(--dur) var(--ease); }
.lib-menu a, .lib-menu button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 14.5px; text-align: left; text-decoration: none; cursor: pointer; }
.lib-menu a:hover, .lib-menu button:hover, .lib-menu :focus-visible { background: var(--surface-2); outline: none; }
.lib-menu .i { width: 17px; height: 17px; color: var(--muted); }
.lib-menu .is-danger, .lib-menu .is-danger .i { color: var(--danger); }

/* Ko-fi buy buttons follow the billing toggle */
.pro-card[data-billing="year"] .buy-month, .pro-card[data-billing="month"] .buy-year { display: none; }
.pro-card .buy-month, .pro-card .buy-year { margin-top: 4px; }
.billing-toggle[hidden] { display: none; }

/* /pro/thanks */
.thanks-page { display: grid; place-items: center; padding-block: 56px 72px; }
.thanks-card { max-width: 520px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.thanks-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); }
.thanks-mark .i { width: 28px; height: 28px; }
.thanks-card h1 { font-size: clamp(28px, 5vw, 38px); letter-spacing: -0.02em; }
.thanks-status { color: var(--muted); font-size: 16px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.thanks-status.is-ok { color: var(--ink); }
.thanks-status.is-late { color: var(--ink); display: block; }
.thanks-status[hidden] { display: none; }
.thanks-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
