[data-theme=plum]{--chapter:#775a70;--chapter-light:#efe5ee}[data-theme=olive]{--chapter:#63734f;--chapter-light:#e7eddf}[data-theme=rose]{--chapter:#845a66;--chapter-light:#f3e5e8}[data-theme=slate]{--chapter:#526a7a;--chapter-light:#e5ecf0}[data-theme=amber]{--chapter:#856238;--chapter-light:#f0e8d9}
.ranking-mark{display:inline-block;border-bottom:2px solid var(--chapter,#86714e);padding:2px 0 4px;color:var(--chapter,#86714e);font-size:11px;letter-spacing:.08em;font-weight:700}.play-heading .eyebrow{margin-top:8px}.topic-choice,.more-topic{border-left:4px solid var(--chapter,#a08b69)}.more-options{margin:16px 0 21px;font-size:12px;color:#80705a}.more-options summary{padding:10px 0}.more-topics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:10px 0}.more-topic{background:#fffcf5;color:#685740;border-top:1px solid #d9ccb7;border-right:1px solid #d9ccb7;border-bottom:1px solid #d9ccb7;border-radius:3px;text-align:left;padding:10px;font-size:11px;line-height:1.8}
.shelf-book[data-theme] .cover-face{border-left-color:var(--chapter,#8c7854)}.book-chapter{display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid #d9ccb7;margin:8px auto 18px;padding:5px 0 12px;max-width:1200px}.book-chapter p{font-size:11px;color:#8c7b63;margin:7px 0 0}.chapter-play{border:1px solid var(--chapter,#856238);background:var(--chapter-light,#f0e8d9);color:var(--chapter,#775a3a);border-radius:4px;font-size:11px;padding:10px 15px}.book-paper{border-top:4px solid var(--chapter,#baa47d)}.paper-heading{color:var(--chapter,#9a886b)}
.unfilled .entry-title{color:#796d5d;font-weight:400}.unfilled .entry-stamp{visibility:hidden}.unfilled .entry-author,.unfilled .entry-excerpt{display:none}.unfilled .entry-empty-lines{height:31px;opacity:.5;max-width:100%}.entry-ranking{display:inline-block;font-size:9px;line-height:1.8;color:var(--chapter,#9b896c);border-bottom:1px solid #d8cdb9;margin:3px 0 4px}.entry-actions .entry-play{color:var(--chapter,#8f7150)}.found .entry-title{color:#514332}.found .entry-stamp{border:1px solid #829371;border-radius:3px;padding:1px 4px;transform:rotate(-3deg)}.just-found .entry-body{animation:written-page .7s ease-out}
#play-panel .game-card{position:relative;border-top-color:var(--chapter,#d4c2a3)}#word-progress{accent-color:var(--chapter,#8e9b78)}#word-progress::-webkit-progress-value{transition:width .12s ease-out;background:var(--chapter,#82916f)}.completion-toast{position:absolute;right:18px;top:-17px;z-index:2;display:flex;gap:16px;align-items:center;padding:8px 14px;background:#fffdf5;border:1px solid var(--chapter,#8e9a7a);border-radius:4px;box-shadow:0 3px 8px #47351d10;color:var(--chapter,#6d7d58);font-size:11px;pointer-events:none}.completion-toast span{font:bold 15px Georgia,serif}.ink-stamp{animation:ink-stamp .28s ease-out}.roman{font-variant-ligatures:none}#roman-done{color:var(--chapter,#867657)}
@keyframes ink-stamp{0%{opacity:0;transform:translateY(4px) rotate(-4deg) scale(1.04)}65%{opacity:1;transform:translateY(0) rotate(0) scale(.99)}100%{transform:none}}@keyframes written-page{0%{opacity:.45;transform:translateY(3px)}100%{opacity:1;transform:none}}
@media(max-width:650px){.more-topics{grid-template-columns:1fr 1fr}.book-chapter{align-items:start;gap:10px}.chapter-play{font-size:10px;padding:9px;max-width:150px}.completion-toast{font-size:10px;right:8px;padding:6px 9px;gap:9px}.completion-toast span{font-size:13px}}@media(prefers-reduced-motion:reduce){.ink-stamp,.just-found .entry-body{animation:none}#word-progress::-webkit-progress-value{transition:none}}
.new-pool-choice{display:block;margin:7px 0 0 auto;font-size:11px;color:#92714d}.new-page-written .practice-summary{border-left:4px solid #86966f;background:#f1f4e9}.new-page-written #practice-award{color:#62784d}.owner-memo{white-space:pre-wrap}

#book-chapter-label{font:600 20px/1.6 var(--serif);margin:0;border-bottom:0;border-left:5px solid var(--chapter,#856238);padding:1px 13px;background:var(--chapter-light,#f0e8d9);letter-spacing:.02em}.paper-heading span:first-child{font-size:12px;font-weight:700}.next-key{background:var(--chapter-light,#f0e8d9);color:var(--chapter,#856238);border-bottom:2px solid var(--chapter,#856238);border-radius:2px;padding:0 2px}.game-card:focus-within{box-shadow:0 3px 12px #604a2c0c}@media(max-width:650px){#book-chapter-label{font-size:17px;padding:2px 8px}.paper-heading span:first-child{font-size:11px}}

.book-section-tabs{display:flex;gap:6px;margin:0 auto 12px;flex-wrap:wrap}.section-tab{background:#fffcf5;color:var(--chapter,#856238);border:1px solid #d7c7ae;border-bottom:3px solid #d7c7ae;border-radius:4px 4px 0 0;padding:8px 19px;font-size:12px}.section-tab[aria-current=page]{background:var(--chapter-light,#f0e8d9);border-color:var(--chapter,#856238);font-weight:700}#word-progress[value="0"]::-webkit-progress-value{transition:none}
@media(max-width:650px){.book-chapter>div{min-width:0;flex:1}.chapter-play{flex-shrink:0;min-width:110px;white-space:nowrap}.paper-heading{gap:8px}.paper-heading span:last-child{max-width:75px;text-align:right}}
#play-panel .play-metrics{position:sticky;top:8px;z-index:4;box-shadow:0 3px 12px #604a2c15}
@media(max-width:650px){#play-panel .play-metrics{top:4px}}

/* A physical page has five fixed writing rows. Content length never changes
   its height, and full notes open in a bounded reading sheet on that page. */
#book-panel{--book-paper-height:780px;--book-heading-height:42px}
#book-panel .book-chapter{box-sizing:border-box;height:112px;min-height:112px;align-items:center}
#book-panel .book-chapter>div{min-width:0;flex:1}
#book-chapter-label{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:64px}
#book-chapter-progress{line-height:1.7;min-height:38px;max-height:38px;overflow:hidden}
#book-panel .chapter-play{flex:none;white-space:nowrap}
#book-panel .section-tab{font-weight:700}
#book-panel .book-paper{box-sizing:border-box;display:grid;grid-template-rows:var(--book-heading-height) minmax(0,1fr);height:var(--book-paper-height);min-height:var(--book-paper-height);max-height:var(--book-paper-height);padding:17px 28px 31px}
#book-panel .book-paper[data-side=left]{padding-right:34px}
#book-panel .book-paper[data-side=right]{padding-left:34px}
#book-panel .paper-heading{box-sizing:border-box;min-height:0;overflow:hidden;align-items:start;padding-bottom:8px}
#book-panel .paper-heading span:first-child{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.5}
#book-panel .paper-heading span:last-child{flex:none;line-height:1.5}
#book-panel .paper-entries{display:grid;height:100%;min-height:0;grid-template-rows:repeat(5,minmax(0,1fr))}
#book-panel .book-entry{box-sizing:border-box;min-height:0;padding:6px 0;position:static}
#book-panel .entry-body{display:grid;min-height:0;grid-template-rows:42px 16px 14px 18px 28px;gap:1px;align-content:start}
#book-panel .entry-heading{grid-row:1;display:flex;position:relative;min-width:0;gap:7px;align-items:start;overflow:hidden}
#book-panel .entry-title{font-size:15px;line-height:21px;margin:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-width:0}
#book-panel .entry-stamp{position:static;writing-mode:horizontal-tb;font-size:8px;line-height:15px;flex:none}
#book-panel .entry-serial{visibility:visible;align-self:start;padding-top:3px}
#book-panel .entry-ranking{grid-row:2;justify-self:start;min-width:0;max-width:100%;box-sizing:border-box;font-size:9px;line-height:14px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#book-panel .entry-author{grid-row:3;font-size:10px;line-height:14px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#book-panel .entry-excerpt{grid-row:4;display:block;font-size:11px;line-height:18px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#book-panel .entry-empty-lines{grid-row:3 / 5;height:32px}
#book-panel .entry-actions{grid-row:5;flex-wrap:nowrap;align-items:start;gap:12px;min-width:0}
#book-panel .entry-play,#book-panel .entry-details summary{box-sizing:border-box;font-size:10px;line-height:20px;min-height:28px;padding:3px 0;white-space:nowrap}
#book-panel .entry-details,#book-panel .entry-details[open]{position:static;flex-basis:auto;min-width:0}
#book-panel .entry-details[open] summary{margin-bottom:0}
#book-panel .entry-details[open]>summary{color:var(--chapter,#856238)}
#book-panel .entry-reading-pane{position:absolute;inset:58px 20px 32px;z-index:6;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 19px 24px;background:#fffdf5;border:1px solid #cdbb9d;border-radius:3px;box-shadow:0 4px 14px #44331e26;outline-offset:-4px}
#book-panel .entry-reading-bar{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;background:#fffdf5;border-bottom:1px solid #e5d9c5;font-size:11px;color:var(--chapter,#856238)}
#book-panel .entry-reading-close{background:#f4eedf;border:1px solid #cdbb9d;border-radius:3px;color:#66513a;min-height:36px;padding:6px 11px;font-size:11px;white-space:nowrap}
#book-panel .entry-reading-title{font:600 17px/1.8 var(--serif);overflow-wrap:anywhere;margin:14px 0}
#book-panel .entry-reading-pane .entry-full-note{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:2}
#book-panel .paper-ending{grid-row:1 / 6;align-self:center}
#book-panel .reader-toolbar{width:100%;box-sizing:border-box;grid-template-columns:minmax(0,1fr) 116px minmax(0,1fr);gap:10px}
#book-panel .reader-toolbar button{box-sizing:border-box;min-height:44px;min-width:0;width:150px;max-width:100%;padding:9px 10px;white-space:nowrap}
#book-page-position{font-variant-numeric:tabular-nums;text-align:center;white-space:nowrap}
@media(max-width:900px){#book-panel .book-paper{padding-left:21px;padding-right:21px}#book-panel .book-paper[data-side=left]{padding-right:27px}#book-panel .book-paper[data-side=right]{padding-left:27px}#book-panel .book-entry{grid-template-columns:18px minmax(0,1fr);gap:6px}#book-panel .entry-title{font-size:14px}#book-panel .entry-heading{gap:4px}#book-panel .entry-stamp{font-size:7px}#book-panel .entry-actions{gap:10px}}
@media(max-width:650px){#book-panel{--book-paper-height:800px;--book-heading-height:42px}#book-panel .book-chapter{height:132px;min-height:132px;gap:8px}#book-panel .chapter-play{font-size:9px;min-width:100px;padding:8px 6px}#book-panel .book-paper,#book-panel .book-paper:has(.paper-ending){height:var(--book-paper-height);min-height:var(--book-paper-height);max-height:var(--book-paper-height);padding:17px 18px 31px!important}#book-panel .book-paper:has(.paper-ending) .paper-entries{display:grid}#book-panel .book-entry{grid-template-columns:18px minmax(0,1fr);gap:6px}#book-panel .entry-title{font-size:15px}#book-panel .entry-stamp{font-size:7px}#book-panel .entry-actions{gap:10px}#book-panel .entry-details summary{font-size:9px}#book-panel .entry-reading-pane{inset:58px 10px 32px;padding:0 12px 18px}#book-panel .reader-toolbar{grid-template-columns:minmax(0,1fr) 84px minmax(0,1fr);gap:6px}#book-panel .reader-toolbar button{width:130px;font-size:10px;padding:8px 3px}#book-page-position{font-size:9px}#book-panel .paper-heading span:last-child{max-width:75px}}

/* Keep physical pages and turn controls fixed while rankings change. The first
   five ranks are on the right leaf; DOM and narrow screens follow that order. */
#book-panel .book-spread-open>.book-paper[data-side=right]{grid-column:2;grid-row:1}
#book-panel .book-spread-open>.book-paper[data-side=left]{grid-column:1;grid-row:1}
#book-panel .book-section-tabs{box-sizing:border-box;height:44px;min-height:44px;max-height:44px;overflow:hidden;align-items:center;gap:12px;flex-wrap:nowrap}
#book-panel .book-ranking-label{font-size:11px;white-space:nowrap;color:var(--chapter,#856238)}
#book-panel .book-ranking-select{box-sizing:border-box;min-width:0;max-width:520px;flex:1;height:36px;padding:5px 28px 5px 10px;border:1px solid #d0bea0;border-radius:4px;background:#fffdf7;color:#62513e;font-family:inherit;font-size:12px;line-height:1.5;text-overflow:ellipsis}
#book-panel .book-ranking-order{font-size:11px;color:#8f7c60}
#book-panel .unfilled .entry-title{color:#9b8b74;font-size:14px;font-weight:400;letter-spacing:.06em}
#book-panel .unfilled .entry-body{grid-template-rows:42px 16px 14px 18px 28px}
#book-panel .unfilled .entry-empty-lines{opacity:.4}
#book-panel .unfilled .reading-pending{font-size:10px;line-height:20px;min-height:28px;padding:3px 0;box-sizing:border-box;color:#a19480}
#book-panel .entry-serial{font-variant-numeric:tabular-nums;white-space:nowrap}
@media(max-width:650px){
 #book-panel .book-ranking-label{font-size:10px}
 #book-panel .book-section-tabs{gap:8px}
 #book-panel .book-ranking-select{font-size:11px;max-width:100%;width:0}
 #book-panel .book-spread-open>.book-paper[data-side=right]{border-radius:5px 5px 0 0;border-bottom:4px double #d6c3a3}
 #book-panel .book-spread-open>.book-paper[data-side=left]{border-radius:0 0 5px 5px;border-bottom:0}
}
