/* ==========================================================
   Paramedic Papers — mobile news-app redesign
   ========================================================== */

:root {
  --bg:        #FBFAF8;
  --surface:   #FFFFFF;
  --ink:       #14171A;
  --ink-2:     #2A2E33;
  --ink-3:     #5A6067;
  --muted:     #8A9097;
  --muted-2:   #A5AAB0;
  --line:      #EAE8E3;
  --line-2:    #E2E0DB;
  --hair:      #F0EEE9;
  --accent:    #2F5FA8;
  --accent-lo: #EDF2FB;
  --accent-in: #9BB4E0;
  --warm:      #C2562F;
  --warm-lo:   #FAF6F2;
  --warm-tint: #FAF0EA;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --serif: Newsreader, Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --tabbar-h: 49px;
  --sidebar-w: 244px;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, including over display:flex/grid
   rules (fixes empty-states and panels that set a display value). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #1F4480; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── masthead ─────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: max(12px, env(safe-area-inset-top)) 22px 12px;
}
.masthead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.masthead h1 { font-size: 23px; line-height: 1; }
.kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-top: 6px;
}
.masthead-actions { display: flex; align-items: center; gap: 10px; }
.updated { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; min-width: 32px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface); color: var(--ink-3); cursor: pointer;
}
.icon-btn:hover { background: #F4F2ED; }
.icon-btn .hi { width: 17px; height: 17px; }
.icon-btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── icons (Hugeicons sprite in index.html) ───────────── */
.hi {
  width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.hi-solid { fill: currentColor; }
/* Inline glyphs inside text buttons and links */
.link-btn, .act, .strip-link, .bullet-link, #podcast-subscribe .panel-kicker {
  display: inline-flex; align-items: center; gap: 5px;
}
.link-btn .hi, .act .hi, .strip-link .hi { width: 13px; height: 13px; }
.bullet-link .hi { width: 11px; height: 11px; }
.panel-kicker .hi { width: 12px; height: 12px; }
.act .hi-solid { width: 10px; height: 10px; }
a.act .hi { width: 11px; height: 11px; }
.act.is-saved .hi { fill: currentColor; }
.sign-btn { display: grid; place-items: center; }
.sign-btn .hi { width: 18px; height: 18px; }
.ep-play .hi { width: 16px; height: 16px; }
.player-btn { display: grid; place-items: center; }
.player-btn .hi { width: 19px; height: 19px; }

/* ── page shell ───────────────────────────────────────── */
main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.page { display: flex; flex-direction: column; gap: 16px; padding: 18px 22px 28px; }
.page[hidden] { display: none; }

/* ── panels (fun fact / TLDRs) ────────────────────────── */
.panel {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(20,23,26,.04);
}
.panel-dark { background: var(--ink); border-color: var(--ink); }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.panel-kicker-accent { color: var(--accent); }
.panel-kicker-invert { color: var(--accent-in); }
.panel-lead { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.fact-headline { font-family: var(--serif); font-size: 19px; line-height: 1.35; color: var(--bg); text-wrap: pretty; }
#fun-fact-body { font-size: 13.5px; line-height: 1.55; color: #C9CDD2; text-wrap: pretty; }

.sign-btn {
  background: none; border: 0; padding: 0 4px; cursor: pointer;
  font-family: var(--mono); font-size: 16px; line-height: 1; color: var(--muted);
}
.link-btn {
  align-self: flex-start; margin-top: 2px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
.link-btn-invert { color: var(--accent-in); }

.collapse { display: block; }
.collapse[hidden] { display: none; }
.bullets {
  display: flex; flex-direction: column; gap: 11px;
  padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--hair);
}
.bullet { display: flex; gap: 9px; align-items: flex-start; }
.bullet .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.bullet.is-weekly .dot { background: var(--muted); }
.bullet-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.bullet-text { font-size: 13.5px; line-height: 1.5; color: #4A5057; text-wrap: pretty; }
.bullet-link {
  background: none; border: 0; border-bottom: 1px solid #C3D3EC; padding: 0; cursor: pointer;
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--accent);
}

/* ── section heads ────────────────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.section-head h2 { font-size: 19px; }
.count-flag, .muted-flag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
}
.count-flag { color: var(--warm); }
.muted-flag { color: var(--muted); }

/* ── paper cards ──────────────────────────────────────── */
.today-list { display: flex; flex-direction: column; }
.today-item {
  display: flex; flex-direction: column; gap: 7px;
  padding: 15px 0; border-top: 1px solid var(--line);
}
.paper-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(20,23,26,.04);
}
.paper-card.is-pinned {
  border-color: var(--warm);
  box-shadow: 0 2px 10px -4px rgba(194,86,47,.35);
}
.tagrow { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; background: var(--accent-lo); color: var(--accent);
}
.tag-outline { background: none; border: 1px solid var(--line-2); color: #6B7178; padding: 2px 7px; }
.rel {
  margin-left: auto; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.rel-high { color: var(--warm); }
.paper-title { font-family: var(--serif); font-size: 17.5px; line-height: 1.28; color: var(--ink); text-wrap: pretty; }
.paper-title a { color: inherit; }
.paper-summary { font-size: 13.5px; line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.today-item .paper-summary {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Home card expand-on-tap ──────────────────────────── */
.today-expand { position: relative; cursor: pointer; }
.today-expand .today-detail {
  display: none; font-size: 13px; line-height: 1.45; color: var(--ink-2);
  margin-top: 4px; text-wrap: pretty;
}
.today-expand .today-chev {
  display: block; width: 28px; height: 3px; border-radius: 2px;
  background: var(--line-2); margin-top: 8px;
  transition: background .15s ease, width .15s ease;
}
.today-expand:hover .today-chev { background: var(--accent-in); width: 36px; }

.today-item.is-expanded .today-item .paper-summary,
.today-item.is-expanded > .today-expand .paper-summary {
  -webkit-line-clamp: unset; overflow: visible;
}
.today-item.is-expanded > .today-expand .today-detail { display: block; }
.today-item.is-expanded > .today-expand .today-chev { width: 36px; background: var(--accent-in); }
.paper-foot { display: flex; align-items: center; gap: 8px; }
.paper-card .paper-foot { padding-top: 3px; margin-top: 2px; border-top: 1px solid var(--hair); }
.paper-meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.paper-acts { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.act {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.act.is-saved { color: var(--warm); }
.act-ep { color: var(--accent); }

/* Details toggle / episode link row, and the structured fields it opens */
.paper-extra { display: flex; align-items: center; gap: 14px; }
.facts { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.facts div { display: grid; grid-template-columns: 58px 1fr; gap: 8px; }
.facts dt {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); padding-top: 2px;
}
.facts dd { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.facts-wrap { padding: 10px 12px; background: var(--hair); border-radius: 10px; }
.today-detail .facts { margin-top: 6px; }

/* Bottom-line badge */
.tag-bl { background: var(--hair); color: var(--ink-3); }
.tag-bl.bl-practice-changing { background: var(--warm-tint); color: var(--warm); }
.tag-bl.bl-supports { background: var(--accent-lo); color: var(--accent); }
a.act { color: var(--accent); }

/* ── feed controls ────────────────────────────────────── */
.search-wrap { position: relative; }
.search-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
#search-input {
  width: 100%; padding: 12px 14px 12px 38px; font-family: inherit; font-size: 14px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 11px;
}
#search-input:focus { outline: none; border-color: var(--accent); }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-divider { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
@media (max-width: 619px) {
  .chips { gap: 6px; }
  .chip { padding: 7px 10px; letter-spacing: .05em; }
}
.chip {
  padding: 7px 13px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: #6B7178;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
}
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.topic-select {
  -webkit-appearance: none; appearance: none; max-width: 100%;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px; background-repeat: no-repeat;
}
.chip.topic-select.is-on {
  background-color: var(--accent);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
}
.result-count { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.day-head { display: flex; align-items: baseline; gap: 9px; padding: 6px 0 10px; }
.day-head .label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--ink);
}
.day-head .rule { height: 1px; flex: 1; background: var(--line-2); }
.day-head .n { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.pin-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.pin-head .label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--warm);
}
.pin-head .rule { height: 1px; flex: 1; background: #E8DCD3; }

.empty { padding: 40px 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ── weekly picks ─────────────────────────────────────── */
.pick-head { display: flex; gap: 10px; align-items: center; }
.pick-rank { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--warm); }
.why {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--warm-lo); border-left: 2px solid var(--warm);
  border-radius: 0 8px 8px 0; padding: 10px 12px;
}
.why-kicker {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--warm);
}
.why-text { font-size: 13px; line-height: 1.5; color: #4A5057; text-wrap: pretty; }

/* ── saved empty state ────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 80px 20px; text-align: center;
}
.empty-state h2 { font-size: 18px; }
.empty-state p { font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 230px; text-wrap: pretty; }
.empty-ico { width: 36px; height: 36px; color: #C7CBD0; }

/* ── wide button ──────────────────────────────────────── */
.wide-btn {
  width: 100%; margin-top: 8px; padding: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid #DCDAD5; border-radius: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
.wide-btn:hover { background: #F4F2ED; }

/* ── tab bar (iOS-standard 49px + safe area) ──────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  height: calc(49px + env(safe-area-inset-bottom));
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; background: none; border: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: .01em;
  color: var(--muted-2);
}
.tab.is-on { color: var(--accent); }
.ico { width: 24px; height: 24px; display: block; }
.tab.is-on .ico, .nav-item.is-on .ico { stroke-width: 2; }

/* ── wider screens: centre the column ─────────────────── */
@media (min-width: 620px) {
  .masthead, .page { max-width: 560px; margin-inline: auto; }
  .tabbar { max-width: 560px; margin-inline: auto; border-inline: 1px solid var(--line); }
}

/* ==========================================================
   Desktop layout (≥960px)
   Sidebar nav replaces the tab bar, the masthead becomes a
   sticky content header with always-visible search, and Home
   splits into a reading column plus a sticky TLDR rail.
   Everything below 960px is untouched.
   ========================================================== */

/* Desktop-only furniture, hidden on mobile. The Home wrappers collapse so
   the mobile stack keeps its original single-column order. */
.sidebar, .wide-only, .kbd-hint { display: none; }
.home-rail, .home-main { display: contents; }

@media (min-width: 960px) {

  /* ── shell ──────────────────────────────────────────── */
  body { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
  .shell { display: block; min-width: 0; }
  .tabbar { display: none; }
  main { padding-bottom: 0; }
  .wide-only { display: block; }

  /* ── sidebar ────────────────────────────────────────── */
  .sidebar {
    display: flex; flex-direction: column; gap: 26px;
    position: sticky; top: 0; height: 100vh;
    padding: 26px 20px 22px;
    border-right: 1px solid var(--line);
  }
  .sidebar-head { display: flex; flex-direction: column; gap: 7px; }
  .wordmark { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1; letter-spacing: -.01em; }
  .sidebar-head .kicker { margin-top: 0; }

  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-item {
    display: flex; align-items: center; gap: 11px;
    width: 100%; text-align: left; cursor: pointer;
    padding: 9px 11px; border: 0; border-radius: 10px;
    background: none; color: var(--ink-3);
    font-size: 14px; letter-spacing: .01em;
  }
  .nav-item:hover { background: #F4F2ED; }
  .nav-item.is-on { background: var(--accent-lo); color: var(--accent); font-weight: 500; }
  .nav-item .ico { width: 20px; height: 20px; flex: none; }
  .nav-pill {
    margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
    padding: 2px 6px; border-radius: 5px; color: var(--muted); background: var(--hair);
  }
  .nav-pill-warm { color: var(--warm); background: var(--warm-tint); }
  .nav-pill[hidden] { display: none; }

  .scan-window { display: flex; flex-direction: column; gap: 10px; }
  .scan-label {
    font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted);
  }
  .scan-rows { display: flex; flex-direction: column; gap: 8px; }
  .scan-row {
    display: flex; align-items: baseline; justify-content: space-between;
    font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  }
  .scan-new { color: var(--warm); }
  .scan-n { color: var(--muted); }

  .sidebar-foot {
    margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding-top: 16px; border-top: 1px solid var(--hair);
  }
  .sidebar-foot .masthead-actions { flex: 1; justify-content: space-between; }
  .icon-btn:hover { color: var(--accent); }

  /* ── content header ─────────────────────────────────── */
  .masthead {
    max-width: none; margin-inline: 0;
    padding: 20px 40px 18px;
    background: rgba(251, 250, 248, .92);
    backdrop-filter: blur(8px);
  }
  .masthead-row { gap: 32px; }
  .masthead h1 { font-size: 25px; }
  .masthead .kicker { margin-top: 7px; }
  .masthead .search-wrap { display: flex; align-items: center; gap: 10px; width: 420px; flex: none; }
  #search-input { padding: 11px 14px 11px 38px; }
  .masthead #search-input { flex: 1; width: auto; min-width: 0; }
  .kbd-hint {
    display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
    color: var(--muted-2); white-space: nowrap;
    border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px;
  }

  /* ── pages ──────────────────────────────────────────── */
  .page { max-width: none; margin-inline: 0; padding: 28px 40px 48px; }

  /* Home: reading column + sticky TLDR rail. */
  #page-home {
    display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 34px; align-items: start;
  }
  #page-home[hidden] { display: none; }  /* id beats .page[hidden] */
  .home-main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .home-rail {
    grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 16px;
    min-width: 0; position: sticky; top: 108px;
  }
  .panel { padding: 18px 20px; }
  .section-head { margin-top: 0; }
  .section-head h2 { font-size: 20px; }
  #btn-see-week {
    margin: 0 0 0 auto; padding-right: 10px;
    font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  }

  /* Today's cards get the full card anatomy instead of hairline rows. */
  .today-list { gap: 14px; }
  .today-item {
    gap: 9px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px;
    background: var(--surface); box-shadow: 0 1px 2px rgba(20,23,26,.04);
  }
  .today-item .paper-title { font-size: 19px; }
  /* Full card anatomy on desktop: the summary is no longer clamped, so the
     tap-to-expand affordance is dropped. */
  .today-item .paper-summary { -webkit-line-clamp: unset; overflow: visible; }
  .today-expand { cursor: default; }
  .today-expand .today-chev, .today-expand .today-detail { display: none; }
  .today-item .paper-foot { padding-top: 10px; border-top: 1px solid var(--hair); }
  .wide-btn { margin-top: 4px; }

  /* Fun fact now closes out the home feed inside the reading column; cap its
     width so the dark panel doesn't stretch across the whole column. */
  #fun-fact-panel { max-width: 560px; }

  /* Feed: filter bar + card grid with full-width day rules. */
  #page-feed { padding-top: 24px; gap: 18px; }
  .chip-divider { margin: 0 4px; }
  .chip:hover { background: #F4F2ED; }
  .chip.is-on:hover { background: var(--accent); }
  #feed-list, #weekly-picks, #saved-list {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px; align-items: start;
  }
  #feed-list .day-head { grid-column: 1 / -1; padding: 0; }
  .paper-card { margin-bottom: 0; padding: 18px 20px; }
  .paper-card .paper-foot { padding-top: 10px; margin-top: 0; }
  .paper-foot { flex-wrap: wrap; row-gap: 6px; }
  .paper-meta { min-width: 0; }
  .paper-card .paper-title { font-size: 19px; }

  /* Weekly: the week's TLDR runs full width, so the lead is capped for
     line length and the bullets split into two columns. */
  #page-weekly .panel { padding: 22px 24px; }
  #page-weekly .panel-lead {
    font-family: var(--serif); font-size: 21px; line-height: 1.35;
    color: var(--ink); max-width: 74ch;
  }
  #page-weekly .bullets {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 34px; padding-top: 13px;
  }
  #page-weekly .bullets[hidden] { display: none; }

  /* Weekly / Saved: three-up grids under a full-width panel. */
  #weekly-picks, #saved-list { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
  #saved-list:empty { display: none; }
  .empty-state { padding-top: 40px; }
}

/* Narrow desktops: give the view title room next to the header search. */
@media (min-width: 960px) and (max-width: 1180px) {
  .masthead .search-wrap { width: 320px; }
}

/* ── podcast ─────────────────────────────────────────── */

/* Slim latest-episode strip at the top of Home. Same surface treatment as
   the TLDR panels but one quiet row: play button, kicker + title, duration,
   link to the tab. Hairline progress bar along the bottom edge. */
.podcast-strip {
  position: relative;
  display: flex;
  flex-direction: row;   /* override .panel's column */
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  overflow: hidden;
}
/* [hidden] must win over the flex display above (same pattern as .page[hidden]). */
.podcast-strip[hidden] { display: none; }
.podcast-strip .panel-kicker { font-size: 9px; }
.ep-play {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
}
.ep-play:hover { background: #F4F2ED; }
.ep-play.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.strip-text { display: flex; flex-direction: column; min-width: 0; }
.strip-title {
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip-dur { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.strip-link {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em;
  color: var(--accent); cursor: pointer; white-space: nowrap;
}
.strip-link:hover { color: #1F4480; }
.strip-progress {
  position: absolute; left: 0; bottom: 0; height: 2px;
  width: 0; background: var(--accent);
  opacity: .55;
  transition: width .25s linear;
}
/* On the desktop Home grid the strip spans both columns in its own row;
   the reading column and rail move down to row 2 (they're pinned to
   row 1 by the original rules). */
@media (min-width: 960px) {
  .podcast-strip { grid-column: 1 / -1; grid-row: 1; padding: 12px 18px; }
  .home-main, .home-rail { grid-row: 2; }
}

/* Episode rows (podcast tab) */
.ep-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--hair);
}
.ep-row { scroll-margin-top: 110px; }  /* clear the sticky header on #episode= links */
.ep-main { display: flex; align-items: center; gap: 12px; }
.ep-notes-btn { margin-top: 4px; }
.ep-notes { padding: 10px 0 2px 52px; display: flex; flex-direction: column; gap: 10px; }
.ep-papers { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.ep-papers li { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.ep-paper {
  display: inline; /* inline-block would hang the list number on the last line */
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  font: inherit; color: var(--accent);
}
.ep-paper:hover { text-decoration: underline; }
.ep-journal { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.ep-transcript {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 14px; background: var(--hair); border-radius: 10px;
}
.ep-transcript p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.ep-row:last-child { border-bottom: none; }
.ep-row .ep-play { width: 40px; height: 40px; }
.ep-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ep-date {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.ep-name { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.ep-desc {
  font-size: 13px; line-height: 1.45; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-len { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Now-playing bar: fixed above the tab bar (mobile) or along the bottom of
   the content column (desktop). */
.player {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px -6px rgba(20,23,26,.18);
}
.player-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.player-top { display: flex; align-items: baseline; gap: 8px; }
.player-title {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-time { font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.player-btn {
  flex: none; min-width: 34px; height: 30px; padding: 0 6px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
}
.player-btn:hover { background: #F4F2ED; }
.player-rate { min-width: 42px; color: var(--accent); }
.player-seek {
  --pct: 0%;
  width: 100%; height: 16px; margin: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.player-seek::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--line-2) var(--pct));
}
.player-seek::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
.player-seek::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--accent); }
.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px;
  border-radius: 50%; background: var(--accent); border: 0;
}
.player-seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 0; }
body.has-player main {
  padding-bottom: calc(var(--tabbar-h) + 64px + env(safe-area-inset-bottom));
}
@media (max-width: 380px) {
  #player-back { display: none; }
}
@media (min-width: 620px) and (max-width: 959px) {
  .player { max-width: 560px; margin-inline: auto; border-inline: 1px solid var(--line); }
}
@media (min-width: 960px) {
  .player { left: var(--sidebar-w); bottom: 0; padding: 10px 40px; }
  body.has-player main { padding-bottom: 76px; }
}

/* Saved: export link above the list */
.saved-tools { display: flex; justify-content: flex-end; }

/* Subscribe panel */
.sub-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.sub-url {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2);
  padding: 7px 10px; background: var(--hair); border-radius: 8px;
  word-break: break-all;
}
.sub-hint { font-size: 12.5px; color: var(--muted); }

