img.fr-emote {
  display: inline-block !important;
  width: 1.55em !important;
  height: 1.55em !important;
  max-width: 32px !important;
  max-height: 32px !important;
  vertical-align: -0.28em;
  margin: 0 0.1em;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  object-fit: contain;
  image-rendering: auto;
}

/* Comments / replies / forum posts use a small font — fixed px so emotes aren't tiny */
.cb-content-cell img.fr-emote,
.comment-reply img.fr-emote,
.cb-body img.fr-emote,
.post-body img.fr-emote,
.forum-post .post-body img.fr-emote {
  width: 30px !important;
  height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  vertical-align: -0.4em;
  cursor: inherit !important;
}

.trumbowyg-editor img.fr-emote,
.trumbowyg-box img.fr-emote {
  display: inline-block !important;
  width: 1.55em !important;
  height: 1.55em !important;
  max-width: 32px !important;
  max-height: 32px !important;
  vertical-align: -0.28em;
  margin: 0 0.1em;
}

.trumbowyg-dropdown-frEmote {
  width: 280px !important;
  max-height: 240px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 7px 5px !important;
}

.trumbowyg-dropdown-frEmote button {
  display: block !important;
  float: left !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 2px !important;
  margin: 2px !important;
  line-height: 32px !important;
  text-align: center !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  background: transparent !important;
}

.trumbowyg-dropdown-frEmote .trumbowyg-frEmoteShortcodes-dropdown-button {
  float: none !important;
  clear: both !important;
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 0 0 6px auto !important;
  padding: 0 !important;
  line-height: 16px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 50% !important;
  background: #f8fafc !important;
  cursor: help !important;
}

.trumbowyg-dropdown-frEmote .trumbowyg-frEmoteShortcodes-dropdown-button:hover,
.trumbowyg-dropdown-frEmote .trumbowyg-frEmoteShortcodes-dropdown-button:focus {
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
  background: #eff6ff !important;
}

.trumbowyg-dropdown-frEmote button:hover,
.trumbowyg-dropdown-frEmote button:focus {
  border-color: #93c5fd !important;
  background: rgba(59, 130, 246, 0.12) !important;
}

.trumbowyg-dropdown-frEmote button img {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  object-fit: contain;
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: middle;
}

body.theme-dark .trumbowyg-dropdown-frEmote button:hover,
body.theme-dark .trumbowyg-dropdown-frEmote button:focus {
  border-color: #60a5fa !important;
  background: rgba(96, 165, 250, 0.15) !important;
}

body.theme-dark .trumbowyg-dropdown-frEmote .trumbowyg-frEmoteShortcodes-dropdown-button {
  color: #94a3b8 !important;
  border-color: #475569 !important;
  background: #1e293b !important;
}

body.theme-dark .trumbowyg-dropdown-frEmote .trumbowyg-frEmoteShortcodes-dropdown-button:hover,
body.theme-dark .trumbowyg-dropdown-frEmote .trumbowyg-frEmoteShortcodes-dropdown-button:focus {
  color: #93c5fd !important;
  border-color: #60a5fa !important;
  background: #0f172a !important;
}

.fr-emote-codes-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.fr-emote-codes-modal {
  width: min(420px, 100%);
  max-height: min(70vh, 560px);
  background: #fff;
  border: 1px solid #c8d5e8;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Tahoma, Verdana, Arial, sans-serif;
}

.fr-emote-codes-head {
  position: relative;
  padding: 10px 36px 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #4a77b5 0%, #2e5fa3 100%);
  color: #fff;
}

.fr-emote-codes-head strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.fr-emote-codes-hint {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.9;
}

.fr-emote-codes-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 22px;
  cursor: pointer;
}

.fr-emote-codes-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.fr-emote-codes-list {
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.fr-emote-codes-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  color: #1e293b;
}

.fr-emote-codes-row:hover,
.fr-emote-codes-row:focus {
  border-color: #93c5fd;
  background: #eff6ff;
}

.fr-emote-codes-row img.fr-emote {
  flex-shrink: 0;
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  margin: 0 !important;
}

.fr-emote-codes-row code {
  font-size: 11px;
  font-family: Consolas, "Courier New", monospace;
  color: #334155;
  word-break: break-all;
}

body.theme-dark .fr-emote-codes-modal {
  background: #1f2937;
  border-color: #374151;
}

body.theme-dark .fr-emote-codes-row {
  background: #111827;
  color: #e5e7eb;
}

body.theme-dark .fr-emote-codes-row:hover,
body.theme-dark .fr-emote-codes-row:focus {
  background: #1e3a5f;
  border-color: #60a5fa;
}

body.theme-dark .fr-emote-codes-row code {
  color: #cbd5e1;
}

body.skin-classic .fr-emote-codes-modal {
  border-radius: 0;
  border-color: #999;
}

body.skin-classic .fr-emote-codes-head {
  background: #003399;
  border-radius: 0;
}
