/* OLONE reactions: our pictures under messages, the row on hover and in the menu, the chat setting. */

.reaction-chip .olone-reaction-img {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* The row of reactions: a glass pill of pictures. */
.olone-react-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 999px;
  background: rgba(16, 22, 38, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* The quick eight and «›» always fit on one line; the opened list wraps under them at the same width. */
.olone-react-bar:not(.is-expanded) {
  flex-wrap: nowrap;
  width: max-content;
  max-width: calc(100vw - 16px);
}

.olone-react-bar.is-expanded {
  border-radius: 18px;
  width: min(372px, calc(100vw - 16px));
}

.olone-react-bar--floating {
  position: fixed;
  z-index: 1200;
  animation: olone-react-in 0.14s ease-out;
}

.olone-react-bar--menu {
  margin: 4px 4px 8px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.05);
}

.olone-react-bar__item {
  width: 38px;
  height: 38px;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease;
}

.olone-react-bar__item .olone-reaction-img {
  width: 28px;
  height: 28px;
  display: block;
  pointer-events: none;
}

.olone-react-bar__item:hover,
.olone-react-bar__item:focus-visible {
  transform: scale(1.22);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.olone-react-bar__item.is-mine {
  background: rgba(99, 102, 241, 0.32);
}

.olone-react-bar__more {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(230, 236, 255, 0.85);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.olone-react-bar__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  width: 100%;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* The heart that flies up on a double click. */
.olone-react-burst {
  position: fixed;
  z-index: 1300;
  width: 56px;
  height: 56px;
  pointer-events: none;
  animation: olone-react-burst 0.7s ease-out forwards;
}

.olone-react-burst .olone-reaction-img {
  width: 56px;
  height: 56px;
}

@keyframes olone-react-in {
  from { opacity: 0; transform: translateY(4px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes olone-react-burst {
  0% { opacity: 0; transform: scale(0.4); }
  30% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: translateY(-30px) scale(1); }
}

/* The setting in channel and chat settings. */
.olone-react-settings {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.olone-react-settings__head h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  color: rgba(244, 247, 255, 0.96);
}

.olone-react-settings__head p {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(190, 200, 225, 0.75);
}

.olone-react-settings__modes {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.olone-react-settings__modes button {
  border: 0;
  border-radius: 9px;
  padding: 7px 14px;
  background: transparent;
  color: rgba(210, 218, 240, 0.85);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.olone-react-settings__modes button.is-on {
  background: rgba(99, 102, 241, 0.45);
  color: #fff;
}

.olone-react-settings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.olone-react-settings__grid.hidden {
  display: none;
}

.olone-react-settings__grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(200, 208, 230, 0.7);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.45;
}

.olone-react-settings__grid button.is-on {
  opacity: 1;
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(99, 102, 241, 0.16);
  color: rgba(236, 240, 255, 0.95);
}

.olone-react-settings__grid .olone-reaction-img {
  width: 30px;
  height: 30px;
}

/* ---------- Reactions on the bottom edge of the bubble (owner, 2026-11-26) ---------- */

/* The row hangs half over the bubble's bottom edge; the bubble keeps room under it, so the next message never
   sits under the reactions. Many reactions wrap downward, never over the text. */
.bubble > .reaction-row:not(:empty) {
  position: relative;
  z-index: 1;
  margin: 6px -2px -20px;
  width: max-content;
  max-width: min(420px, calc(100vw - 96px));
}
.bubble:has(> .reaction-row:not(:empty)) {
  margin-bottom: 18px;
}
.bubble.out > .reaction-row:not(:empty) {
  margin-left: auto;
  justify-content: flex-end;
}

/* Direct chat: just the pictures, one from each of you. */
.reaction-chip.reaction-chip--solo {
  padding: 2px 4px;
  min-width: 0;
  border: 2px solid var(--bg, #0b1020);
  background: #232c58;
}
.reaction-chip.reaction-chip--solo .olone-reaction-img {
  width: 18px;
  height: 18px;
}
.reaction-chip.reaction-chip--solo.mine {
  background: #3d5bd9;
  border-color: var(--bg, #0b1020);
}

/* Group chats and channels: one pill, the three most common pictures and the total. */
.reaction-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 5px;
  border-radius: 999px;
  border: 2px solid var(--bg, #0b1020);
  background: #232c58;
  color: #dfe5ff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.reaction-summary.mine {
  background: #3d5bd9;
}
.reaction-summary:hover {
  filter: brightness(1.12);
}
.reaction-summary__faces {
  display: inline-flex;
  align-items: center;
}
.reaction-summary__faces .olone-reaction-img,
.reaction-summary__faces .olone-reaction-glyph {
  width: 18px;
  height: 18px;
  display: block;
  font-size: 15px;
  line-height: 18px;
}
.reaction-summary__faces > * + * {
  margin-left: -5px;
}
.reaction-summary small {
  font-size: 12px;
  font-weight: 600;
  color: inherit;
}
/* In a channel the pill sits in the post's footer, next to the views and time. */
.channel-post .reaction-row.channel-reactions .reaction-summary {
  border-color: transparent;
}

/* The list a tap on the pill opens. */
.olone-react-summary-pop {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(372px, calc(100vw - 16px));
  padding: 6px;
  border-radius: 18px;
  background: rgba(16, 22, 38, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  animation: olone-react-in 0.14s ease-out;
}
.olone-react-summary-pop__item,
.olone-react-summary-pop__add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px 0 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dfe5ff;
  font: inherit;
  cursor: pointer;
}
.olone-react-summary-pop__item .olone-reaction-img {
  width: 22px;
  height: 22px;
}
.olone-react-summary-pop__item small {
  font-size: 13px;
  font-weight: 600;
}
.olone-react-summary-pop__item.is-mine {
  background: #3d5bd9;
}
.olone-react-summary-pop__add {
  width: 34px;
  justify-content: center;
  padding: 0;
  font-size: 20px;
  color: #aeb6dc;
}
.olone-react-summary-pop__item:hover,
.olone-react-summary-pop__add:hover {
  background: rgba(255, 255, 255, 0.12);
}
.olone-react-summary-pop .olone-react-bar--menu {
  margin: 0;
  background: transparent;
  border: 0;
  padding: 0;
}

/* Group chats: the visible bubble is an inner block after the avatar, the row comes after it. */
.bubble.bubble--gc-layout > .reaction-row:not(:empty) {
  margin: -10px 0 0 58px;
  max-width: calc(100% - 66px);
}
.bubble.bubble--gc-layout.out > .reaction-row:not(:empty) {
  margin: -10px 8px 0 auto;
  align-self: flex-end;
}
.bubble.bubble--gc-layout:has(> .reaction-row:not(:empty)) {
  margin-bottom: 6px;
}
