/*
 * TD AI Customer Service — WhatsApp message tools parity v2.4.1
 * Right-side in-chat search and WhatsApp-style per-message dropdown.
 */

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-panel.hidden,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-clear.hidden,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-empty.hidden {
  display: none !important;
}

/* Search is a real fifth-column panel so the conversation remains visible. */
@media (min-width: 901px) {
  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .inbox-view.chat-search-open {
    --td-chat-search-width: clamp(360px, 20vw, 460px);
    grid-template-columns:
      var(--td-conversation-width, clamp(380px, 27vw, 500px))
      1px
      minmax(420px, 1fr)
      1px
      var(--td-chat-search-width) !important;
  }

  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .inbox-view.chat-search-open > .chat-panel {
    grid-column: 3 !important;
  }

  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .inbox-view.chat-search-open > .customer-details,
  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .inbox-view.chat-search-open > .customer-panel-resizer {
    display: none !important;
  }

  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .inbox-view.chat-search-open > .chat-search-panel {
    display: grid !important;
    grid-column: 5 !important;
  }
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-panel {
  position: relative;
  z-index: 12;
  min-width: 0;
  height: 100%;
  grid-template-rows: 64px auto auto minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid #e9edef;
  background: #ffffff;
  color: #111b21;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-panel-header {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid #e9edef;
  background: #ffffff;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-panel-header h3 {
  margin: 0;
  color: #111b21;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-panel-close,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-date-button,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-clear {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: #54656f;
  box-shadow: none;
  cursor: pointer;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] :is(.chat-search-panel-close, .chat-search-date-button):hover,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] :is(.chat-search-panel-close, .chat-search-date-button):focus-visible {
  background: #f0f2f5;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] :is(.chat-search-panel-close, .chat-search-date-button) svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-panel-controls {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 12px;
  background: #ffffff;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-date-input {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
  opacity: 0;
  pointer-events: none;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-input-shell {
  min-width: 0;
  min-height: 40px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  padding: 0 7px 0 11px;
  border: 0;
  border-radius: 20px;
  background: #f0f2f5;
  color: #54656f;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-input-shell:focus-within {
  outline: 2px solid rgba(0, 168, 132, .22);
  outline-offset: 0;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-input-shell > svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] #chat-search-input {
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 4px;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #111b21 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 20px;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] #chat-search-input::-webkit-search-cancel-button {
  display: none;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] #chat-search-input::placeholder {
  color: #667781 !important;
  opacity: 1;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-clear {
  width: 30px;
  height: 30px;
  color: #667781;
  font-size: 21px;
  font-weight: 300;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-panel-status {
  min-height: 0;
  padding: 0 20px;
  color: #667781;
  font-size: 12px;
  line-height: 28px;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-results {
  min-height: 0;
  overflow-y: auto;
  background: #ffffff;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "direction time"
    "snippet snippet";
  gap: 4px 12px;
  margin: 0;
  padding: 12px 18px 12px 24px;
  border: 0;
  border-bottom: 1px solid #f0f2f5;
  border-radius: 0;
  background: #ffffff;
  color: #111b21;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result:hover,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result:focus-visible,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result.selected {
  background: #f0f2f5;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result-direction {
  grid-area: direction;
  overflow: hidden;
  color: #111b21;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result-direction.outbound {
  color: #008069;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result-snippet {
  grid-area: snippet;
  overflow: hidden;
  color: #3b4a54;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-result-time {
  grid-area: time;
  color: #667781;
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-empty {
  position: absolute;
  top: 174px;
  right: 20px;
  left: 20px;
  display: grid;
  place-items: center;
  min-height: 120px;
  color: #667781;
  text-align: center;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .chat-search-empty strong {
  font-weight: 400;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-row.search-match .bubble {
  outline: 1px solid rgba(0, 168, 132, .28);
  outline-offset: 2px;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-row.search-active .bubble {
  outline: 2px solid rgba(0, 168, 132, .56);
  outline-offset: 2px;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-row.search-active .bubble,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .bubble.search-highlight {
  animation: td-wa-search-focus 2.2s ease;
}

@keyframes td-wa-search-focus {
  0%, 100% { box-shadow: 0 1px 1px rgba(11, 20, 26, .13); }
  18%, 48% { box-shadow: 0 0 0 4px rgba(0, 168, 132, .34), 0 3px 10px rgba(11, 20, 26, .20); }
}

/* WhatsApp reveals a small chevron at the top corner of a hovered bubble. */
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-shell {
  top: 0 !important;
  right: 0 !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-trigger {
  z-index: 5 !important;
  width: 32px !important;
  height: 30px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 7px 0 8px !important;
  background: linear-gradient(90deg, rgba(255,255,255,0), #ffffff 45%) !important;
  color: #667781 !important;
  box-shadow: none !important;
  opacity: 0;
  pointer-events: none;
  transform: none !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-row.outbound .message-actions-trigger {
  background: linear-gradient(90deg, rgba(217,253,211,0), #d9fdd3 45%) !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-trigger svg {
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-row:hover .message-actions-trigger,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-shell.open .message-actions-trigger,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-trigger:focus-visible,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-trigger[aria-expanded="true"] {
  opacity: 1 !important;
  pointer-events: auto !important;
  background-color: transparent !important;
  color: #54656f !important;
}

/* The menu is intentionally portalled to body so it is never clipped by chat scroll. */
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] > .message-action-menu.portal-open {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  min-width: 196px !important;
  max-width: min(260px, calc(100vw - 16px)) !important;
  max-height: min(520px, calc(100dvh - 16px)) !important;
  margin: 0 !important;
  padding: 8px 0 !important;
  overflow-y: auto !important;
  border: 1px solid #e9edef !important;
  border-radius: 3px !important;
  background: #ffffff !important;
  color: #111b21 !important;
  box-shadow: 0 8px 24px rgba(11, 20, 26, .18) !important;
  white-space: normal !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] > .message-action-menu.portal-open .message-tool {
  width: 100% !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 9px 20px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #111b21 !important;
  box-shadow: none !important;
  font-size: 14.5px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
  text-align: left;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] > .message-action-menu.portal-open .message-tool svg {
  display: none !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] > .message-action-menu.portal-open .message-tool span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] > .message-action-menu.portal-open .message-tool:hover,
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] > .message-action-menu.portal-open .message-tool:focus-visible {
  background: #f5f6f6 !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] > .message-action-menu.portal-open .message-tool.danger-link {
  color: #ea0038 !important;
}

html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-action-backdrop:not(.hidden),
html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-shell.open::before {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 900px) {
  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .inbox-view.chat-search-open > .chat-search-panel {
    position: absolute !important;
    z-index: 95 !important;
    inset: 0 !important;
    display: grid !important;
    width: 100% !important;
    height: 100% !important;
    border-left: 0;
  }

  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .inbox-view.chat-search-open > .chat-panel {
    visibility: hidden;
  }
}

@media (hover: none), (pointer: coarse) {
  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-actions-trigger {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .message-row.search-active .bubble,
  html[data-theme="whatsapp"] body[data-message-tools-release="2.4.1-whatsapp-message-tools"] .bubble.search-highlight {
    animation: none;
    outline: 3px solid rgba(0, 168, 132, .30);
  }
}


/* V2.4.4 — WhatsApp desktop typography parity + visible search-keyword emphasis. */
html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"],
html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] :is(button, input, textarea, select) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] {
  font-size: 15.5px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .inbox-heading-row h1 {
  font-size: 22px !important;
  line-height: 28px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .wa-search-always input,
html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .inbox-search-row input {
  font-size: 16px !important;
  line-height: 20px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .inbox-tabs button {
  font-size: 14.5px !important;
  font-weight: 500 !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] :is(.conversation-item h4, .conversation-row .conversation-name) {
  font-size: 16.5px !important;
  font-weight: 500 !important;
  line-height: 21px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] :is(.conversation-item p, .conversation-row .conversation-preview) {
  font-size: 14.5px !important;
  line-height: 19px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .conversation-item time {
  font-size: 12px !important;
  line-height: 16px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .conversation-platform-source {
  font-size: 11px !important;
  line-height: 14px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .conversation-platform-source > small {
  font-size: 10.5px !important;
  line-height: 14px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .contact-title-block h3 {
  font-size: 17px !important;
  line-height: 22px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .bubble {
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 20.5px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] :is(.bubble small, .message-meta, .meta-text) {
  font-size: 11.5px !important;
  line-height: 15px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .composer .composer-input-shell #message-input {
  font-size: 16px !important;
  line-height: 20px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .chat-search-panel-header h3 {
  font-size: 17px !important;
  line-height: 22px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] #chat-search-input {
  font-size: 16px !important;
  line-height: 20px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .chat-search-panel-status {
  font-size: 13px !important;
  line-height: 30px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .chat-search-result-direction {
  font-size: 13.5px !important;
  line-height: 19px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .chat-search-result-snippet {
  font-size: 15.5px !important;
  line-height: 21px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .chat-search-result-time {
  font-size: 12.5px !important;
  line-height: 19px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .chat-search-empty p {
  font-size: 15px !important;
  line-height: 21px !important;
}

html[data-theme="whatsapp"] body[data-font-parity-release="2.4.4-whatsapp-font-parity"] .chat-search-keyword {
  color: #00a884 !important;
  background: transparent !important;
  font: inherit !important;
  font-weight: 650 !important;
}

/* V2.4.5 — WhatsApp quick-forward affordance, native forward picker/contact card and larger typography. */
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] {
  font-size: 16px !important;
}

/* One-tap forward arrow beside each message bubble, matching WhatsApp desktop placement. */
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-quick-forward {
  position: absolute;
  z-index: 14;
  top: 50%;
  right: -47px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(17, 27, 33, .08);
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #54656f;
  box-shadow: 0 1px 2px rgba(11, 20, 26, .16);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(.92);
  transition: opacity .12s ease, transform .12s ease, background .12s ease, color .12s ease;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-row.outbound .message-quick-forward {
  right: auto;
  left: -47px;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-quick-forward svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-row:hover .message-quick-forward,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-quick-forward:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-quick-forward:hover,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-quick-forward:focus-visible {
  background: #f7f8fa;
  color: #111b21;
  outline: none;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-row.selection-mode .message-quick-forward {
  display: none !important;
}

/* WhatsApp-style Forward message to picker. */
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] dialog#forward-dialog.wa-forward-dialog {
  width: min(360px, calc(100vw - 24px)) !important;
  max-width: 360px !important;
  max-height: min(690px, calc(100dvh - 24px)) !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  color: #111b21 !important;
  box-shadow: 0 8px 28px rgba(11, 20, 26, .28) !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] dialog#forward-dialog.wa-forward-dialog::backdrop {
  background: rgba(11, 20, 26, .44) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
  background: #ffffff;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-header h3 {
  margin: 0;
  color: #111b21 !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 24px !important;
  text-align: left;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: #111b21 !important;
  font-size: 28px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  cursor: pointer;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-close:hover,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-close:focus-visible {
  background: #f0f2f5 !important;
  outline: none;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-message-count {
  justify-self: end;
  min-width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: #e7fce3;
  color: #008069;
  font-size: 12px;
  font-weight: 600;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-search-shell {
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 16px 10px;
  padding: 0 11px;
  border: 2px solid #111b21;
  border-radius: 22px;
  background: #ffffff;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-search-shell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #54656f;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] #forward-conversation-search.forward-conversation-search {
  width: 100% !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 2px !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #111b21 !important;
  box-shadow: none !important;
  font-size: 15.5px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] #forward-conversation-search::placeholder {
  color: #667781 !important;
  opacity: 1;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-section-title {
  padding: 13px 22px 8px;
  color: #667781;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] #forward-conversation-list.forward-conversation-list {
  max-height: min(500px, calc(100dvh - 228px)) !important;
  display: block !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0 6px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  scrollbar-gutter: stable;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-option {
  min-height: 62px !important;
  display: grid !important;
  grid-template-columns: 24px 46px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 7px 12px !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  color: #111b21 !important;
  cursor: pointer;
  transition: background .1s ease;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-option:hover,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-option.selected {
  background: #f0f2f5 !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  border: 2px solid #8696a0 !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  cursor: pointer;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-checkbox:checked {
  border-color: #00a884 !important;
  background: #00a884 !important;
  box-shadow: inset 0 0 0 3px #00a884 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m4.5 10.2 3.2 3.2 7.8-7.8'/%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 16px 16px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-avatar-wrap {
  width: 46px !important;
  height: 46px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-avatar {
  width: 46px !important;
  height: 46px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden;
  border-radius: 50% !important;
  background: #dfe5e7 !important;
  color: #54656f !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-avatar.has-image img,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-avatar img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-copy {
  min-width: 0;
  display: grid !important;
  gap: 2px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-copy strong {
  overflow: hidden;
  color: #111b21 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 21px !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .forward-conversation-copy small {
  overflow: hidden;
  color: #667781 !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-empty {
  padding: 28px 16px !important;
  color: #667781 !important;
  font-size: 14.5px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-footer {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  max-height: 0;
  padding: 0 18px;
  overflow: hidden;
  border-top: 1px solid transparent;
  background: #ffffff;
  opacity: 0;
  transition: max-height .14s ease, padding .14s ease, opacity .14s ease;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-footer.has-selection {
  max-height: 76px;
  padding: 10px 18px 12px;
  border-top-color: #e9edef;
  opacity: 1;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-selected-summary {
  color: #54656f;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-confirm {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #00a884 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(11, 20, 26, .22) !important;
  cursor: pointer;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-confirm svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-confirm:disabled {
  cursor: default;
  opacity: .55;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-confirm.is-forwarding svg {
  animation: td-wa-forward-spin .7s linear infinite;
}

@keyframes td-wa-forward-spin {
  to { transform: rotate(360deg); }
}

/* WhatsApp-native contact card. */
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .bubble.has-contact-card {
  min-width: min(370px, 76vw) !important;
  max-width: min(390px, 80vw) !important;
  padding: 0 !important;
  overflow: visible !important;
  border-color: rgba(17, 27, 33, .10) !important;
  background: #ffffff !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-row.outbound .bubble.has-contact-card {
  background: #d9fdd3 !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card {
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .97) !important;
  color: #111b21 !important;
  box-shadow: none !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card .special-card-body {
  display: block !important;
  padding: 0 !important;
  background: transparent !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-contact-card-identity {
  min-height: 86px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 11px;
  background: transparent;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-contact-card-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d8f1ff;
  color: #087ea4 !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-contact-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-contact-card-copy strong {
  overflow: hidden;
  color: #111b21 !important;
  font-size: 16.5px !important;
  font-weight: 600 !important;
  line-height: 21px !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-contact-card-copy small {
  overflow: hidden;
  color: #667781 !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-contact-card-time {
  align-self: end;
  padding-bottom: 4px;
  color: #667781 !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  white-space: nowrap;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-contact-card-more {
  padding: 0 14px 10px 78px;
  color: #667781 !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card .special-card-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 0 !important;
  border-top: 1px solid #e9edef !important;
  background: transparent !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card .special-card-action.wa-contact-action {
  min-height: 46px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #008069 !important;
  box-shadow: none !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 20px !important;
  text-align: center !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card .special-card-action.wa-contact-action + .special-card-action.wa-contact-action {
  border-left: 1px solid #e9edef !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card .special-card-action.wa-contact-action:hover,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card .special-card-action.wa-contact-action:focus-visible {
  background: #f5f6f6 !important;
  outline: none;
}

/* Larger WhatsApp workspace typography, one small step above V2.4.4. */
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] :is(.conversation-item h4, .conversation-row .conversation-name) {
  font-size: 17px !important;
  line-height: 22px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] :is(.conversation-item p, .conversation-row .conversation-preview) {
  font-size: 15px !important;
  line-height: 20px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .bubble:not(.has-contact-card) {
  font-size: 16.5px !important;
  line-height: 21.5px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .composer .composer-input-shell #message-input,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] #chat-search-input,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] :is(.wa-search-always input, .inbox-search-row input) {
  font-size: 16.5px !important;
  line-height: 21px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .chat-search-result-snippet {
  font-size: 16px !important;
  line-height: 21px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .contact-title-block h3,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .details-header h3,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .details-profile h3 {
  font-size: 17px !important;
  line-height: 22px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .details-profile p,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .details-list :is(dt, dd) {
  font-size: 13.5px !important;
  line-height: 18px !important;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .details-tip {
  font-size: 13px !important;
  line-height: 19px !important;
}

@media (max-width: 900px), (hover: none), (pointer: coarse) {
  html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-quick-forward {
    display: none !important;
  }

  html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] dialog#forward-dialog.wa-forward-dialog {
    width: min(420px, calc(100vw - 12px)) !important;
    max-width: calc(100vw - 12px) !important;
    max-height: calc(100dvh - 18px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .message-quick-forward,
  html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-footer {
    transition: none !important;
  }
}
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .special-message-card.contact.wa-native-contact-card .special-card-actions:has(.wa-contact-action:only-child) {
  grid-template-columns: minmax(0, 1fr) !important;
}
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .bubble:is(.has-document-media, .has-compact-image, .has-contact-card) > .message-quick-forward,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .bubble:has(> video) > .message-quick-forward,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .bubble:has(> audio) > .message-quick-forward {
  opacity: .92;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-header-tools {
  justify-self: end;
  display: flex;
  align-items: center;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-find-contact {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: #111b21 !important;
  cursor: pointer;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-find-contact svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-find-contact:hover,
html[data-theme="whatsapp"] body[data-native-ui-release="2.4.5-whatsapp-forward-contact-font"] .wa-forward-find-contact:focus-visible {
  background: #f0f2f5 !important;
  outline: none;
}

/* V2.4.6 — WhatsApp anchored emoji picker, one-tap reaction + forward actions,
   WhatsApp-style Quick Replies and high-readability typography. */
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Group the two WhatsApp quick actions beside a bubble: reaction first, forward second. */
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions {
  position: absolute;
  z-index: 16;
  top: 50%;
  right: -88px;
  display: flex;
  align-items: center;
  gap: 5px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-row.outbound .message-quick-actions {
  right: auto;
  left: -88px;
  flex-direction: row-reverse;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-row:hover .message-quick-actions,
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions .message-quick-forward,
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions .message-quick-reaction {
  position: static !important;
  inset: auto !important;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(17,27,33,.08);
  border-radius: 50%;
  background: rgba(255,255,255,.98);
  color: #54656f;
  box-shadow: 0 1px 2px rgba(11,20,26,.15);
  cursor: pointer;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  transition: background .12s ease,color .12s ease,box-shadow .12s ease;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions :is(.message-quick-forward,.message-quick-reaction):hover,
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions :is(.message-quick-forward,.message-quick-reaction):focus-visible {
  background: #f0f2f5;
  color: #111b21;
  box-shadow: 0 2px 5px rgba(11,20,26,.16);
  outline: none;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-reaction svg,
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions .message-quick-forward svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-row.selection-mode .message-quick-actions { display:none !important; }

/* Media/document/contact bubbles keep both quick actions visible, just like WhatsApp Web. */
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .bubble:is(.has-document-media,.has-compact-image,.has-contact-card) > .message-quick-actions,
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .bubble:has(> video) > .message-quick-actions,
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .bubble:has(> audio) > .message-quick-actions {
  opacity: .95;
  pointer-events: auto;
}

/* WhatsApp Web quick-reaction strip. */
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .td-quick-reaction-bar {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 4px 6px !important;
  border: 1px solid #e1e5e7 !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(11,20,26,.18) !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .td-quick-reaction-bar button {
  width: 34px !important;
  height: 34px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  font-size: 21px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .td-quick-reaction-bar button:hover { background:#f0f2f5 !important; }

/* Composer emoji picker: compact WhatsApp-like panel anchored above the input bar. */
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-panel.emoji-panel.td-reaction-panel {
  position: fixed !important;
  z-index: 10080 !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0,1fr) !important;
  border: 1px solid #dfe3e5 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #111b21 !important;
  box-shadow: 0 4px 18px rgba(11,20,26,.20) !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-panel .emoji-search-row {
  min-height: 52px !important;
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  padding:9px 10px 7px !important;
  background:#fff !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-search {
  height: 36px !important;
  padding: 8px 13px !important;
  border: 0 !important;
  border-radius: 18px !important;
  outline: none !important;
  background:#f0f2f5 !important;
  color:#111b21 !important;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif !important;
  font-size:15px !important;
  line-height:20px !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-close {
  width:32px !important;height:32px !important;border:0 !important;background:transparent !important;color:#54656f !important;font-size:22px !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-categories.emoji-categories {
  min-height: 42px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-around !important;
  padding:0 6px !important;
  border-bottom:1px solid #e9edef !important;
  background:#fff !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-categories button {
  min-width:32px !important;height:38px !important;border:0 !important;border-bottom:3px solid transparent !important;border-radius:0 !important;background:transparent !important;font-size:19px !important;opacity:.72 !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-categories button.active {
  border-bottom-color:#00a884 !important;opacity:1 !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-grid.emoji-grid {
  overflow:auto !important;
  display:grid !important;
  grid-template-columns:repeat(8,minmax(0,1fr)) !important;
  align-content:start !important;
  gap:1px !important;
  padding:8px !important;
  background:#fff !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-grid button {
  min-width:0 !important;height:38px !important;padding:0 !important;border:0 !important;border-radius:6px !important;background:transparent !important;font-size:24px !important;line-height:1 !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-grid button:hover { background:#f0f2f5 !important; }

/* Quick Replies side panel rebuilt in WhatsApp's clean light visual language. */
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] dialog#quick-reply-dialog.side-drawer {
  width:min(430px,calc(100vw - 16px)) !important;
  max-width:430px !important;
  padding:0 !important;
  border:1px solid #dfe3e5 !important;
  border-radius:10px 0 0 10px !important;
  background:#fff !important;
  color:#111b21 !important;
  box-shadow:-8px 0 30px rgba(11,20,26,.16) !important;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] dialog#quick-reply-dialog::backdrop { background:rgba(11,20,26,.30) !important; backdrop-filter:none !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .wa-quick-reply-header {
  min-height:72px !important;padding:14px 18px !important;border-bottom:1px solid #e9edef !important;background:#f0f2f5 !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .wa-quick-reply-header > div { display:grid !important;gap:2px !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .wa-quick-reply-header h3 { margin:0 !important;color:#111b21 !important;font-size:19px !important;font-weight:600 !important;line-height:24px !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .wa-quick-reply-header p { margin:0 !important;color:#667781 !important;font-size:13.5px !important;line-height:18px !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog .quick-reply-search { margin:12px 14px 8px !important;position:relative !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog #quick-reply-search {
  width:100% !important;height:40px !important;padding:9px 40px 9px 14px !important;border:0 !important;border-radius:20px !important;outline:none !important;background:#f0f2f5 !important;color:#111b21 !important;font-size:15.5px !important;line-height:21px !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog #quick-reply-search::placeholder { color:#667781 !important;opacity:1 !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog .quick-reply-search > span { color:#667781 !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list.quick-reply-list {
  display:grid !important;gap:0 !important;align-content:start !important;padding:0 8px 8px !important;overflow:auto !important;background:#fff !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card {
  min-height:72px !important;display:grid !important;gap:5px !important;padding:11px 12px !important;border:0 !important;border-bottom:1px solid #f0f2f5 !important;border-radius:7px !important;background:#fff !important;color:#111b21 !important;box-shadow:none !important;text-align:left !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card:hover,
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card:focus-visible { background:#f5f6f6 !important;outline:none !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card-header { display:flex !important;align-items:center !important;justify-content:space-between !important;gap:10px !important;color:#111b21 !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card-header strong { color:#111b21 !important;font-size:16px !important;font-weight:600 !important;line-height:21px !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card-header b {
  flex:0 0 auto !important;padding:3px 7px !important;border-radius:10px !important;background:#e7fce8 !important;color:#008069 !important;font-size:12px !important;font-weight:600 !important;line-height:16px !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card-content {
  display:-webkit-box !important;overflow:hidden !important;color:#667781 !important;font-size:14.5px !important;font-weight:400 !important;line-height:20px !important;-webkit-box-orient:vertical !important;-webkit-line-clamp:2 !important;white-space:normal !important;text-overflow:ellipsis !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-list .quick-reply-card-media { color:#667781 !important;font-size:13px !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog .quick-reply-manage {
  margin:0 !important;padding:0 14px 12px !important;border-top:1px solid #e9edef !important;background:#fff !important;color:#111b21 !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog .quick-reply-manage > summary {
  min-height:48px !important;display:flex !important;align-items:center !important;color:#008069 !important;font-size:15.5px !important;font-weight:600 !important;cursor:pointer !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog .quick-reply-form label { color:#3b4a54 !important;font-size:13.5px !important;font-weight:500 !important; }
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #quick-reply-dialog .quick-reply-form :is(input,textarea) { background:#fff !important;color:#111b21 !important;border:1px solid #dfe3e5 !important;font-size:15px !important;line-height:20px !important; }

/* Final readability pass: keep text crisp and at WhatsApp-like sizes. */
html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] :is(.bubble:not(.has-contact-card),#message-input,.conversation-row .conversation-preview,.chat-search-result-snippet) {
  font-weight:400 !important;
  letter-spacing:0 !important;
}

@media (max-width:900px),(hover:none),(pointer:coarse) {
  html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] .message-quick-actions { display:none !important; }
  html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] dialog#quick-reply-dialog.side-drawer { width:100vw !important;max-width:100vw !important;border-radius:0 !important; }
  html[data-theme="whatsapp"] body[data-emoji-ui-release^="2.4.6"] #emoji-grid.emoji-grid { grid-template-columns:repeat(8,minmax(0,1fr)) !important; }
}


/* V2.4.6.1 — Emoji anchor + close hardfix.
   This rule intentionally comes after the V2.4.6 display:grid !important rule. */
html[data-theme="whatsapp"] body[data-emoji-ui-release="2.4.6.1-emoji-anchor-close-hardfix"] #emoji-panel.emoji-panel.td-reaction-panel.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
html[data-theme="whatsapp"] body[data-emoji-ui-release="2.4.6.1-emoji-anchor-close-hardfix"] #emoji-panel.emoji-panel.td-reaction-panel:not(.hidden) {
  visibility: visible !important;
  pointer-events: auto !important;
}


/* v2.5.3 — reaction toggle + media quick actions reliability */
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .message-quick-actions,
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .td-quick-reaction-bar { -webkit-user-select:none; user-select:none; }
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:is(.has-compact-image,.has-document-media,.has-contact-card,.has-template-message),
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(> video),
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(> audio),
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(.special-card),
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(.media-document),
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(.chat-media-image) {
  overflow: visible !important;
}
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:is(.has-compact-image,.has-document-media,.has-contact-card,.has-template-message) > .message-quick-actions,
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(> video) > .message-quick-actions,
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(> audio) > .message-quick-actions,
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(.special-card) > .message-quick-actions,
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .bubble:has(.chat-media-image) > .message-quick-actions {
  opacity: .98 !important;
  pointer-events: auto !important;
}
html[data-theme="whatsapp"] body[data-mobile-theme-release^="2.5.3"] .message-row .message-quick-actions {
  z-index: 18 !important;
}
