/* Donexa Chat Emojis & Stickers */
.wa-compose { position:relative; z-index:30; overflow:visible !important; }
.wa-emoji-btn { font-size:1.28rem !important; line-height:1; width:40px !important; }
.donexa-chat-tools-panel {
  position:absolute; left:8px; bottom:62px; width:min(430px, calc(100% - 16px));
  max-height:min(440px, 68vh); display:flex; flex-direction:column; overflow:hidden;
  background:#111b21; border:1px solid rgba(134,150,160,.24); border-radius:16px;
  box-shadow:0 14px 45px rgba(0,0,0,.45); z-index:100;
}
.donexa-chat-tools-head { display:flex; align-items:center; gap:8px; padding:8px 10px; border-bottom:1px solid rgba(134,150,160,.14); }
.donexa-chat-tools-tabs { display:flex; gap:4px; min-width:0; flex:1; }
.donexa-chat-tools-tabs button { border:0; border-radius:10px; padding:7px 10px; background:transparent; color:#9aaab4; font-size:.78rem; cursor:pointer; white-space:nowrap; }
.donexa-chat-tools-tabs button.active { background:rgba(0,168,132,.16); color:#62e6c4; }
.donexa-chat-tools-close { border:0; background:transparent; color:#aebac1; font-size:1.35rem; line-height:1; width:32px; height:32px; border-radius:50%; cursor:pointer; }
.donexa-chat-tools-close:hover { background:rgba(255,255,255,.07); color:#fff; }
.donexa-chat-tools-search-wrap { padding:8px 10px 4px; }
.donexa-chat-tools-search { width:100%; border:1px solid rgba(134,150,160,.18); background:#202c33; color:#e9edef; border-radius:10px; padding:8px 11px; outline:none; font-size:.82rem; }
.donexa-chat-tools-search::placeholder { color:#8696a0; }
.donexa-chat-tools-body { overflow-y:auto; overscroll-behavior:contain; padding:6px 8px 10px; }
.donexa-emoji-category { margin-bottom:8px; }
.donexa-emoji-label { color:#8696a0; font-size:.68rem; font-weight:700; padding:3px 5px 5px; text-transform:uppercase; letter-spacing:.04em; }
.donexa-emoji-grid { display:grid; grid-template-columns:repeat(8, minmax(0,1fr)); gap:2px; }
.donexa-emoji-choice { border:0; background:transparent; border-radius:9px; min-height:38px; padding:2px; cursor:pointer; font-size:1.45rem; line-height:1; display:flex; align-items:center; justify-content:center; }
.donexa-emoji-choice:hover, .donexa-emoji-choice:focus { background:rgba(255,255,255,.09); outline:none; transform:scale(1.04); }
.donexa-sticker-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:7px; }
.donexa-sticker-choice { border:0; padding:3px; background:transparent; border-radius:12px; cursor:pointer; }
.donexa-sticker-choice img { display:block; width:100%; aspect-ratio:1; object-fit:contain; border-radius:10px; }
.donexa-sticker-choice:hover, .donexa-sticker-choice:focus { background:rgba(255,255,255,.08); outline:none; }
.donexa-chat-tools-note, .donexa-chat-tools-empty { color:#8696a0; text-align:center; font-size:.7rem; padding:8px 4px 2px; }
.donexa-sticker-message { display:flex; justify-content:center; padding:1px; }
.donexa-sticker-message img { width:min(190px, 58vw); height:auto; display:block; border-radius:14px; }
.wa-msg-row.mine .donexa-sticker-message img { margin-left:auto; }
@media (max-width:767px) {
  .donexa-chat-tools-panel { left:6px; bottom:60px; width:calc(100vw - 12px); max-width:none; max-height:min(58vh,390px); }
  .donexa-emoji-grid { grid-template-columns:repeat(7,minmax(0,1fr)); }
  .donexa-emoji-choice { min-height:40px; font-size:1.4rem; }
  .donexa-sticker-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .donexa-sticker-message img { width:min(180px,55vw); }
}
@media (max-width:380px) {
  .wa-compose .wa-attach-btn, .wa-compose .wa-send-btn { width:36px !important; min-width:36px !important; flex-basis:36px !important; }
  .wa-compose .wa-input { padding-left:8px; padding-right:8px; }
  .donexa-emoji-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
}

/* Donexa flags + resilient sticker rendering */
.donexa-flag-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.donexa-flag-choice { border:0; background:transparent; border-radius:10px; min-height:58px; padding:4px 2px; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:#d8e0e5; }
.donexa-flag-choice:hover, .donexa-flag-choice:focus { background:rgba(255,255,255,.09); outline:none; }
.donexa-flag-emoji { font-size:1.65rem; line-height:1.1; }
.donexa-flag-choice small { display:block; width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; color:#8696a0; font-size:.57rem; }
.donexa-sticker-choice { position:relative; min-height:92px; display:flex; align-items:center; justify-content:center; }
.donexa-sticker-choice img { width:100%; height:auto; aspect-ratio:1; object-fit:contain; border-radius:10px; }
.donexa-sticker-fallback { width:100%; aspect-ratio:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; border-radius:10px; background:linear-gradient(145deg,#18232b,#26343d); border:1px solid rgba(255,255,255,.08); color:#fff; }
.donexa-sticker-fallback > span { font-size:2.25rem; line-height:1; }
.donexa-sticker-fallback small { color:#aebac1; font-size:.62rem; font-weight:700; }
.donexa-sticker-message .donexa-sticker-image { max-width:min(190px,58vw); }
.donexa-sticker-message .donexa-sticker-fallback { width:min(190px,58vw); aspect-ratio:1; }
@media (max-width:767px) {
  .donexa-flag-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .donexa-flag-emoji { font-size:1.5rem; }
  .donexa-flag-choice { min-height:54px; }
}
@media (max-width:380px) {
  .donexa-flag-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* Sticker messages should float on the conversation background instead of inheriting the normal message bubble.
   Sticker artwork already carries its own transparent alpha channel. */
.wa-msg-row.donexa-sticker-row { margin-top:4px; margin-bottom:4px; }
.wa-bubble.donexa-sticker-bubble {
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  max-width:min(220px, 70vw) !important;
}
.wa-msg-row.donexa-sticker-row .donexa-sticker-message {
  justify-content:flex-start;
  padding:0;
}
.wa-msg-row.mine.donexa-sticker-row .donexa-sticker-message {
  justify-content:flex-end;
}
.wa-bubble.donexa-sticker-bubble .donexa-sticker-message img {
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.wa-bubble.donexa-sticker-bubble .wa-msg-meta {
  display:block !important;
  margin-top:2px;
  padding:0 4px;
  background:transparent !important;
  color:rgba(174,186,193,.78);
  font-size:.65rem;
}
