.wsfr-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
  align-items: center;
  position: relative;
}

.wsfr-reaction-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.wsfr-reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(17, 24, 39, .22) !important;
  background: #fff !important;
  color: #000 !important;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
  min-height: 34px;
}

.wsfr-reaction-button span {
  color: #000 !important;
}

.wsfr-reaction-button:hover,
.wsfr-reaction-button:focus {
  transform: translateY(-1px);
  border-color: rgba(17, 24, 39, .46) !important;
  background: #f9fafb !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.10);
  outline: none;
}

.wsfr-reaction-button.is-active {
  background: #f3f4f6 !important;
  color: #000 !important;
  border-color: #000 !important;
  box-shadow: inset 0 0 0 1px #000, 0 2px 7px rgba(0,0,0,.10);
}

.wsfr-reaction-button.is-active span {
  color: #000 !important;
}

.wsfr-reaction-button:disabled {
  opacity: .55;
  cursor: wait;
}

.wsfr-emoji {
  font-size: 16px;
}

.wsfr-label {
  font-weight: 700;
  color: #000 !important;
  white-space: nowrap;
}

.wsfr-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .01em;
  background: #fff !important;
  color: #000 !important;
  border: 1px solid rgba(0,0,0,.30);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}

.wsfr-reaction-button.is-active .wsfr-count {
  background: #fff !important;
  color: #000 !important;
  border-color: #000;
}

.wsfr-count.has-count {
  background: #000 !important;
  color: #fff !important;
  border-color: #000;
}

.wsfr-reaction-button.is-active .wsfr-count.has-count {
  background: #000 !important;
  color: #fff !important;
}

.wsfr-avatar-stack {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  padding-left: 2px;
}

.wsfr-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
  border: 2px solid #fff;
  background: #e5e7eb;
  color: #111827;
  font-size: 10px;
  font-weight: 800;
  box-sizing: border-box;
}

.wsfr-reaction-button.is-active .wsfr-avatar {
  border-color: #111827;
}

.wsfr-avatar:first-child {
  margin-left: 0;
}

.wsfr-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wsfr-avatar-more {
  padding: 0 4px;
  width: auto;
  min-width: 22px;
  border-radius: 999px;
  background: #f3f4f6;
}

.wsfr-profiles-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 99996;
  min-width: 220px;
  max-width: min(300px, calc(100vw - 28px));
  padding: 10px;
  background: #fff;
  color: #111827;
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(0,0,0,.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .14s ease, visibility .14s ease, transform .14s ease;
}

.wsfr-reaction-item:hover .wsfr-profiles-popover,
.wsfr-reaction-item:focus-within .wsfr-profiles-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.wsfr-profiles-popover::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid rgba(17,24,39,.12);
  border-bottom: 1px solid rgba(17,24,39,.12);
  transform: rotate(45deg);
}

.wsfr-popover-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.2;
}

.wsfr-popover-title b {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.wsfr-profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
}

.wsfr-profile-row:hover,
.wsfr-profile-row:focus {
  background: #f3f4f6;
  outline: none;
}

.wsfr-profile-row img,
.wsfr-profile-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.wsfr-profile-row img {
  object-fit: cover;
  display: block;
}

.wsfr-profile-fallback {
  background: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.wsfr-profile-more,
.wsfr-profile-empty {
  padding: 7px 6px 2px;
  color: #6b7280;
  font-size: 12px;
}

.wsfr-emoji-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99997;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(17,24,39,.14);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  font-size: 22px;
  cursor: pointer;
  display: none;
}

body.wsfr-editor-active .wsfr-emoji-toggle {
  display: block;
}

.wsfr-emoji-panel {
  position: fixed;
  right: 18px;
  bottom: 70px;
  z-index: 99998;
  width: min(320px, calc(100vw - 36px));
  max-height: 240px;
  overflow: auto;
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.20);
}

.wsfr-emoji-panel.is-open {
  display: grid;
}

.wsfr-emoji-item {
  border: 0;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 7px 5px;
  font-size: 20px;
  cursor: pointer;
}

.wsfr-emoji-item:hover,
.wsfr-emoji-item:focus {
  background: #e5e7eb;
  outline: none;
}

.wsfr-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  z-index: 99999;
  background: #111827;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.wsfr-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .wsfr-reactions {
    gap: 7px;
  }

  .wsfr-label {
    display: inline-flex;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wsfr-reaction-button {
    padding: 7px 9px;
    gap: 5px;
  }

  .wsfr-avatar-stack {
    display: none;
  }

  .wsfr-profiles-popover {
    left: 50%;
    transform: translateX(-50%) translateY(6px);
  }

  .wsfr-reaction-item:hover .wsfr-profiles-popover,
  .wsfr-reaction-item:focus-within .wsfr-profiles-popover {
    transform: translateX(-50%) translateY(0);
  }
}
