  /* Custom tooltip (replaces native title=) — matte-green, fast */
  .tip {
    position: fixed;
    z-index: 10000;
    max-width: 280px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    background: linear-gradient(180deg, rgba(36,52,46,0.96), rgba(20,36,30,0.96));
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    letter-spacing: 0.2px;
    border: 1px solid rgba(110,150,135,0.35);
    box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02) inset;
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.12s ease, transform 0.14s ease;
    white-space: pre-wrap;
    top: -9999px;
    left: -9999px;
  }
  .tip.show { opacity: 1; transform: translateY(0); }
  .tip.measuring { opacity: 0; transform: none; }
  .tip::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 8px; height: 8px;
    margin-left: -4px;
    background: inherit;
    border: 1px solid rgba(110,150,135,0.35);
    border-top: none; border-left: none;
    transform: rotate(45deg);
  }
  .tip[data-dir="up"]::after { bottom: -5px; }
  .tip[data-dir="down"]::after { top: -5px; transform: rotate(225deg); }

/* Тач: тултип показывается по long-press через JS — display управляется
   классом .tip--touch-active; без него на touch-only устройствах скрыт. */
@media (hover: none) {
  .tip:not(.tip--touch-active) { display: none !important; }
}
