/* The bubble of Components/Shared/Tooltip.razor. interop.js opens it as a popover and sets its top/left. */
.tooltip {
  /* Undo the browser's popover defaults (centered, bordered, Canvas colors). */
  position: fixed;
  inset: auto;
  margin: 0;
  border: none;
  overflow: visible;

  width: max-content;
  max-width: min(220px, calc(100vw - 16px));
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  background: var(--color-text-primary);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
}

/* Fills the 6px gap to the element it belongs to, so the pointer can move onto the bubble without it closing. */
.tooltip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
}

.tooltip[data-placement="top"]::before {
  top: 100%;
}

.tooltip[data-placement="bottom"]::before {
  bottom: 100%;
}
