.slider-container,
.slider-label,
.slider-description,
.info-tooltip,
#customizeOverlay .dialog-header,
#customizeOverlay .dialog-body,
#customizeOverlay .customize-footer {
  --hg-slider-bg: #ffffff;
  --hg-slider-surface: #f7f8fa;
  --hg-slider-text: #222;
  --hg-slider-text-secondary: #333;
  --hg-slider-border: #e0e0e0;
  --hg-slider-border-strong: #bbb;
  --hg-slider-track: #dcdcdc;
  --hg-slider-tick: #bbb;
  --hg-slider-tooltip-bg: #333;
  --hg-slider-tooltip-fg: #ffffff;
  --hg-slider-scrollbar: #e5e5e5;
  --hg-slider-scrollbar-thumb: #8a8a8a;
}

.slider-container {
  margin-bottom: 25px;
  min-height: 85px;
}
.slider-label {
  font-weight: bold;
  color: var(--hg-slider-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 20px;
  line-height: 20px;
}
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #0052D5;
  color: white;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  position: relative;
  flex-shrink: 0;
}
.info-tooltip {
  position: fixed;
  bottom: auto;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hg-slider-tooltip-bg);
  color: var(--hg-slider-tooltip-fg);
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 280px;
  width: max-content;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  font-weight: normal;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}
.info-tooltip.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.info-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
}
.info-tooltip.above::after {
  top: 100%;
  border-top-color: var(--hg-slider-tooltip-bg);
}
.info-tooltip.below::after {
  bottom: 100%;
  border-bottom-color: var(--hg-slider-tooltip-bg);
}
.custom-slider-wrapper {
  position: relative;
  height: 30px;
  margin-top: 15px;
  margin-bottom: 15px;
}
.slider-track {
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 20px;
  background: var(--hg-slider-track);
  border: 1px solid var(--hg-slider-border-strong);
  border-radius: 15px;
  z-index: 1;
  overflow: hidden;
}
.slider-fill {
  height: 100%;
  border-radius: 15px 0 0 15px;
  width: 0%;
  transition: width 0.1s ease-out, background 0.1s ease-out;
}
.tick-line {
  position: absolute;
  top: 6px;
  height: 18px;
  width: 2px;
  background: var(--hg-slider-tick);
  z-index: 2;
  pointer-events: none;
}
input[type="range"].hg-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 30px;
  background: transparent;
  position: relative;
  z-index: 3;
  margin: 0;
}
input[type="range"].hg-slider::-webkit-slider-runnable-track {
  height: 20px;
  background: transparent;
  border: none;
}
input[type="range"].hg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--knob-color, #deebf7);
  border: 2px solid #a8a8a8;
  cursor: pointer;
  margin-top: -8px;
  z-index: 4;
  position: relative;
}
input[type="range"].hg-slider::-moz-range-track {
  height: 20px;
  background: transparent;
  border: none;
}
input[type="range"].hg-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--knob-color, #deebf7);
  border: 2px solid #a8a8a8;
  cursor: pointer;
  z-index: 4;
  position: relative;
}
.slider-description {
  margin-top: 0;
  font-size: 0.95em;
  color: var(--hg-slider-text-secondary);
  height: 20px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slider-description.is-expandable {
  cursor: pointer;
}

.slider-description.is-expandable:focus-visible {
  outline: 2px solid #0052D5;
  outline-offset: 2px;
  border-radius: 2px;
}

.slider-description.is-expanded {
  height: auto;
  line-height: 1.4;
  max-height: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* Customize overlay custom scrollbar (single, stable scrollbar) */
#customizeOverlay .dialog-body.hg-custom-scroll-area {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#customizeOverlay .dialog-body.hg-custom-scroll-area::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#customizeOverlay .dialog-container {
  position: relative;
}

#customizeOverlay .hg-custom-scrollbar {
  position: absolute;
  right: 8px;
  width: 8px;
  border-radius: 999px;
  background: var(--hg-slider-scrollbar);
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease;
  z-index: 5;
}

#customizeOverlay .hg-custom-scrollbar.is-hidden {
  opacity: 0;
  visibility: hidden;
}

#customizeOverlay .hg-custom-scrollbar-thumb {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 999px;
  background: var(--hg-slider-scrollbar-thumb);
}

@media (prefers-color-scheme: dark) {
  .slider-container,
  .slider-label,
  .slider-description,
  .info-tooltip,
  #customizeOverlay .dialog-header,
  #customizeOverlay .dialog-body,
  #customizeOverlay .customize-footer {
    --hg-slider-bg: var(--hg-dark-bg, #161a1f);
    --hg-slider-surface: var(--hg-dark-surface, #22272f);
    --hg-slider-text: var(--hg-dark-text, #e8ecf0);
    --hg-slider-text-secondary: var(--hg-dark-text-secondary, #a0a8b4);
    --hg-slider-border: var(--hg-dark-border, #3a4150);
    --hg-slider-border-strong: var(--hg-dark-border, #3a4150);
    --hg-slider-track: #2a313b;
    --hg-slider-tick: #3a4150;
    --hg-slider-tooltip-bg: #2a313b;
    --hg-slider-tooltip-fg: var(--hg-dark-text, #e8ecf0);
    --hg-slider-scrollbar: #5c5c5c;
    --hg-slider-scrollbar-thumb: #9aa0a6;
  }

  #customizeOverlay .dialog-header,
  #customizeOverlay .dialog-body,
  #customizeOverlay .customize-footer {
    background: var(--hg-slider-bg);
    color: var(--hg-slider-text);
  }

  #customizeOverlay .dialog-header {
    border-bottom: 1px solid var(--hg-slider-border);
  }

  #customizeOverlay .customize-footer {
    border-top: 1px solid var(--hg-slider-border);
  }
}
