#emote-toggle {
  pointer-events:auto; display:inline-flex; align-items:center; gap:6px;
  min-height:44px; padding:0 12px; border:1px solid #ffffff62; border-radius:22px;
  background:var(--glass); color:var(--ivory); font:600 .84rem/1.2 system-ui; cursor:pointer;
}
.emote-face {
  position:relative; width:16px; height:16px; display:inline-block;
  border:1.4px solid currentColor; border-radius:49% 49% 47% 47%;
}
.emote-face::before {
  content:''; position:absolute; top:4px; left:3px; width:2px; height:2px;
  border-radius:50%; background:currentColor; box-shadow:6px 0 currentColor;
}
.emote-face::after {
  content:''; position:absolute; left:3px; bottom:3px; width:6px; height:3px;
  border-bottom:1.4px solid currentColor; border-radius:0 0 50% 50%;
}
#emote-menu {
  position:fixed; inset:max(150px,calc(env(safe-area-inset-top) + 130px)) auto auto max(22px,env(safe-area-inset-left));
  margin:0; padding:14px; width:min(370px,calc(100% - 24px));
  max-height:calc(100dvh - 168px); overflow:auto; overscroll-behavior:contain;
  touch-action:pan-y; color:#28372d; border:1px solid #dad9c9; border-radius:18px;
  background:#f8f6ec; box-shadow:0 8px 36px #18251c42;
}
#emote-menu::backdrop {background:rgb(19 27 19 / 23%)}
.emote-menu-head {display:flex; align-items:center; justify-content:space-between; margin:0 0 9px 2px}
#emote-heading {margin:0; font:700 1.12rem/1.3 system-ui; letter-spacing:-.045em}
#emote-close {
  display:grid; place-items:center; flex:none; width:44px; height:44px; margin:-6px -5px -5px 0;
  border:none; border-radius:50%; background:transparent; color:#52614f; font:400 1.6rem/1 system-ui; cursor:pointer;
}
.emote-choices {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px}
.emote-choice {
  position:relative; display:grid; place-items:center; grid-template-rows:1fr auto; gap:2px;
  min-width:0; padding:5px 1px 8px; background:#eeeee2; color:#28372d; border:1px solid #d7dacb;
  border-radius:11px; font:650 .86rem/1.25 system-ui; cursor:pointer; text-align:center; word-break:keep-all;
}
.emote-choice i {
  position:relative; display:block; width:min(100%,64px); aspect-ratio:1; background-repeat:no-repeat;
  background-image:url('./emote-poses.webp'); background-size:400% 200%;
}
.emote-choice i::after {
  position:absolute; top:5%; right:5%; font:700 .84rem/1 system-ui;
}
.emote-choice[data-emote=dance] i::after {content:'♪'; color:#326b64; transform:rotate(10deg)}
.emote-choice[data-emote=curious] i::after {content:'?'; color:#86591a}
.emote-choice[data-emote=heart] i::after {content:'♥'; color:#ae3855}
.emote-choice[data-emote=cheers] i::after {
  content:'☕︎'; color:#5b4536; top:36%; right:23%; font-size:.75rem;
}
.emote-choice:nth-child(4n + 1) i {background-position-x:0%}
.emote-choice:nth-child(4n + 2) i {background-position-x:33.333333%}
.emote-choice:nth-child(4n + 3) i {background-position-x:66.666667%}
.emote-choice:nth-child(4n) i {background-position-x:100%}
.emote-choice:nth-child(n + 5) i {background-position-y:100%}
#emote-menu button:focus-visible {outline:3px solid #9b6d2c; outline-offset:1px; z-index:1}
@media(hover:hover) {
  #emote-close:hover {background:#e4e7da}
  .emote-choice:hover {background:#dde5d7; border-color:#9baa91}
}
.emote-choice:active {background:#d4e0cf}
#emote-feedback {
  position:absolute; z-index:4; left:50%; bottom:max(140px,calc(env(safe-area-inset-bottom) + 110px)); transform:translateX(-50%);
  width:max-content; max-width:85%; margin:0; padding:8px 14px; border:1px solid #ffffff46; border-radius:14px;
  background:#29382eed; color:#fffaef; text-align:center; font:600 .9rem/1.4 system-ui; pointer-events:none;
}
#emote-feedback:empty {display:none}
@media(max-width:550px), (max-height:550px) {
  #emote-menu {
    inset:auto max(12px,env(safe-area-inset-right)) max(13px,calc(env(safe-area-inset-bottom) + 8px)) auto;
    max-height:calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}
@media(max-width:335px) {
  #emote-menu {padding:11px}
  .emote-choice {font-size:.80rem}
}
.emote-error {margin:9px 2px 1px; color:#865226; font-size:.89rem}
.emote-error:empty {display:none}
.emote-choices[aria-busy=true] {opacity:.76; cursor:progress}
