/* GARS on-air presence dots (js/cluster-presence.js) — GU Callbook + Membership */
.gars-presence {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 0 1px 6px;
  border-radius: 50%;
  vertical-align: middle;
  cursor: help;
  outline: none;
}
/* the visible dot — a child, so its hover scale doesn't also scale the tooltip */
.gars-presence__dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gars-presence--live .gars-presence__dot {
  background: #27AE60;                                   /* --gars-success */
  box-shadow: 0 0 0 1px rgba(26, 122, 69, 0.35), 0 1px 3px rgba(26, 122, 69, 0.35);
}
.gars-presence--recent .gars-presence__dot {
  background: #CF9A2E;                                   /* --gars-donate-gold */
  box-shadow: 0 0 0 1px rgba(122, 84, 10, 0.3);
}
/* gentle "on air" pulse — transform/opacity only */
.gars-presence--live .gars-presence__dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #27AE60;
  animation: gars-presence-pulse 2.2s ease-out infinite;
}
@keyframes gars-presence-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  80%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
.gars-presence:hover .gars-presence__dot  { transform: scale(1.25); }
.gars-presence:active .gars-presence__dot { transform: scale(0.9); }
.gars-presence:focus-visible { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #1A6BBF; }

/* tooltip */
.gars-presence::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  padding: 6px 10px;
  border-radius: 8px;
  background: #1E3A5F;                                   /* --gars-navy */
  color: #FFFFFF;
  font: 600 12px/1.4 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.01em;
  width: max-content;
  max-width: min(240px, 62vw);   /* wraps onto two lines on phones */
  white-space: normal;
  box-shadow: 0 4px 12px rgba(26, 63, 168, 0.18), 0 12px 32px rgba(26, 63, 168, 0.14);
  pointer-events: none;
  opacity: 0;
  /* --tip-shift is set by js/cluster-presence.js to keep the tip on screen */
  transform: translate(calc(-50% + var(--tip-shift, 0px)), 4px);
  transition: opacity 0.18s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* flipped below the dot when there is no room above (set by js/cluster-presence.js) */
.gars-presence--tip-below::after {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translate(calc(-50% + var(--tip-shift, 0px)), -4px);
}
.gars-presence:hover::after,
.gars-presence:focus-visible::after,
.gars-presence:focus::after {
  opacity: 1;
  transform: translate(calc(-50% + var(--tip-shift, 0px)), 0);
}

/* legend line above the table */
.gars-presence-legend {
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #5D6F86;                                        /* --gars-muted */
}
.gars-presence-key {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  vertical-align: middle;
}
.gars-presence-key--live   { background: #27AE60; }
.gars-presence-key--recent { background: #CF9A2E; margin-left: 12px; }
.gars-presence-src { margin-left: 8px; }

@media (prefers-reduced-motion: reduce) {
  .gars-presence--live .gars-presence__dot::before { animation: none; opacity: 0; }
  .gars-presence__dot, .gars-presence::after { transition: none; }
}
