.portal-sticker-picker[data-picker-enhanced="1"] {
  box-sizing: border-box;
  right: 48px;
  bottom: calc(100% + 4px);
  left: auto;
  width: min(382px, calc(100vw - 20px));
  height: min(500px, calc(100dvh - 150px));
  min-height: 360px;
  padding: 0;
  border: 1px solid #d8dfe5;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 46px 48px minmax(0, 1fr) 48px;
  gap: 0;
  overflow: hidden;
  background: #fff;
  color: #26323c;
  box-shadow: 0 18px 48px rgba(23, 31, 38, 0.22);
}

.portal-picker-tabs {
  min-width: 0;
  padding: 0 10px;
  border-bottom: 1px solid #e4e8eb;
  display: flex !important;
  align-items: stretch;
  gap: 4px !important;
}

.portal-sticker-picker .portal-picker-tabs > button {
  position: relative;
  width: auto;
  min-width: 88px;
  height: 45px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  background: transparent;
  color: #6b7781;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.portal-sticker-picker .portal-picker-tabs > button::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: transparent;
}

.portal-sticker-picker .portal-picker-tabs > button:hover { background: #f3f6f8; }
.portal-sticker-picker .portal-picker-tabs > button.is-active { color: #347dbd; }
.portal-sticker-picker .portal-picker-tabs > button.is-active::after { background: #3d83c5; }

.portal-picker-search {
  min-width: 0;
  padding: 7px 12px;
  display: block;
}

.portal-picker-search input {
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: none;
  background-color: #eef2f5;
  background-image: url("/admin/icons/search.svg");
  background-position: 10px center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  color: #26323c;
  font: inherit;
  font-size: 13px;
}

.portal-picker-search input:focus {
  border-color: #79aedd;
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(61, 131, 197, 0.12);
}

.portal-picker-content {
  min-width: 0;
  min-height: 0;
  padding: 0 8px 7px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 32px minmax(0, 1fr);
  gap: 0 !important;
  overflow: hidden;
}

.portal-picker-content > header {
  min-width: 0;
  padding: 0 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-picker-content > header strong {
  overflow: hidden;
  color: #4f5d68;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-picker-content > header small {
  margin-left: auto;
  color: #8a959e;
  font-size: 10px;
}

.portal-picker-grid {
  min-width: 0;
  min-height: 0;
  padding: 2px 3px 8px;
  display: grid;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #bdc6cd transparent;
  scrollbar-width: thin;
}

.portal-picker-grid--emoji { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.portal-picker-grid--stickers { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }

.portal-sticker-picker .portal-picker-grid > button {
  width: 100%;
  min-width: 0;
  border: 0;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  line-height: 1;
  transition: background 100ms ease, transform 100ms ease;
}

.portal-sticker-picker .portal-picker-grid--emoji > button {
  aspect-ratio: 1;
  border-radius: 6px;
  font-size: 27px;
}

.portal-sticker-picker .portal-picker-grid--stickers > button {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #f2f5f7;
  font-size: 32px;
}

.portal-sticker-picker .portal-picker-grid > button:hover,
.portal-sticker-picker .portal-picker-grid > button:focus-visible {
  background: #e6f0f8;
  outline: none;
  transform: translateY(-1px);
}

.portal-picker-empty {
  grid-row: 2;
  margin: auto;
  padding: 20px;
  color: #7b8791;
  font-size: 12px;
  text-align: center;
}

.portal-picker-empty[hidden] { display: none !important; }

.portal-picker-categories {
  min-width: 0;
  padding: 4px 8px;
  border-top: 1px solid #e3e8eb;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
  overflow-x: auto;
  background: #f7f9fa;
}

.portal-sticker-picker .portal-picker-categories > button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 0;
  border-radius: 50%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 19px;
}

.portal-sticker-picker .portal-picker-categories > button:hover { background: #e9eef2; }
.portal-sticker-picker .portal-picker-categories > button.is-active { background: #dcecf8; }

@media (max-width: 640px) {
  .portal-sticker-picker[data-picker-enhanced="1"] {
    right: 0;
    bottom: calc(100% + 3px);
    width: min(382px, 100%);
    height: min(500px, 64dvh);
    min-height: 330px;
  }

  .portal-picker-tabs { padding-inline: 6px; }
  .portal-sticker-picker .portal-picker-tabs > button { min-width: 82px; padding-inline: 8px; }
  .portal-picker-search { padding-inline: 9px; }
  .portal-picker-grid--emoji { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .portal-picker-grid--stickers { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
  .portal-sticker-picker .portal-picker-grid--emoji > button { font-size: 25px; }
  .portal-sticker-picker .portal-picker-grid--stickers > button { font-size: 29px; }
  .portal-picker-categories { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-sticker-picker .portal-picker-grid > button { transition: none; }
}
