:root {
  --bg: #fbf9f5; --fg: #1d1b18; --muted: #6f6a62; --faint: #a39d93; --rule: #e6e1d8;
  --hi: #f3eee4; --accent: #8a4b2a; --orig: #3a3631;
  --fs: 19px; --measure: 38rem;
  --serif: "Source Serif 4", Georgia, serif;
  --greek: "Gentium Book Plus", "Gentium Plus", "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161514; --fg: #e8e4dc; --muted: #9c968c; --faint: #6b665e; --rule: #2c2a27;
    --hi: #211f1c; --accent: #d49a72; --orig: #cfc9bf;
  }
}
:root[data-theme="dark"] {
  --bg: #161514; --fg: #e8e4dc; --muted: #9c968c; --faint: #6b665e; --rule: #2c2a27;
  --hi: #211f1c; --accent: #d49a72; --orig: #cfc9bf;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--serif);
  font-size: var(--fs); line-height: 1.62; font-optical-sizing: auto;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* Top bar: identical on every page */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 14px; }
.bar-inner { max-width: 76rem; margin: 0 auto; padding: 0 16px; height: 3.25rem; display: flex; align-items: center; gap: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; flex: none; }
.brand img { width: 26px; height: 26px; display: block; }
.brand span { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: .005em; color: var(--fg); position: relative; top: 1px; }
.brand:hover span { color: var(--accent); }
.crumb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  padding-left: .9rem; border-left: 1px solid var(--rule); line-height: 1.2; }
.crumb a { color: inherit; text-decoration: none; } .crumb a:hover { color: var(--fg); }
.spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; flex: none; background: var(--bg); }
.seg button, .icon { font: inherit; font-size: 13px; background: none; border: 0; color: var(--muted);
  padding: .35rem .7rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.icon { border: 1px solid var(--rule); border-radius: 8px; min-width: 2.2rem; height: 2rem; flex: none; background: var(--bg); }
.icon:hover, .seg button:hover:not([aria-pressed="true"]) { color: var(--fg); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--accent); width: 0; }

/* Title block */
.head { max-width: 76rem; margin: 0 auto; padding: 4rem 16px 1rem; }
.head .author { font-family: var(--sans); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.1; margin: .4rem 0 .3rem; font-weight: 600; letter-spacing: -.01em; }
.head .orig-title { font-family: var(--greek); font-size: 1.3rem; color: var(--muted); }
.intro { max-width: var(--measure); margin: 2rem 0 0; color: var(--fg); }
.intro p { margin: 0 0 1em; }
.meta { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 1.5rem; line-height: 1.55; max-width: var(--measure); text-wrap: pretty; }
.toc { max-width: 76rem; margin: 0 auto; padding: 0 16px 2rem; font-family: var(--sans); font-size: 14px; }
.toc-in { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-block: 1rem; }
.toc h2 { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2 16rem; column-gap: 2.5rem; }
.toc li.grp { break-inside: avoid; margin: 0 0 .7rem; }
.toc li.grp > a { font-weight: 600; }
.toc li.grp ul { columns: auto; margin: .15rem 0 0; padding-left: .9rem; }
.toc li.grp ul li { margin: .15rem 0; }
.toc a { text-decoration: none; } .toc a:hover { color: var(--accent); }
.toc .n { color: var(--faint); font-variant-numeric: tabular-nums; margin-left: .35rem; font-size: 12px; }

/* Text */
.text { max-width: 76rem; margin: 0 auto; padding: 0 16px 6rem; }
.colheads, .row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1.12fr); column-gap: 2.75rem; }
.colheads { position: sticky; top: 2.9rem; z-index: 5; background: var(--bg); font-family: var(--sans);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: .6rem 0; border-bottom: 1px solid var(--rule); margin-bottom: 1rem; }
.colheads span:first-child { grid-column: 2; } 
h2.speech { font-size: 1.55rem; font-weight: 600; margin: 3.5rem 0 .2rem; grid-column: 1 / -1; }
.speech-sub { font-family: var(--sans); font-size: 14px; color: var(--muted); margin: 0 0 1.5rem; max-width: var(--measure); }
h3.part { font-family: var(--sans); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  font-weight: 600; margin: 2.8rem 0 1rem; }
/* Off-screen rows skip layout and paint until scrolled near: long books render instantly. */
.row { content-visibility: auto; contain-intrinsic-size: auto 12rem; }
.row { position: relative; border-radius: 6px; margin: 0 -.75rem; padding: .35rem .75rem; }
.row.para { margin-top: .9rem; }
.row:hover, .row.active { background: var(--hi); }
.gut { font-family: var(--sans); font-size: 12px; color: var(--faint); padding-top: .42em; font-variant-numeric: tabular-nums; }
.gut a { text-decoration: none; } .gut a:hover { color: var(--accent); }
.orig { font-family: var(--greek); color: var(--orig); font-size: .96em; line-height: 1.66; }
.en p, .orig p { margin: 0; }
.st { font-family: var(--sans); font-size: 10.5px; color: var(--faint); vertical-align: .45em; padding: 0 .12em; user-select: none; cursor: help; letter-spacing: .02em; }
.spk { font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-right: .5em; }
.orig .spk { color: var(--faint); }
.nref { font-family: var(--sans); font-size: 11px; color: var(--accent); background: none; border: 0; padding: 0 .15em; cursor: pointer; vertical-align: .4em; line-height: 1; }
.note { display: none; font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted);
  border-left: 2px solid var(--accent); padding: .2rem 0 .2rem .75rem; margin: .6rem 0 .2rem; }
.row.show-note .note { display: block; }

/* Modes */
body.mode-en .orig, body.mode-en .colheads span:first-child { display: none; }
body.mode-orig .en, body.mode-orig .colheads span:last-child { display: none; }
body.mode-en .row, body.mode-en .colheads, body.mode-orig .row, body.mode-orig .colheads { grid-template-columns: 3rem minmax(0, var(--measure)); }
body.mode-en .colheads, body.mode-orig .colheads { display: none; }

/* Mobile */
@media (max-width: 820px) {
  :root { --fs: 18px; }
  .head { padding-top: 2.5rem; }
  .colheads { display: none !important; }
  .row, body.mode-en .row, body.mode-orig .row { grid-template-columns: minmax(0, 1fr); margin: 0 -.5rem; padding: .3rem .5rem; }
  .gut { display: none; }
  .row .orig { order: 2; }
  body.mode-both .orig, .row.show-orig .orig { display: block; font-size: .9em; margin: .5rem 0 .4rem; padding-left: .75rem; border-left: 2px solid var(--rule); }
  body.mode-en .row { cursor: pointer; }
  .row:hover { background: none; } .row.active, .row.show-orig { background: var(--hi); }
  .crumb { display: none; } .brand span { font-size: 18px; }
  .row.para { margin-top: .75rem; }
}
@media (max-width: 420px) { .bar-inner { gap: .5rem; } .bar .seg button { padding: .35rem .55rem; } }

/* Library */
.lib { max-width: 76rem; margin: 0 auto; padding: 4.5rem 16px 6rem; }
.lib-head { margin-bottom: 3.5rem; }
.lib h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); line-height: 1.05; margin: 0 0 1rem; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.lib .lede { font-size: 1.2rem; line-height: 1.5; color: var(--muted); max-width: none; margin: 0; text-wrap: pretty; }
.author-block { display: grid; grid-template-columns: 14rem minmax(0, 1fr); column-gap: 2.5rem; border-top: 1px solid var(--rule); padding: 2rem 0 2.2rem; }
.author-block h2 { font-size: 1.45rem; font-weight: 600; margin: .1rem 0 0; line-height: 1.3; }
.author-block .dates { display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: .25rem; font-variant-numeric: tabular-nums; }
.author-block ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.6rem 2.5rem; }
.work { display: grid; gap: .15rem; text-decoration: none; color: inherit; }
.work .t { font-size: 1.2rem; font-weight: 600; line-height: 1.25; }
.work .o { font-family: var(--greek); font-size: .95rem; color: var(--faint); }
.work .d { font-size: .98rem; color: var(--muted); line-height: 1.45; margin-top: .15rem; }
a.work:hover .t { color: var(--accent); }
.work.soon .t { color: var(--muted); }
.soon-tag { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: .2rem; }
.lib .foot { border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 1rem; font-family: var(--sans); font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 40rem; }
@media (max-width: 700px) {
  .lib { padding-top: 3rem; }
  .author-block { grid-template-columns: 1fr; row-gap: 1.1rem; padding: 2.2rem 0 2.4rem; }
  /* One column: make philosopher vs. book obvious — bigger name, smaller titles, books hung under a rule */
  .author-block h2 { font-size: 1.85rem; line-height: 1.15; letter-spacing: -.01em; }
  .author-block .dates { font-size: 13px; margin-top: .35rem; }
  .author-block ul { border-left: 2px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); padding-left: 1rem; gap: 1.25rem; }
  .work .t { font-size: 1.05rem; }
  .work .o { font-size: .88rem; }
  .work .d { font-size: .93rem; }
}

/* Author's own footnotes (e.g. Hume) */
.row.fn { font-size: .86em; color: var(--muted); }
.row.fn .orig, .row.fn .en { padding-left: 1rem; border-left: 1px solid var(--rule); }

/* Editorial substitution for an offensive term in an original text */
.ed { font-style: italic; color: var(--muted); cursor: help; }

/* Famous passages */
:root { --fam-bg: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.famous-list { max-width: 76rem; margin: 0 auto; padding: 0 16px 1.5rem; font-family: var(--sans); font-size: 14px; }
.famous-list h2 { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .5rem; }
.famous-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.famous-list li a { display: inline-block; text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--rule)); color: var(--fg);
  border-radius: 999px; padding: .25rem .7rem; background: var(--fam-bg); }
.famous-list li a:hover { border-color: var(--accent); color: var(--accent); }
.fam { margin: 2rem 0 .1rem; padding-left: calc(3rem + 2.75rem); font-family: var(--sans); font-size: 13.5px; line-height: 1.45; display: grid; gap: .1rem; scroll-margin-top: 5rem; }
.fam-tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.fam-t { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--fg); }
.fam-why { color: var(--muted); max-width: 44rem; }
.row.famous { background: var(--fam-bg); box-shadow: inset 3px 0 0 var(--accent); }
.row.famous:hover, .row.famous.active { background: color-mix(in srgb, var(--accent) 11%, var(--bg)); }
body.mode-en .fam, body.mode-orig .fam { padding-left: calc(3rem + 2.75rem); }
@media (max-width: 820px) { .fam { padding-left: 0; } body.mode-en .fam, body.mode-orig .fam { padding-left: 0; } .row.famous { background: var(--fam-bg); } }

/* Keeping your place: resume / back pill and contents button */
.float-ui { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  display: flex; justify-content: center; align-items: center; gap: .5rem; pointer-events: none; padding-inline: 16px; }
.pill, .fab { pointer-events: auto; font-family: var(--sans); font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.pill { display: inline-flex; align-items: stretch; background: var(--fg); color: var(--bg); border-radius: 999px; overflow: hidden; max-width: 100%; }
.pill[hidden], .fab[hidden] { display: none; }
.pill button { font: inherit; color: inherit; background: none; border: 0; padding: .6rem 1rem; cursor: pointer; white-space: nowrap; }
.pill button[data-act="close"] { padding: .6rem .85rem; opacity: .7; border-left: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); }
.pill button:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); }
.fab { position: absolute; right: 16px; bottom: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--rule); border-radius: 999px; padding: .5rem .9rem; cursor: pointer; }
.fab:hover { border-color: var(--muted); }
@media (max-width: 820px) { .fab { right: 12px; } .pill { font-size: 13.5px; } }
@media (max-width: 520px) { .float-ui { justify-content: flex-start; } }

/* Paragraph breaks inside a chunk; long works split into one page per book */
.orig p + p, .en p + p { margin-top: .45em; }
.head-part { padding-top: 3rem; padding-bottom: 1.5rem; }
.head-part .author a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
.head-part .author a:hover { color: var(--accent); }
.head-part h1 { margin-bottom: .2rem; }
.part-sub { font-size: 1.15rem; color: var(--muted); margin: 0; max-width: var(--measure); }
.partnav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; font-family: var(--sans); font-size: 14px; margin: 1.75rem 0 0; max-width: var(--measure); }
.partnav > :last-child { text-align: right; }
.partnav a { text-decoration: none; color: var(--muted); } .partnav a:hover { color: var(--accent); }
.text > .partnav { border-top: 1px solid var(--rule); padding-top: 1.25rem; margin-top: 3rem; }
.pill .pill-link { color: inherit; text-decoration: none; padding: .6rem 1rem; white-space: nowrap; }

/* Book opening: intro on the left, famous passages + contents on the right */
.head { padding-bottom: 2.5rem; }
.front { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); column-gap: 4rem; align-items: start; margin-top: 2rem; }
.front .intro { margin-top: 0; }
.front-side { display: grid; gap: 1.75rem; font-family: var(--sans); font-size: 14px; }
.front-side .famous-list, .front-side .toc { max-width: none; margin: 0; padding: 0; }
.front-side .toc-in { border: 0; padding: 0; }
.front-side h2 { margin-bottom: .6rem; }
.front-side .toc ul { columns: 1; }
.front-side .toc li.grp { margin-bottom: .55rem; }
@media (max-width: 980px) {
  .front { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; }
  .front-side { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
  .front-side .toc ul { columns: 2 15rem; }
}

/* Contents beside the intro; famous passages as a full-width band beneath */
.head .famous-list { max-width: none; margin: 2.5rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid var(--rule); }
.head .famous-list .toc-in { border: 0; padding: 0; }
.toc-sub { display: block; font-size: 12.5px; color: var(--muted); margin: .1rem 0 .15rem; line-height: 1.4; }
.front-side .toc li.grp > .n { margin-left: .35rem; }

/* In-page contents on a book-part page */
.head-part .part-toc { max-width: none; margin: 2rem 0 0; padding: 0; }
.head-part .part-toc .toc-in { border-top: 1px solid var(--rule); border-bottom: 0; padding-top: 1.25rem; }
.head-part .part-toc ul { list-style: none; padding: 0; columns: 3 14rem; column-gap: 2.5rem; }
.head-part .part-toc li { margin: .2rem 0; break-inside: avoid; }
.head-part .famous-list { max-width: none; margin: 1.25rem 0 0; padding: 0; }
.head-part .famous-list .toc-in { border: 0; padding: 0; }

/* Classical Chinese originals: system serif CJK faces (no web font download) */
.orig[lang="ar"], [lang="ar"].o, .orig-title[lang="ar"] {
  font-family: "Noto Naskh Arabic", "Amiri", "Geeza Pro", serif; direction: rtl; text-align: right; unicode-bidi: isolate;
  font-size: 1.12em; line-height: 1.95; letter-spacing: 0; font-style: normal;
}
.orig[lang="ar"] .ed, .orig[lang="ar"] .st { unicode-bidi: isolate; }
.orig[lang="fa"], [lang="fa"].o, .orig-title[lang="fa"] {
  font-family: "Noto Naskh Arabic", "Amiri", "Geeza Pro", serif; direction: rtl; text-align: right; unicode-bidi: isolate;
  font-size: 1.12em; line-height: 1.95; letter-spacing: 0; font-style: normal;
}
.orig[lang="he"], [lang="he"].o, .orig-title[lang="he"] {
  font-family: "Noto Serif Hebrew", "SBL Hebrew", "Times New Roman", serif; direction: rtl; text-align: right; unicode-bidi: isolate;
  font-size: 1.15em; line-height: 1.85; letter-spacing: 0; font-style: normal;
}
.orig[lang="fa"] .ed, .orig[lang="fa"] .st, .orig[lang="he"] .ed, .orig[lang="he"] .st { unicode-bidi: isolate; }
.orig[lang="sa"], [lang="sa"].o, .orig-title[lang="sa"] {
  font-family: "Noto Serif Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", serif;
  line-height: 1.9;
}
.orig[lang="lzh"], [lang="lzh"].o, .orig-title[lang="lzh"] {
  font-family: "Songti TC", "STSong", "Noto Serif CJK TC", "Noto Serif TC", "Source Han Serif TC", "PMingLiU", "MingLiU", serif;
  letter-spacing: .04em; line-height: 1.9;
}

.orig[lang="ja"], [lang="ja"].o, .orig-title[lang="ja"] {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  letter-spacing: .03em; line-height: 1.9;
}
.orig[lang="gu"], [lang="gu"].o, .orig-title[lang="gu"] {
  font-family: "Noto Serif Gujarati", "Gujarati Sangam MN", "Shruti", serif; line-height: 1.9;
}

/* Room after the last passage so a jump to it can bring it to the top */
.text { padding-bottom: max(6rem, 45vh); }

/* Display-settings menu (Aa) */
.menu { position: relative; flex: none; }
.panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30; background: var(--bg); border: 1px solid var(--rule);
  border-radius: 10px; padding: .75rem .85rem; box-shadow: 0 10px 30px rgba(0,0,0,.14); min-width: 15.5rem; display: grid; gap: .65rem; }
.panel[hidden] { display: none; }
.row2 { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 13.5px; }
.icon:focus-visible, .seg button:focus-visible, .pill button:focus-visible, .fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon:focus:not(:focus-visible) { outline: none; }

/* One-line description under a section heading */
h3.part + .part-desc { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted); margin: -.6rem 0 1.1rem; max-width: var(--measure); }

/* Key terms */
.term { text-decoration: underline dotted color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: .22em; text-decoration-thickness: 1.5px; cursor: help; }
.term:hover, .term:focus-visible { color: var(--accent); outline: none; }
.term-pop { position: absolute; z-index: 40; background: var(--bg); color: var(--fg); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: .75rem .9rem; font-family: var(--sans); font-size: 14px; line-height: 1.5; }
.term-pop[hidden] { display: none; }
.term-pop .tp-head strong { font-family: var(--serif); font-size: 1.05rem; }
.term-pop .tp-orig { font-family: var(--greek); color: var(--accent); }
.term-pop .tp-tr { color: var(--muted); font-style: italic; }
.term-pop p { margin: .35rem 0 0; color: var(--fg); }
/* Reader's guide: about the author, who's who, key terms */
.guide { display: grid; gap: 2rem; margin-top: 2.5rem;
  padding-top: 1.5rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
.guide h2 { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.guide p { margin: 0; color: var(--fg); }
.guide dl { margin: 0; columns: 3 15rem; column-gap: 2.5rem; }
.guide dl > div { break-inside: avoid; margin-bottom: .7rem; }
.guide .g-col > p { max-width: 44rem; }
.guide dt { font-weight: 600; color: var(--fg); }
.guide dd { margin: .1rem 0 0; color: var(--muted); }
.guide .g-orig { font-family: var(--greek); font-weight: 400; color: var(--accent); }
.guide .g-tr { font-weight: 400; color: var(--muted); font-style: italic; }
/* Outline mode */
.skim-link { display: block; font: inherit; font-size: 13px; color: var(--accent); background: none; border: 0; padding: 0; margin: -.2rem 0 .7rem; cursor: pointer; }
.skim-link:hover { text-decoration: underline; }
.outline-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
body.skim .row, body.skim .fam, body.skim .colheads { display: none !important; }
body.skim h2.speech, body.skim h3.part, body.skim .part-desc, body.skim .speech-sub { cursor: pointer; }
body.skim h3.part { margin: 1.6rem 0 .5rem; }
body.skim h3.part:hover, body.skim h2.speech:hover { color: var(--accent); }
body.skim .text::before { content: "Outline — tap any section to read it"; display: block; font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 1rem 0 0; }
.outline-row { display: none !important; }
.outline-row button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
@media (max-width: 560px) { .outline-btn { display: none !important; } .outline-row { display: flex !important; } }

/* ── Library timeline: a rail down the side, a node per author, era dividers with small line drawings ── */
.timeline { --rail: 17px; --pad: 52px; --icon: 36px; --dot: 12px;   /* whole pixels so thin rings render crisply */
  position: relative; padding-left: var(--pad); }
/* everything on the rail is centered on the line: line center = --rail + 1px (it is 2px wide) */
.timeline::before { content: ""; position: absolute; left: var(--rail); top: .5rem; bottom: 0; width: 2px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 55%, var(--rule)), var(--rule) 92%, transparent); }
.timeline .author-block { position: relative; }
.timeline .author-block::before { content: ""; position: absolute; left: calc(var(--rail) + 1px - var(--pad) - var(--dot) / 2); top: 2.55rem; width: var(--dot); height: var(--dot);
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-sizing: border-box; }
.era { position: relative; display: flex; align-items: baseline; gap: .75rem; margin: 2.6rem 0 .4rem; }
.era:first-child { margin-top: 1rem; }
.era-icon { position: absolute; left: calc(var(--rail) + 1px - var(--pad) - var(--icon) / 2); top: -.45rem; width: var(--icon); height: var(--icon); display: grid; place-items: center;
  background: var(--bg); color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--rule)); border-radius: 50%; }
.era-icon svg { width: 1.35rem; height: 1.35rem; }
.era-name { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.era-span { font-family: var(--sans); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.timeline .era + .author-block { border-top: none; padding-top: 1.1rem; }
.timeline .era + .author-block::before { top: 1.65rem; }
@media (max-width: 700px) {
  .timeline { --rail: 10px; --pad: 34px; --icon: 30px; }
  .timeline .author-block::before { top: 2.85rem; }
  .timeline .era + .author-block::before { top: 1.95rem; }
  .era-icon { top: -.35rem; }
  .era-icon svg { width: 1.1rem; height: 1.1rem; }
  .timeline .author-block ul { border-left: none; padding-left: 0; }   /* the rail does the grouping now */
}

/* Downloads on a work's landing page: PDF, parallel-text PDF, EPUB, Send to Kindle (files made by scripts/export.py) */
.dl { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem 1.1rem; margin-top: 1.4rem; padding-top: 1rem;
  border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 14px; max-width: var(--measure); position: relative; }
.dl-h { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dl > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem 1.1rem; }
.dl > ul > li { display: inline-flex; align-items: baseline; gap: .35rem; }
.dl a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .22em; }
.dl a:hover { color: var(--accent); text-decoration-color: currentColor; }
.dl-sz { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kindle { position: relative; }
.kindle-btn { font: inherit; font-size: 13px; color: var(--fg); background: var(--bg); border: 1px solid var(--rule); border-radius: 999px;
  padding: .2rem .75rem; cursor: pointer; }
.kindle-btn:hover, .kindle-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.dl a:focus-visible, .kindle-btn:focus-visible, .kp-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kindle-pop:focus { outline: none; }   /* focus moves to the dialog itself when it opens */
.kindle-pop a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.kindle-pop { position: absolute; left: 0; top: calc(100% + .5rem); z-index: 30; width: min(22rem, calc(100vw - 32px));
  background: var(--bg); color: var(--fg); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14);
  padding: .75rem .9rem .8rem; font-size: 14px; line-height: 1.5; }
.kindle-pop[hidden] { display: none; }
.kp-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.kp-top strong { font-weight: 600; }
.kp-x { font: inherit; font-size: 20px; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; padding: .1rem .35rem; margin-right: -.35rem; }
.kp-x:hover { color: var(--fg); }
.kindle-pop ol { margin: 0; padding-left: 1.25rem; }
.kindle-pop li + li { margin-top: .35rem; }
.kp-again { margin: .65rem 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) {
  .kindle { position: static; }                      /* popover spans the download row instead */
  .kindle-pop { left: 0; right: 0; width: auto; }
}

/* Multi-page works: make the way into the text obvious. */
.start-reading { display: inline-flex; flex-direction: column; gap: .1rem; margin-top: 1.4rem; padding: .7rem 1.1rem .75rem;
  border-radius: 8px; background: var(--fg); color: var(--bg); text-decoration: none; font-family: var(--sans); line-height: 1.25; }
.start-reading:hover { background: var(--accent); color: var(--bg); }
.start-reading .sr-k { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.start-reading .sr-t { font-size: 16px; font-weight: 600; }
.toc-note { margin: -.2rem 0 .8rem; font-size: 13px; color: var(--muted); }
.split-toc ul { list-style: none; padding: 0; }
.front-side .split-toc ul { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.split-toc li.grp { position: relative; margin: 0 !important; padding: .7rem .9rem 2rem; border: 1px solid var(--rule); border-radius: 8px;
  transition: border-color .15s, background .15s; }
.split-toc li.grp:hover { border-color: var(--accent); }
.split-toc li.grp > a { color: var(--fg); font-size: 15px; }
.split-toc li.grp > a::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }   /* whole card clickable */
.split-toc .toc-go { position: absolute; left: .9rem; bottom: .6rem; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.split-toc li.grp:hover .toc-go { text-decoration: underline; text-underline-offset: .2em; }

/* Site footer and the short legal pages */
.site-foot { display: flex; justify-content: center; gap: .6rem; padding: 2.5rem 16px 3rem; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); text-decoration: none; } .site-foot a:hover { color: var(--accent); }
.legal { max-width: 40rem; } .legal p { line-height: 1.65; margin: 0 0 1.1rem; }
.legal .updated { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.legal a { color: var(--accent); }

/* Passage of the day (home card and /today/) */
.daily { max-width: 46rem; margin: -1.5rem 0 3.5rem; padding: 1.4rem 1.5rem 1.2rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--hi); }
.daily-eyebrow { margin: 0 0 .5rem; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.daily-title { margin: 0 0 .25rem; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.daily-by { margin: 0 0 1rem; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.daily-by a { color: inherit; } .daily-ref { opacity: .8; }
.daily-text { margin: 0; padding: 0 0 0 1rem; border-left: 3px solid var(--accent); font-size: 1.05rem; line-height: 1.6; }
.daily-text p { margin: 0 0 .7rem; }
.daily:not(.daily-full) .daily-text { max-height: 13.5em; overflow: hidden; }
.daily .daily-text.clamped { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }   /* fade only when the passage is cut off */
.daily-why { margin: .9rem 0 .6rem; font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--muted); }
.daily-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0; font-family: var(--sans); font-size: 14px; font-weight: 600; }
.daily-links a { color: var(--accent); text-decoration: none; } .daily-links a:hover { text-decoration: underline; }
.daily-orig { margin: 1rem 0 0; font-size: .98rem; } .daily-orig summary { cursor: pointer; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.daily-orig > div { margin-top: .6rem; padding-left: 1rem; border-left: 3px solid var(--rule); color: var(--orig); }
.daily-full { margin: 0 auto; } .today-page { max-width: 50rem; }
@media (max-width: 600px) { .daily { padding: 1.1rem 1rem 1rem; margin-top: -1rem; } .daily-title { font-size: 1.25rem; } }

/* Library page: start-here shelf, search and filters, era bar, denser entries */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shelf { margin: 0 0 3rem; }
.shelf h2, .lib-tools h2 { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .3rem; }
.shelf-sub { margin: 0 0 1rem; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.shelf ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }   /* 8 cards: 2 or 4 columns so rows fill */
@media (min-width: 900px) { .shelf ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shelf-card { display: grid; gap: .2rem; height: 100%; padding: .9rem 1rem 1rem; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; color: inherit; transition: border-color .15s; }
.shelf-card:hover { border-color: var(--accent); }
.sc-t { font-size: 1.12rem; font-weight: 600; line-height: 1.25; }
.sc-a { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.sc-d { font-size: .95rem; line-height: 1.45; color: var(--muted); margin-top: .2rem; }
.lib-tools { display: grid; gap: .75rem; margin: 0 0 1rem; }
#lib-q { width: 100%; max-width: 34rem; padding: .7rem .95rem; font: 16px/1.3 var(--sans); color: var(--fg); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 8px; }
#lib-q:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip { font: 500 13px/1 var(--sans); padding: .45rem .75rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--muted); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--fg); }
.chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip .n { font-weight: 400; opacity: .6; margin-left: .15rem; font-variant-numeric: tabular-nums; }
.chip.zero { opacity: .45; }   /* still clickable, but shows it would give nothing */
.lang-pick select { font: 500 13px/1 var(--sans); padding: .42rem .6rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--muted); }
.lib-count { margin: 0; font-family: var(--sans); font-size: 13px; color: var(--faint); min-height: 1em; line-height: 1.6; }
.lib-empty { font-family: var(--sans); font-size: 15px; color: var(--muted); }
.lib-count strong { font-weight: 600; color: var(--muted); }
.lib-count button, .lib-empty button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.era-bar { position: sticky; top: calc(3.25rem + env(safe-area-inset-top, 0px)); z-index: 9; margin: 0 -16px 1rem; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.era-bar-in { display: flex; gap: 1.4rem; overflow-x: auto; scrollbar-width: none; padding: .6rem 0; }
.era-bar-in::-webkit-scrollbar { display: none; }
.era-bar a { flex: none; font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.era-bar a:hover { color: var(--fg); }
.era-bar a.on { color: var(--accent); border-bottom-color: var(--accent); }
.era { scroll-margin-top: 7.5rem; }
/* denser entries */
.author-block { padding: 1.5rem 0 1.6rem; }
.author-block ul { gap: 1.15rem 2.2rem; }
.work .d { margin-top: .05rem; }
.work .f { font-family: var(--sans); font-size: 12px; color: var(--faint); margin-top: .2rem; font-variant-numeric: tabular-nums; }
.timeline [hidden] { display: none !important; }
@media (max-width: 700px) {
  .work .o { display: none; }   /* the original title is on the book's own page */
  .shelf ul { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .shelf-card { padding: .75rem .8rem .85rem; }
  .sc-d { display: none; }
  .era-bar-in { gap: 1.1rem; }
}
@media (max-width: 330px) { .shelf ul { grid-template-columns: 1fr; } }

/* Listen: audiobook player */
.listen { margin: 1.4rem 0 0; padding: 1rem 1.1rem 1.05rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--hi); display: grid; gap: .65rem; max-width: 40rem; }
.ls-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; }
.ls-h { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.ls-sub { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.listen audio { width: 100%; height: 40px; }
.ls-pick select { width: 100%; font: 500 14px/1.3 var(--sans); padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg); color: var(--fg); }
.ls-ch summary { cursor: pointer; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.ls-ch ol { margin: .5rem 0 0; padding-left: 1.4rem; max-height: 16rem; overflow-y: auto; font-family: var(--sans); font-size: 14px; }
.ls-ch li { margin: .15rem 0; }
.ls-ch button { font: inherit; color: var(--fg); background: none; border: 0; padding: .1rem 0; cursor: pointer; text-align: left; }
.ls-ch button:hover, .ls-ch li.on button { color: var(--accent); }
.ls-ch .t { color: var(--faint); font-variant-numeric: tabular-nums; margin-left: .4rem; font-size: 12px; }
.ls-dl { margin: 0; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.ls-dl a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .2em; }
.head-part .listen { margin: 1rem 0 1.2rem; }

/* Pathways */
.pathways { margin: 0 0 3rem; }
.pathways h2 { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .3rem; }
.shelf-sub a { color: var(--accent); }
.pw-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.pw-card { display: grid; gap: .3rem; height: 100%; padding: .95rem 1rem 1rem; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; color: inherit; background: var(--bg); transition: border-color .15s; }
.pw-card:hover { border-color: var(--accent); }
.pw-ct { font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.pw-cd { font-size: .95rem; line-height: 1.45; color: var(--muted); }
.pw-cm { font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin-top: auto; }
.pw-bar { display: block; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.pw-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.pw-card .pw-bar { visibility: hidden; } .pw-card.started .pw-bar { visibility: visible; }
.pw-page { max-width: 46rem; }
.pw-kicker { margin: 0 0 .4rem; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pw-kicker a { color: var(--accent); text-decoration: none; }
.pw-intro { font-size: 1.05rem; line-height: 1.65; margin: -1.5rem 0 1.5rem; }
.pw-progress { display: grid; gap: .5rem; margin: 0 0 1.6rem; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.pw-next { justify-self: start; font-weight: 600; color: var(--accent); text-decoration: none; }
.pw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.pw-step { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: .9rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--rule); }
.pw-n { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--rule)); }
.pw-step.done .pw-n { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.pw-body { display: grid; gap: .2rem; }
.pw-t { font-size: 1.15rem; font-weight: 600; color: var(--fg); text-decoration: none; line-height: 1.3; }
.pw-t:hover { color: var(--accent); }
.pw-by { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.pw-audio { color: var(--accent); font-weight: 600; }
.pw-why { font-size: .98rem; line-height: 1.5; color: var(--muted); }
.pw-done { display: flex; align-items: center; gap: .35rem; font-family: var(--sans); font-size: 13px; color: var(--muted); cursor: pointer; padding-top: .35rem; }
.pw-done input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
@media (max-width: 600px) { .pw-step { grid-template-columns: 2rem minmax(0, 1fr); } .pw-done { grid-column: 2; padding-top: 0; } }
.ls-cast { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.ls-cast span { color: var(--faint, var(--muted)); opacity: .75; }
/* Follow along */
.ls-now { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin: .5rem 0 0; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.ls-who { font-weight: 600; color: var(--accent); min-height: 1.2em; }
.ls-follow { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
.row.ls-here { background: var(--hi); box-shadow: inset 3px 0 0 var(--accent); }
.ls-jump { display: none; position: absolute; top: .35rem; right: .25rem; border: 0; background: none; color: var(--accent);
  font-size: 12px; line-height: 1; padding: .35rem; cursor: pointer; border-radius: 4px; opacity: .55; }
body.listening .ls-jump { display: block; }
body.listening .row:hover .ls-jump, .ls-jump:focus-visible { opacity: 1; }
@media (hover: hover) { body.listening .ls-jump { opacity: 0; } body.listening .row:hover .ls-jump { opacity: .9; } }
/* Mini player along the bottom while listening */
.ls-mini { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: .25rem;
  padding: .35rem 16px calc(.35rem + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--rule);
  box-shadow: 0 -4px 18px rgba(0,0,0,.06); font-family: var(--sans); font-size: 13px; }
.ls-mini[hidden] { display: none; }
.ls-mini-bar { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: transparent; }
.ls-mini-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.ls-mini button { border: 0; background: none; color: var(--fg); font: inherit; cursor: pointer; padding: .45rem .5rem; border-radius: 6px; }
.ls-mini button:hover { background: var(--hi); }
.ls-mini-pp { color: var(--accent) !important; font-size: 14px !important; min-width: 2.5rem; }
.ls-mini-back { color: var(--muted) !important; font-size: 12px !important; }
.ls-mini-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; flex: 1; text-align: left; line-height: 1.25; }
.ls-mini-who { color: var(--accent); font-weight: 600; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ls-mini-sub { color: var(--muted); font-size: 12px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.ls-mini-on { padding-bottom: 64px; }
body.ls-mini-on .float-ui { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
@media (hover: none) { body.listening .row.para { padding-right: 1.9rem; } }
.work .f .aud { color: var(--accent); white-space: nowrap; }
.work .f .aud .hp { vertical-align: -1px; margin-right: 3px; }
.listen { scroll-margin-top: 4.5rem; }
.work .f .aud { cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
.work .f .aud:hover { text-decoration-color: var(--accent); }
a.pw-audio { color: var(--accent); text-decoration: none; }
a.pw-audio:hover { text-decoration: underline; }
.ls-now[hidden] { display: none; }
.ls-mini .ls-mini-back2 { flex: none; color: var(--bg); background: var(--accent); border-radius: 999px; padding: .4rem .8rem; font-weight: 600; font-size: 12px; }
.ls-mini .ls-mini-back2:hover { background: var(--accent); opacity: .9; }
.ls-mini .ls-mini-back2[hidden] { display: none; }
/* Header links */
.site-nav { display: flex; gap: 1.1rem; margin-left: 1.4rem; font-family: var(--sans); font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--fg); }
@media (max-width: 1100px) { .site-nav.in-reader { display: none; } }
@media (max-width: 520px) { .site-nav { gap: .8rem; margin-left: .8rem; font-size: 13.5px; } }
/* Home: passage of the day beside Continue / Listen today */
.home-top { display: grid; grid-template-columns: minmax(0, 46rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin: -1.5rem 0 3.5rem; }
.home-top .daily { margin: 0; max-width: none; }
.home-side { padding: 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: 10px; }
.home-side .daily-eyebrow { margin-bottom: .6rem; }
.hs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.hs-list a, .hs-feature { display: grid; gap: .1rem; padding: .45rem .5rem; margin: 0 -.5rem; border-radius: 6px; text-decoration: none; color: inherit; }
.hs-list a:hover, .hs-feature:hover { background: var(--hi); }
.hs-kind { font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hs-t { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.hs-sub { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.hs-play { margin-top: .5rem; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); }
.hs-all { display: inline-block; margin-top: .6rem; font-family: var(--sans); font-size: 13px; color: var(--accent); }
@media (max-width: 900px) {
  .home-top { grid-template-columns: minmax(0, 1fr); }
  .home-side.continue { order: -1; }
}
.pw-more { border-style: dashed; }
.pw-more .pw-ct { color: var(--accent); }
.pw-cm .aud { color: var(--accent); white-space: nowrap; }
.pw-cm .aud .hp { vertical-align: -1px; margin-right: 3px; }
.site-nav { position: relative; top: 1px; }   /* sits on the wordmark's baseline */
@media (max-width: 520px) { .site-nav { top: 2px; } }
/* /listen/ */
.lr-era { margin: 1.6rem 0 0; }
.lr-era h3 { margin: 0 0 .4rem; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lr-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); column-gap: 2rem; }
.lr-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .75rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.lr-list a:hover .lr-t { color: var(--accent); }
.lr-t { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; }
.lr-a { grid-row: 2; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.lr-m { grid-row: 1 / span 2; align-self: center; text-align: right; font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.lr-m .aud { color: var(--accent); white-space: nowrap; } .lr-m .aud .hp { vertical-align: -1px; margin-right: 3px; }
.lr-list li[hidden], .lr-era[hidden] { display: none; }
@media (max-width: 520px) { .lr-list { grid-template-columns: minmax(0, 1fr); } .lr-m { max-width: 9rem; } }
.listen-page .lib-tools h2 { margin-bottom: .6rem; }
@media (max-width: 520px) {
  .lr-list a { grid-template-columns: minmax(0, 1fr); }
  .lr-m { grid-row: 3; text-align: left; max-width: none; margin-top: .15rem; }
}
.ls-readalong { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.ls-readalong:hover { text-decoration: underline; }
.ls-readalong[hidden] { display: none; }
.pw-step.started .pw-t::after { content: "Started"; margin-left: .5rem; vertical-align: 2px; font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; padding: .05rem .45rem; }
.pw-card.started .pw-cm::after { content: " · " attr(data-started); color: var(--accent); }
/* Your place on other devices */
.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.sync-dlg { max-width: min(30rem, calc(100vw - 32px)); border: 1px solid var(--rule); border-radius: 12px; padding: 1.3rem 1.4rem; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
.sync-dlg::backdrop { background: rgba(0,0,0,.35); }
.sync-dlg h2 { margin: 0 0 .6rem; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.sync-link { display: flex; gap: .5rem; }
.sync-link input { flex: 1; min-width: 0; font: inherit; padding: .45rem .6rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--hi); color: var(--fg); }
.sync-dlg button:not(.linkish) { font: inherit; font-weight: 600; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--rule); background: var(--bg); color: var(--fg); cursor: pointer; }
.sync-note { color: var(--muted); font-size: 13px; }
.sync-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0 0; }
.sync-actions .linkish { color: var(--muted); font-size: 13px; }
.sync-toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(4rem + env(safe-area-inset-top, 0px)); z-index: 40; background: var(--fg); color: var(--bg);
  font-family: var(--sans); font-size: 14px; padding: .6rem 1rem; border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.18); max-width: calc(100vw - 32px); }
.us-only { margin: .9rem 0 0; padding: .55rem .8rem; border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 6px;
  background: var(--hi); font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 40rem; }
/* Mini player: desktop controls */
.ls-mini-wide { display: contents; }
.ls-mini-back { order: 1; } .ls-mini-pp { order: 2; } .ls-mini-fwd { order: 3; color: var(--muted) !important; font-size: 12px !important; }
.ls-mini-info { order: 4; } .ls-mini-back2 { order: 5; } .ls-mini-chap { order: 6; } .ls-mini-time { order: 7; } .ls-mini-rate { order: 8; }
.ls-mini-chap select { max-width: 16rem; font: inherit; font-size: 12.5px; color: var(--fg); background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; padding: .3rem .4rem; }
.ls-mini-chap[hidden] { display: none; }
.ls-mini-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 .25rem; }
.ls-mini-rate { font-size: 12px !important; font-weight: 600; color: var(--muted) !important; min-width: 3rem; border: 1px solid var(--rule) !important; }
.ls-mini-bar { top: -6px; height: 12px; cursor: pointer; touch-action: none; }
.ls-mini-bar i { position: absolute; left: 0; bottom: 5px; height: 2px; }
.ls-mini-bar:hover i { height: 4px; bottom: 4px; }
@media (max-width: 700px) { .ls-mini-wide { display: none; } }
.free-note { margin: .6rem 0 0; font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 46rem; }
.free-note a { color: inherit; }
.fnref { font-family: var(--sans); font-size: .62em; line-height: 0; margin-left: 1px; }
.fnref a { color: var(--accent); text-decoration: none; padding: 0 1px; }
.fn-n { font-family: var(--sans); font-size: .8em; font-weight: 600; color: var(--accent); }
/* home header: lede and free note share the passage card's width, so the left column has one right edge */
.lib .lib-head .lede, .lib .lib-head .free-note { max-width: 46rem; }
/* Home: compact passage of the day */
.home-top .daily { padding: 1rem 1.2rem .9rem; }
.home-top .daily .daily-eyebrow { margin-bottom: .35rem; font-size: 11px; }
.home-top .daily .daily-title { font-size: 1.2rem; margin: 0; }
.home-top .daily .daily-by { font-size: 13px; margin: .15rem 0 .5rem; }
.home-top .daily .daily-text { font-size: 1rem; line-height: 1.55; margin: 0 0 .5rem; padding-left: .8rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.home-top .daily .daily-links { margin: 0; font-size: 13px; }
/* Search in the top bar */
.site-search { display: flex; }
.site-search input { width: 15rem; font: inherit; font-family: var(--sans); font-size: 13.5px; padding: .38rem .7rem; border: 1px solid var(--rule);
  border-radius: 999px; background: var(--bg); color: var(--fg); }
.site-search input:focus { outline: none; border-color: var(--accent); }
.search-btn { display: none; }
.site-search.in-reader { display: none; } .search-btn.in-reader { display: inline-flex; }
@media (max-width: 760px) { .site-search { display: none; } .search-btn { display: inline-flex; } }
body.search-open .site-search { display: flex; position: absolute; left: 0; right: 0; top: 100%; padding: .5rem 16px;
  background: var(--bg); border-bottom: 1px solid var(--rule); }
body.search-open .site-search input { width: 100%; font-size: 16px; }
.bar { position: sticky; }
@media (max-width: 440px) {
  .site-nav a[href$="/#library"] { display: none; }   /* the logo already goes to the library */
  .bar-inner { gap: .6rem; }
  .site-nav { margin-left: .4rem; gap: .7rem; }
}
@media (max-width: 520px) { .search-btn.in-reader { display: none; } }
/* Search autocomplete */
.site-search { position: relative; }
.ac { position: absolute; top: calc(100% + 6px); right: 0; width: min(24rem, calc(100vw - 32px)); z-index: 40; list-style: none; margin: 0; padding: .3rem;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.14); font-family: var(--sans); }
.ac[hidden] { display: none; }
.ac li a { display: grid; gap: .05rem; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--fg); }
.ac li.on a, .ac li a:hover { background: var(--hi); }
.ac-t { font-family: var(--serif); font-weight: 600; font-size: 15px; }
.ac-a { font-size: 12.5px; color: var(--muted); }
.ac-none { padding: .5rem .6rem; font-size: 13px; color: var(--muted); }
body.search-open .site-search .ac { left: 16px; right: 16px; width: auto; }
