/* A narrow selvage keeps the cutting scale outside the page and its controls. */
:root { --ruler-width: 18px }
@media (scripting:enabled) { html { border-right: var(--ruler-width) solid #181a1b } }
.reading-ruler {
 position: fixed; right: 0; top: 50%; transform: translateY(-50%);
 width: var(--ruler-width); z-index: 32; pointer-events: none;
 display: grid; justify-items: end; gap: 7px;
 background: #181a1b; color: #eee;
}
.ruler-scale {
 position: relative; width: 100%; height: clamp(104px,21svh,205px);
 background:
  repeating-linear-gradient(to bottom,#f1f1ef 0 1px,transparent 1px 25%) right / 100% 100% no-repeat,
  repeating-linear-gradient(to bottom,#c1c4c5 0 1px,transparent 1px 5%) right / 45% 100% no-repeat;
 border-bottom: 1px solid #d4d4d4;
}
.ruler-scale i {
 position: absolute; inset: 0; background: #181a1bc9;
 transform: scaleY(var(--remaining,1)); transform-origin: bottom;
}
.ruler-value { justify-self: center; writing-mode: vertical-rl; font: 600 10px/1 Manrope,sans-serif; font-variant-numeric: tabular-nums }
.motion-paused .ruler-scale { display: none }
.reading-ruler[hidden],.menu-open .reading-ruler,.lightbox-open .reading-ruler { visibility: hidden }
@media(max-width:700px),(max-height:500px) {
 :root { --ruler-width: 10px }
 .ruler-scale { height: 86px }
 .ruler-value { font-size: 9px }
}
@media(forced-colors:active) {
 html { border-right-width: 0 }
 .reading-ruler { display: none }
}
