/* ClassicBooksPress.com — one stylesheet, no framework, system fonts only. */

/* ---------- tokens ---------- */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --serif-zh: "Songti TC", "Noto Serif CJK TC", "Source Han Serif TC", "Noto Serif TC", "PMingLiU", "MingLiU", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --measure: 36em;
  --gutter: 1.1rem;
  --paper: #F4EFE4;
  --ink: #2B2723;
  --ink-soft: #6F675C;
}
html[data-measure="narrow"] { --measure: 31em; }
html[data-measure="wide"] { --measure: 44em; }

html[data-theme="sepia"] { --bg: #f4ecd8; --fg: #3b3024; --muted: #8b7b63; --rule: #ddd0b4; --link: #7a4d22; --tint: #ebe1c8; --sel: #e2cfa3; }
html[data-theme="light"] { --bg: #fcfbf7; --fg: #24221f; --muted: #807a70; --rule: #e6e2d8; --link: #6b4a2a; --tint: #f3f0e8; --sel: #efe3c6; }
html[data-theme="dark"]  { --bg: #18191b; --fg: #d5d0c5; --muted: #8c877d; --rule: #2f3033; --link: #c9a774; --tint: #222326; --sel: #4a3f2c; color-scheme: dark; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 600px) { html:not([style*="font-size"]) { font-size: 17px; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font-family: var(--serif); line-height: 1.6;
  font-kerning: normal; font-variant-ligatures: common-ligatures; text-rendering: optimizeLegibility;
  transition: background-color .25s, color .25s;
}
:lang(zh) { font-family: var(--serif-zh); }
::selection { background: var(--sel); }
a { color: var(--link); text-decoration-thickness: .06em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .1em; }
main { flex: 1; width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 1rem; }
.is-home main, .is-library main, .is-print main, .is-my main, .is-book main { max-width: 64rem; }
button { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--bg); padding: .3rem .6rem; z-index: 10; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ---------- header (one line, always) ---------- */
.top {
  display: flex; align-items: center; gap: .6rem;
  max-width: 64rem; width: 100%; margin: 0 auto; padding: .7rem var(--gutter);
  font-family: var(--sans); font-size: 15px;
}
.mark {
  font-family: var(--serif); font-size: 1.25rem; letter-spacing: .06em; color: var(--fg);
  text-decoration: none; flex: none;
}
.search { position: relative; flex: 1; min-width: 0; max-width: 26rem; margin-left: auto; }
.search input {
  width: 100%; min-width: 0; height: 2rem; padding: 0 .75rem; border: 1px solid var(--rule); border-radius: 1rem;
  background: var(--tint); color: var(--fg); font: inherit; font-size: 15px; outline: none; -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); opacity: .8; }
.search input:focus { border-color: var(--muted); background: var(--bg); }
.prefs { display: flex; flex: none; gap: .05rem; }
.prefs button {
  width: 1.9rem; height: 1.9rem; padding: 0; border: 0; border-radius: .4rem; background: none; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: baseline; justify-content: center; padding-top: .45rem; font-family: var(--serif); font-size: 15px; line-height: 1; white-space: nowrap;
}
.prefs button:hover { color: var(--fg); background: var(--tint); }
.prefs svg { width: 1.05rem; height: 1.05rem; align-self: center; margin-top: -.45rem; }
.a-small { font-size: .8em; } .a-large { font-size: 1.05em; }
@media (max-width: 420px) {
  .top { gap: .35rem; padding-left: .75rem; padding-right: .6rem; }
  .mark { font-size: 1.1rem; letter-spacing: .03em; }
  .prefs button { width: 1.6rem; }
  .search input { padding: 0 .55rem; font-size: 14px; }
}

/* search results */
.results {
  position: absolute; top: calc(100% + .35rem); right: 0; width: min(30rem, calc(100vw - 1.5rem));
  background: var(--bg); border: 1px solid var(--rule); border-radius: .5rem; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  max-height: 70vh; overflow-y: auto; z-index: 20; padding: .3rem 0;
}
@media (max-width: 640px) { .results { position: fixed; top: 3.1rem; left: .6rem; right: .6rem; width: auto; } }
.results a { display: block; padding: .45rem .8rem; text-decoration: none; color: var(--fg); line-height: 1.35; }
.results a[aria-selected="true"], .results a:hover { background: var(--tint); }
.results .r-t { font-family: var(--serif); font-size: 1rem; }
.results .r-m { display: block; color: var(--muted); font-size: .8rem; }
.results .r-x { display: block; color: var(--muted); font-size: .78rem; font-style: italic; }
.results .r-none { padding: .6rem .8rem; color: var(--muted); font-size: .9rem; }
.results mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--muted); }

/* ---------- footer (one line, always) ---------- */
.bottom { border-top: 1px solid var(--rule); margin-top: 1rem; padding: .9rem var(--gutter) 1.1rem; font-family: var(--sans); }
.bottom nav { display: flex; justify-content: center; gap: 1.4rem; white-space: nowrap; font-size: .8rem; }
.bottom a { color: var(--muted); text-decoration: none; }
.bottom a:hover { color: var(--fg); }
@media (max-width: 420px) { .bottom nav { gap: .85rem; font-size: 12.5px; } }

/* ---------- reading text ---------- */
.text { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.text p { margin: 0; }
.text p + p { text-indent: 1.5em; }
.text h1 + p, .text hr + p, .text h2 + p, .text h3 + p, .text .center + p { text-indent: 0; }
.text h3 { font-size: 1.05rem; font-weight: normal; font-variant: small-caps; letter-spacing: .06em; text-align: center; margin: 2.2em 0 1em; }
.text blockquote { margin: 1em 0 1em 1.5em; font-size: .95em; }
.text blockquote p + p { text-indent: 0; margin-top: .6em; }
.text hr { border: 0; margin: 1.8em 0; text-align: center; height: auto; }
.text hr::before { content: "⁂"; color: var(--muted); font-size: 1.1em; letter-spacing: .3em; }
.text ul, .text ol { padding-left: 1.5em; }
.text .center { text-align: center; margin: 1em 0; }
.text .right { text-align: right; margin: 1em 0; }
.text .epigraph { margin: 1.2em 0 1.8em 18%; font-size: .93em; font-style: italic; }
.text .epigraph em { font-style: normal; }
.text .letter { margin: 1.1em 1.5em; }
.text .letter p + p { text-indent: 0; margin-top: .55em; }
.verse { margin: 1.1em 0 1.1em 1.2em; }
.verse .stanza { margin: 0 0 .9em; text-indent: 0; }
.verse .l { display: block; padding-left: 2em; text-indent: -2em; }
.verse .i1 { margin-left: 1em; } .verse .i2 { margin-left: 2em; } .verse .i3 { margin-left: 3em; } .verse .i4 { margin-left: 4em; }
.verse .i5, .verse .i6, .verse .i7, .verse .i8 { margin-left: 5em; }
sup.fn { font-size: .68em; line-height: 0; margin-left: .05em; }
sup.fn a { text-decoration: none; }
.notes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--rule); font-size: .85em; color: var(--fg); }
.notes ol { padding-left: 1.6em; }
.notes li { margin: .35em 0; }
.notes .back { text-decoration: none; color: var(--muted); }

/* Chinese typesetting */
.text:lang(zh) { line-height: 1.9; text-align: justify; hyphens: none; font-feature-settings: "palt" 0; }
.text:lang(zh) p { text-indent: 2em; margin-top: .35em; }
.text:lang(zh) h3 { font-variant: normal; letter-spacing: .25em; font-weight: bold; font-size: 1.05rem; }
.text:lang(zh) .verse { margin-left: 2em; }
.text:lang(zh) .verse .l { padding-left: 0; text-indent: 0; }
:lang(zh) { text-spacing-trim: normal; hanging-punctuation: allow-end; }

/* ---------- chapter page ---------- */
.crumb { display: flex; justify-content: space-between; gap: 1rem; margin: .6rem 0 0; font-family: var(--sans); font-size: .78rem; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb a:hover { color: var(--fg); }
.crumb-pos { flex: none; }
.ch-head { text-align: center; margin: 3.5rem 0 2.6rem; }
.ch-group { margin: 0 0 .5rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); }
.ch-head h1 { margin: 0; font-size: 1.55rem; font-weight: normal; letter-spacing: .02em; line-height: 1.3; }
.text:lang(zh) .ch-head h1 { letter-spacing: .2em; }
.pager { display: flex; justify-content: space-between; align-items: baseline; margin: 3.5rem 0 1.2rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: .88rem; }
.pager a { text-decoration: none; padding: .3rem 0; }
.resume { font-family: var(--sans); font-size: .8rem; text-align: center; margin: 1rem 0 0; }
.resume a { text-decoration: none; }
.resume button { border: 0; background: none; color: var(--muted); cursor: pointer; margin-left: .6em; }

/* POD bar: small, low-contrast, one line, never floating */
.pod-bar { margin: 1.4rem 0 0; font-family: var(--sans); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.pod-bar a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: .45em; max-width: 100%; }
.pod-bar a span { overflow: hidden; text-overflow: ellipsis; }
.pod-bar a:hover { color: var(--fg); }
.pod-bar svg { width: 1.15em; height: 1.15em; flex: none; }

/* note-taking popover */
.note-pop { position: absolute; z-index: 30; font-family: var(--sans); font-size: .8rem; background: var(--fg); color: var(--bg); border: 0; border-radius: 1rem; padding: .3rem .8rem; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.note-dialog { border: 1px solid var(--rule); border-radius: .6rem; background: var(--bg); color: var(--fg); padding: 1rem; width: min(28rem, 92vw); }
.note-dialog::backdrop { background: rgba(0,0,0,.25); }
.note-dialog blockquote { margin: 0 0 .7rem; color: var(--muted); font-size: .9rem; max-height: 8rem; overflow: auto; }
.note-dialog textarea { width: 100%; min-height: 6rem; font: inherit; background: var(--tint); color: var(--fg); border: 1px solid var(--rule); border-radius: .4rem; padding: .5rem; }
.note-dialog menu { display: flex; justify-content: flex-end; gap: .6rem; padding: 0; margin: .7rem 0 0; }

/* ---------- covers (same HTML/CSS is printed to PDF for Lulu) ---------- */
.cover {
  container-type: inline-size; aspect-ratio: 2 / 3; width: 100%;
  background: var(--paper); color: var(--ink); position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 6px 18px rgba(60,40,10,.10); border-radius: 1px;
  font-family: var(--serif); line-height: 1.15; user-select: none;
}
html[data-theme="dark"] .cover { box-shadow: 0 1px 2px rgba(0,0,0,.5); filter: brightness(.9); }
.cover__frame { position: absolute; inset: 6.5cqw; border: .45cqw solid var(--ink); outline: .18cqw solid var(--ink); outline-offset: -1.6cqw; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 9cqw 7cqw 6cqw; }
.cover__author { font-size: 5.2cqw; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.cover__band { width: 100%; height: 3.2cqw; background: var(--accent); margin: 6cqw 0 0; opacity: .85; }
.cover__title { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 11cqw; line-height: 1.12; padding: 2cqw 0; overflow-wrap: break-word; hyphens: manual; }
.cover--m .cover__title { font-size: 9.5cqw; }
.cover--l .cover__title { font-size: 8cqw; }
.cover--xl .cover__title { font-size: 6.8cqw; }
.cover__tr { font-size: 3.6cqw; font-style: italic; color: var(--ink-soft); margin-bottom: 4cqw; }
.cover__mark { width: 6cqw; height: 6cqw; color: var(--accent); margin-bottom: 3cqw; }
.cover__mark svg { width: 100%; height: 100%; display: block; }
.cover__press { font-family: var(--serif); font-size: 3cqw; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-soft); }

/* Chinese: string-bound book title slip (題簽), set vertically at top right */
.cover--zh .cover__frame { display: block; padding: 0; }
.cover--zh .cover__label {
  position: absolute; top: 8cqw; right: 9cqw; padding: 4.5cqw 3cqw; border: .45cqw solid var(--accent); outline: .18cqw solid var(--accent); outline-offset: -1.4cqw;
  writing-mode: vertical-rl; text-orientation: upright; background: color-mix(in srgb, var(--paper) 88%, var(--accent));
}
.cover--zh .cover__title { display: block; font-family: var(--serif-zh); font-size: 10.5cqw; letter-spacing: .32em; line-height: 1; padding: 0; color: var(--ink); }
.cover--zh.cover--m .cover__title { font-size: 9.2cqw; letter-spacing: .22em; }
.cover--zh.cover--l .cover__title { font-size: 7.6cqw; letter-spacing: .12em; }
.cover--zh .cover__author { position: absolute; top: 10cqw; right: 30cqw; writing-mode: vertical-rl; text-orientation: upright; font-family: var(--serif-zh); font-size: 5.4cqw; letter-spacing: .35em; text-transform: none; color: var(--ink-soft); }
.cover--zh.cover--m .cover__author { right: 28cqw; }
.cover--zh.cover--l .cover__author { right: 25cqw; }
.cover--zh .cover__press { position: absolute; left: 0; right: 0; bottom: 6cqw; text-align: center; }

/* ---------- grids & cards ---------- */
.tagline { text-align: center; color: var(--muted); font-style: italic; margin: 2.2rem 0 2.4rem; }
.section-title { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 2.4rem 0 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.2rem, 1fr)); gap: 1.6rem 1.3rem; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem 1rem; } }
.card { text-decoration: none; color: var(--fg); display: block; }
.card .cover { transition: transform .2s ease, box-shadow .2s ease; }
.card:hover .cover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.1), 0 12px 26px rgba(60,40,10,.16); }
.card__cap { display: block; margin-top: .55rem; line-height: 1.3; }
.card__t { display: block; font-size: .88rem; }
.card__a { display: block; font-size: .76rem; color: var(--muted); font-family: var(--sans); }
.more { text-align: center; margin: 2.6rem 0 1rem; font-family: var(--sans); font-size: .9rem; }
.more a { text-decoration: none; }
.continue { margin: 0 0 1rem; }
.continue-list { display: grid; gap: .6rem; }
.continue-item { display: flex; gap: .9rem; align-items: center; text-decoration: none; color: var(--fg); padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: .5rem; }
.continue-item:hover { background: var(--tint); }
.continue-item .cover { width: 2.6rem; flex: none; box-shadow: none; }
.continue-item small { display: block; color: var(--muted); font-family: var(--sans); font-size: .76rem; }
.bar { display: block; height: 3px; background: var(--rule); border-radius: 2px; margin-top: .35rem; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--muted); }

/* library */
.page-title { font-size: 1.6rem; font-weight: normal; margin: 2.2rem 0 1.2rem; }
.page-title .count { font-family: var(--sans); font-size: .85rem; color: var(--muted); vertical-align: middle; margin-left: .3rem; }
.filters { display: grid; gap: .55rem; margin-bottom: 1.8rem; font-family: var(--sans); font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips button { border: 1px solid var(--rule); background: none; border-radius: 1rem; padding: .2rem .7rem; cursor: pointer; color: var(--muted); }
.chips button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sort { color: var(--muted); }
.sort select { font: inherit; background: var(--bg); color: var(--fg); border: 1px solid var(--rule); border-radius: .3rem; padding: .1rem .3rem; }
.query-note { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.pages { display: flex; justify-content: center; gap: .4rem; margin-top: 2rem; font-family: var(--sans); font-size: .85rem; }
.pages button { border: 1px solid var(--rule); background: none; padding: .2rem .6rem; border-radius: .3rem; cursor: pointer; }
.pages button.on { background: var(--fg); color: var(--bg); }

/* ---------- book page ---------- */
.book-head { display: grid; grid-template-columns: 15rem 1fr; gap: 2.4rem; margin: 2.4rem 0 1rem; align-items: start; }
@media (max-width: 640px) { .book-head { grid-template-columns: 1fr; gap: 1.4rem; } .book-head > .cover { width: 58%; margin: 0 auto; } }
.book-title { font-size: 2rem; font-weight: normal; line-height: 1.2; margin: 0 0 .3rem; }
.book-title:lang(zh) { letter-spacing: .12em; }
.book-title-en, .book-sub { margin: 0 0 .4rem; color: var(--muted); font-style: italic; }
.book-by { margin: .4rem 0; font-size: 1.05rem; }
.book-meta { margin: 0 0 1.1rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.blurb { margin: .5rem 0; max-width: 34em; }
.blurb-src { color: var(--fg); opacity: .85; }
.book-actions { margin-top: 1.4rem; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.btn { display: inline-block; background: var(--fg); color: var(--bg); text-decoration: none; padding: .55rem 1.25rem; border-radius: 2rem; font-family: var(--sans); font-size: .9rem; border: 0; cursor: pointer; }
.btn:hover { opacity: .88; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font-family: var(--sans); font-size: .85rem; text-decoration: none; display: inline-flex; gap: .35em; align-items: center; }
.link svg { width: 1em; height: 1em; }
.link.danger { color: #a3412f; }
.toc { list-style: none; padding: 0; margin: 0; columns: 2 16rem; column-gap: 2.5rem; }
.toc li { break-inside: avoid; padding: .18rem 0; }
.toc a { text-decoration: none; color: var(--fg); }
.toc a:hover { color: var(--link); }
.toc li.read a { color: var(--muted); }
.toc li.read a::after { content: " ✓"; font-size: .75em; }
.toc li.here a { font-weight: bold; }
.toc-group { font-family: var(--sans); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: .9rem !important; }
.book .pod-bar { margin-top: 2.2rem; text-align: left; }
.source { font-family: var(--sans); font-size: .75rem; color: var(--muted); margin-top: 1.4rem; }
.source a { color: var(--muted); }

/* ---------- print (POD) page ---------- */
.print-stage { display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: center; margin: 2rem 0 1.5rem; }
@media (max-width: 760px) { .print-stage { grid-template-columns: 1fr; justify-items: center; gap: 2rem; } }
.book3d { perspective: 1400px; width: 14em; font-size: 13px; touch-action: pan-y; cursor: grab; }
.book3d__inner { position: relative; width: 14em; height: 21em; transform-style: preserve-3d; transform: rotateY(-28deg) rotateX(4deg); transition: transform .5s ease; }
.book3d__front, .book3d__back, .book3d__spine { position: absolute; top: 0; height: 100%; backface-visibility: hidden; }
.book3d__front { width: 100%; transform: translateZ(calc(var(--spine) / 2)); }
.book3d__front .cover { height: 100%; }
.book3d__back { width: 100%; background: var(--paper); transform: rotateY(180deg) translateZ(calc(var(--spine) / 2)); }
.book3d__spine, .spread__spine {
  width: var(--spine); left: calc(50% - var(--spine) / 2); background: color-mix(in srgb, var(--paper) 93%, #000);
  transform: rotateY(-90deg) translateZ(7em); display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 1.2em 0; color: var(--ink); overflow: hidden;
}
.spine-t, .spine-a { writing-mode: vertical-rl; font-size: min(.9em, calc(var(--spine) * .55)); white-space: nowrap; letter-spacing: .08em; }
.spine-t:lang(zh) { text-orientation: upright; font-family: var(--serif-zh); letter-spacing: .3em; }
.spine-a { color: var(--ink-soft); font-size: min(.7em, calc(var(--spine) * .45)); }
.spread { display: grid; grid-template-columns: 1fr var(--spine) 1fr; width: min(100%, 30rem); aspect-ratio: auto; font-size: 13px; box-shadow: 0 6px 20px rgba(60,40,10,.12); }
.spread .cover { box-shadow: none; }
.spread__back { background: var(--paper); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; padding: 14% 12% 8%; aspect-ratio: 2 / 3; }
.back-blurb { font-size: .82em; line-height: 1.55; text-align: center; margin: 0; }
.back-en { font-style: italic; color: var(--ink-soft); }
.back-press { font-size: .55em; letter-spacing: .25em; text-transform: uppercase; color: var(--ink-soft); text-align: center; margin: 0; }
.spread__spine { position: static; transform: none; border-left: 1px dashed rgba(0,0,0,.18); border-right: 1px dashed rgba(0,0,0,.18); padding: 1.2em 0; justify-content: center; }
.print-title { font-size: 1.5rem; font-weight: normal; margin: 1rem 0 .2rem; }
.print-by { color: var(--muted); font-size: 1.1rem; }
.print-spec { font-family: var(--sans); font-size: .82rem; color: var(--muted); margin: 0 0 1.4rem; }
.quote { max-width: 36rem; font-family: var(--sans); font-size: .9rem; }
.quote fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; }
.quote legend { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.quote .row { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: .6rem; }
.quote label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: var(--muted); flex: 1 1 7rem; }
.quote label.qty { flex: 0 0 4.5rem; }
.quote label.wide { flex-basis: 100%; }
.quote input, .quote select { font: inherit; font-size: .95rem; color: var(--fg); background: var(--tint); border: 1px solid var(--rule); border-radius: .35rem; padding: .4rem .5rem; width: 100%; }
.ship-opts label { flex-direction: row; align-items: center; gap: .5rem; font-size: .88rem; color: var(--fg); padding: .25rem 0; }
.ship-opts label input { width: auto; }
.ship-opts .eta { color: var(--muted); margin-left: auto; }
.price { width: 100%; border-collapse: collapse; margin: .4rem 0 .8rem; }
.price th, .price td { padding: .32rem 0; border-bottom: 1px solid var(--rule); font-weight: normal; text-align: left; }
.price td { text-align: right; font-variant-numeric: tabular-nums; }
.price tfoot th, .price tfoot td { font-weight: 600; border-bottom: 0; padding-top: .6rem; }
.agree { display: block !important; padding-left: 1.5rem; text-indent: -1.5rem; font-size: .82rem !important; color: var(--fg) !important; margin: .8rem 0; }
.agree input { width: auto !important; margin: 0 .5rem 0 0; text-indent: 0; vertical-align: -.1em; }
.note { color: var(--muted); font-size: .82rem; }
.note.small { font-size: .76rem; }
.note.err { color: #a3412f; }
.formula { font-family: var(--sans); font-size: .76rem; color: var(--muted); margin-top: 2rem; }

/* ---------- my reading ---------- */
.lede { color: var(--muted); font-style: italic; }
.shelf { display: grid; gap: .7rem; }
.shelf-item { display: grid; grid-template-columns: 3rem 1fr auto; gap: .9rem; align-items: center; }
.shelf-item .cover { box-shadow: none; }
.shelf-item a { color: var(--fg); text-decoration: none; }
.shelf-item small { color: var(--muted); font-family: var(--sans); font-size: .76rem; display: block; }
.shelf-item button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.note-item { border-left: 2px solid var(--rule); padding: .2rem 0 .2rem .9rem; margin: .9rem 0; }
.note-item blockquote { margin: 0; color: var(--muted); font-size: .92rem; }
.note-item p { margin: .3rem 0; }
.note-item .meta { font-family: var(--sans); font-size: .74rem; color: var(--muted); display: flex; gap: .8rem; flex-wrap: wrap; }
.note-item .meta button { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font: inherit; }
.empty, .hint { color: var(--muted); font-size: .9rem; }
.tools { font-family: var(--sans); font-size: .85rem; line-height: 2; }
.file { cursor: pointer; }

/* static pages */
.page h3 { font-variant: normal; text-align: left; font-size: 1.15rem; letter-spacing: 0; margin-top: 2em; }
.page p + p { text-indent: 0; margin-top: .8em; }
.page ol, .page ul { margin: .8em 0; }
.page li { margin: .4em 0; }

@media print {
  .top, .bottom, .pager, .pod-bar, .crumb { display: none; }
  html { font-size: 11pt; } body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* contents with opening words (books whose chapters are only numbered) */
.toc--ex { columns: 1; }
.toc--ex li { display: flex; gap: .9rem; align-items: baseline; padding: .26rem 0; border-bottom: 1px solid var(--rule); }
.toc--ex li a { flex: none; min-width: 7.5em; }
.toc--ex li.toc-group { border-bottom: 0; }
.toc-ex { color: var(--muted); font-size: .88rem; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
