/* WhatsApp-style UI – colors/layout aligned with WhatsApp (ref: github.com/Sovrano28/Whatsapp-UI-Clone) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
  --wa-teal: #075e54;
  --wa-teal-light: #128c7e;
  --wa-green: #25d366;
  --primary: #075e54;
  --primary-dark: #054d45;
  --accent: #25d366;
  --sent-bubble: #d9fdd3;
  --sent-bubble-text: #111;
  --recv-bubble: #fff;
  --recv-bubble-text: #111;
  --chat-bg: #efeae2;
  --header-bg: #075e54;
  --header-text: #fff;
  --list-bg: #fff;
  --border: #e9edef;
  --muted: #667781;
  --input-bg: #f0f2f5;
  --link: #25d366;
}

* { box-sizing: border-box; }
html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: auto;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", "Segoe UI", system-ui, sans-serif;
  background: var(--chat-bg);
  font-size: 15px;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
}

/* ========== Global theme packs (full app) ========== */
body.wa-girls {
  --wa-teal: #d63384;
  --wa-teal-light: #e85ca3;
  --wa-green: #ff6fae;
  --primary: #d63384;
  --primary-dark: #b82e72;
  --accent: #ff6fae;
  --sent-bubble: #ffe4f2;
  --sent-bubble-text: #5b2144;
  --recv-bubble: #fff6fb;
  --recv-bubble-text: #4a2b3e;
  --chat-bg: #fff0f7;
  --header-bg: #d63384;
  --header-text: #fff;
  --list-bg: #fff8fc;
  --border: #f6c8df;
  --muted: #935f79;
  --input-bg: #ffeaf5;
  --link: #d63384;
}

body.wa-corporate {
  --wa-teal: #0b3a67;
  --wa-teal-light: #19528b;
  --wa-green: #1f7a8c;
  --primary: #0b3a67;
  --primary-dark: #072845;
  --accent: #1f7a8c;
  --sent-bubble: #dbeafe;
  --sent-bubble-text: #112f4e;
  --recv-bubble: #fff;
  --recv-bubble-text: #111827;
  --chat-bg: #eef2f7;
  --header-bg: #0b3a67;
  --header-text: #fff;
  --list-bg: #fff;
  --border: #d5dde8;
  --muted: #5b6b7d;
  --input-bg: #f3f6fb;
  --link: #0b3a67;
}

body.wa-luxury {
  --wa-teal: #9f7a2f;
  --wa-teal-light: #b78c35;
  --wa-green: #d8b46b;
  --primary: #9f7a2f;
  --primary-dark: #7e611f;
  --accent: #d8b46b;
  --sent-bubble: #5b4a22;
  --sent-bubble-text: #f7e7c1;
  --recv-bubble: #1e1a12;
  --recv-bubble-text: #f7e7c1;
  --chat-bg: #12100b;
  --header-bg: #1a150d;
  --header-text: #f7e7c1;
  --list-bg: #19150f;
  --border: #3a2f1f;
  --muted: #c8b283;
  --input-bg: #201a12;
  --link: #d8b46b;
}

body.wa-technical {
  --wa-teal: #00bcd4;
  --wa-teal-light: #26cfe4;
  --wa-green: #00e5ff;
  --primary: #00bcd4;
  --primary-dark: #0095a8;
  --accent: #00e5ff;
  --sent-bubble: #003a42;
  --sent-bubble-text: #ecfbff;
  --recv-bubble: #132230;
  --recv-bubble-text: #ecf9ff;
  --chat-bg: #0a1018;
  --header-bg: #112131;
  --header-text: #f3fcff;
  --list-bg: #12202d;
  --border: #2a4154;
  --muted: #b3cede;
  --input-bg: #192b3a;
  --text: #ecf9ff;
  --link: #00e5ff;
}

body.wa-technical .wa-chat-item .wa-name,
body.wa-technical .wa-settings-item,
body.wa-technical .wa-settings-profile,
body.wa-technical .wa-modal,
body.wa-technical .wa-msg-menu button,
body.wa-technical .wa-dropdown,
body.wa-technical .wa-dropdown a {
  color: var(--recv-bubble-text) !important;
}

body.wa-technical .wa-dropdown {
  background: var(--list-bg) !important;
}

body.wa-technical .wa-dropdown a:hover,
body.wa-technical .wa-msg-menu button:hover {
  background: color-mix(in srgb, var(--input-bg) 80%, var(--wa-teal) 20%) !important;
}

body.wa-bigfont {
  --wa-teal: #0a7a5f;
  --wa-teal-light: #0f9a79;
  --wa-green: #11b889;
  --primary: #0a7a5f;
  --primary-dark: #08614c;
  --accent: #11b889;
  --sent-bubble: #d7fbe8;
  --sent-bubble-text: #083a2d;
  --recv-bubble: #ffffff;
  --recv-bubble-text: #102a24;
  --chat-bg: #e9f8f2;
  --header-bg: #0a7a5f;
  --header-text: #fff;
  --list-bg: #fff;
  --border: #c9e9dd;
  --muted: #466f63;
  --input-bg: #f1fcf7;
  --link: #0a7a5f;
  font-size: 18px;
}

body.wa-bigfont input,
body.wa-bigfont button,
body.wa-bigfont select,
body.wa-bigfont textarea {
  font-size: 18px !important;
}

body.wa-girls .wa-header,
body.wa-corporate .wa-header,
body.wa-luxury .wa-header,
body.wa-technical .wa-header,
body.wa-bigfont .wa-header {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

body.wa-girls .wa-settings-section,
body.wa-girls .wa-chat-item,
body.wa-girls .wa-status-item {
  border-radius: 14px;
}

body.wa-corporate .wa-settings-section,
body.wa-corporate .wa-chat-item,
body.wa-corporate .wa-status-item {
  border-radius: 6px;
}

body.wa-luxury .wa-settings-section,
body.wa-luxury .wa-chat-item,
body.wa-luxury .wa-status-item,
body.wa-luxury .card {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

body.wa-technical .wa-settings-section,
body.wa-technical .wa-chat-item,
body.wa-technical .wa-status-item,
body.wa-technical .card {
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, .15), 0 8px 22px rgba(0,0,0,.35);
}

body.wa-bigfont .wa-settings-item .label,
body.wa-bigfont .wa-title,
body.wa-bigfont .wa-chat-item .name,
body.wa-bigfont .wa-status-name {
  font-size: 1.12em;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
input, button { font: inherit; font-size: 15px; }
.btn { display: inline-block; padding: 12px 20px; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; }
.btn-primary { background: var(--wa-teal); color: #fff; }
.btn-primary:hover { background: var(--wa-teal-light); }
.btn-secondary { background: var(--border); color: var(--recv-bubble-text); }
.btn-secondary:hover { background: #d1d5db; }
body.wa-dark .btn-secondary { background: #2a3942; color: #e9edef; }
body.wa-dark .btn-secondary:hover { background: #3a4952; }
.container { max-width: 420px; margin: 0 auto; padding: 24px; width: 100%; }
.card { background: var(--list-bg); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 24px; max-width: 100%; }
@media (max-width: 480px) {
  .container { padding: 16px 12px; max-width: none; }
  .card { padding: 20px 0; }
}

/* Responsive: settings sub-pages (account, privacy, help, contact-details) */
.page.wa-page-scroll .container.wa-settings-container,
.page.wa-page-scroll .container.wa-container-top.wa-settings-container {
  max-width: 100%;
  padding: 0 16px 24px;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .page.wa-page-scroll .container.wa-settings-container,
  .page.wa-page-scroll .container.wa-container-top.wa-settings-container {
    padding: 0 12px 20px;
  }
  .page.wa-page-scroll .wa-settings-section,
  .page.wa-page-scroll .wa-settings-item {
    min-width: 0;
  }
  .page.wa-page-scroll .form-group input,
  .page.wa-page-scroll .form-group textarea,
  .page.wa-page-scroll select {
    max-width: 100%;
    box-sizing: border-box;
  }
  .page.wa-page-scroll #qrCanvas {
    max-width: 100%;
    height: auto;
  }
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: #374151; font-size: 14px; }
.form-group input { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.form-group input:focus { outline: none; border-color: var(--wa-teal); box-shadow: 0 0 0 2px rgba(7,94,84,.2); }
.err { color: #dc2626; font-size: 14px; margin-top: 8px; }
input, button, .card, .container { min-width: 0; }

/* ========== Auth screens (login / register) – app-like full screen ========== */
.page.auth-page { background: #fff; min-height: 100vh; min-height: 100dvh; }
body.wa-dark .page.auth-page { background: #111b21; }

.auth-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}
.auth-screen .auth-form-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 24px 32px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
@supports (padding: env(safe-area-inset-bottom)) {
  .auth-screen .auth-form-wrap { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}

/* Brand block (login: large; register: compact under header) */
.auth-brand {
  padding: 48px 24px 32px;
  text-align: center;
}
.auth-brand--compact { padding: 24px 24px 20px; }
.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--wa-teal);
}
.auth-logo svg { width: 100%; height: 100%; }
.auth-logo--small { width: 48px; height: 48px; margin-bottom: 12px; }
.auth-title {
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 6px;
  color: #111;
  letter-spacing: -0.02em;
}
.auth-title--small { font-size: 22px; }
.auth-tagline {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
body.wa-dark .auth-title { color: #e9edef; }
body.wa-dark .auth-tagline { color: #8696a0; }

/* Register: app header with back */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 8px 0 4px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
body.wa-dark .auth-header { background: #202c33; border-bottom-color: #2a3942; }
.auth-back {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 22px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
body.wa-dark .auth-back { color: #e9edef; }
.auth-back:hover { background: rgba(0,0,0,.06); text-decoration: none; }
body.wa-dark .auth-back:hover { background: rgba(255,255,255,.08); }
.auth-header-title {
  font-size: 18px;
  font-weight: 500;
  color: #111;
}
body.wa-dark .auth-header-title { color: #e9edef; }
.auth-header-spacer { width: 48px; }

/* Form inputs – underline style, app-like */
.auth-form .form-group input {
  padding: 16px 0;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-size: 16px;
  width: 100%;
  min-width: 0;
  color: inherit;
}
body.wa-dark .auth-form .form-group input { border-bottom-color: #2a3942; color: #e9edef; }
.auth-form .form-group input::placeholder { color: var(--muted); }
.auth-form .form-group input:focus {
  outline: none;
  box-shadow: none;
  border-bottom-width: 2px;
  border-bottom-color: var(--wa-teal);
  margin-bottom: -1px;
}
.auth-form .form-group { margin-bottom: 24px; }
.auth-form .form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}
body.wa-dark .auth-form .form-group label { color: #8696a0; }
.auth-form .err { font-size: 13px; margin-top: 4px; margin-bottom: 8px; }
.auth-cta {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 24px;
  min-height: 48px;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
}
.auth-footer {
  margin-top: 24px;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.auth-footer a { color: var(--wa-teal); font-weight: 500; }
body.wa-dark .auth-footer a { color: #00a884; }

/* Safe areas */
@supports (padding: env(safe-area-inset-left)) {
  .auth-screen .auth-form-wrap { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .auth-brand { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .auth-header { padding-left: max(8px, env(safe-area-inset-left)); }
}

/* ========== WhatsApp-style app header (chats + chat screen) ========== */
.wa-header {
  background: var(--header-bg);
  color: var(--header-text);
  height: 56px;
  padding: 0 8px 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.wa-header a { color: var(--header-text); display: flex; align-items: center; padding: 8px; border-radius: 50%; }
.wa-header a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.wa-header .wa-title { font-size: 18px; font-weight: 500; flex: 1; text-align: center; margin: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-header .wa-title.left,
.wa-header .wa-title-left { text-align: left; }
.wa-header-actions { display: flex; align-items: center; gap: 4px; }
.wa-header-actions a, .wa-header-actions span { color: var(--header-text); padding: 8px; cursor: pointer; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.wa-header-actions a:hover, .wa-header-actions span:hover { background: rgba(255,255,255,.1); }
.wa-header-actions svg { width: 22px; height: 22px; fill: currentColor; }
.wa-header-icon { display: inline-flex; align-items: center; justify-content: center; }
.wa-header-icon svg { width: 22px; height: 22px; }

/* ========== Chats list (WhatsApp home) ========== */
.wa-plan-limit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(7, 94, 84, 0.12);
  color: var(--recv-bubble-text);
  font-size: 13px;
  flex-shrink: 0;
}
body.wa-dark .wa-plan-limit-banner { background: rgba(0, 168, 132, 0.15); color: #e9edef; }
.wa-plan-limit-banner a { color: var(--wa-teal); font-weight: 500; text-decoration: none; }
body.wa-dark .wa-plan-limit-banner a { color: var(--wa-green); }
.wa-chats-wrap {
  background: var(--list-bg);
  max-width: 640px;
  margin: 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.wa-header-icon-btn { background: none; border: none; padding: 8px; cursor: pointer; font-size: 20px; line-height: 1; color: inherit; }
.wa-search-bar-inline { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--header-bg); border-bottom: 1px solid var(--border, #e9edef); flex-shrink: 0; }
body.wa-dark .wa-search-bar-inline { background: var(--list-bg); border-bottom-color: #2a3942; }
.wa-search-bar-inline .wa-search-inline { flex: 1; min-width: 0; padding: 10px 14px; border: none; border-radius: 8px; background: var(--list-bg); font-size: 15px; }
body.wa-dark .wa-search-bar-inline .wa-search-inline { background: #2a3942; color: #e9edef; }
.wa-search-bar-inline .wa-search-close { width: 36px; height: 36px; border: none; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; padding: 0; line-height: 1; }
.wa-chat-item-wrap { display: block; }
.wa-search-wrap { padding: 10px 12px 8px; background: var(--header-bg); }
body.wa-dark .wa-search-wrap { background: var(--list-bg); }
.wa-search { width: 100%; padding: 10px 14px 10px 40px; border: none; border-radius: 8px; background: var(--list-bg); font-size: 15px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23667981'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; background-size: 20px; }
.wa-search::placeholder { color: var(--muted); }
.wa-chat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  min-height: 72px;
  transition: background 0.15s;
}
.wa-chat-item:hover { background: #f0f2f5; }
.wa-chat-item .wa-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #dfe5e9; flex-shrink: 0; }
.wa-chat-item .wa-avatar-placeholder { width: 52px; height: 52px; border-radius: 50%; background: #dfe5e9; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: #374151; flex-shrink: 0; line-height: 1; }
body.wa-dark .wa-chat-item .wa-avatar-placeholder { background: #2a3942; color: #8696a0; }
.wa-chat-item .wa-body { flex: 1; min-width: 0; }
.wa-chat-item .wa-name { font-weight: 500; color: #111; font-size: 16px; margin-bottom: 2px; line-height: 1.3; }
.wa-chat-item .wa-preview { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.wa-chat-item .wa-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.wa-chat-item .wa-time { font-size: 12px; color: var(--muted); }
.wa-chat-item .wa-badge { font-size: 12px; font-weight: 500; background: #00a884; color: #fff; border-radius: 50%; padding: 2px 7px; min-width: 22px; height: 22px; line-height: 18px; text-align: center; box-sizing: border-box; }
.wa-chat-avatar-wrap { position: relative; flex-shrink: 0; }
.wa-chat-avatar-wrap.wa-status-unviewed .wa-avatar,
.wa-chat-avatar-wrap.wa-status-unviewed .wa-avatar-placeholder { box-shadow: 0 0 0 2px var(--wa-teal); outline: 2px dashed var(--wa-teal); outline-offset: 2px; }

/* Status tab – WhatsApp-like list */
.wa-status-wrap { background: var(--list-bg); }
.wa-status-my { border-bottom: 1px solid var(--border); }
.wa-status-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  color: inherit; text-decoration: none;
  min-height: 72px;
  transition: background 0.15s;
}
.wa-status-item:hover { background: #f0f2f5; }
body.wa-dark .wa-status-item:hover { background: #202c33; }
.wa-status-avatar-wrap {
  position: relative;
  width: 52px; height: 52px;
  flex-shrink: 0;
}
.wa-status-avatar-wrap.wa-status-avatar-unviewed .wa-status-avatar,
.wa-status-avatar-wrap.wa-status-avatar-unviewed .wa-status-avatar-placeholder {
  box-shadow: 0 0 0 2px var(--list-bg);
  outline: 2px dashed var(--wa-teal);
  outline-offset: 2px;
}
.wa-status-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #dfe5e9; }
.wa-status-avatar-placeholder { width: 52px; height: 52px; border-radius: 50%; background: #e9edef; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 500; color: var(--muted); }
body.wa-dark .wa-status-avatar-placeholder { background: #2a3942; color: #8696a0; }
.wa-status-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-status-name { font-weight: 600; font-size: 16px; color: var(--recv-bubble-text); }
.wa-status-time { font-size: 14px; color: var(--muted); }
.wa-status-menu-btn { font-size: 20px; color: var(--muted); padding: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wa-status-recent-header { font-size: 14px; color: var(--muted); padding: 8px 16px 4px; }
.wa-status-recent-list { border-top: 1px solid var(--border); }
.wa-status-recent-list .wa-status-item { border-bottom: 1px solid var(--border); }
.wa-status-empty { padding: 24px 16px; text-align: center; }
.wa-status-empty-text { margin: 0; font-size: 14px; color: var(--muted); }

/* Status FABs: pencil (small, grey) + camera (main green) */
.wa-fab.wa-fab-status-pencil {
  bottom: 96px; right: 24px;
  width: 56px; height: 56px;
  background: var(--input-bg);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.wa-fab.wa-fab-status-pencil:hover { background: var(--border); color: var(--recv-bubble-text); }
.wa-fab.wa-fab-status-pencil svg { width: 26px; height: 26px; }
.wa-fab.wa-fab-status-camera { bottom: 24px; right: 24px; }
@supports (padding: env(safe-area-inset-bottom)) {
  .wa-fab.wa-fab-status-pencil { bottom: max(96px, calc(76px + env(safe-area-inset-bottom))); right: max(20px, env(safe-area-inset-right)); }
  .wa-fab.wa-fab-status-camera { bottom: max(20px, env(safe-area-inset-bottom)); right: max(20px, env(safe-area-inset-right)); }
}

/* New chat row - match reference */
.wa-new-chat { border-bottom: 1px solid var(--border); }
.wa-new-chat:hover { background: #f0f2f5; }
.wa-new-chat .wa-avatar-placeholder { width: 52px; height: 52px; border-radius: 50%; background: #e9edef; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 300; color: var(--wa-teal); flex-shrink: 0; line-height: 1; }
body.wa-dark .wa-new-chat .wa-avatar-placeholder { background: #2a3942; color: #00a884; }
body.wa-dark .wa-new-chat:hover { background: #202c33; }

/* Broadcast comment panel – full-screen chat-like UI for comments */
.wa-broadcast-comment-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  overflow: hidden;
}
.wa-broadcast-comment-panel .wa-header.broadcast-comment-header {
  flex-shrink: 0;
}
.wa-broadcast-comment-panel #broadcastCommentList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.wa-broadcast-comment-panel .wa-input-bar {
  flex-shrink: 0;
}
.wa-broadcast-comment-panel .broadcast-comment-header .wa-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  padding: 10px 8px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}
/* Legacy: input bar styling when class was broadcast-comment-input-bar */
.wa-broadcast-comment-panel .broadcast-comment-input-bar .wa-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}
.wa-broadcast-comment-panel .broadcast-comment-input-bar input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 24px;
  border: none;
  font-size: 15px;
  background: var(--input-bg);
  color: var(--recv-bubble-text);
}
body.wa-dark .wa-broadcast-comment-panel .broadcast-comment-input-bar input { background: #2a3942; color: #e9edef; }
.wa-broadcast-comment-panel .broadcast-comment-input-bar .wa-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--wa-teal);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-broadcast-comment-panel .broadcast-comment-input-bar .wa-send svg { width: 24px; height: 24px; }

/* Broadcast link preview card (clickable – opens copy modal) */
.wa-broadcast-link-preview {
  transition: background 0.15s;
}
.wa-broadcast-link-preview:hover { background: #e9edef !important; }
.wa-broadcast-link-preview:active { background: #d1d7db !important; }
body.wa-dark .wa-broadcast-link-preview:hover { background: #2a3942 !important; }
body.wa-dark .wa-broadcast-link-preview:active { background: #3a4952 !important; }

/* Broadcast link copy modal – show URL and Copy / Open */
.wa-broadcast-link-copy-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.wa-broadcast-link-copy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.wa-broadcast-link-copy-box {
  position: relative;
  background: var(--list-bg);
  border-radius: 12px;
  padding: 20px;
  max-width: 100%;
  width: 340px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
body.wa-dark .wa-broadcast-link-copy-box { background: #111b21; }
.wa-broadcast-link-copy-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--recv-bubble-text);
}
.wa-broadcast-link-copy-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--recv-bubble-text);
  margin-bottom: 14px;
}
body.wa-dark .wa-broadcast-link-copy-input { background: #2a3942; border-color: #3a4952; color: #e9edef; }
.wa-broadcast-link-copy-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.wa-broadcast-link-copy-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wa-broadcast-link-copy-btn:first-child {
  background: var(--wa-teal);
  color: #fff;
}
.wa-broadcast-link-copy-btn.wa-broadcast-link-copy-open {
  background: var(--border);
  color: var(--recv-bubble-text);
}
body.wa-dark .wa-broadcast-link-copy-btn.wa-broadcast-link-copy-open { background: #2a3942; color: #e9edef; }

/* ========== Chat screen (messages + input) – match reference ========== */
.wa-chat-page {
  height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
}
.wa-chat-header .wa-back { font-size: 22px; padding: 10px 8px; line-height: 1; color: #fff; text-decoration: none; }
.wa-chat-header .wa-avatar-small { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #374151; margin-right: 12px; flex-shrink: 0; }
.wa-chat-header .wa-avatar-placeholder { width: 40px; height: 40px; border-radius: 50%; background: #374151; margin-right: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; color: #e9edef; flex-shrink: 0; }
.wa-chat-header .wa-title { text-align: left; margin: 0; font-size: 16px; font-weight: 600; }
.wa-chat-header .wa-subtitle { font-size: 13px; font-weight: 400; opacity: .85; }
.wa-chat-header .wa-header-actions span:first-of-type { color: var(--wa-teal); }
.wa-chat-header .wa-header-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; min-width: 0; }
.wa-chat-header .wa-header-call { color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 8px; min-width: 44px; min-height: 44px; }
.wa-chat-header .wa-header-call:hover { color: rgba(255,255,255,.9); }
.wa-chat-header .wa-header-call-icon { width: 22px; height: 22px; fill: currentColor; }
body.wa-dark .wa-chat-header .wa-header-call { color: #e9edef; }
body.wa-dark .wa-chat-header .wa-header-call:hover { color: #fff; }
@media (max-width: 400px) {
  .wa-chat-header .wa-header-call { min-width: 40px; min-height: 40px; padding: 6px; }
  .wa-chat-header .wa-header-call-icon { width: 20px; height: 20px; }
}

.wa-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 16px;
  background: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='56' height='56' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 0L56 28L28 56L0 28z' fill='%23d9dbd5' fill-opacity='0.2'/%3E%3C/svg%3E");
  -webkit-overflow-scrolling: touch;
}
body.wa-dark .wa-messages {
  background: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h36v36H0zM36 36h36v36H36z' fill='%23000' fill-opacity='0.25'/%3E%3C/svg%3E");
}
/* Date separator – WhatsApp style centered pill */
.wa-chat-date { text-align: center; margin: 14px 0; }
.wa-chat-date span {
  background: rgba(0,0,0,.2);
  color: rgba(255,255,255,.95);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 500;
}
body.wa-dark .wa-chat-date span { background: rgba(255,255,255,.15); color: rgba(255,255,255,.9); }

.wa-bubble {
  max-width: 75%;
  padding: 6px 12px 8px;
  border-radius: 8px;
  margin-bottom: 2px;
  position: relative;
  box-shadow: 0 1px 0.5px rgba(0,0,0,.13);
}
/* Text bubbles: message and time on same line when short (e.g. "hiiii...    12:39 PM ✓") */
.wa-bubble-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  row-gap: 2px;
  width: 100%;
}
.wa-bubble-inline .wa-bubble-text {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
}
.wa-bubble-inline .wa-time {
  flex: 0 0 auto;
  margin-left: auto;
  margin-top: 0;
}
.wa-edited { font-size: 10px; opacity: 0.85; font-style: italic; margin-left: 4px; color: inherit; }
.wa-bubble .wa-time {
  font-size: 11px;
  opacity: .75;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  margin-top: 4px;
}
.wa-bubble-inline .wa-time { margin-top: 0; }
/* Media: time stays below image with margin */
/* Media bubbles: image inside bubble, tighter padding, time below image */
.wa-bubble:has(.wa-media-thumb) {
  padding: 4px 4px 6px;
  max-width: 85%;
}
.wa-bubble.sent {
  background: var(--sent-bubble);
  color: var(--sent-bubble-text);
  margin-left: auto;
  border-bottom-right-radius: 2px;
}
.wa-bubble.recv {
  background: var(--recv-bubble);
  color: var(--recv-bubble-text);
  border-bottom-left-radius: 2px;
}
.wa-bubble .wa-bubble-text { word-wrap: break-word; font-size: 14px; line-height: 1.4; }
.wa-bubble .wa-bubble-text a { color: inherit; text-decoration: underline; }
.wa-bubble.recv .wa-bubble-text a { color: var(--wa-teal); }
.wa-bubble .wa-status { margin-left: 2px; display: inline-flex; }
.wa-bubble .wa-status svg { width: 16px; height: 16px; }
.wa-bubble.sent .wa-status[data-status="delivered"] { color: #1a5c54; }
.wa-bubble .wa-reply-quote { border-left: 3px solid rgba(0,0,0,.2); padding: 4px 8px; margin-bottom: 6px; background: rgba(0,0,0,.06); border-radius: 4px; }
body.wa-dark .wa-bubble .wa-reply-quote { border-left-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
.wa-bubble .wa-reply-quote[data-reply-to-id] { cursor: pointer; }
.wa-bubble .wa-reply-quote.wa-reply-quote-media { display: flex; align-items: center; gap: 8px; }
.wa-bubble .wa-reply-msg-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(0,0,0,.12);
  flex-shrink: 0;
}
.wa-bubble .wa-reply-msg-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.wa-bubble .wa-reply-quote .wa-reply-name { font-size: 12px; font-weight: 600; opacity: .9; margin-bottom: 2px; }
.wa-bubble .wa-reply-quote .wa-reply-snippet { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-bubble .wa-reply-quote-status { display: flex; align-items: center; gap: 8px; }
.wa-bubble .wa-reply-quote-status .wa-reply-status-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.wa-bubble .wa-reply-quote-status .wa-reply-status-thumb-placeholder { display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(0,0,0,.1); }
.wa-bubble .wa-reply-quote-status .wa-reply-status-thumb-text { display:flex; align-items:center; justify-content:center; padding:6px; box-sizing:border-box; color:#fff; font-weight:800; font-size:11px; line-height:1.1; text-align:center; word-break:break-word; }
.wa-bubble .wa-reply-quote-status .wa-reply-status-label { font-size: 12px; font-weight: 600; opacity: .9; }
.wa-reply-preview .wa-reply-preview-status-thumb { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.wa-reply-preview .wa-reply-preview-status-thumb-text { width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0; display:flex; align-items:center; justify-content:center; padding:5px; box-sizing:border-box; color:#fff; font-weight:800; font-size:10px; line-height:1.1; text-align:center; word-break:break-word; }

/* New message pill (WhatsApp-style) */
.wa-new-msg-pill {
  position: fixed;
  right: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 50;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.96);
  color: #111;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
body.wa-dark .wa-new-msg-pill {
  background: rgba(32,44,51,.96);
  color: #e9edef;
  border-color: rgba(255,255,255,.08);
}
.wa-new-msg-pill:active { transform: scale(0.98); }
.wa-new-msg-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #00a884; }

/* Media thumbnails – smaller max height so chat looks clean */
.wa-bubble .wa-media-thumb {
  position: relative;
  max-width: 200px;
  max-height: 180px;
  min-height: 110px; /* reserve space so media is visible before load */
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  margin: 0;
  background: #000;
}
.wa-bubble .wa-media-thumb.wa-media-image { aspect-ratio: 4 / 3; }
.wa-bubble .wa-media-thumb.wa-media-gif { aspect-ratio: auto; max-height: 240px; }
.wa-bubble .wa-media-thumb.wa-media-gif img { object-fit: contain; background: #000; }
.wa-bubble .wa-media-thumb img {
  width: 100%;
  height: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
  vertical-align: top;
}
.wa-bubble .wa-media-thumb video {
  width: 100%;
  height: auto;
  max-height: 160px;
  min-height: 90px;
  object-fit: cover;
  display: block;
  vertical-align: top;
  background: #1a1a1a;
}
.wa-bubble .wa-media-thumb .wa-media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding-left: 4px;
  pointer-events: none;
}
/* Time + tick overlay on bottom of image/video – darker strip, right-aligned */
.wa-media-time-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 6px 4px;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,.2) 40%, transparent);
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
}
.wa-media-time-overlay .wa-time {
  color: #fff;
  font-size: 11px;
  opacity: 1;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.wa-media-time-overlay .wa-status { margin-left: 2px; }
.wa-media-time-overlay .wa-status svg { width: 14px; height: 14px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.wa-media-time-overlay .wa-status[data-status="read"] { color: #8fcbff; }
.wa-bubble .wa-media-thumb.wa-media-placeholder { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.wa-bubble .wa-media-thumb.wa-media-placeholder .wa-media-time-overlay { align-items: flex-end; justify-content: flex-end; }
.wa-bubble .wa-media-thumb .wa-media-placeholder-label { color: rgba(255,255,255,.8); font-size: 14px; }
.wa-bubble .wa-media-caption { font-size: 14px; line-height: 1.4; word-wrap: break-word; margin-top: 6px; padding: 0 4px; }
.wa-call-msg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wa-call-msg .wa-call-msg-icon { font-size: 18px; }
.wa-call-msg .wa-call-msg-text { flex: 1; min-width: 0; font-size: 14px; }
.wa-call-msg .wa-time { margin-left: auto; }

/* Call / missed call in chat – same left-right style as other bubbles, 10px smaller height */
.wa-bubble.wa-call-bubble-wrap { padding: 4px 10px 6px; }
.wa-bubble .wa-call-bubble { text-decoration: none; color: inherit; }
.wa-bubble .wa-call-missed-inner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.wa-bubble .wa-call-missed-icon {
  width: 32px; height: 32px; border-radius: 50%; background: #e53935; flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z'/%3E%3C/svg%3E");
  background-size: 18px; background-position: center; background-repeat: no-repeat;
}
.wa-bubble .wa-call-missed-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wa-bubble .wa-call-missed-title { font-weight: 600; font-size: 14px; }
.wa-bubble .wa-call-missed-tap { font-size: 12px; opacity: .85; }
.wa-bubble .wa-call-missed-time { font-size: 11px; opacity: .85; margin-left: auto; white-space: nowrap; flex-shrink: 0; }
.wa-bubble .wa-call-msg.wa-call-bubble { padding: 2px 0; }
.wa-bubble .wa-call-msg .wa-call-msg-icon { font-size: 16px; }

.wa-voice-msg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wa-voice-msg .wa-voice-player { max-width: 220px; height: 36px; vertical-align: middle; }
.wa-voice-msg .wa-time { margin-left: auto; }
.wa-voice-msg.wa-voice-uploading { min-height: 56px; padding: 8px 12px; position: relative; }
.wa-voice-msg.wa-voice-uploading .wa-voice-upload-icon { font-size: 20px; }
.wa-voice-msg.wa-voice-uploading .wa-voice-upload-label { font-size: 13px; opacity: .9; }
.wa-media-thumb.wa-media-audio { min-width: 180px; }
.wa-media-thumb.wa-media-audio .wa-media-upload-progress { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Pending upload: circular progress overlay (WhatsApp style) */
.wa-media-thumb.wa-media-uploading { position: relative; }
.wa-media-upload-progress {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  z-index: 2;
  pointer-events: none;
}
.wa-media-upload-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.wa-media-upload-progress .wa-progress-bg {
  fill: none;
  stroke: rgba(255,255,255,.45);
  stroke-width: 3;
}
.wa-media-upload-progress .wa-progress-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset .15s ease-out;
}
.wa-media-upload-progress .wa-progress-percent {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* Fullscreen media preview – close (X) + download */
.wa-media-preview {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.95);
  display: flex; align-items: center; justify-content: center;
  padding: 56px 16px 16px;
}
.wa-media-preview-toolbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 48px;
  padding: 0 8px 0 12px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent);
  z-index: 2001;
}
.wa-media-preview-close {
  width: 40px; height: 40px;
  border: none; background: rgba(255,255,255,.2);
  color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.wa-media-preview-close:hover { background: rgba(255,255,255,.35); }
.wa-media-preview-download {
  width: 40px; height: 40px;
  border: none; background: rgba(255,255,255,.2);
  color: #fff; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.wa-media-preview-download:hover { background: rgba(255,255,255,.35); }
.wa-media-preview-download svg { width: 22px; height: 22px; }
.wa-media-preview img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.wa-media-preview video { max-width: 100%; max-height: 100%; width: auto; height: auto; }

/* Message row */
.wa-message-row { display: flex; width: 100%; margin-bottom: 2px; }
.wa-message-row .wa-msg-select-check { display: none; width: 20px; height: 20px; margin: 0 10px 0 2px; align-self: center; flex: 0 0 auto; }
.wa-message-row .wa-bubble-wrap { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.wa-message-row .wa-bubble-wrap.sent { justify-content: flex-end; }
.wa-message-row .wa-bubble-wrap.recv { justify-content: flex-start; }
.wa-message-row .wa-bubble-wrap .wa-bubble { max-width: 75%; }
.wa-message-row .wa-bubble-wrap .wa-bubble:has(.wa-media-thumb) { max-width: 85%; }
.wa-messages.wa-forward-select-mode .wa-message-row .wa-msg-select-check { display: inline-block; }
.wa-messages.wa-forward-select-mode .wa-message-row.no-forward .wa-msg-select-check { display: none; }
.wa-messages.wa-forward-select-mode .wa-message-row.selected .wa-bubble { box-shadow: 0 0 0 2px rgba(0,168,132,.45); }
body.wa-dark .wa-messages.wa-forward-select-mode .wa-message-row.selected .wa-bubble { box-shadow: 0 0 0 2px rgba(0,168,132,.6); }
.wa-message-row.wa-reply-target .wa-bubble { box-shadow: 0 0 0 2px rgba(0,168,132,.75); }

.wa-forwarded-label { font-size: 11px; line-height: 1.1; font-weight: 600; opacity: .8; margin-bottom: 4px; }

.wa-multi-forward-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 1110;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
body.wa-dark .wa-multi-forward-bar { background: #202c33; border-color: #2f3b42; }
.wa-multi-forward-count { flex: 1; font-size: 13px; color: var(--muted); }
.wa-multi-forward-cancel,
.wa-multi-forward-choose {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.wa-multi-forward-cancel { background: rgba(0,0,0,.06); color: #111; }
body.wa-dark .wa-multi-forward-cancel { background: rgba(255,255,255,.1); color: #e9edef; }
.wa-multi-forward-choose { background: var(--wa-teal); color: #fff; }
body.wa-dark .wa-multi-forward-choose { background: var(--wa-green); }
.wa-multi-forward-choose:disabled { opacity: .55; cursor: not-allowed; }

.wa-delete-msg-backdrop { position: fixed; inset: 0; z-index: 1120; background: rgba(0,0,0,.52); }
.wa-delete-msg-modal {
  position: fixed;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 360px);
  z-index: 1121;
  background: var(--list-bg, #fff);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
  overflow: hidden;
}
body.wa-dark .wa-delete-msg-modal { background: #202c33; }
.wa-delete-msg-title { padding: 14px 16px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
body.wa-dark .wa-delete-msg-title { border-bottom-color: #2f3b42; color: #e9edef; }
.wa-delete-msg-actions { display: flex; flex-direction: column; }
.wa-delete-msg-btn {
  border: none;
  background: transparent;
  text-align: left;
  padding: 14px 16px;
  font-size: 15px;
  color: #111;
  cursor: pointer;
}
body.wa-dark .wa-delete-msg-btn { color: #e9edef; }
.wa-delete-msg-btn:hover { background: rgba(0,0,0,.06); }
body.wa-dark .wa-delete-msg-btn:hover { background: rgba(255,255,255,.08); }
.wa-delete-msg-btn.wa-delete-msg-cancel { color: var(--muted); }

/* Reply preview above input */
.wa-reply-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(0,0,0,.06); border-left: 3px solid var(--wa-teal); margin: 0 8px 4px; border-radius: 6px; flex-wrap: wrap; }
body.wa-dark .wa-reply-preview { background: rgba(255,255,255,.08); }
.wa-reply-preview .wa-reply-preview-label { font-size: 11px; font-weight: 600; color: var(--wa-teal); text-transform: uppercase; letter-spacing: 0.03em; flex-shrink: 0; }
body.wa-dark .wa-reply-preview .wa-reply-preview-label { color: var(--wa-green); }
.wa-reply-preview .wa-reply-preview-text { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-reply-preview .wa-reply-cancel { width: 28px; height: 28px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0; }

/* Long-press message menu */
.wa-msg-menu { position: fixed; z-index: 1000; background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.2); min-width: 160px; padding: 4px 0; }
body.wa-dark .wa-msg-menu { background: #233138; box-shadow: 0 4px 20px rgba(0,0,0,.5); }
.wa-msg-menu button { display: block; width: 100%; text-align: left; padding: 12px 16px; border: none; background: none; font-size: 14px; color: #111; cursor: pointer; }
body.wa-dark .wa-msg-menu button { color: #e9edef; }
.wa-msg-menu button:hover { background: rgba(0,0,0,.06); }
body.wa-dark .wa-msg-menu button:hover { background: rgba(255,255,255,.08); }
.wa-msg-menu-backdrop { position: fixed; inset: 0; z-index: 999; background: transparent; }

/* Forward to contact modal */
.wa-forward-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.5); }
.wa-forward-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 1101; width: 90%; max-width: 360px; max-height: 70vh;
  background: var(--list-bg, #fff); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.2);
  display: flex; flex-direction: column; overflow: hidden;
}
body.wa-dark .wa-forward-modal { background: var(--list-bg); }
.wa-forward-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--border, #e9edef); flex-shrink: 0;
}
.wa-forward-title { font-size: 18px; font-weight: 600; color: #111; }
body.wa-dark .wa-forward-title { color: #e9edef; }
.wa-forward-close {
  width: 36px; height: 36px; border: none; background: transparent;
  font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0;
}
.wa-forward-search {
  flex-shrink: 0; margin: 0 12px 8px; padding: 10px 14px;
  border: 1px solid var(--border, #e9edef); border-radius: 8px;
  font-size: 15px; background: var(--input-bg, #f0f2f5); color: var(--recv-bubble-text, #111);
}
body.wa-dark .wa-forward-search { background: #2a3942; border-color: #3a4952; color: #e9edef; }
.wa-forward-list { flex: 1; overflow-y: auto; padding: 8px 0; -webkit-overflow-scrolling: touch; min-height: 0; }
.wa-forward-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  cursor: pointer; transition: background .15s;
}
.wa-forward-item:hover { background: #f0f2f5; }
body.wa-dark .wa-forward-item:hover { background: #202c33; }
.wa-forward-check { margin: 0; flex-shrink: 0; width: 20px; height: 20px; cursor: pointer; }
.wa-forward-footer { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid var(--border, #e9edef); }
body.wa-dark .wa-forward-footer { border-color: #2a3942; }
.wa-forward-btn {
  width: 100%; padding: 12px; font-size: 16px; font-weight: 500;
  background: var(--wa-teal); color: #fff; border: none; border-radius: 8px; cursor: pointer;
}
.wa-forward-btn:hover:not(:disabled) { opacity: 0.95; }
.wa-forward-btn:disabled { opacity: 0.6; cursor: not-allowed; }
body.wa-dark .wa-forward-btn { background: var(--wa-green); }
.wa-forward-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #dfe5e9; flex-shrink: 0; }
.wa-forward-avatar-placeholder {
  width: 48px; height: 48px; border-radius: 50%; background: var(--wa-teal);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; flex-shrink: 0;
}
body.wa-dark .wa-forward-avatar-placeholder { background: #2a3942; color: #00a884; }
.wa-forward-name { font-size: 16px; font-weight: 500; color: #111; }
body.wa-dark .wa-forward-name { color: #e9edef; }
.wa-forward-loading, .wa-forward-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.wa-encryption-msg {
  max-width: 85%;
  margin: 0 auto 16px;
  padding: 12px 16px;
  background: rgba(255,255,255,.95);
  border-radius: 8px;
  font-size: 13px;
  color: #54656f;
  text-align: center;
  box-shadow: 0 1px 0.5px rgba(0,0,0,.1);
}
body.wa-dark .wa-encryption-msg { background: #202c33; color: #8696a0; }
.wa-encryption-msg .wa-lock { margin-right: 6px; vertical-align: middle; opacity: .8; }

/* ========== Input bar (WhatsApp style – match reference) ========== */
.wa-input-bar {
  display: flex;
  flex-direction: column;
  padding: 8px 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: #f0f2f5;
  border-top: 1px solid var(--border);
  min-height: 52px;
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
}
body.wa-dark .wa-input-bar { background: #1f2c34; border-top-color: #2a3942; }
.wa-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.wa-input-bar .wa-emoji-btn { order: -1; }
.wa-input-bar #input { flex: 1; min-width: 0; order: 0; }
.wa-input-bar .wa-attach,
.wa-input-bar .wa-mic,
.wa-input-bar .wa-send { flex-shrink: 0; }
.wa-input-bar .wa-attach {
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #54656f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
body.wa-dark .wa-input-bar .wa-attach { color: #8696a0; }
.wa-input-bar .wa-attach:hover { background: rgba(0,0,0,.06); }
body.wa-dark .wa-input-bar .wa-attach:hover { background: rgba(255,255,255,.08); }
.wa-input-bar .wa-attach svg { width: 24px; height: 24px; fill: currentColor; }
.wa-input-bar .wa-emoji-icon { width: 24px; height: 24px; }
.wa-input-bar input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  margin: 0;
  border: none;
  border-radius: 24px;
  background: #fff;
  font-size: 15px;
  line-height: 42px;
  box-shadow: none;
  box-sizing: border-box;
  vertical-align: middle;
}
body.wa-dark .wa-input-bar input { background: #2a3942; color: #e9edef; }
body.wa-dark .wa-input-bar input::placeholder { color: #8696a0; }
.wa-input-bar input:focus { outline: none; box-shadow: 0 0 0 1px var(--wa-teal); }
/* Right-side button: white circle with dark icon (reference) */
.wa-input-bar .wa-mic,
.wa-input-bar .wa-send {
  width: 48px;
  height: 48px;
  margin: 0;
  margin-left: 4px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #3b4a54;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
}
body.wa-dark .wa-input-bar .wa-mic,
body.wa-dark .wa-input-bar .wa-send { background: #fff; color: #3b4a54; }
.wa-input-bar .wa-mic:hover,
.wa-input-bar .wa-send:hover { background: #e9edef; }
.wa-input-bar .wa-mic svg,
.wa-input-bar .wa-send svg { width: 24px; height: 24px; }

/* Recording overlay: bar over input with animation, delete left, stop+send right */
.wa-recording-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  background: #f0f2f5;
  border-radius: 24px;
  border: 1px solid var(--border);
  min-height: 48px;
  z-index: 10;
}
body.wa-dark .wa-recording-overlay { background: #2a3942; border-color: #3d4f5c; }
.wa-recording-delete {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #54656f;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
body.wa-dark .wa-recording-delete { color: #8696a0; }
.wa-recording-delete:hover { background: rgba(0,0,0,.08); color: #111; }
body.wa-dark .wa-recording-delete:hover { background: rgba(255,255,255,.08); color: #e9edef; }
.wa-recording-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}
.wa-recording-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00a884;
  animation: wa-recording-pulse 0.8s ease-in-out infinite;
}
.wa-recording-dot:nth-child(2) { animation-delay: 0.1s; }
.wa-recording-dot:nth-child(3) { animation-delay: 0.2s; }
.wa-recording-dot:nth-child(4) { animation-delay: 0.3s; }
.wa-recording-dot:nth-child(5) { animation-delay: 0.4s; }
@keyframes wa-recording-pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}
.wa-recording-duration {
  font-size: 14px;
  color: #54656f;
  min-width: 36px;
  text-align: right;
}
body.wa-dark .wa-recording-duration { color: #8696a0; }
.wa-recording-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wa-recording-stop,
.wa-recording-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.wa-recording-stop {
  background: rgba(0,0,0,.1);
  color: #54656f;
  font-size: 14px;
}
body.wa-dark .wa-recording-stop { background: rgba(255,255,255,.15); color: #e9edef; }
.wa-recording-send {
  background: #00a884;
  color: #fff;
}
.wa-recording-send:hover { background: #06cf9c; }
.wa-recording-send svg { width: 20px; height: 20px; }

/* ========== Chats | Status | Calls tabs (WhatsApp home) ========== */
.wa-tabs { display: flex; background: var(--header-bg); padding: 0; flex-shrink: 0; }
.wa-tab { flex: 1; text-align: center; padding: 14px 8px; font-size: 16px; font-weight: 500; color: rgba(255,255,255,.7); cursor: pointer; position: relative; border: none; background: none; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 4px; }
.wa-tab:hover { color: rgba(255,255,255,.95); }
.wa-tab.active { color: #fff; font-weight: 600; }
.wa-tab.active::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: 0; height: 3px; background: #fff; border-radius: 3px 3px 0 0; }
body.wa-dark .wa-tab { color: #8696a0; }
body.wa-dark .wa-tab:hover { color: #e9edef; }
body.wa-dark .wa-tab.active { color: #00a884; }
body.wa-dark .wa-tab.active::after { background: #00a884; left: 10%; right: 10%; }
.wa-tab-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #00a884; display: inline-block; margin-left: 2px; vertical-align: middle; }
.wa-tab-panel { display: none; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.wa-tab-panel.active { display: flex; }
.wa-tab-panel .wa-search-wrap { flex-shrink: 0; }
.wa-tab-panel .wa-chats-wrap { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ========== Attachment menu (chat input) ========== */
/* Emoji picker – above input bar */
.wa-emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  margin-bottom: 4px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--list-bg);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  padding: 12px;
  z-index: 60;
  display: none;
}
body.wa-dark .wa-emoji-picker { background: #2a3942; }
.wa-emoji-picker-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.wa-emoji-item {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1;
  cursor: pointer; border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.wa-emoji-item:hover { background: rgba(0,0,0,.08); }
body.wa-dark .wa-emoji-item:hover { background: rgba(255,255,255,.1); }

/* GIF modal */
.wa-gif-modal {
  position: fixed; inset: 0; z-index: 2500;
  background: var(--chat-bg);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.wa-gif-modal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.wa-gif-search {
  flex: 1; min-width: 0;
  padding: 10px 14px; border-radius: 24px;
  border: 1px solid var(--border);
  font-size: 15px; background: var(--input-bg);
}
body.wa-dark .wa-gif-search { background: #2a3942; border-color: #3d4f5c; color: #e9edef; }
.wa-gif-close {
  width: 44px; height: 44px;
  border: none; background: transparent;
  font-size: 24px; cursor: pointer;
  color: var(--muted); border-radius: 50%;
}
.wa-gif-results {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 12px;
  align-content: start;
}
.wa-gif-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.06);
  min-height: 0;
}
body.wa-dark .wa-gif-item { background: rgba(255,255,255,.06); }
.wa-gif-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  vertical-align: middle;
}
.wa-gif-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 24px; margin: 0; }

/* Attachment menu – follows app theme (light/dark) */
.wa-attach-menu {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 8px; padding: 16px 12px;
  background: var(--list-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  min-width: 280px; max-width: 92vw;
  z-index: 50; display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 8px;
}
.wa-attach-menu.open { display: grid; }
.wa-attach-menu-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px; cursor: pointer; border: none; background: none;
  width: 100%; font: inherit; text-align: center;
  color: var(--recv-bubble-text);
  border-radius: 12px; -webkit-tap-highlight-color: transparent;
}
.wa-attach-menu-item:hover { background: rgba(0,0,0,.06); }
.wa-attach-menu-item .icon-wrap {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wa-attach-menu-item .icon-wrap svg { width: 26px; height: 26px; }
.wa-attach-menu-item .icon-wrap.document { background: #7c4dff; color: #fff; }
.wa-attach-menu-item .icon-wrap.camera { background: #e91e63; color: #fff; }
.wa-attach-menu-item .icon-wrap.gallery { background: #2196f3; color: #fff; }
.wa-attach-menu-item .icon-wrap.audio { background: #ff9800; color: #fff; }
.wa-attach-menu-item .icon-wrap.catalog { background: #00acc1; color: #fff; }
.wa-attach-menu-item .icon-wrap.quickreply { background: #ffc107; color: #1a1a1a; }
.wa-attach-menu-item .icon-wrap.location { background: #4caf50; color: #fff; }
.wa-attach-menu-item .icon-wrap.contact { background: #2196f3; color: #fff; }
.wa-attach-menu-item .icon-wrap.poll { background: #ffc107; color: #1a1a1a; }
.wa-attach-menu-item .icon-wrap.event { background: #e91e63; color: #fff; }
.wa-attach-menu-item .icon-wrap.gif { background: #7c4dff; color: #fff; font-size: 14px; font-weight: 600; }
.wa-attach-menu-item .icon-wrap.upi { background: #2196f3; color: #fff; }
.wa-attach-menu-item > span:last-child { font-size: 12px; line-height: 1.2; color: inherit; }
/* Dark theme */
body.wa-dark .wa-attach-menu {
  background: #202c33;
  border-color: #2a3942;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
body.wa-dark .wa-attach-menu-item { color: #e9edef; }
body.wa-dark .wa-attach-menu-item:hover { background: rgba(255,255,255,.1); }

/* Audio options sheet (Record voice / Choose from device) */
.wa-audio-options-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.4);
}
.wa-audio-options-sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 320px;
  background: var(--list-bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 8px 0  calc(8px + env(safe-area-inset-bottom));
  z-index: 201;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
}
.wa-audio-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border: none; background: none;
  font: inherit; color: var(--recv-bubble-text);
  text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 8px;
  margin: 0 8px;
}
.wa-audio-option:hover { background: rgba(0,0,0,.06); }
.wa-audio-option-icon { font-size: 24px; }
body.wa-dark .wa-audio-options-sheet { border-color: #2a3942; box-shadow: 0 -4px 24px rgba(0,0,0,.4); }
body.wa-dark .wa-audio-option:hover { background: rgba(255,255,255,.08); }

/* ========== Dark theme ========== */
body.wa-dark { background: #0b141a; --list-bg: #111b21; --chat-bg: #0b141a; --border: #2a3942; --muted: #8696a0; --recv-bubble: #202c33; --recv-bubble-text: #e9edef; --input-bg: #2a3942; }
body.wa-dark .wa-chat-item:hover { background: #202c33; }
body.wa-dark .wa-chat-item .wa-name { color: #e9edef; }
body.wa-dark .card { background: var(--list-bg); }
body.wa-dark .form-group label { color: #e9edef; }
body.wa-dark .wa-search { background: #202c33; color: #e9edef; }
body.wa-dark .wa-search::placeholder { color: #8696a0; }
body.wa-dark .wa-chat-item .wa-preview { color: #8696a0; }
body.wa-dark .wa-chat-item .wa-time { color: #8696a0; }
/* Full-height chats home: contain scroll inside list area only */
.wa-chats-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wa-chats-page .wa-header { flex-shrink: 0; }
.wa-chats-page .wa-tabs { flex-shrink: 0; }
.wa-chats-page .wa-tab-panel.active { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.wa-dark .wa-chats-page .wa-header { background: #202c33; color: #e9edef; }
body.wa-dark .wa-chats-page .wa-header .wa-title { color: #e9edef; font-weight: 600; }
body.wa-dark .wa-chats-page .wa-header-actions .wa-header-icon { color: #e9edef; }
body.wa-dark .wa-chats-page .wa-header-actions .wa-header-icon svg { fill: currentColor; }
body.wa-dark .wa-chats-page .wa-tabs { background: #202c33; }
@media (max-width: 640px) {
  .wa-chats-wrap { max-width: 100%; }
}

/* Auth pages – mobile style + dark theme */
body.wa-dark .page.auth-page { background: var(--chat-bg); }
body.wa-dark .page.auth-page .container { background: var(--chat-bg); }
body.wa-dark .page.auth-page .card { background: var(--chat-bg); }
body.wa-dark .page.auth-page .card h1 { color: #e9edef; }
body.wa-dark .page.auth-page .card .subtitle { color: #8696a0; }
body.wa-dark .page.auth-page .card .footer-text { color: #8696a0; }
body.wa-dark .page.auth-page .card .footer-text a { color: #00a884; }
body.wa-dark .page.auth-page .form-group label { color: #8696a0; }
body.wa-dark .page.auth-page .form-group input { color: #e9edef; border-bottom-color: #2a3942; }
body.wa-dark .page.auth-page .form-group input::placeholder { color: #667781; }
body.wa-dark .page.auth-page .form-group input:focus { border-bottom-color: #00a884; }
body.wa-dark .page.auth-page .err { color: #ff6b6b; }

/* ========== Modal & crop overlay (WhatsApp-style profile crop) ========== */
.wa-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.wa-modal { background: var(--list-bg); border-radius: 12px; max-width: 400px; width: 100%; padding: 20px; box-shadow: 0 4px 20px rgba(0,0,0,.3); color: #111; }
.wa-modal h3 { margin: 0 0 16px; font-size: 18px; }
body.wa-dark .wa-modal { color: #e9edef; }
body.wa-dark .wa-modal h3 { color: #e9edef; }
body.wa-dark .wa-modal .form-group label { color: #8696a0; }
body.wa-dark .wa-modal .form-group input { color: #e9edef; background: #2a3942; border-color: #2a3942; }
.wa-crop-wrap { position: relative; width: 280px; height: 280px; margin: 0 auto 16px; border-radius: 50%; overflow: hidden; background: #000; touch-action: none; cursor: move; user-select: none; }
.wa-crop-wrap img { position: absolute; max-width: none; display: block; pointer-events: none; }
.wa-crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0,0,0,.6); pointer-events: none; }
.wa-crop-zoom { margin: 12px 0 0; padding: 0 8px; }
.wa-crop-zoom label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.wa-crop-zoom input[type="range"] { width: 100%; height: 6px; accent-color: var(--wa-teal); }
.wa-modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }
.wa-modal-actions .btn { padding: 10px 20px; }
.wa-popup-vn { text-align: center; padding: 8px 0; }
.wa-popup-vn .vn-number { font-size: 22px; font-weight: 600; color: var(--wa-teal); margin: 12px 0; letter-spacing: 1px; }

/* ========== Settings list (WhatsApp style) ========== */
/* Settings page: natural scroll, content from top, consistent padding */
.wa-settings-container { padding: 16px 16px 32px !important; }
@supports (padding: env(safe-area-inset-bottom)) {
  .wa-settings-container { padding-bottom: max(32px, env(safe-area-inset-bottom)) !important; }
}
.wa-settings-section { background: var(--list-bg); border-radius: 8px; margin-bottom: 24px; overflow: visible; }
.wa-settings-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); color: #111; text-decoration: none; }
.wa-settings-item:last-child { border-bottom: none; }
.wa-settings-item:hover { background: rgba(0,0,0,.03); }
body.wa-dark .wa-settings-item { color: #e9edef; }
body.wa-dark .wa-settings-item:hover { background: rgba(255,255,255,.05); }
.wa-settings-item .label { flex: 1; color: inherit; }
.wa-settings-item .value { color: var(--muted); font-size: 14px; }
.wa-settings-item .arrow { color: var(--muted); }
.wa-settings-profile { display: flex; align-items: center; padding: 16px 20px; background: var(--list-bg); border-bottom: 1px solid var(--border); gap: 16px; color: #111; }
.wa-settings-profile .wa-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--input-bg); flex-shrink: 0; }
.wa-settings-profile .wa-avatar-initial { width: 64px; height: 64px; border-radius: 50%; background: var(--wa-teal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 500; flex-shrink: 0; }
.wa-settings-profile .wa-profile-body { flex: 1; min-width: 0; }
.wa-settings-profile .wa-profile-name { font-size: 18px; font-weight: 500; color: inherit; margin: 0 0 2px; }
.wa-settings-profile .wa-profile-status { font-size: 14px; color: var(--muted); margin: 0; }
.wa-settings-profile .wa-qr { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--wa-teal); flex-shrink: 0; }
body.wa-dark .wa-settings-profile { color: #e9edef; }
body.wa-dark .wa-settings-profile .wa-profile-name { color: #e9edef; }
body.wa-dark .wa-settings-profile .wa-profile-status { color: #8696a0; }

/* Usage section (progress bars) */
.wa-usage-section { background: var(--list-bg); border-radius: 8px; margin-bottom: 24px; padding: 16px; border: 1px solid var(--border); }
body.wa-dark .wa-usage-section { background: #111b21; border-color: #2a3942; }
.wa-usage-title { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px; }
body.wa-dark .wa-usage-title { color: #8696a0; }
.wa-usage-loading, .wa-usage-muted { font-size: 14px; color: var(--muted); margin: 0; }
.wa-usage-row { margin-bottom: 10px; }
.wa-usage-row:last-child { margin-bottom: 0; }
.wa-usage-row .wa-usage-label { display: block; font-size: 13px; color: var(--recv-bubble-text); margin-bottom: 2px; }
.wa-usage-row .wa-usage-value { font-size: 13px; color: var(--muted); }
body.wa-dark .wa-usage-row .wa-usage-label { color: #e9edef; }
body.wa-dark .wa-usage-row .wa-usage-value { color: #8696a0; }
.wa-usage-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 4px; }
body.wa-dark .wa-usage-bar-wrap { background: #2a3942; }
.wa-usage-bar { height: 100%; background: var(--wa-teal); border-radius: 3px; transition: width 0.2s; }
body.wa-dark .wa-usage-bar { background: var(--wa-green); }
.wa-usage-subtitle { font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.wa-usage-hint .wa-usage-bar-wrap { display: none; }

/* Inline usage bar (chats page) */
.wa-usage-bar-inline { padding: 8px 16px; background: var(--list-bg); border-bottom: 1px solid var(--border); }
body.wa-dark .wa-usage-bar-inline { background: #111b21; border-color: #2a3942; }
.wa-usage-bar-label { font-size: 12px; color: var(--muted); }
body.wa-dark .wa-usage-bar-label { color: #8696a0; }
.wa-usage-bar-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 4px; }
body.wa-dark .wa-usage-bar-track { background: #2a3942; }
.wa-usage-bar-fill { height: 100%; background: var(--wa-teal); border-radius: 2px; transition: width 0.2s; }
body.wa-dark .wa-usage-bar-fill { background: var(--wa-green); }

.wa-settings-item .wa-settings-icon { width: 24px; height: 24px; margin-right: 16px; color: var(--muted); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.wa-settings-item .wa-settings-icon svg { width: 22px; height: 22px; fill: currentColor; }
.wa-settings-item .label-block { flex: 1; min-width: 0; }
.wa-settings-item .label-block .label { display: block; color: inherit; }
.wa-settings-item .label-block .sublabel { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; word-break: break-word; }
body.wa-dark .wa-settings-item .label-block .sublabel { color: #8696a0; }

/* Responsive: settings cards (Account, Privacy, Help, Contact details) – prevent overflow and hidden inputs */
.wa-settings-section { box-sizing: border-box; width: 100%; }
/* Prevent sections from being shrunk by flex so all form fields stay visible */
.page.wa-page-scroll .container .wa-settings-section { flex-shrink: 0; }
.wa-settings-item { min-width: 0; box-sizing: border-box; }
.wa-settings-item .label-block { overflow: visible; max-width: 100%; min-height: 0; }
.wa-settings-item .label-block form,
.wa-settings-item .label-block > div { max-width: 100%; box-sizing: border-box; }
.wa-settings-item .form-group { max-width: 100%; box-sizing: border-box; display: block; }
.wa-settings-item .form-group input,
.wa-settings-item .form-group textarea,
.wa-settings-item .form-group select,
.wa-settings-item input,
.wa-settings-item textarea,
.wa-settings-item select,
.wa-settings-item button.btn { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
#referralBlock .btn,
#earnCoinsBlock .btn {
  width: auto;
  max-width: none;
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
#referralBlock .label-block .sublabel,
#earnCoinsBlock .label-block .sublabel {
  overflow-wrap: break-word;
  word-break: normal;
}
.wa-settings-item.wa-block-row {
  align-items: flex-start;
  gap: 12px;
}
.wa-settings-item.wa-block-row .label-block {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 8px;
}
.wa-settings-item.wa-block-row .label-block .sublabel {
  overflow-wrap: break-word;
  word-break: normal;
}
.wa-settings-item button.btn.wa-block-btn {
  width: auto;
  max-width: none;
  min-width: 100px;
  height: 36px;
  padding: 0 14px;
  white-space: nowrap;
  flex: 0 0 auto;
  align-self: center;
}
@media (max-width: 480px) {
  .wa-settings-section { margin-bottom: 16px; border-radius: 12px; }
  .wa-settings-item { padding: 12px 12px; flex-wrap: wrap; }
  .wa-settings-item .wa-settings-icon { margin-right: 12px; }
  .wa-settings-item .label-block { flex-basis: calc(100% - 40px); }
  .wa-settings-item .label-block form { margin-top: 8px; width: 100%; display: block; }
  .wa-settings-item .form-group { display: block; margin-bottom: 12px; }
  .wa-settings-item .form-group:last-of-type { margin-bottom: 10px; }
  .wa-settings-item .form-group input,
  .wa-settings-item .form-group textarea { padding: 10px 12px; font-size: 16px; display: block; }
  .wa-settings-item .label-block > div[style*="padding"] { padding: 10px !important; max-width: 100%; box-sizing: border-box; word-wrap: break-word; }
  .wa-settings-item .btn { min-width: 0; }
  .wa-settings-item.wa-block-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .wa-settings-item.wa-block-row .label-block {
    width: 100%;
    flex-basis: 100%;
    padding-right: 0;
  }
  .wa-settings-item button.btn.wa-block-btn {
    width: auto;
    max-width: none;
    min-width: 88px;
    height: 34px;
    padding: 0 12px;
    align-self: flex-start;
  }
}

/* Settings page-only mobile cleanup: keep rows readable and prevent overflow */
@media (max-width: 480px) {
  .wa-settings-container {
    padding: 12px 10px 24px !important;
  }

  .wa-settings-profile {
    padding: 14px 12px;
    gap: 12px;
  }
  .wa-settings-profile .wa-avatar,
  .wa-settings-profile .wa-avatar-initial {
    width: 56px;
    height: 56px;
  }
  .wa-settings-profile .wa-avatar-initial {
    font-size: 24px;
  }
  .wa-settings-profile .wa-profile-name {
    font-size: 17px;
  }
  .wa-settings-profile .wa-qr {
    width: 32px;
    height: 32px;
  }

  .wa-settings-container > .wa-settings-section > .wa-settings-item {
    flex-wrap: nowrap;
    align-items: center;
  }
  .wa-settings-container > .wa-settings-section > .wa-settings-item .wa-settings-icon {
    margin-right: 10px;
  }
  .wa-settings-container > .wa-settings-section > .wa-settings-item .label-block {
    flex-basis: auto;
    min-width: 0;
  }
  .wa-settings-container > .wa-settings-section > .wa-settings-item .arrow {
    margin-left: 8px;
    flex-shrink: 0;
    align-self: center;
  }

  #referralBlock,
  #earnCoinsBlock {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  #referralBlock .btn,
  #earnCoinsBlock .btn {
    margin-left: 34px;
    width: calc(100% - 34px);
  }

  #devEnvRow {
    align-items: flex-start !important;
  }
  #devEnvRow .label-block > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  #devEnvRow #waEnvSelect,
  #devEnvRow #waEnvCustomUrl,
  #devEnvRow #waEnvSave {
    width: 100%;
    min-width: 0 !important;
  }

  .wa-usage-section {
    padding: 14px 12px;
  }
}

@media (max-width: 360px) {
  .wa-settings-container {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .wa-settings-item {
    padding-left: 10px;
    padding-right: 10px;
  }
}
.wa-fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--wa-teal); color: #fff; border: none; box-shadow: 0 4px 14px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 40; text-decoration: none; transition: background 0.2s; }
.wa-fab:hover { background: var(--wa-green); color: #fff; }
.wa-fab svg { width: 26px; height: 26px; }
@supports (padding: env(safe-area-inset-bottom)) {
  .wa-fab { bottom: max(20px, env(safe-area-inset-bottom)); right: max(20px, env(safe-area-inset-right)); }
}
.wa-tab .wa-tab-badge { margin-left: 4px; background: rgba(255,255,255,.35); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 50%; min-width: 18px; line-height: 1.2; text-align: center; display: inline-block; }
.wa-tab.active .wa-tab-badge { background: #fff; color: #075e54; }
body.wa-dark .wa-tab .wa-tab-badge { background: #00a884; color: #fff; }
body.wa-dark .wa-tab.active .wa-tab-badge { background: #fff; color: #00a884; }

/* ========== Call log (WhatsApp Calls tab) ========== */
.wa-calls-wrap { padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wa-call-link-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border); transition: background .15s;
}
.wa-call-link-row:hover { background: color-mix(in srgb, var(--input-bg) 82%, var(--wa-teal) 18%); }
.wa-call-link-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--wa-teal); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wa-call-link-icon svg { width: 26px; height: 26px; fill: currentColor; }
.wa-call-link-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-call-link-title { font-size: 16px; font-weight: 600; color: var(--text, #111); }
.wa-call-link-desc { font-size: 14px; color: var(--muted); }
.wa-calls-recent-header { font-size: 14px; font-weight: 500; color: var(--muted); padding: 10px 16px 6px; }
.wa-calls-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
}
.wa-call-item-wrap {
  display: flex; align-items: center; border-bottom: 1px solid var(--border); background: var(--list-bg);
}
.wa-call-item-wrap:active .wa-call-item { background: rgba(0,0,0,.04); }
body.wa-dark .wa-call-item-wrap:active .wa-call-item { background: rgba(255,255,255,.06); }
.wa-call-item {
  flex: 1; display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 72px; color: inherit; text-decoration: none; min-width: 0;
}
.wa-call-item:hover { background: color-mix(in srgb, var(--input-bg) 82%, var(--wa-teal) 18%); }
.wa-call-item .wa-call-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #dfe5e9; flex-shrink: 0; }
.wa-call-item .wa-call-avatar-placeholder {
  width: 52px; height: 52px; border-radius: 50%; background: var(--wa-teal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 500; flex-shrink: 0;
}
.wa-call-item .wa-call-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-call-item .wa-call-name { font-size: 16px; font-weight: 600; color: var(--text, #111); }
.wa-call-item .wa-call-meta { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wa-call-direction { display: inline-block; width: 14px; height: 14px; flex-shrink: 0; }
.wa-call-arrow-outgoing { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300a884'%3E%3Cpath d='M20 5.41L18.59 4 7 15.59V9H5v10h10v-2H8.41z'/%3E%3C/svg%3E") center/contain no-repeat; }
.wa-call-arrow-incoming { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e53935'%3E%3Cpath d='M20 15.5v-4h-4V9h6v6.5c0 1.38-1.12 2.5-2.5 2.5h-11C5.12 18 4 16.88 4 15.5V9h6v2H6v4.5c0 .28.22.5.5.5h11c.28 0 .5-.22.5-.5z'/%3E%3C/svg%3E") center/contain no-repeat; }
.wa-call-arrow-missed { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e53935'%3E%3Cpath d='M20 15.5v-4h-4V9h6v6.5c0 1.38-1.12 2.5-2.5 2.5h-11C5.12 18 4 16.88 4 15.5V9h6v2H6v4.5c0 .28.22.5.5.5h11c.28 0 .5-.22.5-.5z'/%3E%3C/svg%3E") center/contain no-repeat; }
.wa-call-callback {
  width: 48px; height: 72px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--wa-teal); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.wa-call-callback::before {
  content: ''; display: block; width: 24px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300a884'%3E%3Cpath d='M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.wa-call-callback:hover { opacity: .9; }
.wa-calls-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; margin: 0; }
.wa-fab-call { display: none; }
.wa-fab-call .wa-fab-phone-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.wa-fab-call .wa-fab-phone-wrap svg { width: 26px; height: 26px; }
.wa-fab-call .wa-fab-plus { position: absolute; top: -2px; right: -4px; font-size: 14px; font-weight: 700; line-height: 1; color: #fff; }

.wa-toggle { width: 52px; height: 28px; border-radius: 14px; background: var(--border); position: relative; cursor: pointer; flex-shrink: 0; }
.wa-toggle.on { background: var(--wa-teal); }
.wa-toggle::after { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.wa-toggle.on::after { transform: translateX(24px); }

/* ========== Header dropdown menu ========== */
.wa-menu-wrap { position: relative; }
.wa-dropdown { position: absolute; top: 100%; right: 0; margin-top: 4px; background: #fff; color: #111; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.2); min-width: 180px; z-index: 1000; overflow: hidden; }
.wa-dropdown a { display: block; padding: 12px 16px; color: #111; text-decoration: none; border: none; text-align: left; width: 100%; font: inherit; cursor: pointer; background: none; }
.wa-dropdown a:hover { background: rgba(0,0,0,.06); }
body.wa-dark .wa-dropdown { background: #233138; color: #e9edef; }
body.wa-dark .wa-dropdown a { color: #e9edef; }
body.wa-dark .wa-dropdown a:hover { background: rgba(255,255,255,.08); }

/* ========== Camera modal (live camera, tap = photo, hold = video) ========== */
.wa-camera-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: #000;
  display: flex; flex-direction: column;
}
.wa-camera-toolbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 56px;
  padding: 0 12px 0 8px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent);
  z-index: 2;
}
.wa-camera-close, .wa-camera-switch {
  width: 44px; height: 44px;
  border: none; background: rgba(255,255,255,.25);
  color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.wa-camera-close:hover, .wa-camera-switch:hover { background: rgba(255,255,255,.4); }
.wa-camera-live {
  flex: 1;
  width: 100%; height: 100%;
  object-fit: cover;
}
.wa-camera-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  display: flex; justify-content: center; align-items: center;
  background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
  z-index: 2;
}
.wa-camera-capture {
  width: 72px; height: 72px;
  border: 4px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s;
}
.wa-camera-capture:active { transform: scale(0.95); }
.wa-camera-capture.recording {
  border-color: #e53935;
  background: rgba(229,57,53,.4);
  animation: wa-pulse-rec 1s ease-in-out infinite;
}
@keyframes wa-pulse-rec {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}
.wa-capture-inner {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  display: block;
}
.wa-camera-capture.recording .wa-capture-inner {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: #e53935;
}

/* ========== Capture preview modal (retake / send; video trim + mute) ========== */
.wa-capture-preview-modal {
  position: fixed; inset: 0; z-index: 2100;
  background: #000;
  display: flex; flex-direction: column;
}
.wa-capture-preview-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(0,0,0,.7);
  flex-shrink: 0;
}
.wa-capture-retake, .wa-capture-send {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wa-capture-retake { background: rgba(255,255,255,.2); color: #fff; }
.wa-capture-send { background: var(--wa-green); color: #fff; }
.wa-capture-retake:hover { background: rgba(255,255,255,.3); }
.wa-capture-send:hover { background: #2ee66d; }
.wa-capture-preview-area {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  min-height: 0;
}
.wa-capture-preview-area img,
.wa-capture-preview-area video {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
}
.wa-capture-video-options {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(0,0,0,.8);
  flex-shrink: 0;
}
.wa-capture-mute-label {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 14px; cursor: pointer;
  margin-bottom: 12px;
}
.wa-capture-mute-label input { width: 18px; height: 18px; accent-color: var(--wa-teal); }
.wa-capture-trim .wa-capture-trim-label { display: block; color: rgba(255,255,255,.9); font-size: 13px; margin-bottom: 6px; }
.wa-capture-trim-inputs { display: flex; gap: 8px; align-items: center; }
.wa-capture-trim-inputs input[type="range"] { flex: 1; accent-color: var(--wa-teal); }
.wa-capture-trim-times { display: block; font-size: 12px; color: rgba(255,255,255,.7); margin-top: 4px; }

/* ========== Call page (audio/video) — full screen ========== */
.wa-call-page {
  --call-btn-surface: rgba(255,255,255,.16);
  --call-btn-border: rgba(255,255,255,.2);
  --call-btn-icon: rgba(255,255,255,.95);
  --call-btn-active-bg: var(--wa-teal);
  --call-btn-active-icon: #fff;
  --call-accept-bg: var(--wa-teal);
  --call-decline-bg: #e53935;
  --call-offer-label: rgba(255,255,255,.95);
  --call-offer-card-bg: rgba(255,255,255,.2);
  --call-offer-card-border: rgba(255,255,255,.34);
  --call-cancel-glow: color-mix(in srgb, var(--call-decline-bg) 42%, transparent);
  --call-message-bg: rgba(255,255,255,.95);
  --call-message-icon: #3b4a54;
  --call-btn-hover-surface: rgba(255,255,255,.28);
  --call-audio-bg-blur: 16px;
  --call-audio-bg-overlay: radial-gradient(110% 90% at 50% -10%, color-mix(in srgb, var(--wa-teal) 38%, transparent), color-mix(in srgb, var(--page-bg) 88%, transparent) 58%, color-mix(in srgb, var(--page-bg) 98%, transparent) 100%);
  --call-pip-audio-bg-blur: 10px;
  --call-pip-audio-bg-opacity: .8;
  --call-pip-audio-overlay: linear-gradient(180deg, color-mix(in srgb, var(--page-bg) 42%, transparent) 0%, color-mix(in srgb, var(--page-bg) 72%, transparent) 100%);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--wa-teal) 18%, transparent), #0d1418 68%);
  color: #fff;
  display: flex;
  flex-direction: column;
}
body.wa-corporate.wa-call-page {
  --call-btn-surface: color-mix(in srgb, var(--input-bg) 64%, rgba(255,255,255,.22));
  --call-btn-border: color-mix(in srgb, var(--border) 72%, rgba(255,255,255,.26));
  --call-btn-icon: color-mix(in srgb, var(--recv-bubble-text) 90%, #fff 10%);
  --call-btn-active-bg: color-mix(in srgb, var(--wa-teal) 90%, #fff 10%);
  --call-btn-hover-surface: color-mix(in srgb, var(--input-bg) 72%, rgba(255,255,255,.28));
  --call-offer-label: color-mix(in srgb, var(--recv-bubble-text) 85%, #fff 15%);
  --call-offer-card-bg: color-mix(in srgb, var(--input-bg) 64%, rgba(255,255,255,.24));
  --call-offer-card-border: color-mix(in srgb, var(--border) 70%, rgba(255,255,255,.3));
  --call-cancel-glow: color-mix(in srgb, var(--call-decline-bg) 46%, transparent);
}
body.wa-bigfont.wa-call-page {
  --call-btn-surface: color-mix(in srgb, var(--input-bg) 62%, rgba(255,255,255,.24));
  --call-btn-border: color-mix(in srgb, var(--border) 68%, rgba(255,255,255,.28));
  --call-btn-icon: color-mix(in srgb, var(--recv-bubble-text) 92%, #fff 8%);
  --call-btn-active-bg: color-mix(in srgb, var(--wa-teal) 88%, #fff 12%);
  --call-btn-hover-surface: color-mix(in srgb, var(--input-bg) 72%, rgba(255,255,255,.3));
  --call-offer-label: color-mix(in srgb, var(--recv-bubble-text) 84%, #fff 16%);
  --call-offer-card-bg: color-mix(in srgb, var(--input-bg) 62%, rgba(255,255,255,.26));
  --call-offer-card-border: color-mix(in srgb, var(--border) 66%, rgba(255,255,255,.32));
  --call-cancel-glow: color-mix(in srgb, var(--call-decline-bg) 45%, transparent);
}
body.wa-girls.wa-call-page {
  --call-btn-surface: color-mix(in srgb, var(--list-bg) 64%, rgba(255,255,255,.28));
  --call-btn-border: color-mix(in srgb, var(--wa-teal) 34%, rgba(255,255,255,.3));
  --call-btn-icon: color-mix(in srgb, var(--recv-bubble-text) 78%, #fff 22%);
  --call-btn-active-bg: color-mix(in srgb, var(--wa-teal) 80%, #fff 20%);
  --call-btn-hover-surface: color-mix(in srgb, var(--list-bg) 72%, rgba(255,255,255,.32));
  --call-offer-label: color-mix(in srgb, var(--recv-bubble-text) 76%, #fff 24%);
  --call-offer-card-bg: color-mix(in srgb, var(--list-bg) 64%, rgba(255,255,255,.28));
  --call-offer-card-border: color-mix(in srgb, var(--wa-teal) 32%, rgba(255,255,255,.34));
  --call-cancel-glow: color-mix(in srgb, var(--call-decline-bg) 40%, transparent);
  --call-audio-bg-blur: 12px;
  --call-audio-bg-overlay: radial-gradient(110% 90% at 50% -10%, color-mix(in srgb, var(--wa-teal) 30%, transparent), color-mix(in srgb, var(--list-bg) 74%, var(--page-bg)) 56%, color-mix(in srgb, var(--page-bg) 92%, transparent) 100%);
  --call-pip-audio-bg-blur: 8px;
  --call-pip-audio-bg-opacity: .76;
  --call-pip-audio-overlay: linear-gradient(180deg, color-mix(in srgb, var(--list-bg) 30%, transparent) 0%, color-mix(in srgb, var(--page-bg) 64%, transparent) 100%);
}
body.wa-luxury.wa-call-page {
  --call-btn-surface: color-mix(in srgb, var(--input-bg) 78%, rgba(255,255,255,.16));
  --call-btn-border: color-mix(in srgb, var(--border) 84%, rgba(255,255,255,.18));
  --call-btn-icon: color-mix(in srgb, var(--recv-bubble-text) 86%, #fff 14%);
  --call-btn-active-bg: color-mix(in srgb, var(--wa-teal) 82%, #fff 18%);
  --call-btn-hover-surface: color-mix(in srgb, var(--input-bg) 86%, rgba(255,255,255,.2));
  --call-offer-label: color-mix(in srgb, var(--recv-bubble-text) 88%, #fff 12%);
  --call-offer-card-bg: color-mix(in srgb, var(--input-bg) 78%, rgba(255,255,255,.16));
  --call-offer-card-border: color-mix(in srgb, var(--border) 82%, rgba(255,255,255,.22));
  --call-cancel-glow: color-mix(in srgb, var(--call-decline-bg) 48%, transparent);
  --call-audio-bg-blur: 18px;
  --call-audio-bg-overlay: radial-gradient(110% 90% at 50% -10%, color-mix(in srgb, var(--wa-teal) 26%, transparent), color-mix(in srgb, var(--page-bg) 92%, transparent) 54%, color-mix(in srgb, var(--page-bg) 99%, transparent) 100%);
  --call-pip-audio-bg-blur: 11px;
  --call-pip-audio-bg-opacity: .86;
  --call-pip-audio-overlay: linear-gradient(180deg, color-mix(in srgb, var(--page-bg) 44%, transparent) 0%, color-mix(in srgb, var(--page-bg) 78%, transparent) 100%);
}
body.wa-technical.wa-call-page {
  --call-btn-surface: color-mix(in srgb, var(--input-bg) 70%, rgba(255,255,255,.2));
  --call-btn-border: color-mix(in srgb, var(--border) 72%, rgba(255,255,255,.26));
  --call-btn-icon: color-mix(in srgb, var(--recv-bubble-text) 90%, #fff 10%);
  --call-btn-active-bg: color-mix(in srgb, var(--wa-teal) 86%, #fff 14%);
  --call-btn-hover-surface: color-mix(in srgb, var(--input-bg) 78%, rgba(255,255,255,.28));
  --call-offer-label: color-mix(in srgb, var(--recv-bubble-text) 90%, #fff 10%);
  --call-offer-card-bg: color-mix(in srgb, var(--input-bg) 70%, rgba(255,255,255,.2));
  --call-offer-card-border: color-mix(in srgb, var(--border) 72%, rgba(255,255,255,.3));
  --call-cancel-glow: color-mix(in srgb, var(--call-decline-bg) 46%, transparent);
  --call-audio-bg-blur: 14px;
  --call-audio-bg-overlay: radial-gradient(110% 90% at 50% -10%, color-mix(in srgb, var(--wa-teal) 34%, transparent), color-mix(in srgb, var(--page-bg) 86%, transparent) 52%, color-mix(in srgb, var(--page-bg) 96%, transparent) 100%);
  --call-pip-audio-bg-blur: 9px;
  --call-pip-audio-bg-opacity: .78;
  --call-pip-audio-overlay: linear-gradient(180deg, color-mix(in srgb, var(--list-bg) 24%, transparent) 0%, color-mix(in srgb, var(--page-bg) 66%, transparent) 100%);
}
.wa-call-screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: env(safe-area-inset-top) 0 0; width: 100%; }
.wa-call-screen > * { position: relative; z-index: 1; }
.wa-call-audio-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(var(--call-audio-bg-blur)) saturate(1.08);
  transform: scale(1.08);
  transition: opacity .24s ease;
}
.wa-call-audio-bg.is-breathing {
  animation: waCallBreath 4.8s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, filter;
}
@keyframes waCallBreath {
  0%, 100% {
    transform: scale(1.08);
    filter: blur(var(--call-audio-bg-blur)) saturate(1.08);
  }
  50% {
    transform: scale(1.13);
    filter: blur(calc(var(--call-audio-bg-blur) + 2px)) saturate(1.16);
  }
}
.wa-call-audio-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--call-audio-bg-overlay);
}
.wa-call-header { display: flex; align-items: center; width: 100%; max-width: 100%; padding: 8px 12px; margin-bottom: 0; flex-shrink: 0; }
.wa-call-back { color: #fff; font-size: 24px; text-decoration: none; padding: 8px; -webkit-tap-highlight-color: transparent; z-index: 15; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.wa-call-back svg { width: 24px; height: 24px; }
.wa-call-status { flex: 1; text-align: center; font-size: 15px; color: rgba(255,255,255,.8); }
.wa-call-sender-preview {
  width: calc(100% - 24px);
  max-width: 460px;
  margin: 6px auto 10px;
  padding: 8px 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--call-btn-surface) 92%, transparent);
  border: 1px solid var(--call-btn-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wa-call-sender-preview-avatar,
.wa-call-sender-preview-avatar-ph {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wa-call-sender-preview-avatar { object-fit: cover; }
.wa-call-sender-preview-avatar-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--wa-teal) 28%, var(--input-bg));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.wa-call-sender-preview-meta { display: flex; flex-direction: column; min-width: 0; }
.wa-call-sender-preview-name {
  color: var(--call-btn-icon);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-call-sender-preview-type {
  color: color-mix(in srgb, var(--call-btn-icon) 70%, transparent);
  font-size: 12px;
  margin-top: 1px;
}
.wa-call-sender-preview-timer {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  background: rgba(0,0,0,.35);
  border-radius: 999px;
  padding: 3px 8px;
  flex-shrink: 0;
}
.wa-call-avatar-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; flex-shrink: 0; }
.wa-call-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: #2a3942; }
.wa-call-avatar-placeholder { width: 120px; height: 120px; border-radius: 50%; background: var(--wa-teal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 300; }
.wa-call-name { font-size: 22px; font-weight: 500; margin-top: 16px; }
.wa-call-subtext { font-size: 14px; color: rgba(255,255,255,.6); margin-top: 4px; }
.wa-call-video-area { position: relative; flex: 1; width: 100%; max-width: none; min-height: 0; background: #000; border-radius: 0; overflow: hidden; display: flex; }
/* Remote user video (no mirror) */
.wa-call-remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.wa-call-remote-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
  background: #000;
}
.wa-call-remote-fallback-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(12px) saturate(1.1);
  transform: scale(1.1);
}
.wa-call-remote-fallback-bg.is-breathing {
  animation: waCallRemoteBreath 4.8s ease-in-out infinite;
}
.wa-call-remote-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(255,255,255,.08), rgba(0,0,0,.35));
}
.wa-call-remote-fallback-avatar,
.wa-call-remote-fallback-ph {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
}
.wa-call-remote-fallback-avatar { object-fit: cover; }
.wa-call-remote-fallback-ph {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  background: rgba(7,94,84,.72);
}
/* Local self preview (mirror like selfie camera) */
.wa-call-local-video {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,.4);
  z-index: 2;
  transform: scaleX(-1); /* mirror only local */
}
.wa-call-local-fallback {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 120px;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.35);
  background: rgba(10,12,18,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.wa-call-local-fallback-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(10px) saturate(1.08);
  transform: scale(1.08);
}
.wa-call-local-fallback-bg.is-breathing {
  animation: waCallLocalBreath 4.6s ease-in-out infinite;
}
.wa-call-local-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.12), rgba(0,0,0,.28));
}
.wa-call-local-fallback-avatar,
.wa-call-local-fallback-ph {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
}
.wa-call-local-fallback-avatar { object-fit: cover; }
.wa-call-local-fallback-ph {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: rgba(7,94,84,.75);
}
@keyframes waCallLocalBreath {
  0%, 100% { transform: scale(1.08); filter: blur(10px) saturate(1.05); }
  50% { transform: scale(1.13); filter: blur(12px) saturate(1.14); }
}
@keyframes waCallRemoteBreath {
  0%, 100% { transform: scale(1.1); filter: blur(12px) saturate(1.08); }
  50% { transform: scale(1.16); filter: blur(14px) saturate(1.16); }
}
body.wa-call-video-active .wa-call-header { display: none !important; }
body.wa-call-video-active .wa-call-audio-bg { opacity: 0 !important; }
body.wa-call-video-active .wa-call-sender-preview {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(env(safe-area-inset-top) + 10px);
  z-index: 26;
  margin: 0 auto;
}
body.wa-call-video-active .wa-call-sender-preview.is-collapsed {
  width: 56px;
  height: 56px;
  left: 12px;
  right: auto;
  top: calc(env(safe-area-inset-top) + 10px);
  border-radius: 50%;
  padding: 0;
  justify-content: center;
  background: rgba(18,22,32,.42);
  border-color: rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.wa-call-video-active .wa-call-sender-preview.is-collapsed .wa-call-sender-preview-meta { display: none; }
body.wa-call-video-active .wa-call-sender-preview.is-collapsed .wa-call-sender-preview-avatar,
body.wa-call-video-active .wa-call-sender-preview.is-collapsed .wa-call-sender-preview-avatar-ph {
  width: 42px;
  height: 42px;
}
body.wa-call-video-active .wa-call-sender-preview.is-collapsed .wa-call-sender-preview-timer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -14px;
  padding: 2px 7px;
  font-size: 11px;
  background: rgba(8,12,20,.72);
}
body.wa-call-video-active .wa-call-avatar-wrap { display: none !important; }
body.wa-call-video-active .wa-call-video-area { position: fixed !important; inset: 0; z-index: 1; width: 100vw; height: 100vh; height: 100dvh; max-width: none; }
body.wa-call-video-active .wa-call-local-video { transform: scaleX(-1); }
body.wa-call-video-active .wa-call-actions { z-index: 25; }
.wa-call-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 18px 12px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(4,10,18,.82) 0%, rgba(8,16,28,.52) 52%, rgba(8,16,28,0) 100%);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  -webkit-tap-highlight-color: transparent;
}
.wa-call-actions-incall { gap: 8px; flex-wrap: nowrap; }
.wa-call-btn { width: 64px; height: 64px; border-radius: 50%; border: 1px solid transparent; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; outline: none; }
.wa-call-btn:active { transform: scale(0.95); }
.wa-call-btn-answer { background: var(--call-accept-bg); color: #fff; box-shadow: 0 4px 20px color-mix(in srgb, var(--call-accept-bg) 42%, transparent); }
.wa-call-btn-decline { background: var(--call-decline-bg); color: #fff; box-shadow: 0 4px 20px color-mix(in srgb, var(--call-decline-bg) 42%, transparent); }
.wa-call-btn-hangup { background: var(--call-decline-bg); color: #fff; box-shadow: 0 4px 20px color-mix(in srgb, var(--call-decline-bg) 42%, transparent); }
.wa-call-btn-mute, .wa-call-btn-speaker, .wa-call-btn-camera { background: var(--call-btn-surface); border-color: var(--call-btn-border); color: var(--call-btn-icon); }
.wa-call-btn-mute:hover, .wa-call-btn-speaker:hover, .wa-call-btn-camera:hover { background: var(--call-btn-hover-surface); }
.wa-call-encrypted-top { display: block; text-align: center; font-size: 13px; color: rgba(255,255,255,.7); padding: 12px 0; }
.wa-call-encrypted { font-size: 13px; color: rgba(255,255,255,.8); margin-bottom: 16px; }
/* In-call action labels (Mute, Message, Speaker, End) */
.wa-call-actions-incall .wa-call-btn {
  width: 56px;
  height: 64px;
  border-radius: 18px;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  line-height: 1.1;
  color: var(--call-btn-icon);
  background: linear-gradient(160deg, color-mix(in srgb, var(--call-btn-surface) 84%, rgba(255,255,255,.24) 16%), color-mix(in srgb, var(--call-btn-surface) 88%, rgba(0,0,0,.15) 12%));
  border-color: color-mix(in srgb, var(--call-btn-border) 75%, rgba(255,255,255,.22) 25%);
  box-shadow: 0 10px 26px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.24);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
.wa-call-actions-incall .wa-call-btn::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(255,255,255,.22), rgba(255,255,255,0));
  pointer-events: none;
}
.wa-call-actions-incall .wa-call-btn svg { width: 22px; height: 22px; }
.wa-call-actions-incall .wa-call-btn.is-active { background: linear-gradient(160deg, color-mix(in srgb, var(--call-btn-active-bg) 84%, #fff 16%), var(--call-btn-active-bg)); color: var(--call-btn-active-icon); border-color: color-mix(in srgb, var(--call-btn-active-bg) 80%, #fff 20%); box-shadow: 0 12px 26px color-mix(in srgb, var(--call-btn-active-bg) 42%, transparent), inset 0 1px 0 rgba(255,255,255,.24); }
.wa-call-actions-incall .wa-call-btn-message-incall { background: var(--call-btn-surface); }
.wa-call-actions-incall .wa-call-btn-hangup {
  background: linear-gradient(160deg, color-mix(in srgb, var(--call-decline-bg) 85%, #fff 15%), var(--call-decline-bg));
  border-color: color-mix(in srgb, var(--call-decline-bg) 80%, #fff 20%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--call-decline-bg) 38%, transparent), inset 0 1px 0 rgba(255,255,255,.2);
}
.wa-call-actions-incall .wa-call-btn-hangup svg,
.wa-call-minimized-end svg {
  transform: rotate(135deg);
}
.wa-call-actions-incall .wa-call-btn-hangup.is-active { background: var(--call-decline-bg); border-color: var(--call-decline-bg); color: #fff; }
.wa-call-action-label {
  display: block;
  max-width: 52px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Incoming/outgoing offer controls on call screen */
.wa-call-actions-offer { gap: 28px; }
.wa-call-actions-offer .wa-call-btn.wa-call-btn-circle {
  --wa-offer-bg: var(--call-offer-card-bg);
  --wa-offer-icon: #fff;
  --wa-offer-label: var(--call-offer-label);
  --wa-offer-circle-size: 64px;
  position: relative;
  display: grid;
  grid-template-rows: var(--wa-offer-circle-size) auto;
  justify-items: center;
  row-gap: 10px;
  width: 88px;
  height: auto;
  padding: 0;
  border: none;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--wa-offer-label);
  font-size: 12px;
  line-height: 0;
  align-items: center;
}
.wa-call-actions-offer .wa-call-btn.wa-call-btn-circle::before {
  content: '';
  grid-row: 1;
  width: var(--wa-offer-circle-size);
  height: var(--wa-offer-circle-size);
  border-radius: 50%;
  background: linear-gradient(160deg, color-mix(in srgb, var(--wa-offer-bg) 82%, #fff 18%), var(--wa-offer-bg));
  border: 1px solid color-mix(in srgb, var(--call-offer-card-border) 78%, #fff 22%);
  box-shadow: 0 12px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.24);
}
.wa-call-actions-offer .wa-call-btn.wa-call-btn-circle svg {
  grid-row: 1;
  width: 28px;
  height: 28px;
  color: var(--wa-offer-icon);
  z-index: 1;
  position: absolute;
  top: calc(var(--wa-offer-circle-size) / 2);
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  transform-origin: 50% 50%;
}
.wa-call-actions-offer .wa-call-btn.wa-call-btn-circle .wa-call-btn-label {
  grid-row: 2;
  width: 100%;
  margin: 0;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.wa-call-actions-offer .wa-call-btn.wa-call-btn-circle:active { transform: scale(0.98); }
.wa-call-actions-offer .wa-call-btn-answer { --wa-offer-bg: var(--call-accept-bg); --wa-offer-icon: #fff; }
.wa-call-actions-offer .wa-call-btn-decline { --wa-offer-bg: var(--call-decline-bg); --wa-offer-icon: #fff; }
.wa-call-actions-offer .wa-call-btn-decline svg { transform: translate(-50%, -50%) rotate(135deg); }
.wa-call-actions-offer #btnCancel {
  --wa-offer-bg: var(--call-decline-bg) !important;
  --wa-offer-icon: #fff !important;
}
.wa-call-actions-offer .wa-call-btn.wa-call-btn-decline::before {
  box-shadow: 0 14px 26px var(--call-cancel-glow), inset 0 1px 0 rgba(255,255,255,.22);
}
.wa-call-actions-offer .wa-call-btn.wa-call-btn-decline .wa-call-btn-label {
  color: color-mix(in srgb, var(--call-offer-label) 70%, #fff 30%);
}

@media (max-width: 360px) {
  .wa-call-actions-incall { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .wa-call-actions-incall .wa-call-btn { width: 52px; height: 60px; border-radius: 16px; }
  .wa-call-actions-incall .wa-call-btn svg { width: 20px; height: 20px; }
  .wa-call-action-label { max-width: 48px; }
  .wa-call-actions-offer { gap: 18px; }
  .wa-call-actions-offer .wa-call-btn.wa-call-btn-circle { --wa-offer-circle-size: 58px; width: 80px; row-gap: 8px; }
  .wa-call-actions-offer .wa-call-btn.wa-call-btn-circle svg { width: 24px; height: 24px; }
}

/* ===== Call PiP (chat inside call page) ===== */
.wa-call-chat-wrap {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: #0d1418;
}
.wa-call-chat-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0d1418;
}
.wa-call-pip {
  position: fixed;
  z-index: 2000;
  left: 16px;
  top: calc(env(safe-area-inset-top) + 16px);
  width: 200px;
  height: 280px;
  min-width: 160px;
  min-height: 200px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  touch-action: none;
  user-select: none;
}
.wa-call-pip-bar {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0));
  z-index: 3;
  cursor: grab;
}
.wa-call-pip-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.wa-call-pip-btn:active { transform: scale(0.96); }
.wa-call-pip-btn.wa-danger { background: rgba(229,57,53,.9); border-color: rgba(229,57,53,.4); }
.wa-call-pip-content { position: absolute; inset: 0; }
.wa-call-pip-center-cta {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.94);
  z-index: 5;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.58);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 9px 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wa-call-pip.show-center-action .wa-call-pip-center-cta {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.wa-call-pip-resize {
  position: absolute;
  right: 0; bottom: 0;
  width: 26px; height: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.35));
  z-index: 4;
  cursor: nwse-resize;
}
.wa-call-pip-audio {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: radial-gradient(circle at 30% 20%, rgba(0,168,132,.22), rgba(0,0,0,.88));
}
.wa-call-pip-audio .wa-call-pip-audio-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(var(--call-pip-audio-bg-blur)) saturate(1.08);
  transform: scale(1.12);
  opacity: var(--call-pip-audio-bg-opacity);
}
.wa-call-pip-audio .wa-call-pip-audio-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--call-pip-audio-overlay);
}
.wa-call-pip-audio .wa-call-pip-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a3942;
  display: block;
  position: relative;
  z-index: 1;
}
.wa-call-pip-audio .wa-call-pip-avatar-ph {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--wa-teal);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  position: relative;
  z-index: 1;
}
.wa-call-pip-audio .wa-call-pip-name {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

/* When PiP is active, hide full call UI (PiP becomes the call) */
body.wa-call-pip-mode #callScreen { display: none !important; }
body.wa-call-pip-mode .wa-call-pip .wa-call-video-area {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  z-index: 1 !important;
}
body.wa-call-pip-mode .wa-call-pip .wa-call-local-video {
  z-index: 2;
  right: 6px;
  top: 6px;
  width: min(34%, 96px);
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  border-width: 1.5px;
}
body.wa-call-pip-mode .wa-call-pip .wa-call-local-fallback {
  right: 6px;
  top: 6px;
  width: min(34%, 96px);
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  border-width: 1.5px;
}
body.wa-call-pip-mode .wa-call-pip .wa-call-local-fallback-avatar,
body.wa-call-pip-mode .wa-call-pip .wa-call-local-fallback-ph {
  width: min(56px, 60%);
  height: min(56px, 60%);
}
body.wa-call-pip-mode .wa-call-pip .wa-call-local-fallback-ph {
  font-size: clamp(16px, 4vw, 24px);
}
/* Minimized call bar */
.wa-call-minimized-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: #1f2c34; border-top: 1px solid #2a3942;
  -webkit-tap-highlight-color: transparent;
}
.wa-call-minimized-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-call-minimized-duration { font-size: 18px; font-weight: 600; color: #fff; }
.wa-call-minimized-name { font-size: 15px; color: rgba(255,255,255,.9); }
.wa-call-minimized-type { font-size: 12px; color: rgba(255,255,255,.6); }
.wa-call-minimized-expand {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--call-btn-border); background: var(--call-btn-surface);
  color: #fff; font-size: 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-call-minimized-expand svg { width: 22px; height: 22px; }
.wa-call-minimized-end {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--call-decline-bg); background: var(--call-decline-bg); color: #fff;
  font-size: 15px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-call-minimized-end svg { width: 22px; height: 22px; }
/* Incoming call – three circular buttons (Decline, Accept, Message) */
.wa-call-incoming-rich .wa-call-incoming-self-overlay { padding-bottom: max(48px, env(safe-area-inset-bottom)); }
.wa-call-incoming-three { display: flex; align-items: flex-end; justify-content: center; gap: 36px; flex-wrap: wrap; }
.wa-call-btn-circle-inline {
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  width: 72px; border: none; background: transparent; color: #fff; cursor: pointer;
  font-size: 12px; text-decoration: none; -webkit-tap-highlight-color: transparent;
  padding: 0;
  --wa-inline-bg: var(--call-offer-card-bg);
  --wa-inline-icon: #fff;
  --wa-inline-label: var(--call-offer-label);
  color: var(--wa-inline-label);
}
.wa-call-btn-circle-inline .wa-call-btn-circle-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--wa-inline-bg) 82%, #fff 18%), var(--wa-inline-bg));
  border: 1px solid color-mix(in srgb, var(--call-offer-card-border) 78%, #fff 22%);
  box-shadow: 0 12px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.24);
}
.wa-call-btn-circle-inline .wa-call-btn-circle-icon svg { width: 28px; height: 28px; color: var(--wa-inline-icon); transform-origin: 50% 50%; }
.wa-call-btn-circle-inline.wa-call-btn-decline { --wa-inline-bg: var(--call-decline-bg); --wa-inline-icon: #fff; }
.wa-call-btn-circle-inline.wa-call-btn-answer { --wa-inline-bg: var(--call-accept-bg); --wa-inline-icon: #fff; }
.wa-call-btn-circle-inline.wa-call-btn-message { --wa-inline-bg: var(--call-message-bg); --wa-inline-icon: var(--call-message-icon); }
.wa-call-btn-circle-inline.wa-call-btn-answer .wa-call-btn-circle-icon {
  background: linear-gradient(160deg, color-mix(in srgb, var(--call-accept-bg) 84%, #fff 16%), var(--call-accept-bg));
  border-color: color-mix(in srgb, var(--call-accept-bg) 78%, #fff 22%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--call-accept-bg) 42%, transparent), inset 0 1px 0 rgba(255,255,255,.24);
}
.wa-call-btn-circle-inline.wa-call-btn-decline .wa-call-btn-circle-icon {
  background: linear-gradient(160deg, color-mix(in srgb, var(--call-decline-bg) 84%, #fff 16%), var(--call-decline-bg));
  border-color: color-mix(in srgb, var(--call-decline-bg) 78%, #fff 22%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--call-decline-bg) 42%, transparent), inset 0 1px 0 rgba(255,255,255,.24);
}
.wa-call-btn-circle-inline .wa-call-btn-label { max-width: 90px; text-align: center; line-height: 1.2; }
.wa-call-btn-circle-inline.wa-call-btn-decline .wa-call-btn-circle-icon svg { transform: rotate(135deg); }

/* Incoming receiver screen: hard enforce semantic colors */
#btnAttendIncoming.wa-call-btn-answer .wa-call-btn-circle-icon {
  background: linear-gradient(160deg, color-mix(in srgb, var(--call-accept-bg) 84%, #fff 16%), var(--call-accept-bg)) !important;
  border: 1px solid color-mix(in srgb, var(--call-accept-bg) 78%, #fff 22%) !important;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--call-accept-bg) 42%, transparent), inset 0 1px 0 rgba(255,255,255,.24) !important;
}
#btnDeclineIncoming.wa-call-btn-decline .wa-call-btn-circle-icon {
  background: linear-gradient(160deg, color-mix(in srgb, var(--call-decline-bg) 84%, #fff 16%), var(--call-decline-bg)) !important;
  border: 1px solid color-mix(in srgb, var(--call-decline-bg) 78%, #fff 22%) !important;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--call-decline-bg) 42%, transparent), inset 0 1px 0 rgba(255,255,255,.24) !important;
}
#btnAttendIncoming.wa-call-btn-answer .wa-call-btn-circle-icon svg,
#btnDeclineIncoming.wa-call-btn-decline .wa-call-btn-circle-icon svg { color: #fff !important; }

/* Incoming call-screen actions (preview incoming / non-self incoming layout): hard enforce colors */
#btnAnswer.wa-call-btn-answer,
#btnAnswer.wa-call-btn-answer::before {
  --wa-offer-bg: var(--call-accept-bg) !important;
  --wa-offer-icon: #fff !important;
}
#btnDecline.wa-call-btn-decline,
#btnDecline.wa-call-btn-decline::before {
  --wa-offer-bg: var(--call-decline-bg) !important;
  --wa-offer-icon: #fff !important;
}

/* Incoming full-screen self view (camera + Attend) */
.wa-call-incoming-self { position: fixed; inset: 0; z-index: 10; background: #000; display: flex; flex-direction: column; }
.wa-call-incoming-remote-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(var(--call-audio-bg-blur)) saturate(1.08);
  transform: scale(1.08);
  transition: opacity .24s ease;
}
.wa-call-incoming-remote-bg.is-breathing {
  animation: waCallBreath 4.8s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, filter;
}
.wa-call-incoming-remote-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--call-audio-bg-overlay);
}
.wa-call-incoming-self-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wa-call-incoming-self-overlay { position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--page-bg) 86%, transparent) 0%, color-mix(in srgb, var(--page-bg) 46%, transparent) 40%, transparent 70%); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 32px 24px max(32px, env(safe-area-inset-bottom)); }
.wa-call-incoming-self-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--wa-teal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 300; margin-bottom: 16px; flex-shrink: 0; }
.wa-call-incoming-self-avatar-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; }
.wa-call-incoming-self-name { font-size: 24px; font-weight: 600; color: #fff; margin-bottom: 4px; text-align: center; }
.wa-call-incoming-self-subtext { font-size: 15px; color: rgba(255,255,255,.8); margin-bottom: 28px; text-align: center; }
.wa-call-incoming-self-actions { display: flex; align-items: center; justify-content: center; gap: 32px; width: 100%; max-width: 320px; }
.wa-call-btn-attend { min-width: 140px; padding: 16px 28px; font-size: 18px; font-weight: 600; border-radius: 32px; animation: wa-attend-pulse 1.8s ease-in-out infinite; }
.wa-call-btn-rich { min-width: 120px; padding: 16px 24px; font-size: 16px; font-weight: 600; border-radius: 28px; }
@keyframes wa-attend-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,.5); transform: scale(1); } 50% { box-shadow: 0 0 0 14px rgba(37,211,102,0); transform: scale(1.02); } }

.wa-header-action { color: inherit; text-decoration: none; padding: 4px 8px; font-size: 20px; display: inline-flex; -webkit-tap-highlight-color: transparent; }
.wa-incoming-call-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 24px; }
.wa-incoming-call-box { background: var(--list-bg, #fff); border-radius: 16px; padding: 32px 24px; text-align: center; max-width: 320px; width: 100%; }
body.wa-dark .wa-incoming-call-box { background: #202c33; }
.wa-incoming-call-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--wa-teal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 16px; }
.wa-incoming-call-avatar-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; display: block; }
.wa-incoming-call-name { display: block; font-size: 20px; font-weight: 600; color: #111; margin-bottom: 4px; }
body.wa-dark .wa-incoming-call-name { color: #e9edef; }
.wa-incoming-call-type { display: block; font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.wa-incoming-call-btns { display: flex; gap: 16px; justify-content: center; }
.wa-incoming-call-btns .wa-call-btn { padding: 12px 24px; border-radius: 28px; border: none; font-size: 16px; font-weight: 500; cursor: pointer; }
.wa-incoming-call-btns .wa-call-btn-decline { background: var(--call-decline-bg); color: #fff; }
.wa-incoming-call-btns .wa-call-btn-answer { background: var(--call-accept-bg); color: #fff; }

/* Fullscreen incoming call (chats + call page) – reference UI */
.wa-incoming-call-fullscreen {
  background: #0d1418;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.wa-incoming-call-fullscreen .wa-incoming-call-box-full {
  background: transparent;
  max-width: 520px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(44px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
}
.wa-incoming-call-box-full .wa-incoming-call-avatar,
.wa-incoming-call-box-full .wa-incoming-call-avatar-img { width: 120px; height: 120px; margin-bottom: 24px; }
.wa-incoming-call-box-full .wa-incoming-call-name { color: #fff; font-size: 28px; margin-bottom: 8px; }
.wa-incoming-call-box-full .wa-incoming-call-type { color: rgba(255,255,255,.8); font-size: 16px; margin-bottom: 0; }
.wa-incoming-call-fullscreen .wa-incoming-call-btns-three { margin-top: auto; padding-bottom: 8px; }
.wa-incoming-call-btns-three { display: flex; align-items: flex-end; justify-content: center; gap: 32px; flex-wrap: wrap; }
.wa-call-btn-circle {
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  width: 72px; border: none; background: none; color: #fff; cursor: pointer;
  font-size: 12px; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.wa-call-btn-circle svg { width: 28px; height: 28px; }
.wa-call-btn-circle.wa-call-btn-decline { color: #fff; }
.wa-call-btn-circle.wa-call-btn-decline .wa-call-btn-circle-inner { background: var(--call-decline-bg); }
.wa-call-btn-circle.wa-call-btn-answer .wa-call-btn-circle-inner { background: var(--call-accept-bg); }
.wa-call-btn-circle.wa-call-btn-message { color: #fff; }
.wa-call-btn-circle.wa-call-btn-message .wa-call-btn-circle-inner { background: var(--call-message-bg); color: var(--call-message-icon); }
.wa-call-btn-circle-inner {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.wa-call-btn-circle-inner svg { width: 28px; height: 28px; }
.wa-call-btn-circle .wa-call-btn-label { max-width: 90px; text-align: center; line-height: 1.2; }
.wa-call-btn-circle.wa-call-btn-decline,
.wa-call-btn-circle.wa-call-btn-answer { background: transparent; }
.wa-call-btn-circle.wa-call-btn-decline .wa-call-btn-circle-inner,
.wa-call-btn-circle.wa-call-btn-answer .wa-call-btn-circle-inner { color: #fff; }
/* Incoming call bottom buttons (flat WhatsApp-style circles + clean labels) */
.wa-incoming-call-btns-three { gap: 30px; }
.wa-incoming-call-btns-three .wa-call-btn-circle,
.wa-incoming-call-btns-three .wa-call-btn-circle-inline {
  background: transparent !important;
  box-shadow: none !important;
}
/* chats.html overlay uses .wa-call-btn. Make it a 2-row grid: [circle] + [label] */
.wa-incoming-call-btns-three .wa-call-btn.wa-call-btn-circle,
.wa-incoming-call-btns-three a.wa-call-btn.wa-call-btn-circle {
  --wa-call-circle-bg: rgba(255,255,255,.2);
  --wa-call-icon: #fff;
  --wa-call-label: rgba(255,255,255,.9);
  position: relative;
  display: grid;
  grid-template-rows: 64px auto;
  justify-items: center;
  row-gap: 10px;
  width: 88px;
  padding: 0;
  border: none;
  color: var(--wa-call-label);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.wa-incoming-call-btns-three .wa-call-btn.wa-call-btn-circle::before,
.wa-incoming-call-btns-three a.wa-call-btn.wa-call-btn-circle::before {
  content: '';
  grid-row: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--wa-call-circle-bg);
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
}
.wa-incoming-call-btns-three .wa-call-btn.wa-call-btn-circle svg,
.wa-incoming-call-btns-three a.wa-call-btn.wa-call-btn-circle svg {
  grid-row: 1;
  width: 28px;
  height: 28px;
  color: var(--wa-call-icon);
  z-index: 1;
}
.wa-incoming-call-btns-three .wa-call-btn.wa-call-btn-circle .wa-call-btn-label,
.wa-incoming-call-btns-three a.wa-call-btn.wa-call-btn-circle .wa-call-btn-label {
  grid-row: 2;
  margin: 0;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}
.wa-incoming-call-btns-three .wa-call-btn.wa-call-btn-circle:active,
.wa-incoming-call-btns-three a.wa-call-btn.wa-call-btn-circle:active { transform: scale(0.98); }

.wa-incoming-call-btns-three .wa-call-btn-decline,
.wa-incoming-call-btns-three a.wa-call-btn-decline {
  --wa-call-circle-bg: #e53935;
  --wa-call-icon: #fff;
}
.wa-incoming-call-btns-three .wa-call-btn-answer,
.wa-incoming-call-btns-three a.wa-call-btn-answer {
  --wa-call-circle-bg: #25d366;
  --wa-call-icon: #fff;
}
.wa-incoming-call-btns-three .wa-call-btn-message,
.wa-incoming-call-btns-three a.wa-call-btn-message {
  --wa-call-circle-bg: rgba(255,255,255,.95);
  --wa-call-icon: #3b4a54;
}
.wa-incoming-call-btns-three .wa-call-btn-decline svg,
.wa-incoming-call-btns-three a.wa-call-btn-decline svg { transform: rotate(135deg); }

/* ========== Auth pages (login, register, verify, onboarding) ========== */
.page { min-height: 100vh; display: flex; flex-direction: column; width: 100%; min-width: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page .wa-header { flex-shrink: 0; }
.page .card { max-width: 360px; margin: 0 auto; width: 100%; }
.page .card h1 { color: inherit; font-weight: 500; }
.page .form-group label { color: var(--muted); font-weight: 400; }
.wa-container-top { padding-top: 0 !important; justify-content: flex-start !important; }

/* When not using fixed viewport: let container grow so document scrolls (e.g. settings) */
.page:not(.wa-page-scroll) .container.wa-container-top { flex: none; min-height: 0; }

/* Scrollable list pages: settings, chats-settings – container scrolls */
.page.wa-page-scroll { min-height: 0; height: 100vh; height: 100dvh; overflow-x: hidden; overflow-y: auto; }
.page.wa-page-scroll .container {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  justify-content: flex-start;
  padding-top: 0;
}
.page.wa-page-scroll .container.wa-container-top { padding-top: 0; }

/* Incoming call decline-reason quick replies */
.wa-decline-reason-sheet {
  position: fixed;
  inset: 0;
  z-index: 4000;
}
.wa-decline-reason-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,.45);
}
.wa-decline-reason-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--list-bg);
  border-top: 1px solid var(--border);
  padding: 14px 14px max(14px, env(safe-area-inset-bottom));
  box-shadow: 0 -12px 26px rgba(0,0,0,.28);
}
.wa-decline-reason-title {
  font-size: 14px;
  color: var(--muted);
  margin: 2px 4px 10px;
}
.wa-decline-reason-item,
.wa-decline-reason-cancel {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--recv-bubble-text);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 8px;
  font-size: 14px;
}
.wa-decline-reason-cancel {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 0;
}

/* ========== Profile photo page (WhatsApp-style) ========== */
.wa-dp-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px; }
.wa-dp-preview { width: 200px; height: 200px; border-radius: 50%; background: var(--input-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 32px 0 24px; border: 3px solid var(--border); }
.wa-dp-preview img { width: 100%; height: 100%; object-fit: cover; }
.wa-dp-preview .wa-dp-initial { font-size: 80px; font-weight: 300; color: var(--wa-teal); }
.wa-dp-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 280px; margin-top: 16px; }
.wa-dp-actions .btn { width: 100%; padding: 14px; border-radius: 24px; text-align: center; }
.wa-dp-actions .btn-outline { background: transparent; border: 2px solid var(--wa-teal); color: var(--wa-teal); }
.wa-dp-actions .btn-outline:hover { background: rgba(7,94,84,.08); }
body.wa-dark .wa-dp-preview { background: var(--input-bg); border-color: var(--border); }
body.wa-dark .wa-dp-preview .wa-dp-initial { color: var(--wa-teal); }


/* ===== Enhanced Editor UI Additions ===== */
.wa-status-preview{
  height:50vh;
  max-height:50vh;
  min-height:50vh;
  border-radius:18px;
  overflow:hidden;
  position:relative;
  box-shadow:0 12px 28px rgba(0,0,0,.25);
}

.wa-video-editor-export{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:180px;
  height:48px;
  min-width:210px;
  border-radius:40px;
  border:none;
  font-weight:700;
  font-size:15px;
  background:linear-gradient(135deg,#25d366,#18b358);
  color:#fff;
  box-shadow:0 12px 24px rgba(37,211,102,.35);
}

.wa-video-tool-tab .ico{
  width:34px;
  height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  box-shadow:0 4px 10px rgba(0,0,0,.08);
}

.wa-video-tool-tab.active .ico{
  background:#25d366;
  color:#fff;
  border:none;
}

/* ========== Theme consistency overrides (global) ========== */
body.wa-girls,
body.wa-bigfont,
body.wa-corporate,
body.wa-luxury,
body.wa-technical {
  color: var(--recv-bubble-text);
}

body.wa-girls .page,
body.wa-bigfont .page,
body.wa-corporate .page,
body.wa-luxury .page,
body.wa-technical .page,
body.wa-girls .card,
body.wa-bigfont .card,
body.wa-corporate .card,
body.wa-luxury .card,
body.wa-technical .card,
body.wa-girls .wa-settings-section,
body.wa-bigfont .wa-settings-section,
body.wa-corporate .wa-settings-section,
body.wa-luxury .wa-settings-section,
body.wa-technical .wa-settings-section,
body.wa-girls .wa-chat-wrap,
body.wa-bigfont .wa-chat-wrap,
body.wa-corporate .wa-chat-wrap,
body.wa-luxury .wa-chat-wrap,
body.wa-technical .wa-chat-wrap,
body.wa-girls .wa-status-wrap,
body.wa-bigfont .wa-status-wrap,
body.wa-corporate .wa-status-wrap,
body.wa-luxury .wa-status-wrap,
body.wa-technical .wa-status-wrap {
  background: var(--list-bg) !important;
  color: var(--recv-bubble-text) !important;
  border-color: var(--border) !important;
}

body.wa-girls .wa-input-bar,
body.wa-bigfont .wa-input-bar,
body.wa-corporate .wa-input-bar,
body.wa-luxury .wa-input-bar,
body.wa-technical .wa-input-bar,
body.wa-girls .wa-search-bar-inline,
body.wa-bigfont .wa-search-bar-inline,
body.wa-corporate .wa-search-bar-inline,
body.wa-luxury .wa-search-bar-inline,
body.wa-technical .wa-search-bar-inline,
body.wa-girls .wa-search-wrap,
body.wa-bigfont .wa-search-wrap,
body.wa-corporate .wa-search-wrap,
body.wa-luxury .wa-search-wrap,
body.wa-technical .wa-search-wrap {
  background: var(--list-bg) !important;
  border-color: var(--border) !important;
}

body.wa-girls .wa-input-bar input,
body.wa-bigfont .wa-input-bar input,
body.wa-corporate .wa-input-bar input,
body.wa-luxury .wa-input-bar input,
body.wa-technical .wa-input-bar input,
body.wa-girls .wa-search,
body.wa-bigfont .wa-search,
body.wa-corporate .wa-search,
body.wa-luxury .wa-search,
body.wa-technical .wa-search,
body.wa-girls .wa-search-inline,
body.wa-bigfont .wa-search-inline,
body.wa-corporate .wa-search-inline,
body.wa-luxury .wa-search-inline,
body.wa-technical .wa-search-inline,
body.wa-girls input,
body.wa-bigfont input,
body.wa-corporate input,
body.wa-luxury input,
body.wa-technical input,
body.wa-girls textarea,
body.wa-bigfont textarea,
body.wa-corporate textarea,
body.wa-luxury textarea,
body.wa-technical textarea,
body.wa-girls select,
body.wa-bigfont select,
body.wa-corporate select,
body.wa-luxury select,
body.wa-technical select {
  background: var(--input-bg) !important;
  color: var(--recv-bubble-text) !important;
  border-color: var(--border) !important;
}

body.wa-girls .btn,
body.wa-bigfont .btn,
body.wa-corporate .btn,
body.wa-luxury .btn,
body.wa-technical .btn,
body.wa-girls .wa-storage-btn,
body.wa-bigfont .wa-storage-btn,
body.wa-corporate .wa-storage-btn,
body.wa-luxury .wa-storage-btn,
body.wa-technical .wa-storage-btn,
body.wa-girls .wa-vpn-status-btn,
body.wa-bigfont .wa-vpn-status-btn,
body.wa-corporate .wa-vpn-status-btn,
body.wa-luxury .wa-vpn-status-btn,
body.wa-technical .wa-vpn-status-btn,
body.wa-girls .wa-create-bc-done,
body.wa-bigfont .wa-create-bc-done,
body.wa-corporate .wa-create-bc-done,
body.wa-luxury .wa-create-bc-done,
body.wa-technical .wa-create-bc-done {
  background: var(--wa-teal) !important;
  color: #fff !important;
  border-color: transparent !important;
}

body.wa-girls .btn-secondary,
body.wa-bigfont .btn-secondary,
body.wa-corporate .btn-secondary,
body.wa-luxury .btn-secondary,
body.wa-technical .btn-secondary,
body.wa-girls .wa-storage-btn.secondary,
body.wa-bigfont .wa-storage-btn.secondary,
body.wa-corporate .wa-storage-btn.secondary,
body.wa-luxury .wa-storage-btn.secondary,
body.wa-technical .wa-storage-btn.secondary {
  background: var(--input-bg) !important;
  color: var(--recv-bubble-text) !important;
  border: 1px solid var(--border) !important;
}

body.wa-girls .wa-chat-item:hover,
body.wa-bigfont .wa-chat-item:hover,
body.wa-corporate .wa-chat-item:hover,
body.wa-luxury .wa-chat-item:hover,
body.wa-technical .wa-chat-item:hover,
body.wa-girls .wa-status-item:hover,
body.wa-bigfont .wa-status-item:hover,
body.wa-corporate .wa-status-item:hover,
body.wa-luxury .wa-status-item:hover,
body.wa-technical .wa-status-item:hover,
body.wa-girls .wa-new-chat-scan-row:hover,
body.wa-bigfont .wa-new-chat-scan-row:hover,
body.wa-corporate .wa-new-chat-scan-row:hover,
body.wa-luxury .wa-new-chat-scan-row:hover,
body.wa-technical .wa-new-chat-scan-row:hover,
body.wa-girls .wa-vpn-server:hover,
body.wa-bigfont .wa-vpn-server:hover,
body.wa-corporate .wa-vpn-server:hover,
body.wa-luxury .wa-vpn-server:hover,
body.wa-technical .wa-vpn-server:hover {
  background: color-mix(in srgb, var(--input-bg) 80%, var(--wa-teal) 20%) !important;
}

body.wa-girls.wa-call-page,
body.wa-bigfont.wa-call-page,
body.wa-corporate.wa-call-page,
body.wa-luxury.wa-call-page,
body.wa-technical.wa-call-page,
body.wa-dark.wa-call-page {
  --call-btn-surface: color-mix(in srgb, var(--input-bg) 72%, rgba(255,255,255,.28) 28%);
  --call-btn-border: color-mix(in srgb, var(--border) 68%, rgba(255,255,255,.24) 32%);
  --call-btn-icon: var(--recv-bubble-text);
  --call-btn-active-bg: var(--wa-teal);
  --call-btn-active-icon: #fff;
  --call-accept-bg: var(--wa-teal);
  --call-message-bg: var(--input-bg);
  --call-message-icon: var(--recv-bubble-text);
}

/* Technical theme: call screens, call log, call buttons */
body.wa-technical.wa-call-page,
body.wa-technical .wa-incoming-call-fullscreen,
body.wa-technical .wa-call-minimized-bar {
  background: var(--chat-bg) !important;
  color: var(--recv-bubble-text) !important;
  border-color: var(--border) !important;
}

body.wa-technical .wa-call-status,
body.wa-technical .wa-call-subtext,
body.wa-technical .wa-call-encrypted,
body.wa-technical .wa-call-encrypted-top,
body.wa-technical .wa-call-minimized-name,
body.wa-technical .wa-call-minimized-type,
body.wa-technical .wa-calls-recent-header,
body.wa-technical .wa-call-link-desc,
body.wa-technical .wa-call-item .wa-call-meta {
  color: var(--muted) !important;
}

body.wa-technical .wa-call-back,
body.wa-technical .wa-call-name,
body.wa-technical .wa-call-link-title,
body.wa-technical .wa-call-item .wa-call-name,
body.wa-technical .wa-calls-wrap,
body.wa-technical .wa-calls-list {
  color: var(--recv-bubble-text) !important;
}

body.wa-technical .wa-call-avatar {
  background: var(--input-bg) !important;
}

body.wa-technical .wa-call-actions-incall .wa-call-btn,
body.wa-technical .wa-call-minimized-expand {
  background: color-mix(in srgb, var(--input-bg) 82%, transparent) !important;
  border-color: var(--border) !important;
  color: var(--recv-bubble-text) !important;
}

body.wa-technical .wa-call-actions-incall .wa-call-btn.is-active {
  background: var(--wa-teal) !important;
  border-color: var(--wa-teal) !important;
  color: #fff !important;
}

body.wa-technical .wa-call-actions-incall .wa-call-btn-hangup,
body.wa-technical .wa-call-minimized-end,
body.wa-technical .wa-call-btn-circle-inline.wa-call-btn-decline .wa-call-btn-circle-icon,
body.wa-technical .wa-call-btn-circle.wa-call-btn-decline .wa-call-btn-circle-inner,
body.wa-technical .wa-incoming-call-btns .wa-call-btn-decline {
  background: #e53935 !important;
  border-color: #e53935 !important;
  color: #fff !important;
}

body.wa-technical .wa-call-btn-circle-inline.wa-call-btn-answer .wa-call-btn-circle-icon,
body.wa-technical .wa-call-btn-circle.wa-call-btn-answer .wa-call-btn-circle-inner,
body.wa-technical .wa-incoming-call-btns .wa-call-btn-answer {
  background: var(--wa-teal) !important;
  color: #fff !important;
}

body.wa-technical .wa-call-btn-circle-inline.wa-call-btn-message,
body.wa-technical .wa-call-btn-circle.wa-call-btn-message {
  color: var(--recv-bubble-text) !important;
}

body.wa-technical .wa-call-btn-circle-inline.wa-call-btn-message .wa-call-btn-circle-icon,
body.wa-technical .wa-call-btn-circle.wa-call-btn-message .wa-call-btn-circle-inner {
  background: var(--input-bg) !important;
  color: var(--recv-bubble-text) !important;
}
