:root{--bg:#151919;--header:#191e1d;--panel:#1c2221;--border:#2d3632;--text:#e9ede7;--muted:#89958d;--accent:#a9c4ad;--accent-strong:#c1d6bb;--accent-dark:#18231b;--stage:#111515;--page-shadow:0 8px 45px #0007;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;color-scheme:dark}
:root[data-theme=light]{--bg:#efeee9;--header:#f8f7f2;--panel:#e8e9e1;--border:#d1d7cc;--text:#252f28;--muted:#6a796f;--accent:#78947c;--accent-strong:#536d56;--accent-dark:#fff;--stage:#e0e3da;--page-shadow:0 6px 30px #33442224;color-scheme:light}
*{box-sizing:border-box}body{margin:0;height:100vh;height:100dvh;min-height:400px;display:flex;flex-direction:column;background:var(--bg);color:var(--text);font-size:13px}button,input,select{font:inherit}button,select{cursor:pointer}button{color:inherit}button:disabled,input:disabled{cursor:default;opacity:.32}button{border:0;background:none}button,a,input,select{outline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent)}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}.icon-library{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-header{min-height:79px;padding:15px 30px;display:flex;align-items:center;gap:22px;background:var(--header);border-bottom:1px solid var(--border)}.brand{display:flex;align-items:center;gap:12px;color:var(--text);text-decoration:none;font-size:21px;letter-spacing:-.7px;white-space:nowrap;font-weight:650}.brand b{font-weight:400;color:var(--accent)}.brand small{display:block;margin-top:4px;font-size:7px;letter-spacing:1.8px;font-weight:500;color:var(--muted)}.brand-mark{display:flex;align-items:center;justify-content:center;width:39px;height:39px;border-radius:11px;background:var(--accent);color:var(--accent-dark)}.brand-mark svg{width:23px;height:23px}.header-actions{display:flex;gap:9px;align-items:center;margin-left:auto}.button{display:inline-flex;align-items:center;justify-content:center;gap:9px;border:1px solid var(--border);border-radius:7px;padding:10px 14px;font-weight:550;transition:background .15s}.button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-dark)}.button.primary:hover{background:var(--accent-strong)}.button.secondary:hover{background:var(--panel)}.header-divider{height:22px;width:1px;background:var(--border);margin:0 6px}.icon-button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:33px;height:33px;border-radius:6px;color:var(--muted)}.icon-button:hover:not(:disabled){background:var(--panel);color:var(--text)}.book-info{overflow:hidden;min-width:0;display:flex;align-items:center;gap:10px;font-size:12px;margin-left:12px}.book-info #book-name{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book-count{padding:4px 6px;border:1px solid var(--border);border-radius:4px;color:var(--muted);font-size:10px;white-space:nowrap}
.reader-toolbar{display:flex;align-items:center;gap:24px;min-height:58px;padding:10px 30px;border-bottom:1px solid var(--border);background:var(--bg)}.toolbar-group{display:flex;align-items:center;gap:10px;white-space:nowrap}.toolbar-caption{font-size:11px;color:var(--muted)}.segmented{display:flex;padding:3px;border:1px solid var(--border);border-radius:7px}.segmented button{padding:5px 12px;border-radius:4px;font-size:11px;color:var(--muted)}.segmented button[aria-pressed=true]{color:var(--text);background:var(--border)}select{border:1px solid var(--border);background:transparent;color:var(--text);border-radius:5px;padding:6px 22px 6px 10px;font-size:11px}select option{background:var(--bg)}.cover-option{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);white-space:nowrap;cursor:pointer}.cover-option input{accent-color:var(--accent);width:13px;height:13px}.toolbar-spacer{flex:1}.zoom-group{gap:4px}.zoom-group select{margin-right:8px}.text-icon{color:var(--muted);width:25px;height:28px;font-size:17px;border-radius:4px}.text-icon:hover{background:var(--border);color:var(--text)}.zoom-value{font-size:10px;color:var(--muted);min-width:35px;font-variant-numeric:tabular-nums}
.reader{position:relative;flex:1;min-height:0;overflow:auto;background:var(--stage);outline:none}.welcome{max-width:1080px;margin:0 auto;height:100%;min-height:410px;display:grid;grid-template-columns:1fr 1fr;align-content:center;gap:28px 80px;padding:40px 44px 30px}.eyebrow{display:flex;align-items:center;gap:9px;color:var(--accent);font-size:9px;letter-spacing:2px;margin:0 0 23px}.eyebrow span{width:5px;height:5px;background:var(--accent);border-radius:50%}h1{font-weight:550;letter-spacing:1px;font-size:clamp(25px,2.6vw,36px);line-height:1.55;margin:0 0 17px}.welcome-description{font-size:13px;line-height:1.9;color:var(--muted);margin:0 0 28px}.button.large{padding:14px 19px;font-size:12px;gap:12px}.button.large .arrow{margin-left:10px;width:15px;height:15px}.supported{font-size:9px;letter-spacing:1px;color:var(--muted);margin:11px 0 24px}.demo-link{color:var(--accent);font-size:11px;padding:0}.demo-link:hover{text-decoration:underline}.demo-link span{margin-left:9px}.drop-card{border:1px dashed #405046;background:linear-gradient(145deg,#24332b45,transparent 80%);border-radius:12px;padding:29px 35px 22px;display:flex;flex-direction:column;align-items:center;gap:25px;color:var(--muted);transition:border .2s}.drop-card:hover{border-color:var(--accent)}.sample-book{width:100%;max-width:290px;aspect-ratio:1.4;position:relative;display:flex;transform:rotate(-4deg);box-shadow:0 15px 23px #0003;color:#626d61}.sample-page{width:50%;background:#d1d5c6;padding:12px 11px 16px;display:flex;flex-direction:column;gap:6px;position:relative}.sample-page.left{border-radius:3px 0 0 3px}.sample-page.right{background:#dde0d3;border-radius:0 3px 3px 0}.book-spine{position:absolute;left:50%;top:0;bottom:0;width:12px;transform:translateX(-50%);background:linear-gradient(90deg,transparent,#48504229,transparent)}.sample-panel{display:block;position:relative;flex:1;border:1px solid #717b6b;overflow:hidden}.skyline{background:linear-gradient(0deg,#67735f 25%,transparent 25%),repeating-linear-gradient(90deg,transparent 0 12px,#7f8975 12px 24px,transparent 24px 29px);background-size:100% 100%,100% 60%;background-position:bottom;background-repeat:no-repeat}.sample-row{display:flex;height:27%;gap:5px}.sample-row i{flex:1;border:1px solid #717b6b;background:repeating-linear-gradient(115deg,transparent 0 8px,#87937d55 8px 9px)}.lines{background:repeating-linear-gradient(160deg,transparent 0 9px,#929d8255 9px 10px)}.circle{flex:1.25;background:radial-gradient(ellipse at 45% 45%,#dce0d2 0 14%,#6d7962 15% 16%,transparent 17%),repeating-conic-gradient(from 10deg at 45% 45%,transparent 0deg 14deg,#929d8270 14deg 15deg)}.mountains{background:linear-gradient(140deg,transparent 50%,#7b8770 50% 61%,transparent 61%),linear-gradient(45deg,transparent 52%,#6d7d6155 52%)}.sample-number{position:absolute;bottom:5px;left:0;right:0;text-align:center;font-size:7px;font-family:Georgia,serif}.drop-message{display:flex;flex-direction:column;align-items:center;gap:8px}.drop-message strong{font-size:12px;font-weight:500;color:var(--text)}.drop-message>span:last-child{font-size:10px}.drop-icon{display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;border:1px solid var(--border);color:var(--accent)}.drop-icon svg{width:15px;height:15px}.welcome-features{grid-column:1/-1;display:flex;justify-content:center;gap:30px;margin-top:12px;color:var(--muted);font-size:10px}.welcome-features span{display:flex;align-items:center;gap:6px}.welcome-features svg{width:13px;height:13px;color:var(--accent)}
.spread{display:flex;justify-content:center;align-items:flex-start;width:max-content;min-width:100%;min-height:100%;padding:22px 46px;gap:2px}.page-sheet{flex:none;margin:0;position:relative;display:flex;align-items:center;justify-content:center;background:#fff;box-shadow:var(--page-shadow);overflow:hidden}.page-sheet img{display:block;width:100%;height:100%;object-fit:contain}.page-error{padding:25px;color:#5c5c5c;text-align:center;font-size:12px;line-height:1.8;overflow-wrap:anywhere}.page-sheet.loading::after{content:"読み込み中…";position:absolute;top:50%;left:0;right:0;text-align:center;color:#8a8a8a;font-size:12px}.edge-nav{position:absolute;top:calc(50% - 22px);width:34px;height:44px;background:var(--bg);color:var(--muted);border:1px solid var(--border);border-radius:6px;opacity:0;z-index:2;display:flex;align-items:center;justify-content:center;transition:opacity .2s}.edge-left{left:9px;margin:0}.edge-right{right:9px;margin:0}.reader:hover .edge-nav,.edge-nav:focus-visible{opacity:.85}.drop-overlay{position:fixed;inset:12px;border:2px dashed var(--accent);border-radius:12px;background:#141e19f2;color:#e7eee5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;z-index:20;pointer-events:none}.drop-overlay svg{width:42px;height:42px}.drop-overlay strong{font-size:22px}.drop-overlay span{color:#a4b5a8}
.navigation{flex:none;padding:12px 30px 14px;border-top:1px solid var(--border);background:var(--header)}.navigation-top{display:grid;grid-template-columns:1fr auto 1fr;gap:20px;align-items:center;margin-bottom:7px}.reading-status{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:10px}.status-dot{width:5px;height:5px;flex:none;border-radius:50%;background:var(--accent)}.page-control{display:flex;align-items:center;gap:22px}.page-label{min-width:110px;text-align:center;font-size:15px;letter-spacing:.5px;font-variant-numeric:tabular-nums}.page-label span{font-size:11px;color:var(--muted);margin-left:5px}.page-jump{justify-self:end;display:flex;align-items:center;gap:7px;color:var(--muted);font-size:10px}.page-jump input{width:50px;background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:5px;color:var(--text);font-size:11px;appearance:textfield;-moz-appearance:textfield;text-align:center}.page-jump input::-webkit-inner-spin-button{appearance:none}.page-jump button{color:var(--muted);font-size:10px;border:1px solid var(--border);border-radius:4px;padding:5px 7px}.timeline{display:flex;align-items:center;gap:14px}.timeline>span{color:var(--muted);font-size:9px;min-width:20px}.page-slider{width:100%;height:5px;appearance:none;-webkit-appearance:none;border-radius:10px;background:linear-gradient(to left,var(--accent) 0%,var(--accent) var(--progress,0%),var(--border) var(--progress,0%),var(--border) 100%);cursor:pointer}.page-slider[dir=ltr]{background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--progress,0%),var(--border) var(--progress,0%),var(--border) 100%)}.page-slider::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:12px;height:12px;background:var(--accent);border-radius:50%;border:2px solid var(--header);box-shadow:0 0 0 1px var(--accent)}.page-slider::-moz-range-thumb{width:9px;height:9px;background:var(--accent);border-radius:50%;border:2px solid var(--header)}.navigation-bottom{display:flex;justify-content:space-between;gap:15px;font-size:9px;color:var(--muted);margin-top:11px}#file-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:65%}.keyboard-hint{white-space:nowrap;display:flex;align-items:center;gap:5px}kbd{font:9px inherit;background:var(--panel);border:1px solid var(--border);padding:1px 4px;border-radius:3px}.keyboard-hint i{font-style:normal;margin:0 4px}
.thumbnails{flex:none;border-top:1px solid var(--border);background:var(--bg);padding:5px 25px 13px;height:172px}.thumbnail-header{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:10px}.thumbnail-header .icon-button{width:26px;height:26px}.thumbnail-header svg{width:15px;height:15px}.thumbnail-list{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;height:120px;padding:5px;scrollbar-width:thin}.thumbnail{flex:0 0 68px;height:107px;padding:3px;border:1px solid transparent;border-radius:4px;color:var(--muted);font-size:9px}.thumbnail img{display:block;width:60px;height:83px;object-fit:contain;background:var(--panel);margin:0 auto 4px;border-radius:2px}.thumbnail.active{border-color:var(--accent);color:var(--accent)}.thumbnail:hover{background:var(--panel)}.toast{position:fixed;bottom:140px;left:50%;transform:translateX(-50%);background:var(--text);color:var(--bg);border-radius:7px;padding:12px 18px;max-width:min(90vw,500px);font-size:12px;z-index:50;box-shadow:0 5px 30px #0004;text-align:center}dialog{background:var(--header);color:var(--text);border:1px solid var(--border);border-radius:12px;max-width:400px;padding:25px}dialog::backdrop{background:#0009}dialog h2{font-size:17px}dialog p{color:var(--muted);line-height:1.8}
@media(min-width:1500px){.welcome{max-width:1200px;gap:35px 110px}.drop-card{padding:35px 40px}.sample-book{max-width:330px}}
@media(max-width:1050px){.reader-toolbar{gap:14px;padding-inline:20px}.app-header{padding-inline:20px}.book-info{margin-left:0}.book-info #book-name{max-width:150px}.brand small{display:none}.brand{font-size:19px}.welcome{gap:25px 45px;padding-inline:35px}.cover-option{font-size:10px}.toolbar-caption{display:none}}
@media(max-width:760px){body{min-height:350px}.app-header{min-height:65px;padding:12px 16px;gap:10px}.brand-mark{width:31px;height:31px;border-radius:8px}.brand{gap:8px;font-size:17px}.header-actions{gap:5px}.header-actions .button{padding:8px 9px}.header-actions .secondary span{display:none}.header-actions .primary span{font-size:10px}.header-actions .button svg{width:16px;height:16px}.header-divider{display:none}.header-actions .icon-button{width:27px}.book-info{display:none}.reader-toolbar{padding:9px 12px;min-height:54px;gap:9px;flex-wrap:wrap}.segmented button{padding:4px 8px;font-size:10px}.toolbar-group{gap:4px}.cover-option{order:5}.toolbar-spacer{display:none}.zoom-group{margin-left:auto}.zoom-group select{max-width:115px;margin-right:1px}.text-icon{width:20px}.reader-toolbar>.icon-button{width:26px}.welcome{grid-template-columns:1fr;min-height:650px;height:auto;padding:35px 28px;gap:30px;text-align:center;max-width:530px}.welcome .eyebrow{justify-content:center;margin-bottom:15px}h1{font-size:29px}.welcome-description{font-size:12px;margin-bottom:22px}.drop-card{max-width:345px;width:100%;margin:auto;padding:22px;gap:17px}.sample-book{max-width:210px}.welcome-features{gap:12px;flex-wrap:wrap;margin-top:0}.supported{margin-bottom:16px}.navigation{padding:9px 16px 12px}.navigation-top{gap:8px}.reading-status{max-width:115px;font-size:9px;line-height:1.6}.page-control{gap:6px}.page-label{min-width:82px;font-size:13px}.page-jump label{display:none}.page-jump{gap:4px}.page-jump input{width:37px}.keyboard-hint{display:none}#file-label{max-width:100%;font-size:8px}.navigation-bottom{margin-top:10px}.spread{padding:14px 10px}.edge-nav{display:none}.timeline{gap:9px}.thumbnails{padding-inline:12px;height:160px}.thumbnail-list{height:113px}.thumbnail{flex-basis:60px}.thumbnail img{width:52px;height:75px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

@media(max-height:600px){.thumbnails{position:fixed;bottom:110px;left:0;right:0;height:150px;z-index:5;box-shadow:0 -10px 35px #0005}.thumbnail-list{height:110px}.thumbnail img{height:72px}.welcome{align-content:start}}

.top-chrome{flex:none;z-index:12}
.has-book .top-chrome{position:fixed;top:0;left:0;right:0}
.has-book .navigation{position:fixed;bottom:0;left:0;right:0;z-index:12}
.has-book .thumbnails{position:fixed;left:0;right:0;bottom:var(--footer-height,105px);z-index:10}
.has-book .reader{margin:0}
.top-chrome,.navigation,.thumbnails{transition:transform .16s ease,opacity .16s ease,visibility .16s}
.chrome-hidden .top-chrome{transform:translateY(-100%);opacity:0;visibility:hidden;pointer-events:none}
.chrome-hidden .navigation,.chrome-hidden .thumbnails{transform:translateY(calc(100% + var(--footer-height,105px)));opacity:0;visibility:hidden;pointer-events:none}
.has-book.chrome-hidden .reader{cursor:none}
.has-book.chrome-hidden.video-mode .reader{cursor:default}
.chrome-hidden .reader:hover .edge-nav{opacity:0}
.chrome-hidden .reader .edge-nav:focus-visible{opacity:.85}
.page-sheet{-webkit-touch-callout:none}
.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.dialog-heading h2{margin:0}
.import-choice-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.import-choice-actions .button{flex:1;justify-content:center;min-height:42px;white-space:nowrap}
.hide-controls{padding:6px 10px;font-size:10px}.speech-panel-top>.button{margin-left:auto;padding:5px 9px;font-size:10px}.speech-panel-top>.button+.icon-button{margin-left:0}
.settings-notice{position:sticky;top:0;z-index:2;padding:12px;margin:12px 0;background:var(--panel);border:1px solid var(--accent);border-radius:7px;color:var(--text);font-size:12px;font-weight:600;line-height:1.7;box-shadow:0 3px 12px #0002}
.voice-preview-status[data-state=success],.settings-notice[data-state=success]{color:var(--accent)}.voice-preview-status[data-state=error],.settings-notice[data-state=error]{color:#e2a39b}.settings-notice[data-state=error]{border-color:#e2a39b}:root[data-theme=light] .voice-preview-status[data-state=error],:root[data-theme=light] .settings-notice[data-state=error]{color:#a33e3a}
.reading-options-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:22px;padding-top:18px;border-top:1px solid var(--border)}.reading-options-footer>span{font-size:11px;color:var(--muted)}
.folder-drop-instruction{display:flex;flex-direction:column;align-items:center;gap:13px;border:1px dashed var(--accent);border-radius:8px;padding:23px 16px;margin-top:20px;text-align:center}.folder-drop-instruction>svg{width:35px;height:35px;color:var(--accent)}.folder-drop-instruction strong{font-size:13px;font-weight:500}.folder-drop-instruction span{font-size:11px;color:var(--muted);line-height:1.8}
.folder-loading { position:fixed;left:50%;bottom:calc(var(--footer-height,105px) + 12px);transform:translateX(-50%);z-index:25;display:flex;align-items:center;gap:13px;width:calc(100% - 32px);max-width:620px;padding:12px 14px;border:1px solid var(--accent);border-radius:10px;background:var(--header);color:var(--text);box-shadow:0 6px 28px #0003; }
.history-mode .folder-loading,.chrome-hidden .folder-loading { bottom:16px; }
.folder-loading-spinner { width:17px;height:17px;flex:none;border:2px solid var(--accent);border-right-color:transparent;border-radius:50%;animation:folder-loading-spin .9s linear infinite; }
.speech-wait { position:fixed;right:16px;bottom:calc(var(--footer-height,105px) + 12px);z-index:24;display:flex;align-items:center;gap:10px;width:min(440px,calc(100% - 32px));padding:10px 13px;border:1px solid var(--border);border-radius:9px;background:var(--header);color:var(--text);box-shadow:0 4px 18px #0003;pointer-events:none; }
.chrome-hidden .speech-wait { bottom:16px; }
.speech-wait-body { flex:1;min-width:0; }
.speech-wait strong { display:block;margin-bottom:3px;color:var(--accent);font-size:11px; }
#speech-wait-status { display:block;font-size:11px;line-height:1.6;overflow-wrap:anywhere; }
.speech-wait small { flex:none;color:var(--muted);font-size:10px; }
.speech-wait-meter { display:flex;align-items:center;gap:10px;margin-top:8px; }
#speech-wait-progress { display:block;flex:1;min-width:30px;width:100%;height:5px;border:0;border-radius:99px;overflow:hidden;background:var(--border);color:var(--accent);appearance:none; }
#speech-wait-progress::-webkit-progress-bar { border-radius:99px;background:var(--border); }
#speech-wait-progress::-webkit-progress-value { border-radius:99px;background:var(--accent); }
#speech-wait-progress::-moz-progress-bar { border-radius:99px;background:var(--accent); }
#speech-wait-progress:not([value])::-webkit-progress-bar { background:linear-gradient(90deg,var(--border) 0%,var(--accent) 45%,var(--border) 75%);background-size:200% 100%;animation:folder-loading-indeterminate 1.4s linear infinite; }
#speech-wait-percent,#speech-wait-elapsed { color:var(--muted);font-size:10px;font-variant-numeric:tabular-nums; }
#speech-wait-percent { flex:none;min-width:42px;text-align:right;white-space:nowrap; }
#speech-wait-elapsed { display:block;margin-top:6px; }
.speech-wait-live { display:block;margin-top:4px;color:var(--muted);font-size:10px;line-height:1.5;font-variant-numeric:tabular-nums; }
.speech-start-note { margin:8px 0 0;color:var(--muted);font-size:11px;line-height:1.7; }
#speech-first-page-note { font-size:10px; }
.folder-loading-body { flex:1;min-width:0; }
#folder-loading-status { min-width:0;margin:0;font-size:11px;line-height:1.8;overflow-wrap:anywhere; }
.folder-loading-meter { display:flex;align-items:center;gap:10px;margin-top:7px; }
#folder-loading-progress { display:block;flex:1;min-width:24px;width:100%;height:5px;border:0;border-radius:99px;overflow:hidden;background:var(--border);color:var(--accent);appearance:none; }
#folder-loading-progress::-webkit-progress-bar { border-radius:99px;background:var(--border); }
#folder-loading-progress::-webkit-progress-value { border-radius:99px;background:var(--accent); }
#folder-loading-progress::-moz-progress-bar { border-radius:99px;background:var(--accent); }
#folder-loading-progress:not([value])::-webkit-progress-bar { background:linear-gradient(90deg,var(--border) 0%,var(--accent) 45%,var(--border) 75%);background-size:200% 100%;animation:folder-loading-indeterminate 1.4s linear infinite; }
#folder-loading-percent { flex:none;min-width:30px;color:var(--muted);font-size:10px;line-height:1.4;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums; }
#folder-loading-bytes { margin:7px 0 0;color:var(--muted);font-size:10px;line-height:1.6;font-variant-numeric:tabular-nums;overflow-wrap:anywhere; }
.folder-load-cancel { flex:none;min-height:34px;padding:7px 13px;border:1px solid var(--border);border-radius:6px;background:var(--panel);color:var(--accent);font-size:11px;line-height:1.6; }
.folder-load-cancel:hover:not(:disabled) { border-color:var(--accent);background:var(--border); }
@keyframes folder-loading-spin { to { transform:rotate(360deg); } }
@keyframes folder-loading-indeterminate { to { background-position:-200% 0; } }
@media(max-width:760px) { .folder-loading { gap:10px;width:calc(100% - 24px);padding:10px 11px; }#folder-loading-status { font-size:10px; }.folder-load-cancel { padding-inline:11px;font-size:10px; } }
@media(prefers-reduced-motion:reduce) { .folder-loading-spinner,#folder-loading-progress:not([value])::-webkit-progress-bar,#speech-wait-progress:not([value])::-webkit-progress-bar { animation:none; } }
@media(prefers-reduced-motion:reduce){.top-chrome,.navigation,.thumbnails{transition:none}}

/* The history shelf follows the reference library's green surfaces and cover grid. */
.speech-toggle { padding:5px 9px;font-size:10px; }
.speech-toggle[aria-expanded=true] { background:var(--accent);border-color:var(--accent);color:var(--accent-dark); }
.speech-toggle[aria-expanded=true]:hover { background:var(--accent-strong);border-color:var(--accent-strong); }
:root[data-theme=light] .speech-toggle[aria-expanded=true] { background:var(--accent-strong);border-color:var(--accent-strong); }
#reading-options-dialog { width:min(calc(100vw - 40px),1080px);max-width:none;max-height:88vh;max-height:88dvh;padding:0;overflow:hidden; }
#reading-options-dialog[open] { display:flex;flex-direction:column; }
#reading-options-dialog>.dialog-heading { flex:none;padding:20px 24px;border-bottom:1px solid var(--border); }
#reading-options-dialog .dialog-heading h2 { font-size:19px; }
.reading-options-tabs { display:flex;flex:none;gap:4px;padding:8px 20px 0;border-bottom:1px solid var(--border);overflow-x:auto; }
.reading-options-tab { flex:none;min-height:40px;padding:8px 14px;border:0;border-bottom:3px solid transparent;background:transparent;color:var(--muted);font:inherit;font-size:12px;cursor:pointer; }
.reading-options-tab[aria-selected=true] { color:var(--accent);border-bottom-color:var(--accent);font-weight:700; }
.reading-options-tab:focus-visible { outline:2px solid var(--accent);outline-offset:-3px; }
.reading-options-setup-panel { max-width:880px;margin-inline:auto; }
.reading-options-setup-panel h3 { margin:0 0 14px;font-size:16px; }
.reading-options-body .reading-setup-intro { margin:0 0 20px;color:var(--text);font-size:13px; }
.reading-setup-guide { margin:20px 0;padding:16px;border:1px solid var(--border);border-radius:10px;background:var(--bg); }
.reading-setup-guide h4 { margin:0 0 12px;font-size:14px;color:var(--text); }
.reading-setup-guide ul,.reading-setup-guide ol,.reading-setup-save-step ol { margin:12px 0;padding-inline-start:22px;font-size:13px;line-height:1.8; }
.reading-setup-guide li,.reading-setup-save-step li { margin-block:8px;overflow-wrap:anywhere; }
.reading-setup-guide a,.reading-setup-next-steps a { color:var(--accent);text-decoration:underline;text-underline-offset:.2em; }
:root[data-theme=light] .reading-setup-guide a,:root[data-theme=light] .reading-setup-next-steps a { color:var(--accent-strong); }
.reading-options-body .reading-setup-next-steps { margin-block:14px 0;font-size:13px;line-height:1.8; }
.reading-setup-restart-notice { margin-block:14px;padding:12px;border:1px solid #e2a39b;border-inline-start-width:4px;border-radius:7px;background:var(--bg);font-size:12px;line-height:1.8; }
.reading-setup-restart-notice>strong { display:block;color:#e2a39b; }
.reading-options-body .reading-setup-restart-notice>p { margin-block:8px 0; }
:root[data-theme=light] .reading-setup-restart-notice { border-color:#a33e3a; }
:root[data-theme=light] .reading-setup-restart-notice>strong { color:#a33e3a; }
.reading-setup-jump-target { scroll-margin-block:12px; }
.reading-setup-jump-target:focus { outline:2px solid var(--accent);outline-offset:4px; }
.reading-setup-step-heading { display:flex;align-items:center;gap:10px;margin:20px 0 14px;font-size:14px;font-weight:650; }
.reading-setup-step-heading>span { display:inline-flex;align-items:center;justify-content:center;flex:none;width:25px;height:25px;border-radius:50%;background:var(--panel);border:1px solid var(--border);color:var(--accent);font-size:12px; }
.reading-setup-step-top { display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:20px 0 10px; }
.reading-setup-step-top .reading-setup-step-heading { margin:0; }
.reading-setup-selection-actions { display:flex;flex-wrap:wrap;gap:8px; }
.reading-setup-selection-actions .button { min-height:38px;padding:8px 13px;font-size:12px; }
.reading-options-body .reading-setup-selection-help { margin:10px 0 16px; }
.reading-setup-groups { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px; }
.reading-setup-group { min-width:0;margin:0;padding:14px;border:1px solid var(--border);border-radius:10px; }
.reading-setup-group legend { padding:0 6px;color:var(--text);font-size:13px;font-weight:650; }
.reading-setup-choice { display:flex;align-items:flex-start;gap:11px;min-height:64px;margin:0 0 10px;padding:11px 12px;border:1px solid var(--border);border-radius:7px;background:var(--bg);cursor:pointer; }
.reading-setup-choice:last-child { margin-bottom:0; }
.reading-setup-choice input { flex:none;width:18px;height:18px;margin:2px 0 0;accent-color:var(--accent); }
.reading-setup-choice>span { display:grid;gap:5px;min-width:0;overflow-wrap:anywhere; }
.reading-setup-choice strong { color:var(--text);font-size:13px;font-weight:650; }
.reading-setup-choice small { color:var(--muted);font-size:11px;line-height:1.6; }
.reading-setup-choice:has(input:checked) { border-color:var(--accent);background:var(--panel);box-shadow:inset 3px 0 0 var(--accent); }
.reading-setup-choice:has(input:focus-visible) { outline:2px solid var(--accent);outline-offset:3px; }
.reading-setup-choice:has(input:disabled) { cursor:default;opacity:.55; }
.reading-options-body .reading-setup-voice-note { margin:14px 2px 0; }
.reading-options-body .reading-setup-summary { margin:14px 0 10px;padding:11px 13px;border-radius:7px;background:var(--bg);color:var(--text); }
.reading-setup-save-step { margin-top:24px;padding-top:20px;border-top:1px solid var(--border); }
.reading-setup-save-step .reading-setup-step-heading { margin-top:0; }
.reading-options-body .reading-setup-first-help { color:#e2a39b;font-weight:650; }
:root[data-theme=light] .reading-options-body .reading-setup-first-help { color:#a33e3a; }
.reading-setup-save-step .voice-preview-actions { margin-top:14px; }
.reading-setup-save-step .voice-preview-actions .button { min-height:44px;padding:10px 15px;font-size:12px; }
.reading-setup-results{list-style:none;padding:0;margin:12px 0;font-size:12px;line-height:1.8}.reading-setup-results li{padding:7px 10px;border-inline-start:3px solid var(--border);margin-block:6px;background:var(--bg);overflow-wrap:anywhere}.reading-setup-results li[data-state=ready]{border-color:var(--accent)}.reading-setup-results li[data-state=error],.reading-setup-results li[data-state=missing]{border-color:#e2a39b}.reading-setup-results [hidden]{display:none}#local-helper-return-settings{margin-top:14px}#reading-setup-use-ocr{min-height:44px}
@media(max-width:760px){.reading-setup-groups { grid-template-columns:minmax(0,1fr);gap:18px; }.reading-setup-group { padding:12px; }.reading-setup-selection-actions .button { min-height:44px; }.reading-setup-save-step .voice-preview-actions .button { width:100%;white-space:normal; }}
.reading-options-columns[hidden],.reading-options-setup-panel[hidden] { display:none; }
.reading-options-body { flex:1;min-height:0;overflow:auto;padding:20px 24px;overscroll-behavior:contain;scrollbar-width:thin; }
.reading-options-columns { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start; }
.reading-options-column { display:grid;gap:18px;min-width:0;align-content:start; }
.helper-management-info { margin:12px 0; }
.helper-management-info dt { margin-top:10px;font-weight:650; }
.helper-management-info dd { margin:3px 0;overflow-wrap:anywhere;white-space:pre-line;user-select:text; }
#local-helper-management-remove-files,#local-helper-management-retained-files { overflow-wrap:anywhere; }
.reading-options-body .voice-preview-settings { margin:0;padding:16px 18px; }
.reading-options-body .voice-preview-settings legend { font-size:14px; }
.reading-options-body p { font-size:12px;line-height:1.7;margin:8px 0;overflow-wrap:anywhere; }
.reading-options-body .reading-option { margin:12px 0; }
.reading-options-body .reading-option select { max-width:100%;margin-left:auto; }
.reading-options-body .local-engine-setup { margin:14px 0;padding:14px; }
.reading-options-body .voice-preview-status { min-height:0; }
.reading-options-body .settings-notice { margin:0 0 18px; }
.reading-options-body .voice-setup-help { margin:12px 0 0; }
.ollama-permission-setup { margin-top:16px;padding-top:14px;border-top:1px solid var(--border); }
.ollama-permission-setup ol { padding-inline-start:20px;font-size:12px;line-height:1.8;color:var(--muted); }
#reading-options-dialog>.reading-options-footer { flex:none;margin:0;padding:14px 24px;border-top:1px solid var(--border);background:var(--header); }
@media(max-width:760px){#reading-options-dialog { width:calc(100vw - 20px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px); }#reading-options-dialog>.dialog-heading { padding:16px; }.reading-options-body { padding:16px; }.reading-options-columns { grid-template-columns:minmax(0,1fr);gap:18px; }.reading-options-body .voice-preview-settings { padding:14px; }#reading-options-dialog>.reading-options-footer { padding:12px 16px; }}
.voice-preview-settings { margin:24px 0 0;padding:14px 16px 10px;border:1px solid var(--border);border-radius:8px;min-width:0; }
.voice-preview-settings legend { font-size:12px;font-weight:600;color:var(--accent);padding:0 6px; }.voice-preview-settings select { max-width:100%; }.voice-preview-settings .reading-option { margin-top:12px; }.voice-preview-actions { display:flex;flex-wrap:wrap;gap:8px;margin-top:16px; }.voice-preview-actions .button { font-size:11px;padding:8px 11px; }.voice-preview-status { min-height:1.8em;font-size:11px;line-height:1.8;color:var(--muted); }
.voice-setup-help { font-size:11px;line-height:1.8;color:var(--muted); }.voice-setup-help summary { cursor:pointer; }.voice-setup-help p { margin:8px 0; }
.local-engine-setup { margin:14px 0;padding:12px;background:var(--bg);border-radius:6px;font-size:11px;line-height:1.8; }.local-engine-setup strong { color:var(--accent);font-size:12px; }.local-engine-setup a { color:var(--accent);text-underline-offset:3px; }.local-engine-setup .button { font-size:11px;padding:8px 11px; }
.speech-panel { padding:12px 25px 15px;border-top:1px solid var(--border);background:var(--header);max-height:min(58vh,430px);overflow:auto; }
.speech-panel-top { display:flex;align-items:center;gap:12px;font-size:12px; }.speech-panel-top>span { color:var(--muted);font-size:10px; }.speech-panel-top>.icon-button { margin-left:auto;width:27px;height:27px; }
.speech-controls { display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px; }.speech-controls .button { padding:7px 11px;font-size:11px; }.speech-controls label { display:flex;align-items:center;gap:6px;color:var(--muted);font-size:10px; }.speech-controls select { max-width:220px; }.speech-check { cursor:pointer; }.speech-check input { accent-color:var(--accent); }
.speech-status { font-size:11px;color:var(--accent);margin:10px 0;line-height:1.8; }.speech-panel details summary { color:var(--muted);font-size:11px;cursor:pointer; }.speech-text-actions { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0;font-size:10px;color:var(--muted); }.speech-text-actions .button { font-size:10px; }.speech-panel textarea { width:100%;min-height:90px;max-height:190px;resize:vertical;border:1px solid var(--border);border-radius:5px;padding:10px;background:var(--bg);color:var(--text);font:12px/1.8 sans-serif; }.reading-option { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:20px 0 10px;font-size:12px; }.reading-option input { accent-color:var(--accent); }
.speech-volume-slider { width:140px;max-width:40vw;accent-color:var(--accent);cursor:pointer; }.speech-volume-control output,.reading-option output { min-width:4em;text-align:right;font-variant-numeric:tabular-nums;color:var(--text); }
.page-sheet.speech-current { outline:2px solid #91ad96;outline-offset:2px; }.page-sheet.text-sheet { background:#faf8ef;color:#34372f;overflow:hidden; }.text-page { height:100%;width:100%;padding:7%;display:flex;flex-direction:column;font-family:'Hiragino Mincho ProN','Yu Mincho',serif; }.text-page h1,.text-page h2 { margin:0 0 .6em;font:600 1.15em/1.5 serif; }.text-page .text-page-author { font-size:.8em;margin:0 0 1em; }.text-page-body { flex:1;min-width:0;min-height:0;width:100%;overflow:auto;line-height:1.8;letter-spacing:.035em;white-space:pre-wrap;scrollbar-width:thin;writing-mode:vertical-rl;text-orientation:mixed; }.text-page-header { flex:none;min-height:0;max-height:35%;overflow:auto;scrollbar-width:thin; }.text-page-body[data-overflow=true],.text-page-header[data-overflow=true] { overscroll-behavior:contain; }.text-page-body:focus-visible,.text-page-header:focus-visible { outline:2px solid #78947c;outline-offset:2px; }.text-fitting .text-page-body { overflow:hidden; }.text-horizontal .text-page-body { writing-mode:horizontal-tb; }.text-page-body p { margin:0 0 1em; }.text-page ruby { ruby-position:over; }.text-page rt { font-size:.5em; }.text-thumbnail { display:flex;align-items:center;justify-content:center;width:60px;height:83px;overflow:hidden;background:#faf8ef;color:#34372f;font:12px/1.5 serif;border:1px solid var(--border);padding:7px; }.text-thumbnail span { overflow:hidden;max-height:100%; }
@media(max-width:760px){.speech-panel { padding:10px 12px; }.speech-controls { gap:7px; }.speech-controls select { max-width:160px; }.speech-toggle span { display:none; }.speech-toggle { padding:5px; }.speech-panel-top>span { font-size:9px; }}
body.history-mode .speech-panel { display:none!important; }
.speech-cast-panel { border-top:1px solid var(--border);margin-top:12px;padding-top:12px; }
.cast-roles { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:10px;margin:12px 0; }
.cast-role-row { display:grid;grid-template-columns:minmax(90px,1fr) minmax(120px,1.4fr);gap:8px;padding:10px;border:1px solid var(--border);border-radius:6px;background:var(--bg); }
.cast-role-row input,.cast-role-row select,.speech-cast-panel .reading-option input,.speech-cast-panel select { min-width:0;max-width:100%;border:1px solid var(--border);border-radius:5px;background:var(--bg);color:var(--text);padding:7px;font:12px/1.5 sans-serif; }
.cast-role-row small { grid-column:1/-1;color:var(--muted);font-size:10px;line-height:1.6; }
.cast-lines { margin:10px 0;padding-left:25px;max-height:220px;overflow:auto; }
.cast-unit-row { margin-bottom:10px;line-height:1.7;font-size:12px; }
.cast-unit-row span { white-space:pre-wrap;display:inline-block;max-width:70%;vertical-align:middle;margin-right:12px; }
.cast-unit-row small { display:block;color:var(--muted); }
.speech-cast-panel p { font-size:11px;line-height:1.8; }
@media(max-width:520px){.cast-unit-row span { display:block;max-width:100%;margin-right:0; }.cast-unit-row select{width:100%;}}
.history-view {
  --shelf-bg:#171f1b;--shelf-surface:#212c25;--shelf-raised:#253029;
  --shelf-text:#e2ebe2;--shelf-muted:#a3b1a5;--shelf-line:#3a473d;
  --shelf-accent:#9ed0aa;--shelf-soft:#304334;--shelf-hover:#29372d;
  --shelf-accent-border:#56785a;--shelf-primary-text:#18251e;--shelf-cover-line:#f3fff014;
  flex:1;min-height:0;overflow:auto;background:var(--shelf-bg);color:var(--shelf-text);outline:none;
}
:root[data-theme=light] .history-view {
  --shelf-bg:#f3f5f1;--shelf-surface:#fff;--shelf-raised:#fbfcf9;
  --shelf-text:#24382f;--shelf-muted:#66746a;--shelf-line:#e2e9df;
  --shelf-accent:#246348;--shelf-soft:#eaf3e8;--shelf-hover:#f4f8f1;
  --shelf-accent-border:#b7d2ba;--shelf-primary-text:#fff;--shelf-cover-line:#26372714;
}
body.history-mode .top-chrome { position:relative;transform:none;opacity:1;visibility:visible;pointer-events:auto;transition:none; }
body.history-mode #history-toggle { display:none; }
body.history-mode :is(#reader,.reader-toolbar,.navigation,.thumbnails) { display:none!important; }
.history-toggle[aria-pressed=true] { color:var(--accent);border-color:var(--accent);background:var(--panel); }
.header-actions { flex-wrap:wrap;justify-content:flex-end;min-width:0;max-width:100%; }
.header-actions>button { flex:none; }
#library-share-open span { display:inline;white-space:nowrap; }
@media(max-width:760px) { #library-share-open span { font-size:10px; } }
.history-layout { max-width:1440px;margin:0 auto;padding:20px 38px 30px; }
.history-page-nav { display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px; }
.history-local-label { display:inline-flex;align-items:center;gap:8px;color:var(--shelf-muted);font-size:11px; }
.history-local-label>span[aria-hidden] { width:6px;height:6px;border-radius:50%;background:var(--shelf-accent); }
.history-page-nav { flex-wrap:wrap; }
.history-page-actions { display:flex;flex-wrap:wrap;gap:8px; }
.history-library-context { display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;min-width:0; }
.history-local-label { min-width:0;overflow-wrap:anywhere; }
.history-share-status { margin:0;padding:7px 11px;border:1px solid var(--shelf-accent-border);border-radius:7px;background:var(--shelf-soft);color:var(--shelf-text);font-size:12px;font-weight:650;line-height:1.6;overflow-wrap:anywhere; }
.history-library-switch { display:flex;align-items:stretch;padding:3px;gap:3px;border:1px solid var(--shelf-line);border-radius:8px;background:var(--shelf-surface); }
.history-library-switch button { min-height:36px;padding:8px 12px;border-radius:5px;color:var(--shelf-muted);font-size:11px;font-weight:600;line-height:1.6; }
.history-library-switch button:hover { background:var(--shelf-soft);color:var(--shelf-text); }
.history-library-switch button[aria-pressed=true] { background:var(--shelf-accent);color:var(--shelf-primary-text); }
.history-sharing-hint { margin:-4px 0 16px;color:var(--shelf-muted);font-size:11px;line-height:1.8; }
.share-host-presence { display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 16px;padding:12px 14px;border:1px solid var(--border);border-radius:8px;background:var(--panel); }
.share-host-presence-status { flex:1 1 280px;min-width:0;margin:0;font-size:13px;font-weight:650;line-height:1.8;overflow-wrap:anywhere; }
.share-host-presence-status[data-state=sharing] { color:var(--accent-strong); }
.share-host-presence .button { min-height:40px; }
.video-mode .reader-toolbar,.video-mode .navigation,.video-mode #speech-panel,.video-mode #thumbnails { display:none; }
.video-sheet { position:relative;overflow:hidden;background:#000;border:0;box-shadow:none; }
.video-player { display:block;width:100%;height:100%;object-fit:contain;background:#000; }
.video-status { position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:calc(100% - 40px);margin:0;padding:12px 16px;color:#fff;background:rgb(0 0 0 / .8);border-radius:8px;font-size:14px;line-height:1.7;pointer-events:none; }
.video-status[hidden] { display:none; }
#library-share-dialog { width:min(1180px,calc(100vw - 32px));max-width:none;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);padding:24px;overflow:auto;overscroll-behavior:contain; }
#library-share-dialog::backdrop { overflow:hidden;overscroll-behavior:contain; }
.library-share-heading { display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px; }
#library-share-dialog .library-share-heading h2 { margin:0;font-size:20px; }
#library-share-dialog .history-dialog-description { font-size:13px; }
#library-share-dialog .history-dialog-hint,#library-share-dialog .voice-preview-status { font-size:12px;line-height:1.8;overflow-wrap:anywhere; }
.library-share-modes { display:flex;flex-wrap:wrap;gap:10px;margin-top:16px; }
.library-share-modes .button { min-height:44px; }
.library-share-columns { display:grid;grid-template-columns:minmax(0,1fr);gap:24px;margin:20px 0; }
.library-share-columns>section[hidden] { display:none!important; }
.library-share-columns>section { min-width:0;padding:20px;border:1px solid var(--border);border-radius:10px; }
.library-share-columns h3 { margin:0 0 12px;font-size:17px;line-height:1.5; }
.library-share-columns .history-field-label { margin-top:14px;font-size:12px; }
.library-share-columns .button { margin-top:10px; }
.library-share-columns textarea { resize:vertical; }
.library-share-columns progress { width:100%;margin-top:12px;accent-color:var(--accent); }
.share-trust-choice { display:flex;align-items:center;gap:10px;margin-top:18px;font-size:13px;line-height:1.6; }
.share-trust-choice input { flex:none;accent-color:var(--accent); }
.share-otp-input { max-width:240px;font-size:22px;letter-spacing:.24em;font-variant-numeric:tabular-nums; }
.share-security-panel { margin-top:22px;padding:18px;border:1px solid var(--border);border-radius:10px; }
.share-auth-qr { display:block;width:min(256px,100%);height:auto;margin:16px 0;border:8px solid white;background:white;image-rendering:pixelated; }
.share-security-devices { display:grid;gap:10px; }
.share-device-row { display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:8px; }
.share-device-detail { min-width:0;flex:1;overflow-wrap:anywhere; }
.share-device-detail p { margin:4px 0;font-size:12px;line-height:1.7; }
.share-device-row .button { flex:none;min-height:44px;margin:0; }
.share-devices-heading { margin-top:24px!important; }
.share-rotate-panel { margin-top:22px;padding-top:18px;border-top:1px solid var(--border); }
.share-rotate-panel h4 { margin:0 0 8px;font-size:14px;line-height:1.5; }
.share-rotate-confirmation { margin-top:12px;padding:12px;border:1px solid var(--accent);border-radius:8px; }
.share-rotate-confirmation[hidden] { display:none; }
.share-start-actions { display:flex;flex-wrap:wrap;gap:8px; }
.share-host-addresses { margin-top:18px;padding:16px;border:1px solid var(--accent);border-radius:8px;background:var(--panel); }
.share-host-address-row + .share-host-address-row { margin-top:14px; }
.share-host-address-row .history-field-label { display:block;margin:0 0 6px;font-size:13px;overflow-wrap:anywhere; }
.share-host-address-row input { font-family:ui-monospace,monospace;font-size:16px; }
.share-host-addresses .history-dialog-hint { margin:10px 0 0; }
#share-host-setup { margin:12px 0;padding:12px;border:1px solid var(--border);border-radius:7px; }
#share-host-viewer-token { font-family:ui-monospace,monospace; }
.share-copy-field { display:flex;align-items:stretch;gap:8px; }
.share-copy-field input { flex:1;min-width:0; }
.library-share-columns .share-copy-field .button { flex:none;margin-top:0;min-height:44px; }
#share-host-unavailable { white-space:pre-line; }
#share-host-status { white-space:pre-line; }
@media (max-width:900px) { #library-share-dialog { width:calc(100vw - 20px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);padding:16px; }.library-share-columns { grid-template-columns:minmax(0,1fr);gap:16px; }.library-share-columns>section { padding:16px; } }
.history-page-nav .button { border-color:var(--shelf-line);color:var(--shelf-muted);font-size:11px; }
.history-page-nav .button:hover { background:var(--shelf-soft);color:var(--shelf-text); }
.history-page-nav svg { width:15px;height:15px; }
.history-intro { display:flex;align-items:center;justify-content:space-between;gap:30px;margin-bottom:18px; }
.history-eyebrow { margin:0 0 7px;color:var(--shelf-accent);font-size:10px;letter-spacing:.04em; }
.history-intro h1 { margin:0 0 6px;font-size:clamp(23px,2.7vw,28px);letter-spacing:-.03em;line-height:1.35;font-weight:650; }
.history-description { margin:0;color:var(--shelf-muted);font-size:12px;line-height:1.8; }
.history-summary { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:10px 20px;flex:0 0 264px;min-width:0;padding:13px 16px;border:1px solid var(--shelf-accent-border);border-radius:11px;background:var(--shelf-soft); }
.history-summary-books,.history-summary-size { min-width:0; }
.history-summary-label { display:block;color:var(--shelf-muted);font-size:10px;margin-bottom:8px;line-height:1.7; }
.history-summary-value { display:flex;align-items:baseline;gap:8px; }
.history-summary strong { font-size:29px;font-weight:650;font-variant-numeric:tabular-nums;letter-spacing:-.025em;line-height:1.25; }
.history-summary small { color:var(--shelf-muted);font-size:10px; }
.history-total-bytes { display:flex;align-items:center;min-height:36px;color:var(--shelf-accent);font-size:20px;font-weight:650;font-variant-numeric:tabular-nums;letter-spacing:-.02em;line-height:1.4;overflow-wrap:anywhere; }
.history-total-bytes-exact { display:block;margin-top:3px;font-variant-numeric:tabular-nums;line-height:1.6;overflow-wrap:anywhere; }
.history-size-note { grid-column:1/-1;margin:0;padding-top:8px;border-top:1px solid var(--shelf-accent-border);color:var(--shelf-muted);font-size:10px;line-height:1.7;overflow-wrap:anywhere; }
.history-workspace { display:grid;grid-template-columns:218px minmax(0,1fr);gap:22px;align-items:start; }
.history-sidebar { position:sticky;top:16px;min-width:0;padding:15px 12px;border:1px solid var(--shelf-line);border-radius:12px;background:var(--shelf-surface);box-shadow:0 6px 16px #1828200c; }
.history-primary-filters { display:grid;gap:5px; }
.history-nav-item { display:flex;align-items:center;gap:9px;width:100%;min-width:0;min-height:40px;padding:9px 10px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--shelf-text);text-align:left;font-size:11px;line-height:1.6; }
.history-nav-item>svg { width:16px;height:16px;color:var(--shelf-muted); }
.history-nav-item>span { flex:1;min-width:0;overflow-wrap:anywhere; }
.history-nav-item>small,.history-filter-count { margin-left:auto;font-size:10px;font-variant-numeric:tabular-nums;color:var(--shelf-muted); }
.history-nav-item:hover { background:var(--shelf-hover); }
.history-nav-item[aria-pressed=true] { background:var(--shelf-soft);border-color:var(--shelf-accent-border);color:var(--shelf-accent);font-weight:650; }
.history-nav-item[aria-pressed=true]>svg,.history-nav-item[aria-pressed=true]>small { color:var(--shelf-accent); }
.history-sidebar-sections>summary { display:none; }
.history-sidebar-sections:not([open])>.history-sidebar-body { display:block; }
.history-group-section,.history-tag-section { margin-top:16px;padding-top:15px;border-top:1px solid var(--shelf-line); }
.history-sidebar-heading { display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 5px 9px; }
.history-sidebar-heading h2 { display:flex;align-items:center;gap:6px;margin:0;font-size:11px;font-weight:650; }
.history-sidebar-heading h2 svg { width:14px;height:14px;color:var(--shelf-muted); }
.history-text-button { display:inline-flex;align-items:center;justify-content:center;gap:3px;min-height:30px;padding:4px;color:var(--shelf-muted);border-radius:4px;font-size:10px;line-height:1.6; }
.history-text-button:hover { color:var(--shelf-accent);background:var(--shelf-soft); }
.history-groups { display:grid;gap:4px;max-height:calc(100dvh - 390px);min-height:36px;overflow:auto;scrollbar-width:thin; }
.history-group-row { display:flex;align-items:center;gap:3px;min-width:0; }
.history-group-row .history-nav-item { flex:1;gap:7px;padding:8px;font-size:10px; }
.history-group-row .history-nav-item>svg { width:14px;height:14px; }
.history-group-edit { display:inline-flex;align-items:center;justify-content:center;flex:none;width:26px;height:30px;padding:3px;border:1px solid var(--shelf-line);border-radius:5px;background:var(--shelf-raised);color:var(--shelf-muted);font-size:13px; }
.history-group-edit svg { width:15px;height:15px; }
.history-group-edit:hover { background:var(--shelf-soft);color:var(--shelf-accent);border-color:var(--shelf-accent-border); }
.history-sidebar-note,.history-sidebar-empty { margin:9px 5px 0;color:var(--shelf-muted);font-size:9px;line-height:1.8; }
.history-sidebar-empty { margin-top:3px; }
.history-tags { display:flex;flex-wrap:wrap;gap:6px;padding:2px 4px; }
.history-tag-filter,.history-tag { display:inline-flex;align-items:center;gap:5px;max-width:100%;min-height:25px;padding:4px 8px;border:1px solid var(--shelf-line);border-radius:99px;background:var(--shelf-raised);color:var(--shelf-muted);font-size:9px;text-align:left;line-height:1.5;overflow-wrap:anywhere; }
.history-tag-filter:hover,.history-tag-filter[aria-pressed=true] { border-color:var(--shelf-accent-border);background:var(--shelf-soft);color:var(--shelf-accent); }
.history-tag-filter[aria-pressed=true] { font-weight:650; }
.history-tag-filter small { font-size:9px;opacity:.8; }
.history-clear-filters { width:100%;margin-top:12px;padding:8px;border-top:1px solid var(--shelf-line);border-radius:0;font-size:10px; }
.history-shelf { min-width:0; }
.history-toolbar { position:sticky;top:0;z-index:3;padding:12px 16px;margin-bottom:16px;border:1px solid var(--shelf-line);border-radius:11px;background:var(--shelf-surface);box-shadow:0 7px 10px -10px #18282080; }
.history-list-heading { display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 12px;margin-bottom:8px; }
.history-list-heading h2 { margin:0;font-size:17px;font-weight:650;letter-spacing:-.01em; }
#history-result-count { color:var(--shelf-muted);font-size:11px; }
.history-sort-control { display:flex;align-items:center;gap:7px;margin-left:auto;color:var(--shelf-muted);font-size:10px; }
.history-sort-control select { max-width:100%;min-height:34px;padding:7px 22px 7px 9px;border-color:var(--shelf-line);background:var(--shelf-raised);color:var(--shelf-text);font-size:10px; }
.history-sort-control select option { background:var(--shelf-surface); }
.history-active-filter { display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:9px;padding-top:9px;border-top:1px solid var(--shelf-line);color:var(--shelf-accent);font-size:10px;line-height:1.7;overflow-wrap:anywhere; }
.history-search-wrap { position:relative; }
.history-search-wrap svg { position:absolute;left:13px;top:50%;transform:translateY(-50%);width:17px;height:17px;color:var(--shelf-muted);pointer-events:none; }
.history-search-wrap input { width:100%;min-width:0;min-height:42px;border:1px solid var(--shelf-line);border-radius:7px;background:var(--shelf-raised);color:var(--shelf-text);font-size:12px;padding:10px 12px 10px 39px; }
.history-search-wrap input::placeholder { color:var(--shelf-muted); }
.history-search-wrap input:focus { border-color:var(--shelf-accent); }
.history-view-options { display:flex;align-items:center;flex-wrap:wrap;gap:9px 16px;margin-top:10px; }
.history-group-control { display:inline-flex;align-items:center;gap:7px;min-height:24px;color:var(--shelf-muted);font-size:10px;line-height:1.6;cursor:pointer; }
.history-group-control input { width:14px;height:14px;flex:none;margin:0;accent-color:var(--shelf-accent); }
.history-parent-note { margin:7px 0 0;color:var(--shelf-muted);font-size:10px;line-height:1.8;overflow-wrap:anywhere; }
.history-cover-tools { display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px; }
.history-cover-status { flex:1;min-width:min(180px,100%);margin:8px 0 0;color:var(--shelf-accent);font-size:10px;line-height:1.8;overflow-wrap:anywhere; }
.history-cover-retry { min-height:31px;max-width:100%;margin-top:8px;padding:6px 9px;border:1px solid var(--shelf-accent-border);border-radius:6px;background:var(--shelf-soft);color:var(--shelf-accent);font-size:10px;line-height:1.6; }
.history-cover-retry:hover:not(:disabled) { border-color:var(--shelf-accent);background:var(--shelf-hover); }
.history-list { display:grid;grid-template-columns:repeat(auto-fill,minmax(min(170px,100%),1fr));align-items:start;gap:22px 18px;padding:4px 0 16px; }
.history-parent-card { position:relative;isolation:isolate;min-width:0;align-self:start;overflow:hidden;border:1px solid var(--shelf-line);border-radius:10px;background:var(--shelf-surface); }
.history-parent-actions { display:flex;justify-content:center;padding:0 16px 12px; }
.history-parent-open { display:flex;flex-direction:column;align-items:stretch;gap:0;width:100%;min-width:0;padding:12px;background:var(--shelf-surface);color:var(--shelf-text);text-align:left; }
.history-parent-open:hover { background:var(--shelf-hover); }
.history-parent-open:focus-visible { outline-offset:-3px; }
.history-parent-covers { position:relative;width:100%;aspect-ratio:5/7.1;min-width:0;isolation:isolate; }
.history-parent-cover { position:absolute;display:block;inset:auto;width:calc(100% - 14px);height:calc(100% - 14px);top:14px;left:0;z-index:3;object-fit:contain;overflow:hidden;border:1px solid var(--shelf-cover-line);border-radius:4px 9px 9px 4px;background:var(--shelf-raised);box-shadow:2px 4px 10px #18282020; }
.history-parent-cover>img { display:block;width:100%;height:100%;object-fit:contain; }
.history-parent-cover>.history-cover-fallback { font-size:21px;padding:10px; }
.history-parent-cover>.history-cover-fallback.history-cover-pending { font-size:11px; }
.history-parent-cover:nth-child(2) { top:7px;left:7px;z-index:2;opacity:.9; }
.history-parent-cover:nth-child(3) { top:0;left:14px;z-index:1;opacity:.8; }
.history-parent-covers>.history-cover-fallback { display:flex;align-items:center;justify-content:center;inset:auto;top:14px;left:0;padding:10px;font-size:21px;overflow:hidden; }
.history-parent-count-badge { position:absolute;right:7px;bottom:8px;z-index:4;display:inline-block;max-width:calc(100% - 14px);padding:4px 8px;border:1px solid var(--shelf-accent-border);border-radius:5px;background:var(--shelf-soft);color:var(--shelf-accent);font-size:10px;font-weight:650;line-height:1.6;font-variant-numeric:tabular-nums; }
.history-parent-info { min-width:0;padding-top:11px; }
.history-parent-meta { margin:6px 0 0;color:var(--shelf-muted);font-size:9px;line-height:1.8;overflow-wrap:anywhere; }
.history-parent-size { margin:3px 0 0;color:var(--shelf-muted);font-size:10px;line-height:1.8;font-variant-numeric:tabular-nums;overflow-wrap:anywhere; }
.history-parent-link { display:flex;align-items:center;justify-content:center;gap:6px;min-height:33px;width:100%;margin-top:12px;padding:7px 6px;border:1px solid var(--shelf-line);border-radius:6px;background:var(--shelf-raised);color:var(--shelf-accent);font-size:10px;line-height:1.6; }
.history-parent-link svg { width:13px;height:13px; }
.history-parent-card.expanded { grid-column:1/-1; }
.history-parent-card.expanded>.history-parent-open { display:grid;grid-template-columns:92px minmax(0,1fr);gap:16px;align-items:start;background:var(--shelf-raised); }
.history-parent-card.expanded>.history-parent-open .history-parent-info { padding:0; }
.history-parent-card.expanded>.history-parent-open .history-card-title { display:block;min-height:0;font-size:15px; }
.history-parent-card.expanded>.history-parent-open .history-parent-count-badge { right:4px;bottom:5px;padding:2px 5px;font-size:9px; }
.history-parent-card.expanded>.history-parent-open .history-parent-link { justify-content:flex-start;min-height:0;width:auto;padding:0;margin-top:8px;border:0;background:none; }
.history-parent-members:not([hidden]) { display:grid;grid-template-columns:repeat(auto-fill,minmax(min(170px,100%),1fr));gap:18px;align-items:start;padding:16px;border-top:1px solid var(--shelf-line); }
.history-parent-toolbar:not([hidden]) { display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 16px 0;border-top:1px solid var(--shelf-line); }
.history-parent-sort { min-width:0;flex-wrap:wrap;margin-left:0; }
.history-view-options .history-parent-sort>span,.history-parent-toolbar .history-parent-sort>span { display:inline; }
.history-parent-toolbar+.history-parent-members:not([hidden]) { border-top:0; }
.history-card { position:relative;display:flex;flex-direction:column;align-items:stretch;min-width:0;padding:7px;border:1px solid transparent;border-radius:9px;transition:background-color .15s,border-color .15s; }
.history-card:hover,.history-card:focus-within { background:var(--shelf-hover);border-color:var(--shelf-line); }
.history-cover-wrap { position:relative; }
.history-favorite { position:absolute;top:15px;right:15px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:31px;height:31px;padding:0;border:1px solid var(--shelf-line);border-radius:50%;background:var(--shelf-surface);color:var(--shelf-muted);box-shadow:0 2px 7px #0002;font-size:21px;line-height:1; }
.history-cover-wrap .history-favorite { top:8px;right:8px; }
.history-favorite svg { width:17px;height:17px; }
.history-favorite:hover,.history-favorite[aria-pressed=true] { color:var(--shelf-accent);background:var(--shelf-soft);border-color:var(--shelf-accent-border); }
.history-favorite[aria-pressed=true] svg { fill:currentColor; }
.history-cover { position:relative;display:flex;align-items:center;justify-content:center;width:100%;padding:0;aspect-ratio:5/7.1;overflow:hidden;border-radius:4px 9px 9px 4px;background:var(--shelf-raised);color:var(--shelf-accent);box-shadow:2px 4px 10px #18282020;isolation:isolate; }
.history-cover::after { content:"";position:absolute;inset:0;pointer-events:none;border:1px solid var(--shelf-cover-line);border-radius:inherit;box-shadow:inset 2px 0 3px #00000010;z-index:2; }
.history-cover img { display:block;width:100%;height:100%;object-fit:contain;background:var(--shelf-raised); }
.history-cover-fallback { position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:16px;background:linear-gradient(135deg,var(--shelf-soft),var(--shelf-surface));color:var(--shelf-accent);font-size:36px;font-weight:650; }
.history-cover-fallback::before { content:"";position:absolute;left:10px;top:12px;bottom:12px;border-left:1px solid var(--shelf-line); }
.history-cover-fallback svg { width:38px;height:38px; }
.history-cover-fallback.history-cover-pending { color:var(--shelf-muted);font-size:13px;font-weight:500;line-height:1.8;text-align:center; }
.history-card-body { min-width:0;padding:11px 1px 0; }
.history-card-title { margin:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;min-height:38px;font-size:12px;font-weight:650;line-height:1.6;color:var(--shelf-text); }
.history-card-meta { margin:7px 0 0;color:var(--shelf-muted);font-size:10px;line-height:1.6; }
.history-read-count,.history-parent-read-count { margin:6px 0 0;color:var(--shelf-accent);font-size:10px;line-height:1.6;font-variant-numeric:tabular-nums; }
.history-group-row .history-group-read-count { margin-left:0;color:var(--shelf-accent);white-space:nowrap; }
.history-reading-note { margin:6px 0;color:var(--shelf-muted);font-size:10px;line-height:1.6; }
.history-read-period-control { margin-left:auto; }
.history-read-period-control>span { display:inline; }
.history-summary-reading { grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0; }.history-summary-reading .history-summary-label { margin:0; }
.history-card-date { display:block;margin-top:5px;color:var(--shelf-muted);font-size:9px;line-height:1.6;font-variant-numeric:tabular-nums; }
.history-card-tags,.history-card-groups { display:flex;flex-wrap:wrap;gap:4px;margin-top:8px; }
.history-card-tags .history-tag { min-height:21px;padding:2px 6px;font-size:9px; }
.history-group-label { display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:3px 6px;border:1px solid var(--shelf-accent-border);border-radius:4px;background:var(--shelf-soft);color:var(--shelf-accent);font-size:9px;line-height:1.5;overflow-wrap:anywhere; }
.history-group-label svg { width:11px;height:11px; }
.history-progress { display:block;width:100%;height:4px;margin-top:9px;border:0;border-radius:99px;overflow:hidden;background:var(--shelf-line);color:var(--shelf-accent);appearance:none; }
.history-progress::-webkit-progress-bar { border-radius:99px;background:var(--shelf-line); }
.history-progress::-webkit-progress-value { border-radius:99px;background:var(--shelf-accent); }
.history-progress::-moz-progress-bar { border-radius:99px;background:var(--shelf-accent); }
.history-card-actions { display:flex;align-items:center;gap:7px;margin-top:12px; }
.history-view .button.primary { color:var(--shelf-primary-text);background:var(--shelf-accent);border-color:var(--shelf-accent); }
.history-view .button.primary:hover { filter:brightness(1.08); }
.history-resume { flex:1;min-height:34px;padding:7px 9px;font-size:11px; }
.history-edit { display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:34px;min-height:34px;padding:6px;border:1px solid var(--shelf-line);border-radius:6px;background:var(--shelf-raised);color:var(--shelf-muted);font-size:10px; }
.history-edit svg { width:15px;height:15px; }
.history-edit:hover { background:var(--shelf-soft);color:var(--shelf-accent);border-color:var(--shelf-accent-border); }
.history-remove { display:inline-flex;align-items:center;justify-content:center;gap:5px;width:100%;min-height:29px;height:auto;margin-top:6px;padding:5px 7px;border-radius:5px;color:var(--shelf-muted);font-size:9px; }
.history-remove:hover:not(:disabled) { background:var(--shelf-soft);color:var(--shelf-text); }
.history-remove svg { width:16px;height:16px; }
.history-remove,.history-parent-remove { display:inline-flex;align-items:center;justify-content:center;text-align:center; }
.history-parent-remove { min-height:32px; }
.history-empty { padding:64px 20px 68px;text-align:center;color:var(--shelf-muted); }
.history-empty-mark { display:flex;align-items:center;justify-content:center;width:72px;height:72px;margin:0 auto 18px;border:1px solid var(--shelf-accent-border);border-radius:20px;background:var(--shelf-soft);color:var(--shelf-accent); }
.history-empty-mark svg { width:35px;height:35px; }
.history-empty h3 { margin:0;color:var(--shelf-text);font-size:16px;font-weight:600; }
.history-empty p { max-width:460px;margin:12px auto 21px;font-size:12px;line-height:1.9; }
.history-empty .button { min-height:42px;font-size:12px; }
.history-storage-note { display:flex;align-items:center;justify-content:center;gap:6px;margin:26px 0 0;color:var(--shelf-muted);font-size:10px;line-height:1.7; }
.history-storage-note svg { width:13px;height:13px;color:var(--shelf-accent); }
.history-delete-dialog,.history-reopen-dialog { width:min(460px,calc(100vw - 32px));max-width:460px; }
.history-organize-dialog { width:min(480px,calc(100vw - 32px));max-width:480px;max-height:calc(100dvh - 48px);overflow:auto; }
.history-organize-dialog h2 { margin:0 0 12px; }
.cloud-upload-dialog { width:min(660px,calc(100vw - 32px));max-width:660px;padding:24px; }
.cloud-upload-dialog .library-share-heading { display:flex;align-items:start;justify-content:space-between;gap:16px; }
.cloud-upload-dialog .library-share-heading h2 { font-size:20px; }
.cloud-upload-fields { border:0;padding:0;margin:16px 0;display:grid;gap:12px;min-width:0; }
.cloud-upload-dialog label { display:grid;gap:6px;font-size:13px; }
.cloud-upload-dialog input { width:100%;min-width:0;box-sizing:border-box; }
.cloud-upload-note { font-size:12px;line-height:1.8;opacity:.8; }
.cloud-upload-dialog progress { display:block;width:100%;height:14px;accent-color:var(--accent,#a9c4ad); }
.cloud-upload-dialog [role=status],.cloud-upload-result { font-size:13px;line-height:1.7;overflow-wrap:anywhere; }
.cloud-upload-dialog .history-dialog-actions { display:flex;flex-wrap:wrap;gap:8px; }
.cloud-upload-restore { margin-top:24px;border-top:1px solid var(--line,#7775);padding-top:16px; }
.cloud-upload-restore label { margin:12px 0; }
.cloud-account-usage { padding:12px;border:1px solid var(--line,#7775);border-radius:12px; }
.cloud-account-usage dl { display:grid;grid-template-columns:minmax(100px,1fr) 2fr;gap:8px;margin:0;font-size:12px;line-height:1.7; }
.cloud-account-usage dt { font-weight:600; }.cloud-account-usage dd { margin:0;overflow-wrap:anywhere; }
.cloud-upload-dialog select { min-width:0;max-width:100%; }
.history-dialog-description { margin:0 0 21px;font-size:12px; }
.history-field-label { display:block;margin:0 0 7px;font-size:12px;font-weight:550; }
.history-dialog-input { display:block;width:100%;min-width:0;min-height:42px;padding:10px 12px;border:1px solid var(--border);border-radius:7px;background:var(--bg);color:var(--text);font-size:12px; }
.history-dialog-input::placeholder { color:var(--muted); }
.history-dialog-input:focus { border-color:var(--accent); }
.history-dialog-error { margin:10px 0 0;color:#e2a39b;font-size:11px; }
:root[data-theme=light] .history-dialog-error { color:#a33e3a; }
.history-dialog-hint { margin:8px 0 0;font-size:10px;line-height:1.8; }
.history-edit-tag-suggestions { display:flex;flex-wrap:wrap;gap:6px;margin-top:11px;max-height:140px;overflow:auto; }
.history-edit-tag-suggestions button { min-height:28px;max-width:100%;padding:4px 9px;border:1px solid var(--border);border-radius:99px;background:var(--panel);color:var(--muted);font-size:10px;text-align:left;line-height:1.6;overflow-wrap:anywhere; }
.history-edit-tag-suggestions button:hover,.history-edit-tag-suggestions button[aria-pressed=true] { border-color:var(--accent);color:var(--accent); }
.history-group-delete { margin-right:auto;color:var(--muted); }
.history-group-delete:hover { background:var(--panel);color:var(--text); }
/* Folder stars match book stars; deletion keeps its original, neutral row. */
.history-parent-card>.history-parent-favorite { top:20px;right:20px;z-index:5; }
.history-parent-card.expanded>.history-parent-favorite { left:65px;right:auto; }
.history-parent-favorite[aria-pressed=mixed] { color:var(--shelf-accent); }
.history-parent-actions .history-parent-remove { min-height:32px;margin:0;padding:6px 8px;color:var(--shelf-muted); }
.history-parent-actions .history-parent-remove:hover:not(:disabled) { background:var(--shelf-soft);color:var(--shelf-text); }
.history-group-favorite-toggle { display:inline-flex;align-items:center;justify-content:center;width:31px;height:31px;margin-top:14px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--panel);color:var(--muted);font-size:21px;line-height:1; }
.history-group-favorite-toggle:hover,.history-group-favorite-toggle[aria-pressed=true],.history-group-favorite-toggle[aria-pressed=mixed] { color:var(--accent);border-color:var(--accent); }
.history-group-removal { margin-top:28px;padding-top:18px;border-top:1px solid var(--border);display:flex;flex-wrap:wrap;gap:12px; }
.history-group-removal .history-text-button { min-height:40px;padding:9px 12px;color:var(--muted); }
.history-group-removal .history-text-button:hover { color:var(--text);background:var(--panel); }
.history-delete-name { color:var(--text);font-weight:600;overflow-wrap:anywhere; }
.history-dialog-actions { display:flex;justify-content:flex-end;flex-wrap:wrap;gap:9px;margin-top:23px; }
.history-dialog-actions .button,.history-reopen-actions .button { min-height:40px;font-size:12px; }
.history-danger { color:#fff;background:#a33e3a;border-color:#a33e3a; }
.history-danger:hover { background:#882e2b;border-color:#882e2b; }
.history-reopen-actions { display:flex;flex-wrap:wrap;gap:9px;margin-top:23px; }
#history-reopen-cancel { margin-left:auto; }
@media(max-width:1050px) {
  .history-layout { padding-inline:24px; }
  .history-workspace { grid-template-columns:190px minmax(0,1fr);gap:16px; }
  .history-sidebar { padding:13px 9px; }
  .history-sort-control>span { display:none; }
}
@media(max-width:760px) {
  .app-header { flex-wrap:wrap;row-gap:10px; }
  .history-layout { padding:18px 16px 24px; }
  .history-page-nav { margin-bottom:22px;gap:12px; }
  .history-local-label { font-size:10px; }
  .history-share-status { font-size:11px; }
  .history-page-actions { width:100%;align-items:center; }
  .history-library-switch button { min-height:40px;padding:8px 10px; }
  .history-page-nav .button { padding:8px 10px;font-size:10px;gap:5px; }
  .history-intro { align-items:flex-start;gap:14px;margin-bottom:22px; }
  .history-intro h1 { font-size:24px; }
  .history-description { font-size:11px; }
  .history-summary { grid-template-columns:1fr;flex-basis:150px;gap:11px;padding:13px 12px;border-radius:9px; }
  .history-summary-label { font-size:9px;margin-bottom:5px; }
  .history-summary strong { font-size:25px; }
  .history-total-bytes { min-height:0;font-size:18px; }
  .history-size-note { font-size:9px; }
  .history-workspace { grid-template-columns:1fr;gap:16px; }
  .history-sidebar { position:static;padding:11px 12px; }
  .history-primary-filters { grid-template-columns:1fr 1fr;gap:7px; }
  .history-nav-item { min-height:38px;font-size:10px; }
  .history-sidebar-sections>summary { display:flex;align-items:center;justify-content:space-between;gap:9px;min-height:37px;margin-top:7px;padding:9px 4px 2px;color:var(--shelf-muted);font-size:10px;cursor:pointer;list-style:none; }
  .history-sidebar-sections>summary::-webkit-details-marker { display:none; }
  .history-sidebar-sections>summary>svg { width:13px;height:13px;transform:rotate(90deg); }
  .history-sidebar-sections[open]>summary>svg { transform:rotate(-90deg); }
  .history-sidebar-sections:not([open])>.history-sidebar-body { display:none; }
  .history-group-section,.history-tag-section { margin-top:9px;padding-top:11px; }
  .history-groups { grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr));gap:5px 9px;max-height:180px; }
  .history-group-row .history-nav-item { min-height:35px; }
  .history-sidebar-note { margin-top:7px; }
  .history-tags { max-height:135px;overflow:auto; }
  .history-clear-filters { margin-top:8px;min-height:31px;padding-block:6px; }
  .history-toolbar { padding:13px 12px;margin-bottom:13px; }
  .history-list-heading h2 { font-size:15px; }
  .history-list-heading { gap:8px;margin-bottom:10px; }
  .history-sort-control { font-size:9px; }
  .history-sort-control select { min-height:33px;padding-left:7px;font-size:9px; }
  .history-search-wrap input { font-size:11px; }
  .history-list { grid-template-columns:repeat(auto-fill,minmax(min(132px,100%),1fr));gap:18px 10px; }
  .history-parent-open { padding:8px; }
  .history-parent-info { padding-top:9px; }
  .history-parent-count-badge { padding:3px 6px;font-size:9px; }
  .history-parent-card.expanded>.history-parent-open { grid-template-columns:64px minmax(0,1fr);gap:12px; }
  .history-parent-card.expanded>.history-parent-open .history-card-title { font-size:12px; }
  .history-parent-members:not([hidden]) { grid-template-columns:repeat(auto-fill,minmax(min(132px,100%),1fr));gap:15px 8px;padding:8px; }
  .history-card { padding:4px; }
  .history-favorite { top:11px;right:11px;width:29px;height:29px; }
  .history-parent-card>.history-parent-favorite { top:16px;right:16px; }
  .history-parent-card.expanded>.history-parent-favorite { left:35px;right:auto; }
  .history-favorite svg { width:16px;height:16px; }
  .history-card-title { font-size:11px;min-height:35px; }
  .history-card-meta { font-size:9px; }
  .history-card-actions { gap:5px; }
  .history-resume { font-size:10px;padding:7px 6px; }
  .history-edit { min-width:31px;padding:5px; }
  .history-remove { font-size:9px; }
  .history-empty { padding:48px 12px; }
  .history-storage-note { text-align:center;font-size:9px; }
}
@media(max-width:390px) {
  .history-intro { flex-direction:column; }
  .history-summary { grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:8px 24px;width:100%;flex-basis:auto;padding:11px 13px; }
  .history-summary strong { font-size:23px; }
  .history-total-bytes { min-height:29px; }
}

.speech-prefetch-status { margin:7px 0;color:var(--muted);font-size:11px;line-height:1.7;overflow-wrap:anywhere; }

.speech-wait-details { pointer-events:auto;margin-top:6px;color:var(--muted);font-size:10px;line-height:1.5; }.speech-wait-details summary { cursor:pointer; }.speech-text-count { margin:7px 0;color:var(--muted);font-size:11px;line-height:1.6; }
#speech-wait-scope { overflow-wrap:anywhere; }

.speech-wait-explanation { margin:6px 0 0;line-height:1.6; }

.has-book.edge-controls-visible .reader .edge-nav,.has-book.chrome-hidden.edge-controls-visible .reader .edge-nav { display:flex;opacity:.85; }
.has-book.chrome-hidden.edge-controls-visible .reader { cursor:default; }
.edge-nav:disabled { opacity:0;cursor:default; }
body:not(.chrome-hidden) .reader:hover .edge-nav:disabled,
body.has-book.edge-controls-visible .reader .edge-nav:disabled { opacity:.25; }
#speech-cast-model-options .reading-option { display:grid;grid-template-columns:minmax(0,1fr);gap:7px; }
#speech-cast-model { width:100%;max-width:100%;min-width:0; }
#speech-cast-model-install { overflow-wrap:anywhere;white-space:normal; }

.text-reflow-status { position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:26;padding:12px 18px;background:var(--header);border:1px solid var(--accent);border-radius:8px;color:var(--text);font-size:.8125rem; }.text-reflow-status output { margin-left:.7em;font-variant-numeric:tabular-nums; }

/* Service announcements: configured locally, displayed only in the library. */
.promotion-slot { min-width:0;display:grid;gap:10px; }
.promotion-slot[hidden] { display:none; }
.promotion-slot-header { flex:1 1 300px;max-width:540px; }
.promotion-card { min-width:0;overflow:hidden;padding:12px 14px;border:1px solid var(--shelf-line);border-radius:10px;background:var(--shelf-surface);color:var(--shelf-text); }
.promotion-label { margin:0 0 7px;color:var(--shelf-muted);font-size:10px;line-height:1.5;overflow-wrap:anywhere; }
.promotion-content { display:flex;align-items:center;gap:12px;min-width:0;color:inherit;text-decoration:none; }
.promotion-content:focus-visible { outline:2px solid var(--shelf-accent);outline-offset:4px;border-radius:4px; }
.promotion-content>img { display:block;width:42%;max-width:240px;max-height:160px;object-fit:contain;border-radius:6px; }
.promotion-copy { min-width:0;overflow-wrap:anywhere; }
.promotion-copy strong { font-size:14px;line-height:1.6; }
.promotion-copy p { margin:5px 0;color:var(--shelf-muted);font-size:11px;line-height:1.7;white-space:pre-line; }
.promotion-link { display:block;margin-top:7px;color:var(--shelf-accent);font-size:11px; }
.promotion-slot-sidebar { margin-top:22px; }
.promotion-slot-sidebar .promotion-content { flex-direction:column;align-items:stretch; }
.promotion-slot-sidebar .promotion-content>img { width:100%;max-width:100%; }
.promotion-slot-footer { margin-top:24px;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); }
.promotion-settings-entry { display:flex;justify-content:flex-end;margin-top:20px; }
.promotion-settings-entry .history-text-button { font-size:10px; }
.promotion-settings-dialog { width:min(680px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:24px;overflow:auto; }
.promotion-settings-dialog h2 { margin:0;font-size:18px; }
.promotion-visibility { display:flex;align-items:center;gap:9px;margin:20px 0 12px; }
#promotion-editor { margin-top:22px;padding-top:18px;border-top:1px solid var(--border); }
#promotion-editor>summary { cursor:pointer;line-height:1.7; }
.promotion-items { display:grid;gap:10px;margin:18px 0; }
.promotion-item { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:8px; }
.promotion-item p { margin:0;min-width:0;font-size:12px;overflow-wrap:anywhere; }
.promotion-item>div { display:flex;gap:8px;flex:none; }
#promotion-form { margin:20px 0;padding:18px;border:1px solid var(--border);border-radius:10px; }
#promotion-form>label { display:block;margin:14px 0 7px;font-size:12px; }
#promotion-form>input:not([type=file]),#promotion-form>select,#promotion-form>textarea { width:100%;min-width:0;padding:10px;border:1px solid var(--border);border-radius:6px;background:var(--panel);color:var(--text);font:inherit; }
#promotion-form>input[type=file] { max-width:100%; }
.promotion-image-preview { display:block;max-width:100%;max-height:180px;object-fit:contain;margin:12px 0; }
.promotion-config-tools { display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:24px;padding-top:18px;border-top:1px solid var(--border); }
.promotion-config-tools label[for=promotion-import] { cursor:pointer; }
.promotion-config-tools:has(#promotion-import:focus-visible) label[for=promotion-import] { outline:2px solid var(--accent);outline-offset:4px; }
@media(max-width:1100px) { .history-intro:has(.promotion-slot-header:not([hidden])) { flex-direction:column;align-items:stretch; }.promotion-slot-header { max-width:none;flex-basis:auto;width:100%; }.history-intro:has(.promotion-slot-header:not([hidden])) .history-summary { flex-basis:auto;width:100%; } }
@media(max-width:600px) { .promotion-slot-header { width:100%;flex-basis:auto; }.promotion-settings-dialog { padding:18px; }.promotion-item { align-items:flex-start;flex-direction:column; }.promotion-content>img { max-height:120px; } }

/* Bookmarks use the reader's native modal and existing theme surfaces. */
.bookmark-toggle { flex:none;width:33px;height:33px;padding:5px; }
.bookmark-toggle.is-bookmarked,.bookmark-toggle.is-bookmarked:hover { background:var(--text);color:var(--bg);border-color:var(--text); }
.bookmark-toggle.is-bookmarked svg { fill:currentColor; }
#bookmarks-dialog { width:min(640px,calc(100vw - 32px));max-width:640px;max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);padding:24px;overflow:auto;overscroll-behavior:contain; }
#bookmarks-dialog::backdrop { overflow:hidden;overscroll-behavior:contain; }
#bookmarks-dialog>.dialog-heading { gap:12px; }
#bookmarks-dialog .dialog-heading h2 { font-size:18px; }
#bookmarks-close { flex:none; }
.bookmark-book-name { margin:12px 0 4px;color:var(--text);font-size:13px;font-weight:600;overflow-wrap:anywhere; }
.bookmark-storage-note { margin:0 0 18px;font-size:11px; }
.bookmark-add-row { display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding-block:14px;border-block:1px solid var(--border); }
.bookmark-add-row>label { font-size:12px;font-weight:550; }
#bookmark-page { width:100%;min-width:0;min-height:38px;background:var(--bg);font-size:12px; }
#bookmark-add { min-height:38px;padding:8px 12px;font-size:12px;white-space:nowrap; }
.bookmark-status { margin:12px 0;color:var(--accent);font-size:12px;overflow-wrap:anywhere; }
.bookmark-status.failed { color:var(--text);font-weight:600; }
.bookmark-empty { margin:22px 0 4px;font-size:12px; }
#bookmark-list { display:grid;gap:12px;margin:16px 0 0;padding:0;list-style:none; }
.web-app-dialog { max-width:620px;line-height:1.9; }
.web-app-dialog p { margin-block:14px; }
#web-app-open { white-space:normal; }
@media(max-width:760px) { #web-app-open { max-width:90px;font-size:10px;line-height:1.3; } }
#bookmark-list>li { min-width:0; }
.bookmark-entry { display:grid;gap:10px;min-width:0;padding:14px;border:1px solid var(--border);border-radius:8px;background:var(--panel); }
.bookmark-entry-heading { display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;min-width:0; }
.bookmark-jump { min-width:0;min-height:36px;padding:6px 10px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--accent);font-size:12px;font-weight:600;line-height:1.6;text-align:left;overflow-wrap:anywhere; }
.bookmark-jump:hover:not(:disabled) { border-color:var(--accent); }
.bookmark-date { margin-inline-start:auto;color:var(--muted);font-size:10px;line-height:1.6;overflow-wrap:anywhere; }
.bookmark-remove { min-height:34px;padding:5px 8px;color:var(--muted);font-size:11px;text-decoration:underline;text-underline-offset:.2em; }
.bookmark-remove:hover:not(:disabled) { color:var(--text); }
.bookmark-comment { margin:0;color:var(--text);font-size:12px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere; }
.bookmark-edit { justify-self:start;min-height:34px;padding:6px 10px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--accent);font-size:11px; }
.bookmark-edit:hover:not(:disabled) { border-color:var(--accent); }
.bookmark-edit-form { display:grid;gap:8px;min-width:0; }
.bookmark-edit-form>label { font-size:12px;font-weight:550; }
.bookmark-comment-input { display:block;width:100%;min-width:0;min-height:88px;max-height:240px;resize:vertical;padding:10px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--text);font:inherit;line-height:1.8; }
.bookmark-comment-input::placeholder { color:var(--muted); }
.bookmark-comment-input:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
.bookmark-edit-actions { display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px; }
.bookmark-edit-actions button { min-height:36px;padding:7px 12px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--text);font-size:12px; }
.bookmark-edit-actions button[type=submit] { background:var(--accent);border-color:var(--accent);color:var(--accent-dark); }
.bookmark-edit-actions button:hover:not(:disabled) { border-color:var(--accent); }
@media(max-width:480px) {
  #bookmarks-dialog { width:calc(100vw - 20px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:18px; }
  .bookmark-add-row { grid-template-columns:minmax(0,1fr) auto;gap:8px; }
  .bookmark-add-row>label { grid-column:1/-1; }
  .bookmark-entry { padding:12px; }
  .bookmark-date { flex-basis:100%;margin-inline-start:0;order:1; }
  .bookmark-remove { margin-inline-start:auto; }
}
