/* ─── Info tooltip (generic, reusable across tables) ─────────────────────────
 *
 * Usage:
 *   <span class="info-tooltip">
 *     <button class="info-tooltip__trigger" aria-label="Column explanation">i</button>
 *     <span class="info-tooltip__bubble" role="tooltip">…</span>
 *   </span>
 *
 * Add .info-tooltip--align-end on triggers near the right edge of a container
 * to right-align the bubble instead of centering it (prevents clipping).
 *
 * Visibility: CSS-only. Bubble shows on :hover and :focus-within. No JS
 * positioning engine; all placement is declarative.
 * ────────────────────────────────────────────────────────────────────────── */

.info-tooltip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.35em;
  line-height: 1;
}

.info-tooltip__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: help;
  transition: color 120ms, border-color 120ms;
}

.info-tooltip__trigger:hover,
.info-tooltip__trigger:focus-visible {
  color: var(--color-text-primary);
  border-color: var(--color-text-primary);
  outline: none;
}

.info-tooltip__bubble {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: calc(var(--z-sticky) + 1);
  min-width: 180px;
  max-width: 280px;
  padding: 8px 10px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms, visibility 120ms;
}

.info-tooltip:hover .info-tooltip__bubble,
.info-tooltip:focus-within .info-tooltip__bubble {
  opacity: 1;
  visibility: visible;
}

/* Right-aligned variant: bubble anchored to right edge of trigger */
.info-tooltip--align-end .info-tooltip__bubble {
  left: auto;
  right: 0;
  transform: none;
}
