/* A quiet gold reading line and a dock-aware return to the start. */
.page-progress{position:fixed;inset-block-start:0;inset-inline:0;height:3px;z-index:12;background:#b79b6430;pointer-events:none;overflow:hidden}
.page-progress-fill{display:block;width:100%;height:100%;background:linear-gradient(90deg,#94713a,#d6b06a,var(--gold));transform:scaleX(0);transform-origin:left}
.back-to-top{position:fixed;inset-inline-end:max(20px,env(safe-area-inset-right,0px));bottom:22px;bottom:max(calc(22px + env(safe-area-inset-bottom,0px)),var(--back-top-bottom,22px));z-index:8;display:grid;place-items:center;width:46px;height:46px;padding:0;border:1px solid var(--gold);border-radius:50%;background:var(--paper);color:var(--gold);box-shadow:0 5px 22px #211b1426;transition:background-color .2s ease,box-shadow .2s ease}
.back-to-top .icon{width:21px;height:21px;transform:rotate(-90deg)}
.back-to-top:hover{background:var(--wash);box-shadow:0 7px 25px #211b1438}
.back-to-top:focus-visible{outline:2px solid var(--gold);outline-offset:4px}
#page-top:focus{outline:none}
/* Hide in the same frame as an overlay opens, before the observer refresh. */
.intro-pending .page-progress,.intro-pending .back-to-top,body.modal-open .page-progress,body.modal-open .back-to-top{visibility:hidden;pointer-events:none}
html[dir=rtl] .page-progress-fill{transform-origin:right}
html[dir=rtl] .back-to-top{inset-inline-end:max(20px,env(safe-area-inset-left,0px))}
html[data-theme=midnight] .page-progress-fill{background:linear-gradient(90deg,#b38a46,#e4c384,var(--gold))}
@media(max-width:680px){.back-to-top{inset-inline-end:max(16px,env(safe-area-inset-right,0px));width:44px;height:44px}html[dir=rtl] .back-to-top{inset-inline-end:max(16px,env(safe-area-inset-left,0px))}}
@media(prefers-reduced-motion:no-preference){.back-to-top:not([hidden]){animation:back-to-top-enter .25s ease-out}@keyframes back-to-top-enter{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}}
@media(prefers-reduced-motion:reduce){.back-to-top{animation:none;transition:none}}
