/* ═══ Who's online (presence.js) — admin only, top bar ═══ */
.presence { position: relative; display: flex; align-items: center; }
.pr-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: border-color var(--ease-fast);
}
.pr-trigger:hover,
.pr-trigger.is-open { border-color: var(--primary); }
.pr-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #1baf7a; flex-shrink: 0; }
.pr-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #1baf7a;
  opacity: 0;
  animation: pr-ping 2.4s ease-out infinite;
}
@keyframes pr-ping { 0% { transform: scale(0.5); opacity: 0.7; } 100% { transform: scale(1.4); opacity: 0; } }
.pr-stack { display: inline-flex; align-items: center; }
.pr-stack .pr-av + .pr-av { margin-left: -7px; }
.pr-only { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.pr-count { font-size: 12px; font-weight: 800; color: var(--text-primary); }
.pr-av {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--tone, #C3502B);
  box-shadow: 0 0 0 2px var(--bg-surface-2);
}
.pr-more { background: var(--text-muted); }
.pr-av-lg { width: 34px; height: 34px; font-size: 12px; box-shadow: none; }

.pr-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 400;
  display: none;
  width: 340px;
  max-height: min(520px, calc(100vh - 90px));
  overflow: auto;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: 0 22px 48px -18px rgba(43, 20, 12, 0.38), 0 2px 8px rgba(0, 0, 0, 0.06);
}
.pr-panel.show { display: block; animation: pr-in 0.16s ease-out; }
@keyframes pr-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.pr-head strong { display: block; font-size: 14px; font-weight: 800; color: var(--text-primary); }
.pr-head small { font-size: 11px; color: var(--text-muted); }
.pr-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #17805c; background: var(--success-bg); }
[data-theme="dark"] .pr-badge { color: var(--success); }
.pr-group { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.pr-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.pr-row:hover { background: var(--bg-hover); }
.pr-av-wrap { position: relative; }
.pr-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #1baf7a; box-shadow: 0 0 0 2px var(--bg-surface); }
.pr-row.is-idle .pr-dot { background: var(--text-dim); }
.pr-row.is-idle .pr-av { opacity: 0.6; }
.pr-who { display: flex; flex-direction: column; min-width: 0; }
.pr-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 800; color: var(--text-primary); }
.pr-who em { margin-left: 4px; padding: 1px 6px; border-radius: 999px; font-style: normal; font-size: 10px; font-weight: 800; color: var(--primary); background: var(--primary-light); }
.pr-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-muted); }
.pr-where { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pr-where small { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.pr-row:not(.is-idle) .pr-where small { color: #17805c; font-weight: 700; }
[data-theme="dark"] .pr-row:not(.is-idle) .pr-where small { color: var(--success); }
.pr-empty { padding: 10px; font-size: 12px; color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) { .pr-pulse::after, .pr-panel.show { animation: none; } }
