/* Yolt v11 — tooltip + popover (3 variants)
 * Source: _DESIGN_HANDOFF/_DESIGN_BATCH_4b_forms-badges-tooltips.html (Section F)
 */

/* ════════ TOOLTIPS ════════ */
.tip-stage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-xl);
  min-height: 240px;
}
.tip-cell {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-md);
  position: relative;
}
.tip-cell .label {
  font-family: ui-monospace, monospace; font-size: 11.5px;
  color: var(--ink-3); letter-spacing: 0.02em;
}
.tip-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  height: 32px;
  color: var(--ink-1);
  font-size: 13px;
  cursor: pointer;
  font: inherit;
  font-family: 'Inter Tight', sans-serif;
}
.tip-trigger:hover { background: var(--bg-3); border-color: var(--ink-3); }
.tip-trigger svg { width: 14px; height: 14px; stroke: var(--ink-2); fill: none; stroke-width: 1.5; }

.tooltip-hover {
  position: absolute;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink-0);
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  max-width: 220px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 100;
  white-space: normal;
}
.tip-trigger:hover + .tooltip-hover,
.tooltip-hover.is-visible {
  opacity: 1;
}
.tooltip-hover.pos-top    { bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-6px); }
.tooltip-hover.pos-bottom { top: 100%;    left: 50%; transform: translateX(-50%) translateY(6px); }
.tooltip-hover.pos-left   { right: 100%; top: 50%; transform: translateY(-50%) translateX(-6px); }
.tooltip-hover .tail {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.tooltip-hover.pos-top .tail    { bottom: -5px; left: 50%; transform: translateX(-50%) rotate(45deg); border-top: none; border-left: none; }
.tooltip-hover.pos-bottom .tail { top: -5px;    left: 50%; transform: translateX(-50%) rotate(45deg); border-bottom: none; border-right: none; }
.tooltip-hover.pos-left .tail   { right: -5px;  top: 50%;  transform: translateY(-50%) rotate(45deg); border-bottom: none; border-left: none; }

.tip-sticky {
  position: absolute;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-high);
  padding: var(--space-md) var(--space-lg);
  max-width: 280px;
  display: none;
  z-index: 200;
  top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
}
.tip-sticky.is-open { display: block; }
.tip-sticky .close {
  position: absolute; top: 6px; right: 6px;
  border: none; background: transparent;
  color: var(--ink-3); cursor: pointer;
  width: 18px; height: 18px; padding: 0;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  font-size: 14px; line-height: 1;
}
.tip-sticky .close:hover { background: var(--bg-2); color: var(--ink-0); }
.tip-sticky .formula {
  font-family: ui-monospace, monospace; font-size: 12.5px;
  color: var(--ink-0);
  background: var(--bg-2);
  padding: 6px 8px; border-radius: 3px;
  margin: 6px 0;
}
.tip-sticky p { margin: 4px 0; font-size: 12.5px; color: var(--ink-1); }
.tip-sticky .heading {
  font-size: 12px; font-weight: 600; color: var(--ink-0);
  margin: 0 0 4px;
  font-family: ui-monospace, monospace;
}

.popover-rich {
  position: absolute;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 12px 32px color-mix(in oklch, oklch(0 0 0) 50%, transparent);
  width: 320px;
  display: none;
  z-index: 200;
  top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  overflow: hidden;
}
.popover-rich.is-open { display: block; }
.popover-rich .popover-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px; font-weight: 600; color: var(--ink-0);
}
.popover-rich .popover-h .close {
  border: none; background: transparent;
  color: var(--ink-3); cursor: pointer;
  width: 22px; height: 22px; padding: 0; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 16px;
}
.popover-rich .popover-h .close:hover { background: var(--bg-2); color: var(--ink-0); }
.popover-rich .popover-body {
  padding: var(--space-md) var(--space-lg);
  font-size: 12.5px; color: var(--ink-1);
}
.popover-rich .popover-body p { margin: 0 0 6px; }
.popover-rich .popover-body code {
  background: var(--bg-2); color: var(--ink-0);
  padding: 1px 5px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 11.5px;
}
.popover-rich .popover-foot {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-2);
  border-top: 1px solid var(--line-soft);
}
.popover-rich .popover-foot a {
  color: var(--brand); font-size: 12px; text-decoration: none;
}
.popover-rich .popover-foot a:hover { text-decoration: underline; }
.popover-rich .popover-foot .got-it {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--bg-0);
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: var(--r-sm);
  cursor: pointer;
}
.popover-rich .popover-foot .got-it:hover { background: color-mix(in oklch, var(--brand) 80%, var(--ink-0)); }

.popover-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--bg-0) 40%, transparent);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 150;
}
.popover-backdrop.is-open { display: block; }

.batch-foot {
  border-top: 1px solid var(--line-soft);
  padding-top: var(--space-md);
  font-family: ui-monospace, monospace; font-size: 11.5px;
  color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: var(--space-md);
}
.batch-foot b { color: var(--ink-1); font-weight: 600; }