:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;color:#242f2b;background:#f7f6f2}*{box-sizing:border-box}body{margin:0}button,select{font:inherit}button{cursor:pointer}button:focus-visible,select:focus-visible{outline:2px solid #6d8f80;outline-offset:3px}header{height:78px;border-bottom:1px solid #e6e7df;display:flex;align-items:center;padding:0 7%;gap:24px}.wordmark{background:none;border:0;padding:0;font:700 25px Georgia,serif;letter-spacing:-1.3px;color:#263d33}.wordmark span{color:#b58767}.header-note{font-size:9px;letter-spacing:1.6px;color:#9aa39b;font-weight:700;border-left:1px solid #d9dfd7;padding-left:23px}.add-top{margin-left:auto;border:0;background:none;color:#4a6b5b;font-size:13px;font-weight:600}main{max-width:1120px;margin:auto;padding:0 32px 80px}.empty{text-align:center;max-width:520px;margin:12vh auto 0}.empty-icon{width:86px;height:86px;margin:0 auto 28px;background:#e8ede6;border-radius:50%;display:grid;place-items:center;color:#6d8b76;font:42px Georgia}.eyebrow{font-size:10px;letter-spacing:1.7px;color:#8a9e8c;font-weight:700;margin:0 0 17px}h1{font:400 51px/1.12 Georgia,serif;letter-spacing:-1.7px;margin:0;color:#263b30}.lead{font-size:15px;line-height:1.8;color:#89978d;margin:20px auto 26px;max-width:420px}.primary{background:#355e4a;color:white;border:0;border-radius:6px;padding:15px 21px;font-weight:600;font-size:13px}.primary span{margin-left:24px}.fine{color:#a7b1a6;font-size:11px;margin-top:18px}.section-top{display:flex;align-items:end;justify-content:space-between;gap:20px;margin:80px 0 34px}.section-top .lead{margin:12px 0 0}.books{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:30px}.book{background:none;border:0;text-align:left;padding:0;color:inherit;min-width:0}.cover{background:#d8e2d6;aspect-ratio:2/3;border-radius:5px;box-shadow:0 8px 20px #293b2d18;display:grid;place-items:center;color:#78917e;font:55px Georgia;overflow:hidden}.cover img{width:100%;height:100%;object-fit:cover}.book strong,.book small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book strong{font:400 19px Georgia;margin-top:15px}.book small{color:#93a097;font-size:12px;margin-top:7px}.book .book-progress{font-size:11px;color:#709078}.back{background:none;border:0;padding:0;color:#789184;font-size:13px;margin:45px 0 32px}.player-layout{display:grid;grid-template-columns:260px 1fr;gap:60px;align-items:start}.large{width:100%;max-height:390px}.book-info{padding:15px 0}.book-info h1{font-size:42px}.author{color:#8b9a90;font-size:15px;margin:12px 0}.divider{border-top:1px solid #e0e5de;margin:35px 0 25px}.label,.reading-head{font-size:10px;letter-spacing:1.3px;font-weight:700;color:#92a397}.book-info select{display:block;width:100%;border:1px solid #dce4da;background:#fff;border-radius:6px;color:#445d4e;padding:12px;margin-top:10px}.progress-row{display:flex;justify-content:space-between;margin:28px 0 9px;color:#93a096;font-size:11px}.progress{height:4px;background:#e3e9e1;border-radius:5px}.progress span{display:block;height:100%;background:#72977d;width:0}.playback{display:flex;align-items:center;gap:18px;margin-top:25px}.playback button{border:0;background:none;color:#668473;font-size:19px}.playback .play{background:#365e4b;border-radius:50%;width:55px;height:55px;color:white;font-size:17px}.speed{margin-left:auto;color:#95a299;font-size:12px;display:flex;align-items:center;gap:8px}.speed select{margin:0;width:auto;padding:8px}.player-status{font-size:12px;line-height:1.6;color:#95a299;min-height:2em}.reading{margin-top:45px;border-top:1px solid #e0e5de;padding:25px 0}.reading-head{display:flex;justify-content:space-between}.reading p{font:20px/1.8 Georgia,serif;color:#5d7063;max-width:780px}.remove{background:none;border:0;color:#a3887b;padding:12px 0;font-size:12px}.remove:hover{text-decoration:underline}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#344d3e;color:white;padding:12px 18px;border-radius:6px;font-size:13px;display:none;max-width:90%}#toast.show{display:block}[hidden]{display:none!important}@media(max-width:650px){header{height:65px;padding:0 20px}.header-note{display:none}main{padding:0 20px 50px}.empty{margin-top:12vh}h1{font-size:39px}.section-top{margin-top:50px;align-items:start;flex-direction:column}.books{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.player-layout{grid-template-columns:100px 1fr;gap:20px}.book-info{padding:0}.book-info h1{font-size:29px}.divider{margin:20px 0}.reading p{font-size:18px}.playback{gap:9px}.playback .play{width:46px;height:46px}.speed{font-size:0}}

.voice-controls{margin-top:24px}.voice-controls .label{display:block;margin-top:16px}

.book-heading{display:flex;align-items:center;gap:22px}.small-cover{width:76px;flex:0 0 76px;font-size:26px}.book-heading h1{font-size:36px}.book-heading .eyebrow{margin-bottom:8px}.reading{margin:35px 0 0;padding:24px 30px;background:#fff;border:1px solid #e4e9e1;border-radius:8px}.reading-head{align-items:center;gap:12px;flex-wrap:wrap}.highlight-option{font:12px system-ui;letter-spacing:0;color:#7b8c80;display:flex;align-items:center;gap:6px}.highlight-option input{accent-color:#668c70}.page-text{font:19px/1.9 Georgia,serif;color:#4b6052;min-height:18em;margin:25px 0;white-space:normal}.page-text .spoken{background:#e2eddb;border-radius:2px}.page-nav{display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px solid #e7ece5;padding-top:17px;color:#91a095;font-size:12px}.page-nav button{background:none;border:0;color:#557764;padding:6px 0;font-size:12px}.page-nav button:disabled{opacity:.35;cursor:default}.player-controls{max-width:780px;margin:22px auto 0;padding:22px 0}.player-controls .voice-controls{margin-top:16px}@media(max-width:650px){.book-heading h1{font-size:27px}.reading{padding:20px 18px}.page-text{font-size:17px;min-height:16em}.page-nav{font-size:11px}}
body.reading-mode{height:100dvh;overflow:hidden}body.reading-mode main{max-width:none;height:100%;padding:0}.reading-mode #reader{height:100%;display:flex;flex-direction:column;position:relative}.book-details{position:relative;z-index:3;flex:none;background:#f7f6f2;border-bottom:1px solid #e0e5de}.book-details summary{list-style:none;cursor:pointer;padding:12px 20px;font-size:13px;color:#52715e}.book-details summary::-webkit-details-marker{display:none}.book-details summary::after{content:' ⌄'}.book-details[open] summary::after{content:' ⌃'}.details-inner{position:absolute;top:100%;left:0;right:0;background:#f7f6f2;padding:0 24px 16px;box-shadow:0 8px 20px #293b2d18}.details-inner .back{margin:15px 0}.details-inner .remove{margin-top:8px}.details-inner .book-heading h1{font-size:25px}.details-inner .small-cover{width:52px;flex-basis:52px}.reading-mode .reading{flex:1;min-height:0;width:min(100%,850px);margin:0 auto;padding:16px 30px;background:transparent;border:0;display:flex;flex-direction:column}.reading-mode .reading-head{flex:none}.reading-mode .page-text{flex:1;min-height:0;margin:12px 0;overflow:hidden;display:block;font-size:clamp(14px,2.1vh,19px);line-height:1.65}.reading-mode .page-nav{flex:none}.player-drawer{flex:none;width:min(100%,850px);margin:0 auto;background:#fff;border:1px solid #dfe7dc;border-bottom:0;border-radius:12px 12px 0 0;box-shadow:0 -5px 25px #293b2d12;z-index:2}.drawer-toggle{display:flex;justify-content:space-between;width:100%;padding:10px 20px;border:0;background:transparent;color:#426551;font-size:13px;font-weight:600}.player-drawer .player-controls{max-height:min(38dvh,350px);overflow:auto;margin:0;padding:4px 20px 16px}.player-drawer .progress-row{margin-top:14px}.player-drawer .playback{margin-top:14px}.player-drawer .player-status{margin:8px 0;min-height:0}.player-drawer .voice-controls{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px}.player-drawer .voice-controls .label{margin:4px 0 0}.player-drawer .voice-controls select{margin:0}.player-drawer .voice-controls .label,.player-drawer .voice-controls select{grid-column:span 1}.player-drawer .voice-controls #voiceLabel{grid-column:2;grid-row:1}.player-drawer .voice-controls #voice{grid-column:2;grid-row:2}.speed{font-size:12px}.speed select{min-width:130px}@media(max-width:650px){.reading-mode .reading{padding:12px 16px}.reading-mode .page-text{font-size:clamp(13px,1.9vh,17px)}.speed{font-size:11px}.speed select{min-width:105px}.player-drawer .player-controls{max-height:35dvh}}
.prepare-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px}.prepare-row button{border:1px solid #b7cbbb;border-radius:6px;background:#f5f9f4;color:#3c654d;padding:9px 12px;font-size:12px;font-weight:600}.prepare-row span{font-size:12px;color:#748a79}
/* Keep the book details in the layout so the reading area resizes with them. */
.details-inner{position:static;padding:0 24px 12px;box-shadow:none;max-height:25dvh;overflow:auto}.details-inner .back{margin:4px 0 10px}.details-inner .remove{margin:0;padding:7px 0}.details-inner .book-heading{gap:12px}.details-inner .author{margin:5px 0}.details-inner .book-heading .eyebrow{margin-bottom:4px}.reading-mode .reading{min-height:105px}.reading-mode .reading-head,.reading-mode .page-nav{flex-shrink:0}.reading-mode .page-text{margin:6px 0}.engine-row{display:flex;align-items:stretch;gap:8px;margin-top:12px}.player-drawer .engine-row select,.engine-row button{width:auto;min-width:0;margin:0;border:1px solid #b7cbbb;border-radius:6px;background:#f5f9f4;color:#3c654d;padding:9px 12px;font-size:12px;font-weight:600}.player-drawer .engine-row select{flex:1}.engine-row button{flex:none}.prepare-status{display:flex;flex-wrap:wrap;gap:4px 12px;color:#748a79;font-size:12px}.prepare-status:not(:empty){margin-top:6px}.player-drawer .voice-controls{display:block;margin-top:8px}.player-drawer .voice-controls select{margin-top:6px}.player-drawer .voice-controls .label{margin:0}
/* Keep changing playback messages from resizing the drawer. */
.player-drawer .player-status{height:2.8em;min-height:2.8em;overflow:auto;line-height:1.4;margin:8px 0}.player-drawer .prepare-status{height:2.8em;min-height:2.8em;overflow:auto;align-content:start;line-height:1.4;margin-top:6px}
.engine-row #storageReader{background:#e9f0e8;border-color:#d4e1d2;color:#486d55;font-weight:600}.engine-row #storageReader:hover{background:#dce9dd;border-color:#b8cdbb}.engine-row #storageReader:focus-visible{outline:2px solid #6d8f80;outline-offset:3px}
.storage-link,.storage-item button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #d4e1d2;border-radius:6px;background:#e9f0e8;color:#486d55;padding:9px 12px;font-size:12px;font-weight:600;text-decoration:none;line-height:1.2}.storage-link:hover,.storage-item button:not(:disabled):hover{background:#dce9dd;border-color:#b8cdbb}.storage-item button:disabled{background:#f3f6f1;color:#9eada0;border-color:#e4ebe2}.close-storage{display:grid;place-items:center;width:34px;height:34px;border:1px solid #d4e1d2;border-radius:6px;background:#e9f0e8;color:#486d55;font-size:22px}.close-storage:hover{background:#dce9dd;border-color:#b8cdbb}.empty-storage{margin:0 auto}.section-top+.storage-link{margin:-18px 0 20px}
/* Theme values are inherited by every app surface. */
:root{--bg:#f7f6f2;--surface:#fff;--text:#263b30;--muted:#718578;--accent:#355e4a;--on-accent:#fff;--border:#dce5da;--soft:#e9f0e8;--highlight:#e2eddb;--body-font:Inter,ui-sans-serif,system-ui,sans-serif;--book-font:Georgia,'Times New Roman',serif;--display-font:Georgia,'Times New Roman',serif;--book-size:clamp(14px,2.1vh,19px);--book-weight:400;--scheme:light}
:root[data-theme=dark]{--bg:#151b19;--surface:#222c27;--text:#edf3ed;--muted:#adbcaf;--accent:#a8cbb2;--on-accent:#14251b;--border:#415347;--soft:#304338;--highlight:#496957;--scheme:dark}
:root[data-theme=paper]{--bg:#e9dfc9;--surface:#f4ecd9;--text:#33291e;--muted:#786c57;--accent:#694c31;--on-accent:#fff8e8;--border:#cdbd9f;--soft:#e3d4b8;--highlight:#d8c398;--body-font:Georgia,'Times New Roman',serif;--book-font:'Times New Roman',Times,serif;--display-font:'Times New Roman',Times,serif}
:root[data-theme=computer]{--bg:#000;--surface:#0a0a0a;--text:#fff;--muted:#bcbcbc;--accent:#fff;--on-accent:#000;--border:#777;--soft:#222;--highlight:#484848;--body-font:ui-monospace,SFMono-Regular,Consolas,monospace;--book-font:ui-monospace,SFMono-Regular,Consolas,monospace;--display-font:ui-monospace,SFMono-Regular,Consolas,monospace;--scheme:dark}
:root[data-theme=modern]{--bg:#111;--surface:#202020;--text:#fff;--muted:#b8b8b8;--accent:#fff;--on-accent:#111;--border:#494949;--soft:#303030;--highlight:#555;--body-font:Helvetica,Arial,sans-serif;--book-font:Helvetica,Arial,sans-serif;--display-font:Helvetica,Arial,sans-serif;--book-size:clamp(23px,3.5vh,36px);--book-weight:700;--scheme:dark}
:root{color-scheme:var(--scheme);font-family:var(--body-font);background:var(--bg);color:var(--text)}body,.book-details,.details-inner{background:var(--bg);color:var(--text)}button,select,input{font-family:var(--body-font)}h1,.book strong,.storage-header h2{font-family:var(--display-font);color:var(--text)}.lead,.fine,.author,.eyebrow,.label,.reading-head,.highlight-option,.progress-row,.player-status,.prepare-status,.storage-intro,.storage-note,.storage-item small,.books small,.speed{color:var(--muted)}.primary,.playback .play{background:var(--accent);color:var(--on-accent)}.cover,.empty-icon{background:var(--soft);color:var(--muted)}.book-details,.player-drawer,.reading,.progress,.page-nav,.storage-items,.storage-item,dialog{border-color:var(--border)}.player-drawer,dialog{background:var(--surface);color:var(--text)}.player-drawer .book-info select,.custom-theme select{background:var(--surface);color:var(--text);border-color:var(--border)}.drawer-toggle,.page-nav button,.back,.book-details summary,.playback button,.remove{color:var(--accent)}.reading-mode .page-text{font-family:var(--book-font);font-size:var(--book-size);font-weight:var(--book-weight);color:var(--text)}.page-text .spoken{background:var(--highlight);color:var(--text)}.progress{background:var(--border)}.progress span{background:var(--accent)}.storage-link,.storage-item button,.close-storage,.engine-row #storageReader,.player-drawer .engine-row select,.engine-row button,.theme-button{background:var(--soft);border-color:var(--border);color:var(--text)}.storage-link:hover,.storage-item button:not(:disabled):hover,.close-storage:hover,.engine-row #storageReader:hover,.theme-button:hover{background:var(--highlight);border-color:var(--accent)}.storage-item button:disabled{background:var(--surface);border-color:var(--border);color:var(--muted)}#toast{background:var(--accent);color:var(--on-accent)}.highlight-option input{accent-color:var(--accent)}
.library-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:-18px 0 20px}.library-actions .storage-link{margin:0}.empty-actions{justify-content:center;margin:0}.theme-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:6px;padding:9px 12px;font-size:12px;font-weight:600;line-height:1.2}.theme-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:22px 0}.theme-grid button{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:7px;padding:7px;text-align:left;font-size:12px}.theme-grid button[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:2px}.theme-swatch{display:flex;align-items:center;justify-content:center;height:58px;margin-bottom:7px;border-radius:4px;font:25px Georgia}.sw-light{background:#f7f6f2;color:#263b30}.sw-dark{background:#18221b;color:#edf3ed}.sw-paper{background:#e9dfc9;color:#33291e;font-family:'Times New Roman',serif}.sw-computer{background:#000;color:#fff;font-family:monospace}.sw-modern{background:#151515;color:#fff;font:700 28px Helvetica,Arial,sans-serif}.sw-custom{background:var(--custom-bg,#dde8df);color:var(--custom-text,#263b30)}.custom-theme{border-top:1px solid var(--border);padding-top:14px}.custom-theme h3{font-size:14px;color:var(--text)}.custom-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0 18px}.custom-grid label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--text)}.custom-grid input[type=color]{height:32px;width:50px;border:1px solid var(--border);background:var(--surface);padding:2px}.custom-grid select{padding:7px;border:1px solid var(--border);border-radius:5px}.font-choice{grid-column:span 2}.font-choice select{flex:1;max-width:60%}:root[data-theme=computer] button,:root[data-theme=computer] select,:root[data-theme=computer] .player-drawer,:root[data-theme=computer] dialog{border-radius:0}:root[data-theme=modern] .page-text{letter-spacing:-.035em;line-height:1.35}:root[data-theme=modern] .page-text .spoken{background:transparent;color:var(--text)}:root[data-theme=modern] .page-text:has(.spoken) span:not(.spoken){opacity:.48}
@media(max-width:650px){.reading-mode .page-text{font-size:var(--book-size)}.theme-grid{grid-template-columns:repeat(2,1fr)}}
.reader-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex:none;background:var(--bg);border-bottom:1px solid var(--border)}.reader-top>.back{flex:none;margin:0;padding:12px 20px;font-size:13px;color:var(--accent)}.reader-top .book-details{flex:1;min-width:0;border:0;background:transparent}.reader-top .book-details summary{text-align:right}.reader-top .details-inner{max-height:25dvh;padding:0 20px 12px;background:var(--bg)}.reader-top .book-heading{justify-content:flex-end;text-align:right}.library-bottom{margin:32px 0 0}.book-card{min-width:0}.book-card .book{display:block;width:100%}.remove-book{border:0;background:none;color:var(--muted);font-size:11px;padding:9px 0;cursor:pointer}.remove-book:hover{color:var(--accent);text-decoration:underline}.sw-modern-light{background:#f5f5f5;color:#181818;font:700 28px Helvetica,Arial,sans-serif}:root[data-theme=modern-light]{--bg:#f5f5f5;--surface:#fff;--text:#181818;--muted:#646464;--accent:#222;--on-accent:#fff;--border:#d4d4d4;--soft:#e9e9e9;--highlight:#ddd;--body-font:Helvetica,Arial,sans-serif;--book-font:Helvetica,Arial,sans-serif;--display-font:Helvetica,Arial,sans-serif;--book-size:clamp(23px,3.5vh,36px);--book-weight:700;--scheme:light}:root[data-theme=modern-light] .page-text{letter-spacing:-.035em;line-height:1.35}:root[data-theme=modern-light] .page-text .spoken{background:transparent;color:var(--text)}:root[data-theme=modern-light] .page-text:has(.spoken) span:not(.spoken){opacity:.48}
#library{min-height:calc(100dvh - 80px);display:flex;flex-direction:column}#shelf:not([hidden]){flex:1;display:flex;flex-direction:column}.library-bottom{margin-top:auto;padding-top:32px}#empty:not([hidden]){flex:1;display:flex;flex-direction:column;align-items:center}.empty-actions{margin-top:auto;padding-top:32px}@media(max-width:650px){#library{min-height:calc(100dvh - 50px)}}
.playback #previous,.playback #next{min-width:48px;min-height:48px;font-size:28px;display:inline-grid;place-items:center}
.library-player-options{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:22px 0 8px;color:var(--muted);font-size:12px}.library-player-options label{display:flex;align-items:center;gap:6px}.library-player-options input{accent-color:var(--accent)}.library-player-options button{background:none;border:0;color:var(--accent);font-size:12px;text-decoration:underline;text-underline-offset:3px}.library-now-playing{padding:12px 20px 0;color:var(--text);font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#libraryPlayerSlot.has-player{position:sticky;bottom:0;z-index:2;margin:12px auto 0;width:min(100%,850px)}#libraryPlayerSlot .player-drawer{width:100%}
body:has(#libraryPlayerSlot.has-player) main{padding-bottom:0}#libraryPlayerSlot.has-player{position:sticky;bottom:0;width:min(100vw,850px);max-width:none;margin:12px auto 0;z-index:2}#libraryPlayerSlot .player-drawer{width:100%;margin:0;border-bottom:0}@media(max-width:650px){#libraryPlayerSlot.has-player{width:calc(100% + 40px);margin-left:-20px;margin-right:-20px}}
#libraryPlayerSlot.has-player{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,850px);margin:0;z-index:4}#libraryPlayerSlot.has-player .player-drawer{margin:0}body:has(#libraryPlayerSlot.has-player) main{padding-bottom:80px}@media(max-width:650px){#libraryPlayerSlot.has-player{width:100%;margin:0}}
body:has(#libraryPlayerSlot.has-player) main{padding-bottom:var(--library-player-height,80px)}
/* Both views share the same player shell; reader content fills the space above it. */
body.reading-mode main{padding:0}body.reading-mode #reader>.player-drawer{margin:0 auto;border-bottom:0}
/* Keep the theme chooser stable as its typography and colors change. */
#themeDialog{box-sizing:border-box;width:80vw;max-width:80vw;height:80dvh;max-height:80dvh;overflow-y:auto}
/* Align the library with the reader and its player. */
body:not(.reading-mode) main{width:min(100%,850px);max-width:850px;margin-inline:auto;padding-inline:20px}body:not(.reading-mode):has(#libraryPlayerSlot.has-player) main{padding-bottom:calc(var(--library-player-height,80px) + 20px)}#libraryPlayerSlot.has-player{width:min(100%,850px)}
/* Library header stays in place while the shelf scrolls side to side. */
body:not(.reading-mode){height:100dvh;overflow:hidden}body:not(.reading-mode) main{height:100dvh;padding-top:0;padding-bottom:0;overflow:hidden}body:not(.reading-mode):has(#libraryPlayerSlot.has-player) main{padding-bottom:var(--library-player-height,80px)}#library{height:100%;min-height:0}#shelf:not([hidden]){min-height:0;flex:1;overflow:hidden}.library-header{flex:none;padding:20px 0 12px;background:var(--bg)}.library-header .section-top{margin:0 0 16px;align-items:center}.library-header .section-top h1{font-size:clamp(30px,4.5vh,46px)}.library-header .section-top .eyebrow{margin-bottom:8px}.library-header .section-top .lead{margin:7px 0 0;line-height:1.4}.library-header .library-actions{margin:0;gap:8px}.library-header .library-player-options{margin:0}.books{display:flex;align-items:center;gap:24px;flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scroll-padding-inline:50%;padding:14px max(20px,calc(50% - 105px)) 24px;scrollbar-width:thin;touch-action:auto}.book-card{flex:0 0 210px;max-height:100%;scroll-snap-align:center;}.book-card .cover{max-height:min(45dvh,330px)}.book-card .book strong{margin-top:10px}.book-card .book small{margin-top:4px}.book-card .remove-book{padding:6px 0}.empty{min-height:0;overflow:auto}@media(max-width:650px){.library-header{padding:14px 0 8px}.library-header .section-top{flex-direction:row;align-items:center;gap:10px}.library-header .section-top h1{font-size:30px}.library-header .section-top .lead{font-size:12px}.library-header .primary{padding:11px 12px;white-space:nowrap}.books{gap:16px;padding-inline:max(15px,calc(50% - 82px))}.book-card{flex-basis:164px}.book-card .cover{max-height:min(36dvh,245px)}}
/* Keep the shelf anchored beneath the library header as the player changes height. */
.books{align-items:flex-start;padding-top:24px}
/* Start the shelf at the first book and keep navigation below it. */
.books{padding-inline:0;scroll-padding-inline:0}.book-card{scroll-snap-align:start}.shelf-navigation{flex:none;display:flex;align-items:center;justify-content:center;gap:12px;padding:4px 0 12px}.shelf-navigation>button{width:34px;height:34px;border:1px solid var(--border);border-radius:6px;background:var(--soft);color:var(--text);font-size:22px;line-height:1}.shelf-navigation>button:disabled{opacity:.35;cursor:default}.shelf-dots{display:flex;align-items:center;justify-content:center;gap:5px;max-width:60%;overflow-x:auto}.shelf-dot{flex:none;width:20px;height:28px;border:0;background:transparent;padding:0;display:grid;place-items:center}.shelf-dot::after{content:'';width:7px;height:7px;border-radius:50%;background:var(--border)}.shelf-dot[aria-current=true]::after{background:var(--accent)}@media(max-width:650px){.books{padding-inline:0}}
.player-drawer .voice-controls{margin-top:8px}.player-drawer .voice-controls .label{display:block;color:var(--muted);font-size:10px;letter-spacing:1.1px;margin:0 0 5px}.player-drawer .voice-controls #voice{width:100%;margin:0;border:1px solid var(--border);border-radius:6px;background:var(--soft);color:var(--text);padding:9px 12px;font-size:12px;font-weight:600}
/* Free scrolling avoids snap points fighting touch and trackpad gestures. */
.books{scroll-snap-type:none;overscroll-behavior-x:contain}
/* The brand bar sits above both the library and reader. */
.app-header{height:30px;padding:0;display:flex;align-items:center;justify-content:center;border-bottom:1px solid var(--border);background:var(--bg);color:var(--text);font-family:var(--body-font);font-size:11px;font-weight:700;letter-spacing:.18em}body:not(.reading-mode) main,body.reading-mode main{height:calc(100dvh - 30px)}
.app-header img{display:block;width:auto;height:14px;max-width:70%;object-fit:contain}
/* Default theme typography follows the supplied LAITTSA wordmark. */
:root[data-theme=light]{--body-font:'Source Code Pro',ui-monospace,monospace;--book-font:'Source Code Pro',ui-monospace,monospace;--display-font:'Source Code Pro',ui-monospace,monospace}
:root[data-theme=light] h1,:root[data-theme=light] .storage-header h2{font-weight:900;-webkit-text-stroke:.12em currentColor;paint-order:stroke fill}
:root[data-theme=light] .reading-mode .page-text,:root[data-theme=light] .highlight-option{font-family:var(--body-font);font-weight:400}
/* LAITTSA's two brand colors, inverted for the dark theme. */
:root[data-theme=light]{--bg:#e6e6e6;--surface:#f1f1f1;--text:#161616;--muted:#555;--accent:#161616;--on-accent:#e6e6e6;--border:#bcbcbc;--soft:#d5d5d5;--highlight:#c4c4c4}
:root[data-theme=dark]{--bg:#161616;--surface:#222;--text:#e6e6e6;--muted:#b0b0b0;--accent:#e6e6e6;--on-accent:#161616;--border:#555;--soft:#333;--highlight:#4c4c4c}
.sw-light{background:#e6e6e6;color:#161616}.sw-dark{background:#161616;color:#e6e6e6}
/* Heading tracking uses one font-size unit, per the brand specification. */
h1,h2{text-transform:uppercase;letter-spacing:1em;overflow-wrap:anywhere} .section-top>div,.book-heading>div:last-child,.storage-header>div{min-width:0}
:root[data-theme=dark]{--body-font:'Source Code Pro',ui-monospace,monospace;--book-font:'Source Code Pro',ui-monospace,monospace;--display-font:'Source Code Pro',ui-monospace,monospace}
:root[data-theme=dark] h1,:root[data-theme=dark] .storage-header h2{font-weight:900;-webkit-text-stroke:.12em currentColor;paint-order:stroke fill}
:root[data-theme=dark] .reading-mode .page-text,:root[data-theme=dark] .highlight-option{font-family:var(--body-font);font-weight:400}
/* Heading spacing follows each theme's typeface. */
:root[data-theme=light] h1,:root[data-theme=light] h2,:root[data-theme=dark] h1,:root[data-theme=dark] h2{letter-spacing:1em}
:root[data-theme=paper] h1,:root[data-theme=paper] h2{letter-spacing:.035em}
:root[data-theme=computer] h1,:root[data-theme=computer] h2{letter-spacing:.12em}
:root[data-theme=modern] h1,:root[data-theme=modern] h2,:root[data-theme=modern-light] h1,:root[data-theme=modern-light] h2{letter-spacing:-.025em}
:root[data-theme=custom] h1,:root[data-theme=custom] h2{letter-spacing:.02em}
:root[data-theme=paper]{--bg:#f6f1e5;--surface:#fffaf0;--text:#33291e;--muted:#786c57;--accent:#694c31;--on-accent:#fffaf0;--border:#dfd3bd;--soft:#efe7d6;--highlight:#e7d9bc}
.sw-paper{background:#f6f1e5;color:#33291e}
/* Keep the welcome message to two readable lines. */
.empty .welcome-heading,:root[data-theme=light] .empty .welcome-heading,:root[data-theme=dark] .empty .welcome-heading{font-size:clamp(19px,6.5vw,38px);line-height:1.25;letter-spacing:.04em;overflow-wrap:normal}.welcome-heading span{display:block;white-space:nowrap}.welcome-actions{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap}.demo-button{border:1px solid var(--border);border-radius:6px;background:var(--soft);color:var(--text);padding:14px 18px;font-size:13px;font-weight:600}.demo-button:hover{background:var(--highlight);border-color:var(--accent)}.demo-button:disabled{opacity:.6;cursor:wait}
