/* The tooltip: one short line of help behind a small (i), for a label that
   cannot carry its own explanation. The first use is the four flag headers on
   /campaigns ("Has Island", "Dead Lead", "Private Equity", "Active Partner"),
   whose names say nothing about what each flag does.

   PORT ONLY. The React application had no tooltip, so there is nothing in
   src/client/styles for this to be byte identical to, and
   frontend/tests/test_stylesheets.py names this file as the port's own.

   HOW IT SHOWS. The bubble is `hidden` until the shell script
   (templates/components/behaviour.html) shows it: on hover and on focus for a
   mouse and a keyboard, and on a tap for a finger, which has neither. It is
   `position: fixed` and placed by that script from the trigger's own box,
   because the triggers live in table headers inside `.table-wrap`, whose
   `overflow-x: auto` would clip anything positioned inside it; a fixed box
   escapes the clip. With scripting off nothing shows, and nothing is lost that
   a screen reader had: the trigger's aria-describedby points at the bubble
   whether it is hidden or not.

   Every colour, size and space is a token (DESIGN.md). The bubble is ink on
   inverse ink, so it reads as a label and not as a panel, in both themes. */

.tip { display: inline-flex; align-items: center; vertical-align: middle; margin-left: var(--space-1); }

.tip-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--space-5); height: var(--space-5); padding: 0; margin: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--ink-3); cursor: help; font: inherit; line-height: 1;
}
.tip-trigger svg { width: var(--space-4); height: var(--space-4); }
.tip-trigger:hover,
.tip-trigger:focus-visible,
.tip-trigger[aria-expanded="true"] { color: var(--ink); background: var(--surface-3); }

/* The bubble sits above the table and the sticky topbar (z-index 20) and the
   open phone sidebar (60), and under the toasts (100), which are about
   something that just happened and must stay on top. */
.tip-bubble {
  position: fixed; z-index: 70;
  max-width: min(300px, calc(100vw - var(--space-7)));
  padding: var(--space-2) var(--space-3);
  background: var(--ink); color: var(--ink-inverse);
  font-size: var(--text-sm); font-weight: 400; line-height: 1.45;
  text-align: left; text-transform: none; white-space: normal;
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.tip-bubble[hidden] { display: none; }
