/* Reactions occupy their own measured line below the unchanged message bubble. */
html body .tg-chat-container:not(.is-desktop) .tg-chat-container__message:has(> .nx-grid-host) {
  overflow: visible !important;
}
html body .tg-chat-container:not(.is-desktop) .nx-grid-host.nx-reactions-grid {
  --nx-reaction-band-width: min(330px, max(96px, calc(100vw - 76px)));
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  container-type: normal !important;
  container-name: none !important;
  margin-block: 0 !important;
  margin-inline-start: 0 !important;
  margin-inline-end: 0 !important;
  overflow: visible !important;
}
html body .tg-chat-container:not(.is-desktop) .nx-grid-host.nx-reactions-grid[data-nx-reaction-side="out"] {
  margin-inline-start: 100% !important;
  margin-inline-end: 0 !important;
}
html body .tg-chat-container:not(.is-desktop) .nx-grid-host.nx-reactions-grid .nx-reactions-flow {
  width: var(--nx-reaction-band-width) !important;
  max-width: none !important;
  container-type: inline-size;
  container-name: nx-reaction-rail;
}
html body .tg-chat-container:not(.is-desktop) .nx-grid-host.nx-reactions-grid[data-nx-reaction-side="out"] .nx-reactions-flow {
  margin-inline-start: calc(-1 * var(--nx-reaction-band-width));
}
html body .dcw-row .dcw-reactions.nx-reactions-grid {
  position: relative;
  display: block;
  flex: none;
  width: min(360px, 100%);
  max-width: 100%;
  min-width: 0;
  margin-block: 0;
  margin-inline: 0;
  padding: 0;
  overflow: visible;
}
html body .dcw-row.is-mine .dcw-reactions.nx-reactions-grid { margin-inline-start: auto; }
html body .dcw-window.is-group-conversation .dcw-row:not(.is-mine) .dcw-reactions.nx-reactions-grid {
  width: min(360px, calc(100% - 42px));
  margin-inline-start: 42px;
}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-flow {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  gap: 4px;
}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid[data-nx-reaction-side="out"] .nx-reactions-flow { justify-content: flex-end; }
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid .nx-motion-reaction-item {
  display: inline-flex;
  flex: 0 0 auto;
  height: 26px !important;
  max-width: 100%;
  min-width: 0;
}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: 26px !important;
  min-height: 26px !important;
  min-width: 32px !important;
  max-width: 100%;
  padding: 2px 5px !important;
  gap: 3px !important;
  border-radius: 13px !important;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
html body .nx-reactions-more {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 4px;
  box-sizing: border-box;
  height: 26px;
  min-width: 56px;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--mobile-theme-line, #284050);
  border-radius: 13px;
  color: var(--mobile-theme-muted, #a9c4d0);
  background: var(--mobile-theme-surface-alt, #15263a);
  font: 600 10px/1.1 system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
html body .nx-reactions-more__symbol { width: 12px; color: var(--mobile-theme-accent, #15d2df); font-size: 16px; line-height: 1; }
html body .nx-reactions-more:focus-visible { outline: 2px solid var(--mobile-theme-accent, #15d2df); outline-offset: 2px; }
html body .nx-reactions-more:active { filter: brightness(1.15); }
@media (hover: hover) {
  html body .nx-reactions-more:hover { border-color: var(--mobile-theme-accent, #15d2df); }
}

/* Three actors share a 38px stack. Keep 16px avatars and a smaller emoji glyph. */
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill) {
  --nx-reaction-icon-size: 16px !important;
  border-width: 1px !important;
  box-shadow: none !important;
}
html body .nx-reactions-grid .nx-reaction-avatars {
  isolation: isolate;
  gap: 0;
}
html body .nx-reactions-grid .nx-reaction-avatar {
  display: inline-flex !important;
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
}
html body .nx-reactions-grid .nx-reaction-avatar + .nx-reaction-avatar {
  margin-inline-start: -5px !important;
}
html body .nx-reactions-grid .nx-reaction-avatar__fallback { font-size: 9px; }
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill) > span:not([class]) {
  font-size: 14px !important;
  line-height: 1 !important;
}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill) > strong {
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 600;
}

@layer nextiVoiceLayout {
html body .tg-chat-container:not(.is-desktop) .tg-chat-container__message:has(> .nx-grid-host){overflow: visible !important}
html body .tg-chat-container:not(.is-desktop) .nx-grid-host.nx-reactions-grid{width: 0 !important;min-width: 0 !important;max-width: 0 !important;container-type: normal !important;container-name: none !important;margin-block: 0 !important;margin-inline-start: 0 !important;margin-inline-end: 0 !important;overflow: visible !important}
html body .tg-chat-container:not(.is-desktop) .nx-grid-host.nx-reactions-grid[data-nx-reaction-side="out"]{margin-inline-start: 100% !important;margin-inline-end: 0 !important}
html body .tg-chat-container:not(.is-desktop) .nx-grid-host.nx-reactions-grid .nx-reactions-flow{width: var(--nx-reaction-band-width) !important;max-width: none !important}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid .nx-motion-reaction-item{height: 26px !important}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill){display: inline-flex !important;align-items: center !important;justify-content: center !important;box-sizing: border-box !important;height: 26px !important;min-height: 26px !important;min-width: 32px !important;padding: 2px 5px !important;gap: 3px !important;border-radius: 13px !important}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill){--nx-reaction-icon-size: 16px !important;border-width: 1px !important;box-shadow: none !important}
html body .nx-reactions-grid .nx-reaction-avatar{display: inline-flex !important;flex: 0 0 16px !important;width: 16px !important;height: 16px !important}
html body .nx-reactions-grid .nx-reaction-avatar + .nx-reaction-avatar{margin-inline-start: -5px !important}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill) > span:not([class]){font-size: 14px !important;line-height: 1 !important}
html body :is(.tg-chat-container:not(.is-desktop), .dcw-row) .nx-reactions-grid :is(.tg-chat-container__reaction-pill, .dcw-reaction-pill) > strong{font-size: 10px !important;line-height: 1 !important}
}
