/* Custom scroll — rail + thumb (native bar hidden) */

html.cs-page,
.cs-host {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.cs-page::-webkit-scrollbar,
.cs-host::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.cs-shell {
  position: relative;
  --cs-fade: #f5f5f2;
}

.modal-overlay > .cs-shell {
  width: min(480px, 100%);
  max-height: 88vh;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}

.modal-overlay > .cs-shell > .modal {
  width: 100%;
  max-height: 88vh;
}

.cs-shell:has(> .segmented) {
  margin-bottom: 14px;
}

.cs-shell:has(> .segmented) > .segmented {
  margin-bottom: 0;
}

.cs-shell.has-more-right::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4.5rem;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--cs-fade));
  z-index: 5;
}

.cs-rail-root {
  position: relative;
}

.cs-rail {
  --cs-size: 2px;
  --cs-size-hover: 10px;
  --cs-hit: 14px;
  position: absolute;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
}

.cs-rail.is-cs-scrolling,
.cs-rail.is-cs-hover,
.cs-rail.is-cs-dragging {
  opacity: 1;
  pointer-events: auto;
}

.cs-rail--y {
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--cs-hit);
  justify-content: flex-end;
}

.cs-rail--x {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--cs-hit);
  align-items: flex-end;
}

.cs-rail--page {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--cs-hit);
  z-index: 9998;
  pointer-events: auto;
  justify-content: flex-end;
}

.cs-thumb {
  background: rgba(18, 20, 22, 0.3);
  border-radius: 0;
  will-change: transform, width, height;
  transition:
    width 0.15s ease,
    height 0.15s ease,
    background-color 0.15s ease;
}

.cs-rail--y .cs-thumb,
.cs-rail--page .cs-thumb {
  width: var(--cs-size);
  min-height: 24px;
}

.cs-rail--x .cs-thumb {
  height: var(--cs-size);
  min-width: 24px;
}

.cs-rail.is-cs-hover .cs-thumb,
.cs-rail.is-cs-dragging .cs-thumb {
  background: rgba(18, 20, 22, 0.55);
}

.cs-rail--y.is-cs-hover .cs-thumb,
.cs-rail--y.is-cs-dragging .cs-thumb,
.cs-rail--page.is-cs-hover .cs-thumb,
.cs-rail--page.is-cs-dragging .cs-thumb {
  width: var(--cs-size-hover);
}

.cs-rail--x.is-cs-hover .cs-thumb,
.cs-rail--x.is-cs-dragging .cs-thumb {
  height: var(--cs-size-hover);
}

.cs-rail[data-cs-theme="dark"] .cs-thumb {
  background: rgba(255, 255, 255, 0.3);
}

.cs-rail[data-cs-theme="dark"].is-cs-hover .cs-thumb,
.cs-rail[data-cs-theme="dark"].is-cs-dragging .cs-thumb {
  background: rgba(255, 255, 255, 0.55);
}
