/* The "?" beside a word a newcomer may not know (components/Hint.jsx), and
 * the one plain line it opens. Built from shell.css's tokens, in SENDIT's
 * register: the ring is a hairline until it is pressed, then lime, as a
 * chosen preset is; the bubble is a card a shade off the panel with a
 * hairline edge, like the account's panel and a chart face's card.
 *
 * THE BUBBLE IS PLACED BY SCRIPT through --hint-x, --hint-y and --hint-tip,
 * set from an effect (never a style attribute in the markup: style-src
 * 'self'). It is fixed to the viewport, so a strip that scrolls sideways or
 * the ticket's sheet never clips it, and it is not drawn until it is placed
 * (data-side). The ring keeps the line it sits on: its negative margins give
 * the line box no more height than the words beside it, so a label with a
 * hint lines up with one without. */

.pep-hint {
  display: inline-flex;
  flex: none;
  align-items: center;
  margin: -3px 0 -3px 6px;
  vertical-align: middle;
}
.pep-hint-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--pep-line-strong);
  color: var(--pep-text-2);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
}
/* A finger-sized target around the small ring, which moves nothing. */
.pep-hint-btn::after {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  content: "";
}
.pep-hint-btn:hover { box-shadow: inset 0 0 0 1px var(--pep-text-2); color: var(--pep-text); }
.pep-hint-btn[aria-expanded="true"] { background: var(--pep-brand); box-shadow: none; color: var(--pep-brand-ink); }
.pep-hint-btn:focus-visible { outline: 2px solid var(--pep-brand); outline-offset: 2px; }

.pep-hint-pop {
  position: fixed;
  top: var(--hint-y, 0px);
  left: var(--hint-x, 0px);
  z-index: 70;
  display: block;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: var(--pep-radius-sm);
  background: var(--pep-panel-2);
  box-shadow: inset 0 0 0 1px var(--pep-line-strong), 0 18px 40px rgb(0 0 0 / 45%);
  color: var(--pep-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  white-space: normal;
}
.pep-hint-pop:not([data-side]) { visibility: hidden; }
/* The tip points at the ring, wherever the viewport's edges moved the bubble. */
.pep-hint-pop::before {
  position: absolute;
  left: var(--hint-tip, 50%);
  width: 8px;
  height: 8px;
  background: var(--pep-panel-2);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}
.pep-hint-pop[data-side="below"]::before { top: -4px; box-shadow: -1px -1px 0 0 var(--pep-line-strong); }
.pep-hint-pop[data-side="above"]::before { bottom: -4px; box-shadow: 1px 1px 0 0 var(--pep-line-strong); }

@media (prefers-reduced-motion: no-preference) {
  .pep-hint-pop[data-side] { animation: pep-hint-in 0.14s ease-out; }
  @keyframes pep-hint-in { from { opacity: 0; } to { opacity: 1; } }
}
