/*
MIT License

Copyright (c) 2026 Param Pathak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/
:root{color-scheme:dark;--bg:#11151b;--panel:#1a2028;--ink:#edf0ef;--muted:#a5adae;--line:#303943;--accent:#b7d7bd;--accent-ink:#17261b;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink)}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button,.primary{border:1px solid var(--line);border-radius:9px;padding:.65rem .95rem;color:var(--ink);background:var(--panel);cursor:pointer}button:hover:not(:disabled){border-color:var(--accent)}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}input[type=search],select{border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);padding:.7rem;max-width:100%}input[type=range]{width:100%;accent-color:var(--accent)}.topbar{height:76px;padding:0 5vw;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:1rem}.brand{font-size:1.25rem;display:flex;gap:.7rem;align-items:center}.brand:first-letter{color:var(--accent)}.quiet-link{color:var(--muted);font-size:.9rem}.quiet-link:hover{color:var(--ink)}.library-main{max-width:1280px;margin:auto;padding:3rem 5vw}.hero{display:grid;grid-template-columns:1.5fr 1fr;gap:4rem;align-items:center;padding:2rem 0 4rem}.eyebrow{font-size:.72rem;letter-spacing:.17em;color:var(--accent)}h1{font-family:Georgia,serif;font-weight:400;font-size:clamp(2.7rem,5vw,4.7rem);line-height:1.05;margin:1rem 0 1.5rem}h2{font-size:1.1rem;font-weight:600}.muted{color:var(--muted);line-height:1.7}.upload-card{border:1px dashed #536158;border-radius:16px;background:linear-gradient(135deg,#202b25,var(--panel));padding:1.8rem;display:grid;gap:1rem}.upload-card label{font-size:1.2rem}.upload-card p{margin:0;font-size:.9rem}.upload-card input{max-width:100%;color:var(--muted);font-size:.85rem}.upload-card input::file-selector-button{background:var(--panel);border:1px solid var(--line);color:var(--ink);padding:.6rem;border-radius:6px;margin-right:.6rem}.primary{background:var(--accent);color:var(--accent-ink);font-weight:600;border:0}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.5rem}.section-heading h2 span{font-size:.8rem;margin-left:.6rem}.book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:1.5rem}.book-card{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel)}.book-cover{display:flex;height:250px;align-items:center;justify-content:center;background:linear-gradient(140deg,#31443c,#202633);padding:1rem}.book-cover img{max-width:100%;height:100%;object-fit:contain}.cover-letter{font-family:Georgia,serif;font-size:5rem;color:#d6e1d6}.book-card-content{padding:1.2rem}.book-card h3{margin:0 0 .5rem;font-family:Georgia,serif;font-size:1.2rem;line-height:1.4}.book-card p{margin:.4rem 0;font-size:.85rem}.book-card .read-link{display:block;margin-top:1rem;color:var(--accent);font-size:.9rem}.pagination{display:flex;align-items:center;justify-content:center;gap:1rem;margin:2rem 0}.pagination span{font-size:.8rem;color:var(--muted)}.reader-page{height:100dvh;display:flex;flex-direction:column}.reader-page[data-theme=light]{color-scheme:light;--bg:#fafaf7;--panel:#fff;--ink:#252c28;--muted:#646d66;--line:#dbe0d9;--accent:#42684b}.reader-page[data-theme=sepia]{color-scheme:light;--bg:#f3e9d5;--panel:#f9f0de;--ink:#40352b;--muted:#786857;--line:#d8cbb2;--accent:#72613c}.reader-topbar{height:64px;flex-shrink:0;padding:0 1.5rem}.reader-topbar strong{font-size:.9rem;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.reader-actions{display:flex;gap:.5rem}.reader-main{position:relative;flex:1;min-height:0}.reader-main iframe{height:100%;width:100%;border:0;background:var(--bg)}.reader-footer{height:76px;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem 1.5rem;border-top:1px solid var(--line);flex-shrink:0}.reading-status{text-align:center;min-width:0}.reading-status span{display:block;max-width:55vw;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:.9rem}.reading-status small{display:block;color:var(--muted);font-size:.75rem;margin-top:.35rem}.reader-panel{position:fixed;top:64px;bottom:76px;background:var(--panel);border:1px solid var(--line);z-index:5;width:340px;padding:1.2rem;overflow:auto;box-shadow:0 16px 40px #0003}.reader-panel[hidden]{display:none}.contents-panel{left:0;display:flex;flex-direction:column}.settings-panel{right:0}.panel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}.panel-heading h2{margin:0}.panel-heading button{padding:.2rem .6rem;font-size:1.4rem}.settings-panel label{display:block;margin:1.5rem 0;font-size:.9rem}.settings-panel select{display:block;width:100%;margin-top:.5rem}.settings-panel input{display:block;margin-top:1rem}.tab-row{display:flex;gap:.5rem;margin-bottom:.8rem}.tab-row button{font-size:.8rem;padding:.5rem}.tab-row button[aria-pressed=true]{border-color:var(--accent);color:var(--accent)}.section-list{flex:1;overflow:auto;min-height:0;margin-top:1rem}.section-list button{display:block;width:100%;text-align:left;border:0;border-radius:5px;background:transparent;font-size:.85rem;line-height:1.5;margin-bottom:.2rem}.section-list button.active{background:var(--bg);color:var(--accent)}.contents-panel .pagination{margin:.8rem 0 0}.loading-overlay{position:absolute;inset:0;background:var(--bg);display:grid;place-items:center;color:var(--muted)}.loading-overlay[hidden]{display:none}@media(max-width:700px){.hero{grid-template-columns:1fr;gap:2rem;padding-top:0}.library-main{padding:2rem 5vw}.hero h1 br{display:none}.section-heading{align-items:flex-start;flex-direction:column}.section-heading input{width:100%}.book-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.book-cover{height:190px}.book-card-content{padding:.9rem}.topbar{padding:0 1rem}.brand{font-size:1rem}.reader-topbar{gap:.5rem}.reader-topbar strong{max-width:35%}.reader-actions button{padding:.55rem .7rem}.reader-footer{padding:.6rem;gap:.4rem}.reader-footer button{font-size:.75rem;padding:.6rem}.reading-status span{max-width:42vw;font-size:.8rem}.reader-panel{width:min(360px,100vw)}}
/* Nested views and controls retain native hidden semantics under flex/grid. */
[hidden]{display:none!important}
