/* Theme extension only. Keep filters off 3D transform parents and UI/watermarks. */
.yi-reader-appearance[hidden] { display: none !important; }
.yi-reader-appearance {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px;
    padding: 12px 16px; margin: 0 auto 16px; max-width: 1200px;
    background: #fff; color: #1a2e4a; border: 1px solid #d5deea; border-radius: 9px;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.yi-reader-appearance__choice, .yi-reader-appearance__paper { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; }
.yi-reader-appearance select { min-height: 44px; padding: 7px 12px; border: 1px solid #b4c1d2; border-radius: 6px; background: #fff; color: #1a2e4a; font: inherit; }
.yi-reader-appearance small { font-size: 12px; color: #657388; }
.yi-reader-appearance__help { flex-basis: 100%; margin: 0; font-size: 12px; color: #657388; }
.yi-reader-appearance, .yi-reader-appearance * { user-select: text !important; -webkit-user-select: text !important; }
.yi-reader-appearance :is(select, input, button):focus-visible,
[data-yi-reader-owned] .yi-reader-appearance-fullscreen select:focus-visible { outline: 3px solid #b58d27 !important; outline-offset: 3px !important; }
/* Override the library's earlier checkbox grid without changing its layout or controls. */
.yi-reader-toolbar > .yi-reader-appearance[data-yi-reader-appearance] { display:flex; grid-column:1/-1; gap:4px 16px; margin:0; padding:0; border:0; background:transparent; }
.yi-reader-toolbar .yi-reader-appearance__choice, .yi-reader-toolbar .yi-reader-appearance__paper { font-size:12px; }
.yi-reader-toolbar .yi-reader-appearance__help { flex:1 1 220px; font-size:11px; }
.yi-reader-appearance-fullscreen[hidden] { display:none !important; }
[data-yi-reader-owned] .yi-reader-appearance-fullscreen { position:absolute; left:50%; bottom:calc(64px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); z-index:2147483000; box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:4px 10px; width:340px; max-width:calc(100% - 24px); padding:6px 8px; background:#fff; color:#1a2e4a; border:1px solid #60718a; border-radius:5px; font:12px/1.4 sans-serif; text-align:left; white-space:normal; pointer-events:auto; }
.yi-reader-appearance-fullscreen label { display:grid; align-items:center; gap:2px; min-width:0; margin:0; }
[data-yi-reader-owned] .yi-reader-appearance-fullscreen select { box-sizing:border-box; width:100%; min-width:0; min-height:44px; padding:5px; border:1px solid #60718a; border-radius:5px; background:#fff; color:#1a2e4a; font:14px/1.4 sans-serif; }
.yi-reader-appearance-fullscreen small { grid-column:1/-1; min-width:0; font-size:11px; }
.yi-reader-appearance select:disabled, .yi-reader-appearance-fullscreen select:disabled { opacity:.65; cursor:default; }
.yi-reader-appearance-fullscreen, .yi-reader-appearance-fullscreen * { user-select:text !important; -webkit-user-select:text !important; }
.yi-reader-paper-defs { position:absolute; width:0; height:0; pointer-events:none; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] .yi-reader-appearance-fullscreen,
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] .yi-reader-appearance-fullscreen select { background:#243449; color:#e2e9f3; border-color:#60718a; }
html[data-yi-reader-theme="dark"] body { background-color: #141c28; }
html[data-yi-reader-theme="dark"] :is(.book-page, .book-content, .yi-reading-progress, .yi-reader-appearance) { background: #1c2736; color: #dce5f2; border-color: #3e4f65; }
html[data-yi-reader-theme="dark"] .yi-reading-progress__label,
html[data-yi-reader-theme="dark"] .yi-reader-appearance :is(small, .yi-reader-appearance__help) { color: #b0bed0; }
html[data-yi-reader-theme="dark"] .yi-reading-progress__label #yi-reading-progress-pct { color: #e1c77e; }
html[data-yi-reader-theme="dark"] .yi-reader-appearance select { background: #152031; color: #dce5f2; border-color: #52647c; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned],
html[data-yi-reader-night="on"] [data-yi-reader-owned] { background: #202936 !important; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] > .df-bg,
html[data-yi-reader-night="on"] [data-yi-reader-owned] > .df-bg { background: #202936 !important; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] :is(.df-ui, .df-ui-wrapper, .df-ui-controls, .df-more-container, .df-sidemenu, .df-outline-container, .df-thumbs-container) { background: #1c2736 !important; color: #dce5f2 !important; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] :is(.df-ui-btn, .df-outline-item) { color: #dce5f2 !important; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] .df-ui .df-ui-btn { background: #1c2736 !important; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] .df-ui .df-ui-btn:hover { background: #34475e !important; }
html[data-yi-reader-theme="dark"] [data-yi-reader-owned] input { background: #243449; color: #e2e9f3; border-color: #60718a; }
/* Each selector addresses a raster surface/leaf page, never the 3D CSS camera. */
[data-yi-reader-owned] .df-flipbook-3d > canvas.df-3dcanvas,
[data-yi-reader-owned] .df-flipbook-2d :is(.df-page-front, .df-page-back),
[data-yi-reader-owned] .df-zoomview > .df-viewer-wrapper > .df-page {
    filter: var(--yi-reader-paper-filter, none);
}
html[data-yi-reader-night="on"] :is(.watermark-item .watermark-text, .watermark-copyright-main) { color: rgba(255, 255, 255, .09); }
html[data-yi-reader-night="on"] .watermark-user-corner { color: rgba(255, 255, 255, .38); background: rgba(0, 0, 0, .15); }
@media (max-width: 600px) {
    .yi-reader-appearance { padding: 10px 12px; gap: 4px 16px; }
    .yi-reader-appearance__paper { flex-wrap: wrap; }
    .yi-reader-appearance__help { line-height: 1.6; }
}
#yi-reading-progress-legacy-restore { margin: 12px auto; padding: 12px 16px; max-width: 1200px; border: 1px solid #b7cde1; border-radius: 10px; background: #eef6ff; color: #203954; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#yi-reading-progress-legacy-restore[hidden] { display: none; }
#yi-reading-progress-legacy-restore button { padding: 8px 12px; border: 1px solid #294b73; border-radius: 8px; background: #294b73; color: white; cursor: pointer; }
