/* Always-visible horizontal scrollbar rail.
   macOS overlay scrollbars stay hidden until the user already scrolls sideways,
   so a synced custom rail under the overflow container paints the affordance. */

.map-hscroll-shell {
  min-width: 0;
  max-width: 100%;
}

.map-hscroll-shell[data-hrail-visible="1"] > .map-hscroll-target {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Hide the native horizontal bar; the rail below replaces it. */
.map-hscroll-target {
  scrollbar-width: none;
}

.map-hscroll-target::-webkit-scrollbar:horizontal {
  height: 0;
  display: none;
}

/* When the same viewport also scrolls vertically, keep a visible V bar. */
.map-hscroll-target.map-hscroll-keep-y {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

.map-hscroll-target.map-hscroll-keep-y::-webkit-scrollbar:vertical {
  width: 10px;
}

.map-hscroll-target.map-hscroll-keep-y::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.map-hscroll-target.map-hscroll-keep-y::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
}

.map-hscroll-rail {
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 var(--map-hscroll-radius, 12px) var(--map-hscroll-radius, 12px);
  background: #f1f5f9;
  padding: 3px 6px;
  box-sizing: border-box;
}

/* Unframed overflow wrappers (inline admin tables) still get a light rail. */
.map-hscroll-shell.map-hscroll-shell--plain .map-hscroll-rail {
  border: none;
  border-radius: 0 0 6px 6px;
  background: transparent;
  padding: 4px 0 0;
}

.map-hscroll-rail-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  cursor: pointer;
}

.map-hscroll-rail-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 8px;
  min-width: 32px;
  border-radius: 999px;
  background: #94a3b8;
  cursor: grab;
}

.map-hscroll-rail-thumb:hover,
.map-hscroll-rail-thumb.is-dragging {
  background: #64748b;
}

.map-hscroll-rail-thumb.is-dragging {
  cursor: grabbing;
}
