:root{--green:#263a32;--green-light:#315f52;--cream:#f3eee4;--paper:#fffdf6;--ink:#25251f;--border:#c7bca9}
*{box-sizing:border-box}html{scroll-behavior:auto}body{margin:0;background:var(--cream);color:var(--ink);font-family:Georgia,'Times New Roman',serif}
button,select{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #ad8541;outline-offset:2px}
.bar{position:sticky;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:9px clamp(14px,3vw,48px);background:#f9f5ed;border-bottom:1px solid var(--border);box-shadow:0 3px 9px #25352b1a;font:13px/1.2 Arial,sans-serif}
.bar button,.bar select{min-height:38px;border:1px solid #c9beab;border-radius:4px;background:white;color:var(--green);padding:7px 10px}.bar button:hover,.bar select:hover{border-color:var(--green-light)}.bar #contents,.bar [data-mode].on{background:var(--green-light);color:white;border-color:var(--green-light)}
.bar #sel{max-width:155px}.bar #status{white-space:nowrap;color:#514d44}.mode-buttons{display:flex;gap:5px;flex-wrap:wrap}.bar #orthography[aria-pressed="true"]{background:var(--green-light);color:white}
main{max-width:1320px;margin:auto;padding:26px 68px 130px;display:flex;gap:22px;align-items:flex-start;justify-content:center}.book{min-width:0;width:min(100%,760px)}.leaf{margin:0 auto 30px;scroll-margin-top:calc(var(--reader-header-height,142px) + var(--reader-bar-height,56px) + 18px)}.leaf-paper{width:100%;min-height:calc(100vw * .95);padding:55px 52px 60px;background:var(--paper);border:1px solid #e0d8c9;box-shadow:0 7px 24px #342f231d}.flow{max-width:100%;font-size:18px;line-height:1.52;overflow-wrap:break-word}.flow p{margin:0 0 .72em;text-indent:1.55em}.flow p.footnote{margin-top:1.4em;padding-top:.4em;border-top:1px solid #80796e;font-size:.86em;text-indent:0}.flow h2,.flow h3,.flow h4,.flow h5{margin:1.1em 0 .55em;text-align:center;line-height:1.25;text-indent:0}.flow h2{font-size:1.25em}.flow h3{font-size:1.13em}.flow h4,.flow h5{font-size:1em}.leaf-label{text-align:right;padding:7px 3px 0;color:#5b5b52;font:12px Arial,sans-serif}.scan{display:none;min-width:0;position:sticky;top:calc(var(--reader-header-height,142px) + var(--reader-bar-height,56px) + 16px);width:min(100%,610px);max-height:calc(100vh - var(--reader-header-height,142px) - var(--reader-bar-height,56px) - 32px);overflow:auto}.scan img{display:block;width:100%;height:auto;background:white;box-shadow:0 5px 20px #342f2330}
body[data-mode="continuous"] .leaf-paper{min-height:0;padding-bottom:25px}.leaf.title-leaf .leaf-paper,.leaf.permission-leaf .leaf-paper,.leaf.chapter-leaf .leaf-paper{min-height:850px}.title-composition{min-height:730px;display:flex;flex-direction:column;align-items:center;text-align:center;justify-content:space-between;padding:8px 0 0}.title-composition h2,.title-composition h3{margin:0}.title-composition h2{font-size:1.7em}.title-composition h3{font-size:1.25em}.title-composition p{margin:0;text-indent:0}.title-author{font-size:1.4em}.title-part{font-size:1.25em}.title-subtitle{max-width:550px;font-size:.95em}.title-imprint{margin-top:auto!important;padding-top:80px;font-size:.9em}
.contents-leaf .toc{display:grid;gap:7px}.toc-row{display:grid;grid-template-columns:minmax(0,auto) 1fr auto;gap:8px;align-items:end;color:var(--ink);text-decoration:none;font-size:.95em}.toc-row.level-1{padding-left:1.2em}.toc-row i{border-bottom:1px dotted #7b776d;transform:translateY(-.28em)}.toc-row b{font-weight:400}.toc-row:hover span{text-decoration:underline}.contents-leaf .flow h2{font-size:1.5em;margin:0 0 1.2em}
body[data-mode="book"] .leaf:not(.active),body[data-mode="compare"] .leaf:not(.active){display:none}body[data-mode="book"] main,body[data-mode="compare"] main{max-width:1420px}body[data-mode="book"] .book{width:min(100%,760px)}body[data-mode="scan"] .book{display:none}body[data-mode="scan"] main{max-width:900px}body[data-mode="scan"] .scan{display:block;position:static;width:min(100%,760px);max-height:none}body[data-mode="compare"] .scan{display:block}body[data-mode="compare"] .book{width:min(50%,650px)}body[data-mode="compare"] .scan{width:min(50%,650px)}
.contents-panel{position:fixed;z-index:200;inset:0 auto 0 0;width:min(470px,100vw);overflow:auto;background:#fcf8ef;border-right:1px solid var(--border);box-shadow:12px 0 34px #1c2b2580;padding:20px 24px 36px;font:15px/1.45 Arial,sans-serif}.contents-panel[hidden]{display:none}.contents-panel h2{font:25px Georgia,serif;color:var(--green)}.contents-panel a{display:block;margin:0;padding:12px 0;border-bottom:1px solid #e1d8c8;color:#263a32;text-decoration:none}.contents-panel a:hover{text-decoration:underline}.contents-panel a span{display:block;margin-top:3px;color:#796f61;font-size:12px}.contents-panel button{padding:8px 14px;border:1px solid var(--green-light);background:var(--green-light);color:white;border-radius:4px}
#return-contents,.jump-pair{position:fixed;z-index:110;bottom:calc(18px + env(safe-area-inset-bottom,0px))}#return-contents{left:18px;padding:11px 14px;border:1px solid #26483e;border-radius:6px;background:var(--green-light);color:white;box-shadow:0 3px 12px #13251c44;font:600 13px Arial,sans-serif}#return-contents[hidden]{display:none}.jump-pair{right:18px;display:flex;flex-direction:column;gap:8px}.jump-pair button{width:44px;height:44px;border:1px solid #b8a98f;border-radius:6px;background:#fffdf8;color:var(--green);box-shadow:0 3px 12px #13251c35;font:26px/1 Arial,sans-serif}
@media(max-width:880px){main{padding:18px 60px 130px}body[data-mode="compare"] main{display:block}body[data-mode="compare"] .book,body[data-mode="compare"] .scan{width:min(100%,680px);margin:auto}body[data-mode="compare"] .scan{position:static;margin-top:18px;max-height:none}}
@media(max-width:600px){.bar{gap:6px;padding:8px 12px}.bar button,.bar select{min-height:36px;padding:6px}.bar #status{font-size:12px}.mode-buttons{order:2;width:100%}.mode-buttons button{flex:1;white-space:nowrap}.bar #orthography{order:3}main{padding:16px 18px 150px}.leaf-paper{padding:28px 22px 35px;min-height:0}.flow{font-size:16px;line-height:1.48}.title-composition{min-height:630px}.leaf.title-leaf .leaf-paper,.leaf.permission-leaf .leaf-paper,.leaf.chapter-leaf .leaf-paper{min-height:690px}.toc-row{font-size:.85em}.toc-row.level-1{padding-left:.5em}#return-contents{left:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 82px)}.jump-pair{right:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px))}}

/* muromtsev scan-aligned correction 2026-10-01 */
.flow p { text-align: justify; hyphens: auto; }
.leaf.title-leaf .leaf-paper,
.leaf.permission-leaf .leaf-paper,
.leaf.contents-leaf .leaf-paper { position: relative; aspect-ratio: 607 / 1053; min-height: 850px; container-type: inline-size; padding: 0; }
.title-composition { display: block; position: absolute; inset: 0; min-height: 0; padding: 0; text-align: center; }
.title-composition > * { position: absolute; left: 3%; right: 3%; margin: 0 !important; text-indent: 0 !important; text-align: center !important; line-height: 1.15; }
.title-composition .title-kicker { top: 8%; font-size: 6.1cqw; letter-spacing: .16em; font-weight: 500; }
.title-composition .title-theory { top: 16%; font-size: 4.2cqw; font-weight: 700; }
.title-composition .title-subject { top: 24%; font-size: 6.1cqw; font-weight: 700; letter-spacing: .02em; }
.title-rule { color: #454038; font-size: 3cqw; line-height: 1; }
.title-rule-one { top: 31%; }
.title-rule-two { top: 44%; }
.title-rule-three { top: 76%; }
.title-author { top: 36%; font-size: 4.4cqw; font-variant: small-caps; }
.title-part { top: 50%; font-size: 4.5cqw; }
.title-subtitle { top: 57%; padding: 0 1%; font-size: 2.75cqw; line-height: 1.45 !important; }
.title-imprint { bottom: 2%; padding: 0 !important; font-size: 2.35cqw; line-height: 1.35 !important; }
.title-city { font-size: 1.12em; font-weight: 700; letter-spacing: .04em; }
.permission-leaf .flow { position: absolute; top: 42%; left: 5%; right: 5%; font-size: clamp(15px, 2.5cqw, 19px); line-height: 1.45; }
.permission-leaf .flow p { margin: 0 0 .65em; text-indent: 0; text-align: justify; }
.permission-leaf .flow p:last-child { text-align: center; }
.contents-leaf .flow { position: absolute; top: 23%; left: 5%; right: 5%; font-size: clamp(15px, 2.5cqw, 20px); }
.contents-leaf .toc { gap: 12px; }
.contents-leaf .flow h2 { font-size: 1.6em; margin: 0 0 1.5em; text-align: center; }
.toc-row { line-height: 1.4; }
body[data-mode="compare"] .scan { position: static; max-height: none; overflow: visible; }
body:not([data-mode="continuous"]) .jump-pair { display: none; }
.footnotes { margin-top: 2em; border-top: 1px solid #80796e; padding-top: .55em; position: relative; font-size: .8em; line-height: 1.2; }
.footnotes::before { content: ""; display: block; width: 29%; border-top: 1px solid #80796e; position: absolute; top: -1px; left: 0; }
.footnotes { border-top: 0; }
.flow .footnotes p.footnote { margin: 0 0 .45em; padding: 0; border: 0; font-size: 1em; line-height: inherit; text-indent: 1.1em; text-align: justify; }
.fn-ref, .fn-back { color: inherit; text-decoration: none; }
.fn-ref:focus-visible, .fn-back:focus-visible { outline: 2px solid #315d4e; outline-offset: 2px; }
.fn-number { white-space: nowrap; }
[id^="fnref-"], [id^="fn-"] { scroll-margin-top: calc(var(--reader-header-height,142px) + var(--reader-bar-height,56px) + 18px); }
body[data-mode="book"] .leaf-paper:has(.footnotes), body[data-mode="compare"] .leaf-paper:has(.footnotes) { display: flex; flex-direction: column; aspect-ratio: 607 / 1053; }
body[data-mode="book"] .leaf-paper:has(.footnotes) .flow, body[data-mode="compare"] .leaf-paper:has(.footnotes) .flow { display: flex; flex-direction: column; flex: 1; }
body[data-mode="book"] .footnotes, body[data-mode="compare"] .footnotes { margin-top: auto; }
@media (max-width: 600px) {
  .footnotes { font-size: 13px; }
  .leaf.title-leaf .leaf-paper, .leaf.permission-leaf .leaf-paper, .leaf.contents-leaf .leaf-paper { min-height: 690px; }
  .title-subtitle { font-size: 3.4cqw; }
  .title-imprint { font-size: 3cqw; white-space: normal; }
  .contents-leaf .flow { font-size: 15px; }
  .contents-leaf .toc { gap: 8px; }
}
.scan-message { padding: 20px; background: #fffdf6; border: 1px solid #c7bca9; font: 15px/1.4 Arial, sans-serif; }
.scan-message[hidden], .scan img[hidden] { display: none; }
.scan-message button { margin-left: 8px; padding: 7px 12px; border: 1px solid #315f52; border-radius: 4px; color: #315f52; background: white; }
