/* Woogeul reactions and field-adjacent emoji picker. */

.woogle-inline-emoji {
  display: inline-block;
  width: 2.15em;
  height: 2.15em;
  margin: -.55em .08em -.48em;
  object-fit: contain;
  vertical-align: baseline;
}

.woogle-single-emoji {
  line-height: 1;
}

.woogle-single-emoji > .woogle-inline-emoji {
  width: 6.45em;
  max-width: min(108px, 30vw);
  height: 6.45em;
  max-height: min(108px, 30vw);
  margin: -.12em .02em -.18em;
  vertical-align: middle;
}

.woogle-reaction-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.community-reaction-chip .community-reaction-option-glyph {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.community-reaction-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.community-reaction-option {
  min-height: 104px;
}

.community-reaction-option .community-reaction-option-glyph {
  width: 58px;
  min-width: 58px;
  height: 58px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.woogle-emoji-trigger {
  position: fixed;
  z-index: 5600;
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(8 116 84 / 22%);
  border-radius: 15px;
  background: rgb(255 255 255 / 94%);
  padding: 1px;
  box-shadow: 0 8px 24px rgb(7 84 61 / 16%);
  backdrop-filter: blur(10px);
}

.woogle-emoji-trigger[hidden] {
  display: none !important;
}

.woogle-emoji-trigger img {
  width: 37px;
  height: 37px;
  object-fit: contain;
}

.woogle-emoji-trigger:hover,
.woogle-emoji-trigger:focus-visible {
  border-color: #65aa8d;
  background: #edf8f3;
  outline: 0;
  transform: translateY(-1px);
}

.woogle-emoji-picker {
  position: fixed;
  z-index: 7000;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  width: min(440px, calc(100vw - 24px));
  max-height: min(620px, calc(100dvh - 28px));
  overflow: hidden;
  gap: 10px;
  border: 1px solid #dce8e2;
  border-radius: 22px;
  background: rgb(255 255 255 / 98%);
  padding: 14px;
  box-shadow: 0 24px 76px rgb(7 35 24 / 24%);
  backdrop-filter: blur(18px);
}

.woogle-emoji-picker > header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.woogle-emoji-picker > header > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.woogle-emoji-picker > header strong {
  color: #123f31;
  font-size: 17px;
}

.woogle-emoji-picker > header small {
  color: #6a786f;
  font-size: 11px;
}

.woogle-emoji-picker > header button {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #f0f5f2;
  color: #53635b;
  padding: 0;
}

.woogle-emoji-grid {
  display: grid;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  overscroll-behavior: contain;
}

.woogle-emoji-grid button {
  display: grid;
  min-width: 0;
  min-height: 82px;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f7faf8;
  color: #426054;
  padding: 4px 2px;
  font-size: 9.5px;
  font-weight: 750;
}

.woogle-emoji-grid button:hover,
.woogle-emoji-grid button:focus-visible {
  border-color: #97c9b5;
  background: #eaf6f1;
  outline: 0;
}

.woogle-emoji-grid img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

@media (max-width: 520px) {
  .woogle-emoji-picker {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(68dvh, 590px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    padding: 13px max(10px, env(safe-area-inset-right)) max(13px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .woogle-emoji-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .woogle-emoji-grid button {
    min-height: 76px;
  }

  .woogle-emoji-grid img {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .woogle-emoji-trigger {
    transition: none;
  }
}
