/* RecallPod
   Ink and paper, with one highlighter yellow that always means "something to remember":
   quiz moments on the timeline, the quiz button, and answers you got right. */

:root {
  --ink: #17223b;
  --ink-2: #4a556d;
  --ink-3: #7b8498;
  --paper: #f2f4f7;
  --surface: #ffffff;
  --line: #dde2ea;
  --hl: #ffe14d;
  --hl-ink: #17223b;
  --bad: #b8341d;
  --join: #17223b;
  --shadow: 0 1px 0 rgba(23, 34, 59, 0.06);
  --mark-bg: linear-gradient(transparent 55%, var(--hl) 55%);
  --mark-ink: var(--ink);
  --radius-s: 6px;
  --radius-m: 12px;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --nav-h: 64px;
  --mini-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e9edf4;
    --ink-2: #b2bbcc;
    --ink-3: #8691a6;
    --paper: #0e1525;
    --surface: #172138;
    --line: #26324d;
    --hl-ink: #0e1525;
    --bad: #ff8a73;
    --join: #e9edf4;
    --shadow: none;
    --mark-bg: var(--hl);
    --mark-ink: var(--hl-ink);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e9edf4; --ink-2: #b2bbcc; --ink-3: #8691a6; --paper: #0e1525; --surface: #172138;
  --line: #26324d; --hl-ink: #0e1525; --bad: #ff8a73; --join: #e9edf4; --shadow: none; --mark-bg: var(--hl); --mark-ink: var(--hl-ink); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
body.has-mini { padding-bottom: calc(var(--nav-h) + var(--mini-h) + env(safe-area-inset-bottom)); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; }
:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
#view { max-width: 600px; margin: 0 auto; padding: 0 16px 32px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 0 10px;
}
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.wordmark span { background: var(--mark-bg); color: var(--mark-ink); padding: 0 3px; border-radius: 3px; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 8px 8px 8px 0; color: var(--ink-2); font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--ink); }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }

h1.page { font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 16px; }
h2.sec { font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 28px 0 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.empty { padding: 28px 4px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 19px; margin-bottom: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 16px; text-decoration: none;
}
.btn.quiz { background: var(--hl); color: var(--hl-ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

/* ---------- artwork ---------- */
.art { flex: none; width: 56px; height: 56px; border-radius: var(--radius-s); object-fit: cover; background: var(--line); }
.art.lg { width: 120px; height: 120px; border-radius: var(--radius-m); }
.art.xl { width: min(72vw, 300px); height: min(72vw, 300px); border-radius: 16px; margin: 0 auto; }

/* ---------- the seam bar: your place, where ads were cut, where quiz answers live ---------- */
.seam { position: relative; padding: 6px 0 12px; }
.seam.has-dots { padding-bottom: 24px; }
.seam.big.has-dots { padding-bottom: 28px; }
.seam-track { position: relative; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.seam-fill { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); border-radius: 3px; background: var(--ink); }
.seam .join {
  position: absolute; top: -5px; width: 6px; height: 16px; margin-left: -3px;
  background: var(--surface); border-left: 2px solid var(--join); border-right: 2px solid var(--join);
}
.seam .dot {
  position: absolute; top: 14px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: var(--hl); box-shadow: 0 0 0 1.5px var(--hl-ink);
}
.seam.big .seam-track { height: 8px; }
.seam.big .join { top: -6px; height: 20px; width: 7px; margin-left: -3.5px; }
.seam.big .dot { top: 16px; width: 10px; height: 10px; margin-left: -5px; }
.seam input[type="range"] {
  position: absolute; left: 0; right: 0; top: -6px; width: 100%; height: 28px; margin: 0; opacity: 0; cursor: pointer;
}
.seam-legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.seam-legend i { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.seam-legend .lj { width: 6px; height: 14px; border-left: 2px solid var(--join); border-right: 2px solid var(--join); }
.seam-legend .ld { width: 9px; height: 9px; border-radius: 50%; background: var(--hl); box-shadow: 0 0 0 1.5px var(--hl-ink); vertical-align: 0; }

/* ---------- now listening tile (home) ---------- */
.now {
  display: block; background: var(--surface); border-radius: 16px; padding: 16px; margin: 4px 0 8px;
  box-shadow: var(--shadow); text-decoration: none;
}
.now-head { display: flex; gap: 14px; align-items: center; }
.now-head .t { font-weight: 700; font-size: 19px; line-height: 1.25; }
.now-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.now .btn { margin-top: 8px; }

/* ---------- episode rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.rows li:last-child .row { border-bottom: 0; }
.row .body { min-width: 0; flex: 1; }
.row-link { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 0; text-decoration: none; }
.row .show { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .title { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .facts { font-size: 14px; color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.row .end { flex: none; }
.cut-chip { white-space: nowrap; }
.cut-chip::before { content: ""; display: inline-block; width: 4px; height: 11px; margin-right: 6px; border-left: 1px solid currentColor; border-right: 1px solid currentColor; vertical-align: -1px; }
.score-chip { font-weight: 700; color: var(--mark-ink); background: var(--mark-bg); padding: 0 3px; border-radius: 3px; }
.status { font-size: 14px; font-weight: 700; }
.status.error { color: var(--bad); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); display: inline-block; vertical-align: -3px; margin-right: 6px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.play-mini { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink); }

/* ---------- show grid ---------- */
.shows-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.shows-strip::-webkit-scrollbar { display: none; }
.shows-strip a { flex: none; width: 88px; text-decoration: none; font-size: 13px; line-height: 1.25; color: var(--ink-2); }
.shows-strip .art { width: 88px; height: 88px; margin-bottom: 6px; border-radius: 10px; }
.shows-strip .add { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 10px; border: 1.5px dashed var(--ink-3); color: var(--ink-2); margin-bottom: 6px; }

/* ---------- episode page ---------- */
.ep-head { display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 16px; }
.ep-head h1 { font-size: 24px; line-height: 1.2; margin: 2px 0 6px; font-weight: 800; letter-spacing: -0.01em; }
.facts-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-2); }
.panel { background: var(--surface); border-radius: var(--radius-m); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 8px; font-size: 17px; }
.panel p { margin: 0 0 8px; }
.points { margin: 8px 0 0; padding-left: 20px; }
.points li { margin-bottom: 6px; }
.cuts { list-style: none; padding: 0; margin: 0; }
.cuts li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cuts li:first-child { border-top: 0; }
.cuts .what { font-weight: 600; }
.cuts .when { font-size: 14px; color: var(--ink-2); }
.link-btn { background: none; border: 0; padding: 6px 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; white-space: nowrap; }
.notice { border-left: 4px solid var(--bad); padding: 8px 12px; background: color-mix(in srgb, var(--bad) 8%, transparent); border-radius: 4px; font-size: 15px; }

/* ---------- quiz ---------- */
.quiz-top { display: flex; justify-content: space-between; align-items: center; }
.pips { display: flex; gap: 6px; margin: 10px 0 22px; }
.pips i { flex: 1; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.pips i.done { background: var(--ink); }
.pips i.right { background: var(--hl); box-shadow: inset 0 0 0 1px var(--hl-ink); }
.pips i.wrong { background: var(--bad); }
.question { font-size: 24px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 18px; }
.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.option {
  width: 100%; text-align: left; padding: 14px 16px; min-height: 56px; border-radius: var(--radius-m);
  border: 1.5px solid var(--line); background: var(--surface); font-size: 17px; line-height: 1.3; display: flex; gap: 12px; align-items: flex-start;
}
.option .k { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--ink-3); color: var(--ink-2); }
.option:not([disabled]):hover { border-color: var(--ink-3); }
.option[disabled] { cursor: default; }
.option.right { border-color: var(--hl-ink); background: var(--hl); color: var(--hl-ink); }
.option.right .k { box-shadow: none; background: var(--hl-ink); color: var(--hl); }
.option.wrong { border-color: var(--bad); }
.option.wrong .txt { text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
.option.wrong .k { box-shadow: none; background: var(--bad); color: var(--surface); }
.option.dim { opacity: 0.55; }
.explain { margin: 18px 0 0; padding: 14px 16px; border-radius: var(--radius-m); background: var(--surface); }
.explain .verdict { font-weight: 800; margin-bottom: 4px; }
.result-score { font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; margin: 24px 0 6px; }
.result-score span { font-size: 28px; color: var(--ink-2); font-weight: 700; }
.missed { list-style: none; padding: 0; margin: 0; }
.missed li { padding: 12px 0; border-top: 1px solid var(--line); }
.missed .a { margin-top: 4px; }
.missed .a b { background: var(--mark-bg); color: var(--mark-ink); padding: 0 3px; border-radius: 3px; }

/* ---------- forms ---------- */
.field { width: 100%; min-height: 50px; padding: 0 16px; border-radius: var(--radius-m); border: 1.5px solid var(--line); background: var(--surface); font-size: 17px; }
.field:focus { outline: none; border-color: var(--ink); }
.search-results .row .art { width: 52px; height: 52px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 16px; }
.tabs button { flex: 1; min-height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: none; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- scores ---------- */
.score-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.score-table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.score-table td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.score-table td.num, .score-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.saved { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 4px; }
.saved .big { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav[hidden] { display: none; }
.nav-inner { display: flex; width: 100%; max-width: 600px; }
.nav a {
  flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; font-size: 12px; font-weight: 600; color: var(--ink-3); position: relative;
}
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] svg { stroke-width: 2.4; }
.nav .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--hl); color: var(--hl-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- mini player ---------- */
.mini {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 19;
  display: none; justify-content: center; background: var(--surface); border-top: 1px solid var(--line);
}
body.has-mini .mini { display: flex; }
.mini-inner { width: 100%; max-width: 600px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; height: var(--mini-h); position: relative; }
.mini .art { width: 44px; height: 44px; }
.mini .meta { flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 0; }
.mini .meta .t { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .meta .s { font-size: 13px; color: var(--ink-2); }
.mini .bar { position: absolute; left: 0; right: 0; top: -1px; height: 2px; }
.mini .bar i { display: block; height: 100%; width: 0; background: var(--ink); }

/* ---------- full player sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 40; background: var(--paper); display: none; flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); overflow-y: auto;
}
.sheet.open { display: flex; animation: rise 0.22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-inner { width: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; flex: 1; }
.sheet .grab { display: flex; justify-content: space-between; align-items: center; }
.sheet .np-title { font-size: 22px; font-weight: 800; line-height: 1.2; margin: 20px 0 4px; }
.sheet .np-show { color: var(--ink-2); margin: 0 0 18px; }
.times { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 2px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 20px 0 12px; }
.controls .skip { position: relative; width: 56px; height: 56px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; }
.controls .skip svg { width: 34px; height: 34px; }
.controls .skip span { position: absolute; font-size: 11px; font-weight: 800; top: 21px; }
.controls .pp { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.controls .pp svg { width: 34px; height: 34px; }
.speed-row { display: flex; justify-content: center; gap: 8px; margin: 8px 0 16px; }
.speed-row button { min-width: 52px; min-height: 36px; border-radius: 999px; border: 1.5px solid var(--line); background: none; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.speed-row button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.sheet .after { margin-top: auto; padding-top: 12px; }

/* ---------- toast + login ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--mini-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  max-width: calc(100% - 32px); display: none;
}
.toast.show { display: block; animation: rise 0.18s ease-out; }
.toast button { background: none; border: 0; color: var(--hl); font-weight: 800; margin-left: 10px; padding: 0; }
.me-row { display: flex; gap: 10px; }
.me-row .field { flex: 1; min-width: 0; }
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 380px; margin: 0 auto; padding: 24px 16px 80px; }
.login .wordmark { font-size: 40px; margin-bottom: 8px; }
.login p { color: var(--ink-2); margin: 0 0 24px; }
.login .field { margin-bottom: 12px; }
.err { color: var(--bad); font-weight: 600; min-height: 1.4em; font-size: 15px; }
.demo-banner { max-width: 600px; margin: 0 auto; padding: 8px 16px 0; font-size: 13px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
