/* ─────────────────────────────────────────────────────────────────
 * Go Fish — Sistema de Helpers de Explicabilidade
 * Padrões: 1) "i" persistente em KPIs · 2) sublinhado pontilhado · 3) "?" inline
 * Tooltips abrem em click (desktop) e touch (mobile).
 * ───────────────────────────────────────────────────────────────── */

/* Container ─ qualquer um dos 3 padrões compartilha */
.gf-help-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

/* Esconde o popover por padrão. Especificidade alta para prevenir vazamento.
   Quando o JS adiciona .is-open, a regra abaixo .gf-help-popover.is-open vence. */
.gf-help-wrap > .gf-help-popover,
.gf-help-popover {
  display: none !important;
}
.gf-help-wrap > .gf-help-popover.is-open,
.gf-help-popover.is-open {
  display: block !important;
}

/* ─── Botões de gatilho ──────────────────────────────────────────── */
.gf-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(148, 163, 184, .18);
  color: var(--gf-text-muted, #94a3b8);
  border: 0;
  cursor: pointer;
  padding: 0;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
  transition: background .15s, color .15s;
  vertical-align: middle;
}
.gf-help-icon:hover,
.gf-help-icon[aria-expanded="true"] {
  background: rgba(56, 189, 248, .22);
  color: var(--gf-primary, #38bdf8);
}
/* o "i" usa fonte serifada itálica para parecer com o glyph clássico */
.gf-help-icon-i {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}
.gf-help-icon-q { font-family: inherit; }

/* Termo sublinhado pontilhado (padrão 2) */
.gf-help-term {
  background: transparent;
  border: 0;
  padding: 0 1px;
  font: inherit;
  color: inherit;
  cursor: help;
  border-bottom: 1.5px dotted rgba(148, 163, 184, .45);
  transition: background .15s, border-color .15s, color .15s;
}
.gf-help-term:hover,
.gf-help-term[aria-expanded="true"] {
  border-bottom-color: var(--gf-primary, #38bdf8);
  border-bottom-style: solid;
  color: var(--gf-primary, #38bdf8);
  background: rgba(56, 189, 248, .06);
}

/* ─── Popover (compartilhado entre os 3 padrões) ─────────────────── */
.gf-help-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: 260px;
  max-width: 88vw;
  background: var(--gf-bg-popover, #0a1424);
  border: 1px solid var(--gf-border, rgba(148, 163, 184, .2));
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .78rem;
  color: var(--gf-text, #cbd5e1);
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .55);
  cursor: default;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* "Setinha" do popover */
.gf-help-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-top-color: var(--gf-bg-popover, #0a1424);
}
/* Quando o popover não couber para cima, vira para baixo via classe `gf-help-flip` */
.gf-help-popover.gf-help-flip {
  bottom: auto;
  top: calc(100% + 8px);
}
.gf-help-popover.gf-help-flip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--gf-bg-popover, #0a1424);
}

/* Conteúdo do popover */
.gf-help-popover-title {
  color: var(--gf-primary, #38bdf8);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  margin-bottom: 5px;
}
.gf-help-popover-desc {
  font-size: .76rem;
  color: var(--gf-text, #cbd5e1);
  margin-bottom: 4px;
}
.gf-help-popover-sep {
  border-top: 1px solid var(--gf-border, rgba(148, 163, 184, .15));
  margin: 7px 0 6px;
}
.gf-help-popover-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .74rem;
}
.gf-help-popover-row span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--gf-text, #f1f5f9);
}
.gf-help-popover-row.gf-help-popover-total {
  color: var(--gf-primary, #38bdf8);
  font-weight: 700;
}
.gf-help-popover-row.gf-help-popover-total span:last-child {
  color: var(--gf-primary, #38bdf8);
}
.gf-help-popover-example {
  font-size: .72rem;
  color: var(--gf-text-muted, #94a3b8);
  background: rgba(56, 189, 248, .05);
  padding: 7px 9px;
  border-radius: 5px;
  border-left: 2px solid var(--gf-primary, #38bdf8);
  line-height: 1.55;
}
.gf-help-popover-example-tag {
  display: inline-block;
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gf-primary, #38bdf8);
  font-weight: 700;
  margin-right: 5px;
  vertical-align: 1px;
}
.gf-help-popover-more {
  margin-top: 8px;
  text-align: right;
}
.gf-help-popover-more a {
  font-size: .72rem;
  color: var(--gf-primary, #38bdf8);
  text-decoration: none;
  font-weight: 500;
}
.gf-help-popover-more a:hover { text-decoration: underline; }

/* ─── Mobile: popover vira modal/sheet centralizado ──────────────── */
@media (max-width: 600px) {
  .gf-help-popover {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    top: auto;
    transform: none;
    width: auto;
    max-width: none;
  }
  .gf-help-popover::after { display: none; }
}
