/* Accessible scrolling; retain the original fixed viewport layout. */
.scroll-frame {
  position: relative;
  float: left;
  width: 465px;
  height: 432px;
  margin-right: 15px;
}

.scroll-frame::before,
.scroll-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}

.scroll-frame::before {
  top: 0;
  background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0));
}

.scroll-frame::after {
  bottom: 0;
  background: linear-gradient(to top, #fff, rgba(255, 255, 255, 0));
}

.scroll-frame.has-content-above::before,
.scroll-frame.has-content-below::after {
  opacity: 1;
}

#textscroll_container {
  float: none;
  margin-right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior: contain;
}

.Scroller-Container {
  position: static;
  display: flow-root;
  width: 100%;
}

/* Native scrollbars remain the fallback until initialization succeeds. */
.scroller-ready #textscroll_container {
  scrollbar-width: none;
}

.scroller-ready #textscroll_container::-webkit-scrollbar {
  display: none;
}

#Scrollbar-Container {
  display: none;
  position: relative;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

/* Capture near misses across the full scrollbar gutter, including its label. */
#Scrollbar-Container::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: calc(6.5px - var(--scroll-hit-size, 44px) / 2);
  width: var(--scroll-hit-size, 44px);
}

.scroller-ready #Scrollbar-Container {
  display: block;
}

#Scrollbar-Container[hidden] {
  display: none;
}

.Scrollbar-Track {
  touch-action: none;
  cursor: pointer;
}

/* Expand the hit area without moving or resizing the original artwork. */
.Scrollbar-Track::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: calc(1.5px - var(--scroll-hit-size, 44px) / 2);
  width: var(--scroll-hit-size, 44px);
}

.Scrollbar-Handle {
  position: absolute;
  top: 0;
  cursor: grab;
  pointer-events: none;
}

.Scrollbar-Track.is-dragging,
.Scrollbar-Track.is-dragging .Scrollbar-Handle {
  cursor: grabbing;
}

#Scrollbar-Text {
  pointer-events: none;
}

#textscroll_container:focus-visible {
  outline: 2px solid #98002a;
  outline-offset: 4px;
}

.Scrollbar-Track:focus {
  outline: none;
}

/* Keep keyboard focus visible without outlining the full scrollbar track. */
.Scrollbar-Track:focus-visible:not(.pointer-focus) .Scrollbar-Handle {
  box-shadow: 0 0 0 2px #98002a;
}

@media (forced-colors: active) {
  .scroll-frame::before,
  .scroll-frame::after {
    display: none;
  }

  .scroller-ready #textscroll_container {
    scrollbar-width: auto;
  }

  .scroller-ready #textscroll_container::-webkit-scrollbar {
    display: block;
  }

  .scroller-ready #Scrollbar-Container {
    display: none;
  }
}
