
#book-side-tabs .book-genre-rail{height:var(--book-paper-height,780px);box-sizing:border-box;padding:10px 0;grid-auto-rows:var(--genre-tab-row,15.2px);overflow-y:auto;overscroll-behavior:contain}
#book-side-tabs .book-genre-tab{height:var(--genre-tab-row,15.2px);min-height:var(--genre-tab-row,15.2px);padding:1px 3px;font-size:10px;line-height:1.05;background:var(--note-fill,#eee6d5);border-color:var(--note-edge,#cbb99b)}
#book-side-tabs .book-genre-tab.is-category-start{border-top-width:2px}
#book-side-tabs .book-genre-tab[aria-current=page],#book-side-tabs .book-genre-choice[aria-current=page]{background:#775b3d;color:#fffdf5;border-color:#775b3d}
#book-side-tabs .book-genre-tab:hover{filter:brightness(1.05)}
#book-side-tabs .genre-tab-count{font-size:8px;line-height:1}
#book-side-tabs .is-preparing{background:#eee9df;color:#958c7e;border-color:#d9cdbb}
#book-side-tabs .book-genre-choice{background:var(--note-fill,#eee6d5);border-color:var(--note-edge,#cbb99b)}
.book-chapter-category{display:block;font-size:10px;line-height:1.3;color:#8b765d;margin:0 0 3px}
#book-section-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#book-ranking-select{max-width:500px;flex:1;min-width:160px}
.book-part-select{font:inherit;font-size:11px;max-width:230px;padding:9px 8px;border:1px solid #cbb99b;background:#fffcf3;border-radius:4px;color:#65543f}
.reader-toolbar-space{height:66px;margin:22px auto;max-width:1200px}
.reader-toolbar-space[hidden]{display:none}
#book-panel:not([hidden]) #reader-toolbar:not([hidden]){position:fixed;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:90;width:min(1050px,calc(100vw - 24px));max-width:1050px;margin:0;padding:8px 10px;display:grid;grid-template-columns:minmax(0,1fr) 136px minmax(0,1fr);gap:10px;min-height:62px;background:#fffaf1;border:1px solid #c8b596;border-radius:7px;box-shadow:0 3px 20px #5a402b29}
#book-panel #reader-toolbar button{min-height:44px}
#book-page-position{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:has(#book-panel:not([hidden])) .completion-toast{bottom:88px}
@media(max-width:900px){#book-side-tabs .book-genre-rail{display:none}#book-side-tabs .genre-tab-count{font-size:10px}#book-side-tabs .book-genre-choice{min-height:44px}#book-section-tabs{gap:5px}#book-ranking-select{min-width:120px}}
@media(max-width:650px){.book-chapter-category{font-size:9px;margin-bottom:2px}#book-panel:not([hidden]) #reader-toolbar:not([hidden]){bottom:max(8px,env(safe-area-inset-bottom));width:calc(100vw - 16px);padding:6px;gap:6px;grid-template-columns:minmax(0,1fr) 94px minmax(0,1fr);min-height:58px}#book-panel #reader-toolbar button{font-size:10px;padding:8px 4px;width:100%;max-width:100%}.book-part-select{max-width:130px;font-size:10px;padding:8px 5px}#book-ranking-select{max-width:100%;font-size:10px}.book-ranking-label{font-size:10px}.reader-toolbar-space{height:62px}}

#book-side-tabs [data-category="relationships"]{--note-fill:#f0e1d6;--note-edge:#9b755f}
#book-side-tabs [data-category="characters"]{--note-fill:#e7e8d9;--note-edge:#858b64}
#book-side-tabs [data-category="roles"]{--note-fill:#e3e5dc;--note-edge:#7b8872}
#book-side-tabs [data-category="appearance"]{--note-fill:#e9dfd3;--note-edge:#9b8065}
#book-side-tabs [data-category="species"]{--note-fill:#e2e7e3;--note-edge:#718c80}
#book-side-tabs [data-category="adventure"]{--note-fill:#e0e4ea;--note-edge:#758397}
#book-side-tabs [data-category="everyday"]{--note-fill:#ece5d9;--note-edge:#9a8764}
#book-side-tabs [data-category="devices"]{--note-fill:#e2e7df;--note-edge:#7a8d70}
#book-side-tabs [data-category="story"]{--note-fill:#e8dfdf;--note-edge:#9a7777}
#book-side-tabs [data-category="thrills"]{--note-fill:#e4dfeb;--note-edge:#8b799d}
#book-side-tabs [data-category="body"]{--note-fill:#eaded3;--note-edge:#a48569}
#book-side-tabs [data-category="upcoming"]{--note-fill:#eee9df;--note-edge:#9c9385}
/* Keep the dock on the paper so every side note stays clickable. */
@media(min-width:901px) and (max-width:1479px){#book-panel:not([hidden]) #reader-toolbar:not([hidden]){width:calc(100vw - 308px);max-width:972px}}

/* The reader keeps the original paper size; only the space above it changes. */
body:has(#book-panel[data-reading="true"]:not([hidden])) .site-head{display:none}
#app:has(#book-panel[data-reading="true"]:not([hidden]))>.tabs{height:38px;align-items:stretch;margin-bottom:4px;gap:24px}
#app:has(#book-panel[data-reading="true"]:not([hidden]))>.tabs button{padding:5px 6px;font-size:12px}
#book-panel[data-reading="true"] .book-reader-top{display:grid;grid-template-columns:110px minmax(0,1fr) 168px;grid-template-rows:36px 18px;column-gap:12px;row-gap:3px;align-items:center;max-width:1200px;margin:0 auto 5px;min-height:57px}
#book-panel[data-reading="true"] #book-other{grid-column:1;grid-row:1;margin:0;padding:5px 0;min-height:36px;font-size:11px;white-space:nowrap}
#book-panel[data-reading="true"] #book-chapter,#book-panel[data-reading="true"] #book-chapter>div,#book-panel[data-reading="true"] .chapter-actions{display:contents}
#book-panel[data-reading="true"] #book-chapter-label,#book-panel[data-reading="true"] #book-start-help,#book-panel[data-reading="true"] #book-chapter-category{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#book-panel[data-reading="true"] #book-section-tabs{grid-column:2;grid-row:1;display:flex;height:36px;min-height:36px;max-height:36px;gap:7px;margin:0;overflow:visible}
#book-panel[data-reading="true"] #book-ranking-select{max-width:none;height:34px;min-width:0;font-size:11px;padding:4px 22px 4px 8px}
#book-panel[data-reading="true"] .book-part-select{height:34px;max-width:190px;min-width:0;font-size:11px;padding:4px 22px 4px 7px}
#book-panel[data-reading="true"] .book-ranking-label{font-size:10px}
#book-panel[data-reading="true"] #book-chapter-progress{grid-column:1 / 3;grid-row:2;line-height:18px;height:18px;min-height:18px;max-height:18px;margin:0;font-size:10px;color:#827158;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#book-panel[data-reading="true"] #book-chapter-play{grid-column:3;grid-row:1;min-height:36px;max-width:100%;margin:0;padding:5px 9px;font-size:11px;line-height:1.4;white-space:nowrap}
#book-panel[data-reading="true"] #book-chapter-next{grid-column:3;grid-row:2;min-height:18px;max-width:100%;font-size:9px;line-height:18px;padding:0;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#book-panel[data-reading="true"] #book-chapter-seal{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
#book-panel[data-reading="true"] .single-book{margin-top:0}
@media(max-width:900px){
 #book-panel[data-reading="true"] .book-reader-top{grid-template-columns:100px minmax(0,1fr) 150px;column-gap:8px}
 #book-panel[data-reading="true"] .book-part-select{max-width:120px}
}
@media(max-width:650px){
 #app:has(#book-panel[data-reading="true"]:not([hidden]))>.tabs{gap:14px;height:38px}
 #app:has(#book-panel[data-reading="true"]:not([hidden]))>.tabs button{font-size:11px;padding:5px 3px}
 #book-panel[data-reading="true"] .book-reader-top{grid-template-columns:minmax(0,1fr) 150px;grid-template-rows:36px 36px 18px;row-gap:3px;min-height:96px}
 #book-panel[data-reading="true"] #book-other{grid-column:1;grid-row:1;font-size:10px}
 #book-panel[data-reading="true"] #book-chapter-play{grid-column:2;grid-row:1;font-size:10px;min-width:0}
 #book-panel[data-reading="true"] #book-section-tabs{grid-column:1 / 3;grid-row:2;gap:5px}
 #book-panel[data-reading="true"] #book-ranking-select{font-size:10px}
 #book-panel[data-reading="true"] .book-part-select{max-width:112px;font-size:10px;padding-left:4px}
 #book-panel[data-reading="true"] .book-ranking-label{font-size:9px}
 #book-panel[data-reading="true"] #book-chapter-progress{grid-column:1 / 3;grid-row:3;font-size:9px}
 #book-panel[data-reading="true"] #book-chapter-next{grid-column:2;grid-row:1;align-self:end;transform:translateY(18px);font-size:8px}
}

@media(max-width:650px){
 #book-panel[data-reading="true"] #book-chapter-next{grid-column:2;grid-row:3;align-self:center;transform:none}
 #book-panel[data-reading="true"]:has(#book-chapter-next:not([hidden])) #book-chapter-progress{grid-column:1}
}

html:has(#book-panel[data-reading="true"]:not([hidden])){scroll-padding-bottom:90px}
#book-panel[data-reading="true"] .entry-play,#book-panel[data-reading="true"] .entry-details summary{scroll-margin-bottom:90px}

#book-panel .entry-reading-pane{max-height:calc(100vh - 94px);max-height:calc(100dvh - 94px);scroll-margin-top:10px}

#book-panel[data-reading="true"] .book-reader-progress{grid-column:1 / 3;grid-row:2;display:flex;align-items:center;gap:9px;min-width:0;height:18px}
#book-panel[data-reading="true"] #book-chapter-progress{flex:1;min-width:0}
#book-panel[data-reading="true"] .chapter-achieved #book-chapter-progress{color:#527043;font-weight:600}
#book-panel[data-reading="true"] #book-chapter-seal{position:static;width:auto;height:16px;max-width:45%;padding:0 5px;clip:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:9px;line-height:14px;transform:none;margin:0;flex:none}
@media(max-width:650px){
 #book-panel[data-reading="true"] .book-reader-progress{grid-column:1 / 3;grid-row:3;gap:6px}
 #book-panel[data-reading="true"]:has(#book-chapter-next:not([hidden])) .book-reader-progress{grid-column:1}
 #book-panel[data-reading="true"]:has(#book-chapter-next:not([hidden])) #book-chapter-seal{display:none}
 #book-panel[data-reading="true"] #book-chapter-seal{font-size:8px;max-width:44%}
}
