/* ─────────────────────────────────────────────────────────────
   Q Signals — shared jargon tooltips (PR H)
   Usage:
     <span data-qtip="Q Score">Q Score</span>
   The hover bubble is auto-rendered by tooltips.js using the
   QTIPS dictionary (jargon → plain-English explanation).

   Manual override: <span data-qtip="custom" data-qtip-text="...">
   ───────────────────────────────────────────────────────────── */
.qtip {
  position: relative;
  border-bottom: 1px dotted rgba(148, 163, 184, .55);
  cursor: help;
}
.qtip:focus { outline: none; }
.qtip::after {
  content: attr(data-qtip-text);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 320px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: .78rem;
  line-height: 1.4;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  border: 1px solid rgba(148, 163, 184, .25);
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, visibility .12s ease;
  pointer-events: none;
  z-index: 9000;
  white-space: normal;
  text-align: left;
}
.qtip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, visibility .12s ease;
  pointer-events: none;
  z-index: 9001;
}
.qtip:hover::after,
.qtip:focus::after,
.qtip:hover::before,
.qtip:focus::before {
  opacity: 1;
  visibility: visible;
}
/* Edge alignment helpers when bubble would clip */
.qtip[data-qtip-align="left"]::after { left: 0; transform: translateX(0); }
.qtip[data-qtip-align="left"]::before { left: 12px; transform: translateX(0); }
.qtip[data-qtip-align="right"]::after { left: auto; right: 0; transform: translateX(0); }
.qtip[data-qtip-align="right"]::before { left: auto; right: 12px; transform: translateX(0); }
/* Below-anchor placement */
.qtip[data-qtip-pos="below"]::after { bottom: auto; top: calc(100% + 8px); }
.qtip[data-qtip-pos="below"]::before { bottom: auto; top: calc(100% + 2px); border-top-color: transparent; border-bottom-color: #1e293b; }

/* Inline icon variant — adds a small (?) circle as the trigger */
.qtip-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  background: rgba(148, 163, 184, .25);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, sans-serif;
  margin-left: 4px;
  vertical-align: middle;
  cursor: help;
  user-select: none;
}
.qtip-icon::before { content: "?"; }
