/* gogridgo TopScroll addon — always-visible scrollbar above a wide
   table. Hand-drawn custom widget (track + draggable thumb) rather
   than a mirrored native scrollbar, because native bars are too
   inconsistent for "always visible when overflowing" across browsers
   — macOS Safari uses overlay bars that fade, Firefox auto-hides thin
   bars, bar heights differ per OS.

   Activation is automatic for every .gg-grid (topscroll.js), and the
   stylesheet + script are loaded globally from the layout. The bar is
   STICKY: on a tall grid it pins to the top of the viewport while the
   grid is in view, so horizontal scrolling never requires hunting for
   the (Chrome-hidden) bottom scrollbar. */

.gg-top-scroll-bar {
  position: sticky;
  /* Host apps with their own sticky header set --gg-topscroll-top to
     that header's height so the bar pins just below it. */
  top: var(--gg-topscroll-top, 0);
  z-index: 20;
  height: 12px;
  margin-bottom: 4px;
  /* Solid track — a translucent one would show table rows through the
     bar while it floats over them in the stuck state. */
  background: #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  touch-action: none;
}

.gg-top-scroll-thumb {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
}

.gg-top-scroll-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.gg-top-scroll-thumb:active {
  background: rgba(0, 0, 0, 0.65);
  cursor: grabbing;
}
