/* Always-visible custom scrollbar for the Add to Army unit list.
   ChromeOS may hide/overlay native scrollbars regardless of CSS, so the
   visible track/thumb below is independent of the operating-system scrollbar. */

@media (min-width: 901px) {
  .unit-browser {
    height: calc(100vh - 126px);
    max-height: calc(100vh - 126px);
  }
}

.unit-scroll-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.unit-scroll-shell .unit-sections {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 26px;
  scrollbar-width: none;
}

.unit-scroll-shell .unit-sections::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.unit-custom-scrollbar {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 5px;
  bottom: 8px;
  width: 14px;
  padding: 2px;
  border: 1px solid #d2c5ae;
  border-radius: 999px;
  background: #eee5d6;
  box-shadow: inset 0 1px 2px rgba(70, 54, 31, .08);
  cursor: pointer;
  touch-action: none;
}

.unit-custom-scrollbar[hidden] {
  display: none;
}

.unit-custom-scrollbar-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  min-height: 46px;
  border-radius: 999px;
  background: #9a7840;
  border: 1px solid #765a2f;
  box-shadow: 0 1px 2px rgba(59, 42, 19, .22);
  cursor: grab;
}

.unit-custom-scrollbar-thumb:hover,
.unit-custom-scrollbar-thumb:focus-visible {
  background: #7b5e2f;
  outline: 2px solid rgba(123, 33, 27, .25);
  outline-offset: 1px;
}

.unit-custom-scrollbar-thumb.is-dragging {
  cursor: grabbing;
  background: #6b4d25;
}

/* On the stacked mobile layout the whole army book flows naturally down the
   page, so no inner scrollbar is needed. */
@media (max-width: 900px) {
  .unit-scroll-shell {
    flex: none;
    overflow: visible;
  }

  .unit-scroll-shell .unit-sections {
    height: auto;
    overflow: visible;
    padding-right: 10px;
  }

  .unit-custom-scrollbar {
    display: none !important;
  }
}
