.edition-languages{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:14px 0;padding:16px 18px;background:#f7f8fa;border-radius:14px}.edition-languages h3{width:100%;margin:0 0 4px;font-size:1rem}.edition-languages button{border:1px solid #cbd1da;background:#fff;color:var(--blue);font:600 .9rem Manrope,system-ui,sans-serif;border-radius:999px;padding:9px 14px;cursor:pointer}.edition-languages button:hover{background:#eef3f8}.toc .source-link{display:block;margin:8px 0}
.toc ol.toc-children{columns:1;margin:5px 0 8px;padding-left:20px}.chapter-pending{padding:16px 18px;border:1px solid var(--line);border-radius:12px;background:#f7f8fa;color:var(--muted);line-height:1.65}
.catalog-filters{display:grid;gap:9px;margin-top:14px}.catalog-filters label{display:grid;gap:5px;font-size:.76rem;font-weight:700;color:var(--muted)}.catalog-filters select{width:100%;min-width:0;padding:10px 12px;border:1px solid #cbd1da;border-radius:11px;background:#fff;color:var(--ink);font:inherit;font-size:.86rem}.work-item{padding:7px;border:1px solid transparent;border-radius:16px;background:#f7f8fa}.work-item:focus-within,.work-item:hover{border-color:#b5c5d8;background:#eef3f8}.work-item .book-button{background:transparent}.work-copy{min-width:0}.work-item .book-meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.edition-chips{display:flex;flex-wrap:wrap;gap:7px;padding:0 10px 8px 74px}.edition-chip{display:inline-flex;align-items:center;min-height:32px;padding:6px 11px;border:1px solid #cbd1da;border-radius:999px;background:#fff;color:var(--blue);font:600 .74rem Manrope,system-ui,sans-serif;text-decoration:none;cursor:pointer}.edition-chip:hover,.edition-chip[aria-current=true]{border-color:#9db3cb;background:#e8f0f7}.edition-chip.unavailable{color:#8b929c;background:#f0f1f3;cursor:not-allowed}.catalog-panel :focus-visible,.reader-panel :focus-visible{outline:3px solid #7fa9d2;outline-offset:2px}.catalog-panel button,.catalog-panel select,.catalog-panel input{min-height:42px}.edition-note{line-height:1.55}.book-summary{max-width:760px;line-height:1.65}.reader-top .edition-note{margin:7px 0}.source-card{display:flex;flex-direction:column;gap:4px;padding:13px 15px;margin:9px 0;border:1px solid var(--line);border-radius:13px;background:#fff;color:var(--blue);text-decoration:none}.source-card:hover{background:#eef3f8;border-color:#b5c5d8}.source-title{font-weight:700}.source-meta{font-size:.78rem;color:var(--muted)}.chapter-target{padding:12px 14px;border-radius:12px;background:#fff4d6;color:#574516;font-weight:600}.book-progress{display:grid;gap:6px;margin:10px 0;color:var(--muted);font-size:.82rem}.book-progress progress{width:100%;height:9px;accent-color:var(--blue)}.toc-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.toc-row>button:first-child{flex:1;min-height:42px;padding:7px 4px}.toc .bookmark-button{padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:.76rem}.resume-button{width:100%;min-height:46px;padding:10px 14px;border:0;border-radius:12px;background:var(--blue);color:#fff;font:600 .95rem Manrope,system-ui,sans-serif;cursor:pointer}.reading-end{height:2px}.edition-languages button[aria-current=true]{background:#e8f0f7;border-color:#9db3cb}.error{line-height:1.6}.retry{min-height:42px}
@media(max-width:1100px){.catalog-filters{grid-template-columns:1fr 1fr}.catalog-filters label:last-child{grid-column:1/-1}.edition-chips{padding-left:10px}.catalog-panel{max-height:none}}
:root{color-scheme:light;--navy:#071a32;--blue:#173b63;--gold:#d6ad62;--paper:#f7f5f0;--ink:#172335;--muted:#687386;--line:#e1e4e8;--white:#fff}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:"DM Sans",system-ui,sans-serif}.library-header{height:70px;padding:0 clamp(18px,4vw,52px);background:var(--navy);display:flex;align-items:center;justify-content:space-between}.brand img{width:130px;height:auto;display:block}.back-link{color:#edf1f7;text-decoration:none;font-size:.9rem}.library-layout{max-width:1440px;min-height:calc(100vh - 112px);margin:auto;display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:24px;padding:24px}.catalog-panel,.reader-panel{background:var(--white);border:1px solid var(--line);border-radius:20px;box-shadow:0 10px 32px #071a320a}.catalog-panel{padding:22px;align-self:start;position:sticky;top:20px;max-height:calc(100vh - 40px);overflow:auto}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.eyebrow{margin:0 0 6px;color:#8b6a2e;font-size:.7rem;font-weight:700;letter-spacing:.14em}.panel-heading h1{font-family:Manrope,system-ui,sans-serif;font-size:1.45rem;line-height:1.2;margin:0}.icon-button{width:42px;height:42px;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--blue);font-size:1.4rem;cursor:pointer}.search-label{display:block;margin:24px 0 7px;font-size:.8rem;font-weight:700}.catalog-panel input{width:100%;padding:12px 14px;border:1px solid #cbd1da;border-radius:12px;font:inherit}.status{min-height:22px;margin:14px 0 8px;color:var(--muted);font-size:.84rem}.book-list{list-style:none;padding:0;margin:0;display:grid;gap:8px}.book-button{width:100%;padding:12px;text-align:left;display:flex;gap:12px;align-items:center;border:1px solid transparent;border-radius:14px;background:#f7f8fa;color:inherit;cursor:pointer}.book-button:hover,.book-button[aria-current=true]{border-color:#b5c5d8;background:#eef3f8}.cover{width:52px;height:70px;border-radius:6px;object-fit:cover;background:#e8edf2;flex:none}.book-title{display:block;font-weight:700;line-height:1.3}.book-meta{display:block;margin-top:5px;color:var(--muted);font-size:.78rem}.reader-panel{min-height:620px;padding:clamp(22px,5vw,64px)}.welcome{min-height:500px;display:grid;align-content:center;justify-items:center;text-align:center;color:var(--muted)}.welcome span{font-size:3rem}.welcome h2{color:var(--ink);font-family:Manrope,system-ui,sans-serif;font-size:1.55rem}.welcome p{max-width:420px;line-height:1.65}.reader-top{display:flex;align-items:center;gap:20px;margin-bottom:30px}.reader-cover{width:86px;height:116px;object-fit:cover;border-radius:8px;background:#e8edf2}.reader-top h2{font:700 clamp(1.5rem,3vw,2.25rem)/1.2 Manrope,system-ui,sans-serif;margin:0 0 8px}.reader-top p{margin:4px 0;color:var(--muted)}.edition-note{font-size:.82rem}.source-link{display:inline-block;margin-top:8px;color:var(--blue);font-weight:600}.toc{padding:18px 20px;margin:22px 0 32px;background:#f7f8fa;border-radius:14px}.toc h3{margin:0 0 12px;font-size:1rem}.toc ol{margin:0;padding-left:22px;columns:2;column-gap:32px}.toc li{padding:4px 0;break-inside:avoid}.toc button{border:0;background:none;color:var(--blue);font:inherit;text-align:left;cursor:pointer}.chapter{max-width:760px;margin:0 auto}.chapter-heading{display:flex;gap:14px;align-items:center;margin:0 0 22px;padding-bottom:14px;border-bottom:1px solid var(--line)}.chapter-heading button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 12px;color:var(--blue);cursor:pointer}.chapter-body{font:400 1.12rem/1.85 Georgia,"Times New Roman",serif}.chapter-body h1,.chapter-body h2,.chapter-body h3{font-family:Manrope,system-ui,sans-serif;line-height:1.35;margin:1.7em 0 .65em}.chapter-body p{margin:0 0 1.15em}.chapter-body blockquote{margin:1em 0;padding:4px 0 4px 18px;border-left:3px solid var(--gold);color:#48566a}.error{color:#963b36}.retry{padding:9px 14px;border:0;border-radius:10px;background:var(--blue);color:#fff;cursor:pointer}footer{padding:18px;text-align:center;color:var(--muted);font-size:.78rem}@media(max-width:1100px){.library-layout{grid-template-columns:1fr;padding:14px}.catalog-panel{position:static;max-height:45vh}.reader-panel{min-height:55vh;padding:24px}.welcome{min-height:34vh}.toc ol{columns:1}}@media(max-width:480px){.library-header{height:60px}.brand img{width:112px}.reader-top{align-items:flex-start}.reader-cover{width:66px;height:90px}.chapter-body{font-size:1.05rem}}
/* Mobile catalog and dedicated reading view. */
html { scroll-padding-top: 84px; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 100; transform: translateY(-160%); padding: 12px 18px; background: #fff; color: var(--navy); border-radius: 12px; }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid #5799e1; outline-offset: 3px; }
.library-header { position: sticky; top: 0; z-index: 20; gap: 16px; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; }
.catalog-panel { top: 90px; max-height: calc(100dvh - 110px); }
.mobile-reader-toolbar { display: none; }
.reader-panel, .reader-top > div { min-width: 0; overflow-wrap: anywhere; }
.reader-cover { flex: none; }
.catalog-filters label:last-child { grid-column: auto; }
.catalog-panel input, .catalog-filters select { font-size: 16px; min-height: 48px; }
.edition-chip, .edition-languages button, .retry, .toc .bookmark-button, .chapter-heading button { min-height: 44px; }
.chapter-heading { flex-wrap: wrap; }
.chapter-heading h2 { font-size: clamp(1.3rem,4vw,1.8rem); margin: 0; }
@media (max-width: 1100px) {
  .library-layout { grid-template-columns: minmax(0,1fr); padding: 16px; gap: 16px; }
  .catalog-panel { position: static; max-height: none; overflow: visible; padding: 20px; }
  .catalog-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-filters label:last-child { grid-column: auto; }
  .reader-panel { padding: 24px 20px; min-height: 0; }
  body:not(.reading-active) .reader-panel { display: none; }
  .reading-active .catalog-panel { display: none; }
  .reading-active .mobile-reader-toolbar:not([hidden]) { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: 70px; z-index: 10; padding: 8px 0; background: var(--paper); }
  .mobile-reader-toolbar button { min-height: 48px; padding: 10px 14px; background: var(--blue); color: #fff; border: 0; border-radius: 12px; font: inherit; cursor: pointer; }
  .mobile-reader-toolbar span { font-size: 12px; color: var(--muted); }
  .reader-panel { scroll-margin-top: 140px; }
  .edition-chips { padding: 4px 10px 10px; }
  .toc { padding: 18px 14px; }
  .toc-row { align-items: flex-start; }
  .toc-row > button:first-child { min-height: 48px; line-height: 1.6; }
  .toc .bookmark-button { flex-shrink: 0; }
  .chapter-body { font-size: 1.125rem; line-height: 1.85; }
  .reader-top { gap: 14px; align-items: flex-start; }
  .book-meta { font-size: 13px; }
}
@media (max-width: 480px) {
  .library-header { padding-inline: 16px; height: 64px; }
  .back-link { font-size: 13px; }
  .reading-active .mobile-reader-toolbar:not([hidden]) { top: 64px; }
  .library-layout { padding: 12px; }
  .catalog-panel { padding: 18px; }
  .reader-cover { width: 56px; height: 78px; }
  .reader-top h2 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
.chapter-body .source-reference { margin-left: .28em; color: var(--muted); font-size: .68em; vertical-align: super; white-space: nowrap; }
.toc ol { list-style: none; padding-left: 0; }
.toc .toc-metadata { display: block; color: var(--muted); font-size: .8em; margin-top: 3px; }
.toc button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.toc .toc-children { padding-left: 16px; }
.toc-row > .toc-title { flex: 1; min-width: 0; min-height: 48px; padding: 7px 4px; line-height: 1.6; overflow-wrap: anywhere; }
.toc-row > .toc-expand { flex: none; min-width: 44px; min-height: 48px; padding: 7px 4px; font-size: .8rem; }

/* Reader controls stay outside text layout changes; tables own their overflow. */
.reader-panel { min-width: 0; --reader-paper: #fafaf8; --reader-ink: #20272d; background: var(--reader-paper); color: var(--reader-ink); }
.reader-panel[data-paper="sepia"] { --reader-paper: #fbf0d9; --reader-ink: #3f352a; }
.reader-panel[data-paper="slate"] { --reader-paper: #20262e; --reader-ink: #e1e5ea; }
.reader-panel[data-paper="black"] { --reader-paper: #000; --reader-ink: #d7dadf; }
@media (prefers-color-scheme: dark) { .reader-panel[data-paper="system"] { --reader-paper: #20262e; --reader-ink: #e1e5ea; } }
.chapter-heading { position: sticky; top: 70px; z-index: 8; padding: 8px; margin-inline: -8px; gap: 8px; background: var(--reader-paper); box-shadow: 0 1px 0 #8291a044; }
.chapter-heading h2 { flex: 1; min-width: 0; font: 600 1rem/1.4 system-ui,sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-heading button, .chapter-navigation button { min-height: 44px; flex-shrink: 0; color: inherit; background: var(--reader-paper); }
.chapter-body { overflow-wrap: anywhere; }
.chapter-body a { color: #17638a; text-underline-offset: .15em; }
.reader-panel[data-paper="slate"] a, .reader-panel[data-paper="black"] a { color: #aacee5; }
.chapter-body blockquote { color: inherit; }
.chapter-body hr { border: 0; border-top: 1px solid #8291a044; margin-block: 1.5em; }
.chapter-navigation { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 32px 0 16px; }
.chapter-navigation button { border: 1px solid #8291a080; border-radius: 12px; padding: 10px 18px; font: inherit; cursor: pointer; }
.table-scroll { overflow-x: auto; max-width: 100%; margin-block: 1em; border: 1px solid #8291a066; border-radius: 10px; }
.table-scroll:focus-visible { outline: 2px solid #17638a; }
.table-scroll table { border-collapse: collapse; min-width: 100%; }
.table-scroll th, .table-scroll td { min-width: 144px; padding: 10px 14px; border: 1px solid #8291a044; text-align: start; vertical-align: top; }
.selection-tools { position: fixed; z-index: 40; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: max-content; max-width: calc(100vw - 20px); padding: 6px; background: #14253a; color: #fff; border: 1px solid #8291a0; border-radius: 16px; box-shadow: 0 5px 24px #0005; }
.selection-tools[hidden] { display: none; }
.selection-tools button { min-width: 44px; min-height: 44px; background: transparent; color: inherit; border: 0; border-radius: 8px; font: inherit; cursor: pointer; }
.selection-tools button[aria-label^="Sorot"] { font-size: 26px; }
.selection-tools button:focus-visible, .reader-dialog button:focus-visible { outline: 2px solid #ffd966; }
.reader-highlight { color: #17242b; border-radius: 2px; }
.reader-highlight a { color: inherit !important; }
.reader-dialog { width: min(500px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); overflow: auto; color: #17242b; background: #fafaf8; border: 1px solid #8291a0; border-radius: 18px; padding: 24px; }
.reader-dialog::backdrop { background: #071a3299; }
.reader-dialog label { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; margin-block: 14px; }
.reader-dialog select, .reader-dialog textarea { max-width: 100%; width: 100%; min-height: 44px; font: inherit; padding: 8px; border: 1px solid #8291a0; border-radius: 8px; }
.reader-dialog button, .reader-button { display: inline-block; margin: 12px 8px 0 0; min-height: 44px; padding: 10px 16px; border: 1px solid #8291a0; border-radius: 10px; background: #e5eef6; color: #17334e; font: inherit; text-decoration: none; cursor: pointer; }
@media(max-width:1100px) { .chapter-heading { top: 116px; } .reader-panel { padding-inline: clamp(16px, 4vw, 32px); } }
@media(max-width:480px) { .chapter-heading { top: 110px; } .chapter-heading > button { padding-inline: 8px; } }
@media(orientation:landscape) and (max-height:500px) { .library-header { height: 48px; } .reading-active .mobile-reader-toolbar:not([hidden]) { display: none; } .chapter-heading { top: 48px; } .reader-panel { padding-top: 12px; } .selection-tools { bottom: 8px; } }

.footnote-button { vertical-align: super; font-size: .75em; min-width: 24px; min-height: 32px; border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; }
