:root {
  --neon-cyan: #00f5ff;
  --neon-pink: #ff00ea;
  --neon-green: #39ff14;
  --neon-purple: #bc13fe;
  --neon-blue: #4d9fff;
  --bg-deep: #050510;
  --bg-card: rgba(12, 18, 40, 0.72);
  --bg-card-hover: rgba(18, 28, 58, 0.88);
  --border-neon: rgba(0, 245, 255, 0.28);
  --text: #eef6ff;
  --muted: #8ba3c7;
  --danger: #ff3864;
  --success: #39ff14;
  --shadow-neon: 0 0 20px rgba(0, 245, 255, 0.15), 0 0 40px rgba(255, 0, 234, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --topbar-h: 56px;
  --bottom-nav-h: 62px;
  --sidebar-w: 260px;
  --kb-offset: 0px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 245, 255, 0.12), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(255, 0, 234, 0.12), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(57, 255, 20, 0.08), transparent 35%),
    linear-gradient(160deg, #050510 0%, #0a1030 45%, #12082a 100%);
  background-attachment: fixed;
}

a { color: var(--neon-cyan); text-decoration: none; transition: .2s; }
a:hover { color: #fff; text-shadow: 0 0 8px var(--neon-cyan); }

.neon-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 18px 16px;
  background: rgba(8, 12, 28, 0.85);
  border-right: 1px solid var(--border-neon);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-neon);
}

.sidebar-brand {
  flex-shrink: 0;
}

.main-column {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.desktop-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 24px;
  border-bottom: 1px solid var(--border-neon);
  background: rgba(8, 12, 28, 0.92);
  backdrop-filter: blur(14px);
}

.desktop-topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
}

.desktop-topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: .88rem;
}

.desktop-topbar-meta .user-name {
  color: var(--neon-cyan);
  font-weight: 600;
}

.desktop-topbar-meta a {
  font-size: .85rem;
}

.chat-topbar-actions .logout-btn--chat:hover {
  border-color: rgba(255, 90, 110, 0.55);
  color: #ffb3c1;
  background: rgba(255, 56, 100, 0.18);
}

.chat-topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.chat-topbar-instance {
  flex: 1;
  min-width: 0;
}

.chat-topbar-instance select {
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 245, 255, 0.22);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .88rem;
  cursor: pointer;
}

.chat-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-topbar-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: none;
}

.chat-topbar-btn:hover {
  border-color: rgba(0, 245, 255, 0.35);
  color: var(--neon-cyan);
}

.desktop-topbar--chat .desktop-topbar-chat {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.desktop-topbar--chat .desktop-topbar-title {
  flex-shrink: 0;
  min-width: 72px;
}

.desktop-topbar--chat .chat-topbar-tools {
  max-width: 560px;
}

.content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.content-alerts {
  flex-shrink: 0;
  padding: 12px 24px 0;
}

.content-alerts:empty {
  display: none;
  padding: 0;
}

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

.page-bar {
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 12, 28, 0.45);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
}

.page-bar .page-head {
  margin: 0;
  min-width: min(100%, 720px);
}

.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 245, 255, 0.22) transparent;
}

.page-viewport--solo {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 28px;
  scrollbar-width: thin;
}

.page-viewport--solo > .page-head {
  margin-bottom: 20px;
}

.page-viewport--wa {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.page-viewport--wa > .chat-page {
  flex: 1;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: #001018;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.45);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-logo--lg {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.brand strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand span { color: var(--muted); font-size: .82rem; }

.sidebar-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 16px -4px 12px;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 245, 255, 0.25) transparent;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: .2s;
  font-size: .92rem;
  line-height: 1.3;
}

.sidebar nav a span:first-child {
  width: 1.35rem;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(0, 245, 255, 0.08);
  border-color: rgba(0, 245, 255, 0.28);
  box-shadow: inset 0 0 16px rgba(0, 245, 255, 0.06);
}

.sidebar nav a.active {
  color: var(--neon-cyan);
  font-weight: 600;
}

.sidebar-foot {
  flex-shrink: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.mobile-drawer-foot {
  flex-shrink: 0;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 90, 110, 0.45);
  background: rgba(255, 56, 100, 0.16);
  color: #ffb3c1 !important;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.logout-btn:hover {
  background: rgba(255, 56, 100, 0.28);
  border-color: rgba(255, 90, 110, 0.65);
  color: #ffd6de !important;
  transform: none;
  text-shadow: none;
}

.logout-btn-label {
  display: inline-block;
}

.logout-btn--sidebar,
.logout-btn--drawer {
  width: 100%;
  margin: 0;
}

.logout-btn--chat {
  width: auto;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  flex-shrink: 0;
}

.logout-btn--inline {
  flex-shrink: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  font-size: .78rem;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-list-action-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--wa-search);
  color: var(--wa-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  box-shadow: none;
  padding: 0;
}

.chat-list-action-btn:hover {
  color: var(--wa-text);
  background: var(--wa-list-hover);
}


.page-head {
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 4vw, 2rem);
  text-shadow: 0 0 16px rgba(0, 245, 255, 0.25);
}

.page-head p, .muted { color: var(--muted); margin: 0; }

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.card {
  flex: 1 1 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-neon);
  transition: transform .2s, box-shadow .2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.22);
}

.card .label, .card small { color: var(--muted); display: block; font-size: .85rem; }
.card strong {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 8px 0;
  color: var(--neon-green);
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-neon);
}

.panel h2, .panel h3 {
  margin-top: 0;
  color: var(--neon-cyan);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  color: var(--neon-cyan);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}

table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: middle;
}

th {
  color: var(--neon-cyan);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  background: rgba(0, 245, 255, 0.04);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background .15s;
}

.data-table tbody tr:hover {
  background: rgba(0, 245, 255, 0.04);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td.actions,
td.actions {
  white-space: nowrap;
  text-align: right;
}

.data-table .cell-strong {
  font-weight: 600;
  color: var(--text);
}

.data-table .cell-muted {
  color: var(--muted);
  font-size: .88rem;
}

.data-table .cell-mono code {
  font-size: .78rem;
}

code {
  background: rgba(0,0,0,.35);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--neon-pink);
  font-size: .85rem;
}

.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(0,245,255,.9), rgba(77,159,255,.9));
  color: #001018;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.25);
}

.btn:hover, button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.45);
}

.btn.secondary {
  background: rgba(255,255,255,.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: none;
}

.btn.danger {
  background: linear-gradient(135deg, #ff3864, #ff006e);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 56, 100, 0.35);
}

.btn.outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  box-shadow: none;
}

.btn-sm { padding: 8px 12px; font-size: .85rem; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert.ok {
  background: rgba(57, 255, 20, 0.1);
  border-color: rgba(57, 255, 20, 0.35);
  color: #b8ffb0;
}

.alert.err {
  background: rgba(255, 56, 100, 0.12);
  border-color: rgba(255, 56, 100, 0.35);
  color: #ffb3c7;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}

.badge.open {
  color: #052010;
  background: rgba(57, 255, 20, 0.85);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
}

.badge.qr, .badge.connecting, .badge.reconnecting {
  color: #3a2d00;
  background: rgba(255, 214, 0, 0.85);
}

.badge.offline, .badge.logged_out {
  color: #fff;
  background: rgba(255, 56, 100, 0.75);
}

.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.form-grid > div { flex: 1 1 200px; }

.form-grid label, .login-card label, .field label {
  display: block;
  margin-bottom: 8px;
  font-size: .88rem;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 245, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  outline: none;
  transition: .2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.15);
}

input::placeholder { color: #6d84a8; }

.account-card {
  border: 1px solid var(--border-neon);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  background: rgba(0,0,0,.2);
}

.account-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.account-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.account-mobile-actions .btn {
  flex: 1 1 calc(50% - 4px);
}

.account-qr-modal {
  padding: 0;
  overflow: hidden;
}

.account-qr-body {
  padding: 16px 20px 20px;
  text-align: center;
}

.account-qr-name {
  margin: 0 0 12px;
  font-weight: 600;
}

.account-qr-frame {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.account-qr-image {
  width: min(280px, 100%);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.account-qr-image.hidden {
  display: none;
}

.account-qr-placeholder {
  color: var(--muted);
  font-size: .92rem;
}

.account-row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-row-actions .btn {
  white-space: nowrap;
}

.qr-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
}

.qr-box.hidden { display: none; }

.qr-image {
  width: min(280px, 100%);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.25);
}

/* Login */
html.login-html,
html.login-html body {
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

.login-card {
  width: min(440px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 22px;
  padding: 32px 28px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-neon);
  position: relative;
  z-index: 2;
}

.login-brand {
  justify-content: center;
  margin-bottom: 22px;
}

.login-card .subtitle { color: var(--muted); margin-bottom: 24px; }

.login-card form { display: flex; flex-direction: column; gap: 14px; }

.login-card button[type="submit"],
.login-submit-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  font-size: 1rem;
}

.login-submit-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.login-submit-row .login-submit-btn,
.login-submit-row button[type="submit"] {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.login-submit-row .login-biometric-btn {
  width: 50px;
  min-width: 50px;
  min-height: 50px;
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 245, 255, 0.55);
  background: rgba(0, 245, 255, 0.14) !important;
  color: var(--neon-cyan) !important;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.18);
}

.login-submit-row .login-biometric-btn:hover {
  background: rgba(0, 245, 255, 0.24) !important;
  transform: none;
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.28);
}

.login-biometric-btn.hidden {
  display: none !important;
}

.login-biometric-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.biometric-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.biometric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-neon);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.panel-note {
  margin: 0 0 4px;
  padding: 0 2px;
}

.hint {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 18px;
  text-align: center;
}

.hint code {
  color: var(--neon-green);
  background: rgba(57,255,20,.08);
}

/* Chat & Status — WhatsApp Web style */
body.page-wa {
  overflow: hidden;
  height: 100%;
}

body.page-wa .app-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.page-wa .main-column {
  height: 100%;
}

.content-wa {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.content-wa > .content-alerts {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 12px 0;
}

.content-wa .page-viewport--wa {
  flex: 1;
  min-height: 0;
}

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

.chat-page > .chat-shell {
  flex: 1;
  min-height: 0;
}

.chat-shell.wa-web {
  --wa-bg: #111b21;
  --wa-panel: #111b21;
  --wa-header: #202c33;
  --wa-border: #222d34;
  --wa-chat-bg: #0b141a;
  --wa-list-hover: #202c33;
  --wa-list-active: #2a3942;
  --wa-text: #e9edef;
  --wa-muted: #8696a0;
  --wa-green: #00a884;
  --wa-green-dark: #005c4b;
  --wa-bubble-in: #202c33;
  --wa-search: #202c33;
  --wa-compose: #202c33;
  --wa-input: #2a3942;
  --wa-ack: #8696a0;
  --wa-ack-read: #53bdeb;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  background: var(--wa-panel);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--wa-text);
}

.wa-tab-bar {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--wa-header);
  border-bottom: 1px solid var(--wa-border);
}

.wa-tab-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: #2a3942;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.wa-tab-pills::-webkit-scrollbar {
  display: none;
}

.wa-tab-pill {
  border: 0;
  background: transparent;
  color: var(--wa-muted);
  font-size: 12px;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.wa-tab-pill:hover {
  color: var(--wa-text);
}

.wa-tab-pill.active {
  background: var(--wa-green);
  color: #111b21;
  font-weight: 500;
}

.wa-tab-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  overflow: hidden;
}

.chat-list,
.chat-list-panel {
  width: 30%;
  min-width: 280px;
  max-width: 440px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--wa-border);
  background: var(--wa-panel);
}

.wa-panel-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--wa-text);
}

.calls-list-items {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 12px;
}

.calls-list-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 0.88rem;
}

.chat-list-panel.hidden,
.chat-main.hidden { display: none !important; }

.chat-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--wa-chat-bg);
  position: relative;
}

.chat-side {
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid var(--wa-border);
  padding: 16px;
  background: var(--wa-header);
  overflow: auto;
  color: var(--wa-text);
}

.chat-list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--wa-header);
  border-bottom: 1px solid var(--wa-border);
  flex-shrink: 0;
}

.wa-instance-pick {
  flex: 1;
  min-width: 0;
}

.wa-instance-pick select {
  width: 100%;
  background: var(--wa-input);
  border: 0;
  color: var(--wa-text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.chat-list-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.chat-search-wrap {
  padding: 8px 12px;
  background: var(--wa-header);
  border-bottom: 1px solid var(--wa-border);
  flex-shrink: 0;
}

.chat-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-search-row .chat-search {
  flex: 1;
  min-width: 0;
}

.chat-list-refresh-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--wa-search);
  color: var(--wa-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.15s, background 0.15s, transform 0.2s;
}

.chat-list-refresh-btn:hover {
  color: var(--wa-text);
  background: var(--wa-list-hover);
}

.chat-list-refresh-btn.is-loading {
  pointer-events: none;
  color: var(--wa-green);
}

.chat-list-refresh-btn.is-loading .chat-list-refresh-icon {
  animation: chat-spin 0.7s linear infinite;
}

.chat-list-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.chat-pull-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--wa-muted);
  font-size: 12px;
  transition: height 0.2s ease, opacity 0.15s ease;
}

.chat-pull-indicator.is-loading .chat-pull-spinner {
  animation: chat-spin 0.7s linear infinite;
}

.chat-pull-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(134, 150, 160, 0.35);
  border-top-color: var(--wa-green);
  border-radius: 50%;
}

.chat-pull-label {
  padding-bottom: 4px;
  white-space: nowrap;
}

.chat-list-panel.is-refreshing .chat-items {
  transition: transform 0.2s ease;
}

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

.chat-search {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px 8px 32px;
  background: var(--wa-search) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238696a0' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 10px center no-repeat;
  color: var(--wa-text);
  font-size: 14px;
}

.chat-search::placeholder { color: var(--wa-muted); }

.chat-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--wa-border);
  cursor: pointer;
  transition: background .15s;
}

.chat-item:hover { background: var(--wa-list-hover); }
.chat-item.active { background: var(--wa-list-active); }
.chat-item-empty { cursor: default; color: var(--wa-muted); }

.chat-avatar {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  background: #6a7175;
  text-transform: uppercase;
  overflow: hidden;
  position: relative;
}

.chat-avatar-photo .chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-avatar-photo .chat-avatar-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.chat-avatar-photo.is-fallback .chat-avatar-img {
  display: none;
}

.chat-avatar-photo.is-fallback .chat-avatar-fallback {
  display: flex;
}

.chat-main-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--wa-border);
  background: var(--wa-panel);
  min-height: 60px;
  flex-shrink: 0;
}

.chat-header-profile {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}

.chat-header-profile:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-header-profile:focus-visible {
  outline: 2px solid rgba(37, 211, 102, 0.55);
  outline-offset: 2px;
}

.chat-main-head .chat-avatar {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.chat-avatar.av-a { background: #00a884; }
.chat-avatar.av-b { background: #53bdeb; }
.chat-avatar.av-c { background: #ff6b6b; }
.chat-avatar.av-d { background: #bc8cff; }
.chat-avatar.av-e { background: #ffb347; }
.chat-avatar.av-f { background: #25d366; }
.chat-avatar.av-g { background: #128c7e; }
.chat-avatar.av-h { background: #7f66ff; }

.chat-item-body {
  flex: 1;
  min-width: 0;
}

.chat-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-item-row-top { margin-bottom: 3px; }

.chat-item-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  color: var(--wa-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--wa-muted);
}

.chat-item-preview {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--wa-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--wa-green);
  color: #111b21;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.chat-empty {
  flex: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 168, 132, 0.06), transparent 40%),
    var(--wa-chat-bg);
  border-bottom: 6px solid var(--wa-green);
}

.chat-empty.hidden { display: none; }

.chat-empty-inner {
  text-align: center;
  max-width: 460px;
  padding: 24px;
  color: var(--wa-muted);
}

.chat-empty-logo {
  font-size: 72px;
  margin-bottom: 20px;
  opacity: .85;
}

.chat-empty-inner h2 {
  margin: 0 0 12px;
  color: var(--wa-text);
  font-weight: 300;
  font-size: 2rem;
}

.chat-empty-inner p { margin: 0 0 10px; line-height: 1.5; }
.chat-empty-note { font-size: 13px; opacity: .8; }

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

.chat-active.hidden { display: none; }

.chat-main-head {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--wa-header);
  border-bottom: 1px solid var(--wa-border);
  min-height: 59px;
  flex-shrink: 0;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-info strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-sub {
  font-size: 13px;
  color: var(--wa-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-about {
  display: block;
  color: var(--wa-muted);
}

.chat-header-about.chat-header-online {
  color: #25d366;
  font-weight: 500;
}

.chat-header-phone {
  display: block;
  font-size: 12px;
  opacity: .85;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 5% 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M0 0h30v30H0zm30 30h30v30H30z'/%3E%3C/g%3E%3C/svg%3E"),
    var(--wa-chat-bg);
}

.msg {
  max-width: min(65%, 520px);
  padding: 5px 7px 6px 9px;
  border-radius: 7.5px;
  background: var(--wa-bubble-in);
  align-self: flex-start;
  word-break: break-word;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  position: relative;
  font-size: 14.2px;
  line-height: 19px;
}

.msg.me {
  align-self: flex-end;
  background: var(--wa-green-dark);
  border: 0;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.msg-body {
  display: block;
  min-width: 0;
}

.msg-quote {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 6px;
  padding: 0;
  border-radius: 7px;
  border-left: 0;
  background: rgba(11, 20, 26, 0.28);
  max-width: 100%;
  cursor: default;
  overflow: hidden;
  min-height: 44px;
}

.msg.me .msg-quote {
  background: rgba(0, 0, 0, 0.22);
  border-left-color: transparent;
}

.msg-quote-bar {
  width: 4px;
  flex-shrink: 0;
  background: #53bdeb;
  border-radius: 7px 0 0 7px;
}

.msg.me .msg-quote-bar {
  background: #06cf9c;
}

.msg-quote-status .msg-quote-bar {
  background: #ffb84d;
}

.msg.me .msg-quote-status .msg-quote-bar {
  background: #ffd28a;
}

.msg-quote-status {
  border-left-color: transparent;
}

.msg.me .msg-quote-status {
  border-left-color: transparent;
}

.msg-quote-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  padding: 6px 8px;
}

.msg-quote-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #53bdeb;
  line-height: 1.25;
}

.msg.me .msg-quote-label {
  color: #06cf9c;
}

.msg-quote-status .msg-quote-label {
  color: #ffb84d;
}

.msg.me .msg-quote-status .msg-quote-label {
  color: #ffd28a;
}

.msg-quote-text {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(233, 237, 239, 0.88);
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.msg-quote-thumb {
  position: relative;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  align-self: stretch;
}

.msg-quote-thumb img,
.msg-quote-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-quote-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.compose-reply-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 3px solid #25d366;
  background: rgba(0, 0, 0, 0.22);
}

.compose-reply-preview.hidden {
  display: none;
}

.compose-reply-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compose-reply-body strong {
  font-size: 12px;
  color: #25d366;
}

.compose-reply-text {
  font-size: 12.5px;
  color: rgba(233, 237, 239, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compose-reply-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.compose-reply-thumb.hidden {
  display: none;
}

.compose-reply-thumb .msg-quote-thumb {
  width: 44px;
  height: 44px;
}

.compose-reply-close {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #e9edef;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
}

.compose-reply-close:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: none;
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: right;
  margin: 4px 0 -4px 6px;
  position: relative;
  top: 2px;
  white-space: nowrap;
  line-height: 15px;
  vertical-align: bottom;
}

.msg time {
  display: inline;
  font-size: 11px;
  color: var(--wa-ack);
  line-height: 15px;
}

.msg.me time { color: rgba(255, 255, 255, 0.65); }

.msg-ack {
  font-size: 14px;
  line-height: 1;
  letter-spacing: -4px;
  color: var(--wa-ack);
  user-select: none;
}

.msg-ack.read { color: var(--wa-ack-read); }
.msg-ack.pending { letter-spacing: 0; font-size: 11px; }
.msg-ack.error { letter-spacing: 0; color: #ea0038; }

.msg.has-media {
  padding: 3px;
  display: inline-block;
  vertical-align: top;
  flex-shrink: 0;
  max-width: 336px;
}

.msg.has-media.has-caption {
  padding: 3px 3px 5px;
}

.msg-media-wrap {
  display: block;
  border-radius: 4px;
  overflow: hidden;
}

.msg.has-media img.msg-media,
.msg.has-media .msg-media-wrap video {
  display: block;
  max-width: 330px;
  width: 100%;
  height: auto;
  min-height: 140px;
  margin: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
  object-fit: contain;
}

.msg.has-media.no-caption {
  position: relative;
}

.msg.has-media.no-caption > .msg-meta {
  position: absolute;
  right: 8px;
  bottom: 8px;
  float: none;
  top: auto;
  margin: 0;
  padding: 2px 6px 3px;
  border-radius: 8px;
  background: rgba(11, 20, 26, 0.55);
  z-index: 1;
}

.msg.has-media.no-caption .msg-meta time {
  color: rgba(255, 255, 255, 0.9);
}

.msg.has-media.no-caption .msg-ack {
  color: rgba(255, 255, 255, 0.85);
}

.msg.has-media.no-caption .msg-ack.read {
  color: #53bdeb;
}

.msg.has-media.has-caption .msg-body {
  padding: 4px 4px 2px;
}

.msg.has-media.media-audio {
  padding: 6px 8px 6px 9px;
  min-width: 240px;
  display: block;
}

.msg.has-media.media-audio .msg-body {
  text-align: right;
}

.msg-caption {
  padding: 4px 2px 0;
  font-size: 14.2px;
  line-height: 19px;
}

.msg-media {
  display: block;
  max-width: 330px;
  width: 100%;
  height: auto;
  min-height: 140px;
  border-radius: 4px;
  margin: 0;
  background: rgba(0, 0, 0, 0.22);
  object-fit: contain;
}

.msg.sticker {
  max-width: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
}

.msg.sticker.me {
  background: transparent;
  box-shadow: none;
}

.msg-sticker-wrap {
  position: relative;
  line-height: 0;
}

.msg.sticker .msg-sticker {
  display: block;
  width: 168px;
  max-width: 168px;
  height: auto;
  margin: 0;
  border-radius: 0;
}

.msg.sticker .msg-meta {
  position: absolute;
  right: 4px;
  bottom: 4px;
  float: none;
  top: auto;
  margin: 0;
  padding: 2px 6px 3px;
  border-radius: 8px;
  background: rgba(11, 20, 26, 0.55);
}

.msg.sticker .msg-meta time {
  color: rgba(255, 255, 255, 0.9);
}

.msg.sticker .msg-ack {
  color: rgba(255, 255, 255, 0.85);
}

.msg.sticker .msg-ack.read {
  color: #53bdeb;
}

.msg-audio {
  width: 100%;
  min-width: 220px;
  margin: 0;
}

.chat-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px 12px;
  background: var(--wa-compose);
  border-top: 1px solid var(--wa-border);
  flex-shrink: 0;
}

.compose-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.wa-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--wa-muted);
  cursor: pointer;
}

.wa-check input {
  width: auto;
  accent-color: var(--wa-green);
}

.compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.compose-input-wrap {
  flex: 1;
  background: var(--wa-input);
  border-radius: 8px;
  padding: 4px 12px;
}

.compose-input-wrap input,
.compose-row input[type="text"] {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--wa-text);
  padding: 9px 0;
  font-size: 15px;
}

.compose-input-wrap input::placeholder { color: var(--wa-muted); }

.wa-icon-btn {
  background: transparent;
  border: 0;
  color: var(--wa-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  line-height: 1;
  flex-shrink: 0;
}

.wa-icon-btn:hover {
  background: rgba(134, 150, 160, 0.15);
  color: var(--wa-text);
}

.wa-send-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--wa-green);
  color: #111b21;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.wa-send-btn:hover { filter: brightness(1.08); }
.wa-send-btn.wide { width: 100%; border-radius: 8px; height: auto; padding: 12px; }

.schedule-field input {
  width: 100%;
  background: var(--wa-input);
  border: 0;
  color: var(--wa-text);
  border-radius: 8px;
  padding: 8px 10px;
}

.schedule-field.hidden { display: none; }

.scheduled-panel {
  padding: 10px 16px;
  background: rgba(255, 214, 0, 0.08);
  border-top: 1px solid rgba(255, 214, 0, 0.2);
  font-size: 13px;
  color: var(--wa-text);
}

.scheduled-panel.hidden { display: none; }

.scheduled-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--wa-border);
}

.scheduled-item:last-child { border-bottom: 0; }

.msg-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  background: rgba(255, 214, 0, 0.15);
  color: #ffd279;
}

.compose-schedule { opacity: 0.85; }

.wa-modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 26, 0.85);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 16px;
}

.wa-modal.hidden { display: none; }

.wa-modal-box {
  width: min(100%, 380px);
  background: var(--wa-header, #202c33);
  border-radius: 12px;
  padding: 20px;
  color: var(--wa-text, #e9edef);
}

.wa-modal-box h3 { margin: 0 0 14px; font-weight: 500; }

.wa-modal-box input {
  width: 100%;
  margin-bottom: 10px;
  background: var(--wa-input, #2a3942);
  border: 0;
  color: var(--wa-text, #e9edef);
  border-radius: 8px;
  padding: 10px 12px;
}

.wa-modal-close {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--wa-muted, #8696a0);
  cursor: pointer;
  padding: 8px;
}

.btn-back-chat { display: none; }

.chat-side .field label { color: var(--wa-muted); font-size: 13px; }
.chat-side .field input {
  background: var(--wa-input);
  border: 0;
  color: var(--wa-text);
  border-radius: 8px;
}

.chat-side h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 500;
}

/* legacy chat head (no instance page) */
.chat-head .instance-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: min(100%, 280px);
}

.icon-btn {
  background: transparent;
  color: var(--neon-cyan);
  border: 0;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: none;
  padding: 4px 8px;
}

.icon-btn:hover { text-shadow: 0 0 10px var(--neon-cyan); transform: none; }

.small { font-size: .82rem; }

.mobile-topbar,
.bottom-nav,
.mobile-drawer,
.mobile-drawer-backdrop { display: none; }

/* Mobile cards for table */
.mobile-cards { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .app-shell {
    margin-top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    height: calc(100svh - var(--nav-h));
  }

  .desktop-topbar { display: none; }

  .content-alerts {
    padding: 8px 12px 0;
  }

  .page-bar {
    padding: 10px 12px;
  }

  .page-bar .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-bar .page-head h1 {
    display: none;
  }

  .page-bar .page-head > div:only-child:has(h1:only-child) {
    display: none;
  }

  .page-bar .page-head:has(> div:only-child) {
    gap: 0;
  }

  .page-bar .page-head .btn,
  .page-bar .page-head .instance-switch {
    width: 100%;
  }

  .page-bar .instance-switch select {
    width: 100%;
    min-width: 0;
  }

  .page-scroll,
  .page-viewport--solo {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .cards {
    gap: 10px;
  }

  .card {
    flex: 1 1 100%;
    padding: 16px;
  }

  .panel {
    padding: 14px;
    margin-bottom: 12px;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .panel-head .btn,
  .panel-head .row-actions {
    width: 100%;
  }

  .panel-head .row-actions .btn {
    flex: 1;
  }

  .account-actions .btn,
  .account-actions form {
    flex: 1 1 calc(50% - 4px);
  }

  .account-actions .btn,
  .account-actions form .btn {
    width: 100%;
  }

  body.page-wa .status-list-scroll .status-section-label:first-child {
    padding-top: 8px;
  }

  .mobile-topbar--chat {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    padding-right: 10px;
  }

  .mobile-topbar--chat .chat-topbar-tools {
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .mobile-topbar--chat .chat-topbar-tools::-webkit-scrollbar {
    display: none;
  }

  .mobile-topbar--chat .chat-topbar-instance {
    flex: 0 0 auto;
    min-width: 128px;
    max-width: 52vw;
  }

  .mobile-topbar--chat .chat-topbar-actions {
    flex-shrink: 0;
  }

  .mobile-topbar--chat .chat-topbar-instance select {
    padding: 6px 8px;
    font-size: .75rem;
    border-radius: 8px;
    max-width: 100%;
  }

  .mobile-topbar--chat .chat-topbar-btn,
  .mobile-topbar--chat .logout-btn--chat {
    width: auto;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    font-size: .72rem;
    border-radius: 8px;
  }

  .mobile-topbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    padding: 0 10px;
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 120;
    background: rgba(8, 12, 28, 0.96);
    border-bottom: 1px solid var(--border-neon);
    backdrop-filter: blur(14px);
  }

  .mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
    padding: 0;
    box-shadow: none;
  }

  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
    transition: transform .2s, opacity .2s;
  }

  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
  }

  .mobile-menu-icon::before { top: -6px; }
  .mobile-menu-icon::after { top: 6px; }

  body.mobile-menu-open .mobile-menu-icon {
    background: transparent;
  }

  body.mobile-menu-open .mobile-menu-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  body.mobile-menu-open .mobile-menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .mobile-topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-topbar-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .mobile-topbar-title {
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
  }

  .mobile-topbar-spacer {
    width: 40px;
  }

  .mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }

  .mobile-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-drawer-backdrop[hidden] {
    display: block;
    visibility: hidden;
  }

  .mobile-drawer-backdrop.is-open[hidden] {
    visibility: visible;
  }

  .mobile-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(88vw, 300px);
    z-index: 140;
    background: rgba(8, 12, 28, 0.98);
    border-right: 1px solid var(--border-neon);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
    transform: translateX(-105%);
    transition: transform .25s ease;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-drawer-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-drawer-head .brand {
    min-width: 0;
  }

  .mobile-drawer-head .brand-logo {
    width: 40px;
    height: 40px;
  }

  .mobile-drawer-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: none;
    flex-shrink: 0;
  }

  .mobile-drawer-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
  }

  .mobile-drawer-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: .92rem;
  }

  .mobile-drawer-nav a span:first-child {
    width: 1.35rem;
    text-align: center;
    flex-shrink: 0;
  }

  .mobile-drawer-nav a.active,
  .mobile-drawer-nav a:hover {
    background: rgba(0, 245, 255, 0.08);
    border-color: rgba(0, 245, 255, 0.25);
    color: var(--neon-cyan);
  }

  .mobile-drawer-foot {
    flex-shrink: 0;
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(8, 12, 28, 0.96);
    border-top: 1px solid var(--border-neon);
    backdrop-filter: blur(14px);
    z-index: 110;
  }

  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: .72rem;
    padding: 8px 4px;
  }

  .bottom-nav a.active {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0,245,255,.4);
  }

  .bottom-nav a span.icon { font-size: 1.15rem; }

  .form-grid { flex-direction: column; }
  .form-grid .actions { width: 100%; }
  .form-grid .actions .btn { width: 100%; }

  .table-wrap { display: none; }
  .mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .data-list .table-wrap { display: none; }
  .data-list .mobile-cards { display: flex; }

  .mobile-card-item {
    border: 1px solid var(--border-neon);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: rgba(0,0,0,.25);
  }

  .mobile-card-item .row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: .92rem;
  }

  .content-wa {
    padding: 0;
  }

  .content-wa .page-viewport--wa {
    height: 100%;
  }

  .chat-shell.wa-web {
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }

  .wa-tab-body {
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }

  .chat-side { display: none; }

  .chat-list,
  .chat-list-panel {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1;
    min-height: 0;
  }

  .wa-tab-bar {
    padding: 6px 8px;
  }

  .wa-tab-pills {
    display: flex;
    width: 100%;
  }

  .wa-tab-pill {
    font-size: 11px;
    padding: 7px 10px;
  }

  .chat-shell {
    flex-direction: column;
  }

  .chat-main {
    width: 100%;
    flex: 1;
    min-height: 0;
  }

  .chat-shell.show-chat .chat-list-panel { display: none; }
  .chat-shell.show-chat .wa-tab-bar { display: none; }
  .chat-shell.show-chat .btn-back-chat { display: inline-flex; }

  /* Daftar chat: jangan bagi layar dengan panel chat kosong */
  .chat-shell[data-tab="chats"]:not(.show-chat) #chatMainPanel {
    display: none !important;
  }

  .chat-shell[data-tab="chats"]:not(.show-chat) #chatListPanel {
    display: flex !important;
    flex: 1;
    min-height: 0;
    width: 100%;
  }

  .chat-shell[data-tab="calls"] #callsMainPanel {
    display: none !important;
  }

  .chat-shell[data-tab="gallery"] .gallery-filter-bar {
    padding: 6px 8px;
    gap: 6px;
  }

  .chat-shell[data-tab="gallery"] .gallery-scope {
    flex: 1 1 100%;
  }

  .chat-shell[data-tab="gallery"] .gallery-contacts {
    width: 100%;
    max-width: none;
    max-height: 42vh;
  }

  .chat-shell[data-tab="contacts"] #contactsPanel {
    display: flex !important;
    flex: 1;
    min-height: 0;
    width: 100%;
  }

  .chat-shell[data-tab="contacts"] .contacts-shell,
  .chat-shell[data-tab="contacts"] .contacts-list,
  .chat-shell[data-tab="contacts"] .contacts-list-scroll {
    flex: 1;
    min-height: 0;
    width: 100%;
  }

  /* Halaman WhatsApp: full height tanpa bottom bar */
  body.page-wa .app-shell {
    height: calc(100dvh - var(--nav-h));
    height: calc(100svh - var(--nav-h));
  }

  .chat-shell.show-chat {
    flex: 1;
    min-height: 0;
    height: var(--chat-shell-height, auto);
    max-height: var(--chat-shell-height, none);
  }

  .chat-shell.show-chat #chatMainPanel {
    display: flex !important;
    flex: 1;
    min-height: 0;
  }

  .chat-shell.show-chat .chat-active {
    flex: 1;
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .chat-shell.show-chat .chat-messages {
    flex: 1;
    min-height: 0;
    padding: 12px 10px 20px;
    scroll-padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
  }

  .chat-shell.show-chat .msg {
    max-width: min(88%, 520px);
    font-size: 15px;
    line-height: 20px;
  }

  .chat-shell.show-chat .chat-main-head {
    padding: 8px 10px;
    min-height: 52px;
    gap: 10px;
  }

  .chat-shell.show-chat .chat-compose {
    flex-shrink: 0;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
  }

  .chat-shell.show-chat .compose-row {
    gap: 6px;
    align-items: center;
  }

  .chat-shell.show-chat .compose-input-wrap {
    min-width: 0;
  }

  .chat-shell.show-chat .compose-input-wrap input {
    padding: 10px 0;
    font-size: 16px;
  }

  .chat-shell.show-chat .attach-btns {
    gap: 2px;
    flex-shrink: 0;
  }

  .chat-shell.show-chat .attach-btn {
    padding: 4px 5px;
    font-size: 1.05rem;
  }

  .chat-shell.show-chat .wa-send-btn {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  .chat-shell.show-chat .attach-preview {
    font-size: 12px;
    padding: 6px 8px;
  }

  .chat-item {
    padding: 12px 14px;
    min-height: 72px;
  }

  .chat-item .chat-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }

  .mobile-topbar--chat {
    grid-template-columns: 40px minmax(0, 1fr);
    padding-right: 8px;
    gap: 6px;
  }

  .mobile-topbar--chat .chat-topbar-tools {
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .mobile-topbar--chat .chat-topbar-tools::-webkit-scrollbar {
    display: none;
  }

  .mobile-topbar--chat .chat-topbar-instance {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 44vw;
  }

  .mobile-topbar--chat .chat-topbar-instance select {
    padding: 5px 6px;
    font-size: .72rem;
    max-width: 100%;
  }

  .mobile-topbar--chat .chat-topbar-actions {
    gap: 3px;
    flex-shrink: 0;
  }

  .mobile-topbar--chat .chat-topbar-btn,
  .mobile-topbar--chat .logout-btn--chat {
    width: auto;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    font-size: .68rem;
  }

  .chat-search-row {
    gap: 6px;
  }

  .chat-search-row .logout-btn--inline {
    padding: 0 10px;
    height: 34px;
    font-size: .72rem;
  }

  .chat-head-actions .logout-btn--inline {
    padding: 0 10px;
    height: 32px;
    font-size: .72rem;
  }

  .chat-list-action-btn {
    width: 34px;
    height: 34px;
  }
  .account-actions .btn, .account-actions button { flex: 1 1 calc(50% - 8px); }
}

@media (max-width: 480px) {
  .chat-shell.show-chat .attach-btns .attach-btn:nth-child(4),
  .chat-shell.show-chat .attach-btns .attach-btn:nth-child(5) {
    display: none;
  }

  .chat-shell.show-chat .compose-input-wrap input {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .card { flex: 1 1 100%; }
  .page-head h1 { font-size: 1.35rem; }
  .login-card { padding: 24px 18px; }
}

.info-banner {
  margin-bottom: 16px;
  border: 1px solid rgba(0, 255, 255, .15);
  background: rgba(0, 255, 255, .04);
}

.info-banner p { margin: 0; line-height: 1.5; }

.warn-banner {
  border-color: rgba(255, 193, 7, .25);
  background: rgba(255, 193, 7, .06);
}

.safety-list {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.55;
  font-size: .88rem;
}

.safety-list li { margin-bottom: 6px; }

.safety-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 193, 7, .08);
  border: 1px solid rgba(255, 193, 7, .2);
  margin-bottom: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 14px;
  margin-top: 8px;
}

.check-grid .wa-check.block,
.check-grid .check-neon.block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

.form-grid .actions {
  grid-column: 1 / -1;
}

.attach-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.attach-btn {
  font-size: 1.1rem;
  padding: 6px 8px;
}

.attach-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--wa-input, rgba(255, 255, 255, .06));
  font-size: 13px;
  color: var(--wa-text, inherit);
}

.attach-preview.hidden { display: none; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.tool-card-wide { grid-column: 1 / -1; }

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.tools-note { margin-bottom: 16px; }

.file-drop {
  min-height: 120px;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.file-drop.has-file { border-style: solid; }

.profile-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

.profile-preview.hidden { display: none; }

.file-hint {
  color: var(--muted);
  font-size: .85rem;
}

.status-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-neon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  cursor: pointer;
  font-size: .85rem;
}

.tab-neon input { width: auto; accent-color: var(--neon-cyan); }

.tool-form textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}

.nav-group-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 16px 12px 6px;
  opacity: .9;
  font-weight: 700;
}

.nav-group-label:first-child {
  padding-top: 4px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .85rem;
}

.tab-btn.active {
  border-color: rgba(0,255,255,.35);
  background: rgba(0,255,255,.08);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.menu-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px;
  min-height: 108px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(145deg, rgba(255,255,255,.04), rgba(0,0,0,.12));
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.menu-card:hover {
  border-color: rgba(0,245,255,.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 245, 255, 0.08);
  color: inherit;
}

.menu-card span { font-size: 1.6rem; line-height: 1; margin-bottom: 4px; }
.menu-card strong { font-size: .95rem; letter-spacing: .01em; }
.menu-card small { color: var(--muted); font-size: .74rem; line-height: 1.35; margin-top: auto; }

.menu-panel { margin-bottom: 18px; }
.menu-panel .menu-grid { margin-top: 0; }

.menu-section-label {
  margin: 0 0 12px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
}

.data-list { display: block; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: .85;
}

.empty-state p { margin: 0; font-size: .92rem; }

.instance-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: min(100%, 260px);
}

.instance-switch label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
}

.instance-switch select {
  min-width: 220px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  color: var(--text);
  font-size: .9rem;
}

.page-head .instance-switch {
  align-self: flex-end;
}

.panel-shell > .tab-bar {
  margin-bottom: 18px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.panel-shell > .tab-bar .tab-btn {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.panel-shell > .tab-bar .tab-btn.active {
  border-bottom-color: var(--neon-cyan);
  background: rgba(0,245,255,.06);
}

.list-cards { display: flex; flex-direction: column; gap: 10px; }

.list-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
}

.list-card.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions { display: flex; gap: 8px; margin-top: 8px; }

.result-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0,255,255,.06);
  border: 1px solid rgba(0,255,255,.15);
}

.result-box.hidden { display: none; }

.msg { position: relative; }
.msg-actions {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  gap: 4px;
}
.msg:hover .msg-actions { display: flex; }
.msg-act {
  border: none;
  background: rgba(0,0,0,.45);
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: .75rem;
}

/* Status — WhatsApp Web style */
.status-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-panel.hidden { display: none !important; }

.gallery-panel.hidden { display: none !important; }

.contacts-panel.hidden { display: none !important; }

.chat-shell[data-tab="chats"] #statusPanel,
.chat-shell[data-tab="chats"] #callsListPanel,
.chat-shell[data-tab="chats"] #callsMainPanel,
.chat-shell[data-tab="chats"] #galleryPanel,
.chat-shell[data-tab="chats"] #contactsPanel { display: none !important; }

.chat-shell[data-tab="chats"]:not(.show-chat) #chatListPanel {
  display: flex !important;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.chat-shell[data-tab="status"] #chatListPanel,
.chat-shell[data-tab="status"] #chatMainPanel,
.chat-shell[data-tab="status"] #callsListPanel,
.chat-shell[data-tab="status"] #callsMainPanel,
.chat-shell[data-tab="status"] #galleryPanel,
.chat-shell[data-tab="status"] #contactsPanel { display: none !important; }

.chat-shell[data-tab="calls"] #chatListPanel,
.chat-shell[data-tab="calls"] #chatMainPanel,
.chat-shell[data-tab="calls"] #statusPanel,
.chat-shell[data-tab="calls"] #galleryPanel,
.chat-shell[data-tab="calls"] #contactsPanel { display: none !important; }

.chat-shell[data-tab="gallery"] #chatListPanel,
.chat-shell[data-tab="gallery"] #chatMainPanel,
.chat-shell[data-tab="gallery"] #statusPanel,
.chat-shell[data-tab="gallery"] #callsListPanel,
.chat-shell[data-tab="gallery"] #callsMainPanel,
.chat-shell[data-tab="gallery"] #contactsPanel { display: none !important; }

.chat-shell[data-tab="contacts"] #chatListPanel,
.chat-shell[data-tab="contacts"] #chatMainPanel,
.chat-shell[data-tab="contacts"] #statusPanel,
.chat-shell[data-tab="contacts"] #callsListPanel,
.chat-shell[data-tab="contacts"] #callsMainPanel,
.chat-shell[data-tab="contacts"] #galleryPanel { display: none !important; }

.chat-shell[data-tab="gallery"] .gallery-panel,
.chat-shell[data-tab="gallery"] .gallery-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.chat-shell[data-tab="status"] .status-panel,
.chat-shell[data-tab="status"] .status-shell,
.chat-shell[data-tab="status"] .status-list {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.status-panel {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.gallery-panel {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.contacts-panel {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.chat-shell[data-tab="contacts"] .contacts-panel,
.chat-shell[data-tab="contacts"] .contacts-shell,
.chat-shell[data-tab="contacts"] .contacts-list {
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
}

.contacts-shell.wa-web {
  flex: 1;
  display: flex;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #111b21;
  color: #e9edef;
}

.contacts-list {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #111b21;
}

.contacts-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px 0;
  background: #202c33;
  border-bottom: 1px solid #222d34;
  flex-shrink: 0;
}

.contacts-subtabs {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.contacts-subtab {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #8696a0;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}

.contacts-add-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: #00a884;
  color: #111b21;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contacts-subtab.active {
  color: #00a884;
  background: #111b21;
  font-weight: 500;
}

.contacts-add-btn:hover {
  background: #06cf9c;
}

.contacts-search-wrap {
  padding: 8px 12px;
  background: #111b21;
  border-bottom: 1px solid #222d34;
  flex-shrink: 0;
}

.contacts-search-wrap .chat-search {
  width: 100%;
}

.contacts-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  text-align: left;
}

.contacts-items {
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.contacts-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid #222d34;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.contacts-row:hover {
  background: #202c33;
}

.contacts-row .chat-avatar-photo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.contacts-row-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.contacts-row-name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contacts-row-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contacts-empty {
  padding: 24px 16px;
  text-align: left;
}

.gallery-panel .gallery-shell.wa-web {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: 0;
  border: 0;
}

.status-panel .status-shell {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.status-shell.wa-web {
  --wa-bg: #111b21;
  --wa-panel: #111b21;
  --wa-header: #202c33;
  --wa-border: #222d34;
  --wa-text: #e9edef;
  --wa-muted: #8696a0;
  --wa-green: #00a884;
  flex: 1;
  display: flex;
  min-height: 0;
  height: 100%;
  background: var(--wa-panel);
  color: var(--wa-text);
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}

.status-list {
  flex: 1;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 0;
  background: var(--wa-panel);
}

.status-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.status-list-scroll .status-section-label:first-child {
  padding-top: 10px;
}

.status-anti-hilang { margin: 4px 0 0; color: #53bdeb; }

.status-saved-badge {
  font-size: .85rem;
  opacity: .85;
}

.status-archived .status-ring-unseen {
  background: #8696a0;
}

.status-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--wa-header);
  border-bottom: 1px solid var(--wa-border);
}

.status-list-head h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.status-my-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--wa-border);
  flex-shrink: 0;
  background: var(--wa-header);
}

.status-my-row:hover { background: #202c33; }

.status-add-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.status-my-add-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wa-green, #00a884);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  border: 2px solid var(--wa-header, #202c33);
}

.status-my-meta {
  min-width: 0;
}

.status-my-meta strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

.status-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #00a884, #25d366, #128c7e);
}

.status-ring-unseen { background: linear-gradient(135deg, #00a884, #25d366, #128c7e); }
.status-ring-seen { background: #8696a0; }
.status-ring-add { background: #2a3942; }

.status-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #111b21;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--wa-text);
}

.status-ring-add .status-ring-inner {
  font-size: 1.4rem;
  color: var(--wa-green);
}

.status-ring-sm {
  width: 40px;
  height: 40px;
}

.status-section-label {
  padding: 14px 20px 8px;
  font-size: .85rem;
  color: var(--wa-muted);
}

.status-updates {
  flex: 0 0 auto;
  overflow: visible;
  min-height: 0;
}

.status-update-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.status-update-row:hover { background: #202c33; }

.status-update-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-count {
  flex-shrink: 0;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 168, 132, 0.22);
  color: #25d366;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
}

.status-empty {
  padding: 20px;
  text-align: center;
}

.status-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b141a;
  min-width: 0;
}

.status-placeholder-inner {
  text-align: center;
  max-width: 360px;
  color: var(--wa-muted);
}

.status-placeholder-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  opacity: .5;
}

.wa-modal-status {
  z-index: 160;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.wa-modal-status .status-viewer-box {
  width: min(100%, 420px);
  height: min(88dvh, 720px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #0b141a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  position: relative;
}

.status-progress {
  display: flex;
  gap: 3px;
  padding: 8px 10px 0;
  flex-shrink: 0;
  background: rgba(11, 20, 26, 0.92);
  z-index: 2;
}

.status-progress-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.status-progress-seg.done,
.status-progress-seg.active {
  background: #fff;
}

.status-progress-seg.upcoming {
  background: rgba(255, 255, 255, 0.28);
}

.status-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 14px;
  background: rgba(32, 44, 51, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.status-viewer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-viewer-user strong {
  display: block;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-viewer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-viewer-meta #viewerTime {
  color: rgba(233, 237, 239, 0.85);
  font-size: .78rem;
  line-height: 1.3;
  white-space: nowrap;
}

.status-viewer-pos {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 700;
  color: #25d366;
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: 999px;
  padding: 1px 8px;
  line-height: 1.4;
}

.status-viewer-pos[hidden] {
  display: none !important;
}

.status-viewer-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #e9edef;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}

.status-viewer-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.status-viewer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  background: #0b141a;
  overflow: auto;
}

.status-viewer-media {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-viewer-media img,
.status-viewer-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

body.status-modal-open {
  overflow: hidden;
}

.status-text-slide {
  font-size: 1.35rem;
  line-height: 1.45;
  text-align: center;
  padding: 20px;
  max-width: 100%;
  word-break: break-word;
  color: #e9edef;
}

.status-caption {
  margin-top: 12px;
  text-align: center;
  padding: 0 8px;
  font-size: .9rem;
  color: #aebac1;
  line-height: 1.4;
}

.status-viewer-nav {
  position: absolute;
  inset: 56px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  padding: 0 4px;
  z-index: 2;
}

.status-viewer-nav-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  backdrop-filter: blur(4px);
}

.status-viewer-nav-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

.status-reply-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 27, 33, 0.98);
  padding: 10px 12px 12px;
  flex-shrink: 0;
}

.status-reply-bar.hidden {
  display: none !important;
}

.status-reply-quote {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 3px solid #ffb84d;
  background: rgba(255, 255, 255, 0.05);
}

.status-reply-quote-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-reply-quote strong {
  font-size: 12px;
  color: #ffd28a;
  display: block;
}

.status-reply-quote-text {
  font-size: 12.5px;
  color: rgba(233, 237, 239, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.status-reply-quote-text[hidden] {
  display: none !important;
}

.status-reply-quote-thumb {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  margin-left: auto;
}

.status-reply-quote-thumb.hidden {
  display: none;
}

.status-reply-quote-thumb img,
.status-reply-quote-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.status-reply-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.status-reply-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 20px;
  background: #2a3942;
  color: #e9edef;
  padding: 10px 14px;
  font-size: 14px;
}

.status-reply-form input::placeholder {
  color: #8696a0;
}

.status-reply-form input:focus {
  outline: 1px solid rgba(83, 189, 235, 0.45);
}

.status-reply-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

.status-reply-send:hover:not(:disabled) {
  background: #06cf9c;
}

.status-reply-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status-reply-chat-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #2a3942;
  color: #e9edef;
  cursor: pointer;
  font-size: 17px;
  flex-shrink: 0;
}

.status-reply-chat-btn:hover {
  background: #374955;
}

.status-updates-empty {
  padding: 16px 14px;
  color: #8696a0;
  font-size: 13px;
  line-height: 1.45;
}

.status-viewers-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 27, 33, 0.96);
  padding: 10px 14px 12px;
}

.status-viewers-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #53bdeb;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.status-viewers-toggle:hover {
  color: #7cccf0;
}

.status-viewers-eye {
  font-size: 15px;
  line-height: 1;
}

.status-viewers-label {
  color: #8696a0;
  font-size: 13px;
}

.status-viewers-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.status-viewer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.status-viewer-row:last-child {
  border-bottom: 0;
}

.status-viewer-row-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.status-viewer-row-meta strong {
  font-size: 14px;
  font-weight: 500;
}

.status-viewer-empty {
  padding: 6px 0;
}

@media (max-width: 900px) {
  .wa-modal-status {
    padding: 12px;
    align-items: flex-end;
    z-index: 200;
  }

  .wa-modal-status .status-viewer-box {
    width: 100%;
    height: min(calc(100dvh - var(--nav-h) - 24px), 820px);
    max-height: calc(100dvh - var(--nav-h) - 24px);
    border-radius: 16px 16px 12px 12px;
  }

  .status-viewers-list {
    max-height: min(42dvh, 320px);
  }
}

.status-composer { max-width: 420px; }

.wa-modal-profile {
  z-index: 165;
}

.wa-modal-contact-profile {
  z-index: 166;
}

.contact-profile-box {
  width: min(100%, 420px);
  padding: 0;
  overflow: hidden;
}

.contact-profile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 24px;
  text-align: center;
}

.contact-profile-hero {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 18px 0 8px;
  background: radial-gradient(circle at 50% 30%, rgba(37, 211, 102, 0.12), transparent 62%);
}

.contact-profile-avatar,
.contact-profile-avatar-fallback {
  width: min(72vw, 220px);
  height: min(72vw, 220px);
  border-radius: 50%;
  object-fit: cover;
}

.contact-profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: #00a884;
  color: #fff;
  font-size: 64px;
  font-weight: 600;
}

.contact-profile-avatar.hidden,
.contact-profile-avatar-fallback.hidden {
  display: none !important;
}

.contact-profile-name {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--wa-text, #e9edef);
}

.contact-profile-phone {
  font-size: 1rem;
  color: rgba(233, 237, 239, 0.78);
}

.contact-profile-presence.is-online {
  color: #25d366;
}

.contact-profile-about-block {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.contact-profile-about {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(233, 237, 239, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
}

.wa-profile-box {
  width: min(100%, 420px);
  padding: 0;
  overflow: hidden;
}

.wa-profile-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.wa-profile-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.wa-profile-avatar,
.wa-profile-avatar-fallback {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.wa-profile-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(0, 168, 132, 0.35), rgba(0, 245, 255, 0.2));
  color: #e9edef;
  border: 3px solid rgba(0, 168, 132, 0.5);
}

.wa-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.wa-profile-meta strong {
  font-size: 1.15rem;
}

.wa-profile-bio-block {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wa-profile-label {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.wa-profile-bio {
  margin: 0;
  font-size: .92rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.wa-profile-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.wa-profile-actions .btn {
  flex: 1;
}

@media (max-width: 900px) {
  .wa-profile-actions {
    flex-direction: column;
  }
}

.chat-topbar-actions .js-wa-profile {
  font-size: 1rem;
}

.wa-modal-composer {
  z-index: 170;
}

.status-composer-box {
  width: min(100%, 440px);
  padding: 0;
  overflow: hidden;
}

.status-composer-box .status-type-tabs {
  margin-bottom: 4px;
}

.calls-stub {
  text-align: center;
  padding: 48px 24px;
}

.calls-stub-icon { font-size: 3rem; margin-bottom: 12px; }

@media (min-width: 901px) {
  .data-list .mobile-cards { display: none; }
  .panel .mobile-cards { display: none; }
}

@media (max-width: 900px) {
  .status-list { width: 100%; }
}

.wa-modal-box.wa-modal-lg {
  width: min(100%, 520px);
}

.wa-modal-box.wa-modal-chat {
  width: min(100%, 420px);
  padding: 0;
  overflow: hidden;
}

.wa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--wa-border, #222d34);
}

.wa-modal-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.wa-modal-x {
  border: 0;
  background: transparent;
  color: var(--wa-muted, #8696a0);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.wa-modal-x:hover {
  background: rgba(134, 150, 160, 0.15);
  color: var(--wa-text, #e9edef);
}

.wa-modal-form {
  padding: 16px 20px 20px;
  margin-top: 0;
  gap: 14px;
}

.wa-modal-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-modal-form .field label {
  margin: 0;
  font-size: 13px;
  color: var(--wa-muted, #8696a0);
}

.wa-modal-form .field input,
.wa-modal-form .field textarea {
  width: 100%;
  margin: 0;
  background: var(--wa-input, #2a3942);
  border: 0;
  color: var(--wa-text, #e9edef);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  box-shadow: none;
}

.wa-modal-form .field input:focus,
.wa-modal-form .field textarea:focus {
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 168, 132, 0.45);
}

.wa-modal-form .field textarea {
  min-height: 72px;
  resize: vertical;
  font-family: inherit;
}

.wa-modal-form .field-inline {
  flex-direction: row;
  align-items: center;
}

.wa-modal-form .field-inline .wa-check {
  margin: 0;
}

.wa-modal-form .schedule-field input {
  margin: 0;
}

.modal-actions-end {
  justify-content: flex-end;
  margin-top: 4px;
}

.modal-actions-end .btn {
  min-width: 92px;
}

.wa-modal-box textarea,
.wa-modal-box select {
  width: 100%;
  margin-bottom: 10px;
  background: var(--wa-input, #2a3942);
  border: 0;
  color: var(--wa-text, #e9edef);
  border-radius: 8px;
  padding: 10px 12px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 { margin: 0; }

/* Gallery per kontak */
.gallery-shell.wa-web {
  display: flex;
  min-height: 70vh;
  background: #111b21;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.gallery-contacts {
  width: 320px;
  max-width: 38%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #222d34;
  background: #111b21;
  color: #e9edef;
}

.gallery-contacts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #202c33;
  border-bottom: 1px solid #222d34;
}

.gallery-contacts-head h2 { margin: 0; font-size: 1rem; font-weight: 500; }

.gallery-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #202c33;
  border-bottom: 1px solid #222d34;
}

.gallery-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: #2a3942;
}

.gallery-pill {
  border: 0;
  background: transparent;
  color: #8696a0;
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.gallery-pill:hover {
  color: #e9edef;
}

.gallery-pill.active {
  background: #00a884;
  color: #111b21;
  font-weight: 500;
}

.gallery-scope {
  flex: 1;
  min-width: 108px;
  max-width: 100%;
  padding: 7px 28px 7px 10px;
  border-radius: 8px;
  border: 0;
  background: #2a3942 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238696a0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: #e9edef;
  font-size: 12px;
  appearance: none;
  cursor: pointer;
}

.gallery-filters.compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #222d34;
}

.gallery-filters.compact select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: #2a3942;
  color: #e9edef;
}

.gallery-contact-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.gallery-contact-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid #222d34;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.gallery-contact-row:hover,
.gallery-contact-row.active { background: #202c33; }

.gallery-contact-name { font-weight: 500; }

.gallery-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #0b141a;
  color: #e9edef;
}

.gallery-main-head {
  padding: 14px 16px;
  background: #202c33;
  border-bottom: 1px solid #222d34;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-main .gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

@media (max-width: 900px) {
  .gallery-shell.wa-web { flex-direction: column; min-height: auto; }
  .gallery-contacts { width: 100%; max-width: none; max-height: 40vh; }
  .gallery-filter-bar { padding: 6px 8px; gap: 6px; }
  .gallery-scope { flex: 1 1 100%; }
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-filters select {
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
}

.gallery-note { margin-bottom: 12px; padding: 12px 16px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #111;
}

.gallery-video-thumb {
  position: relative;
  aspect-ratio: 1;
  background: #111;
}

.gallery-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  pointer-events: none;
}

.gallery-item-meta {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .82rem;
}

.gallery-item-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item-dl {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  opacity: .92;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox.hidden { display: none; }

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
}

.gallery-lightbox-body {
  position: relative;
  z-index: 1;
  width: min(920px, 96vw);
  max-height: 92vh;
  background: var(--panel);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.gallery-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(0,0,0,.45);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

#galleryLightboxMedia {
  flex: 1;
  min-height: 200px;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b141a;
}

#galleryLightboxMedia img,
#galleryLightboxMedia video {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.gallery-lightbox-meta {
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.gallery-lightbox-meta strong { flex: 1; min-width: 120px; }

/* —— Camera capture —— */
body.camera-modal-open {
  overflow: hidden;
}

.wa-modal-camera {
  z-index: 220;
  background: rgba(0, 0, 0, .72);
}

.camera-capture-box {
  width: min(100%, 420px);
  max-height: min(96vh, 720px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #111b21;
  color: #e9edef;
  border: none;
}

.camera-capture-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.camera-capture-head .wa-modal-x,
.camera-flip-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
}

.camera-mode-tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}

.camera-mode-tab {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .06);
  color: #8696a0;
  cursor: pointer;
  font-weight: 600;
}

.camera-mode-tab.is-active {
  background: #00a884;
  color: #111b21;
}

.camera-stage {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #000;
  overflow: hidden;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.camera-stage-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, .55);
  color: #e9edef;
  font-size: .92rem;
  z-index: 2;
}

.camera-stage-hint.hidden { display: none; }
.camera-stage-hint.is-error { color: #ffd7d7; }

.camera-rec-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(180, 0, 0, .85);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.camera-rec-badge.hidden { display: none; }

.camera-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px 20px;
}

.camera-shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: transparent;
  padding: 4px;
  cursor: pointer;
}

.camera-shutter-ring {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  transition: transform .12s ease, background .12s ease, border-radius .12s ease;
}

.camera-shutter.is-video .camera-shutter-ring {
  background: #e53935;
}

.camera-shutter.is-recording .camera-shutter-ring {
  width: 42%;
  height: 42%;
  margin: auto;
  border-radius: 8px;
  background: #e53935;
}

.camera-controls-hint {
  margin: 0;
  color: #8696a0;
}

.status-media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.status-media-actions .btn {
  flex: 1 1 120px;
}

.status-media-name {
  margin: 0;
  word-break: break-all;
}

.status-media-name.hidden { display: none; }

@media (max-width: 480px) {
  .camera-capture-box {
    width: 100%;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }

  .camera-stage {
    flex: 1;
    aspect-ratio: auto;
    min-height: 50vh;
  }
}

/* —— Voice note compose —— */
.wa-mic-btn {
  background: var(--wa-accent, #00a884) !important;
}

.voice-record-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 4px;
  width: 100%;
}

.voice-record-bar.hidden { display: none; }

.voice-record-cancel {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 80, 80, .15);
  color: #ff6b6b;
  cursor: pointer;
}

.voice-record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e53935;
  animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}

.voice-record-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 3ch;
}

.voice-record-hint { flex: 1; }

.voice-record-send { flex-shrink: 0; }

.compose-row.hidden { display: none !important; }

.status-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-color-row input[type="color"] {
  width: 42px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.status-viewer-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 240px;
  padding: 24px;
  background: linear-gradient(160deg, #075e54, #128c7e 55%, #0b141a);
  border-radius: 12px;
}

.status-viewer-audio-icon {
  font-size: 3rem;
}

.status-viewer-audio audio {
  width: min(100%, 320px);
}

#statusMusicHint.hidden { display: none; }
#statusColorField.hidden { display: none; }
