/* The chapter index replaces the visible page scrollbar, not native scrolling. */
html{scrollbar-width:none;scrollbar-gutter:auto}
html::-webkit-scrollbar,body::-webkit-scrollbar{display:none;width:0;height:0}
/* A small address-book index with a generous pointer surface. */
.chapter-rail{--rail-ink:#244735;--rail-paper:#f6f8f0e8;position:fixed;z-index:18;right:max(10px,env(safe-area-inset-right));top:54%;transform:translateY(-50%);display:block;width:40px;border:1px solid #82967840;border-radius:26px;background:var(--rail-paper);color:var(--rail-ink);box-shadow:0 4px 22px #10291d0d,inset 0 1px 0 #fff7;backdrop-filter:blur(16px);touch-action:none;user-select:none;-webkit-user-select:none;transition:background .4s,color .4s,box-shadow .25s,opacity .25s;padding:10px 0}
.chapter-rail.chapter-dark{--rail-ink:#e1e8c8;--rail-paper:#18382dd9;border-color:#d4dfb82b;box-shadow:0 6px 24px #071a2420,inset 0 1px 0 #f4f8d510}
.chapter-rail:hover,.chapter-rail:focus-within,.chapter-rail.chapter-dragging{box-shadow:0 7px 30px #10291d24}
.chapter-grip{height:15px;display:flex;justify-content:center;align-items:center;gap:2px;pointer-events:none;opacity:.45}
.chapter-grip i{width:1px;height:7px;background:currentColor;border-radius:1px}
.chapter-stops{list-style:none;margin:0;padding:0;position:relative}
.chapter-stops:before{content:'';position:absolute;left:50%;width:1px;top:18px;bottom:18px;background:currentColor;opacity:.12;pointer-events:none}
.chapter-stops li{margin:0;padding:0;display:block}
.chapter-rail .chapter-stops a{position:relative;display:flex!important;align-items:center;justify-content:center;height:36px;width:100%;outline-offset:0;border-radius:15px}
.chapter-mark{position:relative;display:block;width:5px;height:5px;border-radius:6px;background:currentColor;opacity:.4;transition:width .2s,height .2s,opacity .2s,box-shadow .2s}
.chapter-rail a:hover .chapter-mark,.chapter-rail a:focus-visible .chapter-mark{width:12px;opacity:.85}
.chapter-rail a[aria-current] .chapter-mark{width:17px;height:5px;opacity:1;box-shadow:0 0 12px #8fba6933}
.chapter-rail a[aria-current]:after{content:'';position:absolute;width:27px;height:27px;border:1px solid currentColor;opacity:.2;border-radius:50%}
.chapter-peek{position:absolute;right:calc(100% + 12px);top:calc(var(--peek-y,38px) + 25px);transform:translate(7px,-50%);min-width:150px;max-width:min(260px,calc(100vw - 80px));width:max-content;border-radius:11px;border:1px solid #b9c5a755;background:#f4f7edfa;color:#244735;padding:13px 17px;box-shadow:0 12px 35px #0e291b20;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s,transform .25s,visibility .18s}
.chapter-peek:after{content:'';position:absolute;right:-4px;top:calc(50% - 4px);width:7px;height:7px;background:inherit;border-right:1px solid #b9c5a755;border-top:1px solid #b9c5a755;transform:rotate(45deg)}
.chapter-peek strong{display:block;font-weight:500;font-size:16px;line-height:1.5;overflow-wrap:anywhere}.chapter-peek>span{display:block;font-size:12px;color:#728466;line-height:1.5;margin-top:3px}
.chapter-dark .chapter-peek{background:#193c30f7;border-color:#c1d2a733;color:#e9eedb}.chapter-dark .chapter-peek>span{color:#adbda0}
.chapter-rail:hover .chapter-peek,.chapter-rail:focus-within .chapter-peek,.chapter-peeking .chapter-peek,.chapter-dragging .chapter-peek{opacity:1;visibility:visible;transform:translate(0,-50%)}
.chapter-dragging{cursor:grabbing}.chapter-dragging a{cursor:grabbing}
html.dialog-open .chapter-rail{opacity:0;pointer-events:none}
@media(max-width:700px){.chapter-rail{right:max(0px,env(safe-area-inset-right));width:26px;padding:7px 0;top:52%;border-radius:20px}.chapter-rail .chapter-stops a{height:32px}.chapter-grip{height:12px}.chapter-stops:before{top:16px;bottom:16px}.chapter-rail a[aria-current] .chapter-mark{width:13px}.chapter-rail a[aria-current]:after{width:23px;height:23px}.chapter-peek{top:calc(var(--peek-y,35px) + 19px);right:calc(100% + 10px);min-width:125px;padding:11px 14px}.chapter-peek strong{font-size:15px}}
@media(max-height:650px){.chapter-rail{top:53%;padding:4px 0}.chapter-grip{display:none}.chapter-rail .chapter-stops a{height:25px}.chapter-peek{top:calc(var(--peek-y,25px) + 4px)}.chapter-stops:before{top:12px;bottom:12px}}
@media(max-height:420px){.chapter-rail{top:auto;bottom:8px;transform:none}.chapter-rail .chapter-stops a{height:24px}.chapter-rail a[aria-current]:after{width:20px;height:20px}.floating{right:calc(64px + env(safe-area-inset-right))}}
@media(hover:none){.chapter-rail:hover .chapter-peek{opacity:0;visibility:hidden}.chapter-rail:focus-within .chapter-peek{opacity:0;visibility:hidden}.chapter-peeking .chapter-peek,.chapter-dragging .chapter-peek{opacity:1!important;visibility:visible!important}}
@media(prefers-reduced-motion:reduce){.chapter-rail,.chapter-mark,.chapter-peek{transition:none}}
@media(forced-colors:active){.chapter-rail{background:Canvas;color:CanvasText;border-color:CanvasText}.chapter-mark{background:CanvasText}.chapter-peek{background:Canvas;color:CanvasText}}

@media(max-height:350px){.chapter-rail{top:calc(var(--site-header-height) + 8px);bottom:8px;transform:none}.chapter-rail .chapter-stops a{height:calc((100dvh - var(--site-header-height) - 26px)/var(--chapter-count,11))}.chapter-rail a[aria-current]:after{width:17px;height:17px}.chapter-peek{padding:8px 12px}.chapter-peek>span{display:none}}
