/* Zyra icon tooltips (2026-12-06)
   Hover (desktop) / long-press (mobile) labels for icon-only controls.
   Uses design tokens so the pill inverts correctly in dark mode:
   light theme = dark pill + light text; dark theme = light pill + dark text. */

.zyra-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100000;
  pointer-events: none;
  background: var(--zyra-ink, #111827);
  color: var(--zyra-paper, #ffffff);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.28);
  max-width: min(240px, 80vw);
  text-align: center;
  white-space: normal;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.zyra-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.zyra-tooltip::after {
  content: "";
  position: absolute;
  left: var(--zyra-tip-arrow-x, 50%);
  width: 8px;
  height: 8px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.zyra-tooltip[data-placement="top"]::after {
  top: 100%;
  margin-top: -4px;
}

.zyra-tooltip[data-placement="bottom"]::after {
  bottom: 100%;
  margin-bottom: -4px;
}

/* Controls that carry tooltips: suppress the native long-press callout and
   text selection so a press-and-hold shows the tooltip instead. Scrolling
   is unaffected (no touch-action change). */
.zyra-tip-target {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .zyra-tooltip {
    transition: none;
    transform: none;
  }
}
