html.ui-starting,html.custom-scroll-ready {
  scrollbar-width:none
}

html.ui-starting::-webkit-scrollbar,html.custom-scroll-ready::-webkit-scrollbar {
  display:none;
  width:0;
  height:0
}

.ui-starting body,.custom-scroll-ready body {
  padding-right:max(44px,env(safe-area-inset-right))
}

.page-scrollbar {
  position:fixed;
  z-index:30;
  right:max(6px,env(safe-area-inset-right));
  top:14px;
  bottom:14px;
  width:32px;
  touch-action:none;
  user-select:none;
  cursor:pointer;
  color:#171e17
}

.scroll-rail,.scroll-progress {
  position:absolute;
  left:15px;
  top:0;
  bottom:0;
  width:1px;
  background:#51593f
}

.scroll-progress {
  background:#db805b;
  transform-origin:top;
  transform:scaleY(var(--scroll-progress,0))
}

.scroll-thumb {
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:var(--thumb-height,56px);
  transform:translateY(var(--thumb-offset,0px));
  cursor:grab;
  background:#db805b;
  clip-path:polygon(8px 0,100% 0,100% 100%,8px 100%,0 50%);
  display:flex;
  align-items:center;
  justify-content:center;
  padding-left:4px
}

.scroll-percent {
  font:bold 10px/1 monospace;
  writing-mode:vertical-rl;
  letter-spacing:1px
}

.page-scrollbar:hover .scroll-thumb,.page-scrollbar:focus-visible .scroll-thumb {
  background:#efaa7d
}

.page-scrollbar:focus-visible {
  outline:1px dashed #db805b;
  outline-offset:2px
}

.is-dragging,.is-dragging .scroll-thumb {
  cursor:grabbing
}

@media(max-width:740px) {
  .ui-starting body,.custom-scroll-ready body {
    padding-right:max(28px,env(safe-area-inset-right))
  }
  .page-scrollbar {
    right:max(2px,env(safe-area-inset-right));
    width:24px;
    top:10px;
    bottom:10px
  }
  .scroll-rail,.scroll-progress {
    left:12px
  }
  .scroll-percent {
    font-size:9px
  }
}

@media(forced-colors:active) {
  html.ui-starting,html.custom-scroll-ready {
    scrollbar-width:auto
  }
  html.ui-starting::-webkit-scrollbar,html.custom-scroll-ready::-webkit-scrollbar {
    display:initial;
    width:auto;
    height:auto
  }
  .ui-starting body,.custom-scroll-ready body {
    padding-right:0
  }
  .page-scrollbar {
    display:none!important
  }
}
