:root {
  --fc-primary-dark: #008069;
  --fc-primary: #00a884;
  --fc-bg-app: #efeae2;
  --fc-bg-sidebar: #ffffff;
  --fc-bg-header: #f0f2f5;
  --fc-outgoing: #d9fdd3;
  --fc-incoming: #ffffff;
  --fc-text-main: #111b21;
  --fc-text-muted: #667781;
  --fc-border: #e9edef;
  --fc-blue-tick: #53bdeb;
  --fc-danger: #ea0038;
  --fc-ui-zoom: 1;
}

    *, *::before, *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
    body, button, input, select, textarea {
      font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }
    .fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands {
      -moz-osx-font-smoothing: grayscale;
      -webkit-font-smoothing: antialiased;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-style: normal;
      font-variant: normal;
      line-height: 1;
      text-rendering: auto;
      vertical-align: -0.125em;
    }
    .fa-solid, .fas, .fa-solid::before, .fas::before {
      font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", FontAwesome !important;
      font-weight: 900 !important;
    }
    .fa-regular, .far, .fa-regular::before, .far::before {
      font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", FontAwesome !important;
      font-weight: 400 !important;
    }
    .fa-brands, .fab, .fa-brands::before, .fab::before {
      font-family: "Font Awesome 6 Brands", FontAwesome !important;
      font-weight: 400 !important;
    }
    i[data-fa-svg="1"]::before {
      content: none !important;
      display: none !important;
    }
    i[data-fa-svg="1"] svg.fc-inline-svg {
      width: 1em;
      height: 1em;
      fill: currentColor;
      display: inline-block;
      vertical-align: middle;
      pointer-events: none;
      flex-shrink: 0;
    }
    @keyframes fc-spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    .fa-spin svg.fc-inline-svg, .fa-spin {
      animation: fc-spin 1s linear infinite;
    }

/* Skala zoom dibatasi aman (90% - 110%) tanpa memaksa ukuran kontainer agar tidak pernah terpotong di Desktop & Android */
html {
  font-size: 16px;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #ffffff;
  color: var(--fc-text-main);
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  font-size: calc(0.86rem * var(--fc-ui-zoom, 1));
  line-height: 1.42;
}

/* Halaman Auth (/login, /register, /@username/:token) */
.auth-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 0%;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: clamp(0.65rem, 2.5vw, 1.5rem);
  background: var(--fc-bg-app);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fc-primary-dark);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0.25rem 0 0.75rem 0;
  flex-shrink: 0;
}

.auth-card {
  background: #ffffff;
  width: 100%;
  max-width: min(28rem, 100%);
  border-radius: 0.65rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--fc-border);
  padding: clamp(0.95rem, 3vw, 1.5rem);
  margin: 0 auto 1rem auto;
  flex-shrink: 0;
}

.auth-card h1 {
  font-size: calc(1.12rem * var(--fc-ui-zoom, 1));
  color: var(--fc-text-main);
  margin-bottom: 0.35rem;
}

.auth-card p.subtitle {
  font-size: calc(0.79rem * var(--fc-ui-zoom, 1));
  color: var(--fc-text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.db-badge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.42rem 0.62rem;
  border-radius: 0.45rem;
  margin-bottom: 0.8rem;
  font-size: 0.74rem;
  color: #166534;
}

.form-group {
  margin-bottom: 0.68rem;
}

.form-group label {
  display: block;
  font-size: calc(0.75rem * var(--fc-ui-zoom, 1));
  font-weight: 600;
  color: #3b4a54;
  margin-bottom: 0.24rem;
}

.form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.46rem 0.64rem;
  font-size: calc(0.81rem * var(--fc-ui-zoom, 1));
  border: 1px solid #cbd5e1;
  border-radius: 0.42rem;
  outline: none;
  transition: border-color 0.15s ease;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--fc-primary);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  border: none;
  border-radius: 0.42rem;
  padding: 0.44rem 0.72rem;
  font-size: calc(0.76rem * var(--fc-ui-zoom, 1));
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  max-width: 100%;
  line-height: 1.25;
}

.btn-primary {
  background-color: var(--fc-primary);
  color: #ffffff;
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--fc-primary-dark);
}

.btn-secondary {
  background-color: #e9edef;
  color: var(--fc-text-main);
}

.btn-danger {
  background-color: #fee2e2;
  color: var(--fc-danger);
}

.auth-footer {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--fc-text-muted);
}

.auth-footer a {
  color: var(--fc-primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.alert-box {
  padding: 0.52rem 0.68rem;
  border-radius: 0.42rem;
  font-size: 0.78rem;
  margin-bottom: 0.75rem;
  display: none;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Search & Pagination Bars */
.search-filter-bar {
  padding: 0.38rem 0.55rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--fc-border);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  min-width: 0;
}

.search-filter-bar input {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  padding: 0.36rem 0.52rem;
  font-size: calc(0.76rem * var(--fc-ui-zoom, 1));
  border: 1px solid #cbd5e1;
  border-radius: 0.38rem;
  outline: none;
  background: #ffffff;
}

.search-filter-bar input:focus {
  border-color: var(--fc-primary);
}

/* Filter Pill Bar (Semua Chat vs Diarsipkan) */
.chat-archive-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.55rem;
  background: #ffffff;
  border-bottom: 1px solid var(--fc-border);
  flex-shrink: 0;
  min-width: 0;
}

.archive-filter-pill {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.archive-filter-pill.active {
  background: #dcfce7;
  border-color: #86efac;
  color: #065f46;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.69rem;
  color: #475569;
  margin-top: 0.15rem;
  border-radius: 0.32rem;
  flex-shrink: 0;
  min-width: 0;
}

.pagination-bar button {
  padding: 0.22rem 0.48rem;
  font-size: 0.67rem;
  border-radius: 0.3rem;
  width: auto;
  flex-shrink: 0;
}

.pagination-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Multi-Session Manager Card */
.multi-session-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.65rem;
  margin-top: 0.7rem;
  min-width: 0;
}

.session-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.42rem 0.52rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.42rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  min-width: 0;
}

.bg-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.6rem, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.48rem;
}

.bg-swatch-btn {
  border: 2px solid #cbd5e1;
  border-radius: 0.42rem;
  padding: 0.4rem 0.28rem;
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  color: #0f172a;
}

.bg-swatch-btn.active {
  border-color: var(--fc-primary-dark);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.25);
}

/* Shell Utama Chat - Fluid 2 Kolom di Desktop, 1 Kolom Penuh di Android */
.app-shell {
  position: relative;
  z-index: 1;
  flex: 1 1 0%;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  margin: 0;
  background: #ffffff;
  display: grid;
  grid-template-columns: clamp(235px, 32%, 360px) minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  border-right: 1px solid var(--fc-border);
  display: flex;
  flex-direction: column;
  background: var(--fc-bg-sidebar);
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.sidebar-header {
  background: var(--fc-bg-header);
  padding: 0.46rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  border-bottom: 1px solid var(--fc-border);
  flex-shrink: 0;
  min-width: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  cursor: pointer;
  min-width: 0;
  flex: 1 1 0%;
  overflow: hidden;
}

.avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.86rem;
  flex-shrink: 0;
  background: var(--fc-primary);
  overflow: hidden;
  object-fit: cover;
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.status-ring-unread {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #00a884;
}

.avatar.status-ring-read {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #94a3b8;
}

.nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--fc-bg-header);
  border-bottom: 1px solid var(--fc-border);
  flex-shrink: 0;
  min-width: 0;
}

.nav-tab {
  padding: 0.48rem 0.15rem;
  text-align: center;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--fc-text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tab.active {
  color: var(--fc-primary-dark);
  border-bottom-color: var(--fc-primary);
  background: #ffffff;
}

.sidebar-content {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: block;
}

#tab-chats.sidebar-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chatListContainer {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 0.56rem;
  padding: 0.54rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s ease;
  min-width: 0;
}

.list-item:hover {
  background: #f8fafc;
}

.list-item.active {
  background: #f0f2f5;
}

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

.list-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.14rem;
  min-width: 0;
}

.list-item-title {
  font-size: calc(0.83rem * var(--fc-ui-zoom, 1));
  font-weight: 600;
  color: var(--fc-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.list-item-time {
  font-size: 0.65rem;
  color: var(--fc-text-muted);
  flex-shrink: 0;
}

.list-item-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
  font-size: calc(0.73rem * var(--fc-ui-zoom, 1));
  color: var(--fc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.badge-unread {
  background: #25d366;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  flex-shrink: 0;
}

.badge-blocked {
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.08rem 0.32rem;
  border-radius: 0.28rem;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.badge-noncontact {
  background: #fef3c7;
  color: #b45309;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.08rem 0.32rem;
  border-radius: 0.28rem;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.badge-archived {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.08rem 0.32rem;
  border-radius: 0.28rem;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  background: var(--fc-bg-app);
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition: background 0.25s ease;
}

.chat-header {
  background: var(--fc-bg-header);
  padding: 0.44rem 0.68rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--fc-border);
  flex-shrink: 0;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}

#activeChatActions {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  max-width: 100%;
}

/* Banner Modifikasi Ketika Tidak Saling Tambahkan Kontak */
.non-contact-banner {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  padding: 0.45rem 0.72rem;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.73rem;
  flex-shrink: 0;
  min-width: 0;
}

.mobile-back-btn {
  display: none;
  padding: 0.32rem 0.52rem;
  font-size: 0.76rem;
  width: auto;
  flex-shrink: 0;
}

.chat-messages {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  padding: clamp(0.55rem, 1.8vw, 0.95rem);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 0.38rem;
  width: 100%;
  min-width: 0;
}

.msg-row.outgoing {
  justify-content: flex-end;
}

.msg-row.incoming {
  justify-content: flex-start;
}

.msg-check {
  margin-top: 0.48rem;
  width: 0.92rem;
  height: 0.92rem;
  accent-color: var(--fc-primary-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.msg-bubble {
  width: fit-content;
  max-width: min(82%, 34rem);
  min-width: min(7.5rem, 70%);
  padding: 0.42rem 0.64rem 0.32rem 0.64rem;
  border-radius: 0.46rem;
  box-shadow: 0 1px 1.5px rgba(11, 20, 26, 0.13);
  font-size: calc(0.81rem * var(--fc-ui-zoom, 1));
  line-height: 1.44;
  position: relative;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.msg-row.outgoing .msg-bubble {
  background: var(--fc-outgoing);
  border-top-right-radius: 0;
}

.msg-row.incoming .msg-bubble {
  background: var(--fc-incoming);
  border-top-left-radius: 0;
}

/* ==========================================================
   WHATSAPP SIMPLE CUSTOM AUDIO PLAYER (TANPA AUDIO BAWAAN HTML)
   ========================================================== */
.wa-audio-player {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 128, 105, 0.16);
  border-radius: 0.55rem;
  padding: 0.42rem 0.58rem;
  min-width: min(14.5rem, 68vw);
  max-width: 100%;
  margin-bottom: 0.25rem;
}

.wa-audio-play-btn {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  border: none;
  background: var(--fc-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.82rem;
  box-shadow: 0 2px 5px rgba(0, 168, 132, 0.28);
  transition: transform 0.12s ease, background 0.15s ease;
}

.wa-audio-play-btn:hover {
  background: var(--fc-primary-dark);
}

.wa-audio-body {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.wa-audio-wave-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.wa-audio-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
  outline: none;
  cursor: pointer;
  accent-color: var(--fc-primary-dark);
}

.wa-audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fc-primary-dark);
  cursor: pointer;
}

.wa-audio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.66rem;
  color: var(--fc-text-muted);
}

.wa-audio-speed-btn {
  background: rgba(0, 128, 105, 0.12);
  color: var(--fc-primary-dark);
  border: none;
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
}

.wa-audio-mic-icon {
  color: var(--fc-primary);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.forwarded-label {
  font-size: 0.65rem;
  font-style: italic;
  color: var(--fc-text-muted);
  margin-bottom: 0.18rem;
  display: flex;
  align-items: center;
  gap: 0.22rem;
}

.quoted-box {
  background: rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--fc-primary);
  border-radius: 0.25rem;
  padding: 0.26rem 0.45rem;
  margin-bottom: 0.28rem;
  font-size: 0.71rem;
  cursor: pointer;
  min-width: 0;
}

.quoted-box-sender {
  font-weight: 700;
  color: var(--fc-primary-dark);
  margin-bottom: 0.08rem;
}

.quoted-box-text {
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-media-box {
  margin-bottom: 0.28rem;
  max-width: 100%;
}

.msg-media-box img,
.msg-media-box video {
  max-width: 100%;
  max-height: 13.5rem;
  height: auto;
  border-radius: 0.36rem;
  display: block;
}

.msg-file-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--fc-bubble-out-audio-bg, rgba(15, 23, 42, 0.08));
  border: 1px solid var(--fc-bubble-out-audio-border, rgba(15, 23, 42, 0.14));
  padding: 0.48rem 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--fc-bubble-out-text, var(--fc-text-main));
  word-break: break-all;
}

.msg-row.outgoing .msg-bubble .msg-file-card {
  background: var(--fc-bubble-out-audio-bg, rgba(15, 23, 42, 0.08)) !important;
  border: 1px solid var(--fc-bubble-out-audio-border, rgba(15, 23, 42, 0.16)) !important;
  color: var(--fc-bubble-out-text, #111b21) !important;
}
.msg-row.outgoing .msg-bubble .msg-file-card span,
.msg-row.outgoing .msg-bubble .msg-file-card i,
.msg-row.outgoing .msg-bubble .msg-file-card i.fa-file-arrow-down {
  color: var(--fc-bubble-out-text, #111b21) !important;
}

.msg-row.incoming .msg-bubble .msg-file-card {
  background: var(--fc-bubble-in-audio-bg, rgba(15, 23, 42, 0.08)) !important;
  border: 1px solid var(--fc-bubble-in-audio-border, rgba(15, 23, 42, 0.16)) !important;
  color: var(--fc-bubble-in-text, #111b21) !important;
}
.msg-row.incoming .msg-bubble .msg-file-card span,
.msg-row.incoming .msg-bubble .msg-file-card i,
.msg-row.incoming .msg-bubble .msg-file-card i.fa-file-arrow-down {
  color: var(--fc-bubble-in-text, #111b21) !important;
}

.msg-code-card {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.36rem;
  overflow: hidden;
  margin-bottom: 0.28rem;
  font-size: 0.72rem;
  max-width: 100%;
}

.msg-code-header {
  background: #1e293b;
  padding: 0.26rem 0.52rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: monospace;
}

.msg-code-pre {
  padding: 0.52rem;
  overflow-x: auto;
  font-family: "JetBrains Mono", Consolas, monospace;
  line-height: 1.45;
  white-space: pre;
  max-width: 100%;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.38rem;
  font-size: 0.65rem;
  color: var(--fc-text-muted);
  margin-top: 0.22rem;
}

.msg-action-btn {
  background: none;
  border: none;
  color: var(--fc-text-muted);
  cursor: pointer;
  font-size: 0.67rem;
  padding: 0 0.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
}

.msg-action-btn:hover {
  color: var(--fc-primary-dark);
}

.msg-action-btn.danger:hover {
  color: var(--fc-danger);
}

.tick-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 600;
  font-size: 0.67rem;
  line-height: 1;
}

.tick-read {
  color: var(--fc-blue-tick);
}

.tick-delivered {
  color: #8696a0;
}

.composer-tray {
  background: #f8fafc;
  border-top: 1px solid var(--fc-border);
  padding: 0.38rem 0.7rem;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.42rem;
  font-size: 0.73rem;
  flex-shrink: 0;
  min-width: 0;
}

.composer-tray-body {
  border-left: 3px solid var(--fc-primary);
  padding-left: 0.45rem;
  flex: 1 1 0%;
  min-width: 0;
}

.blocked-banner {
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.52rem 0.75rem;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.42rem;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.chat-composer {
  background: var(--fc-bg-header);
  padding: 0.44rem 0.64rem calc(0.44rem + env(safe-area-inset-bottom, 0px)) 0.64rem;
  display: flex;
  align-items: flex-end;
  gap: 0.36rem;
  border-top: 1px solid var(--fc-border);
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
}

.chat-textarea {
  resize: none;
  min-height: 2.2rem;
  max-height: 6.5rem;
  line-height: 1.4;
  overflow-y: auto;
  flex: 1 1 0%;
  min-width: 0;
  width: auto;
}

.icon-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.42rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: var(--fc-primary-dark);
}

.realtime-dot {
  display: inline-block;
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 0.24rem;
  flex-shrink: 0;
}

.offline-dot {
  display: inline-block;
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: #94a3b8;
  margin-right: 0.24rem;
  flex-shrink: 0;
}

/* Modal Backdrop & Card */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 26, 0.82);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 0.7rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: min(26.5rem, 100%);
  max-height: calc(100dvh - 1.4rem);
  overflow-y: auto;
  border-radius: 0.75rem;
  padding: clamp(0.85rem, 2.5vw, 1.2rem);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  margin: auto;
}

.profile-preview-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 0.62rem;
  padding: 0.75rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.avatar-xl {
  width: 4.3rem;
  height: 4.3rem;
  border-radius: 50%;
  margin: 0 auto 0.48rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--fc-primary);
  overflow: hidden;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.avatar-xl img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.progress-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.progress-bar-fill {
  height: 100%;
  background: #ffffff;
  width: 0%;
  transition: width 0.2s linear;
}

@media (max-width: 740px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
  }

  .app-shell .sidebar {
    display: flex;
    width: 100%;
    height: 100%;
    flex: 1 1 0%;
    border-right: none;
  }

  .app-shell .chat-pane {
    display: none;
    width: 100%;
    height: 100%;
    flex: 1 1 0%;
  }

  .app-shell.mobile-chat-open .sidebar {
    display: none;
  }

  .app-shell.mobile-chat-open .chat-pane {
    display: flex;
  }

  .mobile-back-btn {
    display: inline-flex;
  }

  .msg-bubble {
    max-width: 88%;
  }
}

.action-progress-toast {
  position: fixed;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 250;
  background: #0f172a;
  color: #ffffff;
  width: min(20rem, calc(100vw - 1.3rem));
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 0.52rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.73rem;
  border: 1px solid #334155;
}

.action-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-weight: 600;
}

.action-progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  overflow: hidden;
}

.action-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.18s ease;
}

.action-progress-toast.error .action-progress-bar-fill {
  background: #ef4444;
}

.chat-pagination-banner {
  align-self: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  color: #0f766e;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 1.2rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  max-width: 100%;
  text-align: center;
}

.security-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 0.16rem 0.42rem;
  border-radius: 0.32rem;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}


/* Dropdown Titik Tiga (⋮) Header Profile & Tombol Kirim Hanya Icon */
.header-more-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.header-more-btn {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.header-more-btn:hover,
.header-more-btn.active {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}
.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.38rem);
  right: 0;
  min-width: 12.8rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  padding: 0.32rem;
  z-index: 80;
  display: none;
  flex-direction: column;
  gap: 0.12rem;
}
.header-dropdown-menu.open {
  display: flex;
  animation: fcDropdownFade 0.14s ease-out;
}
@keyframes fcDropdownFade {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.header-dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.48rem 0.65rem;
  border-radius: 0.42rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.header-dropdown-item i {
  width: 1.05rem;
  text-align: center;
  color: #475569;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.header-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.header-dropdown-item.danger {
  color: #dc2626;
}
.header-dropdown-item.danger i {
  color: #dc2626;
}
.header-dropdown-item.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}
.header-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.2rem 0.25rem;
}
.send-icon-btn {
  width: 2.35rem !important;
  height: 2.35rem !important;
  min-width: 2.35rem !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  font-size: 0.88rem !important;
  box-shadow: 0 2px 6px rgba(0, 168, 132, 0.28);
}
.chat-header, .conv-header, .sidebar-header, .sidebar-user-bar {
  position: relative;
  z-index: 35;
  flex-wrap: nowrap !important;
}
.chat-pane, .conversation-pane, .sidebar {
  position: relative;
}


/* Full-Screen WhatsApp Status Creator & Story Viewer (Geser/Tap Kanan-Kiri Tanpa Tombol) */
.wa-fullscreen-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #0b141a;
  z-index: 95;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.wa-status-creator- fullscreen,
.wa-story-viewer-fullscreen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.75rem, 2.2vw, 1.35rem);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}
.story-segments-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  margin-bottom: 0.65rem;
  z-index: 5;
}
.story-segment-track {
  flex: 1 1 0%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  overflow: hidden;
}
.story-segment-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 999px;
  transition: width 0.15s linear;
}
.story-gesture-stage {
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  padding: 0.5rem;
}
.story-Creator-textarea {
  width: 100%;
  max-width: 38rem;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: clamp(1.35rem, 3.8vw, 2.15rem) !important;
  font-weight: 700 !important;
  text-align: center;
  resize: none;
  line-height: 1.4;
}
.story-Creator-textarea::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}
.status-count-pill {
  background: #dcfce7;
  color: #065f46;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}
.status-ttl-pill {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.06rem 0.35rem;
  border-radius: 0.28rem;
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
}
/* Tombol Voice Note Hold-to-Record */
.icon-btn.recording-active {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.22);
  animation: fcRecPulse 1s infinite ease-in-out;
}
@keyframes fcRecPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.36); }
}
.rec-live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 0.3rem;
  animation: fcRecDotBlink 0.8s infinite alternate;
}
@keyframes fcRecDotBlink {
  from { opacity: 1; }
  to { opacity: 0.25; }
}


/* Pin Chat Pill, Clock Tick Icon, Date Divider (Kemarin / Hari Ini), Responsive Media Bubble & Fullscreen Media Lightbox */
.pinned-pill {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}
.pin-quick-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.18rem 0.3rem;
  border-radius: 0.3rem;
  font-size: 0.72rem;
  transition: color 0.15s ease, background 0.15s ease;
}
.pin-quick-btn:hover,
.pin-quick-btn.pinned {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
}
.tick-sending {
  color: #d97706;
  font-weight: 600;
}
.chat-date-divider {
  align-self: center;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2.5px rgba(15, 23, 42, 0.08);
  padding: 0.24rem 0.75rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  margin: 0.45rem auto 0.25rem auto;
  text-align: center;
  letter-spacing: 0.01em;
  z-index: 2;
}
.bubble.has-media-bubble {
  width: fit-content;
  max-width: min(21rem, 76vw);
  min-width: min(12rem, 62vw);
  padding: 0.35rem 0.42rem 0.3rem 0.42rem;
}
.msg-media-box {
  margin: 0 auto 0.32rem auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 0.42rem;
  overflow: hidden;
  position: relative;
}
.msg-media-box img,
.msg-media-box video {
  width: 100%;
  max-width: min(20rem, 72vw);
  max-height: 15.5rem;
  height: auto;
  object-fit: cover;
  border-radius: 0.38rem;
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
  transition: transform 0.15s ease;
}
.msg-media-box img:hover,
.msg-media-box video:hover {
  transform: scale(1.01);
}
.media-preview-hint-badge {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  background: rgba(15, 23, 42, 0.68);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}
.wa-media-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(11, 20, 26, 0.96);
  z-index: 98;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  color: #ffffff;
}
.wa-media-lightbox-stage {
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.5rem;
}
.wa-media-lightbox-stage img,
.wa-media-lightbox-stage video {
  max-width: 94vw;
  max-height: 80dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
}


/* Responsive WhatsApp-Style Status Viewers Pill & Scrollable Sheet (Ada Profil, Nama & Tidak Overload) */
.story-viewers-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  z-index: 25;
}
.story-viewers-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  padding: 0.36rem 0.82rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  max-width: min(92vw, 25rem);
  transition: background 0.15s ease, transform 0.12s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.story-viewers-pill:hover {
  background: rgba(15, 23, 42, 0.78);
}
.story-viewers-avatar-stack {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.story-viewer-mini-av {
  width: 1.38rem;
  height: 1.38rem;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  background: #00a884;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-left: -0.35rem;
  flex-shrink: 0;
}
.story-viewer-mini-av:first-child {
  margin-left: 0;
}
.story-viewer-mini-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-viewers-pill-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14.5rem;
}
.story-viewers-sheet {
  display: none;
  flex-direction: column;
  width: min(92vw, 24.5rem);
  max-height: min(42dvh, 16.5rem);
  background: #ffffff;
  color: #0f172a;
  border-radius: 0.85rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid #e2e8f0;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-align: left;
  animation: fcDropdownFade 0.16s ease-out;
}
.story-viewers-sheet.open {
  display: flex;
}
.story-viewers-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  background: #f0f2f5;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  flex-shrink: 0;
}
.story-viewers-sheet-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.3rem 0;
  -webkit-overflow-scrolling: touch;
}
.story-viewer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.8rem;
  border-bottom: 1px solid #f1f5f9;
  min-width: 0;
}
.story-viewer-row:last-child {
  border-bottom: none;
}
.story-viewer-row-av {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 50%;
  background: #00a884;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.story-viewer-row-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-viewer-row-body {
  flex: 1 1 0%;
  min-width: 0;
}
.story-viewer-row-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-viewer-row-sub {
  font-size: 0.66rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-viewer-row-time {
  font-size: 0.65rem;
  color: #008069;
  font-weight: 600;
  flex-shrink: 0;
}

/* Tombol Refresh Halaman (Pengganti Tulisan AES-256) dengan Animasi Loading */
.header-refresh-btn {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #008069;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.18s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.header-refresh-btn:hover {
  background: #ecfdf5;
  border-color: #00a884;
  color: #006854;
  transform: rotate(25deg);
}
.header-refresh-btn.is-refreshing {
  background: #008069 !important;
  border-color: #008069 !important;
  color: #ffffff !important;
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.24);
}
.page-refresh-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 220;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.page-refresh-loading-overlay.active {
  display: flex;
}
.page-refresh-loading-card {
  background: #ffffff;
  color: #0f172a;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
}

/* Full WhatsApp-Style Profile Photo Preview (di Kartu Profil & Fullscreen Image Lightbox) */
.avatar-xl.wa-profile-full-box {
  width: 100% !important;
  max-width: 21rem !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 0.85rem !important;
  margin: 0 auto 0.75rem auto !important;
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  font-size: 4.5rem !important;
}
.avatar-xl.wa-profile-full-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  transition: transform 0.2s ease;
}
.avatar-xl.wa-profile-full-box:hover img {
  transform: scale(1.02);
}
.wa-profile-zoom-badge {
  position: absolute;
  bottom: 0.55rem;
  right: 0.55rem;
  background: rgba(11, 20, 26, 0.76);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.wa-media-lightbox-stage img.wa-fullscreen-profile-photo,
.wa-media-lightbox-stage img {
  width: min(92vw, 78dvh) !important;
  height: min(92vw, 78dvh) !important;
  max-width: 94vw !important;
  max-height: 82dvh !important;
  object-fit: contain !important;
  border-radius: 0.6rem;
}

/* Popup Notifikasi Pesan Masuk ala WhatsApp (Support Android & iPhone + Foto Profil + Tombol Izin) */
.wa-incoming-popup-banner {
  display: none;
  position: fixed;
  top: max(0.65rem, env(safe-area-inset-top, 0.65rem));
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 26.5rem);
  background: rgba(17, 27, 33, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.95rem;
  padding: 0.68rem 0.82rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  z-index: 210;
  flex-direction: column;
  gap: 0.45rem;
  animation: waPopupSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.wa-incoming-popup-banner.show {
  display: flex;
}
@keyframes waPopupSlideDown {
  from { opacity: 0; transform: translate(-50%, -18px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.wa-incoming-popup-main {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  cursor: pointer;
  min-width: 0;
}
.wa-incoming-popup-av {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #00a884;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #25d366;
}
.wa-incoming-popup-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wa-incoming-popup-body {
  flex: 1 1 0%;
  min-width: 0;
}
.wa-incoming-popup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.12rem;
}
.wa-incoming-popup-sender {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-incoming-popup-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.16);
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.wa-incoming-popup-text {
  font-size: 0.75rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-incoming-popup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.38rem;
}
.pwa-notif-perm-bar {
  background: #ecfdf5;
  border-bottom: 1px solid #a7f3d0;
  color: #065f46;
  padding: 0.36rem 0.65rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.pwa-notif-perm-bar.show {
  display: flex;
}


/* Centang Biru Resmi (Official Verified Badge) & Tombol Interaktif ala WhatsApp Business */
.fc-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #1d9bf0;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(29, 155, 240, 0.38);
  line-height: 1;
}
.fc-official-bot-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
}
.wa-biz-buttons-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}
.wa-biz-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.24);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}
.wa-biz-btn:hover {
  background: #e0f2fe;
  color: #0369a1;
}


/* ==========================================================
   MODIFIKASI STYLING BAGIAN KETIK PESAN (COMPOSER)
   (Tanpa tanda + & tanpa ikon emoji, serta Tombol Voice Note
    dan Tombol Kirim dipisah berdampingan secara permanen)
   ========================================================== */
.chat-composer,
.conv-composer {
  position: sticky;
  bottom: 0;
  z-index: 25;
  background: #f0f2f5 !important;
  padding: 0.45rem 0.65rem calc(0.45rem + env(safe-area-inset-bottom, 0px)) 0.65rem !important;
  display: flex;
  align-items: flex-end !important;
  gap: 0.45rem !important;
  border-top: 1px solid rgba(134, 150, 160, 0.2) !important;
  width: 100%;
  min-width: 0;
}

.wa-composer-pill {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  background: #ffffff !important;
  border: 1px solid rgba(134, 150, 160, 0.28) !important;
  border-radius: 1.55rem !important;
  padding: 0.22rem 0.55rem 0.22rem 0.85rem !important;
  min-height: 2.75rem;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.06) !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.wa-composer-pill:focus-within {
  border-color: rgba(0, 168, 132, 0.55) !important;
  box-shadow: 0 1px 4px rgba(0, 168, 132, 0.16) !important;
}

.wa-pill-icon-btn {
  width: 2.15rem !important;
  height: 2.15rem !important;
  min-width: 2.15rem !important;
  border: none !important;
  background: transparent !important;
  color: #54656f !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  font-size: 1.02rem !important;
  padding: 0 !important;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.wa-pill-icon-btn:hover,
.wa-pill-icon-btn.active {
  background: rgba(84, 101, 111, 0.1) !important;
  color: #008069 !important;
}

.wa-pill-icon-btn.paperclip-tilt svg,
.wa-pill-icon-btn.paperclip-tilt i {
  transform: rotate(-45deg);
}

.wa-pill-right-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  flex-shrink: 0;
  margin-bottom: 0.04rem;
}

.wa-composer-pill .chat-textarea {
  flex: 1 1 0%;
  min-width: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #111b21 !important;
  font-size: 0.92rem !important;
  line-height: 1.4 !important;
  padding: 0.36rem 0.25rem !important;
  min-height: 2.05rem !important;
  max-height: 7.2rem !important;
  resize: none !important;
  overflow-y: auto;
  scrollbar-width: thin;
}

.wa-composer-pill .chat-textarea::placeholder {
  color: #8696a0 !important;
  font-weight: 400;
}

/* Tombol Voice Note & Tombol Kirim Dipisah Berdampingan Secara Permanen */
.wa-voice-circle-btn,
#canvasSendVoiceNoteBtn,
#sendVoiceNoteBtn {
  width: 2.75rem !important;
  height: 2.75rem !important;
  min-width: 2.75rem !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1.5px solid #00a884 !important;
  background: #ffffff !important;
  color: #008069 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  font-size: 1.02rem !important;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08) !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
}

.wa-voice-circle-btn:hover,
#canvasSendVoiceNoteBtn:hover,
#sendVoiceNoteBtn:hover {
  background: #ecfdf5 !important;
  border-color: #008069 !important;
  color: #006854 !important;
  transform: scale(1.04);
}

#canvasSendVoiceNoteBtn i,
#canvasSendVoiceNoteBtn svg,
#sendVoiceNoteBtn i,
#sendVoiceNoteBtn svg {
  color: #008069 !important;
  fill: #008069 !important;
}

#canvasSendVoiceNoteBtn.recording-active,
#sendVoiceNoteBtn.recording-active {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

#canvasSendVoiceNoteBtn.recording-active i,
#canvasSendVoiceNoteBtn.recording-active svg,
#sendVoiceNoteBtn.recording-active i,
#sendVoiceNoteBtn.recording-active svg {
  color: #dc2626 !important;
  fill: #dc2626 !important;
}

.wa-send-circle-btn,
.send-icon-btn {
  width: 2.75rem !important;
  height: 2.75rem !important;
  min-width: 2.75rem !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: none !important;
  background: #00a884 !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  font-size: 1.02rem !important;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 168, 132, 0.35) !important;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
}

.wa-send-circle-btn:hover,
.send-icon-btn:hover {
  background: #008069 !important;
  transform: scale(1.04);
}

.wa-send-circle-btn:active,
.send-icon-btn:active,
.wa-voice-circle-btn:active,
#canvasSendVoiceNoteBtn:active,
#sendVoiceNoteBtn:active {
  transform: scale(0.95);
}

.send-icon-btn i,
.send-icon-btn svg {
  color: #ffffff !important;
  fill: #ffffff !important;
}


/* ==========================================================================
   PERBAIKAN PWA ANDROID & IPHONE (IOS) VIEWPORT ANTI-TERPOTONG +
   LOCK SEMUA ZOOM (100% FIXED) + DISABLE (+) +
   DISABLE COPY-PASTE SELAIN DI DALAM CHAT
   ========================================================================== */
:root {
  --fc-ui-zoom: 1;
  --fc-vvh: 100dvh;
  --fc-vvo: 0px;
}

html {
  font-size: 16px !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: var(--fc-vvh, 100dvh) !important;
  max-height: var(--fc-vvh, 100dvh) !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  touch-action: pan-x pan-y !important;
}

body {
  position: fixed !important;
  top: var(--fc-vvo, 0px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--fc-vvh, 100dvh) !important;
  max-height: var(--fc-vvh, 100dvh) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  display: flex !important;
  flex-direction: column !important;
  font-size: 0.84rem !important;
  touch-action: pan-x pan-y !important;
}

/* Matikan seluruh seleksi teks & copy-paste di luar ruang chat */
*, *::before, *::after {
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
}

/* Izinkan seleksi teks & copy-paste HANYA di dalam area chat aktif */
.chat-pane .msg-text-content,
.chat-pane .msg-code-pre,
.chat-pane .msg-code-pre code,
.chat-pane #messageInput,
.chat-pane #searchMessagesInChatInput,
#codeSnippetModal #codeSnippetInput,
#codeSnippetModal #codeCaptionInput,
.conversation-pane .msg-text-content,
.conversation-pane .msg-code-pre,
.conversation-pane .msg-code-pre code,
.conversation-pane #msgContentInput,
.conversation-pane #canvasSearchConvMessagesInput,
#codeSnippetModal #codeSnippetTextarea,
#codeSnippetModal #codeSnippetCaption {
  user-select: text !important;
  -webkit-user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* Pastikan kontainer utama chat menyusut proporsional mengikuti visualViewport */
.top-bar {
  padding-top: max(0.36rem, env(safe-area-inset-top, 0px)) !important;
  flex-shrink: 0 !important;
}

.view-section.active {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.app-shell,
.chat-workspace {
  flex: 1 1 0% !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.sidebar,
.chat-pane,
.conversation-pane {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column !important;
}

.sidebar-header,
.sidebar-user-bar,
.chat-header,
.conv-header {
  padding-top: max(0.45rem, env(safe-area-inset-top, 0px)) !important;
  flex-shrink: 0 !important;
}

.top-bar ~ .view-section .sidebar-user-bar,
.top-bar ~ .view-section .conv-header {
  padding-top: 0.45rem !important;
}

.chat-messages,
.conv-messages {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  padding-bottom: 0.65rem !important;
}

.composer-tray,
.blocked-banner,
.non-contact-banner,
.wa-sticker-picker-tray {
  flex-shrink: 0 !important;
}

.chat-composer,
.conv-composer {
  position: relative !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  flex-shrink: 0 !important;
  width: 100% !important;
  padding: 0.42rem 0.6rem calc(0.45rem + env(safe-area-inset-bottom, 0px)) 0.6rem !important;
  background: #f0f2f5 !important;
  border-top: 1px solid rgba(134, 150, 160, 0.22) !important;
  z-index: 30 !important;
}

.pagination-bar {
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px)) !important;
  flex-shrink: 0 !important;
}

/* Sembunyikan semua elemen tanda + & kontrol zoom yang dinonaktifkan */
.wa-dropup-wrap,
#attachDropupBtn,
#attachDropupMenu,
#canvasAttachDropupBtn,
#canvasAttachDropupMenu,
.status-plus-badge {
  display: none !important;
}

/* ============================================================================
   PERBAIKAN TAMPILAN MOBILE / ANDROID AGAR TIDAK SPLIT SCREEN (1 LAYAR PENUH)
   Saat di daftar chat: hanya .sidebar yang tampil 100%.
   Saat kontak dipilih (.mobile-chat-open): .sidebar disembunyikan & .chat-pane
   tampil 100% layar penuh beserta tombol Kembali (←).
   ============================================================================ */
@media (max-width: 768px) {
  .app-shell,
  .chat-workspace {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
  }

  .app-shell .sidebar,
  .chat-workspace .sidebar {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 0% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    border-right: none !important;
  }

  .app-shell .chat-pane,
  .chat-workspace .conversation-pane {
    display: none !important;
    width: 100% !important;
    flex: 1 1 0% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
  }

  .app-shell.mobile-chat-open .sidebar,
  .chat-workspace.mobile-chat-open .sidebar {
    display: none !important;
  }

  .app-shell.mobile-chat-open .chat-pane,
  .chat-workspace.mobile-chat-open .conversation-pane {
    display: flex !important;
  }

  .mobile-back-btn {
    display: inline-flex !important;
  }
}

/* ============================================================================
   INDIKATOR LOADING LOGIN SEDERHANA & RINGKAS (TIDAK BERLEBIHAN)
   ============================================================================ */
@keyframes fcSpinSimple {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-loading-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #065f46;
  font-size: 12.5px;
  font-weight: 600;
}

.auth-loading-banner.active {
  display: flex;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn-inline-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  animation: fcSpinSimple 0.75s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

.auth-inline-spinner-teal {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(0, 128, 105, 0.25);
  border-top-color: #008069;
  border-radius: 50%;
  display: inline-block;
  animation: fcSpinSimple 0.75s linear infinite;
  flex-shrink: 0;
}


/* ============================================================================
   MINIMALIST CHAT DESIGN & GESTURE INTERACTIONS
   - Hold contact row -> Contact options menu
   - Swipe message left/right -> Reply
   - Hold message bubble -> Select message for deletion
   ============================================================================ */
.sidebar-header,
.sidebar-user-bar,
.chat-header,
.conv-header {
  background: #ffffff !important;
  border-bottom: 1px solid #eef2f6 !important;
  box-shadow: none !important;
}

.nav-tabs,
.sub-tabs {
  background: #ffffff !important;
  border-bottom: 1px solid #eef2f6 !important;
}

.nav-tab,
.sub-tab-btn {
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

.list-item,
.row-item {
  border-bottom: 1px solid #f4f6f8 !important;
  transition: background-color 0.15s ease !important;
  position: relative;
}

.list-item:active,
.row-item:active,
.list-item.lp-pressing,
.row-item.lp-pressing {
  background-color: #e9eef2 !important;
}

/* Minimalist Message Rows & Bubbles */
.msg-row,
.bubble-row {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 2px 6px !important;
  border-radius: 10px !important;
  transition: background-color 0.16s ease !important;
  touch-action: pan-y !important;
}

.msg-row.is-selected,
.bubble-row.is-selected {
  background-color: rgba(0, 168, 132, 0.13) !important;
}

/* Hide checkboxes by default for a clean minimalist look; show only in selection mode */
.msg-check,
.msg-select-cb {
  display: none !important;
  width: 17px !important;
  height: 17px !important;
  accent-color: #008069 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  margin: 0 2px !important;
}

.selection-mode-active .msg-check,
.selection-mode-active .msg-select-cb {
  display: inline-block !important;
}

/* Hide cluttered inline action buttons inside message bubbles */
.msg-action-btn,
.reply-btn-inline {
  display: none !important;
}

.msg-bubble,
.bubble {
  position: relative !important;
  border-radius: 14px !important;
  padding: 7px 11px 5px 11px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.15s ease !important;
  will-change: transform;
  cursor: pointer;
}

.msg-row.outgoing .msg-bubble,
.bubble-row.mine .bubble {
  border-top-right-radius: 4px !important;
}

.msg-row.incoming .msg-bubble,
.bubble-row.theirs .bubble {
  border-top-left-radius: 4px !important;
}

.msg-row.is-selected .msg-bubble,
.bubble-row.is-selected .bubble {
  outline: 1.5px solid #00a884 !important;
}

.msg-meta,
.bubble-meta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  float: right !important;
  margin-left: 8px !important;
  margin-top: 2px !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
  opacity: 0.78 !important;
}

/* Swipe-to-Reply Indicator Pill */
.swipe-reply-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.5);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, background-color 0.12s ease;
  z-index: 4;
}

.msg-row.incoming .swipe-reply-indicator,
.bubble-row.theirs .swipe-reply-indicator {
  left: 8px;
}

.msg-row.outgoing .swipe-reply-indicator,
.bubble-row.mine .swipe-reply-indicator {
  right: 8px;
}

.swipe-reply-indicator.ready {
  background: #00a884;
  transform: translateY(-50%) scale(1.06);
}

/* Minimalist Gesture Hint Pill */
.chat-gesture-hint-pill {
  align-self: center;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(4px);
  color: #64748b;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 4px;
  text-align: center;
  border: 1px solid rgba(203, 213, 225, 0.55);
}

/* Contact Long-Press Options Sheet */
.wa-contact-context-sheet {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 16px;
}

.wa-contact-context-sheet.open {
  display: flex;
}

.wa-contact-context-card {
  background: #ffffff;
  width: 100%;
  max-width: 340px;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.wa-contact-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f6;
}

.wa-contact-context-actions {
  display: flex;
  flex-direction: column;
  padding: 6px;
}

.wa-contact-context-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.wa-contact-context-btn:hover,
.wa-contact-context-btn:active {
  background: #f1f5f9;
}

.wa-contact-context-btn.danger {
  color: #dc2626;
}

.wa-contact-context-btn.danger:hover {
  background: #fef2f2;
}



/* ==========================================================================
   UPGRADE: HOLD-TO-SELECT ANTI-BOUNCE, SCROLL PAGINATION, BROKEN IMAGE CARD
   ========================================================================== */
.msg-row,
.msg-bubble,
.msg-text-content,
.bubble-row,
.bubble {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.msg-row.is-selected .msg-bubble,
.bubble-row.is-selected .bubble {
  outline: 2px solid #00a884 !important;
  box-shadow: 0 2px 10px rgba(0, 168, 132, 0.22) !important;
}

#selectionTray,
#bulkActionBar {
  position: sticky !important;
  top: 0 !important;
  z-index: 65 !important;
  background: #f0fdf4 !important;
  border-bottom: 1.5px solid #86efac !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

/* Hide legacy manual Prev/Next pagination bars in sidebar lists */
#chatListPaginationBar,
#myContactsPaginationBar,
#directoryPaginationBar,
#statusPaginationBar,
#canvasChatsPaginationBar,
#canvasDirPaginationBar,
#subtab-status .pagination-bar,
#subtab-contacts .pagination-bar {
  display: none !important;
}

/* Scrollable contact/status list containers */
#chatListContainer,
#chatItemsList {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

#contactsListContainer,
#savedContactsList {
  max-height: 46dvh;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

#directoryListContainer,
#directoryUsersList {
  max-height: 36dvh;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

#statusListContainer,
#statusItemsList {
  max-height: 58dvh;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.scroll-pagination-sentinel {
  padding: 10px 12px;
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}

.scroll-pagination-sentinel.is-complete {
  color: #94a3b8;
  font-size: 11px;
  padding: 8px 12px;
}

/* Broken Image Visible Fallback Styling (Icon-Only, No Text) */
.msg-media-box.has-broken-image {
  min-width: 130px !important;
  min-height: 96px !important;
  background: rgba(148, 163, 184, 0.12) !important;
  border: 1.5px dashed rgba(148, 163, 184, 0.45) !important;
  border-radius: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px !important;
  position: relative !important;
  overflow: hidden !important;
}

img.is-broken-image {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 120px !important;
  height: 90px !important;
  min-width: 120px !important;
  min-height: 90px !important;
  max-width: 100% !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  background: transparent !important;
}

.msg-sticker-img.is-broken-image {
  min-width: 120px !important;
  min-height: 120px !important;
  width: 120px !important;
  height: 120px !important;
  border: 1.5px dashed #cbd5e1 !important;
  padding: 6px !important;
}

.broken-img-status-pill {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 2px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.avatar img.is-broken-avatar,
.story-viewer-mini-av img.is-broken-avatar,
.story-viewer-row-av img.is-broken-avatar {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}


/* Dynamic UI & Text Scale support */
.ui-scale-preset-btn.active {
  background: #00a884 !important;
  color: #ffffff !important;
  border-color: #00a884 !important;
}
.chat-pane .msg-bubble,
.conversation-pane .bubble {
  font-size: calc(0.84rem * var(--fc-ui-zoom, 1)) !important;
}
.list-item-title,
.row-title {
  font-size: calc(0.84rem * var(--fc-ui-zoom, 1)) !important;
}
.list-item-sub,
.row-sub {
  font-size: calc(0.75rem * var(--fc-ui-zoom, 1)) !important;
}


/* ==========================================================================
   STICKER TRAY, KEYBOARD STICKER BUBBLES & REALTIME TYPING INDICATOR
   ========================================================================== */
.wa-sticker-picker-tray {
  display: none;
  flex-direction: column;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  max-height: 225px;
  flex-shrink: 0;
  z-index: 32;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.06);
}
.wa-sticker-picker-tray.open {
  display: flex;
}
.wa-sticker-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.wa-sticker-search-row input {
  flex: 1 1 0%;
  min-width: 0;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 12px;
  outline: none;
  background: #ffffff;
}
.wa-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  padding: 8px 10px;
  overflow-y: auto;
  max-height: 170px;
}
.wa-sticker-item {
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  border-radius: 10px;
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  transition: transform 0.14s ease, background 0.14s ease;
}
.wa-sticker-item:hover {
  transform: scale(1.06);
  background: #ecfdf5;
  border-color: #86efac;
}
.wa-sticker-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.msg-sticker-img {
  width: 122px !important;
  height: 122px !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: 8px;
  display: block;
}
.msg-bubble.has-sticker-bubble,
.bubble.has-sticker-bubble {
  background: transparent !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
}
.msg-bubble.has-sticker-bubble .msg-meta,
.bubble.has-sticker-bubble .meta {
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff !important;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-flex;
  margin-top: 2px;
}

/* Realtime Typing Indicator Styles */
.wa-header-typing {
  color: #00a884 !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wa-sidebar-typing {
  color: #00a884 !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wa-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.wa-typing-dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #00a884;
  animation: waTypingBounce 1.2s infinite ease-in-out;
}
.wa-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.wa-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes waTypingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.wa-chat-typing-bubble-row {
  display: flex;
  align-items: center;
  margin: 4px 0;
  animation: fadeIn 0.18s ease;
}
.wa-chat-typing-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px 14px 14px 4px;
  padding: 7px 12px;
  font-size: 12px;
  color: #0f766e;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}


/* ==========================================================================
   MODERN MINIMALIST LOGIN & REGISTER UI + GROUP CHAT BADGES & MODALS
   ========================================================================== */
.auth-wrapper {
  background: radial-gradient(circle at 50% 0%, #e0f2fe 0%, #f8fafc 48%, #f1f5f9 100%) !important;
  min-height: 100dvh !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 20px 16px !important;
}

.auth-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  padding: 7px 16px 7px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
  margin-bottom: 16px !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  letter-spacing: -0.02em !important;
}

.auth-brand i,
.auth-brand svg {
  background: linear-gradient(135deg, #00a884 0%, #008069 100%);
  color: #ffffff !important;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.auth-card {
  width: 100% !important;
  max-width: 410px !important;
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  border-radius: 20px !important;
  padding: 28px 26px !important;
  box-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.03) !important;
}

.auth-card h1,
.auth-card h2 {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.025em !important;
  margin-bottom: 6px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-card p.subtitle,
.auth-card p.desc {
  font-size: 13px !important;
  color: #64748b !important;
  margin-bottom: 20px !important;
  line-height: 1.5 !important;
}

.auth-card .form-group {
  margin-bottom: 14px !important;
}

.auth-card .form-group label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 5px !important;
  letter-spacing: -0.01em;
}

.auth-card .form-control,
.auth-card .form-input {
  height: 42px !important;
  padding: 0 13px !important;
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 11px !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
  transition: all 0.16s ease !important;
}

.auth-card .form-control:focus,
.auth-card .form-input:focus {
  background: #ffffff !important;
  border-color: #00a884 !important;
  box-shadow: 0 0 0 3.5px rgba(0, 168, 132, 0.12) !important;
}

.auth-card .btn-primary {
  height: 44px !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, #00a884 0%, #008069 100%) !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  box-shadow: 0 6px 16px -4px rgba(0, 128, 105, 0.35) !important;
  margin-top: 4px !important;
  transition: transform 0.12s ease, box-shadow 0.15s ease !important;
}

.auth-card .btn-primary:active {
  transform: scale(0.99);
}

.auth-footer {
  margin-top: 18px !important;
  padding-top: 14px !important;
  border-top: 1px solid #f1f5f9 !important;
  text-align: center !important;
  font-size: 12.5px !important;
  color: #64748b !important;
}

.auth-footer a {
  color: #008069 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

/* Hide removed Code Snippet buttons and modals */
#openCodeModalBtn,
#openCodeSnippetModalBtn,
#codeSnippetModal {
  display: none !important;
}

/* Group Chat Badges, Sender Name Header & Group Management Modal */
.badge-group,
.group-pill {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.group-sender-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #0284c7;
  margin-bottom: 3px;
  display: block;
}

.group-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.group-member-row:last-child {
  border-bottom: none;
}

.group-role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}

.group-role-badge.member {
  background: #f1f5f9;
  color: #475569;
}


/* ==========================================================================
   FIX: RESPONSIVE REGISTER / LOGIN (NO CUTOFF ON ANDROID, IPHONE, DESKTOP)
   + GROUP DELETE ALERT TOAST BANNER
   ========================================================================== */
.auth-wrapper {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: var(--fc-vvh, 100dvh) !important;
  max-height: var(--fc-vvh, 100dvh) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 18px 14px calc(36px + env(safe-area-inset-bottom, 0px)) 14px !important;
}

.auth-brand {
  margin-top: auto !important;
  margin-bottom: 12px !important;
  flex-shrink: 0 !important;
}

.auth-card {
  width: 100% !important;
  max-width: 440px !important;
  margin: 0 auto auto auto !important;
  flex-shrink: 0 !important;
  padding: clamp(18px, 3vw, 26px) !important;
  border-radius: 18px !important;
}

.auth-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .auth-grid-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .auth-wrapper {
    padding: 12px 10px calc(28px + env(safe-area-inset-bottom, 0px)) 10px !important;
  }
  .auth-card {
    padding: 16px 15px !important;
    border-radius: 15px !important;
  }
  .auth-card h1,
  .auth-card h2 {
    font-size: 18px !important;
  }
  .auth-card p.subtitle,
  .auth-card p.desc {
    margin-bottom: 12px !important;
    font-size: 12px !important;
  }
  .auth-card .form-group {
    margin-bottom: 10px !important;
  }
  .auth-card .form-control,
  .auth-card .form-input {
    height: 39px !important;
    font-size: 13px !important;
  }
}

/* Floating Alert Notification Banner (e.g. Group Deleted Alert) */
.fc-top-alert-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  animation: fadeIn 0.2s ease;
}


/* ==========================================================================
   FIX: CONFIRMATION MODAL Z-INDEX ALWAYS ABOVE GROUP PROFILE & SECURITY MODAL
   ========================================================================== */
#confirmActionModal,
#canvasConfirmModal {
  z-index: 10050 !important;
}

#deleteMessageModal,
#shareMessageModal,
#deleteMsgModal,
#shareMsgModal,
#waMediaLightboxModal,
#canvasMediaLightboxModal {
  z-index: 9980 !important;
}


/* ==========================================================================
   INSTAGRAM-STYLE PROFILE LAYOUT (EMERALD/TEAL THEME), 3-COLUMN WEBP POST GRID,
   POST DETAIL MODAL WITH LIKE BUTTON & ANIMATED GIF / STICKER BUBBLES
   ========================================================================== */
.ig-profile-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 10px 25px -12px rgba(15, 23, 42, 0.06);
}

.ig-header-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.ig-avatar-ring {
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884 0%, #008069 50%, #34d399 100%);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ig-avatar-inner {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: #008069;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ig-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-stats-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  text-align: center;
  gap: 6px;
}

.ig-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ig-stat-num {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.ig-stat-label {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
}

.ig-bio-section {
  text-align: left;
  margin-bottom: 14px;
}

.ig-bio-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ig-bio-handle {
  font-size: 12px;
  color: #008069;
  font-weight: 600;
  margin-bottom: 5px;
}

.ig-bio-text {
  font-size: 13px;
  color: #334155;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
}

.ig-actions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ig-actions-row .btn {
  flex: 1;
  min-width: 120px;
  height: 36px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
}

.ig-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 0;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: #008069;
  letter-spacing: 0.06em;
  gap: 6px;
}

.ig-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
}

.ig-post-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e2e8f0;
}

.ig-post-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.ig-post-tile:hover img {
  transform: scale(1.05);
}

.ig-post-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.65) 0%, rgba(15, 23, 42, 0) 55%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 6px 8px;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  gap: 4px;
}

.ig-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.ig-like-btn.liked {
  background: #fef2f2;
  border-color: #fecaca;
  color: #e11d48;
}

.ig-like-btn.liked i,
.ig-like-btn.liked svg {
  color: #e11d48 !important;
  transform: scale(1.12);
}

/* Animated GIF & Expressive Sticker Bubbles */
.msg-gif-box {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  max-width: 240px;
  background: #0f172a;
}

.msg-gif-img {
  width: 100%;
  max-width: 240px;
  max-height: 220px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

.gif-corner-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.sticker-cat-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  overflow-x: auto;
}

.sticker-cat-pill {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.sticker-cat-pill.active {
  background: #00a884;
  color: #ffffff;
  border-color: #00a884;
}


/* Allow clipboard copy & input selection */
input,
textarea,
[contenteditable="true"],
.allow-clipboard-copy,
#myShareLinkLabel,
#previewShareLinkText,
#sharedLinkText,
#sharePageVerifiedUrl {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}


/* ==========================================================================
   DIRECT CLICKABLE LINKS IN CHAT, GROUP READ RECEIPTS, SUGGESTED FRIENDS (IG),
   AND WHATSAPP STATUS MEDIA STUDIO (IMAGE/VIDEO EDITOR + TEXT OVERLAY)
   ========================================================================== */
.chat-inline-link {
  color: #0284c7 !important;
  text-decoration: underline !important;
  word-break: break-all;
  cursor: pointer !important;
  pointer-events: auto !important;
  font-weight: 600;
  position: relative;
  z-index: 5;
}
.chat-inline-link:hover {
  color: #0369a1 !important;
  background: rgba(2, 132, 199, 0.08);
  border-radius: 4px;
}

.group-read-by-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 168, 132, 0.12);
  color: #0f766e;
  border: 1px solid rgba(0, 168, 132, 0.28);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer !important;
  pointer-events: auto !important;
  margin-left: 4px;
  transition: background 0.15s ease;
}
.group-read-by-pill:hover {
  background: rgba(0, 168, 132, 0.22);
}

/* Instagram-Style Suggested Friends Carousel */
.ig-suggestions-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}
.ig-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ig-suggestions-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.ig-suggestion-card {
  flex: 0 0 138px;
  scroll-snap-align: start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ig-suggestion-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}
.ig-suggestion-dismiss {
  position: absolute;
  top: 5px;
  right: 6px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
}
.ig-suggestion-dismiss:hover {
  color: #475569;
}
.ig-suggestion-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #00a884 0%, #059669 55%, #10b981 100%);
  cursor: pointer;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.ig-suggestion-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
}
.ig-suggestion-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-suggestion-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  max-width: 118px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.ig-suggestion-handle {
  font-size: 10.5px;
  color: #64748b;
  max-width: 118px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.ig-suggestion-tag {
  font-size: 9.5px;
  color: #0f766e;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 1px 6px;
  margin-bottom: 7px;
}

/* WhatsApp Status Media Studio (Image & Video Editor + Text/Emoji Overlay) */
.wa-status-studio-box {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 10px;
  margin-top: 8px;
  text-align: left;
  color: #fff;
}
.wa-status-live-stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 250px;
  margin: 0 auto 10px auto;
  background: #090d16;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  touch-action: none;
  user-select: none;
}
.wa-status-live-stage img,
.wa-status-live-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.wa-status-floating-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 800;
  text-align: center;
  max-width: 88%;
  word-break: break-word;
  cursor: grab;
  z-index: 15;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  line-height: 1.3;
  pointer-events: auto;
}
.wa-status-floating-overlay:active {
  cursor: grabbing;
}
.wa-status-floating-emoji {
  position: absolute;
  left: 78%;
  top: 22%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  cursor: grab;
  z-index: 16;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}
.wa-studio-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.65);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease;
}
.wa-studio-color-dot.active {
  transform: scale(1.2);
  border-color: #fff;
  box-shadow: 0 0 0 2px #00a884;
}


/* Smooth vertical scrolling & anti-accidental horizontal shift when configuring settings */
.sidebar,
.sidebar-content,
#tab-chats,
#tab-status,
#tab-contacts,
#tab-profile,
#chatListContainer,
#messagesContainer,
.modal-card {
  touch-action: pan-y !important;
  overscroll-behavior-x: none !important;
  overflow-x: hidden !important;
}
.ig-suggestions-carousel {
  touch-action: pan-x !important;
  overscroll-behavior-x: contain !important;
}


/* ==========================================================================
   INTERACTIVE CHAT IMAGE ZOOM & PAN VIEWER (PINCH, WHEEL, DOUBLE-TAP, & BAR)
   ========================================================================== */
.wa-media-lightbox-stage,
#waLightboxStage,
#canvasLightboxStage {
  position: relative;
  overflow: hidden !important;
  touch-action: none !important;
  user-select: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
}
.wa-zoomable-img {
  max-width: 92vw;
  max-height: 74dvh;
  object-fit: contain;
  border-radius: 8px;
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.wa-zoomable-img.is-zoomed {
  cursor: grab;
}
.wa-zoomable-img.is-zoomed:active {
  cursor: grabbing;
}
.wa-lightbox-zoom-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 6px auto;
  z-index: 25;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.wa-lightbox-zoom-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.wa-lightbox-zoom-btn:hover {
  background: rgba(0, 168, 132, 0.85);
}
.wa-lightbox-zoom-btn:active {
  transform: scale(0.92);
}
.wa-lightbox-zoom-pct {
  font-size: 12px;
  font-weight: 800;
  min-width: 44px;
  text-align: center;
  color: #a7f3d0;
  font-family: monospace;
}


/* ==========================================================
   SINICHAT UPGRADE: HOLD MESSAGE LAST READ BADGE & REGIONAL TZ
   ========================================================== */
.msg-hold-read-badge {
  display: none;
  margin-top: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--fc-bubble-out-audio-bg, rgba(15, 23, 42, 0.08));
  border: 1px dashed var(--fc-bubble-out-audio-border, rgba(0, 128, 105, 0.45));
  font-size: 11px;
  color: var(--fc-bubble-out-text, #0f172a);
  font-weight: 700;
  align-items: center;
  gap: 5px;
}

.msg-row.outgoing .msg-bubble .msg-hold-read-badge,
.msg-row.outgoing .msg-bubble .msg-hold-read-badge span,
.msg-row.outgoing .msg-bubble .msg-hold-read-badge strong {
  color: var(--fc-bubble-out-text, #0f172a) !important;
}
.msg-row.outgoing .msg-bubble .msg-hold-read-badge {
  background: var(--fc-bubble-out-audio-bg, rgba(15, 23, 42, 0.08)) !important;
  border-color: var(--fc-bubble-out-audio-border, rgba(0, 128, 105, 0.45)) !important;
}
.msg-row.outgoing .msg-bubble .msg-hold-read-badge i.tick-read {
  color: var(--fc-bubble-tick-read, #38bdf8) !important;
}
.msg-row.outgoing .msg-bubble .msg-hold-read-badge i.tick-unseen {
  color: var(--fc-bubble-out-meta, rgba(15, 23, 42, 0.65)) !important;
}

.msg-row.incoming .msg-bubble .msg-hold-read-badge,
.msg-row.incoming .msg-bubble .msg-hold-read-badge span,
.msg-row.incoming .msg-bubble .msg-hold-read-badge strong {
  color: var(--fc-bubble-in-text, #0f172a) !important;
}
.msg-row.incoming .msg-bubble .msg-hold-read-badge {
  background: var(--fc-bubble-in-audio-bg, rgba(15, 23, 42, 0.08)) !important;
  border-color: var(--fc-bubble-in-audio-border, rgba(0, 128, 105, 0.45)) !important;
}
.msg-row.incoming .msg-bubble .msg-hold-read-badge i.tick-read {
  color: var(--fc-bubble-tick-read, #38bdf8) !important;
}
.msg-row.incoming .msg-bubble .msg-hold-read-badge i.tick-unseen {
  color: var(--fc-bubble-in-meta, rgba(15, 23, 42, 0.65)) !important;
}

/* Sticker bubbles need an opaque background on .msg-hold-read-badge */
.msg-row.outgoing .msg-bubble.has-sticker-bubble .msg-hold-read-badge {
  background: var(--fc-bubble-out-bg, #d9fdd3) !important;
  color: var(--fc-bubble-out-text, #0f172a) !important;
  border: 1px solid var(--fc-bubble-out-audio-border, rgba(0,0,0,0.15)) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}
.msg-row.incoming .msg-bubble.has-sticker-bubble .msg-hold-read-badge {
  background: var(--fc-bubble-in-bg, #ffffff) !important;
  color: var(--fc-bubble-in-text, #0f172a) !important;
  border: 1px solid var(--fc-bubble-in-audio-border, rgba(0,0,0,0.15)) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

.msg-row.is-selected .msg-hold-read-badge {
  display: inline-flex;
}

html[data-theme="dark"] #selectionReadTimestampBadge {
  background: rgba(0, 168, 132, 0.18) !important;
  border-color: rgba(0, 168, 132, 0.45) !important;
  color: #e9edef !important;
}
html[data-theme="dark"] #selectionReadTimestampBadge span,
html[data-theme="dark"] #selectionReadTimestampBadge strong {
  color: #e9edef !important;
}

/* ==========================================================
   FLOATING SCROLL-TO-BOTTOM BUTTON & UNREAD COUNTER CIRCLE
   ========================================================== */
.chat-main {
  position: relative;
}
.wa-scroll-bottom-fab {
  position: absolute;
  right: 18px;
  bottom: 76px;
  z-index: 42;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: #008069;
  border: 1.5px solid rgba(0, 128, 105, 0.28);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.wa-scroll-bottom-fab:hover {
  background: #f0fdf4;
  transform: translateY(-2px);
}
.wa-scroll-bottom-fab.has-unread {
  border-color: #00a884;
  box-shadow: 0 5px 16px rgba(0, 168, 132, 0.38);
}
.wa-scroll-unread-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #00a884;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 168, 132, 0.45);
}

/* ==========================================================================
   ANDROID & IOS RESPONSIVE AUTH SCROLL FIX + GOOGLE AUTH UI
   + CATEGORIZED SETTINGS + EASY STATUS EDITOR
   ========================================================================== */
html.auth-page-html,
html:has(body.auth-page-body) {
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow: hidden !important;
}

body.auth-page-body {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: relative !important;
  display: block !important;
}

body.auth-page-body .auth-wrapper {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: var(--fc-vvh, 100dvh) !important;
  max-height: var(--fc-vvh, 100dvh) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  display: block !important;
  padding: 14px 12px calc(72px + env(safe-area-inset-bottom, 28px)) 12px !important;
  box-sizing: border-box !important;
}

body.auth-page-body .auth-brand {
  display: flex !important;
  width: fit-content !important;
  margin: 4px auto 12px auto !important;
}

body.auth-page-body .auth-card {
  width: 100% !important;
  max-width: min(420px, 100%) !important;
  margin: 0 auto 28px auto !important;
  padding: clamp(16px, 3.5vw, 24px) !important;
  border-radius: 18px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.auth-page-body .auth-grid-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
}

body.auth-page-body .auth-grid-row > * {
  min-width: 0 !important;
}

@media (max-width: 480px) {
  body.auth-page-body .auth-wrapper {
    padding: 10px 10px calc(80px + env(safe-area-inset-bottom, 32px)) 10px !important;
  }
  body.auth-page-body .auth-card {
    padding: 15px 14px !important;
    border-radius: 16px !important;
  }
  body.auth-page-body .auth-card h1 {
    font-size: 18px !important;
    margin-bottom: 4px !important;
  }
  body.auth-page-body .auth-card p.subtitle {
    font-size: 12px !important;
    margin-bottom: 12px !important;
  }
  body.auth-page-body .auth-card .form-group {
    margin-bottom: 9px !important;
  }
  body.auth-page-body .auth-card .form-control {
    height: 38px !important;
    font-size: 13px !important;
    padding: 0 10px !important;
  }
  body.auth-page-body .auth-grid-row {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
}

.google-auth-btn {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 42px;
  padding: 0 12px;
  box-sizing: border-box;
  background: #ffffff;
  color: #1e293b;
  border: 1.5px solid #cbd5e1;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.google-auth-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.google-auth-btn:active {
  transform: scale(0.99);
}

.google-auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  box-sizing: border-box;
}

.google-auth-modal-card {
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: min(400px, calc(100vw - 24px));
  padding: 18px 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
  border: 1px solid #e2e8f0;
  margin: auto;
  box-sizing: border-box;
  overflow: hidden;
}

.google-popup-launch-btn {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-size: 12.5px !important;
  padding: 9px 12px !important;
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.3 !important;
}

.auth-divider-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 11px 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-divider-or::before,
.auth-divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ==========================================================================
   CATEGORIZED SETTINGS UI (#tab-profile)
   ========================================================================== */
.settings-category-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 12px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.settings-cat-pill {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-align: center;
  min-width: 0;
}

.settings-cat-pill:hover {
  background: rgba(255, 255, 255, 0.65);
  color: #0f172a;
}

.settings-cat-pill.active {
  background: #ffffff;
  color: #008069;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.settings-section-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-section-sub {
  font-size: 11px;
  color: #475569;
  margin-top: 2px;
}

.settings-card-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px;
  border-radius: 10px;
}

/* ==========================================================================
   REDESIGNED EASY STATUS CREATOR & MEDIA EDITOR UI
   ========================================================================== */
.status-creator-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 15;
  padding-bottom: 6px;
}

.status-mode-Switch-bar {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 3px;
  border-radius: 999px;
  gap: 3px;
}

.status-mode-pill-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.status-mode-pill-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.status-quick-bg-bar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  flex-wrap: wrap;
  justify-content: center;
}

.status-bg-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.status-bg-dot:hover {
  transform: scale(1.15);
}

.status-media-editor-shell {
  width: 100%;
  max-width: 480px;
  text-align: center;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.status-upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.28);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.status-upload-dropzone:hover {
  background: rgba(15, 23, 42, 0.42);
  border-color: #34d399;
}

.status-upload-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 168, 132, 0.28);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.status-editor-tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: rgba(15, 23, 42, 0.65);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.status-editor-tool-tab {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.status-editor-tool-tab.active {
  background: #00a884;
  color: #ffffff;
}

.status-editor-tab-pane {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
}

.status-creator-bottombar {
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================
   AUTH PAGES (LOGIN RESET PASSWORD & REGISTER OTP) DARK MODE
   ========================================================== */
html[data-theme="dark"] #forgotPwModal {
  background: rgba(2, 6, 23, 0.76) !important;
}
html[data-theme="dark"] #forgotPwModal > div {
  background: #111b21 !important;
  border-color: #222e35 !important;
  color: #e9edef !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72) !important;
}
html[data-theme="dark"] #forgotPwModal h2,
html[data-theme="dark"] #forgotPwModal label {
  color: #e9edef !important;
}
html[data-theme="dark"] #forgotPwSubtitle {
  color: #8696a0 !important;
}
html[data-theme="dark"] #forgotOtpGroup,
html[data-theme="dark"] #regOtpCodeGroup {
  background: rgba(0, 168, 132, 0.14) !important;
  border-color: rgba(0, 168, 132, 0.42) !important;
  color: #e9edef !important;
}
html[data-theme="dark"] #forgotOtpGroup label,
html[data-theme="dark"] #regOtpCodeGroup label,
html[data-theme="dark"] #regOtpCodeGroup label span {
  color: #34d399 !important;
}
html[data-theme="dark"] #forgotOtpCodeInput,
html[data-theme="dark"] #regOtpCodeInput {
  background: #202c33 !important;
  color: #ffffff !important;
  border-color: #00a884 !important;
}
html[data-theme="dark"] #forgotOtpCodeInput::placeholder,
html[data-theme="dark"] #regOtpCodeInput::placeholder {
  color: #8696a0 !important;
}
html[data-theme="dark"] #displayNameCounter,
html[data-theme="dark"] #usernameCounter,
html[data-theme="dark"] #phoneCounter,
html[data-theme="dark"] #regOtpTimerText,
html[data-theme="dark"] #openForgotPwModalLink {
  color: #34d399 !important;
}
html[data-theme="dark"] #displayNameValidationHint,
html[data-theme="dark"] #usernameValidationHint,
html[data-theme="dark"] #regOtpStatusHint {
  color: #8696a0 !important;
}
html[data-theme="dark"] #googleAuthModal .google-auth-modal-card {
  background: #111b21 !important;
  border-color: #222e35 !important;
  color: #e9edef !important;
}
html[data-theme="dark"] #googleAuthModal .google-auth-modal-card strong,
html[data-theme="dark"] #googleAvatarPreviewTitle {
  color: #e9edef !important;
}
html[data-theme="dark"] #googleAvatarPreviewSub {
  color: #8696a0 !important;
}
html[data-theme="dark"] #googleAuthModal .google-auth-modal-card div[style*="background:#f8fafc"] {
  background: #202c33 !important;
  border-color: #2a3942 !important;
}
html[data-theme="dark"] .google-auth-btn,
html[data-theme="dark"] .btn-secondary {
  background: #202c33 !important;
  color: #e9edef !important;
  border-color: #2a3942 !important;
}
html[data-theme="dark"] .auth-divider-or::before,
html[data-theme="dark"] .auth-divider-or::after {
  background: #222e35 !important;
}
html[data-theme="dark"] .auth-divider-or span {
  background: #111b21 !important;
  color: #8696a0 !important;
}
html[data-theme="dark"] .auth-footer {
  border-top-color: #222e35 !important;
  color: #8696a0 !important;
}

/* ==========================================================
   PROFILE WEBSITE LINKS PILLS (MAX 3 BELOW BIO, DARK MODE READY)
   ========================================================== */
.fc-profile-links-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.ig-bio-section .fc-profile-links-wrap {
  justify-content: flex-start;
}
.fc-profile-website-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #0f766e;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease;
}
.fc-profile-website-pill:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}
.fc-profile-website-pill-text {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
html[data-theme="dark"] .fc-profile-website-pill {
  background: rgba(0, 168, 132, 0.15) !important;
  border-color: rgba(0, 168, 132, 0.42) !important;
  color: #34d399 !important;
}
html[data-theme="dark"] .fc-profile-website-pill .fc-profile-website-pill-text {
  color: #e9edef !important;
}

/* Restore full responsive size for #igDetailImg and #postModalImg when not broken */
#igDetailImg:not(.is-broken-image),
#postModalImg:not(.is-broken-image) {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 64dvh !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Ensure Instagram Post Grid Tiles & Detail Modal Images Always Fill Cleanly */
.ig-post-tile img.is-broken-image {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 18% !important;
  box-sizing: border-box !important;
  object-fit: contain !important;
  background: rgba(148, 163, 184, 0.14) !important;
}
#igDetailImg.is-broken-image,
#postModalImg.is-broken-image {
  width: 180px !important;
  height: 140px !important;
  margin: 28px auto !important;
  object-fit: contain !important;
}




/* ==========================================================================
   TURN 21 UPGRADES:
   1. FIX .list-item NAME, BADGE, PIN & GREEN UNREAD DOT TRUNCATION / OVERFLOW
   2. GROUP @MENTION GREEN DOT BADGE & #HASHTAG PILLS
   3. PROFILE-STYLE GROUP INFO MODAL + 3-DOTS (⋮) ADMIN MENU
   4. WHATSAPP-STYLE "{member} left group" SYSTEM PILL & DELETED TOMBSTONE
   ========================================================================== */
.list-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.6rem !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.list-item > .avatar {
  flex-shrink: 0 !important;
}

.list-item-body {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.list-item-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  width: 100% !important;
}

.list-item-title {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.fc-item-name-text {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-weight: 600;
  display: inline-block !important;
}

.fc-item-title-badges .pinned-pill,
.fc-item-title-badges .badge-group,
.fc-item-title-badges .badge-noncontact,
.fc-item-title-badges .badge-archived,
.fc-item-title-badges .badge-blocked {
  font-size: 9.5px !important;
  padding: 1px 5px !important;
  line-height: 1.25 !important;
  flex-shrink: 0 !important;
}

.fc-item-title-badges {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.list-item-time {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  margin-left: 4px !important;
}

.list-item-sub {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
}

.fc-item-sub-text {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: block !important;
}

.fc-item-sub-badges {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-shrink: 0 !important;
  margin-left: 4px !important;
}

.fc-contact-sub-line {
  font-size: 11.5px;
  color: var(--fc-text-muted, #667781);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  width: 100%;
}

/* Green Unread Notification Dot & Group @ Mention Green Dot Badge */
.fc-chat-unread-green-dot,
.fc-at-green-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22);
  flex-shrink: 0;
}

.fc-group-at-green-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.35);
  flex-shrink: 0;
  line-height: 1.2;
}

.fc-group-at-green-badge.is-active {
  background: #dcfce7;
  color: #166534;
  border-color: #22c55e;
}

html[data-theme="dark"] .fc-group-at-green-badge {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}

/* Group @Mention & #Hashtag Pills inside Bubbles & Composer Bar */
.fc-group-mention-pill,
.fc-group-hashtag-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.92em;
  background: rgba(0, 168, 132, 0.14);
  color: #008069;
}

html[data-theme="dark"] .fc-group-mention-pill,
html[data-theme="dark"] .fc-group-hashtag-pill {
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.fc-group-tag-quick-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--fc-surface, #f8fafc);
  border-top: 1px solid var(--fc-border, #e2e8f0);
  overflow-x: auto;
  white-space: nowrap;
}

.fc-tag-suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 168, 132, 0.35);
  background: #ffffff;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

html[data-theme="dark"] .fc-tag-suggest-chip {
  background: #1e293b;
  color: #f1f5f9;
  border-color: rgba(52, 211, 153, 0.35);
}

/* WhatsApp-Style Centered "{member} left group" System Pill */
.msg-row.system-msg-row {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 6px 0 !important;
  width: 100% !important;
}

.fc-wa-system-notice-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  max-width: 88%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .fc-wa-system-notice-pill {
  background: rgba(30, 41, 59, 0.88);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* "pesan ini sudah dihapus" Tombstone Styling inside Bubble */
.msg-deleted-tombstone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-style: italic;
  opacity: 0.78;
  font-size: 12.5px;
  user-select: none;
}

/* Profile-Style Group Info Modal & 3-Dots Dropdown */
.fc-group-profile-hero-card {
  background: linear-gradient(180deg, rgba(0, 168, 132, 0.08) 0%, rgba(248, 250, 252, 0.9) 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 14px;
  text-align: center;
}

html[data-theme="dark"] .fc-group-profile-hero-card {
  background: rgba(30, 41, 59, 0.75);
  border-color: #334155;
}

.fc-group-bio-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 12px;
}

html[data-theme="dark"] .fc-group-bio-card {
  background: #0f172a;
  border-color: #334155;
}

.fc-group-hashtag-handle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
}

html[data-theme="dark"] .fc-group-hashtag-handle {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.fc-group-three-dots-dropdown {
  position: absolute;
  top: 38px;
  right: 0;
  min-width: 225px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  padding: 5px;
  z-index: 9999;
}

html[data-theme="dark"] .fc-group-three-dots-dropdown {
  background: #1e293b;
  border-color: #334155;
}

.fc-group-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
}

.fc-group-dropdown-item:hover {
  background: #f1f5f9;
}

html[data-theme="dark"] .fc-group-dropdown-item {
  color: #f1f5f9;
}

html[data-theme="dark"] .fc-group-dropdown-item:hover {
  background: #334155;
}



/* ==========================================================================
   TURN 23 REFINEMENTS:
   1. BLUE VERIFIED TICK SNUG RIGHT NEXT TO USERNAME (.fc-item-name-wrap)
   2. SINGLE WHATSAPP-STYLE GREEN @ CIRCLE INDICATOR ONLY WHEN MENTIONED
   ========================================================================== */
.fc-item-name-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.fc-item-name-wrap .fc-item-name-text {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: inline-block !important;
}

.fc-item-name-wrap .fc-verified-badge {
  flex-shrink: 0 !important;
  margin-left: 3px !important;
}

.fc-group-at-green-badge.is-active {
  background: #25d366 !important;
  color: #ffffff !important;
  border: none !important;
  min-width: 1.15rem !important;
  height: 1.15rem !important;
  padding: 0 5px !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(37, 211, 102, 0.35) !important;
}
