/* =============================================================
   wa-chat.css — WhatsApp-style Support Chat UI
   Shared stylesheet for Admin_Panel, Seller_Panel, and Supportify.
   ALL selectors are scoped under .wa-root to prevent leakage
   into other admin pages.
   ============================================================= */

/* -------------------------------------------------------------
   1. CSS Custom Properties — Dark mode (default)
   ------------------------------------------------------------- */
.wa-root {
  --wa-bg-body:      #111B21;
  --wa-sidebar-bg:   #111B21;
  --wa-header-bg:    #202C33;
  --wa-chat-bg:      #0B141A;
  --wa-input-bg:     #1F2C33;
  --wa-search-bg:    #2A3942;
  --wa-sent-bubble:  #005C4B;
  --wa-recv-bubble:  #202C33;
  --wa-accent:       #00A884;
  --wa-text-primary: #E9EDEF;
  --wa-text-secondary: #8696A0;
  --wa-divider:      #222D34;
  --wa-hover:        #2A3942;
  --wa-active:       #2A3942;
  --wa-unread-badge: #00A884;
}

/* -------------------------------------------------------------
   2. CSS Custom Properties — Light mode overrides
   ------------------------------------------------------------- */
.wa-root.wa-light {
  --wa-bg-body:      #F0F2F5;
  --wa-sidebar-bg:   #FFFFFF;
  --wa-header-bg:    #F0F2F5;
  --wa-chat-bg:      #ECE5DD;
  --wa-sent-bubble:  #DCF8C6;
  --wa-recv-bubble:  #FFFFFF;
  --wa-text-primary: #111B21;
  --wa-text-secondary: #667781;
  --wa-divider:      #E9EDEF;
  --wa-hover:        #F5F6F6;
  --wa-active:       #F0F2F5;
  --wa-input-bg:     #F0F2F5;
  --wa-search-bg:    #FFFFFF;
}

/* -------------------------------------------------------------
   3. Layout Primitives
   ------------------------------------------------------------- */

/* Root container — full-viewport, no scroll */
.wa-root {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--wa-bg-body);
  color: var(--wa-text-primary);
}

/* Inner layout wrapper — sits to the right of any existing sidebar */
.wa-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left panel — conversation list column */
.wa-left-panel {
  width: 350px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--wa-sidebar-bg);
  border-right: 1px solid var(--wa-divider);
}

/* Chat area — message feed column */
.wa-chat-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--wa-chat-bg);
}

/* ---------------------------------------------------------------
   4. Left Panel — Conversation List
   --------------------------------------------------------------- */

.wa-root .wa-panel-header {
  height: 59px;
  flex-shrink: 0;
  background: var(--wa-header-bg);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--wa-divider);
}

.wa-root .wa-panel-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--wa-text-primary);
  flex: 1;
}

.wa-root .wa-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px;
  background: var(--wa-search-bg);
  border-radius: 8px;
  padding: 0 12px;
  height: 35px;
  flex-shrink: 0;
}

.wa-root .wa-search-wrap i,
.wa-root .wa-search-wrap svg {
  color: var(--wa-text-secondary);
  font-size: 14px;
  flex-shrink: 0;
}

.wa-root .wa-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--wa-text-primary);
  font-size: 14px;
  font-family: inherit;
}

.wa-root .wa-search-input::placeholder {
  color: var(--wa-text-secondary);
}

.wa-root .wa-conv-list {
  flex: 1;
  overflow-y: auto;
}

.wa-root .wa-conv-list::-webkit-scrollbar {
  width: 4px;
}

.wa-root .wa-conv-list::-webkit-scrollbar-track {
  background: transparent;
}

.wa-root .wa-conv-list::-webkit-scrollbar-thumb {
  background: var(--wa-divider);
  border-radius: 4px;
}

.wa-root .wa-conv-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--wa-divider);
  transition: background 0.15s ease;
  text-align: left;
  width: 100%;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
}

.wa-root .wa-conv-item:hover {
  background: var(--wa-hover);
}

.wa-root .wa-conv-item.active {
  background: var(--wa-active);
}

/* Avatar — circular, 49px */
.wa-root .wa-avatar {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: var(--wa-header-bg);
  color: var(--wa-text-primary);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  user-select: none;
}

/* Online indicator dot */
.wa-root .wa-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wa-accent);
  position: absolute;
  bottom: 1px;
  right: 1px;
  border: 2px solid var(--wa-sidebar-bg);
}

/* Conversation item text area */
.wa-root .wa-conv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wa-root .wa-conv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.wa-root .wa-conv-name {
  font-size: 16px;
  font-weight: 400;
  color: var(--wa-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-root .wa-conv-preview {
  font-size: 13px;
  color: var(--wa-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.wa-root .wa-conv-time {
  font-size: 12px;
  color: var(--wa-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.wa-root .wa-conv-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Unread count badge */
.wa-root .wa-unread-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--wa-unread-badge);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ---------------------------------------------------------------
   5. Chat Area — Topbar
   --------------------------------------------------------------- */

.wa-root .wa-topbar {
  height: 59px;
  flex-shrink: 0;
  background: var(--wa-header-bg);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--wa-divider);
}

.wa-root .wa-topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-header-bg);
  color: var(--wa-text-primary);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  user-select: none;
}

.wa-root .wa-topbar-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wa-root .wa-topbar-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--wa-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-root .wa-topbar-status {
  font-size: 13px;
  color: var(--wa-text-secondary);
}

.wa-root .wa-topbar-status.online {
  color: var(--wa-accent);
}

.wa-root .wa-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.wa-root .wa-hamburger:hover {
  background: var(--wa-hover);
}

/* ---------------------------------------------------------------
   6. Chat Area — Message Feed
   --------------------------------------------------------------- */

.wa-root .wa-feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px 5%;
  background: var(--wa-chat-bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  scroll-behavior: smooth;
}

.wa-root .wa-feed::-webkit-scrollbar {
  width: 5px;
}

.wa-root .wa-feed::-webkit-scrollbar-track {
  background: transparent;
}

.wa-root .wa-feed::-webkit-scrollbar-thumb {
  background: rgba(134, 150, 160, 0.3);
  border-radius: 4px;
}

/* Date pill separator */
.wa-root .wa-date-pill {
  align-self: center;
  background: #182229;
  color: var(--wa-text-secondary);
  border-radius: 7.5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  margin: 10px 0;
  user-select: none;
}

.wa-root.wa-light .wa-date-pill {
  background: #D9DBD5;
  color: #54656F;
}

/* Message row wrapper */
.wa-root .wa-msg-row {
  display: flex;
  max-width: 65%;
  animation: waMsgIn 0.2s ease;
}

@keyframes waMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wa-root .wa-msg-row.sent {
  align-self: flex-end;
}

.wa-root .wa-msg-row.recv {
  align-self: flex-start;
}

/* Message bubble */
.wa-root .wa-bubble {
  padding: 6px 9px 8px;
  border-radius: 7.5px;
  position: relative;
  word-break: break-word;
  max-width: 100%;
}

.wa-root .wa-bubble.sent {
  background: var(--wa-sent-bubble);
  border-bottom-right-radius: 0;
}

.wa-root .wa-bubble.recv {
  background: var(--wa-recv-bubble);
  border-bottom-left-radius: 0;
}

.wa-root .wa-bubble-text {
  font-size: 13.6px;
  color: var(--wa-text-primary);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}

.wa-root .wa-bubble-img {
  display: block;
  max-width: 260px;
  max-height: 240px;
  border-radius: 7px;
  object-fit: cover;
  margin-top: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.wa-root .wa-bubble-img:hover {
  opacity: 0.92;
}

/* Bubble footer: timestamp + tick */
.wa-root .wa-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.wa-root .wa-bubble-time {
  font-size: 11px;
  color: var(--wa-text-secondary);
}

/* Tick icons */
.wa-root .wa-tick {
  font-size: 13px;
  color: var(--wa-text-secondary);
}

.wa-root .wa-tick-double {
  font-size: 13px;
  color: var(--wa-text-secondary);
}

.wa-root .wa-tick-read {
  font-size: 13px;
  color: #53BDEB;
}

/* Typing indicator */
.wa-root .wa-typing {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 10px;
  font-size: 13px;
  color: var(--wa-text-secondary);
}

.wa-root .wa-typing.visible {
  display: flex;
}

.wa-root .wa-typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.wa-root .wa-typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--wa-text-secondary);
  animation: waTypeDot 1.4s ease infinite;
}

.wa-root .wa-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.wa-root .wa-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waTypeDot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Scroll-to-bottom button */
.wa-root .wa-scroll-btn {
  position: absolute;
  bottom: 72px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-header-bg);
  border: 1px solid var(--wa-divider);
  color: var(--wa-text-primary);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background 0.15s ease;
}

.wa-root .wa-scroll-btn.visible {
  display: flex;
}

.wa-root .wa-scroll-btn:hover {
  background: var(--wa-hover);
}

/* Empty state — no conversation selected */
.wa-root .wa-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  color: var(--wa-text-secondary);
}

.wa-root .wa-empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.wa-root .wa-empty-state h3 {
  font-size: 16px;
  font-weight: 400;
  color: var(--wa-text-primary);
  margin-bottom: 8px;
}

.wa-root .wa-empty-state p {
  font-size: 13px;
  color: var(--wa-text-secondary);
  max-width: 320px;
  line-height: 1.5;
}

.wa-root .wa-empty-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--wa-text-secondary);
  margin-top: 16px;
  padding: 4px 10px;
  border: 1px solid var(--wa-divider);
  border-radius: 4px;
}

/* ---------------------------------------------------------------
   7. Chat Area — Composer
   --------------------------------------------------------------- */

.wa-root .wa-composer {
  flex-shrink: 0;
  min-height: 62px;
  background: var(--wa-input-bg);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-root .wa-composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-root .wa-composer-input {
  flex: 1;
  background: var(--wa-search-bg);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--wa-text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.45;
  overflow-y: auto;
  resize: none;
}

.wa-root .wa-composer-input::placeholder {
  color: var(--wa-text-secondary);
}

.wa-root .wa-composer-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wa-root .wa-attach-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.wa-root .wa-attach-btn:hover:not(:disabled) {
  color: var(--wa-text-primary);
}

.wa-root .wa-attach-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Circular send button */
.wa-root .wa-send-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--wa-accent);
  border: none;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.wa-root .wa-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.wa-root .wa-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Attachment preview strip */
.wa-root .wa-attach-preview {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--wa-search-bg);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wa-text-primary);
}

.wa-root .wa-attach-preview.visible {
  display: flex;
}

.wa-root .wa-attach-preview-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.wa-root .wa-attach-preview-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-root .wa-attach-remove {
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.wa-root .wa-attach-remove:hover {
  color: #FF3B30;
}

/* ---------------------------------------------------------------
   8. Toast Notifications
   --------------------------------------------------------------- */

.wa-root .wa-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.wa-root .wa-toast {
  background: var(--wa-header-bg);
  border: 1px solid var(--wa-divider);
  color: var(--wa-text-primary);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: waToastIn 0.3s ease;
  max-width: 320px;
}

@keyframes waToastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.wa-root .wa-toast .wa-toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.wa-root .wa-toast.success .wa-toast-icon { color: var(--wa-accent); }
.wa-root .wa-toast.error .wa-toast-icon { color: #FF3B30; }

/* ---------------------------------------------------------------
   9. Admin — Visitors Editor (inside topbar)
   --------------------------------------------------------------- */

.wa-root .wa-visitors-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.wa-root .wa-visitors-editor label {
  font-size: 11px;
  color: var(--wa-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.wa-root .wa-visitors-editor input {
  width: 76px;
  background: var(--wa-search-bg);
  border: 1px solid var(--wa-divider);
  border-radius: 6px;
  color: var(--wa-text-primary);
  text-align: center;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.wa-root .wa-visitors-editor input:focus {
  border-color: var(--wa-accent);
}

.wa-root .wa-visitors-editor input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wa-root .wa-visitors-editor button {
  background: var(--wa-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.wa-root .wa-visitors-editor button:hover:not(:disabled) {
  opacity: 0.9;
}

.wa-root .wa-visitors-editor button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------
   10. Seller — Contact Strip (Telegram / Email quick links)
   --------------------------------------------------------------- */

.wa-root .wa-contact-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px 16px;
  background: var(--wa-header-bg);
  border-bottom: 1px solid var(--wa-divider);
  flex-shrink: 0;
}

.wa-root .wa-contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--wa-sidebar-bg);
  border: 1px solid var(--wa-divider);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wa-root .wa-contact-card:hover {
  background: var(--wa-hover);
}

.wa-root .wa-contact-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.wa-root .wa-contact-card-icon.telegram {
  color: #29B6F6;
  background: rgba(41, 182, 246, 0.12);
}

.wa-root .wa-contact-card-icon.email {
  color: #EF5350;
  background: rgba(239, 83, 80, 0.12);
}

.wa-root .wa-contact-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--wa-text-primary);
  margin: 0 0 2px 0;
}

.wa-root .wa-contact-card p {
  font-size: 11px;
  color: var(--wa-text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------
   11. Panel Overlay (mobile left-panel backdrop)
   --------------------------------------------------------------- */

.wa-root .wa-panel-overlay,
.wa-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 15;
}

.wa-root .wa-panel-overlay.wa-open,
.wa-panel-overlay.wa-open {
  display: block;
}

/* ---------------------------------------------------------------
   12. Responsive — ≤ 768px
   --------------------------------------------------------------- */

@media (max-width: 768px) {
  /* ── Root: fill iframe height, don't overflow ── */
  .wa-root {
    height: 100%;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  /* ── Layout: fills remaining space after seller-header ── */
  .wa-layout {
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    display: flex;
  }

  /* ── Left panel: slides in as drawer ── */
  .wa-root .wa-left-panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 85vw;
    max-width: 350px;
    height: 100%;
  }

  .wa-root .wa-left-panel.wa-open {
    transform: translateX(0);
  }

  /* ── Chat area: flex column, fills all available space ── */
  .wa-root .wa-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  /* ── Topbar: fixed at top of chat ── */
  .wa-root .wa-topbar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 5;
  }

  /* ── Message feed: scrollable, takes all remaining space ── */
  .wa-root .wa-feed {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 3%;
    min-height: 0;
  }

  /* ── Typing indicator ── */
  .wa-root .wa-typing {
    flex-shrink: 0;
  }

  /* ── Composer: ALWAYS at bottom, never pushed off screen ── */
  .wa-root .wa-composer {
    flex-shrink: 0;
    min-height: 62px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    /* Safe area for phones with home bar */
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }

  /* ── Hamburger visible ── */
  .wa-root .wa-hamburger {
    display: flex;
  }

  /* ── Message bubbles wider ── */
  .wa-root .wa-msg-row {
    max-width: 88%;
  }

  /* ── Visitors editor ── */
  .wa-root .wa-visitors-editor {
    flex-wrap: wrap;
    gap: 6px;
  }

  .wa-root .wa-visitors-editor input {
    width: 60px;
  }

  /* ── Contact strip ── */
  .wa-root .wa-contact-strip {
    gap: 6px;
    padding: 8px 12px;
    flex-shrink: 0;
  }

  .wa-root .wa-contact-card {
    padding: 8px 10px;
    gap: 8px;
  }

  .wa-root .wa-contact-card p {
    display: none;
  }
}

@media (max-width: 480px) {
  /* Very small screens: contact cards stack if needed */
  .wa-root .wa-contact-strip {
    grid-template-columns: 1fr;
  }

  .wa-root .wa-contact-card p {
    display: none;
  }

  .wa-root .wa-contact-card h3 {
    font-size: 12px;
  }

  .wa-root .wa-msg-row {
    max-width: 92%;
  }

  .wa-root .wa-bubble-text {
    font-size: 13px;
  }

  /* Composer input font-size 16px prevents iOS zoom */
  .wa-root .wa-composer-input {
    font-size: 16px;
  }

  /* Larger send button tap target */
  .wa-root .wa-send-btn {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}
