/* Approved Reader reference: wide pill controls, compact chapter bar, floating panels. */
body[data-reader-review=yes]{--reader-gutter:clamp(12px,3.2vw,46px)}
body[data-reader-review=yes] #app{max-width:1440px;min-width:0;padding-inline:var(--reader-gutter)}
body[data-reader-review=yes] .reader-bar{position:sticky;top:var(--header);display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;padding:8px 12px;min-height:49px;border-radius:9px;box-shadow:none;z-index:24;transition:transform .22s ease,opacity .2s ease,top .22s ease}
body[data-reader-review=yes][data-reader-stage="1"] .reader-bar,body[data-reader-review=yes]:has(#header[hidden]) .reader-bar{top:0}
body[data-reader-review=yes] .reader-bar.reader-bar-hidden{transform:translateY(calc(-100% - var(--header) - 15px));opacity:0;pointer-events:none}
.reader-title-row,.reader-chapter-nav,.reader-bar-actions,.reader-quick-actions{display:flex;align-items:center;gap:6px;min-width:0}
.reader-work-title{display:grid;gap:2px;min-width:0}.reader-work-title b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reader-work-title small{font-size:10px;color:var(--muted)}
.reader-bar-actions{justify-content:flex-end}
.reader-tool{display:inline-grid;place-items:center;width:28px;height:28px;min-width:28px;padding:0!important;flex:none;border:0;background:transparent;color:var(--text);border-radius:6px;transition:color .18s,background .18s}
.reader-tool .ic{width:16px;height:16px;transform:none!important}.reader-tool:hover{color:var(--accent);background:var(--raised)}.reader-tool:disabled{opacity:.35;cursor:default}
.reader-chapter-link,.reader-current-chapter{display:inline-flex;align-items:center;justify-content:center;gap:5px;border:1px solid var(--border);border-radius:999px;min-height:31px;padding:5px 12px;font-size:12px;white-space:nowrap;background:transparent}.reader-chapter-link .ic{width:13px;height:13px}.reader-chapter-link[aria-disabled=true]{opacity:.4;pointer-events:none}
body[data-reader-review=yes] .reader-controls{position:fixed;left:50%;bottom:12px;transform:translateX(-50%);width:min(1280px,calc(100vw - 2 * var(--reader-gutter)));max-width:none;min-height:44px;display:flex;align-items:center;gap:8px;padding:6px 11px;border-radius:999px;background:var(--surface);border:1px solid var(--border);box-shadow:0 4px 18px #0003;z-index:35;transition:opacity .2s ease}
body[data-reader-review=yes] .reader-controls.hide-controls{opacity:0;pointer-events:none}
.reader-quick-actions{flex:none;gap:2px}.reader-controls .reader-page-count{padding:5px 9px;min-width:45px;font-size:12px;white-space:nowrap;border-radius:999px;color:var(--accent);background:var(--raised);border:1px solid var(--border);direction:ltr}
body[data-reader-review=yes] .reader-controls input[type=range]{flex:1;min-width:20px;width:auto;accent-color:var(--accent);height:20px;cursor:pointer}
body[data-reader-review=yes] .reader-pages{margin:12px auto 20px;gap:0;min-height:200px}body[data-reader-review=yes] .chapter-image{display:block;object-fit:contain}
body[data-reader-review=yes] .reader-pages.horizontal-mode{min-height:calc(100dvh - 160px);align-items:center;gap:2px}
body[data-reader-review=yes] .reader-pages.horizontal-mode .chapter-image{max-height:calc(100dvh - 150px);max-width:100%}
body[data-reader-review=yes] .reader-pages.horizontal-mode.double .chapter-image{max-width:49.8%}
body[data-reader-review=yes].focus #app{padding:0;max-width:100%}
body[data-reader-review=yes].focus .reader-pages{margin:0 auto;min-height:100dvh}
body[data-reader-review=yes].focus .reader-pages.horizontal-mode .chapter-image{max-height:100dvh}
body[data-reader-review=yes].focus :is(#header,#footer,.reader-bar,.reader-end){display:none!important}
.reader-end-nav{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0 16px}.reader-end-nav .reader-chapter-link{min-height:38px}.reader-end-nav .next{background:var(--accent);border-color:var(--accent);color:white}
.reader-team{padding:12px;margin-bottom:12px}.reader-team h3{font-size:12px;color:var(--muted);margin-bottom:9px}.reader-team-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:12px;align-items:center}.reader-team-people,.reader-team-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.reader-team-people>div{display:flex;align-items:center;gap:5px;min-width:0}.reader-team-people .avatar{width:28px;height:28px;flex:none}.reader-team-people span{display:grid;min-width:0;gap:2px}.reader-team-people b{font-size:10px;overflow-wrap:anywhere}.reader-team-people small{font-size:9px}
.reader-team-actions>div{padding:6px;background:var(--raised);border:1px solid var(--border);border-radius:7px;display:grid;gap:6px;text-align:center}.reader-team-actions small{font-size:10px}.reader-team-button{font-size:10px;min-height:26px;padding:4px 8px;border-color:currentColor;background:transparent}.reader-team-support .reader-team-button{color:#fbbf24}.reader-team-discord .reader-team-button{color:#38bdf8}.reader-team-report .reader-team-button{color:#f87171}
.reader-floating{position:fixed;z-index:42;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 12px 40px #0005;overflow:hidden;max-width:calc(100vw - 24px)}.reader-floating[hidden]{display:none!important}
.reader-settings-panel{width:350px;inset-inline-start:var(--reader-gutter);bottom:66px;max-height:min(600px,calc(100dvh - 92px))}
.reader-chapter-panel{width:280px;inset-inline-end:var(--reader-gutter);top:80px;bottom:66px;max-height:650px}
.reader-floating-head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;border-bottom:1px solid var(--border);font-size:13px}.reader-settings-body,.reader-chapter-list{padding:8px;overflow-y:auto;max-height:calc(min(600px,100dvh - 92px) - 45px);scrollbar-width:thin}.reader-chapter-list{display:grid;gap:6px;max-height:calc(100% - 45px)}
.reader-chapter-search{width:100%;font-size:12px;min-height:32px;padding:6px 9px}.reader-chapter-list a{display:flex;align-items:center;gap:8px;padding:5px 7px;min-height:42px;background:var(--raised);border:1px solid var(--border);border-radius:7px;font-size:12px}.reader-chapter-list a[hidden]{display:none}.reader-chapter-list a.current{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}.reader-chapter-list a span{width:35px;height:33px;flex:none;overflow:hidden;border-radius:4px}.reader-chapter-list a img{width:100%;height:100%;object-fit:cover}.reader-chapter-list a .ic{margin-inline-start:auto;width:15px;height:15px}
.reader-setting-group{padding:8px 3px;border-bottom:1px solid var(--border);display:grid;gap:7px}.reader-setting-group:last-child{border:0}.reader-setting-group>b{font-size:11px;color:var(--muted)}.reader-setting-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.reader-setting-row>small{font-size:11px}.reader-segment{display:flex;gap:2px;min-width:0;background:var(--raised);padding:2px;border:1px solid var(--border);border-radius:6px}.reader-segment button{min-width:0;padding:5px 7px;font-size:10px;line-height:1.3;border:0;background:transparent;border-radius:4px}.reader-segment button.selected{background:var(--accent);color:white}.reader-setting-row input{width:125px;max-width:52%;accent-color:var(--accent)}
@media(max-width:700px){body[data-reader-review=yes] #app{padding-inline:8px}body[data-reader-review=yes] .reader-bar{grid-template-columns:minmax(0,1fr) auto;padding:6px;gap:6px}.reader-title-row{grid-column:1;grid-row:1}.reader-bar-actions{grid-column:2;grid-row:1;gap:1px}.reader-chapter-nav{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px}.reader-chapter-link,.reader-current-chapter{font-size:11px;padding:4px 6px;min-height:30px}.reader-tool{width:24px;height:26px;min-width:24px}.reader-tool .ic{width:15px;height:15px}.reader-work-title b{font-size:12px}.reader-work-title small{font-size:9px}.reader-quick-actions{gap:0}.reader-controls .reader-page-count{min-width:36px;padding:4px 6px;font-size:10px}body[data-reader-review=yes] .reader-controls{gap:3px;padding:5px 6px;width:calc(100vw - 16px);min-height:40px;bottom:8px}.reader-controls .reader-tool{min-width:23px;width:23px}.reader-team-body{grid-template-columns:1fr;gap:10px}.reader-team-people b{font-size:9px}.reader-team-actions small{font-size:9px}.reader-settings-panel{bottom:56px;inset-inline-start:8px;width:min(350px,calc(100vw - 16px))}.reader-chapter-panel{inset-inline-end:8px;top:65px;bottom:56px;width:min(280px,calc(100vw - 16px))}body[data-reader-review=yes] .reader-pages{max-width:100%}.reader-end-nav{gap:5px}}
@media(prefers-reduced-motion:reduce){body[data-reader-review=yes] :is(.reader-bar,.reader-controls){transition:none!important}}

body[data-reader-review=yes] .reader-controls input[type=range]{appearance:none;-webkit-appearance:none;background:var(--raised);border:0;border-radius:999px;height:22px;padding:0 6px;outline-offset:2px}body[data-reader-review=yes] .reader-controls input[type=range]::-webkit-slider-runnable-track{height:8px;background:transparent;border-radius:999px}body[data-reader-review=yes] .reader-controls input[type=range]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:18px;height:18px;border-radius:50%;background:var(--text);margin-top:-5px;border:1px solid var(--border)}body[data-reader-review=yes] .reader-controls input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:var(--text);border:1px solid var(--border)}
@media(max-width:700px){body[data-reader-review=yes] .reader-controls input[type=range]{height:18px}body[data-reader-review=yes] .reader-controls input[type=range]::-webkit-slider-thumb{width:15px;height:15px;margin-top:-3.5px}}

/* Latest approved reader geometry and compact controls */
body[data-reader-review=yes] :is(.reader-bar,.reader-end-nav){width:var(--reading-width,100%);max-width:100%;margin-inline:auto}
body[data-reader-review=yes] .reader-controls{width:min(var(--reading-width,800px),calc(100vw - 16px));padding:6px 8px}
body[data-reader-review=yes] .reader-bar{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:5px;padding:6px 8px}
.reader-bar-actions,.reader-chapter-nav{gap:3px}.reader-chapter-link,.reader-current-chapter{padding:5px 8px}
.reader-floating{inset:auto;max-height:calc(100dvh - 76px);overflow:hidden}
.reader-floating-head{padding:9px 12px}.reader-floating-head>div{display:grid;gap:3px}.reader-floating-head small{font-size:10px;color:var(--muted)}
.reader-chapter-panel{width:min(340px,calc(100vw - 24px));height:auto;max-height:min(560px,calc(100dvh - 90px))}
.reader-chapter-list{max-height:min(470px,calc(100dvh - 160px));overflow-y:auto;padding:7px;gap:6px}
.reader-chapter-list a.reference-chapter{display:flex;position:relative;align-items:center;gap:8px;min-height:74px;padding:7px;border-radius:8px;background:var(--surface)}
.reader-chapter-list a.reference-chapter.current{background:var(--accent-soft);border-color:var(--accent)}
.reader-chapter-list a.reference-chapter.read{opacity:.6}.reader-chapter-list a.reference-chapter.read img{filter:grayscale(1)}
.reader-chapter-list .reference-chapter-art{width:94px;height:60px;flex:none;order:0;overflow:hidden;border-radius:5px}
.reader-chapter-list .reference-chapter-art img{width:100%;height:100%;object-fit:cover}
.reader-chapter-list .reference-chapter-text{display:grid;gap:3px;flex:1;min-width:0;align-self:center}
.reader-chapter-list .reference-chapter-text>b{padding:0;font-size:12px}.reader-chapter-list .reference-chapter-text>span{display:block;width:auto;height:auto;background:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:10px}
.reader-chapter-list .reference-chapter-metrics{display:flex;gap:4px;flex-wrap:wrap;font-size:9px}.reader-chapter-list .reference-chapter-rating{font-size:9px;display:inline-flex;gap:2px}
.reader-chapter-list .reference-chapter-rating .work-stars,.reader-chapter-list .star-meter{width:auto;height:auto;background:none;overflow:visible;font-size:9px;display:inline-flex}
.reader-chapter-list .reference-chapter-side{position:static;align-self:flex-end;flex:none;font-size:9px}.reader-chapter-list .reference-read,.reader-chapter-list .reference-chapter-new{font-size:9px}
.reader-settings-panel{width:min(310px,calc(100vw - 24px));max-height:min(490px,calc(100dvh - 80px))}
.reader-settings-body{max-height:min(420px,calc(100dvh - 140px));padding:8px;display:grid;gap:6px}
details.reader-setting-group{display:block;border:0;padding:0}details.reader-setting-group summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;border-radius:7px;background:var(--raised);padding:9px;font-size:12px;font-weight:600}
details.reader-setting-group summary::-webkit-details-marker{display:none}details.reader-setting-group summary:after{content:'⌄';color:var(--muted)}details.reader-setting-group[open] summary:after{content:'⌃'}
.reader-setting-content{padding:8px 4px;display:grid;gap:9px}.reader-segment{border:0;background:transparent;justify-content:center;gap:5px}.reader-segment button{border-radius:999px;padding:6px 9px}.reader-segment button.selected{background:var(--accent-soft);color:var(--accent)}
.reader-check{display:flex;align-items:center;gap:7px;font-size:11px}.reader-check input{accent-color:var(--accent);width:15px;height:15px}
.reader-range-row{display:flex;align-items:center;gap:5px;flex:1;max-width:65%}.reader-range-row input{flex:1;min-width:0;max-width:none}.reader-range-row output{font-size:10px;min-width:32px;color:var(--accent)}
.reader-reset{font-size:11px;width:100%;min-height:29px;border-radius:999px;padding:4px}
.reader-jump-panel{width:178px;padding:0;border-radius:10px}.reader-jump-panel .reader-floating-head{padding:5px 8px;font-size:11px}.reader-jump-body{padding:8px;display:grid;gap:7px}.reader-jump-number{display:flex;align-items:center;justify-content:space-between;gap:5px}.reader-jump-number>div{display:grid;justify-items:center;flex:1;min-width:0}.reader-jump-number input{width:58px;text-align:center;appearance:textfield;-moz-appearance:textfield;padding:3px;font-size:21px;font-weight:600;border:0;background:transparent}.reader-jump-number input::-webkit-inner-spin-button,.reader-jump-number input::-webkit-outer-spin-button{appearance:none}.reader-jump-number small{font-size:9px;color:var(--muted)}.reader-jump-number .reader-tool{border:1px solid var(--border);border-radius:50%;width:25px;height:25px;min-width:25px}.reader-jump-go{width:100%;font-size:10px;min-height:27px;padding:4px 6px}
.reader-speed{position:fixed;left:50%;bottom:67px;transform:translateX(-50%);z-index:41;display:flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:5px 7px;box-shadow:0 5px 16px #0004}.reader-speed[hidden]{display:none}.reader-speed b{font-size:12px;color:var(--accent)}.reader-speed [data-action=speed-play]{background:var(--text);color:var(--surface);border-radius:50%}
.reader-team-body{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:10px}.reader-team-people{border-inline-end:1px solid var(--border);padding-inline-end:10px}.reader-team-people>div{padding:7px;background:var(--raised);border:1px solid var(--border);border-radius:7px;min-height:49px}.reader-team-people b{font-size:11px}.reader-team-people small{font-size:10px}
.reference-creators{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)!important}.reference-creator-actions{min-width:0}.reference-creator{min-height:48px}
@media(max-width:700px){body[data-reader-review=yes] .reader-bar{grid-template-columns:minmax(0,1fr) auto}.reader-team-body{grid-template-columns:1fr}.reader-team-people{border-inline-end:0;border-bottom:1px solid var(--border);padding:0 0 8px}.reader-team-people>div{min-height:46px;padding:4px;gap:3px}.reader-team-people .avatar{width:22px;height:22px}.reader-team-people b{font-size:10px}.reader-team-people small{font-size:9px}.reader-chapter-panel{width:min(300px,calc(100vw - 24px))}.reader-settings-panel{width:min(278px,calc(100vw - 24px))}.reader-speed{bottom:57px}.reference-creators{grid-template-columns:1fr!important}}

/* Chapter drawer mirrors the site sidebar on the opposite logical edge. */
body[data-reader-review=yes] .reader-chapter-panel{position:fixed;inset:0 0 0 auto;width:min(320px,88vw);height:100dvh;max-height:100dvh;max-width:100vw;border-radius:0;border:0;border-inline-start:1px solid var(--border);background:linear-gradient(160deg,var(--surface),var(--bg));display:flex;flex-direction:column;padding:10px;z-index:65;box-shadow:-8px 0 25px #0004}
html[dir=rtl] body[data-reader-review=yes] .reader-chapter-panel{inset:0 auto 0 0}
.reader-chapter-panel .reader-floating-head{flex:none;padding:8px 5px 10px}.reader-chapter-panel .reader-chapter-list{flex:1;min-height:0;max-height:none;overflow:auto;padding:6px 0;gap:5px}
.reader-chapter-panel .reference-chapter-rating .work-stars,.reader-chapter-panel .reference-chapter-rating .star-meter{color:#fbbf24!important}.reader-chapter-panel .reference-chapter-rating{color:#fbbf24}.reader-chapter-panel .reference-chapter-rating:before{content:'★';color:#fbbf24;font-size:10px}
body[data-reader-review=yes] .reader-settings-panel{width:min(276px,calc(100vw - 20px));max-height:min(360px,calc(100dvh - 100px));border-radius:10px}
.reader-settings-panel .reader-floating-head{padding:7px 9px;font-size:12px}.reader-settings-panel .reader-settings-body{padding:6px;max-height:min(315px,calc(100dvh - 145px));gap:5px;overflow:auto}
details.reader-setting-group summary{justify-content:flex-start;gap:6px;padding:8px;font-size:11px}details.reader-setting-group summary .ic{width:13px;height:13px;color:var(--accent)}details.reader-setting-group summary:after{margin-inline-start:auto}
.reader-setting-content{gap:7px;padding:6px 3px}.reader-setting-content .reader-segment button{font-size:11px;padding:5px 8px}.reader-setting-content .reader-segment button.selected{color:var(--text)}
.reader-setting-content .reader-setting-row:has(.reader-range-block){display:grid;grid-template-columns:1fr;gap:3px}.reader-range-block{display:grid;gap:3px}.reader-range-block output{text-align:end;font-size:10px;color:var(--accent)}.reader-range-block .reader-range-row{max-width:none;gap:5px}.reader-range-row .reader-tool{border:1px solid var(--border);border-radius:50%;width:21px;height:21px;min-width:21px}
.reader-range-row input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:14px;border:0;border-radius:999px;background:var(--raised);padding:0 3px;max-width:none;accent-color:var(--accent)}.reader-range-row input[type=range]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:var(--text)}.reader-range-row input[type=range]::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:var(--text);border:0}
.reader-check input{appearance:none;width:16px;height:16px;border-radius:50%;border:1px solid var(--border);background:transparent;display:grid;place-items:center;flex:none}.reader-check input:checked{background:var(--text);color:var(--bg)}.reader-check input:checked:after{content:'✓';font-size:12px;font-weight:bold}.reader-auto-note{font-size:10px;color:var(--muted)}
.reader-controls [data-action=auto-scroll].active{background:var(--accent-soft);color:var(--accent)}
@media(max-width:700px){body[data-reader-review=yes] .reader-chapter-panel{width:min(250px,72vw);padding:7px}.reader-chapter-panel .reference-chapter-art{width:65px;height:46px}.reader-chapter-panel .reference-chapter{min-height:61px!important;padding:5px!important;gap:5px!important}.reader-chapter-panel .reference-chapter-text>b{font-size:11px}.reader-chapter-panel .reference-chapter-text>span{font-size:9px}.reader-chapter-panel .reference-chapter-side{font-size:8px}body[data-reader-review=yes] .reader-settings-panel{width:min(242px,calc(100vw - 20px));max-height:min(310px,calc(100dvh - 90px))}.reader-settings-panel .reader-settings-body{max-height:min(270px,calc(100dvh - 135px))}}

.reader-chapter-panel .reference-chapter-rating .work-stars{display:none!important}.reader-chapter-panel .reference-chapter-rating:before{content:'★';color:#fbbf24}.reader-chapter-panel .reference-chapter-new{min-width:0;height:auto!important;min-height:0;padding:3px 5px!important}.reader-chapter-panel .reference-chapter-text{align-items:start;justify-items:start;text-align:start}.reader-chapter-panel .reference-chapter-metrics{justify-content:flex-start}

/* Compact reader settings: restore circular checks and clear direct choices. */
.reader-tool.is-saved{color:var(--accent);background:var(--accent-soft)}.reader-tool.is-saved svg{fill:currentColor!important}.reader-tool[hidden],.reader-page-count[hidden]{display:none!important}
.reader-settings-panel .reader-check{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:11px;line-height:1.4;min-height:23px}
.reader-settings-panel .reader-check input[type=checkbox]{appearance:none!important;-webkit-appearance:none!important;box-sizing:border-box!important;flex:0 0 17px!important;width:17px!important;min-width:17px!important;max-width:17px!important;height:17px!important;min-height:17px!important;max-height:17px!important;padding:0!important;margin:0!important;border:1px solid var(--muted)!important;border-radius:50%!important;background:transparent!important;display:grid;place-items:center;position:relative}
.reader-settings-panel .reader-check input:checked{background:var(--accent)!important;border-color:var(--accent)!important;color:white!important}.reader-settings-panel .reader-check input:checked:after{content:'✓';font-size:11px;line-height:1;color:white}
.reader-settings-panel summary:focus:not(:focus-visible){outline:none}.reader-settings-panel summary:focus-visible{outline:1px solid var(--accent);outline-offset:1px}.reader-settings-panel details summary{background:var(--raised);border:1px solid transparent}.reader-settings-panel details[open] summary{border-color:var(--border)}
.reader-settings-panel .reader-setting-content{padding:7px 4px;gap:8px}.reader-settings-panel .reader-segment button{color:var(--muted);font-weight:500}.reader-settings-panel .reader-segment button.selected{color:var(--text);background:var(--accent-soft);font-weight:600}
.reader-speed-setting{display:flex;align-items:center;justify-content:center;gap:12px;padding:2px}.reader-speed-setting output{color:var(--accent);font-size:12px;font-weight:600}.reader-speed-setting .reader-tool{border:1px solid var(--border);border-radius:50%;width:24px;height:24px;min-width:24px}
