.ebook-app{--reader-bg:var(--bg,#20211c);--reader-text:var(--text,#f8f8f2)}.ebook-layout{display:flex;flex:1;min-height:0}.ebook-layout>aside{width:280px;flex:none;overflow:auto;padding:16px;border-right:1px solid var(--line);overscroll-behavior:contain}.ebook-layout>aside[hidden]{display:none}.ebook-nav-heading,.ebook-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.ebook-nav-heading h1{font-size:20px;margin:0}.ebook-layout h2{font-size:16px}.ebook-layout .hint{font-size:13px;line-height:1.6;color:var(--muted)}.ebook-library:empty:before{content:'No saved books yet.';color:var(--muted);font-size:14px}.ebook-book{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;margin:8px 0}.ebook-book>button:first-child{overflow:hidden;text-overflow:ellipsis;text-align:left}.ebook-book [aria-current=true],#ebookChapters [aria-current=true]{border-color:var(--green);font-weight:700}#ebookChapters a{display:block;padding:8px;border-radius:6px;overflow-wrap:anywhere;line-height:1.4;text-decoration:none}#ebookChapters a:hover{background:var(--panel)}.ebook-layout details{font-size:13px;line-height:1.7;margin:20px 0}.ebook-layout summary{cursor:pointer}.ebook-legal{display:flex;flex-wrap:wrap;gap:14px;margin:22px 0}.ebook-main{display:flex;flex:1;min-width:0;min-height:0;flex-direction:column}.ebook-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 16px;border-bottom:1px solid var(--line)}.ebook-toolbar label{display:flex;align-items:center;gap:7px}.ebook-toolbar input{width:72px}.ebook-toolbar>span{font-size:13px;font-variant-numeric:tabular-nums}#ebookChapterLabel{flex:1;min-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}#ebookViewport{flex:1;min-height:0;overflow:auto;background:var(--reader-bg);color:var(--reader-text);padding:28px;position:relative;overscroll-behavior:contain;scrollbar-gutter:stable}#ebookWelcome{max-width:520px;margin:10vh auto;text-align:center}#ebookWelcome>span{font-size:56px;color:var(--green)}#ebookWelcome h2{font-size:28px}#ebookWelcome p{line-height:1.7}:is(#ebookContent,.ebook-measure){font-family:var(--reading-font,Georgia,serif);font-size:var(--reading-size,20px);line-height:var(--reading-line,1.7);max-width:var(--reading-width,760px);margin:0 auto;overflow-wrap:anywhere}:is(#ebookContent,.ebook-measure) h1,:is(#ebookContent,.ebook-measure) h2,:is(#ebookContent,.ebook-measure) h3{font-family:inherit;line-height:1.3;break-after:avoid}:is(#ebookContent,.ebook-measure) h1{font-size:1.7em}:is(#ebookContent,.ebook-measure) h2{font-size:1.4em}:is(#ebookContent,.ebook-measure) p{margin:.8em 0}:is(#ebookContent,.ebook-measure) img{display:block;max-width:100%;height:auto;max-height:65dvh;object-fit:contain;margin:1em auto}:is(#ebookContent,.ebook-measure) pre{white-space:pre-wrap}:is(#ebookContent,.ebook-measure) a{color:inherit;text-decoration:underline;text-underline-offset:3px}:is(#ebookContent,.ebook-measure) table{max-width:100%;font-size:.85em;border-collapse:collapse}:is(#ebookContent,.ebook-measure) td,:is(#ebookContent,.ebook-measure) th{border:1px solid currentColor;padding:5px}:is(#ebookContent,.ebook-measure) .ebook-chapter{padding-bottom:0}#ebookViewport[data-view=continuous] .ebook-chapter{content-visibility:visible}#ebookViewport[data-view=continuous] .ebook-chapter:target{content-visibility:visible}#ebookViewport[data-view=single],#ebookViewport[data-view=dual]{overflow:hidden}#ebookViewport[data-view=single] :is(#ebookContent,.ebook-measure),#ebookViewport[data-view=dual] :is(#ebookContent,.ebook-measure){max-width:none;width:100%;height:100%;margin:0;column-width:var(--page-width);column-gap:40px;column-fill:auto}#ebookViewport:not([data-view=continuous]) :is(#ebookContent,.ebook-measure) .ebook-chapter{padding-bottom:0}#ebookViewport:not([data-view=continuous]) :is(#ebookContent,.ebook-measure) img{max-height:90%;break-inside:avoid}#ebookViewport:not([data-view=continuous]) :is(#ebookContent,.ebook-measure) *{max-width:100%}.ebook-footer{display:flex;justify-content:space-between;gap:16px;padding:8px 16px;border-top:1px solid var(--line);font-size:12px;min-height:35px}.ebook-footer span{overflow-wrap:anywhere;min-width:0}#ebookTitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:45%}#ebookAppearanceDialog{width:min(500px,calc(100% - 24px));max-height:88dvh;overflow:auto;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:12px;padding:22px}#ebookAppearanceDialog::backdrop{background:#0009}#ebookAppearanceDialog label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0;font-size:14px}#ebookAppearanceDialog select{max-width:65%}#ebookAppearanceDialog input[type=number]{width:85px}#ebookAppearanceDialog input[type=range]{width:45%}#ebookAppearanceDialog .ebook-check{justify-content:flex-start}.ebook-custom-colors,.ebook-font-actions{display:flex;gap:12px;flex-wrap:wrap}.ebook-custom-colors label{margin:0!important}.ebook-custom-colors input{width:48px;height:36px;padding:3px}.ebook-font-actions button{font-size:13px}#ebookNavClose{display:none}#ebookCommandResults:empty:before{content:'No matching commands.'}#ebookCommandResults button{display:block;width:100%;text-align:left;margin:4px 0}#ebookCommandResults .active{border-color:var(--green)}
@media(max-width:800px){.ebook-layout>aside{position:fixed;top:0;bottom:0;left:0;width:min(310px,88vw);z-index:50;background:var(--bg);box-shadow:0 0 0 100vmax #0008;padding-top:max(16px,env(safe-area-inset-top))}#ebookNavClose{display:block}.ebook-app .studio-header{padding:8px;gap:8px}.ebook-app .studio-title{display:none}.ebook-app .studio-header button{font-size:13px}.ebook-toolbar{padding:8px;gap:8px}.ebook-toolbar label{font-size:13px}#ebookViewport{padding:20px}.ebook-footer{padding:8px}.ebook-app #ebookAppearance{max-width:110px;white-space:normal}.ebook-app .brand-word{font-size:20px}}

#ebookViewport:not([data-view=continuous]) :is(#ebookContent,.ebook-measure){overflow:hidden}
#ebookCommandDialog:not([open]){display:none}

.ebook-page-controls{display:flex;align-items:center;gap:8px;min-width:0}.ebook-page-controls span{font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}.ebook-page-controls label{white-space:nowrap}#ebookPageTotal{min-width:24px}@media(max-width:800px){.ebook-app #ebookAppearance{max-width:none;white-space:normal!important}.ebook-toolbar{align-items:center}.ebook-page-controls{flex-wrap:nowrap;max-width:100%}.ebook-page-controls input{width:58px}.ebook-page-controls button{padding:6px 10px}#ebookChapterLabel{flex-basis:100%;font-size:12px}.ebook-footer span{font-size:11px}}

.ebook-nav-page{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px}.ebook-nav-page input{width:80px}#ebookPageList{display:flex;gap:6px;align-items:center;flex-wrap:wrap}#ebookPageList button{padding:5px 8px;min-width:35px;font-size:13px;font-variant-numeric:tabular-nums}#ebookPageList [aria-current=page]{background:var(--green);color:var(--accent-text,#162013);font-weight:700}

:is(#ebookContent,.ebook-measure) .ebook-pdf-page{margin:0 0 24px;text-align:center}:is(#ebookContent,.ebook-measure) .ebook-pdf-page img{display:block;width:100%;height:auto;max-height:none;min-height:80px;background:#fff;margin:0 auto;color:#222}:is(#ebookContent,.ebook-measure) .ebook-pdf-page figcaption{font:12px/1.5 var(--ui-font);margin-top:6px;color:var(--reader-text)}#ebookViewport.pdf-original:not([data-view=continuous]) :is(#ebookContent,.ebook-measure)>.ebook-chapter{height:100%}#ebookViewport.pdf-original:not([data-view=continuous]) .ebook-pdf-page{height:100%;margin:0;display:flex;flex-direction:column;justify-content:center;break-inside:avoid;break-after:column;overflow:hidden}#ebookViewport.pdf-original:not([data-view=continuous]) .ebook-pdf-page:last-child{break-after:auto}#ebookViewport.pdf-original:not([data-view=continuous]) :is(#ebookContent,.ebook-measure) .ebook-pdf-page img{width:100%;height:calc(100% - 28px);max-height:calc(100% - 28px);min-height:0;object-fit:contain}#ebookViewport.pdf-original:not([data-view=continuous]) .ebook-pdf-page figcaption{flex:none;height:22px;margin:6px 0 0}

#ebookBookPage{display:inline-block;flex:none;width:195px;white-space:nowrap;font-size:12px;font-variant-numeric:tabular-nums}

/* Fullscreen is limited to the reading surface, with an accessible exit. */
.ebook-focused #ebookViewport{position:fixed;inset:0;z-index:10000;width:100%;height:100dvh;box-sizing:border-box;background:var(--reader-bg);padding-top:56px}.ebook-focused .studio-header,.ebook-focused #ebookNav,.ebook-focused .ebook-toolbar,.ebook-focused .ebook-footer{visibility:hidden}#ebookViewport:fullscreen{width:100%;height:100dvh;box-sizing:border-box}#ebookExitFullscreen{position:fixed;top:8px;right:16px;z-index:10001;background:var(--reader-bg);color:var(--reader-text);border:1px solid currentColor;font:13px var(--ui-font)}#ebookExitFullscreen[hidden]{display:none}
