/* Afterword 4.0 — per-novel Dark PDF option.
   Color filter applies only to PDF pixels, never reader chrome or book artwork outside the PDF. */
#readerCanvasWrap.aw40-inverted > #pdfCanvas,
#readerCanvasWrap.aw40-inverted > #detailTiles { filter: invert(1); }
.aw40-switch { position: relative; width: 43px; height: 25px; display:inline-flex; align-items:center; flex: 0 0 auto; cursor:pointer; }
.aw40-switch input { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index:1; }
.aw40-track { background:#4a455d; border-radius:999px; width:43px; height:25px; position:relative; border:1px solid #68617e; transition:background .15s ease; }
.aw40-track::before { content:''; display:block; width:17px; height:17px; position:absolute; border-radius:50%; background:#f2efff; top:3px; left:3px; transition:transform .15s ease; }
.aw40-switch input:checked + .aw40-track { background:#9e91f2; border-color:#b2a7ff; }
.aw40-switch input:checked + .aw40-track::before { transform:translateX(17px); background:#1b1530; }
.aw40-switch input:focus-visible + .aw40-track { outline:2px solid #d8caff; outline-offset:3px; }
.aw40-pref-note { color:#a5a0bd; font-size:10px; font-weight:400; }
.reader-prefs .aw40-pdf-hint { margin-top:-12px; line-height:1.5; }
.aw40-quick[aria-pressed="true"] { background:#6d5fba; color:white; border-color:#b9a9ff; }
.aw40-quick { min-width:31px; }
@media (max-width:650px){ .zoom-controls .aw40-quick{min-width:28px;padding:0 5px}.reader-prefs .aw40-pdf-pref{min-height:27px} }
@media (prefers-reduced-motion:reduce) {
 .aw40-track,.aw40-track::before { transition:none; }
}

.reader-prefs .aw40-pdf-hint kbd{font:inherit;font-weight:700;padding:1px 5px;border:1px solid #77718f;border-radius:4px;background:#302b41;color:#f0eaff}
