:root {
  --wa-dark-green: #008069;
  --wa-teal: #00A884;
  --wa-light-green: #25D366;
  --wa-chat-bg: #EFEAE2;
  --wa-sent: #D9FDD3;
  --wa-received: #FFFFFF;
  --wa-header-green: #008069;
  --wa-input-bg: #F0F2F5;
  --wa-text: #111B21;
  --wa-secondary: #667781;
  --wa-border: #E9EDEF;
  --wa-blue-check: #53BDEB;
  --wa-msg-time: rgba(0, 0, 0, 0.45);
  --wa-wallpaper: #EFEAE2;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, 'Lucida Grande', Arial, 'Ubuntu', 'Cantarell', 'Fira Sans', 'Roboto', sans-serif;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-tap-highlight-color: transparent;
}

*::-webkit-scrollbar {
  display: none;
}

html, body {
  touch-action: manipulation;
  height: 100%;
  height: -webkit-fill-available;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

body {
  background: var(--wa-chat-bg);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

.app {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  background: var(--wa-chat-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}


/* ===== HEADER ===== */
.header {
  background: var(--wa-header-green);
  color: #fff;
  padding: 0;
  padding-top: var(--safe-top);
  flex-shrink: 0;
  border-bottom: none;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.header-eyebrow {
  display: none;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 7px 4px 7px 0;
  min-height: 56px;
}

.header-back {
  padding: 8px 2px 8px 12px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  opacity: 0.95;
  flex-shrink: 0;
}

.header-logo {
  width: 38px;
  height: 38px;
  background: #6B8E85;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  flex-shrink: 0;
  overflow: hidden;
  margin-left: 2px;
  margin-right: 10px;
}

.emblem-svg {
  width: 32px;
  height: 32px;
  color: #DFE5E7;
}

.header-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.header h1 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 5px;
}

.verified-badge {
  color: #4FC3F7;
  font-size: 14px;
  flex-shrink: 0;
}

.header-online {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
  margin-top: 1px;
  letter-spacing: 0;
}

.header-online::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4EE09A;
  box-shadow: 0 0 0 0 rgba(78, 224, 154, 0.75);
  animation: onlinePulse 2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(78, 224, 154, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(78, 224, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(78, 224, 154, 0); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 12px 0 10px;
  font-size: 19px;
  opacity: 0.92;
  flex-shrink: 0;
}

.header-actions i {
  cursor: pointer;
  padding: 4px;
}

.header-info {
  display: none;
}

/* ===== INFO SUBHEADER ===== */
.info-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0A4F44;
  color: rgba(255, 255, 255, 0.78);
  padding: 4px 14px 5px;
  font-family: 'SF Mono', ui-monospace, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.info-subheader .info-id,
.info-subheader .info-date {
  font-weight: 500;
}

/* ===== COMPLIANCE BANNER - WhatsApp encrypted notice ===== */
.compliance-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFF3C4;
  border-bottom: 1px solid #F0E4A8;
  padding: 7px 20px 8px 20px;
  font-size: 11.5px;
  color: #54656F;
  font-weight: 500;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.35;
}

.compliance-banner i {
  font-size: 9px;
  color: #C98B07;
  flex-shrink: 0;
}

.compliance-banner span:first-of-type {
  font-weight: 400;
  letter-spacing: normal;
}

.compliance-sep {
  display: none;
}

/* ===== STATUS BAR - Hidden ===== */
.status-bar,
.status-left,
.status-right,
.status-dot-green,
.status-online,
.status-sep {
  display: none;
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--wa-chat-bg);
  min-height: 0;
}

.chat-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ===== CHAT AREA - WhatsApp wallpaper doodle ===== */
.chat-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 3px 10px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background-color: #EFEAE2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='366' height='366' viewBox='0 0 366 366'><g fill='none' stroke='%23D1C7B7' stroke-width='1.1' opacity='0.55'><path d='M30 40c6-9 18-9 24 0s-6 18-12 18-18-9-12-18z'/><path d='M70 80c4-3 10-3 14 0m-14 4c4 3 10 3 14 0'/><circle cx='120' cy='55' r='8'/><path d='M115 55l4 4 8-8'/><path d='M165 30c3-5 10-5 13 0s-2 12-6 12-10-7-7-12z'/><path d='M170 50v8m-5-4h10'/><path d='M210 40c5 0 9 4 9 9s-4 9-9 9-9-4-9-9 4-9 9-9z M210 45v8l5 3'/><path d='M255 40h12v10h-12z M255 46h12'/><path d='M300 30c5 0 8 3 8 8v6c0 3-3 5-5 5h-6c-2 0-5-2-5-5v-6c0-5 3-8 8-8z'/><path d='M335 35v18m-5-14h10'/><path d='M30 100l6-6 6 6 6-6 6 6'/><path d='M75 115c0-6 5-10 10-10s10 4 10 10'/><path d='M85 105v-8 M85 115c0 5 5 5 5 0'/><circle cx='130' cy='115' r='9'/><path d='M123 115h14 M130 108v14'/><path d='M170 100c5 0 9 4 9 9v8c0 2-2 4-4 4h-10c-2 0-4-2-4-4v-8c0-5 4-9 9-9z'/><path d='M167 114h6m-3-3v6'/><path d='M215 105l-8 8 8 8 8-8z'/><path d='M255 100c5-3 10 0 10 5v10c0 5-5 8-10 5s-10-3-10 0'/><path d='M300 105l10 10m0-10l-10 10'/><path d='M340 100v15h10'/><path d='M20 160c4-4 10-4 14 0 m0 8c-4 4-10 4-14 0'/><path d='M65 150c6 0 10 4 10 10s-4 10-10 10-10-4-10-10'/><path d='M60 160h10 M65 155v10'/><path d='M105 150h16v4l-8 8-8-8z'/><path d='M150 160c4-6 12-6 16 0s-4 14-8 14-12-8-8-14z'/><path d='M195 150c0 8 8 12 14 6m0-12c-6-6-14-2-14 6z'/><path d='M240 150l-5 10h10z M240 160v10'/><circle cx='285' cy='160' r='8'/><path d='M282 160h6 M285 157v6'/><path d='M325 150c6 0 8 4 8 8s-4 8-8 8h-4v-16z'/><path d='M35 220c4 0 7 3 7 7s-3 7-7 7-7-3-7-7'/><path d='M28 227l8-8 M28 217l8 8'/><path d='M75 215v16 M67 223h16'/><path d='M115 215c6-4 14-4 14 4s-8 8-14 4z'/><path d='M155 225c5-4 9 0 9 4s-4 8-9 4z M155 215v-5 M159 215v-5 M163 215v-5'/><path d='M200 220c0-6 5-8 8-8s8 2 8 8v6h-16z'/><path d='M205 226h6v6h-6z'/><path d='M245 212l10 18h-20z'/><path d='M285 215h14 M292 215v14'/><path d='M330 215c5 5 5 13 0 18'/><path d='M25 275l4-4 4 4 4-4 4 4'/><circle cx='70' cy='280' r='6'/><path d='M64 280h12'/><path d='M115 270v20m-5-10h10'/><path d='M155 275c4-2 10 0 10 5s-6 7-10 5m5-2v8'/><path d='M200 270c-4 4-4 12 0 16s12 4 16 0'/><path d='M240 275l-6 6 6 6 6-6z'/><path d='M280 270h16v16h-16z M280 278h16 M288 270v16'/><path d='M330 270l-4 16h14l-4-16z'/><path d='M35 320c5-5 13-5 18 0'/><path d='M42 318v8m-3-4h6'/><path d='M80 315v16 M88 315v16 M80 323h8'/><path d='M125 320c0-6 5-8 8-8s8 2 8 8-5 10-8 10-8-4-8-10z'/><path d='M170 310l-8 16h16z M170 318v4'/><path d='M215 310c5 0 8 3 8 8v8c0 1-1 2-2 2h-12c-1 0-2-1-2-2v-8c0-5 3-8 8-8z'/><path d='M211 322h8 M211 318h8'/><path d='M260 310l-5 6 5 6 5-6z M260 322v8'/></g></svg>");
  background-repeat: repeat;
  background-size: 366px 366px;
}

/* ===== Date separator - WhatsApp pill ===== */
.chat-start-timestamp {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--wa-secondary);
  letter-spacing: normal;
  text-transform: uppercase;
  margin: 6px auto 6px auto;
  background: rgba(255, 255, 255, 0.92);
  padding: 5px 12px 6px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  width: fit-content;
  font-weight: 400;
  font-size: 11.5px;
}

.chat-sep-line {
  display: none;
}

/* STATUS DOT (legacy) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--wa-light-green);
  border-radius: 50%;
  margin-left: 2px;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--wa-received);
  border-radius: 7.5px;
  border-top-left-radius: 0;
  width: fit-content;
  max-width: 72px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  align-self: flex-start;
  position: relative;
  margin-bottom: 2px;
}

.typing-indicator::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  background: var(--wa-received);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  width: 8px;
  height: 13px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #8D9F8A;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ===== MESSAGE BUBBLES ===== */
.message {
  padding: 6px 8px 8px 9px;
  border-radius: 7.5px;
  font-size: 15.5px;
  line-height: 21px;
  max-width: 100%;
  width: fit-content;
  position: relative;
  animation: msgSlideIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.message-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-self: flex-start;
  max-width: 85%;
  margin-bottom: 2px;
}

.message-group.notice-group {
  align-self: center;
  margin: 4px 0;
  max-width: 92%;
}

.message.notice {
  background: rgba(255, 255, 210, 0.92) !important;
  color: var(--wa-text) !important;
  text-align: center;
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  border: none !important;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13) !important;
  padding: 5px 12px 6px 12px !important;
  max-width: fit-content !important;
  width: fit-content !important;
  border-radius: 7.5px !important;
  margin: 0 auto;
  line-height: 19px;
}

.message.notice::after {
  display: none !important;
}

.notice-group .msg-sender-label,
.notice-group .msg-timestamp {
  display: none !important;
}

.message-group.user-group {
  align-self: flex-end;
}

/* Sender label hidden */
.msg-sender-label {
  display: none;
}

/* Legacy timestamp (hidden - now inline) */
.msg-timestamp {
  display: none;
}

/* Inline timestamp inside bubble */
.msg-meta-inline {
  float: right;
  display: flex;
  align-items: center;
  gap: 3px;
  margin: -4px 0 -5px 8px;
  padding-top: 5px;
  position: relative;
  bottom: -3px;
}

.msg-time-inline {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.45);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.msg-checks {
  display: inline-flex;
  align-items: center;
  color: var(--wa-blue-check);
  line-height: 1;
}

.message.notice .msg-meta-inline {
  display: none;
}

/* ===== Tails ===== */
.message::after {
  content: '';
  position: absolute;
  top: 0;
  width: 8px;
  height: 13px;
}

.msg-meta {
  display: none !important;
}

/* Hide external timestamp for flat messages too */
.flat-group .msg-timestamp {
  display: none !important;
}

/* ===== Received (white) ===== */
.ai,
.agent,
.system {
  background: var(--wa-received);
  color: var(--wa-text);
  align-self: flex-start;
  border-top-left-radius: 0;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.ai::after,
.agent::after,
.system::after {
  left: -8px;
  top: 0;
  background: var(--wa-received);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  border: none;
  width: 8px;
  height: 13px;
}

/* ===== Flat messages ===== */
.message.flat {
  padding: 4px !important;
  background: var(--wa-received) !important;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13) !important;
  border: none !important;
  max-width: 100% !important;
  width: auto !important;
  align-self: flex-start !important;
  border-radius: 7.5px !important;
  border-top-left-radius: 0 !important;
}

.message.flat::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  background: var(--wa-received);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  width: 8px;
  height: 13px;
}

/* ===== Video Message ===== */
.message.video-msg {
  max-width: 100% !important;
  width: auto !important;
  padding: 3px !important;
  background: var(--wa-received) !important;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13) !important;
  border: none !important;
  border-radius: 7.5px !important;
  border-top-left-radius: 0 !important;
  align-self: flex-start !important;
}

.message.video-msg::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  background: var(--wa-received);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  width: 8px;
  height: 13px;
}

.video-container {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  margin: 0;
  background: #000;
  line-height: 0;
  width: 100%;
}

.video-container video {
  width: 100%;
  display: block;
}

.big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.unmute-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  z-index: 12;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  animation: unmutePulse 2.2s ease-in-out infinite;
}

.unmute-badge i { font-size: 12px; }

@keyframes unmutePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
  50% { transform: scale(1.06); box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4); }
}

.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 11;
}

.video-container:hover .custom-controls,
.video-container:active .custom-controls {
  opacity: 1;
}

.control-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.volume-slider {
  flex: 1;
  max-width: 100px;
  height: 3px;
  cursor: pointer;
  accent-color: var(--wa-teal);
}

/* ===== Sent (green) ===== */
.user {
  background: var(--wa-sent);
  color: var(--wa-text);
  align-self: flex-end;
  border: none;
  border-top-right-radius: 0;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  font-size: 15.5px;
  width: fit-content;
  white-space: normal;
  max-width: 100%;
}

.user::after {
  right: -8px;
  left: auto;
  top: 0;
  background: var(--wa-sent);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  border: none;
  width: 8px;
  height: 13px;
}

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

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ===== INPUT AREA ===== */
.input-area {
  padding: 4px 6px 5px 6px;
  padding-bottom: max(5px, var(--safe-bottom));
  background: #F0F2F5;
  border-top: none;
  flex-shrink: 0;
}

.chat-input-container {
  display: flex;
  gap: 6px;
  background: transparent;
  align-items: flex-end;
}

.input-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: 21px;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.06), 0 0 0 1px rgba(11, 20, 26, 0.04);
  min-height: 42px;
  padding: 0 6px 0 0;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.input-box:focus-within {
  box-shadow: 0 2px 8px rgba(0, 128, 105, 0.1), 0 0 0 2px rgba(0, 168, 132, 0.25);
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #54656F;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 8px;
}

.input-emoji {
  padding: 0 4px 0 10px;
  font-size: 22px;
}

.input-attach {
  font-size: 20px;
  transform: rotate(45deg);
  padding: 0 6px;
}

.input-camera {
  font-size: 19px;
  padding: 0 8px 0 4px;
}

.chat-input {
  flex: 1;
  padding: 9px 4px 11px 6px;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-family: inherit;
  color: var(--wa-text);
  background: transparent;
  outline: none;
  transition: none;
  min-height: 42px;
  line-height: 20px;
  -webkit-appearance: none;
}

.chat-input::placeholder {
  color: #3B4A54;
  font-style: normal;
  opacity: 0.55;
}

.chat-input:focus {
  border: none;
  background: transparent;
}

.send-btn {
  padding: 0;
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: var(--wa-teal);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 168, 132, 0.25);
  -webkit-appearance: none;
}

.send-btn:hover {
  background: #017561;
  box-shadow: 0 3px 10px rgba(0, 168, 132, 0.35);
}

.send-btn:active {
  transform: scale(0.94);
}

.send-btn:disabled {
  background: var(--wa-teal);
  cursor: pointer;
  opacity: 1;
}

/* ===== DROPDOWN ===== */
.dropdown-container {
  display: flex;
  gap: 6px;
  align-items: center;
}

.chat-select {
  flex: 1;
  padding: 10px 36px 10px 14px;
  border: none;
  border-radius: 21px;
  font-size: 14px;
  font-family: inherit;
  color: var(--wa-text);
  background: #FFFFFF;
  outline: none;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.06);
  min-height: 42px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23667781' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.dropdown-confirm-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--wa-teal) !important;
  color: white !important;
  border: none !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  -webkit-appearance: none;
}

.dropdown-confirm-btn:disabled {
  background: #B3B3B3 !important;
  cursor: not-allowed;
}

/* ===== MINI FOOTER & BRAND BAR - Hidden ===== */
.mini-footer,
.ai-brand-bar {
  display: none;
}

/* ===== MOBILE NAVBAR ===== */
.mobile-navbar {
  display: flex;
  justify-content: space-around;
  padding: 4px 0 4px 0;
  padding-bottom: max(4px, var(--safe-bottom));
  border-top: 1px solid #E0E0E0;
  background: #FFFFFF;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #54656F;
  cursor: pointer;
  padding: 4px 8px 2px 8px;
  position: relative;
  flex: 1;
}

.nav-item i {
  font-size: 20px;
  position: relative;
  z-index: 1;
}

.nav-item span {
  font-size: 11px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.nav-item.active {
  color: var(--wa-header-green);
}

.nav-item.active span {
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 28px;
  background: rgba(0, 168, 132, 0.12);
  border-radius: 14px;
}

/* Progress bar removed */
.progress-bar-container,
.progress-bar {
  display: none !important;
}

/* UTILS */
.hidden {
  display: none !important;
}

/* ===== OPTIONS & BUTTONS ===== */
.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 4px 0;
}

.chat-action-btn {
  background: transparent;
  color: var(--wa-teal);
  border: 1px solid rgba(0, 168, 132, 0.45);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  -webkit-appearance: none;
  white-space: nowrap;
}

.chat-action-btn:hover {
  background: rgba(0, 168, 132, 0.08);
  border-color: var(--wa-teal);
}

.chat-action-btn:active {
  background: rgba(0, 168, 132, 0.15);
}

.chat-action-btn.secondary {
  border-color: rgba(102, 119, 129, 0.35);
  color: var(--wa-secondary);
}

.chat-action-btn.secondary:hover {
  background: rgba(102, 119, 129, 0.08);
}

/* ===== EMBED LOADER ===== */
.embed-loader-container,
.embed1-loader-container,
.embed2-loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--wa-received);
  border: none;
  padding: 12px 16px;
  border-radius: 7.5px;
  width: 100%;
  margin: 2px 0;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.embed-loader-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(0, 128, 105, 0.12);
  border-top-color: var(--wa-header-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.embed-loader-checkmark {
  display: none;
  width: 20px;
  height: 20px;
  background: var(--wa-teal);
  color: #fff;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  animation: scaleIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.embed-loader-container.success {
  background: var(--wa-sent);
}

.embed-loader-container.success .embed-loader-spinner {
  display: none;
}

.embed-loader-container.success .embed-loader-checkmark {
  display: flex;
  background: var(--wa-teal);
}

.embed-loader-status-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--wa-text);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== INFO BOX ===== */
.info-box {
  padding: 10px 12px;
  border-radius: 7.5px;
  border-left: 4px solid var(--wa-teal);
  margin: 2px 0;
  font-size: 13.5px;
  line-height: 19px;
  background: #F0F4F0;
  color: var(--wa-text);
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  width: 100%;
}

.info-box h3 {
  margin: 0 0 4px 0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--wa-header-green);
}

.info-box p {
  margin: 0;
  color: var(--wa-secondary);
  font-size: 13px;
  line-height: 1.45;
}

/* ===== AUDIO PLAYER - WhatsApp voice note ===== */
.audio-player {
  background: var(--wa-sent);
  padding: 6px 10px 6px 6px;
  border-radius: 7.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 2px 0;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.audio-control {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
  color: var(--wa-header-green);
  font-size: 22px;
  flex-shrink: 0;
}

.audio-control:hover {
  background: rgba(0, 128, 105, 0.08);
}

.audio-control:active {
  transform: scale(0.92);
}

.audio-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
}

.audio-waveform-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1px;
  height: 24px;
  cursor: pointer;
  overflow: hidden;
  width: 100%;
}

.audio-bar {
  flex: 1;
  min-width: 2px;
  max-width: 3px;
  border-radius: 1.5px;
  background: rgba(0, 128, 105, 0.25);
  transition: height 0.1s;
  align-self: center;
}

.audio-bar.played {
  background: var(--wa-header-green);
}

.audio-time {
  font-size: 11px;
  font-weight: 400;
  color: var(--wa-msg-time);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ===== PREMIUM CARD ===== */
.premium-card {
  background: #fff;
  border-radius: 7.5px;
  overflow: hidden;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  margin-bottom: 4px;
  width: 100%;
}

.card-header {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #F0F2F5;
}

.card-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--wa-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.card-hero {
  background: linear-gradient(135deg, #008069 0%, #00A884 100%);
  color: #fff;
  padding: 18px 16px;
  position: relative;
}

.hero-label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hero-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.hero-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 10px;
}

.stat-item span {
  display: block;
  font-size: 10px;
  opacity: 0.7;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.stat-item b {
  font-size: 13px;
  font-weight: 600;
}

.card-content {
  padding: 14px;
}

.data-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.data-label {
  font-size: 12px;
  color: var(--wa-secondary);
  font-weight: 400;
  flex-shrink: 0;
}

.data-value {
  font-size: 12.5px;
  color: var(--wa-text);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.data-value.success {
  color: #008069;
}

.data-value.warning {
  color: #EA0038;
}

.card-footer {
  padding: 0 14px 14px;
}

.confirm-panel-btn {
  width: 100%;
  background: var(--wa-teal);
  color: white;
  border: none;
  padding: 11px;
  border-radius: 21px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-appearance: none;
}

.confirm-panel-btn:hover {
  background: #017561;
}

/* Security modal removed */

/* ===== OVERLAY ===== */
.embed-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: #fff;
  z-index: 1001;
  display: none;
  overflow: hidden;
}

.embed-overlay.active {
  display: block;
}

.embed-overlay iframe {
  width: 100%;
  height: 100%;
  height: 100dvh;
  border: none;
  display: block;
  -webkit-overflow-scrolling: touch;
}

/* =========================================
   RESPONSIVE - All Devices
   ========================================= */

/* =========================================
   RESPONSIVE — mobile-first, all devices
   ========================================= */

/* === Global mobile (up to 600px) === */
@media screen and (max-width: 600px) {
  .app {
    max-width: 100%;
  }

  .message.flat {
    max-width: 100% !important;
  }

  .message.video-msg {
    max-width: 100% !important;
  }

  .info-box,
  .embed-loader-container,
  .embed1-loader-container,
  .embed2-loader-container,
  .audio-player,
  .premium-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  .embed-overlay iframe {
    width: 100%;
    height: 100%;
    height: 100dvh;
  }

  .video-container video {
    max-height: 65vh;
    object-fit: contain;
  }

  .premium-card .card-hero {
    padding: 14px 12px;
  }

  .premium-card .hero-value {
    font-size: 24px;
  }

  .premium-card .card-content {
    padding: 10px;
  }

  .premium-card .data-item {
    gap: 6px;
  }

  .premium-card .data-label,
  .premium-card .data-value {
    font-size: 11.5px;
  }
}

/* Very small phones (iPhone SE 1st gen, Galaxy S5) — max 320px */
@media screen and (max-width: 320px) {
  .header-content {
    padding: 4px 2px 4px 0;
    min-height: 46px;
  }

  .header-back {
    padding: 6px 1px 6px 6px;
    font-size: 16px;
  }

  .header-logo {
    width: 30px;
    height: 30px;
    margin-right: 5px;
  }

  .emblem-svg {
    width: 24px;
    height: 24px;
  }

  .header h1 {
    font-size: 13.5px;
  }

  .header-online {
    font-size: 10.5px;
  }

  .header-actions {
    gap: 12px;
    padding: 0 6px 0 4px;
    font-size: 15px;
  }

  .compliance-banner {
    padding: 4px 14px;
    font-size: 10px;
  }

  .chat-area {
    padding: 4px 3px 8px 3px;
  }

  .message {
    font-size: 14px;
    line-height: 19px;
    max-width: 100%;
    padding: 5px 7px 7px 8px;
  }

  .message-group {
    max-width: 100%;
  }

  .message.flat {
    max-width: 100% !important;
  }

  .message.video-msg {
    max-width: 100% !important;
  }

  .chat-action-btn {
    padding: 6px 10px;
    font-size: 12.5px;
  }

  .options-container {
    gap: 4px;
  }

  .chat-input {
    font-size: 14px;
    min-height: 36px;
    padding: 7px 4px;
  }

  .input-box {
    min-height: 36px;
    border-radius: 18px;
  }

  .input-emoji { font-size: 18px; padding: 0 3px 0 7px; }
  .input-attach { font-size: 17px; padding: 0 4px; }
  .input-camera { font-size: 16px; padding: 0 5px 0 3px; }

  .send-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 15px;
  }

  .input-area {
    padding: 3px 4px 4px 4px;
  }

  .nav-item i { font-size: 17px; }
  .nav-item span { font-size: 9.5px; }

  .nav-item.active::before {
    width: 48px;
    height: 26px;
  }

  .hero-value { font-size: 22px; }
  .stat-item b { font-size: 12px; }
  .data-value { font-size: 11px; }

  .audio-player {
    max-width: 100%;
    padding: 5px 8px 5px 4px;
  }

  .audio-control {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 18px;
  }

  .chat-start-timestamp {
    font-size: 10.5px;
    padding: 4px 10px;
  }

  .info-box {
    padding: 8px 10px;
    font-size: 12.5px;
    line-height: 18px;
  }

  .info-box h3 { font-size: 12px; }
  .info-box p { font-size: 12px; }

  .embed-loader-container,
  .embed1-loader-container,
  .embed2-loader-container {
    padding: 10px 12px;
    gap: 8px;
  }

  .embed-loader-status-text { font-size: 12.5px; }

  .premium-card .card-hero { padding: 12px 10px; }
  .premium-card .hero-value { font-size: 20px; }
  .premium-card .hero-label { font-size: 10px; }
  .premium-card .stat-item span { font-size: 9px; }
  .premium-card .card-content { padding: 10px; }
  .premium-card .card-header { padding: 6px 10px; }
  .premium-card .card-title { font-size: 9.5px; }
  .premium-card .data-label { font-size: 10.5px; }
  .premium-card .data-value { font-size: 10.5px; }
  .premium-card .card-footer { padding: 0 10px 10px; }
  .confirm-panel-btn { font-size: 12.5px; padding: 9px; }

  .video-container video { max-height: 50vh; }
  .big-play-btn { width: 42px; height: 42px; font-size: 18px; }

  .msg-time-inline { font-size: 10px; }
  .msg-checks svg { width: 14px; height: 10px; }

  .audio-waveform-container { height: 20px; }
}

/* Small phones (iPhone SE 2/3, iPhone 8, Pixel 4a) — 321 to 375px */
@media screen and (min-width: 321px) and (max-width: 375px) {
  .header-content {
    padding: 5px 2px 5px 0;
    min-height: 50px;
  }

  .header-back { font-size: 18px; }

  .header-logo {
    width: 34px;
    height: 34px;
    margin-right: 7px;
  }

  .header h1 { font-size: 14.5px; }
  .header-online { font-size: 11px; }

  .header-actions {
    gap: 15px;
    font-size: 17px;
    padding: 0 8px 0 6px;
  }

  .compliance-banner {
    padding: 5px 18px;
    font-size: 10.5px;
  }

  .chat-area {
    padding: 4px 3px 8px 3px;
  }

  .message {
    font-size: 15px;
    line-height: 20px;
    max-width: 100%;
  }

  .message-group { max-width: 100%; }
  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }

  .chat-action-btn {
    padding: 7px 14px;
    font-size: 13.5px;
  }

  .chat-input {
    font-size: 15px;
    min-height: 40px;
    padding: 8px 4px;
  }

  .input-box {
    min-height: 40px;
  }

  .input-emoji { font-size: 21px; padding: 0 3px 0 8px; }
  .input-attach { font-size: 19px; }
  .input-camera { font-size: 18px; }

  .send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 17px;
  }

  .audio-player { max-width: 100%; }
  .hero-value { font-size: 24px; }
}

/* Mid phones (iPhone 12 mini, Pixel 5, Galaxy S21) — 376 to 400px */
@media screen and (min-width: 376px) and (max-width: 400px) {
  .header h1 { font-size: 15.5px; }

  .header-actions {
    gap: 17px;
    font-size: 18px;
  }

  .message { max-width: 100%; }
  .message-group { max-width: 100%; }
  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }

  .audio-player { max-width: 100%; }
}

/* Standard phones (iPhone 14/15, Pixel 7, Galaxy S23) — 401 to 430px */
@media screen and (min-width: 401px) and (max-width: 430px) {
  .message { max-width: 100%; }
  .message-group { max-width: 100%; }
  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }
  .audio-player { max-width: 100%; }
}

/* Large phones (iPhone Plus/Max, Galaxy Ultra) — 431 to 600px */
@media screen and (min-width: 431px) and (max-width: 600px) {
  .header-content {
    padding: 8px 6px 8px 0;
    min-height: 58px;
  }

  .header h1 { font-size: 17px; }
  .header-logo { width: 40px; height: 40px; }

  .message {
    max-width: 100%;
    font-size: 16px;
    line-height: 22px;
  }

  .message-group { max-width: 100%; }
  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }

  .chat-area { padding: 6px 6px 12px 6px; }
  .audio-player { max-width: 100%; }
  .chat-input { font-size: 16px; }
}

/* Tablets portrait (iPad, Galaxy Tab) — 601 to 900px */
@media screen and (min-width: 601px) and (max-width: 900px) {
  body {
    background: #2b3940;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 20px;
  }

  .app {
    max-width: 460px;
    height: min(900px, calc(100dvh - 40px));
    margin: 0 auto;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
  }

  .header-content { min-height: 60px; }
  .header h1 { font-size: 17.5px; }

  .message {
    max-width: 100%;
    font-size: 16px;
    line-height: 22px;
  }

  .message-group { max-width: 100%; }
  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }

  .chat-area { padding: 8px 10px 14px 10px; }
  .audio-player { max-width: 100%; }

  .chat-input {
    font-size: 16px;
    min-height: 44px;
  }

  .send-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
}

/* Tablets landscape & desktop — 901px+ */
@media screen and (min-width: 901px) {
  body {
    background: #2b3940;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px;
  }

  .app {
    max-width: 460px;
    height: min(900px, calc(100dvh - 48px));
    margin: 0 auto;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
  }

  .header-content { min-height: 60px; }

  .message {
    max-width: 100%;
    font-size: 16px;
    line-height: 22px;
  }

  .message-group { max-width: 100%; }
  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }

  .chat-area {
    padding: 8px 12px 14px 12px;
    gap: 3px;
  }

  .audio-player { max-width: 100%; }
}

/* Landscape mode on phones */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .header-content {
    min-height: 42px;
    padding: 3px 4px 3px 0;
  }

  .header-logo { width: 28px; height: 28px; }
  .emblem-svg { width: 22px; height: 22px; }
  .header h1 { font-size: 14px; }
  .header-online { font-size: 10.5px; }

  .compliance-banner {
    padding: 2px 20px;
    font-size: 9.5px;
  }

  .mobile-navbar { padding: 2px 0; }

  .nav-item {
    flex-direction: row;
    gap: 4px;
    padding: 3px 8px;
  }

  .nav-item i { font-size: 15px; }
  .nav-item span { font-size: 10px; }

  .nav-item.active::before {
    width: 100%;
    height: 100%;
    border-radius: 10px;
  }

  .chat-input {
    min-height: 34px;
    padding: 6px 4px;
    font-size: 14px;
  }

  .input-box { min-height: 34px; }
  .input-emoji { font-size: 18px; padding: 0 3px 0 7px; }
  .input-attach { font-size: 16px; padding: 0 4px; }
  .input-camera { font-size: 15px; padding: 0 5px 0 3px; }

  .send-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 14px;
  }

  .input-area { padding: 3px 4px; }

  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }
}

/* Galaxy Fold outer screen — very narrow */
@media screen and (max-width: 290px) {
  .header-actions {
    gap: 8px;
    font-size: 14px;
    padding: 0 4px;
  }

  .header-actions i:first-child { display: none; }
  .header h1 { font-size: 12.5px; }

  .header-logo {
    width: 26px;
    height: 26px;
    margin-right: 4px;
  }

  .compliance-banner {
    padding: 3px 10px;
    font-size: 9px;
  }

  .message {
    max-width: 100%;
    font-size: 13px;
    padding: 4px 5px 5px 6px;
  }

  .message-group { max-width: 100%; }
  .message.flat { max-width: 100% !important; }
  .message.video-msg { max-width: 100% !important; }

  .options-container {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-action-btn {
    text-align: center;
    font-size: 12px;
    padding: 5px 8px;
  }
}

/* Notch / Dynamic Island safe areas */
@supports (padding-top: env(safe-area-inset-top)) {
  .header {
    padding-top: env(safe-area-inset-top);
  }

  .mobile-navbar {
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }

  .input-area {
    padding-bottom: max(5px, env(safe-area-inset-bottom));
  }

  .embed-overlay iframe {
    padding-top: env(safe-area-inset-top);
  }
}
