/* All tooltips inherit the current document palette, including portal content. */
.tooltip-surface {
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  padding: 4px 7px;
  border: 1px solid var(--border, var(--line));
  border-radius: var(--radius, 4px);
  background: var(--popover, var(--surface));
  color: var(--popover-foreground, var(--ink));
  box-shadow: 0 2px 8px #0004;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tooltip-surface :is([data-slot=kbd], kbd) {
  color: inherit;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.tooltip-arrow { fill: var(--popover, var(--surface)); }

:is(.pollux-tooltip, .bitwise-tooltip) {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--layer-popup, 230);
  pointer-events: none;
}

.pollux-tooltip { white-space: pre-line; }
.pollux-tooltip[hidden] { display: none; }
