/* Ghost overlay scrollbar — page chrome only; inner panes keep native thumbs. */

html,
body {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.ghost-scrollbar {
  position: fixed;
  top: 10px;
  right: 5px;
  bottom: 10px;
  width: 14px;
  z-index: 40;
  display: none;
  justify-content: center;
  align-items: stretch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  user-select: none;
  touch-action: none;
}

.ghost-scrollbar.is-needed {
  display: flex;
}

.ghost-scrollbar.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.ghost-scrollbar-track {
  position: relative;
  width: 4px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.28), rgba(6, 78, 59, 0.22));
  border: 1px solid rgba(168, 85, 247, 0.22);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.55), 0 0 12px rgba(168, 85, 247, 0.12);
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
}

.ghost-scrollbar-track::before {
  content: "";
  position: absolute;
  inset: 8px 1px;
  border-radius: inherit;
  background: repeating-linear-gradient(
    to bottom,
    rgba(192, 132, 252, 0.28) 0 1px,
    transparent 1px 13px
  );
  opacity: 0.4;
  pointer-events: none;
}

.ghost-scrollbar.is-visible:hover .ghost-scrollbar-track,
.ghost-scrollbar.is-dragging .ghost-scrollbar-track {
  width: 8px;
  border-color: rgba(52, 211, 153, 0.45);
  background: linear-gradient(180deg, rgba(126, 34, 206, 0.38), rgba(16, 185, 129, 0.28));
}

.ghost-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(100% + 4px);
  min-height: 42px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, transparent 28%),
    linear-gradient(180deg, #c084fc 0%, #7c3aed 46%, #34d399 100%);
  box-shadow:
    0 0 10px rgba(168, 85, 247, 0.55),
    0 0 18px rgba(52, 211, 153, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: grab;
  will-change: transform;
}

.ghost-scrollbar-thumb::after {
  content: "";
  position: absolute;
  inset: 3px 2px auto 2px;
  height: 28%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent);
  pointer-events: none;
}

.ghost-scrollbar-bead {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ecfdf5;
  box-shadow: 0 0 8px #34d399, 0 0 14px rgba(168, 85, 247, 0.8);
  transform: translateX(-50%);
  pointer-events: none;
}

.ghost-scrollbar.is-dragging .ghost-scrollbar-thumb {
  cursor: grabbing;
  filter: brightness(1.12);
  box-shadow:
    0 0 16px rgba(52, 211, 153, 0.7),
    0 0 26px rgba(168, 85, 247, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.ghost-scroll-dragging {
  cursor: grabbing !important;
  user-select: none !important;
}

@media (pointer: coarse) {
  .ghost-scrollbar {
    display: none !important;
  }

  html,
  body {
    scrollbar-width: thin;
    scrollbar-color: #7e22ce #070312;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: block !important;
    width: 6px !important;
    height: 6px !important;
  }
}


@media print {
  .ghost-scrollbar {
    display: none !important;
  }
}
