@font-face{font-family:system-fallback;src:local("Segoe UI")}*{box-sizing:border-box}html{scroll-behavior:auto;color-scheme:dark;font-size:100%} :root{--text-muted:#9d899b}body{margin:0;background:#17141b;color:#ede6e8;font:0.9375rem system-ui,"Segoe UI",sans-serif}button,input{font:inherit}button,a,label{touch-action:manipulation}button{cursor:pointer}button:disabled,input:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #f4a7bd;outline-offset:4px}button,a{transition:background .16s,color .16s}a{color:inherit;text-decoration:none}[hidden]{display:none!important}.sidebar{position:fixed;inset:0 auto 0 0;width:230px;border-right:1px solid #302733;background:#19161e;padding:35px 25px;display:flex;flex-direction:column}.brand{display:flex;gap:12px;align-items:center;font-size:1.1875rem;line-height:1.15;letter-spacing:.01em}.brand img{width:48px;height:48px}.brand b{font-weight:500;color:#e4a4b8}.nav-label,.eyebrow{font-size:0.75rem;letter-spacing:.2em;font-weight:650;color:#bda7b3}.nav-label{margin:64px 12px 15px;color:var(--text-muted)}.nav{background:none;border:0;display:flex;align-items:center;gap:13px;padding:14px 13px;border-radius:8px;color:#ac9daa;text-align:left;font-size:0.875rem}.nav span{font-size:1.25rem}.nav.active{background:#34232e;color:#f3b9ca}.nav:hover{background:#30252f}.sidebar-bottom{margin-top:auto;padding:30px 12px 0}.tag{font-size:0.75rem;letter-spacing:.13em;border:1px solid #55404e;color:#d5a4b8;padding:6px 8px;border-radius:4px}.sidebar-bottom p{font-family:Georgia,serif;font-size:1.3125rem;line-height:1.5;color:#bba8b4}.sidebar-bottom small{font-size:0.75rem;color:var(--text-muted)}main{margin-left:230px;padding:0 54px;max-width:1700px}.topbar{display:flex;gap:20px;align-items:center;min-height:88px;border-bottom:1px solid #2d2531}.breadcrumb{font-size:0.75rem;letter-spacing:.15em;color:#b1a0ac}.breadcrumb span{padding:0 12px;color:var(--text-muted)}.offline{margin-left:auto;font-size:0.75rem;color:#aaa0a9}.offline.ready{color:#b1c9b2}.offline.ready:before{content:"";display:inline-block;width:6px;height:6px;background:#93b896;border-radius:100%;margin-right:8px}.hero{display:flex;align-items:center;justify-content:space-between;padding:54px 0 48px;border-bottom:1px solid #302733}.hero .eyebrow{color:#d1a0b2}h1{font-family:Georgia,"Times New Roman",serif;font-size:clamp(2.5rem,4.2vw,4rem);font-weight:400;line-height:1.07;letter-spacing:-.04em;margin:18px 0 18px}h1 span{color:#e3a3b8}.hero p{color:#b6a8b4;line-height:1.8;font-size:0.875rem}.hero-flower{font-size:10.9375rem;color:#ad738c33;text-align:center;line-height:.85;transform:rotate(-12deg);padding:0 70px}.hero-flower span{display:block;font:italic 13px Georgia,serif;letter-spacing:.03em;color:#a08294;margin-top:24px;transform:rotate(12deg)}h2{font-size:1.1875rem;letter-spacing:-.02em;font-weight:550;margin:0 0 8px}.library-tools{display:flex;justify-content:space-between;align-items:center;margin:34px 0 24px;gap:20px}.library-tools p{font-size:0.75rem;color:#988895;margin:0}.library-tools h2 span{font-size:0.75rem;background:#322630;color:#b8a0b0;border-radius:4px;padding:3px 7px;margin-left:8px;vertical-align:middle}.primary,.subtle{border-radius:7px;padding:12px 18px;border:1px solid #51404e;font-size:0.75rem;display:inline-flex;justify-content:center;align-items:center;gap:10px}.primary{background:#e8adc0;color:#231720;border-color:#e8adc0;font-weight:650}.primary:hover{background:#f3c0d0}.subtle{background:#251e29;color:#d7c9d2}.subtle:hover{background:#352733}.file-button{position:relative;cursor:pointer}.file-button input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.file-button:focus-within{outline:3px solid #f4a7bd;outline-offset:4px}.shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:26px;min-height:0}.book{background:none;border:0;text-align:left;padding:0;color:inherit;max-width:260px}.cover{height:230px;background:linear-gradient(145deg,#4b394d,#292d3d 60%,#64424f);border:1px solid #695364;border-radius:7px;position:relative;overflow:hidden;display:flex;flex-direction:column;padding:24px;box-shadow:0 14px 30px #0002}.cover:before{content:"";position:absolute;inset:10px;border:1px solid #e1b6c135;border-radius:2px}.cover:after{content:"✿";position:absolute;right:-25px;bottom:-30px;font-size:10.9375rem;color:#ecc1d81c;transform:rotate(25deg)}.cover-label{font-size:0.75rem;letter-spacing:.2em;color:#d0b5c8}.cover-title{font:1.375rem/1.2 Georgia,serif;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;margin-top:auto;z-index:1;overflow-wrap:anywhere}.cover-bottom{font-size:0.75rem;color:#c7b1c0;margin-top:20px;letter-spacing:.14em}.book-name{font-size:0.875rem;margin:14px 0 5px;overflow-wrap:anywhere}.book-meta{font-size:0.75rem;color:#a28e9d}.book:hover .cover{border-color:#e7afc3;transform:translateY(-2px)}.progress-track{height:2px;background:#392d3b;margin-top:10px}.progress-track span{display:block;height:100%;background:#d29ab1}.empty{padding:40px 10px 50px;text-align:center;background:#1d1821;border:1px dashed #4b3849;border-radius:9px}.empty-mark{font-size:2.25rem;color:#c897ac}.empty h3{font:1.6875rem Georgia,serif;font-weight:400;margin:14px 0}.empty p{font-size:0.75rem;color:#a997a5;line-height:1.8;margin-bottom:24px}.empty .subtle{font-size:0.75rem}.empty .subtle span{margin-left:15px;color:#e1a4bb}.storage-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:48px 0 30px}.panel{background:#201a25;border:1px solid #382c3b;border-radius:9px;padding:25px 27px}.panel .eyebrow{font-size:0.75rem;color:#b993a6}.panel h3{font:1.5rem Georgia,serif;font-weight:400;margin:14px 0}.panel p{font-size:0.75rem;line-height:1.7;color:#b6a5b3;max-width:550px}.panel .fine{font-size:0.75rem;color:var(--text-muted);line-height:1.7}.meter{height:4px;background:#3a2d3d;border-radius:3px;margin:16px 0}.meter span{display:block;height:100%;background:#dca2bb;border-radius:3px;width:0}.text-button{border:0;background:none;color:#d9a6bd;font-size:0.75rem;padding:6px 0}.backup-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}.backup-actions .subtle{font-size:0.75rem;padding:10px 14px}footer{border-top:1px solid #302733;padding:25px 0;font-size:0.75rem;letter-spacing:.08em;color:var(--text-muted);line-height:2}footer span{padding:0 10px}footer a{float:right}#notice{font-size:0.75rem;line-height:1.7;color:#c9b5c3;margin-bottom:15px}#notice:empty{display:none}.error{border:1px solid #9a596c;background:#38222d;color:#f6c4d0;padding:14px;border-radius:7px;font-size:0.75rem;line-height:1.7;margin:15px 0}.readerbar{position:fixed;inset:0 0 auto;min-height:80px;background:#19151df5;border-bottom:1px solid #443140;z-index:5;display:flex;align-items:center;gap:18px;padding:13px 24px;backdrop-filter:blur(10px)}.reader-title{flex:1;min-width:0}.reader-title strong{font-size:0.875rem;display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.reader-title small{display:block;font-size:0.75rem;color:#a78d9e;margin-top:5px}#save-status{font-size:0.75rem;color:#b4cbb5;max-width:190px}#save-status.unsaved{color:#e8b191}.reading .sidebar{display:none}.reader-intro{display:flex;justify-content:space-between;gap:10px;max-width:850px;margin:0 auto;padding:110px 20px 24px;color:#998393;font-size:0.75rem;letter-spacing:.1em}.reader-intro span:last-child{letter-spacing:0}#pdf-pages{max-width:850px;margin:auto;padding:0 12px}.pdf-page{position:relative;background:#fff;margin-bottom:18px;box-shadow:0 8px 35px #0003;overflow:hidden}.pdf-page .page-label{position:absolute;bottom:10px;right:14px;color:#786f77;font-size:0.75rem;z-index:1;background:#ffffffb0;padding:3px 5px}.pdf-page canvas{display:block;width:100%;height:100%;position:absolute;inset:0}.reader-end{text-align:center;padding:50px 20px 80px;color:#b9a0b2;font:1.6875rem Georgia,serif}.reader-end button{margin-top:22px}.reader-error{position:fixed;top:80px;left:12px;right:12px;z-index:6;background:#482b39;border:1px solid #bf718c;padding:14px 20px;font-size:0.75rem;color:#f8d1dd;line-height:1.5;box-shadow:0 5px 20px #0004}.reader-error button{margin-left:12px;font-size:0.75rem;padding:6px 10px}dialog{background:#241c29;color:#e9dfe5;border:1px solid #77556c;border-radius:12px;padding:30px;max-width:560px;width:calc(100% - 32px);box-shadow:0 20px 80px #0008}dialog::backdrop{background:#08060bd6;backdrop-filter:blur(5px)}dialog h2{font:1.8125rem Georgia,serif;margin:18px 0}dialog p,dialog li{font-size:0.75rem;line-height:1.8;color:#c3afbe}dialog ul{max-height:180px;overflow:auto;padding-left:20px}.confirm-check{display:flex;align-items:center;gap:10px;font-size:0.75rem;margin:24px 0}.confirm-check input{accent-color:#dd9db7;width:17px;height:17px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px}@media(max-width:1000px){.sidebar{width:190px;padding:30px 18px}main{margin-left:190px;padding:0 30px}.hero-flower{padding:0 25px;font-size:8.4375rem}.storage-grid{gap:14px}.panel{padding:22px}.readerbar{gap:12px;padding:12px}.reader-title strong{max-width:350px}}@media(max-width:760px){.sidebar{display:none}main{margin:0;padding:0 22px}.topbar{min-height:65px;gap:8px}.breadcrumb{font-size:0.75rem;letter-spacing:.1em}.offline{font-size:0.75rem}#install-app{font-size:0.75rem;padding:6px}.hero{padding:37px 0 30px}.hero-flower{font-size:6.5625rem;padding:0 5px}.hero-flower span{font-size:0.75rem;max-width:110px;line-height:1.3}.hero p{font-size:0.75rem}h1{font-size:2.625rem}.hero .eyebrow{font-size:0.75rem}.library-tools{margin:28px 0 20px}.library-tools h2{font-size:1.0625rem}.primary,.subtle{padding:11px 13px}.shelf{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.cover{height:220px;padding:22px}.cover-title{font-size:1.4375rem}.storage-grid{grid-template-columns:1fr;margin-top:30px}.panel{padding:24px}footer a{float:none;display:block}.readerbar{flex-wrap:wrap;min-height:96px;gap:9px;padding:10px}.reader-title{flex-basis:50%;max-width:calc(100% - 100px)}.readerbar .subtle{font-size:0.75rem;padding:10px}.readerbar .primary{font-size:0.75rem;padding:9px 12px}#save-status{margin-left:4px;flex:1;max-width:none;font-size:0.75rem}.reader-intro{padding-top:125px;font-size:0.75rem}.reader-intro span:last-child{max-width:150px;text-align:right}.reader-error{top:99px}.pdf-page{margin-bottom:12px}.empty p{font-size:0.75rem}.cover-label{font-size:0.75rem}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

.getting-started{margin-top:24px}.getting-started h2{font-size:1.0625rem}.getting-started ol{padding-left:20px;font-size:0.75rem;line-height:1.8;color:#c7b3c1}.getting-started details{font-size:0.75rem;line-height:1.8}.getting-started summary{cursor:pointer;color:#e8adc0}.topbar{flex-wrap:wrap;padding:12px 0}.getting-started p{max-width:780px}

.import-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}.image-title-label{display:grid;gap:8px;font-size:0.75rem;color:#d7b6c7}.image-title-label input{width:100%;min-width:0;background:#19151d;color:#ede6e8;border:1px solid #77556c;border-radius:6px;padding:10px}#image-order{max-height:240px;overflow:auto;padding-left:26px;overflow-wrap:anywhere}#image-summary{overflow-wrap:anywhere}@media(max-width:760px){.library-tools{flex-wrap:wrap}.import-actions{width:100%;justify-content:flex-start}}

.epub-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center;max-width:980px;margin:20px auto;padding:0 20px}.epub-controls label{display:flex;gap:8px;align-items:center;font-size:0.875rem}.epub-controls select{max-width:100%;background:#241d29;color:#eee6df;border:1px solid #574153;padding:10px;border-radius:6px}.epub-controls>select{flex:1;min-width:160px}.epub-chapter{max-width:850px;margin:24px auto}.epub-chapter iframe{display:block;width:100%;border:0;background:#211b25}@media(max-width:600px){.epub-controls{gap:8px;padding:0 12px}.epub-chapter{margin:16px 8px}}

.epub-controls{position:sticky;top:80px;z-index:4;background:#17141b;padding-top:10px;padding-bottom:10px}

/* Continuity changes presentation only: original page margins remain content. */
.reading-spacing{display:flex;align-items:center;gap:6px;font-size:0.75rem}.reading-spacing select{background:#251e29;color:#ede6e8;border:1px solid #51404e;border-radius:5px;padding:6px}.pdf-page{contain:layout paint;overflow-anchor:none}.pdf-page:not([data-rendered]):after{content:'Loading page';position:absolute;inset:45% 0 auto;text-align:center;color:#786f77;font-size:0.75rem}.pdf-page canvas{z-index:1}.gapless .pdf-page{margin-bottom:0;box-shadow:none}.gapless .page-label{display:none}.epub-chapter{position:relative;margin:0 auto 24px;overflow:hidden;overflow-anchor:none;contain:layout paint;background:#211b25}.gapless .epub-chapter{margin:0 auto}.epub-chapter iframe{height:100%;width:100%;display:block;border:0}.epub-measure{position:absolute;visibility:hidden;pointer-events:none;width:100%;inset:0 auto auto 0}.epub-measure iframe{display:block;width:100%;border:0}.epub-chapter:not([data-rendered]):after{content:'Loading chapter';position:absolute;inset:40px 0 auto;text-align:center;color:#bda7b3}.epub-chapter iframe{position:relative;z-index:1}#pdf-pages{position:relative;overflow-anchor:none}.reading .readerbar{flex-wrap:wrap}@media(max-width:760px){.reading-spacing{font-size:0.75rem}.reading-spacing select{padding:4px}.epub-chapter{margin-left:0;margin-right:0}}
.epub-controls{position:fixed;left:0;right:0;max-width:none;margin:0;justify-content:center}.reading:has(#epub-controls) .reader-intro{padding-bottom:110px}.epub-measure{width:calc(100% - 24px);left:12px}

/* Fractional paint clips can expose the dark backdrop between touching slots.
   Keep geometry containment, without cropping, overlap or background painting. */
.gapless .pdf-page,.gapless .epub-chapter{contain:layout;overflow:visible}

/* Explicit fixed-page navigation; no reading preference or storage migration. */
.readerbar:has(.page-navigation){flex-wrap:wrap}.page-navigation{display:flex;flex:1 0 100%;align-items:center;justify-content:center;gap:8px;font-size:0.75rem}.page-navigation label{display:flex;align-items:center;gap:6px}.page-navigation input{width:5em;background:#251e29;color:#ede6e8;border:1px solid #51404e;border-radius:5px;padding:9px}.page-navigation .subtle{min-height:40px;padding:9px 12px}@media(max-width:480px){.page-navigation{gap:5px;font-size:0.75rem;flex-wrap:wrap}.page-navigation .subtle{padding:8px;font-size:0.75rem}.page-navigation input{width:3.5em}}

.reading:has(.page-navigation) .reader-end{min-height:100vh}
.readerbar:has(.page-navigation) #save-status{min-height:3.5em;display:flex;align-items:center}

#bookmark-editor label{display:block;margin-bottom:8px}#bookmark-name{width:100%;background:#17141b;color:#ede6e8;border:1px solid #77556c;border-radius:6px;padding:10px}#bookmark-list{padding:0;list-style:none;max-height:45vh;overflow:auto}#bookmark-list li{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid #51404e;padding:12px 0}#bookmark-list strong{overflow-wrap:anywhere;flex:1 1 100%}#bookmark-list .subtle{min-height:40px;padding:8px}#bookmark-status{min-height:1.5em}#bookmark-dialog .dialog-actions{flex-wrap:wrap}

.library-view-controls{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:20px 0}.library-view-controls label{display:flex;flex-direction:column;gap:6px;min-width:0}.library-view-controls input,.library-view-controls select{max-width:100%;min-height:44px;background:var(--panel,#201c24);color:inherit;border:1px solid #645868;border-radius:8px;padding:9px}.library-view-controls input{width:280px}.library-view-controls p{flex-basis:100%;margin:0}.library-view-controls button{min-height:44px}

#category-dialog{max-height:90vh;overflow:auto}#category-editor{display:flex;gap:10px;flex-wrap:wrap;align-items:end}#category-editor label{display:flex;flex-direction:column;max-width:100%}#category-name,#category-title{max-width:100%;min-height:44px}#category-list{padding-left:0;list-style:none;max-height:30vh;overflow:auto}#category-list li{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0}#category-list strong{overflow-wrap:anywhere}#category-assignments label{display:flex;align-items:center;gap:10px;min-height:44px;overflow-wrap:anywhere}#category-assignments input{width:20px;height:20px}#category-assignments{max-height:30vh;overflow:auto}

.book-item{min-width:0;display:flex;flex-direction:column;gap:8px}.book-item>.book{width:100%}.favorite-toggle{align-self:flex-start;min-height:44px}.favorite-toggle[aria-pressed="true"]{color:var(--accent,#e4a6bf)}.favorite-filter{display:flex!important;flex-direction:row!important;align-items:center;gap:8px}.favorite-filter input{width:auto;min-height:24px}

.shelf[data-layout="list"]{grid-template-columns:minmax(0,1fr)}.shelf[data-layout="list"] .book-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px}.shelf[data-layout="list"] .book{display:grid;grid-template-columns:80px minmax(0,1fr);column-gap:18px;text-align:left}.shelf[data-layout="list"] .cover{grid-row:1/5;width:80px;height:110px;min-height:0;margin:0}.shelf[data-layout="list"] .cover-title{font-size:0.875rem}.shelf[data-layout="list"] .cover-label,.shelf[data-layout="list"] .cover-bottom{display:none}.shelf[data-layout="list"] .book-name{align-self:end;overflow-wrap:anywhere}.shelf[data-layout="list"] .book-meta{align-self:start}.shelf[data-layout="list"] .progress-track{grid-column:2}.shelf[data-layout="list"] .favorite-toggle{align-self:center}@media(max-width:480px){.shelf[data-layout="list"] .book-item{grid-template-columns:minmax(0,1fr)}.shelf[data-layout="list"] .favorite-toggle{margin-left:98px}.shelf[data-layout="list"] .book{column-gap:12px}.shelf[data-layout="list"] .cover{width:72px;height:100px}}

.book-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.book-actions button{min-height:44px}.shelf[data-layout="list"] .book-actions .favorite-toggle{margin-left:0}#title-detail-dialog{width:min(640px,calc(100vw - 32px));max-height:90vh;overflow:auto}#title-detail-heading,#title-detail-metadata dd{overflow-wrap:anywhere}#title-detail-metadata{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px}#title-detail-metadata dt{font-weight:600}#title-detail-metadata dd{margin:0}#title-detail-dialog .dialog-actions{flex-wrap:wrap}@media(max-width:480px){.shelf[data-layout="list"] .book-actions{margin-left:84px}#title-detail-metadata{grid-template-columns:1fr;gap:4px}#title-detail-metadata dd{margin-bottom:10px}}

#title-detail-chapter-list{padding:0;list-style:none}#title-detail-chapter-list li{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-top:1px solid #51404e;padding:10px 0}#title-detail-chapter-list li>span{flex:1 1 180px;overflow-wrap:anywhere}#title-detail-chapters button{min-height:44px}

#chapter-mark-controls{display:flex;flex-wrap:wrap;gap:8px}#chapter-mark-controls[hidden]{display:none}#chapter-mark-controls p{flex-basis:100%}.chapter-read-state{font-size:0.75rem}#title-detail-chapter-list input[type="checkbox"]{width:22px;height:22px}

.bulk-shelf{margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:14px}.bulk-actions{display:flex;flex-wrap:wrap;gap:.5rem}.bulk-title-label{display:flex;align-items:center;gap:.5rem;padding:.5rem}.bulk-title-label input{width:20px;height:20px}.bulk-shelf select{max-width:100%}

body.reading,body.reading #reader-view{background:var(--reader-surround,#17141b)}.reader-option-label{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:16px 0}.reader-option-label select{max-width:100%;background:#251e29;color:#eee6df;border:1px solid #77556c;padding:10px;border-radius:6px}#reader-options-dialog{max-width:min(520px,calc(100vw - 24px))}#reader-options-close{font-size:1rem;min-height:44px;min-width:44px}

.reading .reader-intro,.reading .reader-end{color:var(--reader-surround-ink,#ede6e8)}

#shelf.session-history{display:flex;flex-direction:column;gap:14px}.history-entry{min-width:0;border:1px solid #51404e;background:#201a25;border-radius:8px;padding:18px}.history-entry h3{margin:0 0 8px;overflow-wrap:anywhere}.history-entry time,.history-entry p{font-size:0.75rem;line-height:1.6;color:#c3afbe}.history-entry button{max-width:100%;white-space:normal}#history-empty{padding:24px;border:1px solid #51404e;border-radius:8px;line-height:1.7}

.library-help{font-size:0.75rem;line-height:1.8;max-width:100%;min-width:0}.library-help summary{cursor:pointer;color:#e8adc0;min-height:44px;display:list-item;align-content:center}.library-help summary:focus-visible{outline:2px solid #e8adc0;outline-offset:4px;border-radius:4px}.library-help p{margin:8px 0;overflow-wrap:anywhere}.library-view-controls .library-help{flex-basis:100%}

#iphone-install-help{margin:12px 0}#iphone-install-help>summary{min-height:44px;align-content:center}#iphone-install-help>summary:focus-visible{outline:2px solid #e8adc0;outline-offset:4px;border-radius:4px}

.cover{position:relative;overflow:hidden}.custom-cover-image{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#211a24}.has-custom-cover>.cover-label,.has-custom-cover>.cover-title,.has-custom-cover>.cover-bottom{visibility:hidden}.cover-warning{font-size:0.75rem;position:relative;z-index:1}.cover-preview{position:relative;height:160px;max-width:180px;background:#211a24;padding:16px;border-radius:8px;overflow:hidden}.cover-preview.has-custom-cover{font-size:0}#title-detail-cover{border-top:1px solid #51404e;margin-top:18px;padding-top:8px}#title-detail-cover>button{min-height:44px;margin:4px}#title-detail-cover summary{min-height:44px;padding:12px 0;cursor:pointer}#title-detail-cover summary:focus-visible{outline:3px solid #f4a7bd;outline-offset:3px}

#getting-started-link{font:0.875rem system-ui,sans-serif;text-decoration:underline;display:inline-block;padding:12px 0;min-height:44px}#getting-started-help-dialog{width:min(760px,calc(100vw - 32px));max-height:90vh;overflow:auto}#getting-started-help-dialog .getting-started{margin:0;border:0;padding:0}#getting-started-help-dialog .dialog-actions{margin-top:16px}

.cover.has-custom-cover::before,.cover.has-custom-cover::after{display:none}

/* Title details: keep Start reading in view, and make removal distinct from cancel. */
.danger{background:#38222d;color:#f6c4d0;border:1px solid #9a596c;border-radius:7px;padding:12px 18px;display:inline-flex;justify-content:center;align-items:center;gap:10px;min-height:44px;min-width:44px;font:inherit;cursor:pointer}
.danger:hover{background:#4a2a38}
.danger:disabled{opacity:.45;cursor:not-allowed}
#remove-cancel.subtle{font-size:inherit}
#reader-tools-slot{display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:12px 0}
#reader-tools-slot:empty{display:none}
#reader-tools-slot .reading-spacing{flex-wrap:wrap;white-space:normal;width:100%;font-size:1rem}
#reader-tools-slot .subtle,#reader-tools-slot select{min-height:44px;min-width:44px}
#reader-tools-slot .subtle{font-size:1rem}
#title-detail-dialog{padding-top:0}
.title-detail-toolbar{position:sticky;top:0;z-index:5;background:#241c29;margin:0 -30px 12px;padding:16px 20px 12px;border-bottom:1px solid #51404e}
.title-detail-toolbar h2{margin:0 0 8px}
.title-detail-toolbar .dialog-actions{justify-content:flex-start;flex-wrap:wrap}
#title-detail-dialog .dialog-actions{flex-wrap:wrap}
@media(max-width:480px){#title-detail-dialog{padding:0 16px 20px}.title-detail-toolbar{margin:0 -16px 12px;padding:12px 12px 10px}}

/* Compact phone reader bar below 760px, and in landscape about 500px tall or shorter. Page navigation is moved outside the bar so it can pin to the viewport. */
button,select,summary,.text-button,.file-button{min-height:44px}
button,select,.text-button,.file-button{min-width:44px}
.page-navigation .subtle,.page-navigation input,.reading-spacing select,#bulk-category,.bulk-title-label input,.confirm-check input,#title-detail-chapter-list input[type="checkbox"],#reader-custom{min-height:44px;min-width:44px}
.bulk-title-label input,.confirm-check input,#title-detail-chapter-list input[type="checkbox"],#reader-custom{width:44px;height:44px}
.favorite-filter input{width:44px;height:44px;min-width:44px;min-height:44px}
.page-navigation .subtle{min-height:44px;min-width:44px}
.file-button{min-height:44px;box-sizing:border-box}
.file-button input{inset:-1px;width:auto;height:auto;min-width:44px;min-height:44px}
body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
body:not(.reading){padding-bottom:env(safe-area-inset-bottom)}
@media(max-width:760px),(max-height:500px) and (orientation:landscape){
 .readerbar,.reading .readerbar,.readerbar:has(.page-navigation){display:flex;flex-wrap:wrap;align-items:center;align-content:center;gap:2px 4px;min-height:0;height:auto;padding:4px 6px;padding-top:calc(4px + env(safe-area-inset-top));padding-bottom:4px;padding-left:calc(6px + env(safe-area-inset-left));padding-right:calc(6px + env(safe-area-inset-right));max-width:100%;overflow:visible}
 #reader-back{flex:0 0 44px;order:1;width:44px;min-width:44px;height:44px;padding:0}
 .reader-title{display:flex;flex-flow:row wrap;align-items:baseline;column-gap:8px;flex:1 1 0;order:2;max-width:100%;min-width:5em;align-self:center;padding:0}
 #reader-title,.reader-title strong{flex:1 1 100%;min-width:0;max-width:100%;font-size:0.75rem;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .reader-count-line{display:flex;flex-flow:row wrap;align-items:baseline;column-gap:8px;flex:1 1 100%;min-width:0;max-width:100%;margin:0}
 .reader-title small,#reader-count{flex:0 0 auto;margin:0;white-space:nowrap;overflow:visible;text-overflow:clip;font-size:0.75rem;line-height:1.05}
 .reader-size{display:none}
 #save-status,.readerbar:has(.page-navigation) #save-status{position:static;z-index:auto;left:auto;right:auto;top:auto;flex:1 1 auto;align-self:baseline;width:auto;min-width:0;max-width:100%;min-height:0;margin:0;pointer-events:none;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word;font-size:0.6875rem;line-height:1.15}
 .readerbar > button.subtle:not(#reader-back),#save-now{position:relative;z-index:1;flex:0 0 auto;align-self:center;white-space:nowrap;height:44px;min-height:44px;min-width:44px;padding:0 8px;line-height:1}
 #save-now{order:3}
 .readerbar > button.subtle:not(#reader-back){order:4}
 .reading-spacing{flex:none;white-space:normal;padding:0}
 .page-navigation{position:fixed;left:0;right:0;bottom:0;z-index:6;flex:none;width:auto;max-width:100%;box-sizing:border-box;background:#19151df5;border-top:1px solid #443140;margin:0;padding:0 calc(4px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(4px + env(safe-area-inset-left));min-height:0;flex-wrap:wrap;justify-content:flex-start;align-items:center;overflow:visible;gap:4px}
 .page-navigation > *,.page-navigation .subtle,.page-navigation label{flex:0 0 auto;white-space:nowrap}
 .page-navigation label{line-height:1;gap:4px}
 #page-navigation-total{line-height:1}
 body.reading #pdf-pages,body.reading .reader-end{padding-bottom:calc(max(96px, var(--phone-nav-h, 0px) + 16px) + env(safe-area-inset-bottom))}
 .page-navigation .subtle,.page-navigation input{height:44px;min-height:44px;min-width:44px;padding:0 6px;line-height:1}
 .page-navigation .subtle,.page-navigation input,.reading-spacing select,input,select,textarea{font-size:1rem}
 #reader-back{font-size:0}
 #reader-back::before{content:'←';font-size:1.25rem;line-height:1}
 .readerbar > button.subtle:not(#reader-back){font-size:0}
 .readerbar > button.subtle:not(#reader-back)::before{content:'Options';font-size:0.75rem;line-height:1}
 #save-now{font-size:0.75rem;line-height:1}
 .page-navigation .page-previous,.page-navigation .page-next,.page-navigation .page-go{font-size:0}
 .page-navigation .page-previous::before{content:'Prev';font-size:1rem;line-height:1}
 .page-navigation .page-next::before{content:'Next';font-size:1rem;line-height:1}
 .page-navigation .page-go::before{content:'Go';font-size:1rem;line-height:1}
}
@media(max-height:340px) and (orientation:landscape){
 .readerbar,.reading .readerbar,.readerbar:has(.page-navigation){padding-top:env(safe-area-inset-top);padding-bottom:0}
 .page-navigation{padding-top:0;padding-bottom:env(safe-area-inset-bottom);min-height:0}
}
