.tip {
  position: relative;
  border-bottom: 1px dotted #6b7280;
  cursor: help;
  text-decoration: none;
  color: inherit;
}
.tip:focus { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 2px; }

.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 280px;
  padding: 10px 12px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  border-radius: 8px;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.tip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 6px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
}
.tip:hover::after,
.tip:focus::after,
.tip.is-open::after,
.tip:hover::before,
.tip:focus::before,
.tip.is-open::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .tip::after { max-width: 240px; font-size: 12px; }
}
