:root {
  --bg: #fafaf8;
  --panel: #ffffff;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --accent: #6d28d9;
  --accent-ink: #ffffff;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
main { max-width: 860px; margin: 0 auto; padding: 0 20px 60px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.site-header {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 860px; margin: 0 auto; padding: 18px 20px;
}
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.site-header nav { display: flex; gap: 16px; align-items: center; }
/* The billing portal needs a POST, so that nav item is a form. Make its button
   sit and read like the anchors beside it rather than like a .link-button. */
.site-header nav .nav-form { display: flex; margin: 0; }
.site-header nav .nav-form .link-button { color: var(--accent); font-size: 1rem; padding: 0; }
.site-footer { max-width: 860px; margin: 0 auto; padding: 24px 20px; border-top: 1px solid var(--border); }

.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin-bottom: 12px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }

.login-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.login-form input[type="email"] {
  padding: 12px 16px; font-size: 1rem; border: 1px solid var(--border);
  border-radius: 8px; min-width: 280px;
}
button {
  padding: 12px 20px; font-size: 1rem; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 8px; cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--border); }
.link-button { background: none; border: none; color: var(--muted); font-size: 0.85rem; padding: 4px; text-decoration: underline; cursor: pointer; font-weight: 400; }

.pricing { display: flex; gap: 20px; justify-content: center; padding: 32px 0; flex-wrap: wrap; }
.plan-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px; width: 280px;
}
.plan-featured { border-color: var(--accent); box-shadow: 0 4px 24px rgba(109, 40, 217, 0.12); }
.plan-card h2 { margin: 0 0 4px; }
.price { font-size: 2.2rem; font-weight: 700; margin-bottom: 12px; }
.price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan-card ul { padding-left: 20px; margin: 0 0 16px; }
.plan-card li { margin-bottom: 6px; }

.how { max-width: 560px; margin: 0 auto; padding: 24px 0; }
.how ol { padding-left: 22px; }
.how li { margin-bottom: 10px; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin: 20px 0;
}
.panel h2 { margin-top: 0; }
.plan-row { display: flex; justify-content: space-between; align-items: center; }

.feed-list, .results-list { list-style: none; padding: 0; margin: 0 0 16px; }
.feed-list li, .results-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.feed-list li span:first-child, .results-list li > div { flex: 1; }
.results-list img { border-radius: 6px; }

/* A feed row is now a stack (title + its episodes), not a single flex line.
   These come after `.feed-list li` on purpose: that rule also matches the
   nested episode <li>s, and equal specificity means last one wins. */
.feed-list li.feed-item { display: block; padding: 14px 0; }
.feed-head { display: flex; align-items: center; gap: 12px; }
.feed-head > span { flex: 1; font-weight: 600; }
.episode-list { list-style: none; padding: 0; margin: 10px 0 0; }
.episode-list li { display: block; padding: 8px 0 8px 14px; border-bottom: none; border-left: 2px solid var(--border); }
.episode-title { font-size: 0.92rem; }
.episode-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 3px; font-size: 0.85rem; }
.episode-empty { margin: 10px 0 0; }
.badge.pending { background: #ede9fe; border: 1px solid var(--accent); border-radius: 6px; padding: 2px 8px; font-size: 0.8rem; }

.search-form { display: flex; gap: 8px; margin-top: 12px; }
.search-form input {
  flex: 1; padding: 10px 14px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px;
}

.tldr { border-bottom: 1px solid var(--border); padding: 16px 0; }
.tldr:last-child { border-bottom: none; }
.tldr h3 { margin: 0 0 8px; }
.summary h3 { font-size: 1rem; margin: 14px 0 6px; color: var(--accent); }

.flashes { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.flash {
  background: #ede9fe; border: 1px solid var(--accent); color: var(--ink);
  border-radius: 8px; padding: 10px 16px; margin-bottom: 8px;
}
.badge.warn { background: #fef3c7; border: 1px solid #d97706; border-radius: 6px; padding: 2px 8px; font-size: 0.8rem; }
.dev-note { background: #fffbeb; border: 1px solid #f59e0b; border-radius: 8px; padding: 12px 16px; display: inline-block; text-align: left; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111118; --panel: #1b1b26; --ink: #e8e8f0;
    --muted: #9ca3af; --accent: #a78bfa; --accent-ink: #16121f; --border: #2d2d3d;
  }
  .plan-featured { box-shadow: 0 4px 24px rgba(167, 139, 250, 0.15); }
  .flash { background: #2d2450; }
  .dev-note { background: #2d2408; }
  .badge.warn { background: #453306; }
  .badge.pending { background: #2e2a4d; }
}
