/* The emoji button and its popover (emoji.js). Theme tokens only, so it follows every theme. */
.emo { position: relative; display: inline-flex; flex: none; }
body.vf .emo-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  padding: 0; margin: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; line-height: 1; cursor: pointer;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
body.vf .emo-btn:hover, body.vf .emo-btn[aria-expanded="true"] { border-color: var(--gold); background: var(--gold-soft); }
body.vf .emo-btn:focus-visible, body.vf .emo-e:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.emo-pop { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 60; width: min(328px, calc(100vw - 16px)); box-sizing: border-box;
  padding: 8px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); }
.emo-pop.right { left: auto; right: 0; }
.emo-pop.below { bottom: auto; top: calc(100% + 6px); }
.emo-pop.full { animation: emo-full .3s; }
@keyframes emo-full { 30% { border-color: var(--danger); } 60% { translate: 3px 0; } }
.emo-sec + .emo-sec { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.emo-h { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 2px 4px; }
.emo-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
body.vf .emo-e { aspect-ratio: 1; min-width: 0; width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 0; margin: 0; cursor: pointer;
  font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; color: var(--text);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
body.vf .emo-e:hover, body.vf .emo-e:focus-visible { background: var(--gold-soft); }

/* phones: big tap targets (the grid fills the width, about 42px a cell) */
@media (max-width: 640px), (pointer: coarse) {
  body.vf .emo-btn { width: 42px; height: 42px; font-size: 21px; }
  body.vf .emo-e { font-size: 26px; }
  .emo-grid { gap: 1px; }
}
@media (prefers-reduced-motion: reduce) { .emo-pop.full { animation: none; } }

/* where it sits */
.dm-compose .emo { align-self: flex-end; }
@media (min-width: 641px) and (pointer: fine) { .dm-compose .emo-btn { width: 42px; height: 42px; } }
