/* Night lighting changes paint only; the shelf and reader retain their geometry. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 0;font:400 12px/1.5 Arial,Helvetica,sans-serif;white-space:nowrap;color:#656565}
.theme-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-sun{display:none}
[data-theme=night] .theme-toggle .theme-moon{display:none}
[data-theme=night] .theme-toggle .theme-sun{display:block}
#reader .theme-compact{width:34px;height:38px;flex:none;padding:0}
#reader .theme-compact [data-theme-label]{display:none}
.header-right{gap:24px}
.cubby-illumination,.cubby-book-glow{opacity:0;transition:opacity .45s ease;pointer-events:none}
[data-theme=night]{--paper:#181a1c;--ink:#e4e2dc;--muted:#aaa9a2;--line:#393c3e;--blue:#dbcfb7;background:#181a1c;color:#e4e2dc}
[data-theme=night] body{background:#181a1c;color:#e4e2dc}
[data-theme=night] .intro h1 em{color:#a8a69f}
[data-theme=night] :is(.private-label,.quiet,.intro-note,.text-button,.theme-toggle,footer,.stage-top,.stage-bottom,.sort-label,.zoom-label,.section-nav,.shelf-navigation>p,.view-tabs button,.view-tabs span){color:#aaa9a2}
[data-theme=night] .tiny-square{background:#b6b3aa}
[data-theme=night] :is(.shelf-navigation strong,.view-tabs button[aria-pressed=true],.search input){color:#e8e5de}
[data-theme=night] .view-tabs button[aria-pressed=true]:before{background:#ddd5c4}
[data-theme=night] .search{border-color:#545759}
[data-theme=night] .search input::placeholder{color:#93958f}
[data-theme=night] .search kbd{border-color:#55585a;color:#a8aaa5}
[data-theme=night] .categories button{color:#adaea8}
[data-theme=night] .categories button[aria-pressed=true]{color:#ebe7de;background:#303335;border-color:#595b5a}
[data-theme=night] .categories button:hover{background:#282b2d;color:#e6e3da}
[data-theme=night] .shelf-stage{background:#1b1d1f;border-color:#3b3d3f}
[data-theme=night] :is(.sort-label select,.zoom-label select){background:#1b1d1f;color:#c3c3bb;border-color:#4a4d4e;color-scheme:dark}
[data-theme=night] .section-nav button{background:#272a2c;border-color:#494c4d;color:#d1d0c9}
[data-theme=night] .section-nav button:hover:not(:disabled){background:#35383a;border-color:#71726c}
[data-theme=night] .shelf-stage #empty{background:#222528f5;color:#dddcd5}
[data-theme=night] #cubby-shade stop:first-child{stop-color:#242728}
[data-theme=night] #cubby-shade stop:nth-child(2){stop-color:#373733}
[data-theme=night] #cubby-shade stop:last-child{stop-color:#252829}
[data-theme=night] .cabinet-side{fill:#242729;stroke:#555959}
[data-theme=night] .cabinet-top{fill:#454847;stroke:#656865}
[data-theme=night] .cubby-side{fill:#2b2e2e}
[data-theme=night] .cubby-floor{fill:#776a51;stroke:#8b7a5c}
[data-theme=night] .shelf-front-edge rect{fill:#343737;stroke:#656862}
[data-theme=night] .shelf-front-edge path{stroke:#979381;opacity:.7}
[data-theme=night] .cabinet-upright{fill:#363a39;stroke:#626660}
[data-theme=night] .cabinet-upright-edge{stroke:#72756a}
[data-theme=night] .cubby-illumination,[data-theme=night] .cubby-book-glow{opacity:1}
[data-theme=night] #cubby-night-glow stop:first-child{stop-color:#ffe7bc;stop-opacity:.88}
[data-theme=night] #cubby-night-glow stop:nth-child(2){stop-color:#f3d59f;stop-opacity:.4}
[data-theme=night] #cubby-book-light stop:first-child{stop-color:#ffedc9;stop-opacity:.48}
[data-theme=night] #cubby-book-light stop:nth-child(2){stop-color:#ffedc9;stop-opacity:.1}
[data-theme=night] .cubby-ceiling-shadow{opacity:.35}
/* Gray cloth recedes into the cabinet; light falls most strongly on its crown. */
[data-theme=night] .book-solid{fill:#646866}
[data-theme=night] .book-cap{fill:#b5b6b3}
[data-theme=night] .book-page-block{fill:#bfc0bb;stroke:#888d86}
[data-theme=night] .spine-front{fill:#989b99}
[data-theme=night] #spine-round stop:first-child{stop-color:#000;stop-opacity:.3}
[data-theme=night] #spine-round stop:nth-child(2){stop-opacity:.22}
[data-theme=night] #spine-round stop:nth-child(3){stop-opacity:.03}
[data-theme=night] #spine-round stop:last-child{stop-color:#000;stop-opacity:.24}
[data-theme=night] :is(.book-outline,.book-seams){stroke:#626763}
[data-theme=night] .spine-rules{stroke:#626763}
[data-theme=night] .spine-title{fill:#232623}
[data-theme=night] .book-spine:hover .spine-front,[data-theme=night] .book-spine:focus-visible .spine-front{fill:#b9bcb6}
[data-theme=night] .book-spine:hover .book-outline,[data-theme=night] .book-spine:focus-visible .book-outline{stroke:#737373}
[data-theme=night] #book-tooltip{background:#292c2d;border-color:#5d625e;box-shadow:0 10px 30px #0005}
[data-theme=night] #book-tooltip strong{color:#ece8dc}
[data-theme=night] #book-tooltip :is(span,small){color:#b3b3aa}
[data-theme=night] .tree-logo{filter:brightness(.8)}

[data-theme=night] #reader{--reading-ink:#dfdfdf;--reading-body:#c2c2c2;--reading-muted:#a3a3a3;--reading-rule:#474747}
[data-theme=night] #reader::backdrop{background:#191c1ef5}
[data-theme=night] #reader .reader-toolbar{border-color:#474747;color:#a6a6a6}
[data-theme=night] #reader .reader-toolbar button{color:#d2d2d2}
[data-theme=night] #reader .reader-toolbar #reader-random{border-color:#636363}
[data-theme=night] #reader .reader-toolbar #reader-random:hover:not(:disabled){background:#313131;border-color:#979797;color:#e5e5e5}
[data-theme=night] #reader .open-book{background:none}
[data-theme=night] #reader .right-page{background:#282828;box-shadow:none}
[data-theme=night] #reader .left-page{background:none}
[data-theme=night] #reader .book-object:after{background:#0009}
[data-theme=night] #reader .category-tag{border-color:#616161;color:#c1c1c1;background:transparent}
[data-theme=night] #reader :is(.save-button,.save-button[aria-pressed=true],.cover-details summary){color:#c1c1c1}
[data-theme=night] #reader .cover-details-panel{background:#343434;border-color:#626262;box-shadow:0 10px 30px #0005}
[data-theme=night] #reader :is(.cover-credit,.cover-edition){color:#bfbfbf}
[data-theme=night] #reader .reader-tabs button{color:#adadad}
[data-theme=night] #reader .reader-tabs button[aria-current=page]{color:#dbdbdb;border-color:#b9b9b9}
[data-theme=night] #reader .page-content .lead-copy{color:#d8d8d8}
[data-theme=night] #reader .page-content h4{color:#adadad}
[data-theme=night] #reader .idea-list li:before{color:#9c9c9c}
[data-theme=night] #reader :is(.source-links a,.reference-links a){color:#cbcbcb;text-decoration-color:#696969}
[data-theme=night] #reader .page-navigation button{color:#c3c3c3}
[data-theme=night] #reader .page-navigation>span,[data-theme=night] #reader .reader-note{color:#9c9c9c}
[data-theme=night] #reader .page-content{scrollbar-color:#686868 transparent}

[data-theme=night] #about{background:#282828;border-color:#4f4f4f;color:#dcdcdc}
[data-theme=night] #about :is(h2,h3,h4){color:#dcdcdc}
[data-theme=night] #about p{color:#bdbdbd}
[data-theme=night] #about :is(.about-eyebrow,.collection-count,.close-about,.inbox-button,.recommendation-signin,.about-book-hint){color:#aaaaaa}
[data-theme=night] #about .close-about:hover{background:#3e3e3e;color:#dddddd}
[data-theme=night] #about .recommend-button{background:#cbcbcb;color:#252525;border-color:#cbcbcb}
[data-theme=night] #about .recommend-button:hover{background:#dadada}
[data-theme=night] #about :is(.recommendation-panel,.recommendation-item){border-color:#515151}
[data-theme=night] #recommendation-form label{color:#c5c5c5}
[data-theme=night] #recommendation-form :is(input,textarea){background:#222222;border-color:#5e5e5e;color:#dedede}
[data-theme=night] #recommendation-form :is(input,textarea)::placeholder{color:#909090}
[data-theme=night] #about :is(.rec-author,.rec-footer,.review-status){color:#a7a7a7}
@media(max-width:680px){
 .header-right{gap:14px}
 #reader .reader-actions{gap:12px}
 #reader .theme-compact{width:26px}
 #reader .reader-toolbar #reader-random{padding:8px 11px}
}
@media(max-width:520px){.masthead .theme-toggle [data-theme-label]{display:none}.masthead .theme-toggle{width:28px}.header-right{gap:12px}}
@media(prefers-reduced-motion:reduce){.cubby-illumination,.cubby-book-glow{transition:none}}

/* The mobile bindings retain a quiet cloth finish under the shelf lighting. */
[data-theme=night] #front-spine-matte stop:first-child{stop-color:#000;stop-opacity:.2}
[data-theme=night] #front-spine-matte stop:nth-child(2){stop-opacity:.1}
[data-theme=night] #front-spine-matte stop:last-child{stop-color:#000;stop-opacity:.16}
[data-theme=night] .front-binding-highlight{opacity:.16}
[data-theme=night] .front-binding-crease{stroke:#4c504b;opacity:.55}

[data-theme=night] .front-shelf .spine-foil{opacity:.16}
[data-theme=night] .front-spine:is(:hover,:focus-visible,:active) .spine-foil{opacity:.35}
