/* Match the comic reader's settings panel across all nine novel themes. */
.novel-reader-settings{box-sizing:border-box;width:min(430px,calc(100% - 32px));max-height:85dvh;overflow:auto;border:1px solid #566077;border-radius:16px;padding:22px;background:#151b29;color:#f1f3f8;font:14px/1.7 system-ui,sans-serif}
.novel-reader-settings::backdrop{background:#0009}
.novel-settings-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}
.novel-settings-head h2{font-size:20px;margin:0;color:inherit}
.novel-reader-settings button{min-height:42px;border:1px solid #566077;border-radius:8px;padding:10px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.novel-reader-settings fieldset{border:0;padding:0;margin:0 0 22px;min-width:0}
.novel-reader-settings legend{margin-bottom:10px}
.novel-settings-options{display:flex;gap:10px;flex-wrap:wrap}
.novel-settings-options button{flex:1}
.novel-settings-options [aria-pressed=true]{background:#6953a5;border-color:#bba5ff}
.novel-reader-settings label{display:flex;justify-content:space-between;gap:12px}
.novel-reader-settings input[type=range]{box-sizing:border-box;width:100%;height:24px;min-height:0;padding:0;margin:14px 0;accent-color:#bba5ff}
.novel-reader-settings p{font-size:13px;color:#bac0ce;line-height:1.7;margin:0}
.novel-reader-settings [data-novel-settings-catalog]{width:100%;margin-top:12px}
body[data-novel-reader-theme=dark]{--novel-reader-paper:#090e18;--novel-reader-ink:#f1f3f8}
body[data-novel-reader-theme=light]{--novel-reader-paper:#eae5dc;--novel-reader-ink:#242838}
body[data-novel-reader-theme=sepia]{--novel-reader-paper:#30291f;--novel-reader-ink:#f2e4ca}
body[data-novel-reader-theme] :is(.reader-shell,.novel-reader,.novel-reader-main,.novel-reading){background:var(--novel-reader-paper)!important;color:var(--novel-reader-ink)!important}
body[data-novel-reader-theme] #novel-prose{font-size:var(--novel-reader-font)!important;line-height:var(--novel-reader-line)!important;color:var(--novel-reader-ink)!important;filter:brightness(var(--novel-reader-brightness,1))}
body[data-novel-reader-theme] #novel-prose p{font-size:inherit!important;line-height:inherit!important;color:inherit!important}
/* Let enlarged chapter text reflow and grow in every novel template. */
body[data-channel=novel] #novel-prose,
body[data-channel=novel] #novel-prose p{box-sizing:border-box;display:block;min-width:0;max-width:100%;height:auto!important;max-height:none!important;overflow:visible!important;white-space:pre-wrap!important;overflow-wrap:anywhere;word-break:normal;text-overflow:clip;-webkit-line-clamp:unset;line-clamp:unset}

/* Only the completion notice is shown below the chapter text. */
body .novel-chapter-nav[hidden]{display:none!important}
body .novel-chapter-end,body .novel-reading>.footnote{margin-block:6px!important;padding-block:0!important;min-height:0!important;background:transparent!important;font-size:12px!important;font-weight:400;line-height:1.5}
body .novel-chapter-end>p{margin:0!important;font-size:inherit!important}

/* Use the same responsive shell and content width as other pages. */
body[data-channel=novel] .app-shell.reader-shell{max-width:var(--page-shell-width)!important}
body[data-channel=novel] :is(.novel-reading,.novel-reader-main){box-sizing:border-box;width:100%;max-width:100%!important}
body[data-channel=novel] .reader-bottom{max-width:var(--page-shell-width,var(--shell,100%))!important}

/* Keep prose and the fixed chapter navigation in one full-width column. */
body[data-channel=novel] :is(.novel-reading,.novel-reader-main){padding-inline:10px!important}
body[data-channel=novel] .novel-chapter-nav.reader-bottom{box-sizing:border-box;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));position:fixed;inset:auto auto 0 50%;transform:translateX(-50%);width:100%;max-width:var(--page-shell-width);margin:0;min-height:64px;padding:7px 10px calc(7px + env(safe-area-inset-bottom));gap:6px;z-index:30;background:var(--novel-reader-paper,var(--paper));border:0;border-top:1px solid var(--line,#80808033)}
body[data-channel=novel] .novel-chapter-nav.reader-bottom>*{min-width:0;display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px}
body[data-channel=novel] .app-shell:has(.novel-chapter-nav.reader-bottom){padding-bottom:calc(80px + env(safe-area-inset-bottom))!important}

body[data-channel=novel] :is(.reader-bottom,.reader-footer){padding-inline:10px!important}

body[data-channel=novel] :is(.app-shell,.app):has(#novel-prose){border-inline:0!important}

/* Avoid layout whitespace between paragraph elements and use a compact paragraph gap. */
body[data-channel=novel] #novel-prose{white-space:normal!important}
body[data-channel=novel] #novel-prose>p{margin-block:0 .6em!important}
body[data-channel=novel] #novel-prose>p:last-child{margin-bottom:0!important}
