
.custom-tooltip {
  position: relative;
  display: inline-block;
}

/* 기본 툴팁 스타일 (위로 표시) */
.custom-tooltip .tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);

  /* 박스 스타일 */
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: normal;       /* 줄바꿈 허용 */
  word-break: keep-all;      /* 단어 단위 줄바꿈 */
  max-width: 200px;          /* 너비 제한 */
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 10;
}

/* 호버 또는 JS로 visible 클래스를 토글할 때 */
.custom-tooltip:hover .tooltip-text,
.custom-tooltip.show-tooltip .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* 화면 밖으로 튀어나갈 때 아래에 표시하도록 반전 */
.custom-tooltip.tooltip-inverted .tooltip-text {
  top: calc(100% + 0.5rem);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
}
