.graph-depth {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  width: 170px;
  margin: 0;
  min-width: 170px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;

  .graph-depth-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 4px;
    line-height: 1;

    .graph-depth-title {
      font-weight: 600;
    }

    .graph-depth-value {
      min-width: 12px;
      font-weight: bold;
      color: var(--td-graph-accent);
    }
  }

  &.disabled {
    pointer-events: none;
    opacity: 0.6;

    .graph-depth-step,
    .graph-depth-range {
      accent-color: var(--td-graph-depth-disabled);
    }

    .graph-depth-step {
      background-color: var(--td-graph-depth-disabled);
      border-color: var(--td-graph-depth-disabled);
    }
  }

  .graph-depth-slider {
    display: flex;
    align-items: center;
    gap: 6px;

    .graph-depth-step {
      width: 16px;
      height: 16px;
      padding: 0;
      border-radius: 50%;
      border: 1px solid var(--td-graph-accent);
      background: #fff;
      color: var(--td-graph-accent);
      font-size: 11px;
      line-height: 14px;
      text-align: center;
      cursor: pointer;
    }

    .graph-depth-step:disabled {
      border-color: var(--td-graph-depth-disabled);
      color: var(--td-graph-depth-disabled);
      cursor: default;
    }

    .graph-depth-range {
      flex: 1;
      height: 18px;
      margin: 0;
      accent-color: var(--td-graph-accent);
      cursor: pointer;
    }
  }

  .graph-depth-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    color: #666;

    span {
      min-width: 12px;
      text-align: center;
      user-select: none;
    }
  }
}

.relation-graph-wrapper {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.graph-depth-v-container {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 2;
}

.graph-depth-v {
  width: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 2px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  user-select: none;

  &.disabled {
    pointer-events: none;
    opacity: 0.5;
  }

  .graph-depth-v-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--td-graph-accent);
    line-height: 1;
    margin-top: -4px;
    margin-bottom: 8px;
  }

  .graph-depth-v-track {
    position: relative;
    width: 4px;
    height: 88px;
    background: var(--td-graph-depth-inactive);
    border-radius: 2px;
    cursor: pointer;

    .graph-depth-v-fill {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: var(--td-depth-pct, 0%);
      background: var(--td-graph-accent);
      border-radius: 2px;
      transition: height 0.2s ease-out;
    }

    .graph-depth-v-thumb {
      position: absolute;
      left: 50%;
      bottom: calc(var(--td-depth-pct, 0%) - 7px);
      transform: translateX(-50%);
      width: 14px;
      height: 14px;
      background: #ffffff;
      border: 2px solid var(--td-graph-accent);
      border-radius: 50%;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
      cursor: grab;
      transition: bottom 0.1s ease-out, transform 0.1s ease-out;

      &.dragging {
        transform: translateX(-50%) scale(1.2);
        cursor: grabbing;
      }
    }
  }
}
