/* ==========================================================================
   Founders Reading Index — research-ledger visual system (v3)
   An unofficial, evidence-first companion. Calm, serious, source-driven.
   ========================================================================== */

:root {
  /* paper + surfaces */
  --paper: #f3efe7;
  --paper-deep: #eee9de;
  --surface: #f6f2ea;
  --plate: #f8f5ee;

  /* ink + text */
  --ink: #2a251d;
  --ink-soft: #3d382e;
  --body: #4a4438;
  --muted: #6b655a;
  /* muted grays darkened to meet WCAG AA (>=4.5:1) on --paper #f3efe7 while
     staying in the same warm-gray family. Ratios: muted 5.04, muted-2 4.83,
     faint 4.68, faint-2 4.55. */
  --muted-2: #6f6857;
  --faint: #716a5a;
  --faint-2: #736c5b;

  /* rules */
  --line: #d8d1c0;
  --line-row: #ded7c8;
  --line-strong: #c9c1b0;
  --dotted: #cfc7b6;

  /* accents */
  --brass: #97742b;
  --brass-soft: rgba(151, 116, 43, 0.1);
  --amber: #a8895a;
  --green: #3f6150;
  --green-line: rgba(63, 97, 80, 0.4);
  --green-faint: rgba(63, 97, 80, 0.32);
  --green-wash: rgba(63, 97, 80, 0.055);
  --green-border: #c2cfc6;

  --shadow-drawer: -24px 0 60px rgba(35, 32, 25, 0.16);

  /* motion — restrained, paper-settling. one curve, short durations */
  --motion-fast: 130ms;
  --motion-mid: 200ms;
  --motion-slow: 320ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --mobile-tabbar-offset: 62px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* always reserve the scrollbar gutter so content width is identical on
     short pages (episodes) and long ones (index) — no sideways shift on
     tab switches */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* shared interaction transitions — eased hover states (see motion tokens) */
.nav-links a,
.nav-cta,
.search-clear,
.filter,
.graph-mode button,
.link-evidence,
.full-index-link,
.btn-dark,
.link-green,
.link-muted,
.drawer-close,
.crumb a,
.footer-links a {
  transition:
    color var(--motion-fast) var(--ease),
    background-color var(--motion-fast) var(--ease),
    border-color var(--motion-fast) var(--ease);
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

em {
  font-style: italic;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 60;
  transform: translateY(-180%);
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 8px 12px;
  font-size: 0.85rem;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- masthead ----------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--ink);
  background: rgba(243, 239, 231, 0.92);
  backdrop-filter: blur(14px);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  padding: 18px var(--gutter);
}

.brand {
  flex: 0 0 auto;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  white-space: nowrap;
  position: relative;
}

/* F-009: extend each nav link's tap target to >=44px tall via a transparent
   pseudo-element. No layout or visual change — the link box stays as-is, but
   the effective hit area (wherever the top nav is shown) meets the touch
   minimum. On phones (<=720px) the top nav is hidden and the 56px tab bar is
   the nav, so this covers the tablet/desktop range. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.is-active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--brass);
}

.nav-cta,
.nav-links a.nav-cta {
  color: #f4f0e8;
  background: var(--ink);
  padding: 8px 15px;
}

.nav-cta:hover,
.nav-links a.nav-cta:hover {
  color: #f4f0e8;
  background: #3a342a;
  box-shadow: none;
}

/* ---------- page shell --------------------------------------------------- */

.page {
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  padding: clamp(28px, 3.2vw, 40px) var(--gutter) 56px;
}

/* entrance plays only on real view changes (route() adds .is-entering),
   never on search/filter re-renders */
.page.is-entering {
  animation: settle var(--motion-slow) var(--ease) both;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- index head: one strong line + search ------------------------- */

.index-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  max-width: 760px;
}

.search {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 640px;
  margin-top: 20px;
  border-bottom: 1.5px solid var(--ink);
  padding: 7px 2px;
}

/* no transition here: renderIndex() rebuilds this node per keystroke, and the
   input's outline is removed — the focus state must be instant and strong */
.search:focus-within {
  border-color: var(--green);
  box-shadow: 0 1px 0 0 var(--green);
}

.search:focus-within .search-icon {
  color: var(--green);
}

.search-icon {
  color: var(--faint);
  font-size: 1.05rem;
  line-height: 1;
}

.search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.search input::placeholder {
  color: var(--faint);
}

.search-hint {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint-2);
  white-space: nowrap;
}

.search-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 2px 4px;
  white-space: nowrap;
}

.search-clear:hover {
  color: var(--ink);
}

/* ---------- filters ------------------------------------------------------ */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.filter {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  font-size: 0.8rem;
}

.filter:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter.is-selected {
  border-color: var(--brass);
  background: var(--brass-soft);
  color: var(--ink);
}

/* "More filters" is a disclosure rather than a filter value. The compact
   sliders mark carries that distinction without the disabled-looking dashed
   border the earlier treatment used. */
.filter-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--body);
}
.filter-more-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* ---------- ledger caption / count -------------------------------------- */

/* ranked-list header: heading + result count on one line, coverage scope as a
   tight sub-line — replaces the old standalone ledger caption row. The divider
   and top spacing live here (moved off .all-books-title) so the rule spans the
   full width and the count baseline-aligns with the heading. */
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(40, 30, 15, 0.13);
}

.list-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint-2);
  white-space: nowrap;
}

.list-scope {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.86rem;
  color: var(--faint-2);
}

/* ---------- ranked ledger (desktop table) -------------------------------- */

.ledger-shell {
  overflow-x: auto;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
}

.ledger thead th {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding: 9px 10px;
  text-align: left;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--faint-2);
}

.ledger th.num,
.ledger td.num {
  text-align: right;
}

.ledger tbody td {
  border-bottom: 1px solid var(--line-row);
  padding: 17px 10px;
  vertical-align: middle;
  transition: background-color var(--motion-fast) var(--ease);
}

.ledger tbody tr:hover td {
  background-color: rgba(151, 116, 43, 0.05);
}

.ledger tbody tr:last-child td {
  border-bottom: 1px solid var(--line-strong);
}

.ledger tbody tr.is-top td {
  background: linear-gradient(90deg, var(--brass-soft), transparent 60%);
}

.ledger tbody tr.is-top td:first-child {
  box-shadow: inset 2px 0 0 var(--brass);
}

.ledger tbody tr.is-top:hover td {
  background: linear-gradient(90deg, rgba(151, 116, 43, 0.17), transparent 60%);
}

.col-rank {
  width: 58px;
  font-family: var(--mono);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--brass);
}

.col-book {
  width: 38%;
}

.lt-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
}

.lt-title:hover {
  text-decoration: underline;
  text-decoration-color: var(--brass);
}

.col-meta {
  width: 24%;
  font-size: 0.88rem;
  color: var(--body);
}

.col-meta .subject {
  color: var(--faint-2);
}

.col-signal {
  width: 70px;
  font-family: var(--mono);
  font-size: 1.12rem;
  color: var(--ink);
}

.col-conf {
  width: 72px;
}

.conf {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
}

.conf.tier-b {
  color: var(--amber);
}

.col-action {
  width: 150px;
  text-align: right;
}

.link-evidence {
  font-size: 0.82rem;
  color: var(--green);
  text-decoration: none;
  border: none;
  background: transparent;
  padding: 0;
  border-bottom: 1px solid var(--green-faint);
}

.link-evidence:hover {
  border-bottom-color: var(--green);
}

.action-meta {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint-2);
}

.full-index-link {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
}

.full-index-link:hover {
  color: var(--ink);
}

/* ---------- ranked ledger (mobile list) ---------------------------------- */

.ledger-mobile {
  display: none;
}

.lrow {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: baseline;
  gap: 13px;
  padding: 15px 0;
  border-top: 1px solid var(--line-row);
  transition: background-color var(--motion-fast) var(--ease);
}

.lrow:hover {
  background-color: rgba(151, 116, 43, 0.05);
}

.ledger-mobile .lrow:first-child {
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--brass);
  margin-left: -8px;
  padding-left: 8px;
}

.ledger-mobile .lrow:last-of-type {
  border-bottom: 1px solid var(--line-strong);
}

.lrow .lr-rank {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--brass);
}

.lrow .lr-title {
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
}

.lrow .lr-sub {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--muted);
}

.lrow .lr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-top: 9px;
}

.lrow .lr-actions .action-meta {
  margin-top: 0;
}

.lrow .lr-signal {
  font-family: var(--mono);
  font-size: 1.04rem;
  color: var(--ink);
}

/* ---------- method note -------------------------------------------------- */

.method-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted-2);
  max-width: 720px;
}

.method-note a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid var(--green-line);
}

/* ---------- generic links / buttons -------------------------------------- */

.btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #f4f0e8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  padding: 13px 22px;
  border: none;
}

.btn-dark:hover {
  background: #3a342a;
}

.link-green {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid var(--green-line);
  padding-bottom: 2px;
}

.link-green:hover {
  border-bottom-color: var(--green);
}

.link-muted {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--dotted);
  padding-bottom: 2px;
}

.link-muted:hover {
  color: var(--ink);
}

.tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}

.tag.audited {
  color: var(--green);
  border-color: var(--green-border);
}

.tag.sample {
  color: var(--amber);
  border-color: #d8c6a6;
}

/* ---------- entity graph ------------------------------------------------- */

.graph-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--ink);
  padding-top: clamp(26px, 3.5vw, 36px);
}

.graph-kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--faint-2);
}

.graph-mode {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  min-height: 38px;
}

.graph-mode button {
  min-width: 92px;
  border: none;
  border-left: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.82rem;
}

.graph-mode button:first-child {
  border-left: none;
}

.graph-mode button:hover,
.graph-mode button.is-selected {
  background: var(--brass-soft);
  color: var(--ink);
}

.graph-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  margin-top: 26px;
}

.graph-stats div {
  min-width: 0;
  padding: 16px 18px;
  border-left: 1px solid var(--line);
}

.graph-stats div:first-child {
  border-left: none;
}

.graph-stats strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.34rem;
  line-height: 1.1;
  color: var(--ink);
}

.graph-stats span {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.76rem;
}

.graph-map {
  margin-top: 26px;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 50% 50%, rgba(63, 97, 80, 0.08), transparent 42%), var(--plate);
  overflow: hidden;
  aspect-ratio: 1.82;
}

.graph-map svg {
  display: block;
  width: 100%;
  height: 100%;
}

.map-edge {
  stroke: rgba(63, 97, 80, 0.26);
  stroke-linecap: round;
  transition:
    opacity var(--motion-fast) var(--ease),
    stroke var(--motion-fast) var(--ease);
}

.map-edge.is-selected {
  stroke: rgba(42, 37, 29, 0.7);
  opacity: 1;
}

.map-edge.is-dimmed {
  opacity: 0.12;
}

.map-node {
  cursor: pointer;
  transition: opacity var(--motion-fast) var(--ease);
}

.map-node circle {
  fill: var(--plate);
  stroke: var(--ink);
  stroke-width: 2;
  transition:
    fill var(--motion-fast) var(--ease),
    stroke var(--motion-fast) var(--ease),
    stroke-width var(--motion-fast) var(--ease);
}

.map-node text {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--plate);
  stroke-width: 5px;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-node.type-book circle {
  fill: rgba(151, 116, 43, 0.18);
  stroke: var(--brass);
}

.map-node.type-person circle,
.map-node.type-company circle {
  fill: rgba(63, 97, 80, 0.15);
  stroke: var(--green);
}

.map-node.type-episode circle {
  fill: rgba(42, 37, 29, 0.12);
  stroke: var(--ink);
}

.map-node.type-concept circle,
.map-node.type-practice circle {
  fill: rgba(168, 137, 90, 0.18);
  stroke: var(--amber);
}

.map-node:hover circle,
.map-node:focus-visible circle,
.map-node.is-selected circle {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 4;
}

.map-node.is-connected circle {
  stroke-width: 3;
}

.map-node.is-dimmed {
  opacity: 0.22;
}

.graph-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  gap: 28px;
  margin-top: 30px;
}

.graph-panel {
  min-width: 0;
  border-top: 2px solid var(--ink);
}

.graph-panel h2 {
  padding: 12px 0 10px;
  font-size: 1.1rem;
}

.hub-list,
.connection-list {
  border-top: 1px solid var(--line-strong);
}

.hub-row,
.connection-row {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line-row);
  padding: 13px 0;
}

.hub-row {
  grid-template-columns: 86px 1fr;
}

.hub-type,
.connection-rel,
.connection-meta {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--faint-2);
}

.hub-type {
  color: var(--green);
}

.hub-row h3 {
  font-size: 1rem;
  line-height: 1.16;
}

.hub-row p,
.connection-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.connection-row {
  grid-template-columns: 128px 1fr 118px;
  align-items: baseline;
}

.connection-row p {
  color: var(--body);
}

.connection-row strong {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
}

/* ---------- evidence drawer ---------------------------------------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(35, 32, 25, 0.3);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--motion-mid) var(--ease),
    visibility 0s linear var(--motion-mid);
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--motion-mid) var(--ease);
}

.evidence-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(600px, 100vw);
  height: 100vh;
  overflow: hidden;
  transform: translateX(102%);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-drawer);
  transition: transform var(--motion-mid) var(--ease);
}

.evidence-drawer.is-open {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 2;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px;
}

.drawer-close:hover {
  color: var(--ink);
}

.drawer-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.drawer-head {
  flex: 0 0 auto;
  padding: 26px 32px 22px;
  border-bottom: 2px solid var(--ink);
}

.drawer-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint-2);
  margin-bottom: 9px;
}

.drawer-book-title {
  font-size: 1.66rem;
  line-height: 1.1;
}

.drawer-book-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 6px;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.stat {
  padding: 0 22px;
  border-left: 1px solid var(--line);
}

.stat:first-child {
  padding-left: 0;
  border-left: none;
}

.stat-num {
  font-family: var(--mono);
  font-size: 1.24rem;
  color: var(--ink);
  line-height: 1.1;
}

.stat-num.is-conf {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--green);
}

.stat-num.is-conf.tier-b {
  color: var(--amber);
}

.stat-num.is-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.84rem;
  color: var(--body);
}

.stat-label {
  margin-top: 3px;
  font-size: 0.7rem;
  color: var(--faint);
}

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 32px 24px;
}

.drawer-body-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0 4px;
}

.drawer-body-head .cap {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.86rem;
  color: var(--muted);
}

.drawer-body-head .meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint-2);
}

.slip {
  border-top: 1px solid var(--line-strong);
  padding: 15px 0 16px;
}

.slip:first-of-type {
  border-top: 1px solid var(--ink);
}

.slip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.slip-type {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.slip-pending {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.74rem;
  color: var(--amber);
}

.slip-id {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint-2);
}

.slip-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--body);
  margin: 0 0 13px;
}

.deflist {
  font-size: 0.82rem;
  color: var(--body);
}

.defrow {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--dotted);
}

.defrow:last-child {
  border-bottom: none;
}

.defrow .k {
  color: var(--faint);
}

.defrow .v {
  text-align: right;
}

.defrow .v.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.rev-reviewed {
  color: var(--green);
}

.rev-pending {
  color: var(--amber);
}

.drawer-foot {
  flex: 0 0 auto;
  padding: 16px 32px;
  border-top: 2px solid var(--ink);
  background: var(--paper-deep);
}

.drawer-foot p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- book detail -------------------------------------------------- */

.crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--ink);
}

.crumb .sep {
  color: var(--line-strong);
}

.crumb .here {
  font-family: var(--serif);
  color: var(--ink);
}

.crumb .crumb-note {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  color: var(--faint-2);
}

/* History-aware return link — a labeled browser-Back, stacked above the
   hierarchy crumb. Button element (it triggers history.back(), not a URL). */
.return-nav {
  padding-bottom: 10px;
}

.return-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--green);
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease);
}

.return-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.return-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* "You were here" — brief flash on the card/row the reader returns to via
   Back. app.js removes the class after the animation window; reduced-motion
   users get a still highlight for the same window instead of an animation. */
.is-return-flash {
  animation: return-flash 1.8s var(--ease);
}

@keyframes return-flash {
  0%,
  35% {
    background-color: rgba(63, 97, 80, 0.14);
    box-shadow: 0 0 0 2px var(--green-faint);
  }

  100% {
    background-color: transparent;
    box-shadow: 0 0 0 2px transparent;
  }
}

.detail-top {
  display: flex;
  gap: clamp(24px, 4vw, 40px);
  padding: 34px 0 32px;
}

/* bibliographic catalog plate */
.plate-wrap {
  flex: 0 0 220px;
}

.plate {
  border: 1px solid var(--ink);
  padding: 5px;
}

/* real cover, framed to echo the catalog plate */
.detail-cover-frame {
  border: 1px solid var(--ink);
  padding: 5px;
  background: var(--plate);
}

.detail-cover {
  display: block;
  width: 100%;
  /* Reserve the plate's space before the image arrives — same 2:3 treatment
     as .card-cover-wrap — so the detail page never shifts on cover load. */
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(40, 30, 15, 0.12), 0 8px 20px rgba(40, 30, 15, 0.10);
}

.plate-inner {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  border: 1px solid var(--line-strong);
  background: var(--plate);
  padding: 20px 18px;
}

.plate-call {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.plate-rule {
  border-top: 1px solid var(--line);
  margin: 12px 0 16px;
}

.plate-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

.plate-author {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--body);
  margin-top: 8px;
}

.plate-meta {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.76rem;
  color: var(--muted-2);
  line-height: 1.7;
}

.plate-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.74rem;
  color: var(--faint-2);
  text-align: center;
  margin: 9px 0 0;
}

/* title block */
.title-block {
  flex: 1;
  min-width: 0;
}

.detail-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-kicker .rank {
  font-family: var(--mono);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--brass);
}

.detail-kicker .sep {
  color: var(--line-strong);
}

.detail-kicker .genre {
  font-size: 0.8rem;
  color: var(--muted);
}

.detail-title {
  font-size: clamp(2rem, 4.6vw, 2.65rem);
  line-height: 1.05;
}

.detail-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--body);
  margin: 6px 0 24px;
}

.detail-hook {
  max-width: 58ch;
  margin: -10px 0 22px;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* stat ledger shares one ruled band with the book and listening actions */
.stat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding: 14px 0;
  margin-bottom: 24px;
}

.detail-stat-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 18px;
  margin-left: auto;
}

.detail-book-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 2px 6px;
}

.stat-ledger {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.stat-ledger .stat {
  padding: 0 28px;
}

.stat-ledger .stat:first-child {
  padding-left: 0;
}

.stat-ledger .stat-num {
  font-size: 1.5rem;
}

.stat-ledger .stat-label {
  font-size: 0.74rem;
  margin-top: 3px;
}

.detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.detail-actions .sep {
  color: var(--line-strong);
}

/* two-column body */
.detail-body {
  border-top: 2px solid var(--ink);
}

.detail-main {
  max-width: 780px;
  padding: 30px 0 0;
}

.doc-section {
  margin-bottom: 32px;
}

.doc-section:last-child {
  margin-bottom: 0;
}

.doc-section h2 {
  font-size: 1.24rem;
  margin: 0 0 14px;
}

.section-prose {
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

.read-if {
  margin-top: 16px;
}

.theme-titles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
}

.theme-titles li::before {
  content: "— ";
  color: var(--brass);
}

.stance-line,
.source-line {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.stance-line {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}

.source-line {
  margin-top: 16px;
}

.method-fold {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 0;
}

.method-fold > summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  margin: 0 -14px;
  padding: 14px;
  border-radius: 3px;
  cursor: pointer;
  list-style: none;
  transition:
    background-color var(--motion-fast) var(--ease),
    box-shadow var(--motion-fast) var(--ease);
}

.method-fold > summary::-webkit-details-marker { display: none; }
.method-fold > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.method-fold > summary:focus-visible,
.method-fold[open] > summary {
  background: var(--green-wash);
  box-shadow: inset 2px 0 0 var(--green);
}
.method-fold-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.24rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.method-fold-hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--faint);
  text-align: right;
}
.method-fold-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  color: var(--green);
}
.method-fold-chevron svg {
  width: 16px;
  height: 16px;
  transition: transform var(--motion-mid) var(--ease);
}
.method-fold[open] .method-fold-chevron svg { transform: rotate(180deg); }
.method-fold-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: 2px 0 24px;
}
.method-fold-body h3 { font-size: 1rem; margin: 0; }

.detail-correction {
  max-width: 780px;
  margin-top: 38px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line-strong);
}

.correction-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--green-line);
  background: rgba(63, 97, 80, 0.025);
  font-weight: 500;
}

.correction-icon {
  font-family: var(--mono);
  font-size: 1rem;
  transition: transform var(--motion-fast) var(--ease);
}

.correction-toggle[aria-expanded="true"] .correction-icon {
  transform: rotate(45deg);
}

/* score breakdown */
.score-row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) 64px;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line-row);
  font-size: 0.88rem;
  color: var(--body);
}

.score-row:last-of-type {
  border-bottom: 1px solid var(--line-row);
}

.score-bar {
  height: 5px;
  background: #e2dbcc;
}

.score-bar span {
  display: block;
  height: 100%;
  background: var(--green);
  transform-origin: left center;
}

/* score bars measure themselves out top to bottom when the Evidence & ranking
   disclosure opens — animating on detail-page mount would finish invisibly
   behind the closed fold */
.method-fold[open] .score-bar span {
  animation: grow-bar var(--motion-slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes grow-bar {
  from {
    transform: scaleX(0);
  }
}

.score-row .score-val {
  font-family: var(--mono);
  text-align: right;
  color: var(--ink);
  font-size: 0.84rem;
}

.score-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 6px;
  vertical-align: 1px;
}

.score-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 14px;
}

.score-total .label {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.score-total .val {
  font-family: var(--mono);
  font-size: 1.08rem;
  color: var(--ink);
}

/* evidence timeline */
/* expandable evidence rows: collapsed = glance line, open = full metadata */
.tl-row {
  border-top: 1px solid var(--line-row);
  font-size: 0.88rem;
}

.tl-row:last-child {
  border-bottom: 1px solid var(--line-row);
}

.tl-summary {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: 13px 0;
  cursor: pointer;
  list-style: none;
}

.tl-summary::-webkit-details-marker {
  display: none;
}

.tl-summary:hover .gloss {
  color: var(--body);
}

.tl-row > summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 3px;
}

.tl-toggle {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--faint-2);
  align-self: center;
  transition: color var(--motion-fast) var(--ease);
}

.tl-toggle::before {
  content: "+";
}

.tl-row[open] .tl-toggle::before {
  content: "−";
}

.tl-summary:hover .tl-toggle {
  color: var(--green);
}

.tl-meta {
  padding: 2px 0 16px 114px;
}

.tl-row[open] .tl-meta {
  animation: settle var(--motion-mid) var(--ease) both;
}

.tl-meta .deflist {
  max-width: 520px;
}

.tl-ep {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink);
}

.tl-desc .lead-in {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}

.tl-desc .gloss {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
}

/* drawer evidence-item source link (glance surface) */
.slip-src {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid var(--green-line);
  white-space: nowrap;
}

/* related books */
.rel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto) auto;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  margin: 0 -14px;
  text-decoration: none;
  padding: 12px 14px;
  border-top: 1px solid var(--line-row);
  border-radius: 3px;
  transition:
    background-color var(--motion-fast) var(--ease),
    box-shadow var(--motion-fast) var(--ease);
}

.rel:last-child {
  border-bottom: 1px solid var(--line-row);
}

.rel .rel-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.rel .rel-by {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

.rel .rel-sig {
  font-family: var(--mono);
  color: var(--ink);
}

.rel-arrow {
  display: inline-flex;
  color: var(--green);
  transition: transform var(--motion-fast) var(--ease);
}

.rel-arrow svg {
  width: 17px;
  height: 17px;
}

.rel:focus-visible {
  background: var(--green-wash);
  box-shadow: inset 2px 0 0 var(--green);
}

.rel:focus-visible .rel-arrow {
  transform: translateX(3px);
}

/* Hover washes are pointer-only so taps do not leave a closed control looking open. */
@media (hover: hover) {
  .method-fold > summary:hover,
  .rel:hover {
    background: var(--green-wash);
    box-shadow: inset 2px 0 0 var(--green);
  }

  .correction-toggle:hover {
    border-color: var(--green);
    background: var(--green-wash);
  }

  .rel:hover .rel-arrow {
    transform: translateX(3px);
  }
}

/* sidebar blocks */
.side-block {
  margin-bottom: 28px;
}

.side-block + .side-block {
  border-top: 1px solid var(--line-strong);
  padding-top: 20px;
}

.side-block h3 {
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.side-block p {
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--body);
  margin: 0;
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
  color: var(--body);
  line-height: 1.5;
}

.side-list li {
  padding: 5px 0;
  border-bottom: 1px dotted var(--dotted);
}

.side-list li:last-child {
  border-bottom: none;
}

.correction {
  font-size: 0.82rem;
  color: var(--body);
}

.correction .when {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
}

.correction .what {
  line-height: 1.45;
  margin-top: 2px;
}

.correction-item + .correction-item {
  border-top: 1px dotted var(--dotted);
  padding-top: 12px;
  margin-top: 12px;
}

.correction-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  max-width: 460px;
}

.correction-form[hidden] {
  display: none;
}

.correction-form .cf-row {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.correction-form textarea,
.correction-form input,
.correction-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.correction-thanks {
  margin-top: 14px;
  color: var(--green);
  font-weight: 600;
}

.correction-error {
  margin-top: 8px;
  color: #c0392b;
}

.colophon {
  padding: 22px 0 0;
  margin-top: 30px;
  border-top: 1px solid var(--line-strong);
}

.colophon p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--muted-2);
  max-width: 780px;
}

/* ---------- prose pages (methodology / changelog / episodes) ------------- */

.prose-head {
  border-top: 1px solid var(--ink);
  padding-top: 34px;
}

.prose-head h1 {
  font-size: clamp(2rem, 4.4vw, 2.6rem);
}

.lead {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 720px;
  margin: 12px 0 0;
}

.prose-section {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 36px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.prose-section h2 {
  font-size: 1.2rem;
}

.prose-section p {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.log-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.log-entry {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line-row);
}

.log-entry:last-child {
  border-bottom: 1px solid var(--line-row);
}

.log-entry .when {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--brass);
}

.log-entry p {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--body);
}

/* ---------- notices ------------------------------------------------------ */

.notice {
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--ink);
  background: var(--surface);
  padding: 26px;
  margin-top: 28px;
}

/* Reset action inside the empty search/filter state */
.empty-clear {
  margin-top: 14px;
  padding: 10px 16px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--body);
  transition:
    border-color var(--motion-fast) var(--ease),
    color var(--motion-fast) var(--ease);
}
.empty-clear:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.notice h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.notice p {
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 640px;
}

.notice p:last-child {
  margin-bottom: 0;
}

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

.site-footer {
  border-top: 1px solid var(--line-strong);
  background: var(--paper-deep);
}

.footer-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  padding: 26px var(--gutter) 30px;
}

.footer-disclaimer {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--muted-2);
  max-width: 480px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.8rem;
}

.footer-links a {
  color: var(--green);
  text-decoration: none;
}

.footer-links a:nth-last-child(-n + 3) {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- responsive --------------------------------------------------- */

@media (max-width: 980px) {
  .graph-head {
    align-items: start;
    flex-direction: column;
  }

  .graph-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-stats div:nth-child(odd) {
    border-left: none;
  }

  .graph-map {
    aspect-ratio: 1.35;
  }

  .map-node text {
    font-size: 18px;
  }

  .graph-grid {
    grid-template-columns: 1fr;
  }

  .detail-main {
    padding-top: 28px;
  }
}

@media (max-width: 860px) {
  .ledger-shell {
    display: none;
  }

  .ledger-mobile {
    display: block;
  }

  .detail-top {
    flex-direction: column;
    gap: 22px;
  }

  .plate-wrap {
    flex-basis: auto;
    max-width: 220px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14.5px;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .graph-mode {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .graph-mode button {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .graph-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-map {
    aspect-ratio: 0.72;
  }

  .map-node text {
    font-size: 16px;
  }

  .graph-stats div {
    border-left: 1px solid var(--line);
    border-top: none;
  }

  .graph-stats div:nth-child(odd) {
    border-left: none;
  }

  .graph-stats div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  /* On phones the legible part of the graph is the hubs/connections lists, so
     lead with them and push the cramped canvas below. */
  .graph-page {
    display: flex;
    flex-direction: column;
  }

  .graph-page > .graph-head {
    order: 1;
  }

  .graph-page > .graph-stats {
    order: 2;
  }

  .graph-page > .graph-grid {
    order: 3;
  }

  .graph-page > .graph-map-section {
    order: 4;
  }

  .graph-page > .method-note {
    order: 5;
  }

  .connection-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .evidence-drawer {
    width: 100vw;
  }

  .drawer-head,
  .drawer-body {
    padding-left: 22px;
    padding-right: 22px;
  }

  .drawer-foot {
    padding-left: 22px;
    padding-right: 22px;
  }

  .stat-ledger .stat,
  .stat-strip .stat {
    padding: 0 16px;
  }

  .prose-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .log-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .score-row {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .score-row .score-bar {
    display: none;
  }

  .tl-summary {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
  }

  .tl-summary .tl-ep {
    grid-column: 1 / -1;
  }

  .tl-meta {
    padding-left: 0;
  }

  .detail-top { padding-top: 22px; }
  .detail-top { flex-direction: row; align-items: flex-start; gap: 16px; }
  .plate-wrap { flex: 0 0 104px; max-width: 104px; }
  .plate-caption { display: none; }
  .plate-inner { min-height: 150px; padding: 11px 9px; }
  .plate-title { font-size: 0.88rem; }
  .plate-author, .plate-meta, .plate-call, .plate-rule { display: none; }
  .detail-title { font-size: 2rem; }
  .detail-subtitle { margin-bottom: 14px; }
  .detail-hook { margin-bottom: 16px; font-size: 1rem; }
  .stat-row { gap: 12px; margin-bottom: 16px; padding: 12px 0; }
  .detail-stat-actions { order: -1; width: 100%; flex-wrap: wrap; gap: 8px 12px; margin-left: 0; }
  .detail-stat-actions .btn-dark { order: -1; width: 100%; justify-content: center; }
  .method-fold > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 12px;
  }
  .method-fold-hint { grid-column: 1 / -1; grid-row: 2; margin-left: 0; text-align: left; }
  .method-fold-chevron { grid-column: 2; grid-row: 1; }
  .rel { grid-template-columns: minmax(0, 1fr) minmax(118px, 42%) auto; gap: 10px; }
  .rel .rel-by { font-size: 0.74rem; }
  .rel .rel-sig { display: block; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }

  .tab:active {
    transform: none !important;
  }

  /* Return flash becomes a still highlight — app.js removes the class after
     the same window, so the "you were here" cue survives without motion. */
  .is-return-flash {
    animation: none !important;
    background-color: rgba(63, 97, 80, 0.14);
    box-shadow: 0 0 0 2px var(--green-faint);
  }
}

/* ============================================================ browse cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.9rem 1.5rem;
  margin-top: 1.5rem;
}

/* Full-width reveal for the truncated default index */
.show-all {
  display: block;
  width: 100%;
  margin: 1.9rem 0 0.25rem;
  padding: 15px 20px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--body);
  transition:
    border-color var(--motion-fast) var(--ease),
    color var(--motion-fast) var(--ease),
    background var(--motion-fast) var(--ease);
}
.show-all:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(42, 37, 29, 0.03);
}
/* Quiet escape hatch under "Show 50 more" for readers who want everything */
.show-all-rest {
  display: block;
  margin: 0.7rem auto 0.25rem;
  padding: 4px 8px;
  border: none;
  background: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--motion-fast) var(--ease);
}
.show-all-rest:hover {
  color: var(--ink);
}
.book-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
}
.book-card:focus-visible {
  outline: 2px solid #1b6b4c;
  outline-offset: 5px;
  border-radius: 6px;
}
.card-cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: #e7e1d6;
  box-shadow: 0 1px 2px rgba(40, 30, 15, 0.12), 0 8px 20px rgba(40, 30, 15, 0.10);
  transition:
    transform var(--motion-mid) var(--ease),
    box-shadow var(--motion-mid) var(--ease);
}
/* hover-capable pointers only — on touch, :hover sticks after tap */
@media (hover: hover) {
  .book-card:hover .card-cover-wrap {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(40, 30, 15, 0.18), 0 16px 32px rgba(40, 30, 15, 0.18);
  }
}
.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Coverless titles (essays, blog archives, editions with no art) get a
   typographic "catalog plate" instead of a broken-looking empty box. */
.card-cover--placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55em;
  width: 100%;
  height: 100%;
  padding: 13% 11%;
  text-align: center;
  background: linear-gradient(165deg, #f3eee3, #e1d6c2);
  box-shadow: inset 0 0 0 1px rgba(120, 100, 60, 0.22);
}
.card-cover--placeholder .ph-mark {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b09a72;
}
.card-cover--placeholder .ph-title {
  font-family: "Source Serif 4", serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.18;
  color: #5a4a30;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cover--placeholder .ph-author {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9b8a68;
}
.card-rank {
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(24, 18, 10, 0.88);
  color: #f6f1e7;
  font-family: "Source Serif 4", serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.42rem 0.6rem;
  border-bottom-right-radius: 7px;
  letter-spacing: 0.01em;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.tier-badge {
  align-self: flex-start;
  font-family: "Public Sans", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1b6b4c;
  background: rgba(27, 107, 76, 0.10);
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
}
.tier-badge.tier-b {
  /* darkened gold to clear WCAG AA (5.10:1 on --paper) — same warm hue */
  color: #7f6018;
  background: rgba(127, 96, 24, 0.12);
}
.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
/* Neutral "what medium is this" marker — deliberately not green/amber so it
   reads as a type label, not a quality signal. */
.medium-badge {
  align-self: flex-start;
  font-family: "Public Sans", sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3a4a5a;
  background: rgba(58, 74, 90, 0.10);
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
}
.card-title {
  font-family: "Source Serif 4", serif;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0.2rem 0 0;
  color: #211a10;
}
.card-author {
  font-family: "Public Sans", sans-serif;
  font-size: 0.82rem;
  color: #6b6051;
  margin: 0;
}
.card-why {
  font-family: "Public Sans", sans-serif;
  font-size: 0.76rem;
  color: #8a7f6d;
  line-height: 1.35;
  margin: 0.15rem 0 0;
}
.card-hook {
  font-family: "Public Sans", sans-serif;
  font-size: 0.82rem;
  color: #8a7f6d;
  line-height: 1.35;
  margin: 0.15rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cta {
  font-family: "Public Sans", sans-serif;
  font-size: 0.73rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0.62rem;
  border-radius: 4px;
  white-space: nowrap;
  transition:
    color var(--motion-fast) var(--ease),
    background-color var(--motion-fast) var(--ease);
}
.cta-get {
  background: #211a10;
  color: #f4efe6;
}
.cta-get:hover { background: #3a2f1c; }
.cta-listen {
  background: rgba(33, 26, 16, 0.06);
  color: #3a2f1c;
}
.cta-listen:hover { background: rgba(33, 26, 16, 0.12); }
@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.3rem 1rem;
  }
}

/* ============================================================ discovery shelves */
.shelf { margin: 2.2rem 0 0; }
.shelf-title {
  font-family: "Source Serif 4", serif;
  font-size: 1.28rem;
  font-weight: 600;
  color: #211a10;
  margin: 0 0 0.9rem;
}
.shelf-rail {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  padding-bottom: 0.7rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.shelf-rail .book-card {
  flex: 0 0 188px;
  width: 188px;
  scroll-snap-align: start;
}
.all-books-title {
  font-family: "Source Serif 4", serif;
  font-size: 1.28rem;
  font-weight: 600;
  color: #211a10;
  margin: 0;
}

/* Curated "browse" rows below the ranked list. */
.browse-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(40, 30, 15, 0.13);
}
.browse-title {
  font-family: "Source Serif 4", serif;
  font-size: 1.28rem;
  font-weight: 600;
  color: #211a10;
  margin: 0;
}

/* ============================================================ episodes list */
.ep-list { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.ep-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.72rem 0.2rem;
  border-bottom: 1px solid rgba(40, 30, 15, 0.10);
}
.ep-num {
  flex: 0 0 3rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--brass);
}
.ep-divider {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 1.6rem 0 0.3rem;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid rgba(40, 30, 15, 0.18);
}
.ep-divider-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}
.ep-divider-note {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}
.ep-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ep-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}
.ep-books {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.18rem;
}
.ep-books--none { font-style: italic; color: var(--faint-2); }
.ep-book {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  text-decoration: none;
}
.ep-book:hover .ep-book-title,
.ep-book:focus-visible .ep-book-title {
  color: var(--green);
  text-decoration: underline;
}
.ep-book-cover,
.ep-book-cover--blank {
  flex: 0 0 auto;
  width: 22px;
  height: 32px;
  border-radius: 2px;
}
.ep-book-cover {
  object-fit: cover;
  background: var(--plate);
  box-shadow: 0 1px 2px rgba(40, 30, 15, 0.18);
}
.ep-book-cover--blank {
  display: inline-block;
  background:
    repeating-linear-gradient(45deg, rgba(40, 30, 15, 0.06), rgba(40, 30, 15, 0.06) 3px, transparent 3px, transparent 6px),
    var(--plate);
}
.ep-book-title { line-height: 1.2; }
.ep-book--plain { color: var(--faint-2); font-style: italic; }
.ep-listen {
  flex: 0 0 auto;
  align-self: center;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
}
.ep-listen:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .ep-num { flex-basis: 2.4rem; }

  /* The index is long on a phone: three shelf rails stacked above the full
     ranked grid. Keep the two most distinct curated cuts (Start here +
     Hidden gems) and drop the niche "Most reread" rail to shorten the page. */
  .shelf--reread { display: none; }
}

/* ============================================================ drawer cover + ctas */
.drawer-id { display: flex; gap: 1rem; align-items: flex-start; margin-top: 0.4rem; }
.drawer-cover {
  flex: 0 0 76px;
  width: 76px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(40, 30, 15, 0.16), 0 6px 14px rgba(40, 30, 15, 0.14);
  background: #e7e1d6;
}
.drawer-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: #9b8a68;
  background: linear-gradient(160deg, #efe9dd, #d8cdb9);
}
.drawer-id-text { flex: 1 1 auto; min-width: 0; }
.drawer-cta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.cta-page { background: rgba(63, 97, 80, 0.12); color: var(--green); }
.cta-page:hover { background: rgba(63, 97, 80, 0.2); }

/* ============================================================ force graph (Obsidian-style) */
.graph-map-section {
  background: #f6f2ea;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 1.3rem;
}
.graph-map {
  margin: 0;
  border: 0;
  border-radius: 0;
}
#force-graph {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#force-graph:active { cursor: grabbing; }
.fg-node text { user-select: none; }
.graph-legend {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-top: 1px solid var(--line);
  background: var(--plate);
}
.graph-legend-label {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--faint-2);
  text-transform: uppercase;
}
.graph-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.graph-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.76rem;
  line-height: 1.2;
}
.graph-legend-swatch {
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border: 1px solid rgba(42, 37, 29, 0.4);
  border-radius: 50%;
  background: var(--graph-node-color);
}
.graph-hint {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--faint);
  text-align: center;
  padding: 0.55rem;
  margin: 0;
  border-top: 1px solid var(--line);
  background: var(--plate);
}

@media (max-width: 560px) {
  .graph-legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
}

/* ---------------------------------------------------- mobile bottom tab bar */
/* Desktop keeps the top nav; phones/small tablets get a thumb-zone tab bar. */
.tabbar,
.more-sheet,
.sheet-backdrop {
  display: none;
}

@media (max-width: 720px) {
  /* slim the header — hide the wrapping desktop links, keep the wordmark */
  .top-nav {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .top-nav .nav-links {
    display: none;
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: rgba(248, 245, 238, 0.98);
    -webkit-backdrop-filter: blur(18px) saturate(105%);
    backdrop-filter: blur(18px) saturate(105%);
    border-top: 1px solid rgba(42, 37, 29, 0.14);
    box-shadow: 0 -8px 24px rgba(42, 37, 29, 0.08);
    padding: 3px 4px env(safe-area-inset-bottom);
  }

  /* A quiet fade separates the dock from imagery scrolling underneath it. */
  .tabbar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 12px;
    background: linear-gradient(to top, rgba(42, 37, 29, 0.045), transparent);
    pointer-events: none;
  }

  .tabbar.has-open-sheet {
    z-index: 65;
  }

  .tab {
    flex: 1 1 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 58px;
    padding: 7px 4px 6px;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    color: var(--muted);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition:
      color var(--motion-fast) var(--ease),
      transform var(--motion-fast) var(--ease);
  }

  .tab::before {
    content: "";
    position: absolute;
    inset: 5px clamp(8px, 3vw, 12px);
    border-radius: 9px;
    background: var(--brass-soft);
    opacity: 0;
    transform: scale(0.96);
    transition:
      opacity var(--motion-fast) var(--ease),
      transform var(--motion-fast) var(--ease);
  }

  .tab:active {
    transform: scale(0.97);
  }

  /* icons use currentColor (stroke or fill), so the label + icon recolor together */
  .tab svg {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    display: block;
  }
  .tab span {
    position: relative;
    z-index: 1;
    line-height: 1;
  }
  .tab.is-active,
  .tab[aria-expanded="true"] {
    color: var(--ink);
  }
  .tab.is-active::before,
  .tab[aria-expanded="true"]::before {
    opacity: 1;
    transform: scale(1);
  }
  .tab.is-active span,
  .tab[aria-expanded="true"] span {
    font-weight: 600;
  }
  .tab:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: -5px;
  }

  /* keep the fixed bar from covering the last content */
  .site-footer {
    padding-bottom: calc(var(--mobile-tabbar-offset) + env(safe-area-inset-bottom) + 18px);
  }

  /* "More" sheet — modeled on the evidence drawer */
  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(35, 32, 25, 0.34);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity var(--motion-mid) var(--ease),
      visibility 0s linear var(--motion-mid);
  }
  .sheet-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--motion-mid) var(--ease);
  }

  .more-sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-tabbar-offset) + env(safe-area-inset-bottom));
    z-index: 60;
    background: var(--surface);
    border-top: 1px solid var(--line-strong);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 34px rgba(40, 30, 15, 0.18);
    padding: 6px 22px 18px;
    transform: translateY(calc(106% + var(--mobile-tabbar-offset) + env(safe-area-inset-bottom)));
    transition: transform var(--motion-mid) var(--ease);
  }
  .more-sheet.is-open {
    transform: translateY(0);
  }
  .sheet-handle {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    margin: 8px auto 6px;
  }
  .more-link {
    display: block;
    padding: 16px 2px;
    font-family: var(--serif);
    font-size: 1.12rem;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line-row);
  }
  .more-link:last-child {
    border-bottom: none;
  }
  .more-cta {
    color: var(--green);
    font-weight: 600;
  }

  /* ----- lighter index top on mobile ----- */

  /* smaller, tighter hero so books appear sooner */
  .index-title {
    font-size: clamp(1.38rem, 4.3vw, 1.72rem);
    line-height: 1.2;
  }

  /* search becomes a clear boxed field; drop the desktop ⌘K hint */
  .search {
    margin-top: 18px;
    padding: 4px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
  }
  /* F-009: the input itself is the tap target — give it a >=44px hit area */
  .search input {
    min-height: 44px;
  }
  .search-hint {
    display: none;
  }

  /* Keep the four everyday controls visible at common phone widths. Expanded
     filters still scroll horizontally, with the next partial chip acting as
     the continuation cue. */
  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    width: calc(100% + var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    margin-top: 14px;
    padding-bottom: 2px;
  }
  .filter-row::-webkit-scrollbar {
    display: none;
  }
  .filter {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-left: 7px;
    padding-right: 7px;
    font-size: 0.75rem;
    /* F-009: >=44px tap target on mobile without changing the visual box much */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .filter-row {
    gap: 5px;
  }
  .filter-more {
    gap: 4px;
  }
  .filter-more-icon {
    width: 12px;
    height: 12px;
  }

  /* drop the coverage scope + count on mobile — they just waste vertical space */
  .list-scope,
  .list-count {
    display: none;
  }

  /* tighter section gap + uniform shelf cards (rail was sized to the tallest
     title, leaving dead space under shorter cards — read as a big gap) */
  .shelf {
    margin-top: 1.5rem;
  }
  .shelf-rail .card-title,
  .shelf-rail .card-why {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* drawer actions fill the width: Get + Listen share a row, View full page below */
  .drawer-cta .cta {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .drawer-cta .cta-get,
  .drawer-cta .cta-listen {
    flex: 1 1 0;
  }
  .drawer-cta .cta-page {
    flex: 1 1 100%;
  }
}

/* --- lens toggle (Most Covered / Most Loved) --- */
.lens-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.lens-toggle .lens {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 16px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-soft);
  transition:
    color var(--motion-fast) var(--ease),
    background-color var(--motion-fast) var(--ease);
}
.lens-toggle .lens.is-selected {
  background: var(--green);
  color: #fff;
}

/* --- lens explainer note --- */
.lens-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 760px;
}
.lens-note strong {
  font-weight: 600;
  color: var(--ink);
}

/* --- endorsement stance label (David's take, in plain words) --- */
.card-stance {
  margin: 4px 0 0;
}
.stance-badge {
  font-size: 12px;
  font-weight: 600;
}
.stance-reveres { color: #8a6320; }
.stance-strong { color: #3f6b54; }
.stance-recommends { color: #4a5872; }
.stance-neutral { color: #6b6558; }
.stance-critical { color: #9a5b4a; }
.stance-none { display: none; }

/* --- detail-page endorsement block --- */
.endorsement-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.endorsement-basis {
  margin: 12px 0 0;
  padding: 8px 14px;
  border-left: 3px solid var(--green);
  color: var(--ink-soft);
  font-style: italic;
}

/* --- detail-page: reader-first restructure (themes, synthesis, folded proof) --- */
.theme-list {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 10px;
}
.theme-list li {
  line-height: 1.55;
}
.read-if {
  margin-top: 12px;
}
.editorial-note {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--faint);
}
/* ---------- evidence drawer: decision surface (stance, hook, synthesis) --- */

.drawer-pitch {
  margin: 18px 0 20px;
}

.drawer-stance {
  margin: 0 0 8px;
}

.drawer-about {
  margin: 4px 0 22px;
}

.drawer-about .drawer-prose {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
}

.drawer-why {
  margin: 0 0 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.drawer-section-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint-2);
  margin: 0 0 10px;
}

.drawer-prose {
  font-family: var(--serif);
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--body);
  margin: 0 0 10px;
}

.drawer-prose:last-child {
  margin-bottom: 0;
}

.drawer-readif {
  margin-top: 4px;
}

.drawer-signals {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.drawer-more {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--muted);
}
