:root {
  color-scheme: light;
  --page: #faf8f3;
  --surface: #fffdf9;
  --surface-soft: #f0ede5;
  --ink: #2b312d;
  --muted: #71746b;
  --accent: #786039;
  --accent-soft: #eee6d6;
  --line: #e4e0d7;
  --highlight: #eee0a4;
  --danger: #aa4039;
  --shadow: 0 16px 55px #302b2110;
  --reading-size: 21px;
  --reading-leading: 1.8;
  --reading-width: 700px;
  --reading-font: Georgia, "Times New Roman", serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html[data-theme="sepia"] { --page: #f0e5d1; --surface: #f6ecd9; --surface-soft: #e8dcc4; --ink: #483c2b; --muted: #776a54; --accent: #72572e; --accent-soft: #e3d3b2; --line: #d8cbb1; --highlight: #e0c576; }
html[data-theme="dark"] { color-scheme: dark; --page: #171917; --surface: #20231f; --surface-soft: #292d27; --ink: #e6e6dc; --muted: #a3ab9d; --accent: #d3b879; --accent-soft: #3a3424; --line: #353b31; --highlight: #66582b; --danger: #f29a8d; --shadow: 0 16px 55px #0003; }
html[data-reading-size="16"] { --reading-size: 16px; }
html[data-reading-size="17"] { --reading-size: 17px; }
html[data-reading-size="18"] { --reading-size: 18px; }
html[data-reading-size="19"] { --reading-size: 19px; }
html[data-reading-size="20"] { --reading-size: 20px; }
html[data-reading-size="21"] { --reading-size: 21px; }
html[data-reading-size="22"] { --reading-size: 22px; }
html[data-reading-size="23"] { --reading-size: 23px; }
html[data-reading-size="24"] { --reading-size: 24px; }
html[data-reading-size="25"] { --reading-size: 25px; }
html[data-reading-size="26"] { --reading-size: 26px; }
html[data-reading-size="27"] { --reading-size: 27px; }
html[data-reading-size="28"] { --reading-size: 28px; }
html[data-reading-size="29"] { --reading-size: 29px; }
html[data-reading-size="30"] { --reading-size: 30px; }
html[data-reading-leading="14"] { --reading-leading: 1.4; }
html[data-reading-leading="15"] { --reading-leading: 1.5; }
html[data-reading-leading="16"] { --reading-leading: 1.6; }
html[data-reading-leading="17"] { --reading-leading: 1.7; }
html[data-reading-leading="18"] { --reading-leading: 1.8; }
html[data-reading-leading="19"] { --reading-leading: 1.9; }
html[data-reading-leading="20"] { --reading-leading: 2; }
html[data-reading-leading="21"] { --reading-leading: 2.1; }
html[data-reading-leading="22"] { --reading-leading: 2.2; }
html[data-reading-width="narrow"] { --reading-width: 560px; }
html[data-reading-width="comfortable"] { --reading-width: 700px; }
html[data-reading-width="wide"] { --reading-width: 850px; }
html[data-reading-font="serif"] { --reading-font: Georgia, "Times New Roman", serif; }
html[data-reading-font="sans"] { --reading-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--page); scroll-padding-top: 150px; }
body { margin: 0; color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, a { touch-action: manipulation; }
button, input, select, textarea { color: inherit; }
button { border: 0; }
a { color: inherit; text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--ink); background: var(--highlight); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
svg { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 12px 18px; color: var(--surface); background: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.masthead { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 88px; padding: 0 clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); background: var(--page); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; font: 26px/1 Georgia, serif; letter-spacing: -.8px; }
.brand-mark { color: var(--accent); font-size: 32px; }
.wordmark small { display: inline-block; margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font: 10px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 2.3px; vertical-align: middle; }
.masthead-actions { display: flex; align-items: center; gap: 18px; }
.text-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 10px; color: var(--muted); background: transparent; font-size: 13px; }
.text-button:hover:not(:disabled), .icon-button:hover:not(:disabled) { color: var(--ink); background: var(--surface-soft); }
.icon-button { min-width: 40px; border-radius: 8px; font-size: 24px; }
.appearance-trigger { font: 22px/1 Georgia, serif; }
.scholar-link { text-decoration: none; }
.sync-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); background: transparent; font-size: 11px; }
.status-dot { display: inline-block; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
[data-sync-state="synced"] .status-dot, [data-sync-state="connected"] .status-dot { background: #6b865c; }
[data-sync-state="error"] .status-dot, [data-sync-state="offline"] .status-dot { background: #b88a43; }
.page-shell { width: min(1250px, 100%); margin: 0 auto; padding: 64px clamp(24px, 5vw, 64px); }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 650; letter-spacing: 2px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.65; }
.welcome { display: grid; grid-template-columns: 1.25fr 1fr; gap: 68px; align-items: center; min-height: calc(100vh - 88px); padding-top: 75px; padding-bottom: 26px; }
.welcome-story { padding-bottom: 35px; }
.welcome-story > .eyebrow { margin-bottom: 26px; }
.welcome h1 { margin-bottom: 25px; font-size: clamp(48px, 5.25vw, 72px); line-height: 1.08; letter-spacing: -2.5px; }
.welcome h1 em { color: var(--accent); font-weight: 400; }
.welcome-copy { max-width: 420px; color: var(--muted); font: 18px/1.7 Georgia, serif; }
.welcome-features { display: grid; gap: 11px; margin-top: 35px; color: var(--muted); font-size: 12px; }
.welcome-features span::before { content: "—"; padding-right: 12px; color: var(--accent); }
.signin-card { max-width: 450px; justify-self: end; padding: 38px 36px 27px; border: 1px solid var(--line); border-radius: 4px 28px 4px 4px; background: var(--surface); box-shadow: var(--shadow); }
.signin-mark { display: block; margin-bottom: 31px; color: var(--accent); font-size: 28px; }
.signin-card h2 { margin: 0 0 16px; font-size: 29px; line-height: 1.15; letter-spacing: -.7px; }
.signin-card > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.65; }
.signin-card strong { color: var(--ink); font-weight: 500; }
.signin-actions { display: grid; justify-items: center; gap: 10px; margin-top: 26px; }
.provider-button { display: block; width: 216px; max-width: 100%; min-height: 48px; padding: 0; border: 0; border-radius: 5px; color: #1f1f1f; background: #fff; }
.provider-button img { display: block; width: 100%; height: auto; }
.provider-button:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--accent-soft); }
.browse-samples { width: 100%; gap: 13px; margin-top: 12px; color: var(--accent); }
.signin-card .signin-hint { margin: 12px 0 0; font-size: 12px !important; }
.signin-card .account-explanation { margin-top: 24px; margin-bottom: 0; padding-top: 19px; border-top: 1px solid var(--line); font-size: 11px !important; }
.welcome-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.welcome-footer a { text-decoration: none; }
.welcome-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.welcome-footer a span { margin-left: 7px; }
.notice { position: relative; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1050px; margin: 16px auto 0; padding: 12px 20px; border: 1px solid var(--danger); border-radius: 6px; color: var(--danger); background: var(--surface); font-size: 13px; line-height: 1.5; }
.notice p { margin: 0; overflow-wrap: anywhere; }
.notice .text-button { color: inherit; }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.library-heading .eyebrow { margin-bottom: 12px; }
.library h1 { margin-bottom: 10px; font-size: clamp(36px, 4vw, 49px); letter-spacing: -1.5px; }
.library-heading .muted { margin-bottom: 0; }
.library-search { display: flex; align-items: center; gap: 10px; width: 275px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface); }
.library-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.library-search:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.catalog-refresh-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -12px 0 26px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.catalog-refresh-notice p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.catalog-refresh-notice button { flex-shrink: 0; color: var(--accent); }
.sync-consent { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 22px 25px; margin-bottom: 40px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.sync-consent strong { font: 20px/1.3 Georgia, serif; }
.sync-consent p { max-width: 620px; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 11px 17px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 550; line-height: 1.4; }
.primary-button { flex-shrink: 0; color: var(--page); background: var(--ink); }
.primary-button:hover:not(:disabled) { opacity: .85; }
.secondary-button { color: var(--ink); border-color: var(--line); background: var(--surface); }
.secondary-button:hover:not(:disabled) { border-color: var(--accent); }
.danger-button { color: var(--danger); background: transparent; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.section-heading > .eyebrow { margin: 0; font-size: 9px; }
.section-heading > .muted { font-size: 11px; }
.continue-section { margin-bottom: 42px; }
.continue-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.continue-book { display: flex; align-items: center; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 7px; text-align: left; color: var(--ink); background: var(--surface); }
.continue-book:hover { border-color: var(--accent); }
.continue-book .book-cover { flex: 0 0 60px; width: 60px; height: 82px; margin: 0; border-radius: 2px; }
.continue-book .book-cover-title { font-size: 9px; padding: 10px 7px; }
.continue-book .book-cover-mark { font-size: 10px; margin-top: 8px; }
.continue-copy { min-width: 0; flex: 1; }
.continue-copy strong { display: block; margin-bottom: 6px; font: 19px/1.25 Georgia, serif; }
.continue-copy small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.continue-arrow { color: var(--accent); font-size: 22px; }
.shelf-heading { border-top: 1px solid var(--line); padding-top: 27px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 35px 28px; }
.book-card { display: block; width: 100%; padding: 0; text-align: left; color: var(--ink); background: transparent; }
.book-cover { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; aspect-ratio: 3 / 4; width: 100%; max-height: 280px; margin-bottom: 16px; border: 1px solid var(--line); border-left: 5px solid color-mix(in srgb, var(--accent), transparent 70%); border-radius: 2px 7px 7px 2px; background: var(--surface-soft); box-shadow: 3px 5px 8px #2827190a; }
.book-card:hover .book-cover { outline: 1px solid var(--accent); outline-offset: 4px; }
.book-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-cover-mark { margin-top: 16px; color: var(--accent); font-size: 22px; }
.book-cover-title { max-height: 85%; overflow: hidden; padding: 20px; text-align: center; color: var(--accent); font: 21px/1.3 Georgia, serif; }
.book-card > strong { display: block; font: 18px/1.3 Georgia, serif; }
.book-card > small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-state { padding: 50px 20px 70px; text-align: center; }
.empty-mark { display: block; margin-bottom: 20px; color: var(--accent); font-size: 30px; }
.empty-state h2 { margin-bottom: 10px; font-size: 27px; }
.empty-state p { max-width: 420px; margin: 0 auto 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 200px; color: var(--muted); font: 17px/1.5 Georgia, serif; }
.loading-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: breathe 1s alternate infinite; }
@keyframes breathe { to { opacity: .25; } }
.reader-toolbar { position: sticky; top: 88px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 58px; padding: 0 clamp(12px, 3vw, 42px); border-bottom: 1px solid var(--line); background: var(--page); }
.reader-toolbar > p { overflow: hidden; max-width: 50%; margin: 0; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font: 13px/1.3 Georgia, serif; }
.reader-toolbar-actions { display: flex; align-items: center; gap: 14px; }
.note-count { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
#bookmark-button[aria-pressed="true"] { color: var(--accent); }
#bookmark-button[aria-pressed="true"] svg path { fill: var(--accent-soft); }
.reader-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 185px); }
.reading-column { flex: 1; min-width: 0; padding: 0 clamp(22px, 5vw, 72px); }
.reading-page { max-width: var(--reading-width); margin: 0 auto; padding: 58px 0 0; }
.chapter-heading { margin-bottom: 38px; }
.chapter-heading .eyebrow { margin-bottom: 16px; font-size: 9px; }
.chapter-heading h1 { max-width: 100%; margin-bottom: 14px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.19; letter-spacing: -.85px; overflow-wrap: break-word; }
.chapter-author { color: var(--muted); font-size: 12px; }
.chapter-rule { display: block; width: 36px; height: 1px; margin-top: 28px; background: var(--accent); }
.chapter-text { color: var(--ink); font: var(--reading-size)/var(--reading-leading) var(--reading-font); white-space: pre-wrap; overflow-wrap: break-word; tab-size: 4; }
.chapter-text mark { padding: 2px 0; color: inherit; background: var(--highlight); cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.chapter-text mark[data-has-note="true"] { border-bottom: 1px solid var(--accent); }
.chapter-text mark:hover { outline: 1px solid var(--accent); }
.chapter-end { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 50px 0 35px; color: var(--accent); }
.chapter-end > span { font-size: 22px; }
.chapter-end > p { margin: 0; color: var(--muted); font-size: 11px; }
.chapter-navigation { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: var(--reading-width); margin: 0 auto; padding: 22px 0 70px; border-top: 1px solid var(--line); }
.chapter-navigation > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.chapter-navigation .text-button { padding-left: 0; padding-right: 0; font-size: 12px; }
.reading-status { position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px max(20px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); border-top: 1px solid var(--line); color: var(--muted); background: var(--page); font-size: 10px; }
.side-panel { position: sticky; top: 146px; flex: 0 0 260px; width: 260px; height: calc(100dvh - 186px); overflow-y: auto; padding: 26px 21px 40px; background: var(--surface); overscroll-behavior: contain; }
.chapter-panel { border-right: 1px solid var(--line); }
.notes-panel { border-left: 1px solid var(--line); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.panel-heading h2 { margin: 0; font-size: 23px; }
.close-panel { min-width: 28px; min-height: 30px; padding: 0; }
.panel-book-title { color: var(--muted); font-size: 11px; line-height: 1.6; }
.chapter-list { margin: 22px 0 0; padding: 0; list-style: none; }
.chapter-list li + li { margin-top: 5px; }
.chapter-list button { display: flex; align-items: baseline; gap: 9px; width: 100%; padding: 12px 10px; border-radius: 4px; text-align: left; color: var(--muted); background: transparent; font-size: 12px; line-height: 1.5; }
.chapter-list button > span { flex-shrink: 0; font-size: 9px; opacity: .7; }
.chapter-list button > .chapter-lock { margin-left: auto; font-size: 8px; }
.chapter-list button:hover { background: var(--surface-soft); color: var(--ink); }
.chapter-list button[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.keyboard-hint { margin: 28px 10px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.panel-intro, .notes-empty { color: var(--muted); font-size: 11px; line-height: 1.65; }
.notes-empty { padding: 25px 0; }
.annotation-list { display: grid; gap: 14px; margin-top: 23px; }
.annotation-card { display: block; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 4px; text-align: left; color: var(--ink); background: var(--page); }
.annotation-card:hover { border-color: var(--accent); }
.annotation-card > small { display: block; margin-bottom: 10px; color: var(--accent); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.annotation-card blockquote { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; margin: 0; font: 14px/1.55 Georgia, serif; white-space: pre-wrap; }
.annotation-card > p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
.selection-tools { position: fixed; z-index: 45; display: flex; align-items: center; left: 50%; bottom: 66px; max-width: calc(100vw - 24px); padding: 5px 7px; border: 1px solid var(--line); border-radius: 9px; transform: translateX(-50%); color: var(--surface); background: var(--ink); box-shadow: 0 8px 25px #0003; }
.selection-tools > button { min-height: 39px; padding: 9px 16px; border-radius: 5px; color: inherit; background: transparent; white-space: nowrap; font-size: 12px; }
.selection-tools > button:hover { background: #8883; }
.selection-tools > span { width: 1px; height: 17px; background: #8887; }
.selection-tools > .selection-close { padding: 5px 10px; opacity: .7; font-size: 21px; }
.reader-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 22px 85px #0003; }
.reader-dialog::backdrop { background: #191c1860; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 25px; }
.dialog-heading .eyebrow { margin-bottom: 7px; font-size: 8px; }
.dialog-heading h2 { margin: 0; font-size: 26px; line-height: 1.25; }
.dialog-heading > .icon-button { margin-top: -9px; margin-right: -9px; }
.reader-dialog fieldset { margin: 0 0 25px; padding: 0; border: 0; }
.reader-dialog legend { margin-bottom: 12px; font-size: 12px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.theme-option { display: grid; gap: 9px; place-items: center; padding: 17px 10px 13px; border: 1px solid transparent; border-radius: 6px; font-size: 10px; }
.theme-option > span { font: 25px/1 Georgia, serif; }
.theme-paper { color: #2b312d; background: #faf8f3; border-color: #e4e0d7; }
.theme-sepia { color: #483c2b; background: #f0e5d1; }
.theme-dark { color: #e6e6dc; background: #20231f; }
.theme-option[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 3px; }
.setting-row, .setting-range { display: block; margin-top: 23px; font-size: 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-row select { max-width: 60%; padding: 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--page); font-size: 12px; }
.setting-range > span { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.setting-range output { color: var(--muted); font-size: 11px; }
.setting-range input { width: 100%; accent-color: var(--accent); }
.dialog-footnote { margin: 24px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.dialog-error { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--danger); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.account-label { padding: 14px 0 20px; border-bottom: 1px solid var(--line); font: 20px/1.5 Georgia, serif; overflow-wrap: anywhere; }
.account-sync-state { display: flex; align-items: baseline; gap: 10px; margin: 20px 0; }
.account-sync-state p { margin: 0; font-size: 12px; line-height: 1.6; }
.reader-dialog > .muted { font-size: 12px; }
.signout-button { width: 100%; margin-top: 12px; }
#account-enable-sync { width: 100%; }
.annotation-dialog blockquote { overflow: auto; max-height: 180px; margin: 0 0 23px; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); font: 16px/1.6 Georgia, serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.annotation-dialog label { display: block; margin-bottom: 10px; font-size: 12px; }
.annotation-dialog textarea { display: block; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--page); font-size: 13px; line-height: 1.65; resize: vertical; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.dialog-actions .danger-button { margin-right: auto; padding-left: 0; }
.noscript-notice { margin: 20px; padding: 20px; border: 1px solid var(--line); }
@media (min-width: 1500px) { .side-panel { flex-basis: 290px; width: 290px; padding-left: 30px; padding-right: 30px; } }
@media (max-width: 1050px) { .welcome { gap: 40px; } .signin-card { padding: 30px 26px 25px; } .side-panel { position: fixed; top: 146px; z-index: 30; height: calc(100dvh - 186px); width: 300px; max-width: calc(100vw - 32px); box-shadow: var(--shadow); } .chapter-panel { left: 0; } .notes-panel { right: 0; } }
@media (max-width: 720px) {
  .masthead { height: 70px; padding: 0 20px; gap: 12px; }
  .wordmark { font-size: 23px; gap: 8px; }
  .brand-mark { font-size: 27px; }
  .wordmark small { display: block; margin: 6px 0 0; padding: 0; border: 0; font-size: 7px; letter-spacing: 2px; }
  .masthead-actions { gap: 5px; }
  .masthead-actions > .text-button { padding: 8px; font-size: 12px; }
  .masthead-actions > .scholar-link { display: none; }
  .sync-chip { padding: 8px; min-width: 32px; min-height: 32px; justify-content: center; }
  .sync-chip #sync-label { display: none; }
  #account-button { display: none; }
  .page-shell { padding: 36px 24px; }
  .welcome { display: block; min-height: calc(100dvh - 70px); }
  .welcome-story { padding: 14px 0 24px; }
  .welcome-story > .eyebrow { margin-bottom: 18px; font-size: 9px; }
  .welcome h1 { font-size: clamp(44px, 10vw, 62px); letter-spacing: -1.9px; margin-bottom: 22px; }
  .welcome-copy { max-width: 420px; font-size: 17px; }
  .welcome-features { display: none; }
  .signin-card { max-width: none; padding: 26px; }
  .signin-mark { display: none; }
  .signin-card h2 { font-size: 28px; }
  .welcome-footer { margin-top: 35px; font-size: 10px; }
  .welcome-footer > span { max-width: 150px; line-height: 1.7; }
  .library-heading { display: block; margin-bottom: 26px; }
  .library h1 { font-size: 38px; }
  .library-search { width: 100%; margin-top: 24px; min-height: 45px; }
  .sync-consent { display: block; padding: 20px; margin-bottom: 30px; }
  .sync-consent .primary-button { margin-top: 18px; }
  .continue-list { grid-template-columns: 1fr; }
  .continue-book { padding: 18px; gap: 17px; }
  .section-heading > .eyebrow { display: none; }
  .section-heading h2 { font-size: 23px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 22px; }
  .book-cover-title { font-size: 18px; padding: 15px; }
  .book-card > strong { font-size: 17px; }
  .reader-toolbar { top: 70px; height: 54px; padding: 0 14px; gap: 8px; }
  .reader-toolbar > p { max-width: 35%; font-size: 12px; }
  .reader-toolbar .text-button { font-size: 11px; padding: 8px 4px; }
  .reader-toolbar-actions { gap: 5px; }
  .reader-toolbar-actions .icon-button { min-width: 34px; }
  .side-panel { top: 124px; height: calc(100dvh - 164px); }
  .reading-column { padding: 0 25px; }
  .reading-page { padding-top: 39px; }
  .chapter-heading { margin-bottom: 30px; }
  .chapter-heading h1 { font-size: 33px; }
  .chapter-heading .eyebrow { margin-bottom: 13px; }
  .chapter-text { font-size: min(var(--reading-size), 28px); }
  .chapter-navigation .text-button { max-width: 40%; font-size: 11px; }
  .chapter-navigation > span { font-size: 9px; }
  .reading-status { font-size: 9px; }
  .notice { margin: 12px 12px 0; padding: 10px 14px; font-size: 12px; }
  .reader-dialog { padding: 24px; }
  html { scroll-padding-top: 140px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }

/* Paged reader: one unmodified chapter tree, fragmented by CSS, never scrolled
   by wheel/touch. Only the pager moves the clipped horizontal viewport. */
body[data-view="reader"] { height: 100dvh; overflow: hidden; display: grid; grid-template-rows: 64px minmax(0, 1fr); }
body[data-view="reader"] .masthead { position: relative; height: 64px; }
body[data-view="reader"] #main-content { min-height: 0; overflow: hidden; }
body[data-view="reader"] .error-notice { position: fixed; top: 66px; left: 12px; right: 12px; z-index: 60; margin: 0; box-shadow: var(--shadow); }
.reader { height: 100%; min-height: 0; display: grid; grid-template-rows: 52px minmax(0, 1fr) auto; }
.reader-toolbar { position: relative; top: auto; height: 52px; }
.reader-layout { display: block; position: relative; min-height: 0; height: 100%; }
.reading-column { display: grid; grid-template-rows: minmax(0, 1fr) 48px; height: 100%; width: min(100%, calc(var(--reading-width) * 1.8)); padding: 0 clamp(24px, 4vw, 60px); margin: 0 auto; }
body[data-restricted="true"] .reading-column { grid-template-rows: auto minmax(0, 1fr) 48px; }
body[data-restricted="true"] .reading-page, body[data-restricted="true"] #chapter-loading { grid-row: 2; }
body[data-restricted="true"] .chapter-navigation { grid-row: 3; }
.reading-page { display: grid; grid-template-rows: auto minmax(0, 1fr) 42px; min-height: 0; width: 100%; max-width: none; padding: 0; margin: 0; }
.chapter-heading { min-width: 0; margin: 0; padding: 20px 0 18px; text-align: center; }
.chapter-heading .eyebrow { margin: 0 0 7px; font-size: 8px; }
.chapter-heading h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0; font-size: clamp(21px, 2.2vw, 30px); line-height: 1.2; letter-spacing: -.4px; }
.chapter-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 7px 0 0; font-size: 10px; }
.chapter-rule { display: none; }
.spread-viewport { position: relative; width: 100%; min-height: 0; height: 100%; overflow: hidden; overscroll-behavior: none; scroll-behavior: auto; background: linear-gradient(90deg, transparent calc(50% - .5px), var(--line) 50%, transparent calc(50% + .5px)); }
.chapter-text { width: 100%; height: 100%; margin: 0; column-count: 2; column-gap: 64px; column-fill: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--reading-size); }
/* Blank generated content cannot change Range text or native UTF-16 offsets.
   One extra column gives a final odd page enough scroll extent to align left. */
.chapter-text::after { content: ""; display: block; break-before: column; height: 100%; }
.chapter-text:focus-visible { outline: none; }
.spread-viewport:has(.chapter-text:focus-visible) { outline: 2px solid var(--accent); outline-offset: 5px; }
.chapter-empty { position: absolute; top: 20px; left: 0; right: 0; text-align: center; }
.chapter-end { flex-direction: row; justify-content: center; gap: 14px; padding: 5px 0 0; min-height: 0; }
.chapter-end > p { font-size: 9px; line-height: 1.4; }
.chapter-end .secondary-button { min-height: 30px; padding: 6px 10px; font-size: 10px; }
.reading-page:not([data-at-end="true"]) #complete-chapter { display: none; }
.chapter-navigation { width: 100%; max-width: none; margin: 0; padding: 4px 0; }
.chapter-navigation .text-button { font-size: 12px; min-height: 38px; }
.chapter-navigation > span { font-size: 10px; }
.reading-status { position: relative; bottom: auto; left: auto; right: auto; padding-top: 9px; padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
.side-panel { position: absolute; top: 0; bottom: 0; z-index: 30; height: 100%; width: min(320px, calc(100vw - 24px)); padding: 22px 21px 35px; box-shadow: var(--shadow); }
.chapter-panel { left: 0; }
.notes-panel { right: 0; }
.reader .loading-state { min-height: 0; height: 100%; grid-row: 1; }
.selection-tools { bottom: calc(83px + env(safe-area-inset-bottom)); }
@media (max-width: 959px) {
  .reading-column { width: min(100%, calc(var(--reading-width) + 56px)); padding: 0 28px; }
  .chapter-text { column-count: 1; column-gap: 40px; }
  .spread-viewport { background: none; }
}
@media (max-width: 720px) {
  body[data-view="reader"] { grid-template-rows: 60px minmax(0, 1fr); }
  body[data-view="reader"] .masthead { height: 60px; padding-left: 16px; padding-right: 16px; }
  .reader { grid-template-rows: 46px minmax(0, 1fr) auto; }
  .reader-toolbar { height: 46px; top: auto; }
  .reading-column { padding: 0 22px; grid-template-rows: minmax(0, 1fr) 44px; }
  .chapter-heading { padding: 16px 0; }
  .chapter-heading h1 { font-size: 23px; }
  .chapter-heading .eyebrow { margin-bottom: 6px; }
  .chapter-navigation .text-button { max-width: none; }
  .side-panel { top: 0; height: 100%; }
  .chapter-end > p { max-width: 55%; font-size: 8px; }
}
@media (max-height: 620px) {
  body[data-view="reader"] { grid-template-rows: 48px minmax(0, 1fr); }
  body[data-view="reader"] .masthead { height: 48px; }
  .reader { grid-template-rows: 40px minmax(0, 1fr) auto; }
  .reader-toolbar { height: 40px; }
  .chapter-heading { padding: 8px 0 10px; }
  .chapter-heading h1 { -webkit-line-clamp: 1; font-size: 19px; }
  .chapter-heading .eyebrow, .chapter-author { display: none; }
  .chapter-end { gap: 8px; }
  .reading-status { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
/* Restricted editions have no supported excerpt export or print path. The
   server, not these presentation rules, enforces country availability. */
.restricted-edition-notice { padding: 8px 20px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.restricted-edition-notice p { margin: 4px 0; }
body[data-restricted="true"] #chapter-text { -webkit-user-select: none; user-select: none; }
@media print { body[data-restricted="true"] #reader { display: none !important; } }
