/* Emoji reactions on posts (reactions.py + reactions.js), on the Float tokens.
   Chips float like little pills; taps settle with a spring, counts roll, calm under reduced motion. */
.reacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: var(--s-3) 0 0; }
.reacts.none { margin-top: var(--s-2); }
.reacts.none .rx-add { opacity: 0; }
.post:hover .reacts.none .rx-add, .reply:hover .reacts.none .rx-add, .reacts.none .rx-add:focus-visible, .reacts.none .rx-add[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .reacts.none .rx-add { opacity: .7; } }

.rx { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px; border: 0; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-muted); font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border); -webkit-tap-highlight-color: transparent; user-select: none;
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-med) var(--ease-liquid), transform var(--t-fast) var(--ease-spring); }
span.rx { cursor: default; }
button.rx:hover { background: var(--surface-3); color: var(--text); transform: translateY(-1px); }
button.rx:active { transform: scale(.9); }
.rx[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--accent) 55%, transparent), 0 4px 14px -6px var(--glow); }
.rx-e { font-size: 16px; line-height: 1; display: inline-block; }
.rx-n { display: inline-block; min-width: 1ch; font-variant-numeric: tabular-nums; }
.rx.in { animation: rx-in var(--t-slow) var(--ease-spring) both; }
.rx.out { animation: rx-out 220ms var(--ease-glide) both; pointer-events: none; }
.rx.hit .rx-e { animation: pop 520ms var(--ease-spring); }
.rx-n.up { animation: rx-up 340ms var(--ease-liquid); } .rx-n.down { animation: rx-down 340ms var(--ease-liquid); }
@keyframes rx-in { from { opacity: 0; transform: scale(.4); max-width: 0; padding: 0; } to { max-width: 120px; } }
@keyframes rx-out { to { opacity: 0; transform: scale(.4); max-width: 0; padding: 0; margin: 0; } }
@keyframes rx-up { from { transform: translateY(70%); opacity: 0; } }
@keyframes rx-down { from { transform: translateY(-70%); opacity: 0; } }

.rx-add { display: inline-flex; align-items: center; gap: 1px; height: 30px; padding: 0 9px; border-radius: var(--r-pill); color: var(--text-faint);
  transition: background-color var(--t-fast), color var(--t-fast), opacity var(--t-med) var(--ease-liquid), transform var(--t-fast) var(--ease-spring); }
.rx-add svg { width: 18px; height: 18px; }
.rx-add:hover, .rx-add[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.rx-add:active { transform: scale(.9); }
.rx-plus { font: 700 12px/1 var(--font-ui); margin-top: -8px; }

/* floating emoji that drifts up when you add a reaction */
.rx-burst { position: fixed; z-index: 97; pointer-events: none; font-size: 22px; line-height: 1; animation: rx-burst 900ms var(--ease-liquid) forwards; }
@keyframes rx-burst { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -14px) scale(1.25); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -70px) scale(.9) rotate(var(--rot, 0deg)); } }

/* picker + who-reacted popover (same floating look as member.css popovers) */
.rx-pop { position: fixed; z-index: 95; width: min(332px, calc(100vw - 16px)); padding: 10px; border-radius: var(--r-md); background: var(--surface-solid);
  box-shadow: var(--rim), var(--e-3); transform-origin: top left; animation: pop-in var(--t-med) var(--ease-spring) both; }
.rx-pop.up { transform-origin: bottom left; }
.rx-pop.out { opacity: 0; transform: scale(.96) translateY(-4px); transition: opacity 160ms var(--ease-glide), transform 160ms var(--ease-glide); }
.rx-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.rx-pick { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 12px; background: none; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--t-fast), transform var(--t-fast) var(--ease-spring); }
.rx-pick:hover, .rx-pick:focus-visible { background: var(--surface-2); transform: scale(1.18); }
.rx-pick:active { transform: scale(.9); }
.rx-pick[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--accent) 55%, transparent); }
.rx-pop .rx-pick { animation: rx-pick-in var(--t-med) var(--ease-spring) both; animation-delay: calc(var(--k, 0) * 12ms); }
@keyframes rx-pick-in { from { opacity: 0; transform: scale(.5) translateY(6px); } }
.rx-all { display: block; margin: 8px 4px 2px; color: var(--text-muted); }
.rx-all:hover { color: var(--accent); }
.rx-who { max-height: min(340px, 60vh); overflow: auto; }
.rx-who .rx-group h3 { margin: 6px 4px 4px; font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; }
.rx-who ul { list-style: none; margin: 0 0 8px; padding: 0; }
.rx-who li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 10px; }
.rx-who li:hover { background: var(--surface-2); }
.rx-page .rx-grid { max-width: 420px; margin-bottom: var(--s-4); }

@media (prefers-reduced-motion: reduce) {
  .rx, .rx-add, .rx-pick { transition: none; }
  .rx.in, .rx.out, .rx.hit .rx-e, .rx-n.up, .rx-n.down, .rx-pop, .rx-pop .rx-pick { animation: none; }
  .rx-burst { display: none; }
}
