/* Editorial warmth around the existing shelves; all reading controls stay intact. */
#customVoiceForm [hidden]{display:none!important}
#customVoiceForm label{font-size:.85rem;font-weight:600;line-height:1.5}
#customVoiceForm input:not([type="checkbox"]):not([type="file"]),#customVoiceForm textarea,#customVoiceForm select{width:100%;min-height:44px;padding:11px 13px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-weight:400;box-shadow:none}
#customVoiceForm textarea{resize:vertical;line-height:1.6}
#customVoiceForm input[type="file"]{width:100%;font:inherit;font-weight:400;color:var(--ink-2)}
#customVoiceForm input::file-selector-button{padding:9px 12px;margin-right:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);color:var(--ink);font:inherit;cursor:pointer}
#customVoiceForm input[type="checkbox"]{width:17px;height:17px;accent-color:var(--brand);flex-shrink:0}
#customVoiceForm .muted{font-weight:400}
#phpVoiceList [hidden]{display:none!important}
#phpVoiceList .voice-picker-label{display:grid;gap:9px;margin-top:20px;font-size:.85rem;font-weight:600}
#phpVoiceList .voice-picker-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}
#phpVoiceList .voice-style-description{margin-top:13px;padding-top:13px;border-top:1px solid var(--line)}
#phpVoiceList .voice-style-description b{font-size:.8rem;color:var(--brand)}
@media(max-width:680px){#phpVoiceList .voice-picker-fields{grid-template-columns:1fr;gap:0}}
#phpVoiceList select,#speechQuality{width:100%;min-height:46px;padding:11px 13px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit}
#phpVoiceList select:focus-visible,#speechQuality:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
#phpVoiceList .voice-selection{margin-top:15px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
#phpVoiceList .voice-selection b{font-size:.95rem}
#phpVoiceList .voice-selection p{margin:7px 0 0;line-height:1.6}
#phpVoiceList .voice-picker-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:13px}
#phpVoiceList .voice-picker-actions .btn{min-height:42px;font-size:.8rem;padding:9px 14px}
#phpVoiceList .voice-style-note{line-height:1.6;margin-top:12px}
:root:not([data-theme="dark"]):has(.library-heading),:root:not([data-theme="dark"]):has(.book-hero){--bg:#f7f4ee;--surface-2:#faf8f3;--line:#e5ded3;--ink:#292331;--muted:#746d76}
:root[data-theme="dark"] .library-heading{border-color:var(--line)}
.library-heading {padding:8px 0 18px;border-bottom:1px solid var(--line);margin-bottom:20px}
.library-kicker {font-size:10px;font-weight:800;letter-spacing:.19em;color:var(--brand);margin-bottom:9px}
.library-heading h1 {font-family:var(--serif);font-size:clamp(2rem,4vw,3.25rem);font-weight:600;letter-spacing:-.045em;line-height:1.1}
.library-heading .sub {margin-top:9px;font-size:.9rem;max-width:44ch}
.library-heading .row {gap:8px}
#view:has(.library-heading) {--shelf-wood:#b79b78}
#view:has(.library-heading) .shelf-head h2 {font-family:var(--serif);font-size:1.3rem;font-weight:600}
#view:has(.library-heading) .shelf-head {margin-bottom:10px}
#view:has(.library-heading) .shelf-row {padding:8px 7px 20px;gap:23px;grid-auto-columns:138px;background:linear-gradient(transparent calc(100% - 10px),#c5af8e calc(100% - 10px),#e1d2b9 calc(100% - 7px),#a48a67 calc(100% - 3px),transparent 100%);border-radius:2px}
#view:has(.library-heading) .bcover {border-radius:2px 6px 6px 2px;box-shadow:2px 3px 3px #25192c24,5px 9px 16px #25192c25}
#view:has(.library-heading) .book-tile {gap:8px}
#view:has(.library-heading) .bt-title {font-size:.8rem}
#view:has(.library-heading) .bt-sub {font-size:.7rem}
#view:has(.library-heading) .continue-row {grid-template-columns:minmax(0,580px)}
#view:has(.library-heading) .continue-card {padding:10px 14px;background:var(--surface);border-left:3px solid var(--brand);border-radius:5px 14px 14px 5px}
#view:has(.library-heading) .continue-card .bcover.sm {width:43px;height:60px;min-width:43px}
#view:has(.library-heading) .continue-card b {font-size:.86rem}
#view:has(.library-heading) .lib-tools {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0 0 18px}
#view:has(.library-heading) .lib-tools .chips {flex-wrap:nowrap;overflow:auto;scrollbar-width:none;padding:2px 0 4px}
#view:has(.library-heading) .lib-tools .chips button {flex-shrink:0}
#view:has(.library-heading) #kSearch {width:100%;max-width:none;background:var(--surface)}
.book-hero {background:var(--surface);border-radius:8px 22px 22px 8px}
.book-hero .bcover.lg {transform:rotate(-3deg);box-shadow:4px 7px 6px #21122a24,12px 20px 28px #21122a20}
.book-tile:focus-visible {outline:3px solid var(--brand);outline-offset:5px;border-radius:4px}
@media(min-width:1000px){#view:has(.library-heading) .lib-tools{grid-template-columns:minmax(0,1fr) 270px;align-items:center}.library-heading{align-items:center}.library-heading .row{flex-shrink:0}}
@media(max-width:680px){
 .library-heading{padding:0 0 12px;gap:12px;margin-bottom:14px}.library-heading .sub{font-size:.8rem;margin-top:6px}.library-heading .row .btn{font-size:.75rem;padding:8px 12px;min-height:36px}
 #view:has(.library-heading) .shelf{margin-bottom:18px}
 #view:has(.library-heading) .shelf-row{grid-auto-columns:112px;gap:17px}
 #view:has(.library-heading) .shelf-head h2{font-size:1.1rem}
 #view:has(.library-heading) .continue-card{gap:10px;padding:8px 11px}
 #view:has(.library-heading) .continue-card .bar{margin:5px 0 4px!important}
 #view:has(.library-heading) .continue-card .bcover.sm{width:35px;height:49px;min-width:35px}
 #view:has(.library-heading) .lib-tools{gap:8px;margin-bottom:14px}
 #view:has(.library-heading) .lib-tools #kSearch{height:40px}
 .book-hero{gap:22px}.book-hero .bcover.lg{max-height:220px;width:150px}
}
@media(prefers-reduced-motion:reduce){.book-tile .bcover{transition:none}.book-tile:hover .bcover{transform:none}}
.study-welcome.hero{background:#ede6da;color:#292331;padding:28px 30px;border:1px solid #dfd5c4;position:relative;overflow:hidden}
.study-welcome h1{font-family:var(--serif);font-size:clamp(1.8rem,3vw,2.8rem);font-weight:600;letter-spacing:-.04em}
.study-welcome.hero p{color:#6b6063;max-width:53ch;font-size:.9rem}
.study-welcome.hero .btn{background:#49305e;color:#fff;border-color:#49305e}
.study-welcome.hero .btn.glass{background:transparent;color:#49305e;border-color:#bfb0c5}
.study-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0 26px}
.study-shortcuts a{display:grid;grid-template-columns:30px 1fr 14px;align-items:center;column-gap:10px;row-gap:4px;padding:17px;background:var(--surface);border:1px solid var(--line);border-radius:12px;color:var(--ink)}
.study-shortcuts a>svg:first-child{grid-row:span 2;color:var(--brand)}
.study-shortcuts a>svg:last-child{grid-column:3;grid-row:1 / span 2}
.study-shortcuts b{font-size:.85rem}.study-shortcuts span{grid-column:2;font-size:.72rem;color:var(--muted)}
.study-shortcuts a:hover{border-color:var(--brand);background:var(--surface-2)}
.home-reading .section-head h2{font-family:var(--serif);font-weight:600;font-size:1.4rem}
.home-reading .shelf-row{grid-auto-columns:132px;gap:20px;padding-bottom:18px}
[data-theme="dark"] .study-welcome.hero{background:#2c2430;border-color:#463449;color:#f3e9df}
[data-theme="dark"] .study-welcome.hero p{color:#c9b9bc}
@media(max-width:680px){.study-welcome.hero{padding:20px}.study-shortcuts{gap:8px;margin:14px 0 22px}.study-shortcuts a{display:flex;flex-direction:column;text-align:center;padding:13px 5px;gap:7px}.study-shortcuts a>svg:last-child{display:none}.study-shortcuts b{font-size:.72rem}.study-shortcuts span{font-size:.64rem}.home-reading .shelf-row{grid-auto-columns:112px;gap:17px}}
.reading-ruler{position:fixed;z-index:9998;left:calc(var(--sidebar-w,236px) + 24px);right:24px;bottom:100px;border:1px solid var(--line,#dcd3e7);border-radius:18px;background:var(--surface,#fff);color:var(--text,#30283e);box-shadow:0 6px 40px #21122c22;padding:12px 18px;max-width:1100px}.reading-ruler[hidden]{display:none}.reading-ruler header{display:flex;align-items:center;gap:14px;font-size:12px}.reading-ruler header>span{opacity:.7;margin-right:auto}.reading-ruler button{background:transparent;border:0;color:inherit;padding:5px 8px;cursor:pointer;font:inherit}.reading-ruler p{position:relative;max-height:86px;overflow:auto;font:18px/1.8 Georgia,serif;margin:8px 0 0;scroll-behavior:smooth}.reading-ruler .current{background:#f4d882;color:#302217;border-radius:4px;box-shadow:0 0 0 3px #f4d882}.chunk.now{background:#f2e8b955!important;outline:2px solid #c3a46e66;outline-offset:5px;border-radius:4px}.dark .reading-ruler,[data-theme=dark] .reading-ruler{background:#292230;color:#f3edf7;border-color:#5b4d67}@media(max-width:900px){.reading-ruler{left:12px;right:12px;padding:10px 14px}.reading-ruler header{flex-wrap:wrap;gap:6px}.reading-ruler p{font-size:16px;max-height:72px}}
.audio-reading{padding:14px 16px;border:1px solid var(--line,#dcd3e7);border-radius:14px;background:var(--surface,#fff);color:var(--text,#30283e);margin-top:18px}.audio-reading label{font-size:12px;display:flex;align-items:center;gap:8px}.audio-reading input{width:18px!important;height:18px}.audio-reading p{position:relative;max-height:150px;overflow:auto;line-height:1.8;font-size:18px}.audio-reading .current{background:#f4d882;color:#302217;border-radius:3px}.dark .audio-reading,[data-theme=dark] .audio-reading{background:#292230;color:#f3edf7}
:root[data-theme=dark] #audioClose,.dark #audioClose{color:#f3edf7!important;border-color:#5b4d67!important}.dark .modal-back>[role=dialog],[data-theme=dark] .modal-back>[role=dialog]{background:#292230!important;color:#f3edf7}.dark .modal-back label,[data-theme=dark] .modal-back label{color:inherit}
