/* Reader chrome follows the approved bookmark prototype; PDF/vendor styles stay untouched. */
[data-yi-reader-library] { --rl-ink:#263a57; --rl-muted:#63748e; --rl-line:#d8e0ec; --rl-soft:#f1f4f8; --rl-paper:#fff; --rl-gold:#94721b; color:var(--rl-ink); font:14px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
[data-yi-reader-library] [hidden] { display:none !important; }
.yi-reader-library__actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
[data-yi-reader-library] button { font:inherit; color:inherit; cursor:pointer; min-height:44px; }
[data-yi-reader-library] button:disabled { opacity:.5; cursor:default; }
.yi-reader-library__open,.yi-reader-library__bookmark-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid #bfcadb; background:var(--rl-paper); border-radius:7px; padding:10px 14px; font-size:13px !important; font-weight:600 !important; }
.yi-reader-library__actions svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.65; flex-shrink:0; }
.yi-reader-library__count { font-size:11px; background:var(--rl-soft); padding:2px 6px; border-radius:4px; font-weight:400; }
.yi-reader-library__bookmark-button[data-yi-reader-library-state="edit"] { background:#fbf5e3; border-color:#d6bd71; color:#735310; }
.yi-reader-library__bookmark-button[data-yi-reader-library-state="edit"] svg { fill:#c89b1f; }
.yi-reader-library__backdrop { position:fixed; inset:0; z-index:2147483646; background:rgba(26,46,74,.34); }
.yi-reader-library__drawer,.yi-reader-library__editor { box-sizing:border-box; position:fixed; z-index:2147483647; background:var(--rl-paper); color:var(--rl-ink); border:1px solid var(--rl-line); box-shadow:0 12px 34px #0f233c38; font:14px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; user-select:text !important; -webkit-user-select:text !important; }
.yi-reader-library__drawer *, .yi-reader-library__editor * { box-sizing:border-box; }
.yi-reader-library__drawer { top:0; right:0; bottom:var(--yi-reader-library-bottom-clearance,0px); width:min(380px,92vw); display:flex; flex-direction:column; border-radius:12px 0 0 12px; overflow:hidden; }
.yi-reader-library__header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:23px 22px 18px; border-bottom:1px solid var(--rl-line); flex-shrink:0; }
.yi-reader-library__header h2 { margin:0 0 8px !important; font:24px/1.15 Georgia,serif !important; color:var(--rl-ink) !important; }
.yi-reader-library__header p { margin:0 !important; color:var(--rl-muted); font-size:12px; line-height:1.5; }
.yi-reader-library__header button { border:0; background:transparent; padding:0; min-width:44px; font-size:27px; line-height:1; }
.yi-reader-library__tabs { display:flex; gap:18px; padding:0 22px; border-bottom:1px solid var(--rl-line); flex-shrink:0; }
.yi-reader-library__tabs button { border:0; border-bottom:2px solid transparent; background:transparent; padding:10px 0; font-size:12px; color:var(--rl-muted); }
.yi-reader-library__tabs [aria-selected="true"] { border-color:var(--rl-gold); color:var(--rl-ink); }
.yi-reader-library__drawer [role="tabpanel"] { min-height:0; flex:1; }
[data-yi-reader-library-panel="contents"] { padding:20px 22px; overflow:auto; }
[data-yi-reader-library-panel="bookmarks"] { display:flex; flex-direction:column; overflow:hidden; }
[data-yi-reader-library-resume] { flex-shrink:0; padding:16px 20px 0; }
.yi-reader-library__bookmark.is-system { padding:13px 14px; margin:0; background:#fbf7ec; border:1px solid #e3d4a9; border-radius:8px; }
.yi-reader-library__resume-heading { display:flex; align-items:center; gap:7px; color:#80631d; }
.yi-reader-library__resume-heading h3 { font:600 13px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important; color:inherit !important; margin:0 !important; }
.yi-reader-library__automatic { margin-left:auto; font-size:10px; letter-spacing:.3px; }
.yi-reader-library__resume-main { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:11px; }
.yi-reader-library__resume-main strong { font-size:18px; white-space:nowrap; color:var(--rl-ink) !important; }
.yi-reader-library__primary { background:#1a2e4a !important; color:#fff !important; border:1px solid #1a2e4a !important; border-radius:7px; padding:10px 12px; font-size:12px !important; white-space:nowrap; }
.yi-reader-library__resume-note { margin:10px 0 0 !important; font-size:11px; line-height:1.5; color:#7b6c49; }
.yi-reader-library__list-area { flex:1; min-height:0; overflow:auto; padding:0 20px; overscroll-behavior:contain; }
.yi-reader-library__list-meta { margin:16px 0 5px !important; font-size:11px; color:var(--rl-muted); }
.yi-reader-library__bookmark:not(.is-system) { padding:16px 0 10px; border-bottom:1px solid var(--rl-line); }
.yi-reader-library__row-jump { display:flex; align-items:flex-start; gap:14px; width:100%; padding:0; border:0; background:transparent; text-align:left; }
.yi-reader-library__page-badge { display:grid; flex-shrink:0; width:50px; padding:8px 4px; text-align:center; background:var(--rl-soft); border-radius:6px; }
.yi-reader-library__page-badge small { font-size:10px; line-height:1.4; color:var(--rl-muted); }
.yi-reader-library__page-badge b { color:var(--rl-ink); font-size:16px; line-height:1.4; }
.yi-reader-library__row-copy { display:grid; gap:6px; padding:6px 0 0; min-width:0; }
.yi-reader-library__row-copy strong { color:var(--rl-ink) !important; font-size:13px; line-height:1.4; overflow-wrap:anywhere; }
.yi-reader-library__row-copy > span { color:var(--rl-muted); font-size:11px; }
.yi-reader-library__bookmark.is-current .yi-reader-library__row-copy > span { color:var(--rl-gold); }
.yi-reader-library__bookmark-actions { display:flex; gap:18px; margin-left:64px; }
.yi-reader-library__bookmark-actions button { border:0; background:transparent; padding:8px 0; text-decoration:underline; text-underline-offset:3px; font-size:12px !important; }
.yi-reader-library__bookmark-actions .yi-reader-library__delete { color:#b4232f; }
.yi-reader-library__pending { margin:4px 0 0 64px !important; color:var(--rl-muted); font-size:11px; }
.yi-reader-library__footer { flex-shrink:0; padding:14px 20px 16px; border-top:1px solid var(--rl-line); background:#fafbfd; }
.yi-reader-library__footer > button { width:100%; border:1px solid #bfcadb; border-radius:7px; padding:10px; background:var(--rl-paper); font-size:13px !important; }
.yi-reader-library__footer p { margin:10px 0 0 !important; color:var(--rl-muted); font-size:11px; line-height:1.6; }
[data-yi-reader-library-undo] { margin-bottom:8px; color:var(--rl-gold) !important; }
[data-yi-reader-library-status] { flex-shrink:0; margin:0 !important; padding:8px 20px; font-size:12px; color:var(--rl-muted); }
[data-yi-reader-library-status][data-kind="success"] { color:#1f6f6e; }
[data-yi-reader-library-status][data-kind="conflict"] { color:#b4232f; }
.yi-reader-library__old-revision,.yi-reader-library__empty { color:var(--rl-muted); font-size:12px; line-height:1.6; margin:14px 0 !important; }
.yi-reader-library__search { display:grid; gap:8px; margin-bottom:14px; color:var(--rl-muted); font-size:12px; }
.yi-reader-library__chapter { padding:8px 0; border-bottom:1px solid var(--rl-line); }
.yi-reader-library__chapter button { background:transparent; border:0; padding:6px 0; width:100%; text-align:left; }
.yi-reader-library__chapter span { font-size:11px; color:var(--rl-muted); }
.yi-reader-library__chapter summary { min-height:44px; cursor:pointer; color:var(--rl-muted); }
.yi-reader-library__editor { inset:50% auto auto 50%; transform:translate(-50%,-50%); border-radius:12px; width:min(420px,calc(100vw - 32px)); max-height:calc(100dvh - var(--yi-reader-library-bottom-clearance,0px) - 24px); overflow:auto; padding:25px; }
.yi-reader-library__editor h3 { font:24px/1.2 Georgia,serif !important; margin:0 !important; color:var(--rl-ink) !important; }
.yi-reader-library__editor-sub { color:var(--rl-muted); font-size:13px; margin:8px 0 20px !important; }
.yi-reader-library__editor label { display:block; margin:16px 0; color:var(--rl-ink); font-size:13px; }
.yi-reader-library__editor label > span { display:block; margin-top:6px; color:var(--rl-muted); font-size:11px; }
.yi-reader-library__editor label small { color:var(--rl-muted); }
.yi-reader-library__editor form > div { display:flex; gap:10px; justify-content:flex-end; }
.yi-reader-library__editor button { border:1px solid #bfcadb; border-radius:7px; padding:10px 14px; background:var(--rl-paper); font-size:13px !important; }
.yi-reader-library__privacy { padding:10px 0; color:var(--rl-muted); font-size:12px; }
.yi-reader-library__drawer input,.yi-reader-library__editor :is(input,select) { width:100%; margin-top:6px; min-height:44px; padding:10px 12px; border:1px solid #bfcadb; border-radius:7px; font:14px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; background:var(--rl-paper); color:var(--rl-ink); user-select:text !important; -webkit-user-select:text !important; }
[data-yi-reader-library] :is(button,input,select,summary):focus-visible { outline:3px solid #b58418 !important; outline-offset:3px !important; }
[data-yi-reader-library] .yi-reader-library__editor input:focus { color:var(--rl-ink); }
.yi-reader-toolbar { max-width:1200px; margin:0 auto 16px; display:grid; grid-template-columns:minmax(160px,1fr) auto auto; gap:8px 14px; align-items:center; padding:13px 16px; border:1px solid #d8e0ec; border-radius:10px; background:#fff; }
.yi-reader-toolbar > .yi-reading-progress { flex:1; min-width:160px; margin:0; padding:0; box-shadow:none; display:flex; flex-direction:column-reverse; align-items:stretch; gap:9px; }
.yi-reader-toolbar .yi-reading-progress__track { flex:initial; }
.yi-reader-toolbar > .yi-reader-appearance { display:contents; }
.yi-reader-toolbar .yi-reader-appearance__choice { grid-column:3; grid-row:1; font-size:12px; }
.yi-reader-toolbar .yi-reader-appearance__night { grid-column:2/-1; grid-row:2; margin:0; font-size:12px; justify-self:end; }
.yi-reader-toolbar .yi-reader-appearance__help { grid-column:1/-1; grid-row:3; margin:0; font-size:11px; }
@media(min-width:761px) and (max-width:1100px) { .yi-reader-toolbar { grid-template-columns:minmax(160px,1fr) auto; } .yi-reader-toolbar .yi-reader-appearance__choice { grid-column:1; grid-row:2; } .yi-reader-toolbar .yi-reader-appearance__night { grid-column:2; } }
html[data-yi-reader-theme="dark"] [data-yi-reader-library] { --rl-ink:#dbe6f7; --rl-muted:#a4b1c2; --rl-line:#354255; --rl-soft:#243044; --rl-paper:#1b2533; --rl-gold:#d5b56c; }
html[data-yi-reader-theme="dark"] .yi-reader-toolbar { background:#1b2533; border-color:#354255; }
html[data-yi-reader-theme="dark"] .yi-reader-library__bookmark.is-system { background:#2c2b23; border-color:#605334; }
html[data-yi-reader-theme="dark"] :is(.yi-reader-library__resume-heading,.yi-reader-library__resume-note) { color:#d5be84; }
html[data-yi-reader-theme="dark"] .yi-reader-library__footer { background:#172130; }
html[data-yi-reader-theme="dark"] .yi-reader-library__primary { background:#d1b36d !important; color:#172437 !important; border-color:#d1b36d !important; }
html[data-yi-reader-theme="dark"] .yi-reader-library__bookmark-button[data-yi-reader-library-state="edit"] { background:#3a3321; border-color:#a98a40; color:#f0d18e; }
html[data-yi-reader-theme="dark"] .yi-reader-library__delete { color:#ff9b9b; }
html[data-yi-reader-theme="dark"] [data-yi-reader-library-status][data-kind="success"] { color:#8bd8c2; }
:fullscreen > [data-yi-reader-library],:-webkit-full-screen > [data-yi-reader-library] { position:absolute; top:12px; left:12px; z-index:2147483100; pointer-events:none; }
:fullscreen > [data-yi-reader-library] :is(button,input,select,summary,.yi-reader-library__drawer,.yi-reader-library__editor,.yi-reader-library__backdrop),:-webkit-full-screen > [data-yi-reader-library] :is(button,input,select,summary,.yi-reader-library__drawer,.yi-reader-library__editor,.yi-reader-library__backdrop) { pointer-events:auto; }
@media(max-width:760px) { .yi-reader-toolbar { display:block; padding:13px 12px; } .yi-reader-library__actions { margin-top:14px; display:grid; grid-template-columns:1fr 1fr; gap:8px; } .yi-reader-library__actions .yi-reader-library__contents-open { grid-column:1/-1; min-height:38px; } .yi-reader-library__actions button { padding:9px 6px; font-size:12px !important; gap:5px; } .yi-reader-toolbar > .yi-reader-appearance { margin-top:12px; } .yi-reader-library__drawer { top:auto; right:0; width:100%; height:min(76dvh,650px); max-height:calc(100dvh - var(--yi-reader-library-bottom-clearance,0px)); border-radius:18px 18px 0 0; } .yi-reader-library__header { padding:22px 20px 15px; } .yi-reader-library__header:before { content:''; position:absolute; width:34px; height:4px; border-radius:6px; background:#d4dbe4; top:8px; left:calc(50% - 17px); } .yi-reader-library__footer { padding-bottom:max(16px,env(safe-area-inset-bottom)); } .yi-reader-library__editor { padding:22px; } }
@media(prefers-reduced-motion:reduce) { [data-yi-reader-library] * { transition:none !important; } }
