.anykey-emoji-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(30, 18, 13, 0.72);
  backdrop-filter: blur(3px);
}

.anykey-emoji-picker {
  width: min(620px, 100%);
  max-height: min(720px, calc(100vh - 2rem));
  overflow: hidden;
  color: #35241d;
  background: #fffaf0;
  border: 1px solid #c9a867;
  border-radius: 16px;
  box-shadow: 0 24px 65px rgba(23, 10, 5, 0.42);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.anykey-emoji-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.9rem;
  color: #fffaf0;
  background: linear-gradient(135deg, #542335, #7d3f39 58%, #9a6428);
}

.anykey-emoji-header strong,
.anykey-emoji-header span {
  display: block;
}

.anykey-emoji-header strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.anykey-emoji-header span {
  margin-top: 0.15rem;
  color: #f6dfb7;
  font-size: 0.82rem;
}

.anykey-emoji-close {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  font: 400 1.75rem/1 sans-serif;
  cursor: pointer;
}

.anykey-emoji-close:hover,
.anykey-emoji-close:focus-visible {
  color: #542335;
  background: #fffaf0;
  outline: 2px solid #e0bb67;
  outline-offset: 2px;
}

.anykey-emoji-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 1rem 0.75rem;
  padding: 0 0.75rem;
  background: #fff;
  border: 1px solid #d6c6ab;
  border-radius: 9px;
}

.anykey-emoji-search-wrap:focus-within {
  border-color: #9a6428;
  box-shadow: 0 0 0 3px rgba(154, 100, 40, 0.15);
}

.anykey-emoji-search {
  width: 100%;
  min-height: 2.65rem;
  margin: 0 !important;
  padding: 0.55rem 0 !important;
  color: #35241d !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  font-size: 1rem !important;
}

.anykey-emoji-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid #e1d5c1;
}

.anykey-emoji-tabs button {
  min-width: 0;
  padding: 0.4rem 0.2rem;
  color: #5a4033;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.anykey-emoji-tabs button span,
.anykey-emoji-tabs button small {
  display: block;
}

.anykey-emoji-tabs button span {
  font-size: 1.35rem;
}

.anykey-emoji-tabs button small {
  margin-top: 0.12rem;
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anykey-emoji-tabs button:hover,
.anykey-emoji-tabs button:focus-visible,
.anykey-emoji-tabs button.is-active {
  background: #f1e3c9;
  border-color: #c9a867;
  outline: 0;
}

.anykey-emoji-tabs button.is-active {
  box-shadow: inset 0 -3px 0 #7d3f39;
}

.anykey-emoji-status {
  padding: 0.7rem 1rem 0.2rem;
  color: #735a48;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.anykey-emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.25rem;
  max-height: 310px;
  padding: 0.55rem 1rem 1rem;
  overflow-y: auto;
  scrollbar-color: #b78a45 #f1e3c9;
}

.anykey-emoji-choice {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0.2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.anykey-emoji-choice:hover,
.anykey-emoji-choice:focus-visible {
  background: #f8ecd7;
  border-color: #c9a867;
  outline: 2px solid #7d3f39;
  outline-offset: 1px;
  transform: scale(1.06);
}

.anykey-emoji-picker footer {
  padding: 0.65rem 1rem;
  color: #775f50;
  background: #f5ead7;
  border-top: 1px solid #e1d5c1;
  font-size: 0.72rem;
  text-align: center;
}

#af-wrapper .mce-anykey-emoji-toolbar-button .mce-txt {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.18rem;
  line-height: 1;
}

@media (max-width: 600px) {
  .anykey-emoji-overlay {
    align-items: end;
    padding: 0;
  }

  .anykey-emoji-picker {
    width: 100%;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
  }

  .anykey-emoji-tabs {
    grid-template-columns: repeat(7, 2.8rem);
    overflow-x: auto;
  }

  .anykey-emoji-tabs button small {
    display: none;
  }

  .anykey-emoji-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    max-height: 42vh;
  }

  .anykey-emoji-choice {
    font-size: 1.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .anykey-emoji-choice:hover,
  .anykey-emoji-choice:focus-visible {
    transform: none;
  }
}
