/* =========================================================
   DOOD BOT Mini App
   Tema terang & gelap otomatis (mengikuti tema Telegram)
   ========================================================= */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: #e2e5ea;
  --divider: #eceef2;
  --text: #14171c;
  --muted: #667085;
  --accent: #109e68;
  --accent-soft: rgba(16, 158, 104, .1);
  --on-accent: #ffffff;
  --info: #2f6fe4;
  --info-soft: rgba(47, 111, 228, .1);
  --danger: #d92d20;
  --danger-soft: rgba(217, 45, 32, .09);
  --avatar-l: 34%;
  --shadow: 0 8px 30px rgba(16, 24, 40, .12);
  --nav-h: calc(64px + env(safe-area-inset-bottom));
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a20;
  --surface-2: #1f232b;
  --border: #272c35;
  --divider: #1e222a;
  --text: #eef0f3;
  --muted: #8b93a1;
  --accent: #34c58b;
  --accent-soft: rgba(52, 197, 139, .14);
  --on-accent: #04281a;
  --info: #6b9bff;
  --info-soft: rgba(107, 155, 255, .14);
  --danger: #f2706c;
  --danger-soft: rgba(242, 112, 108, .13);
  --avatar-l: 68%;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --border: #272c35;
    --divider: #1e222a;
    --text: #eef0f3;
    --muted: #8b93a1;
    --accent: #34c58b;
    --accent-soft: rgba(52, 197, 139, .14);
    --on-accent: #04281a;
    --info: #6b9bff;
    --info-soft: rgba(107, 155, 255, .14);
    --danger: #f2706c;
    --danger-soft: rgba(242, 112, 108, .13);
    --avatar-l: 68%;
    color-scheme: dark;
  }
}

/* ---------- Dasar ---------- */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  width: 100%;
  max-width: 720px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: var(--nav-h);
}

body.in-chat .app {
  padding-bottom: 0;
}

@media (min-width: 760px) {
  .app {
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
  }
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 5px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
}

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

.brand h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.brand p {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transition: background .15s;
}

.icon-button:active {
  background: var(--surface-2);
}

.icon-button.plain {
  border-color: transparent;
  background: transparent;
}

.icon-button.small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.icon-button.small .i {
  width: 17px;
  height: 17px;
}

.icon-button.danger {
  color: var(--danger);
}

.icon-button.is-on {
  color: var(--accent);
}

.icon-button.is-on .i {
  fill: currentColor;
}

/* ---------- Halaman umum ---------- */

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 14px;
}

.page-title h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.4px;
}

.page-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  margin: 0 16px 12px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color .15s;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.chip.active {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 16px 6px;
}

.section-heading h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

/* ---------- Daftar ---------- */

.list {
  display: flex;
  flex-direction: column;
}

.list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background .12s;
}

button.list-item:active {
  background: var(--surface);
}

.list-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 74px;
  height: 1px;
  background: var(--divider);
}

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

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

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

.item-title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.item-title.danger {
  color: var(--danger);
}

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

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

.item-time.is-unread {
  color: var(--accent);
  font-weight: 600;
}

.badge {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
}

.item-flags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mini-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.mini-icon.fav {
  fill: var(--accent);
  stroke: var(--accent);
}

.avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: hsl(var(--h, 160) 45% 50% / .17);
  color: hsl(var(--h, 160) 55% var(--avatar-l));
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3px;
  overflow: hidden;
}

.avatar-photo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.avatar.large {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.avatar.small {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.sub-heading {
  padding: 14px 16px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

/* ---------- Panggilan ---------- */

.call-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.call-icon.outgoing {
  background: var(--info-soft);
  color: var(--info);
}

.call-icon.missed {
  background: var(--danger-soft);
  color: var(--danger);
}

.call-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.call-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.link-button {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.saved-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.saved-tag .i {
  width: 13px;
  height: 13px;
}

/* ---------- Kontak ---------- */

.contact-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- Tombol ---------- */

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .15s, transform .1s;
}

.primary-button {
  background: var(--accent);
  color: var(--on-accent);
}

.primary-button .i {
  width: 17px;
  height: 17px;
}

.secondary-button {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.primary-button:active,
.secondary-button:active {
  transform: scale(.98);
}

.primary-button:disabled {
  opacity: .55;
}

/* ---------- Status kosong / memuat ---------- */

.loading,
.empty,
.error-state {
  padding: 48px 24px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.loading::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.empty-icon .i {
  width: 26px;
  height: 26px;
}

.empty h3 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.empty .primary-button,
.error-state .secondary-button {
  margin-top: 16px;
}

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

/* ---------- Percakapan ---------- */

.conversation {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.conversation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.conversation-header .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.conversation-info {
  flex: 1;
  min-width: 0;
  margin-left: 2px;
}

.conversation-info h2 {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.conversation-info p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.message-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  overflow-y: auto;
}

.day-label {
  align-self: center;
  margin: 10px 0 4px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.message {
  align-self: flex-start;
  max-width: 82%;
  padding: 8px 12px 6px;
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.message-text {
  white-space: pre-wrap;
}

.message.outgoing {
  align-self: flex-end;
  border-color: transparent;
  border-radius: 16px 16px 4px 16px;
  background: var(--accent-soft);
}

.message-sender {
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.message-media {
  color: var(--muted);
  font-style: italic;
}

.message-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: right;
}

/* [MODIFIED] Dedicated soft-yellow, privacy-safe presentation for WhatsApp View Once messages. */
.message.view-once {
  width: min(82%, 310px);
  padding: 12px;
  border-color: color-mix(in srgb, #e5b63f 48%, var(--border));
  background: color-mix(in srgb, #f5c542 17%, var(--surface));
  box-shadow: inset 3px 0 0 #e5b63f;
}
.view-once-content {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.view-once-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, #f5c542 28%, var(--surface));
  color: #9a6a00;
  font-size: 23px;
  font-weight: 700;
}
.view-once-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.view-once-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.view-once-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.view-once-action {
  grid-column: 1 / -1;
  min-height: 38px;
  margin-top: 2px;
  border: 1px solid #e5b63f;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffe49a, #f5c542);
  color: #3d2b08;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 2px 3px 7px rgba(130, 91, 13, .16);
}
.view-once-action:active {
  transform: scale(.98);
  filter: brightness(.97);
}

/* ---------- Foto & video di percakapan ---------- */

/* [MODIFIED] Keep photo and video bubbles compact on mobile screens. */
.message.has-media {
  width: min(82%, 270px);
  padding: 4px 4px 6px;
}

.message.has-media .message-sender,
.message.has-media .message-text,
.message.has-media .message-meta {
  padding: 0 8px;
}

.message.has-media:has(> .media.sticker) {
  width: auto;
}

.media {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-2);
}

.media-img {
  display: block;
  width: 100%;
  max-height: 230px;
  object-fit: cover;
  cursor: zoom-in;
}

.media-img.is-loading {
  height: 180px;
  cursor: default;
  animation: pulse 1.2s ease-in-out infinite;
}

.media.sticker {
  width: 150px;
  background: transparent;
}

.media.sticker .media-img {
  max-height: 150px;
  object-fit: contain;
  cursor: default;
}

.video-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 160px;
  margin-bottom: 4px;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.video-card .i {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  fill: currentColor;
}

.media-video {
  display: block;
  width: 100%;
  max-height: 240px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: #000;
}

.media-error {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.lightbox {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .92);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

@keyframes pulse {
  50% { opacity: .55; }
}

.read-note {
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* ---------- Akun ---------- */

.card {
  margin: 0 16px 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-card h3 {
  font-size: 17px;
  font-weight: 600;
}

.profile-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.tips-card h3 {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 600;
}

.tips-card p {
  color: var(--muted);
  font-size: 13px;
}

.tips-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.tips-card code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
}

.segmented button {
  padding: 9px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .15);
}

/* ---------- Navigasi bawah ---------- */

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 720px;
  margin: 0 auto;
  padding: 6px 8px env(safe-area-inset-bottom);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.in-chat .bottom-nav {
  display: none;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.nav-item.selected {
  color: var(--accent);
  font-weight: 600;
}

.nav-item:active {
  transform: scale(.96);
}

/* ---------- Form kontak (bottom sheet) ---------- */

.sheet {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  animation: fade .2s ease;
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise .25s cubic-bezier(.2, .8, .2, 1);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 4px;
  background: var(--border);
}

.sheet-panel h3 {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 700;
}

.sheet-panel label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sheet-panel input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  transition: border-color .15s;
}

.sheet-panel input:focus {
  border-color: var(--accent);
}

.sheet-panel input.invalid {
  border-color: var(--danger);
}

.field-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions button {
  flex: 1;
  min-height: 46px;
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes rise {
  from { transform: translateY(40px); opacity: 0; }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(var(--nav-h) + 14px);
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transform: translateX(-50%);
  animation: fade .2s ease;
}

body.in-chat .toast,
.sheet:not(.hidden) ~ .toast {
  bottom: calc(20px + env(safe-area-inset-bottom));
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* [ADDED] WhatsApp QR pairing gate — green neumorphic brand surface. */
.connection-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 190, 85, .18), transparent 34%),
    radial-gradient(circle at 92% 88%, rgba(0, 160, 75, .16), transparent 36%),
    #edf6f1;
  color: #15251d;
}
/* [MODIFIED] Keep QR pairing hidden until Connect is pressed in Profile. */
.connection-gate.is-active { display: grid; }
.connection-panel {
  width: min(100%, 430px);
  padding: 26px 22px 22px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 30px;
  background: linear-gradient(145deg, #f8fffb, #e7f1ec);
  box-shadow: 14px 14px 32px rgba(25, 78, 52, .13), -12px -12px 30px rgba(255,255,255,.95);
  text-align: center;
}
.connection-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 25px;
}
.connection-brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  padding: 9px;
  place-items: center;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(145deg, #10c85a, #008c3e);
  box-shadow: 6px 6px 14px rgba(0,120,55,.22), -5px -5px 12px #fff;
}

.connection-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.connection-brand-name {
  color: #15251d;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.6px;
  text-align: left;
}
.connection-brand-name span { display: block; color: #078c42; }
.connection-eyebrow {
  margin-bottom: 8px;
  color: #078c42;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.connection-title {
  margin-bottom: 9px;
  color: #17231c;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.8px;
}
.connection-description {
  max-width: 310px;
  margin: 0 auto 22px;
  color: #64746b;
  font-size: 14px;
  line-height: 1.55;
}
.connection-qr-wrap {
  display: grid;
  width: min(100%, 280px);
  aspect-ratio: 1;
  place-items: center;
  margin: 0 auto 20px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 25px;
  background: #f4faf6;
  box-shadow: inset 5px 5px 12px rgba(35,80,54,.09), inset -5px -5px 12px #fff, 8px 8px 20px rgba(25,78,52,.10);
}
.connection-qr-wrap img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.connection-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #e9f4ed;
  box-shadow: inset 4px 4px 9px rgba(32,79,51,.08), inset -4px -4px 9px #fff;
  color: #3e5c49;
  font-size: 13px;
}
.connection-pulse {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0ab653;
  box-shadow: 0 0 0 5px rgba(10,182,83,.12);
  animation: connectionPulse 1.4s infinite;
}
@keyframes connectionPulse { 50% { opacity: .35; transform: scale(.78); } }
.connection-steps {
  padding: 17px 18px;
  border-radius: 18px;
  background: rgba(12,177,76,.08);
  color: #456151;
  font-size: 13px;
  line-height: 1.75;
  text-align: left;
}
.connection-steps strong { display: block; margin-bottom: 5px; color: #173b27; }
.connection-error { color: #b42318; font-size: 13px; }
.connection-retry {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(145deg, #11c95a, #00933f);
  box-shadow: 6px 6px 14px rgba(0,120,55,.2), -5px -5px 12px #fff;
  color: #fff;
  font-weight: 750;
}
body.connection-pending .app { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .connection-pulse { animation: none; }
}


/* [ADDED] WAGRAM visual refresh — light green neumorphic mobile shell. */
:root {
  --bg: #eef8f2;
  --surface: #f7fcf9;
  --surface-2: #e6f2eb;
  --border: #dcebe2;
  --divider: #e3eee7;
  --text: #17251d;
  --muted: #718078;
  --accent: #03a84f;
  --accent-soft: rgba(3, 168, 79, .11);
  --on-accent: #ffffff;
  --shadow: 8px 8px 20px rgba(43, 91, 63, .10), -8px -8px 20px rgba(255,255,255,.92);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a20;
  --surface-2: #1f232b;
  --border: #272c35;
  --divider: #1e222a;
  --text: #eef0f3;
  --muted: #8b93a1;
  --accent: #34c58b;
  --accent-soft: rgba(52,197,139,.14);
  --on-accent: #04281a;
  color-scheme: dark;
}
.topbar {
  padding: 14px 18px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.brand-icon {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 15px;
  background: linear-gradient(145deg,#10c85a,#008c3e);
  box-shadow: 5px 5px 12px rgba(0,120,55,.18),-5px -5px 12px rgba(255,255,255,.8);
}
.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.page-title { padding-top: 18px; }
.page-title h2 { font-size: 25px; letter-spacing: -.6px; }
.search-box {
  height: 48px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 3px 3px 8px rgba(43,91,63,.055), inset -3px -3px 8px rgba(255,255,255,.85);
}
.card,.connection-status-card,.automation-empty {
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 20px;
  background: linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow: var(--shadow);
}
.bottom-nav {
  max-width: 720px;
  padding: 9px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb,var(--surface) 94%,transparent);
}
.nav-item { min-height: 54px; gap: 5px; border-radius: 16px; }
.nav-item.selected {
  background: linear-gradient(145deg,#0ac65b,#009640);
  color: #fff;
  box-shadow: 4px 5px 12px rgba(0,145,65,.2);
}
.nav-item .i { width: 21px; height: 21px; }
.message-shortcuts {
  display:flex;
  gap:8px;
  padding:0 16px 14px;
}
.shortcut-button {
  min-height:36px;
  padding:7px 15px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--muted);
  font-size:13px;
  font-weight:600;
}
.shortcut-button.active {
  border-color:transparent;
  background:var(--accent-soft);
  color:var(--accent);
}
.message-subpage-back { padding:10px 16px 0; }
.message-subpage-back button {
  border:0;
  padding:7px 0;
  background:transparent;
  color:var(--accent);
  font-weight:700;
}
.connection-status-card {
  display:flex;
  align-items:center;
  gap:14px;
  margin:0 16px 13px;
  padding:16px;
}
.service-symbol {
  display:grid;
  width:46px;
  height:46px;
  flex:0 0 auto;
  place-items:center;
  border-radius:15px;
  color:#fff;
  font-size:25px;
  font-weight:800;
}
.whatsapp-symbol { background:#18bd61; }
.telegram-symbol { background:#269bd7; }
.service-copy { display:flex; flex:1; flex-direction:column; gap:4px; }
.service-copy strong { font-size:15px; }
.service-copy span { color:var(--accent); font-size:12px; font-weight:650; }
.service-copy i {
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:5px;
  border-radius:50%;
  background:var(--accent);
}
.service-chevron { color:var(--muted); font-size:25px; }
.automation-empty {
  display:flex;
  flex-direction:column;
  align-items:center;
  margin:18px 16px;
  padding:34px 24px;
  text-align:center;
}
.automation-empty-icon {
  display:grid;
  width:68px;
  height:68px;
  margin-bottom:18px;
  place-items:center;
  border-radius:22px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:40px;
}
.automation-empty h3 { margin-bottom:8px; font-size:17px; }
.automation-empty p { max-width:300px; color:var(--muted); font-size:13px; line-height:1.6; }
.coming-soon {
  margin-top:18px;
  padding:7px 12px;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:10px;
  font-weight:800;
  letter-spacing:.7px;
}


/* [MODIFIED] Compact four-tab home navigation with a soft neumorphic surface. */
:root {
  --bg: #edf6f0;
  --surface: #f4fbf6;
  --surface-2: #e5f0e8;
  --border: rgba(255,255,255,.88);
  --divider: rgba(113,145,123,.13);
  --text: #17251d;
  --muted: #718078;
  --accent: #08a94f;
  --accent-soft: rgba(8,169,79,.11);
  --on-accent: #ffffff;
  --shadow: 7px 7px 18px rgba(39,88,58,.12), -7px -7px 18px rgba(255,255,255,.92);
}
html[data-theme="dark"] {
  --bg: #080d0a;
  --surface: #111a14;
  --surface-2: #18251c;
  --border: rgba(69,103,78,.22);
  --divider: rgba(145,180,151,.10);
  --text: #edf7ef;
  --muted: #8b9b8f;
  --accent: #27d477;
  --accent-soft: rgba(39,212,119,.13);
  --on-accent: #07130b;
  --shadow: 7px 7px 18px rgba(0,0,0,.46), -5px -5px 15px rgba(37,64,44,.13);
}
.brand-text p { display: none; }
.topbar { padding: 12px 16px 8px; }
.page-title { padding: 12px 16px 14px; }
.page-title h2 { font-size: 25px; }
.count { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); }
.search-box {
  margin: 0 14px 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-2);
  box-shadow: inset 4px 4px 9px rgba(41,78,51,.08), inset -4px -4px 9px rgba(255,255,255,.78);
}
html[data-theme="dark"] .search-box {
  box-shadow: inset 4px 4px 9px rgba(0,0,0,.3), inset -3px -3px 8px rgba(51,81,57,.12);
}
.chips { padding-bottom: 12px; }
.chip {
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: 3px 3px 8px rgba(41,78,51,.07), -3px -3px 8px rgba(255,255,255,.75);
}
.chip.active {
  background: linear-gradient(145deg,#0cc45b,#079747);
  color: #fff;
  box-shadow: 3px 4px 10px rgba(0,145,65,.2);
}
.list { padding: 0 10px 12px; gap: 7px; }
.list-item {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow: var(--shadow);
}
.list-item:not(:last-child)::after { display: none; }
button.list-item:active { background: var(--surface-2); transform: scale(.99); }
.item-title { font-size: 14px; }
.item-sub { font-size: 12px; }
.avatar {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255,255,255,.65);
  box-shadow: 3px 3px 8px rgba(39,88,58,.12), -2px -2px 6px rgba(255,255,255,.7);
}
html[data-theme="dark"] .avatar {
  border-color: rgba(255,255,255,.06);
  box-shadow: 3px 3px 8px rgba(0,0,0,.25);
}
.bottom-nav {
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: color-mix(in srgb,var(--surface) 94%,transparent);
  box-shadow: 0 -7px 22px rgba(39,88,58,.08);
}
.nav-item {
  min-height: 54px;
  gap: 4px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 10.5px;
}
.nav-item.selected {
  background: linear-gradient(145deg,#0bc45b,#079646);
  color: #fff;
  box-shadow: 4px 5px 12px rgba(0,145,65,.24), inset 1px 1px 2px rgba(255,255,255,.25);
}
html[data-theme="dark"] .nav-item.selected {
  background: linear-gradient(145deg,#27d477,#0b9e50);
  color: #06130a;
}
.nav-item .i { width: 21px; height: 21px; }
.message-shortcuts { display: none; }
.message-subpage-back { display: none; }
.connection-status-card,.card,.automation-empty {
  border: 1px solid var(--border);
  background: linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow: var(--shadow);
}
.primary-button {
  background: linear-gradient(145deg,#0bc45b,#079646);
  box-shadow: 4px 5px 12px rgba(0,145,65,.18);
}
html[data-theme="dark"] .primary-button {
  background: linear-gradient(145deg,#27d477,#0b9e50);
  color: #06130a;
}
@media (max-width: 380px) {
  .nav-item { font-size: 9.5px; }
  .bottom-nav { padding-right: 6px; padding-left: 6px; }
}


/* [ADDED] Dark neumorphism correction: remove inherited white highlights. */
html[data-theme="dark"] {
  --border: rgba(89, 132, 101, .18);
  --divider: rgba(119, 166, 130, .09);
  --shadow: 7px 7px 18px rgba(0, 0, 0, .48), -4px -4px 12px rgba(37, 75, 48, .07);
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .bottom-nav {
  background: color-mix(in srgb, #0b110d 96%, transparent);
}
html[data-theme="dark"] .bottom-nav {
  border-color: rgba(71, 111, 81, .16);
  box-shadow: 0 -7px 22px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .search-box {
  border-color: rgba(80, 124, 91, .17);
  background: #101a13;
  box-shadow: inset 4px 4px 9px rgba(0, 0, 0, .42), inset -3px -3px 8px rgba(35, 75, 46, .08);
}
html[data-theme="dark"] .chip {
  border-color: rgba(79, 119, 88, .16);
  background: linear-gradient(145deg, #121b15, #0c130e);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, .38), -2px -2px 7px rgba(40, 76, 49, .07);
}
html[data-theme="dark"] .chip.active {
  border-color: transparent;
  background: linear-gradient(145deg, #20c96b, #087b3d);
  color: #06130a;
  box-shadow: 3px 4px 10px rgba(0, 0, 0, .3);
}
html[data-theme="dark"] .list-item,
html[data-theme="dark"] .card,
html[data-theme="dark"] .connection-status-card,
html[data-theme="dark"] .automation-empty {
  border-color: rgba(79, 119, 88, .16);
  background: linear-gradient(145deg, #142018, #0e1711);
  box-shadow: 6px 6px 16px rgba(0, 0, 0, .4), -3px -3px 10px rgba(37, 72, 46, .06);
}
html[data-theme="dark"] .avatar {
  border-color: rgba(90, 137, 101, .14);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, .36), -2px -2px 6px rgba(36, 72, 45, .06);
}
html[data-theme="dark"] .brand-icon {
  box-shadow: 4px 4px 12px rgba(0, 0, 0, .42), 0 0 13px rgba(22, 193, 91, .12);
}
html[data-theme="dark"] .icon-button {
  border-color: rgba(79, 119, 88, .16);
  background: linear-gradient(145deg, #142018, #0d1510);
  box-shadow: 4px 4px 9px rgba(0, 0, 0, .38), -2px -2px 7px rgba(36, 72, 45, .06);
}
html[data-theme="dark"] .nav-item.selected {
  background: linear-gradient(145deg, #20c96b, #087b3d);
  color: #06130a;
  box-shadow: 4px 5px 12px rgba(0, 0, 0, .32), inset 1px 1px 2px rgba(255, 255, 255, .06);
}
html[data-theme="dark"] .primary-button {
  background: linear-gradient(145deg, #20c96b, #087b3d);
  color: #06130a;
  box-shadow: 4px 5px 12px rgba(0, 0, 0, .3);
}
html[data-theme="dark"] .secondary-button {
  border-color: rgba(79, 119, 88, .17);
  background: #111b14;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, .32), -2px -2px 6px rgba(36, 72, 45, .05);
}
html[data-theme="dark"] .segmented {
  background: #0c140f;
}
html[data-theme="dark"] .segmented button.active {
  background: #18251c;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, .35), -1px -1px 4px rgba(39, 77, 49, .06);
}
html[data-theme="dark"] .count {
  background: #142018;
}
html[data-theme="dark"] .empty-icon {
  background: #142018;
  box-shadow: inset 3px 3px 7px rgba(0, 0, 0, .3), inset -2px -2px 6px rgba(38, 75, 47, .06);
}
html[data-theme="dark"] .message,
html[data-theme="dark"] .conversation-header,
html[data-theme="dark"] .read-note {
  border-color: rgba(79, 119, 88, .15);
  background: #111a14;
}
html[data-theme="dark"] .message.outgoing {
  background: rgba(39, 212, 119, .13);
}
html[data-theme="dark"] .sheet-panel {
  border: 1px solid rgba(79, 119, 88, .16);
  background: #111a14;
  box-shadow: 0 -8px 26px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] .sheet-panel input {
  border-color: rgba(79, 119, 88, .18);
  background: #0b120d;
  box-shadow: inset 3px 3px 7px rgba(0, 0, 0, .35);
}


/* [ADDED] WhatsApp profile detail sheet. */
.profile-avatar {
  cursor: pointer;
}

.profile-avatar:active,
.profile-sender:active {
  opacity: .72;
}

.profile-sender {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.conversation-header .profile-avatar,
.conversation-info [data-profile-jid] {
  cursor: pointer;
}

.profile-panel {
  max-height: min(82dvh, 680px);
  overflow-y: auto;
  padding-top: 12px;
}

.profile-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 24px;
  line-height: 1;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 0 22px;
  text-align: center;
}

.profile-photo-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 6px;
}

.profile-avatar-large,
.profile-photo {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  font-size: 34px;
}

.profile-photo {
  position: absolute;
  inset: 0;
  object-fit: cover;
  background: var(--surface-2);
}

.profile-hero h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 20px;
  font-weight: 700;
}

.profile-hero > p {
  color: var(--muted);
  font-size: 13px;
}

.profile-detail {
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.profile-detail span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.profile-detail p {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  white-space: pre-wrap;
}

.profile-detail .profile-jid {
  color: var(--muted);
  font-size: 12px;
}

.profile-updated {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.conversation-header #conversationAvatar {
  cursor: pointer;
}


/* [MODIFIED] Search expands over the page title area; logo stays fixed and theme stays at far right. */
.topbar {
  position: sticky;
  min-height: 66px;
  gap: 10px;
}

.topbar-brand {
  flex: 1 1 auto;
  min-width: 0;
  gap: 11px;
}

.topbar-brand .brand-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.topbar-brand .brand-text { min-width: 0; }

.topbar-title {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.55px;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity .18s ease, transform .24s cubic-bezier(.2,.8,.2,1);
}

.topbar-actions {
  position: static;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.topbar-search-wrap {
  position: static;
  display: flex;
  align-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.topbar-search {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 94px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 0;
  max-width: calc(100% - 154px);
  height: 42px;
  overflow: hidden;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  opacity: 0;
  transform: translateX(12px) scaleX(.96);
  transform-origin: right center;
  pointer-events: none;
  transition:
    width .38s cubic-bezier(.22,.8,.25,1),
    opacity .2s ease,
    transform .38s cubic-bezier(.22,.8,.25,1),
    padding .3s ease,
    border-color .25s ease;
}

.topbar-search .i { flex: 0 0 18px; width: 18px; height: 18px; }

.topbar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.topbar-search input::placeholder { color: var(--muted); }

.topbar.search-open .topbar-title {
  opacity: 0;
  transform: translateX(-5px);
}

.topbar.search-open .topbar-search {
  width: calc(100% - 154px);
  padding: 0 12px;
  border-color: var(--border);
  opacity: 1;
  transform: translateX(0) scaleX(1);
  pointer-events: auto;
}

.topbar .icon-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

#searchToggleButton {
  position: relative;
  z-index: 3;
  flex: 0 0 42px;
  font-size: 24px;
  line-height: 1;
  transition: transform .22s ease, background .18s ease;
}

#searchToggleButton:active { transform: scale(.9); }

@media (max-width: 380px) {
  .topbar-search { right: 90px; max-width: calc(100% - 144px); }
  .topbar.search-open .topbar-search { width: calc(100% - 144px); }
  .topbar-brand .brand-icon { flex-basis: 38px; width: 38px; height: 38px; }
  .topbar-title { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-title, .topbar-search, #searchToggleButton { transition: none !important; }
}


/* [ADDED] WAGRAM swipe-to-archive interaction: single green archive action. */
.chat-swipe-row {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 0;
  background: transparent;
}
.chat-row-content {
  position: relative;
  z-index: 1;
  border-radius: 0;
  background: var(--surface);
  transition: transform .24s cubic-bezier(.2,.75,.25,1), background .15s;
  touch-action: pan-y;
}
.chat-actions {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  display: flex;
  width: 152px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.chat-actions button {
  display: grid;
  place-items: center;
  width: 76px;
  flex: 0 0 76px;
  padding: 0;
  border: 0;
  border-radius: 0;
}
.chat-favorite-action {
  background: var(--surface-2);
  color: var(--accent);
}
.chat-favorite-action .i {
  width: 22px;
  height: 22px;
  fill: none;
  stroke-width: 2;
}
.chat-archive-action {
  background: var(--accent);
  color: var(--on-accent);
}
.chat-archive-action .i {
  width: 23px;
  height: 23px;
  stroke-width: 2;
}
.chat-swipe-row.is-revealed .chat-row-content {
  transform: translateX(-152px);
}
.chat-swipe-row.is-revealed .chat-actions {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.chat-actions button:disabled {
  opacity: .55;
}
@media (prefers-reduced-motion: reduce) {
  .chat-row-content { transition: none; }
}


/* [ADDED] Compact counters inside chat filter chips. */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.chip.active .chip-count {
  background: var(--accent);
  color: var(--on-accent);
}


/* [MODIFIED] Make the WhatsApp contact action instantly recognizable. */
#openChatWhatsAppButton {
  color: #25D366;
}
#openChatWhatsAppButton .i {
  width: 25px;
  height: 25px;
  stroke-width: 2.15;
}
#openChatWhatsAppButton:disabled {
  opacity: .4;
}



/* [MODIFIED] Call history cards: inline save icon and swipe favorite/archive actions. */
.call-swipe-row {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 18px;
  background: transparent;
}
.call-row-content {
  position: relative;
  z-index: 2;
  width: 100%;
  background: var(--surface);
  transition: transform .24s cubic-bezier(.2,.75,.25,1);
  touch-action: pan-y;
}
.call-actions {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  display: flex;
  width: 152px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.call-actions button {
  display: grid;
  place-items: center;
  width: 76px;
  flex: 0 0 76px;
  padding: 0;
  border: 0;
  border-radius: 0;
}
.call-favorite-action {
  background: var(--surface-2);
  color: var(--accent);
}
.call-archive-action {
  background: var(--accent);
  color: var(--on-accent);
}
.call-actions .i { width: 23px; height: 23px; stroke-width: 2; }
.call-swipe-row.is-revealed .call-row-content { transform: translateX(-152px); }
.call-swipe-row.is-revealed .call-actions {
  z-index: 3;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.call-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.call-phone-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  color: var(--muted);
}
.call-inline-save,
.call-inline-saved {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  flex: 0 0 auto;
}
.call-inline-save .i,
.call-inline-saved .i { width: 17px; height: 17px; stroke-width: 2.2; }
.call-inline-saved { color: var(--muted); }
.call-detail { color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .call-row-content { transition: none; } }


/* [MODIFIED] Square call card edges only while swipe actions are revealed. */
.call-swipe-row.is-revealed,
.call-swipe-row.is-revealed .call-row-content,
.call-swipe-row.is-revealed .call-actions,
.call-swipe-row.is-revealed .call-actions button {
  border-radius: 0 !important;
}


/* [MODIFIED] Keep the contact action on the same horizontal line as the call name. */
.call-name-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-width: 0;
  width: 100%;
}
.call-name-line .item-title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 32px);
}
.call-name-line .call-inline-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  vertical-align: middle;
}


/* [ADDED] Contacts add action placed between global search and theme controls. */
.topbar-add-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  height: 42px;
  min-width: 0;
  padding: 0 11px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 13px;
}
.topbar-add-contact .i {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}
@media (max-width: 380px) {
  .topbar-add-contact {
    gap: 3px;
    padding: 0 8px;
    font-size: 12px;
  }
}


/* [MODIFIED] Compact person-plus icon button to match the header controls. */
.topbar-add-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}
.topbar-add-contact .i {
  width: 21px;
  height: 21px;
}


/* [ADDED] Clear control stays inside the expanded search field. */
.topbar-search-clear {
  display: none;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
}
.topbar.search-open .topbar-search-clear {
  display: inline-flex;
}


/* [MODIFIED] Expanded search fills the entire space between WAGRAM logo and theme toggle. */
.topbar.search-open #searchToggleButton,
.topbar.search-open #addContactButton {
  display: none !important;
}
.topbar.search-open .topbar-search {
  left: 69px;
  right: 66px;
  top: 12px;
  width: auto;
  max-width: none;
  padding: 0 10px;
  transform: translateX(0) scaleX(1);
}
.topbar.search-open .topbar-search > .i {
  display: none;
}
.topbar.search-open .topbar-search-wrap {
  flex-basis: 0;
  width: 0;
}
@media (max-width: 380px) {
  .topbar.search-open .topbar-search {
    left: 64px;
    right: 62px;
    width: auto;
    max-width: none;
  }
}


/* [ADDED] Neumorphic contact swipe actions: WhatsApp, edit and delete. */
.contact-swipe-row {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 16px;
  background: transparent;
}
.contact-row-content {
  position: relative;
  z-index: 2;
  width: 100%;
  background: var(--surface);
  transition: transform .24s cubic-bezier(.2,.75,.25,1);
  touch-action: pan-y;
}
.contact-swipe-actions {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  display: flex;
  width: 174px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.contact-swipe-actions button {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  padding: 0;
  border: 0;
  border-radius: 0;
}
.contact-swipe-actions .i { width: 21px; height: 21px; stroke-width: 2; }
.contact-swipe-whatsapp { background: #25D366; color: #fff; }
.contact-swipe-edit { background: var(--surface-2); color: var(--text); }
.contact-swipe-delete { background: var(--danger); color: #fff; }
.contact-swipe-row.is-revealed .contact-row-content { transform: translateX(-174px); }
.contact-swipe-row.is-revealed .contact-swipe-actions {
  z-index: 3;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.contact-swipe-row.is-revealed,
.contact-swipe-row.is-revealed .contact-row-content,
.contact-swipe-row.is-revealed .contact-swipe-actions,
.contact-swipe-row.is-revealed .contact-swipe-actions button { border-radius: 0 !important; }
@media (prefers-reduced-motion: reduce) { .contact-row-content { transition: none; } }


/* [ADDED] Hide the global header only while the Profile page is active. */
body:has(#accountPage:not(.hidden)) .topbar {
  display: none !important;
}


/* [ADDED] Horizontal Profile identity header. */
.profile-identity-card {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 11px;
  min-width: 0;
}
.profile-square-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border-radius: 9px !important;
  font-size: 18px;
}
.account-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.profile-identity-copy {
  flex: 1 1 0;
  min-width: 0;
}
.profile-identity-copy h3 {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-identity-copy p {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-plan-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 6px;
  min-width: 0;
}
.profile-tier.is-premium {
  border-color: #b58a35;
  background: linear-gradient(135deg, #5b4318, #34270f);
  color: #ffe2a0;
}
.profile-tier.is-admin {
  box-shadow: 0 0 0 1px rgba(255, 214, 128, .16);
}
.profile-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 25px;
  padding: 0 7px;
  border: 1px solid #7d8497;
  border-radius: 7px;
  background: #343a4b;
  color: #f1f3fa;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}
.premium-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  gap: 4px;
  min-width: 0;
  min-height: 25px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #ffdc78, #e8a92e);
  color: #352000;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.premium-button span { font-size: 13px; line-height: 1; }
.profile-theme-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.profile-theme-button .i { width: 17px; height: 17px; }
@media (max-width: 380px) {
  .profile-identity-card { gap: 7px; padding: 9px; }
  .profile-square-avatar { flex-basis: 44px; width: 44px; height: 44px; }
  .profile-theme-button { flex-basis: 32px; width: 32px; height: 32px; }
  .profile-plan-actions { gap: 4px; }
  .profile-tier { min-height: 23px; padding: 0 5px; font-size: 8px; }
  .premium-button { min-height: 23px; padding: 0 5px; font-size: 8px; gap: 3px; }
  .premium-button span { font-size: 12px; }
}


/* [ADDED] WhatsApp connection and notification settings in Profile. */
.whatsapp-account-card,.notification-card { margin-top: 12px; }
.settings-section-heading,.notification-card-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}
.settings-heading-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.settings-heading-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.settings-heading-copy h3,.settings-heading-copy strong { font-size: 14px; font-weight: 700; }
.settings-heading-copy p,.settings-heading-copy small { color: var(--muted); font-size: 11px; }
.whatsapp-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--divider);
  min-width: 0;
}
.whatsapp-account-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 11px;
  background: rgba(37,211,102,.13);
  color: #25d366;
}
.whatsapp-account-avatar .i { width: 25px; height: 25px; }
.whatsapp-account-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.whatsapp-account-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:2px; }
.whatsapp-account-copy strong { overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.whatsapp-account-copy > span:not(.whatsapp-connection-state) { overflow:hidden; color:var(--muted); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.whatsapp-connection-state {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex:0 0 auto;
  min-height:30px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--muted);
  font-size:10px;
  white-space:nowrap;
}
.whatsapp-connection-state i { width:7px; height:7px; border-radius:50%; background:#98a2b3; }
.whatsapp-connection-state.is-connected { border-color:rgba(34,199,122,.28); color:#22a66a; }
.whatsapp-connection-state.is-connected i { background:#22c77a; }
 .whatsapp-disconnect-row {
  display:flex;
  justify-content:center;
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid var(--divider);
}
.disconnect-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 14px;
  border:1px solid var(--danger);
  border-radius:9px;
  background:transparent;
  color:var(--danger);
  font-size:11px;
  font-weight:700;
}
.disconnect-button:disabled { opacity:.55; }
.notification-card { padding:0; overflow:hidden; }
.notification-card-heading {
  width:100%;
  padding:15px;
  border:0;
  background:transparent;
  color:var(--text);
  text-align:left;
}
.notification-chevron { width:17px; height:17px; transform:rotate(-90deg); transition:transform .18s ease; }
.embedded-notification-section.is-collapsed .notification-chevron { transform:rotate(-180deg); }
.notification-options { padding:0 15px 8px; }
.embedded-notification-section.is-collapsed .notification-options { display:none; }
.notification-option {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:55px;
  border-top:1px solid var(--divider);
}
.notification-option-icon { display:grid; place-items:center; flex:0 0 30px; color:var(--muted); }
.notification-option-icon .i { width:19px; height:19px; }
.notification-option-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:2px; }
.notification-option-copy strong { font-size:12px; font-weight:600; }
.notification-option-copy small { color:var(--muted); font-size:10px; }
.notification-switch {
  position:relative;
  flex:0 0 38px;
  width:38px;
  height:22px;
  padding:0;
  border:0;
  border-radius:99px;
  background:var(--surface-2);
  box-shadow:inset 0 0 0 1px var(--border);
}
.notification-switch::after {
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--muted);
  transition:transform .18s ease,background .18s ease;
}
.notification-switch[aria-checked="true"] { background:var(--accent); box-shadow:none; }
.notification-switch[aria-checked="true"]::after { transform:translateX(16px); background:#fff; }
/* [ADDED] Free users see premium-only notification controls as locked, not enabled. */
.notification-option.is-premium-locked {
  opacity:.48;
}
.notification-option.is-premium-locked .notification-option-icon,
.notification-option.is-premium-locked .notification-option-copy {
  color:var(--muted);
}
.notification-switch.is-premium-locked {
  display:grid;
  place-items:center;
  overflow:visible;
  background:var(--surface-2);
  box-shadow:inset 0 0 0 1px var(--border);
}
.notification-switch.is-premium-locked::after { display:none; }
.notification-lock-crown {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  line-height:1;
  filter:none;
}
.notification-lock-crown .premium-crown-svg {
  width:17px;
  height:17px;
  transform:rotate(22deg);
}
.notification-switch.is-premium-locked:focus-visible {
  outline:2px solid #d9a441;
  outline-offset:3px;
}
.notification-coming-soon { opacity:.62; }
.coming-soon-pill {
  flex:0 0 auto;
  padding:4px 7px;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:9px;
  font-weight:800;
  letter-spacing:.05em;
}
@media(max-width:380px) {
  .whatsapp-account-card,.notification-card { margin-left:12px; margin-right:12px; }
  .whatsapp-account-avatar { flex-basis:42px; width:42px; height:42px; }
  .disconnect-button { padding:0 8px; font-size:9px; }
  .notification-card-heading { padding:13px; }
  .notification-options { padding-left:13px; padding-right:13px; }
}


/* [MODIFIED] Notification controls are nested inside the WhatsApp connection card. */
.whatsapp-account-card { overflow:hidden; }
.whatsapp-account-card .embedded-notification-section {
  margin-top:14px;
  border-top:1px solid var(--divider);
}
.whatsapp-account-card .notification-card-heading {
  padding:14px 0 12px;
}
.whatsapp-account-card .notification-options {
  padding:0 0 4px;
}
.whatsapp-account-card .notification-option:first-child {
  border-top:1px solid var(--divider);
}


/* [ADDED] Professional data cleanup section, nested in the WhatsApp account card. */
.whatsapp-account-card .embedded-history-section {
  margin-top: 6px;
  border-top: 1px solid var(--divider);
}
.history-section-heading {
  display:flex;
  align-items:center;
  gap:11px;
  padding:15px 0 12px;
}
.history-heading-icon { color:var(--danger); background:rgba(226,75,75,.10); }
.history-cleanup-list { padding-bottom:4px; }
.history-cleanup-item {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:58px;
  border-top:1px solid var(--divider);
}
.history-cleanup-icon {
  display:grid;
  place-items:center;
  flex:0 0 30px;
  color:var(--muted);
}
.history-cleanup-icon .i { width:19px; height:19px; }
.history-cleanup-copy {
  display:flex;
  flex:1;
  min-width:0;
  flex-direction:column;
  gap:3px;
}
.history-cleanup-copy strong { font-size:12px; font-weight:600; }
.history-cleanup-copy small { color:var(--muted); font-size:10px; line-height:1.35; }
.history-trash-action {
  display:grid;
  place-items:center;
  flex:0 0 30px;
  width:30px;
  height:30px;
  border-radius:8px;
  color:var(--danger);
  background:rgba(226,75,75,.09);
}
.history-trash-action .i { width:16px; height:16px; }


/* [MODIFIED] History and data cleanup section supports expand/collapse. */
.history-section-heading {
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.history-chevron {
  flex:0 0 17px;
  width:17px;
  height:17px;
  transform:rotate(-90deg);
  transition:transform .18s ease;
}
.embedded-history-section.is-collapsed .history-chevron { transform:rotate(-180deg); }
.embedded-history-section.is-collapsed .history-cleanup-list { display:none; }


/* [ADDED] Cleanup actions are interactive buttons styled as compact list rows. */
button.history-cleanup-item {
  width:100%;
  padding:0;
  border-right:0;
  border-bottom:0;
  border-left:0;
  background:transparent;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
button.history-cleanup-item:active { background:var(--surface-2); }
button.history-cleanup-item:disabled { opacity:.5; cursor:wait; }


/* [MODIFIED] Profile surfaces use the same soft neumorphic treatment as the web UI. */
#accountPage .profile-identity-card,
#accountPage .whatsapp-account-card {
  border:1px solid color-mix(in srgb,var(--text) 5%,transparent);
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow:
    7px 7px 16px color-mix(in srgb,#000 22%,transparent),
    -5px -5px 14px color-mix(in srgb,#fff 3%,transparent),
    inset 1px 1px 1px color-mix(in srgb,#fff 4%,transparent);
}
#accountPage .settings-heading-icon,
#accountPage .whatsapp-account-avatar,
#accountPage .history-cleanup-icon,
#accountPage .notification-option-icon {
  filter:drop-shadow(1px 1px 1px color-mix(in srgb,#000 16%,transparent));
}
#accountPage .notification-card-heading,
#accountPage .history-section-heading {
  transition:background .18s ease;
}
#accountPage .notification-card-heading:active,
#accountPage .history-section-heading:active {
  background:color-mix(in srgb,var(--surface-2) 70%,transparent);
}


/* [ADDED] WAGRAM Premium subscription selector. */
.premium-sheet { z-index:35; align-items:flex-end; }
.premium-panel {
  max-height: min(92dvh, 820px);
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:10px 18px calc(18px + env(safe-area-inset-bottom));
  border:1px solid color-mix(in srgb,var(--text) 6%,transparent);
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow:10px 10px 28px rgba(0,0,0,.22),-5px -5px 18px rgba(255,255,255,.035);
}
.premium-close {
  position:absolute;
  top:14px;
  right:16px;
  width:32px;
  height:32px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:22px;
}
.premium-heading { display:flex; align-items:flex-start; gap:12px; padding:5px 42px 17px 0; }
.premium-crown {
  display:grid;
  place-items:center;
  flex:0 0 42px;
  width:42px;
  height:42px;
  border-radius:13px;
  background:linear-gradient(145deg,#ffe5a0,#d9a441);
  color:#49320a;
  box-shadow:4px 4px 9px rgba(0,0,0,.12),-3px -3px 8px rgba(255,255,255,.08);
}
.premium-crown .i { width:22px; height:22px; }
.premium-eyebrow { color:#c28c28; font-size:9px; font-weight:850; letter-spacing:.13em; }
.premium-heading h2 { margin-top:3px; font-size:21px; font-weight:800; letter-spacing:-.5px; }
.premium-subtitle { margin-top:4px; color:var(--muted); font-size:11px; }
.premium-duration-tabs {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
  padding:5px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--bg);
  box-shadow:inset 3px 3px 7px rgba(0,0,0,.07),inset -3px -3px 7px rgba(255,255,255,.035);
}
.premium-duration-tab {
  min-height:39px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}
.premium-duration-tab.active {
  background:linear-gradient(145deg,#ffe5a0,#d9a441);
  color:#3d2b08;
  box-shadow:3px 3px 8px rgba(0,0,0,.12),-2px -2px 6px rgba(255,255,255,.12);
}
.premium-price-panel {
  margin-top:13px;
  padding:15px;
  border:1px solid color-mix(in srgb,#d9a441 28%,var(--border));
  border-radius:16px;
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow:6px 6px 14px rgba(0,0,0,.10),-4px -4px 12px rgba(255,255,255,.035);
}
.premium-plan-label { color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.1em; }
.premium-price-line { display:flex; align-items:baseline; flex-wrap:wrap; gap:9px; margin-top:5px; }
.premium-price-line del { color:var(--muted); font-size:13px; }
.premium-price-line strong { color:var(--text); font-size:29px; font-weight:850; letter-spacing:-1px; }
.premium-price-note { margin-top:2px; color:#c28c28; font-size:10px; font-weight:650; }
.premium-session-benefit {
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:13px;
  padding-top:12px;
  border-top:1px solid var(--divider);
}
.premium-session-icon {
  display:grid;
  place-items:center;
  flex:0 0 36px;
  width:36px;
  height:36px;
  border-radius:10px;
  background:var(--accent-soft);
  color:var(--accent);
}
.premium-session-icon .i { width:19px; height:19px; }
.premium-session-benefit > span:last-child { display:flex; flex-direction:column; gap:3px; }
.premium-session-benefit strong { font-size:12px; }
.premium-session-benefit small { color:var(--muted); font-size:10px; }
.premium-benefits,.premium-free-comparison { margin-top:16px; }
.premium-benefits h3,.premium-free-comparison h3 { margin-bottom:9px; font-size:13px; font-weight:800; }
.premium-benefit-list { display:grid; gap:9px; }
.premium-benefit-list > div { display:flex; align-items:flex-start; gap:8px; color:var(--text); font-size:11px; line-height:1.4; }
.premium-benefit-list .i { flex:0 0 15px; width:15px; height:15px; color:var(--accent); }
.premium-free-comparison {
  padding:12px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--surface-2);
}
.premium-comparison-row {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:8px 0;
  border-top:1px solid var(--divider);
  font-size:10px;
}
.premium-comparison-row > span { color:var(--muted); }
.premium-comparison-row > strong { display:flex; flex-direction:column; align-items:flex-end; gap:3px; text-align:right; }
.premium-no { color:var(--muted); font-weight:600; }
.premium-yes { color:var(--accent); font-weight:700; }
.premium-continue-button {
  width:100%;
  min-height:47px;
  margin-top:15px;
  border:0;
  border-radius:12px;
  background:linear-gradient(135deg,#ffe5a0,#d9a441);
  color:#382708;
  font-size:13px;
  font-weight:850;
  box-shadow:5px 5px 12px rgba(0,0,0,.14),-3px -3px 9px rgba(255,255,255,.08);
}
.premium-payment-note { margin-top:8px; color:var(--muted); font-size:9px; text-align:center; }
@media(max-width:380px) {
  .premium-panel { padding-left:14px; padding-right:14px; }
  .premium-heading h2 { font-size:19px; }
  .premium-price-line strong { font-size:26px; }
}


/* [MODIFIED] Compact Premium sheet so the main action stays visible on mobile. */
.premium-panel {
  max-height:94dvh;
  padding:8px 16px calc(12px + env(safe-area-inset-bottom));
  overflow-y:auto;
}
.premium-panel .sheet-handle { margin-bottom:9px; }
.premium-heading { gap:10px; padding:2px 38px 10px 0; }
.premium-crown { flex-basis:36px; width:36px; height:36px; border-radius:11px; }
.premium-crown .i { width:19px; height:19px; }
.premium-heading h2 { font-size:18px; }
.premium-subtitle { font-size:10px; }
.premium-duration-tabs { padding:4px; gap:4px; border-radius:11px; }
.premium-duration-tab { min-height:34px; font-size:11px; }
.premium-price-panel { margin-top:9px; padding:11px 12px; border-radius:13px; }
.premium-price-line { margin-top:3px; gap:8px; }
.premium-price-line strong { font-size:25px; }
.premium-price-line del { font-size:11px; }
.premium-price-note { font-size:9px; }
.premium-session-benefit { gap:8px; margin-top:9px; padding-top:9px; }
.premium-session-icon { flex-basis:30px; width:30px; height:30px; border-radius:9px; }
.premium-session-icon .i { width:16px; height:16px; }
.premium-session-benefit strong { font-size:11px; }
.premium-session-benefit small { font-size:9px; }
.premium-benefits { margin-top:11px; }
.premium-benefits h3 { margin-bottom:7px; font-size:12px; }
.premium-benefit-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 10px; }
.premium-benefit-list > div { gap:6px; font-size:10px; line-height:1.3; }
.premium-benefit-list .i { flex-basis:13px; width:13px; height:13px; }
.premium-continue-button {
  position:sticky;
  bottom:0;
  z-index:2;
  min-height:44px;
  margin-top:12px;
  box-shadow:0 -8px 14px color-mix(in srgb,var(--surface) 75%,transparent),5px 5px 12px rgba(0,0,0,.14);
}
.premium-payment-note { margin-top:5px; font-size:8px; }
@media(max-height:760px) {
  .premium-panel { max-height:96dvh; }
  .premium-heading { padding-bottom:7px; }
  .premium-price-panel { margin-top:7px; padding:9px 11px; }
  .premium-benefits { margin-top:8px; }
  .premium-benefit-list { gap:5px 8px; }
  .premium-continue-button { margin-top:9px; }
}
@media(max-width:380px) {
  .premium-panel { padding-left:13px; padding-right:13px; }
  .premium-heading h2 { font-size:17px; }
  .premium-price-line strong { font-size:23px; }
}


/* [ADDED] Compact Free vs Premium comparison table. */
.premium-comparison { margin-top:11px; }
.premium-comparison h3 { margin-bottom:7px; font-size:12px; font-weight:800; }
.premium-comparison-scroll {
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-2);
}
.premium-comparison-table {
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  font-size:9px;
}
.premium-comparison-table th,
.premium-comparison-table td {
  padding:7px 6px;
  border-bottom:1px solid var(--divider);
  text-align:center;
  vertical-align:middle;
  overflow-wrap:anywhere;
}
.premium-comparison-table th {
  padding-top:9px;
  padding-bottom:9px;
  color:var(--muted);
  font-size:9px;
  font-weight:800;
  background:color-mix(in srgb,var(--surface) 65%,var(--surface-2));
}
.premium-comparison-table th:first-child,
.premium-comparison-table td:first-child {
  width:56%;
  padding-left:10px;
  text-align:left;
}
.premium-comparison-table th:last-child { color:#c28c28; }
.premium-comparison-table tr:last-child td { border-bottom:0; }
.premium-table-check {
  color:var(--accent);
  font-size:15px;
  font-weight:900;
  line-height:1;
}
.premium-table-dash { color:var(--muted); font-size:14px; }
.premium-comparison-table td:nth-child(3) { font-weight:700; }
@media(max-width:380px) {
  .premium-comparison-table { font-size:8px; }
  .premium-comparison-table th,.premium-comparison-table td { padding:6px 4px; }
  .premium-comparison-table th:first-child,.premium-comparison-table td:first-child { padding-left:8px; }
}


/* [MODIFIED] Show the existing WAGRAM brand mark inside the gold Premium tile. */
.premium-crown { overflow:hidden; }
.premium-crown img {
  display:block;
  width:29px;
  height:29px;
  object-fit:contain;
}
/* [MODIFIED] WhatsApp mark for the Premium multi-session benefit. */
.premium-session-icon {
  background:rgba(37,211,102,.12);
  color:#25d366;
}
.premium-session-icon .i { width:21px; height:21px; }


/* [ADDED] Account-level dropdown controls beside WhatsApp connection status. */
.whatsapp-controls-toggle {
  display:grid;
  place-items:center;
  flex:0 0 30px;
  width:30px;
  height:30px;
  margin-left:-4px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface-2);
  color:var(--muted);
  box-shadow:2px 2px 5px rgba(0,0,0,.10),-2px -2px 5px rgba(255,255,255,.025);
}
.whatsapp-controls-toggle .i {
  width:16px;
  height:16px;
  transform:rotate(-90deg);
  transition:transform .2s ease;
}
.whatsapp-controls-toggle[aria-expanded="true"] .i { transform:rotate(90deg); }
.whatsapp-account-controls {
  overflow:hidden;
  max-height:1800px;
  opacity:1;
  transition:max-height .25s ease,opacity .2s ease;
}
.whatsapp-account-controls.is-collapsed {
  max-height:0;
  opacity:0;
  pointer-events:none;
}
.whatsapp-account-controls .embedded-notification-section,
.whatsapp-account-controls .embedded-history-section { border-top:1px solid var(--divider); }
@media(max-width:380px) {
  .whatsapp-account-row { gap:7px; }
  .whatsapp-connection-state { padding:0 7px; font-size:9px; }
  .whatsapp-controls-toggle { flex-basis:28px; width:28px; height:28px; }
}


/* [ADDED] Add-session action aligned to the far right of the WhatsApp heading. */
.whatsapp-add-session-button {
  display:grid;
  place-items:center;
  flex:0 0 34px;
  width:34px;
  height:34px;
  margin-left:auto;
  border:1px solid rgba(37,211,102,.28);
  border-radius:11px;
  background:rgba(37,211,102,.10);
  color:#25d366;
  box-shadow:2px 2px 6px rgba(0,0,0,.12),-2px -2px 6px rgba(255,255,255,.025);
  transition:transform .15s ease,background .15s ease;
}
.whatsapp-add-session-button:active {
  transform:scale(.94);
  background:rgba(37,211,102,.18);
}
.whatsapp-add-session-button .i { width:19px; height:19px; stroke-width:2.2; }
.whatsapp-add-session-button > span { display:block; font-size:27px; font-weight:400; line-height:1; }
.whatsapp-account-rows { display:flex; flex-direction:column; gap:12px; }
.whatsapp-account-row { display:flex; align-items:center; gap:10px; }
.whatsapp-account-select { display:flex; align-items:center; gap:12px; flex:1; min-width:0; padding:0; border:0; background:transparent; color:inherit; text-align:left; }
.whatsapp-account-select .whatsapp-account-copy { flex:1; min-width:0; }
.whatsapp-account-select .whatsapp-account-copy strong,
.whatsapp-account-select .whatsapp-account-copy span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.whatsapp-account-disconnect { flex:0 0 auto; padding:8px 10px; border:1px solid rgba(255,90,90,.25); border-radius:10px; background:rgba(255,90,90,.08); color:var(--danger,#ff7777); font-size:11px; }
.whatsapp-account-disconnect:disabled { opacity:.35; }


/* [ADDED] Full-screen WAGRAM splash loader with an organic, wavy process ring. */
.app-loading-screen {
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:
    radial-gradient(ellipse at 50% 48%,rgba(8,104,53,.34) 0%,rgba(3,54,31,.20) 34%,transparent 66%),
    linear-gradient(145deg,#031b11 0%,#052719 48%,#03170f 100%);
  opacity:1;
  visibility:visible;
  transition:opacity .32s ease,visibility .32s ease;
}
.app-loading-screen.is-hidden {
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
.loading-brand-wrap {
  position:relative;
  display:grid;
  place-items:center;
  width:190px;
  height:190px;
  isolation:isolate;
}
.loading-brand-wrap::before {
  content:"";
  position:absolute;
  inset:20px;
  z-index:-1;
  border-radius:50%;
  background:rgba(0,113,56,.23);
  filter:blur(24px);
  animation:loading-pulse 2.4s ease-in-out infinite;
}
.loading-process-ring {
  position:absolute;
  inset:0;
  border-radius:48% 52% 55% 45% / 46% 43% 57% 54%;
  background:conic-gradient(
    from 0deg,
    rgba(37,211,102,.12) 0deg,
    rgba(37,211,102,.22) 75deg,
    #b6e96b 150deg,
    #f4d46c 220deg,
    #d9a441 280deg,
    rgba(37,211,102,.18) 360deg
  );
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 5px),#000 calc(100% - 3.5px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 5px),#000 calc(100% - 3.5px));
  filter:drop-shadow(0 0 8px rgba(217,164,65,.36));
  animation:
    loading-ring-spin 2.8s linear infinite,
    loading-ring-morph 3.8s ease-in-out infinite;
}
.loading-process-ring::after {
  content:"";
  position:absolute;
  top:4px;
  left:50%;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#fff2b5;
  box-shadow:0 0 8px 3px rgba(255,220,119,.75),0 0 20px 7px rgba(217,164,65,.35);
  transform:translateX(-50%);
}
.loading-brand-logo {
  display:block;
  width:104px;
  height:104px;
  object-fit:contain;
  filter:drop-shadow(0 5px 14px rgba(0,0,0,.28));
  animation:loading-logo-breathe 2.4s ease-in-out infinite;
}
@keyframes loading-ring-spin {
  to { transform:rotate(360deg); }
}
@keyframes loading-ring-morph {
  0%,100% { border-radius:48% 52% 55% 45% / 46% 43% 57% 54%; }
  25% { border-radius:55% 45% 48% 52% / 54% 48% 52% 46%; }
  50% { border-radius:44% 56% 51% 49% / 48% 56% 44% 52%; }
  75% { border-radius:52% 48% 43% 57% / 42% 52% 48% 58%; }
}
@keyframes loading-logo-breathe {
  0%,100% { transform:scale(1); }
  50% { transform:scale(1.045); }
}
@keyframes loading-pulse {
  0%,100% { opacity:.55; transform:scale(.92); }
  50% { opacity:1; transform:scale(1.08); }
}
/* [MODIFIED] Refine welcome spacing and keep the primary action compact. */
.onboarding-welcome {
  justify-content:center;
  padding:30px 24px calc(34px + env(safe-area-inset-bottom));
}
.onboarding-welcome-logo {
  width:88px;
  height:88px;
  margin-bottom:26px;
  padding:15px;
  border-radius:26px;
}
.onboarding-welcome-logo img {
  max-width:58px;
  max-height:58px;
}
.onboarding-welcome-kicker {
  margin-bottom:11px;
  font-size:8px;
  letter-spacing:.18em;
}
.onboarding-welcome h1 {
  font-size:clamp(28px,7.2vw,35px);
  line-height:1.1;
}
.onboarding-welcome-description {
  max-width:285px;
  margin:13px auto 27px;
  font-size:12px;
  line-height:1.6;
}
.onboarding-welcome-button {
  width:min(100%,280px);
  min-height:50px;
  margin:0 auto;
  border-radius:15px;
  font-size:13px;
}
@media(max-height:740px) {
  .onboarding-welcome { padding-top:22px; padding-bottom:calc(26px + env(safe-area-inset-bottom)); }
  .onboarding-welcome-logo { width:80px; height:80px; margin-bottom:21px; }
  .onboarding-welcome-logo img { max-width:52px; max-height:52px; }
  .onboarding-welcome-description { margin-bottom:22px; }
  .onboarding-welcome-button { min-height:48px; }
}
/* [MODIFIED] Override the shared full-width button rule on the welcome screen. */
.onboarding-welcome .onboarding-welcome-button {
  display:inline-flex;
  flex:0 0 auto;
  align-self:center;
  width:220px;
  max-width:82%;
  min-height:48px;
  padding:0 24px;
}
/* [ADDED] Brand marks for the WhatsApp–Telegram onboarding visual. */
.onboarding-app-tile svg {
  display:block;
  width:39px;
  height:39px;
  color:#fff;
  fill:currentColor;
}
.onboarding-whatsapp-tile svg { width:38px; height:38px; }
.onboarding-telegram-tile svg { width:40px; height:40px; }
.onboarding-app-tile {
  border-color:rgba(255,255,255,.58);
  box-shadow:0 12px 28px rgba(0,0,0,.075),inset 0 1px 0 rgba(255,255,255,.8);
}
/* [MODIFIED] Hero artwork replaces the standalone logo on the welcome screen. */
.onboarding-hero-art {
  position:relative;
  z-index:1;
  display:block;
  width:min(100%,390px);
  height:auto;
  max-height:42vh;
  margin:0 auto 4px;
  object-fit:contain;
  mix-blend-mode:screen;
  filter:drop-shadow(0 18px 28px rgba(0,45,24,.18));
}
.onboarding-welcome {
  gap:0;
  padding:18px 22px calc(28px + env(safe-area-inset-bottom));
}
.onboarding-welcome-kicker { margin-top:0; margin-bottom:10px; }
.onboarding-welcome h1 { font-size:clamp(27px,7.2vw,35px); }
.onboarding-welcome-description { margin:12px auto 22px; }
.onboarding-welcome-button { width:220px; max-width:82%; min-height:48px; }
.onboarding-pagination { padding-top:8px; }
@media(max-height:740px) {
  .onboarding-hero-art { width:min(100%,320px); max-height:36vh; margin-bottom:0; }
  .onboarding-welcome { padding-top:8px; padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
  .onboarding-welcome-description { margin:9px auto 17px; }
  .onboarding-welcome-button { min-height:46px; }
}
/* [MODIFIED] Welcome screen follows the supplied premium WAGRAM composition. */
.onboarding-welcome {
  position:relative;
  justify-content:flex-start;
  min-height:100%;
  padding:clamp(14px,3vh,30px) 18px calc(24px + env(safe-area-inset-bottom));
  overflow:hidden;
  background:
    radial-gradient(ellipse at 50% 18%,rgba(0,255,112,.26),transparent 38%),
    radial-gradient(ellipse at 8% 62%,rgba(0,190,95,.17),transparent 34%),
    linear-gradient(155deg,#003d27 0%,#005b35 42%,#003b29 100%);
}
.onboarding-welcome::before {
  content:"";
  position:absolute;
  inset:0;
  width:auto;
  height:auto;
  border:0;
  border-radius:0;
  background:radial-gradient(ellipse at 50% 38%,rgba(22,255,120,.12),transparent 55%);
  pointer-events:none;
}
.onboarding-welcome::after {
  content:"";
  position:absolute;
  inset:auto -25% -26% -25%;
  width:auto;
  height:48%;
  border:1px solid rgba(115,255,169,.18);
  border-radius:50%;
  transform:rotate(-12deg);
  pointer-events:none;
}
.onboarding-hero-art {
  flex:0 0 auto;
  width:min(100%,440px);
  height:auto;
  max-height:43vh;
  margin:0 auto 4px;
  overflow:visible;
  object-fit:contain;
  mix-blend-mode:normal;
  filter:drop-shadow(0 20px 30px rgba(0,0,0,.2));
}
.onboarding-welcome-kicker {
  position:relative;
  z-index:1;
  margin:0 auto 13px;
  color:rgba(232,255,240,.78);
  font-size:9px;
  font-weight:800;
  letter-spacing:.28em;
  text-align:center;
}
.onboarding-welcome h1 {
  position:relative;
  z-index:1;
  margin:0 auto;
  color:#fff;
  font-size:clamp(30px,8vw,43px);
  font-weight:850;
  line-height:1.04;
  letter-spacing:-.045em;
  text-align:center;
}
.onboarding-welcome-description {
  position:relative;
  z-index:1;
  max-width:330px;
  margin:15px auto 22px;
  color:rgba(235,255,242,.82);
  font-size:clamp(13px,3.5vw,16px);
  line-height:1.55;
  text-align:center;
}
.onboarding-hero-benefits {
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap;
  gap:8px;
  width:100%;
  max-width:450px;
  margin:0 auto 25px;
}
.onboarding-hero-benefits span {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:40px;
  padding:0 12px;
  border:1px solid rgba(196,255,216,.22);
  border-radius:999px;
  background:rgba(0,75,43,.35);
  color:rgba(245,255,248,.94);
  font-size:10px;
  font-weight:650;
  white-space:nowrap;
  backdrop-filter:blur(10px);
}
.onboarding-hero-benefits b {
  color:#8DFFB6;
  font-size:16px;
  font-weight:800;
}
.onboarding-welcome-button {
  position:relative;
  z-index:1;
  align-self:center;
  width:min(72%,360px);
  max-width:360px;
  min-height:54px;
  margin:0 auto;
  border:1px solid rgba(180,255,201,.78);
  border-radius:999px;
  background:linear-gradient(110deg,#12D95F,#08B94F 55%,#00A844);
  color:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,255,255,.28);
  font-size:15px;
}
.onboarding-welcome-button:active { transform:translateY(1px); }
.onboarding-pagination { position:relative; z-index:1; padding-top:10px; }
@media(max-height:760px) {
  .onboarding-welcome { padding-top:10px; padding-bottom:calc(14px + env(safe-area-inset-bottom)); }
  .onboarding-hero-art { max-height:36vh; width:min(100%,360px); }
  .onboarding-welcome-description { margin:10px auto 14px; }
  .onboarding-hero-benefits { margin-bottom:16px; gap:5px; }
  .onboarding-hero-benefits span { min-height:35px; padding:0 8px; font-size:9px; }
  .onboarding-welcome-button { min-height:48px; }
}
@media(max-width:360px) {
  .onboarding-hero-benefits { gap:4px; }
  .onboarding-hero-benefits span { gap:4px; padding:0 7px; font-size:8px; }
}
@media(prefers-reduced-motion:reduce) {
  .loading-process-ring,.loading-brand-logo,.loading-brand-wrap::before { animation:none; }
}


/* [ADDED] WAGRAM compact bottom navigation: icons only, active item expands inline. */
.bottom-nav {
  align-items: center;
  gap: 8px;
}

.nav-item {
  min-width: 0;
  min-height: 48px;
  flex-direction: row;
  justify-content: center;
  gap: 0;
  padding: 0 10px;
  border-radius: 16px;
  transition:
    flex-grow .24s ease,
    background .24s ease,
    color .24s ease,
    box-shadow .24s ease,
    transform .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-item span {
  display: none;
}

.nav-item .i {
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  transition: transform .24s ease;
}

.nav-item.selected {
  flex-grow: 1.35;
  gap: 9px;
  padding: 0 17px;
}

.nav-item.selected span {
  display: inline;
  overflow: hidden;
  max-width: 100px;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  animation: nav-label-in .22s ease both;
}

.nav-item.selected .i {
  transform: scale(1.04);
}

.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@keyframes nav-label-in {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 360px) {
  .bottom-nav {
    gap: 5px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .nav-item {
    padding-right: 7px;
    padding-left: 7px;
  }

  .nav-item.selected {
    gap: 7px;
    padding-right: 11px;
    padding-left: 11px;
  }

  .nav-item.selected span {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item,
  .nav-item .i {
    transition: none;
  }

  .nav-item.selected span {
    animation: none;
  }
}


/* [MODIFIED] Give the selected tab enough width for its full label. */
.bottom-nav {
  display: flex;
}

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

.nav-item.selected {
  flex: 1.9 1 0;
}

.nav-item.selected span {
  max-width: 120px;
}


/* [ADDED] Unread counters float above their bottom navigation icons. */
.nav-item {
  position: relative;
}

.nav-item .nav-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 7px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  pointer-events: none;
}

.nav-item.selected .nav-badge {
  left: calc(50% - 17px);
  border-color: #079c4b;
}

.nav-item .nav-badge.hidden {
  display: none;
}


/* [ADDED] Media players and document cards in the conversation timeline. */
.audio-card,
.document-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.audio-card > .i,
.document-card > .i {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}

.audio-card span,
.document-card span {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
  font-size: 13px;
}

.document-card strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card small {
  color: var(--muted);
  font-size: 11px;
}

.media-audio {
  display: block;
  width: min(100%, 280px);
  min-height: 42px;
  margin: 6px 0;
}

/* [ADDED] Minimal locked-media preview for Free membership. */
.locked-media {
  display:flex;
  flex-direction:column;
  gap:7px;
  width:min(100%,280px);
  margin:5px 0;
  padding:10px 11px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-2);
}
.locked-media-heading {
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--text);
}
.locked-media-heading > .i {
  width:17px;
  height:17px;
  color:var(--muted);
}
.locked-media-heading strong {
  font-size:12px;
  font-weight:700;
  text-transform:capitalize;
}
.locked-media-lock {
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  margin-left:auto;
  border-radius:7px;
  background:color-mix(in srgb,#d9a441 13%,transparent);
  color:#d9a441;
}
.locked-media-lock .i { width:13px; height:13px; }
.locked-media-copy {
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}
.locked-media-upgrade {
  display:inline-flex;
  align-items:center;
  align-self:flex-start;
  gap:5px;
  min-height:24px;
  padding:2px 0;
  border:0;
  background:transparent;
  color:#c99a3c;
  font-size:11px;
  font-weight:750;
  text-align:left;
}
.locked-media-upgrade:active { opacity:.7; }
.locked-media-upgrade:focus-visible {
  outline:2px solid #d9a441;
  outline-offset:3px;
  border-radius:4px;
}



/* [ADDED] Red visual state for WhatsApp messages revoked for everyone. */
.message.deleted {
  border: 1px solid color-mix(in srgb, var(--danger) 42%, transparent);
  background: color-mix(in srgb, var(--danger-soft) 82%, var(--surface));
  box-shadow: inset 3px 0 0 var(--danger);
}
.message.deleted .message-text,
.message.deleted .message-meta,
.message.deleted .message-sender {
  color: color-mix(in srgb, var(--danger) 88%, var(--text));
}
.message-status {
  margin-bottom: 5px;
  color: var(--danger);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .01em;
}


/* [MODIFIED] Blue visual state for WhatsApp messages edited after sending. */
.message.edited {
  border: 1px solid color-mix(in srgb, var(--info) 42%, transparent);
  background: color-mix(in srgb, var(--info-soft) 82%, var(--surface));
  box-shadow: inset 3px 0 0 var(--info);
}
.message.edited .message-text,
.message.edited .message-meta,
.message.edited .message-sender,
.message-edited {
  color: color-mix(in srgb, var(--info) 90%, var(--text));
}
.message-edited {
  margin-left: 4px;
  font-size: 10px;
  font-style: italic;
  opacity: .85;
}


/* [MODIFIED] Show the pre-edit version as a separate bubble with a short elbow connector. */
.message-history-group {
  display:flex;
  flex-direction:column;
  align-self:flex-start;
  width:fit-content;
  max-width:100%;
  cursor:pointer;
}
.message-history-group.outgoing {
  align-self:flex-end;
}
.message-history-group .original-version {
  box-sizing:border-box;
  max-height:0;
  margin:0;
  padding:0 12px;
  overflow:hidden;
  border-width:0;
  opacity:0;
  transform:translateY(-7px);
  transition:
    max-height .38s cubic-bezier(.2,.75,.25,1),
    margin .38s cubic-bezier(.2,.75,.25,1),
    padding .38s cubic-bezier(.2,.75,.25,1),
    border-width .2s ease,
    opacity .22s ease,
    transform .38s cubic-bezier(.2,.75,.25,1);
}
.message-history-group .original-version .message-text,
.message-history-group .original-version .message-meta {
  opacity:0;
  transition:opacity .2s ease;
}
.message-history-group .original-version .message-meta {
  color:var(--muted);
  font-size:10px;
}
.message-history-group .edit-connector {
  box-sizing:border-box;
  width:14px;
  height:0;
  margin-left:20px;
  overflow:hidden;
  opacity:0;
  transition:
    height .32s cubic-bezier(.2,.75,.25,1),
    opacity .2s ease;
}
.message-history-group .edit-connector::before {
  content:"";
  display:block;
  width:12px;
  height:9px;
  border-left:2px solid var(--info);
  border-bottom:2px solid var(--info);
  border-bottom-left-radius:5px;
}
.message-history-group.show-original .original-version {
  max-height:220px;
  margin-bottom:2px;
  padding:8px 12px 6px;
  border-width:1px;
  border-color:color-mix(in srgb,var(--info) 30%,var(--border));
  background:color-mix(in srgb,var(--info-soft) 35%,var(--surface));
  opacity:1;
  transform:translateY(0);
}
.message-history-group.show-original .original-version .message-text,
.message-history-group.show-original .original-version .message-meta {
  opacity:1;
}
.message-history-group.show-original .edit-connector {
  height:11px;
  opacity:1;
}
.message-history-group > .message.edited {
  transition:transform .38s cubic-bezier(.2,.75,.25,1);
}
.message-history-group.show-original > .message.edited {
  transform:translateY(0);
}
@media(prefers-reduced-motion:reduce) {
  .message-history-group .original-version,
  .message-history-group .original-version .message-text,
  .message-history-group .original-version .message-meta,
  .message-history-group .edit-connector,
  .message-history-group > .message.edited {
    transition:none;
  }
}


/* [ADDED] Orange Premium treatment for locked group and channel rows. */
.chat-row-content.is-premium-locked,
.chat-swipe-row.is-premium-locked .chat-row-content {
  background: color-mix(in srgb, #f59e0b 9%, var(--surface));
  border-color: color-mix(in srgb, #f59e0b 28%, var(--border));
}
.chat-row-content.is-premium-locked .item-title,
.chat-swipe-row.is-premium-locked .item-title {
  color: #f5a623;
}
/* [ADDED] Anchor the tilted Premium crown above the group/channel avatar. */
.chat-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}
.premium-chat-crown {
  position: absolute;
  top: -9px;
  right: -7px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.premium-chat-crown .premium-crown-svg {
  width: 22px;
  height: 22px;
  transform: rotate(22deg);
}
.chat-row-content.is-premium-locked .item-sub {
  color: #d99a32;
}


/* [ADDED] Premium crown badge above the add-session button in Profile. */
.whatsapp-add-session-button {
  position: relative;
}
.whatsapp-add-session-button.is-session-locked {
  opacity:1;
}
/* [MODIFIED] Give the Premium crown on the WhatsApp add button a clearer size and right tilt. */
.whatsapp-add-session-button.is-session-locked::after {
  content:"";
  position:absolute;
  top:-9px;
  right:-8px;
  z-index:2;
  width:23px;
  height:23px;
  background:url("./assets/premium-crown.svg") center / contain no-repeat;
  transform:rotate(22deg);
  transform-origin:center;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.35));
}


/* [MODIFIED] Premium-only notification switches look darker and carry a tilted crown. */
.notification-option.is-premium-locked {
  opacity: 1;
}
.notification-option.is-premium-locked .notification-option-icon,
.notification-option.is-premium-locked .notification-option-copy {
  color: var(--muted);
  opacity: .58;
}
/* [MODIFIED] Keep the green toggle visible in a darker Premium-locked state. */
.notification-switch.is-premium-locked {
  display: block;
  overflow: visible;
  background: #17633f;
  box-shadow: inset 0 0 0 1px #287b54;
}
.notification-switch.is-premium-locked::after {
  display: block;
  transform: translateX(16px);
  background: #a8c9b7;
}
/* [MODIFIED] Place the tilted crown just above the dark-green toggle. */
.notification-lock-crown {
  position: absolute;
  top: -12px;
  right: -5px;
  left: auto;
  bottom: auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 13px;
  line-height: 1;
  filter: none;
  transform: rotate(22deg);
  pointer-events: none;
}


/* [MODIFIED] Prevent the WhatsApp profile card from clipping Premium crowns. */
#accountPage .whatsapp-account-card {
  overflow: visible;
}
#accountPage .embedded-notification-section,
#accountPage .notification-options,
#accountPage .notification-option {
  overflow: visible;
}
#accountPage .notification-option {
  position: relative;
}
#accountPage .notification-switch.is-premium-locked {
  position: relative;
  z-index: 5;
}
#accountPage .notification-lock-crown {
  z-index: 20;
}


/* [MODIFIED] The expanded WhatsApp controls wrapper was the remaining clipping ancestor. */
#accountPage .whatsapp-account-controls:not(.is-collapsed) {
  overflow: visible !important;
}
#accountPage .whatsapp-account-controls:not(.is-collapsed) .embedded-notification-section,
#accountPage .whatsapp-account-controls:not(.is-collapsed) .notification-options,
#accountPage .whatsapp-account-controls:not(.is-collapsed) .notification-option {
  overflow: visible !important;
}
#accountPage .whatsapp-account-controls:not(.is-collapsed) .notification-lock-crown {
  z-index: 999;
}


/* [ADDED] Free WhatsApp session pause status: yellow and tappable only while paused. */
.whatsapp-connection-state {
  font: inherit;
  cursor: default;
}
.whatsapp-connection-state:disabled {
  opacity: 1;
}
.whatsapp-connection-state.is-paused {
  border-color: rgba(234,179,8,.48);
  background: rgba(234,179,8,.10);
  color: #d6a51c;
  cursor: pointer;
}
.whatsapp-connection-state.is-paused i {
  background: #eab308;
}
.whatsapp-connection-state.is-paused:active {
  background: rgba(234,179,8,.18);
}


/* [MODIFIED] Three-step WAGRAM onboarding inspired by the supplied visual direction. */
.onboarding-screen {
  position:fixed;
  inset:0;
  z-index:9998;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  padding:calc(20px + env(safe-area-inset-top)) 22px calc(18px + env(safe-area-inset-bottom));
  background:var(--bg);
  color:var(--text);
  opacity:1;
  transition:opacity .28s ease,transform .28s ease;
}
.onboarding-screen.hidden { display:none !important; }
.onboarding-screen.is-dismissed { opacity:0; transform:translateY(8px); pointer-events:none; }
.onboarding-content { width:100%; max-width:460px; margin:auto; padding:24px 0 18px; }
.onboarding-welcome-logo {
  position:relative;
  z-index:1;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  width:104px;
  height:104px;
  margin:0 auto 30px;
  padding:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.24);
  border-radius:30px;
  background:rgba(255,255,255,.12);
  box-shadow:0 18px 45px rgba(0,60,30,.18),inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter:blur(12px);
}
.onboarding-welcome-logo img {
  display:block;
  width:100%;
  height:100%;
  max-width:68px;
  max-height:68px;
  object-fit:contain;
}
.onboarding-welcome {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:calc(100% + 44px);
  max-width:none;
  min-height:calc(100% + 38px + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  margin:calc(-20px - env(safe-area-inset-top)) -22px calc(-18px - env(safe-area-inset-bottom));
  padding:42px 30px calc(50px + env(safe-area-inset-bottom));
  border-radius:0;
  background:radial-gradient(ellipse at 80% 18%,rgba(255,255,255,.13),transparent 34%),linear-gradient(145deg,#08b95c 0%,#079b4c 52%,#04783e 100%);
  color:#fff;
  text-align:center;
}
.onboarding-welcome::before,.onboarding-welcome::after { content:""; position:absolute; width:270px; height:270px; border:1px solid rgba(255,255,255,.10); border-radius:44% 56% 60% 40%; pointer-events:none; }
.onboarding-welcome::before { top:7%; right:-145px; transform:rotate(28deg); }
.onboarding-welcome::after { bottom:9%; left:-190px; transform:rotate(-24deg); }
.onboarding-hero-mark {
  position:relative;
  z-index:1;
  display:grid;
  place-items:center;
  width:116px;
  height:116px;
  margin:0 auto 32px;
  border:1px solid rgba(255,255,255,.24);
  border-radius:34px;
  background:rgba(255,255,255,.12);
  box-shadow:0 18px 45px rgba(0,60,30,.18),inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter:blur(12px);
}
.onboarding-hero-mark img { width:82px; height:82px; object-fit:contain; }
.onboarding-welcome-kicker { position:relative; z-index:1; margin:0 0 13px; color:rgba(255,255,255,.78); font-size:9px; font-weight:850; letter-spacing:.2em; }
.onboarding-welcome h1 { position:relative; z-index:1; margin:0; color:#fff; font-size:clamp(30px,8vw,39px); font-weight:820; line-height:1.12; letter-spacing:-.045em; text-align:center; }
.onboarding-welcome-description { position:relative; z-index:1; max-width:300px; margin:16px auto 34px; color:rgba(255,255,255,.88); font-size:13px; line-height:1.65; text-align:center; }
.onboarding-welcome-button { position:relative; z-index:1; border:1px solid rgba(255,255,255,.8); background:#fff; color:#087b42; box-shadow:0 12px 28px rgba(0,60,30,.18); }
.onboarding-welcome-button:active { box-shadow:0 5px 14px rgba(0,60,30,.14); }
.onboarding-eyebrow { margin:0 0 12px; color:var(--accent); font-size:9px; font-weight:850; letter-spacing:.2em; text-align:center; }
.onboarding-content h2 { margin:0; font-size:clamp(27px,7vw,34px); font-weight:780; line-height:1.1; letter-spacing:-.05em; text-align:center; }
.onboarding-content h2 span { color:var(--accent); }
.onboarding-description { max-width:340px; margin:12px auto 22px; color:var(--muted); font-size:12px; line-height:1.65; text-align:center; }
.onboarding-sync-visual { display:flex; align-items:center; justify-content:center; gap:15px; margin:22px auto 27px; }
.onboarding-app-tile { display:grid; place-items:center; width:94px; height:94px; border:1px solid var(--border); border-radius:27px; background:var(--surface); box-shadow:0 12px 30px rgba(0,0,0,.07),inset 0 1px 0 rgba(255,255,255,.7); }
.onboarding-app-tile span { display:grid; place-items:center; width:58px; height:58px; border-radius:19px; color:#fff; font-size:36px; font-weight:850; }
.onboarding-whatsapp-tile span { background:linear-gradient(145deg,#25d366,#07994b); }
.onboarding-telegram-tile span { padding-right:4px; background:linear-gradient(145deg,#36b9f5,#168bd2); }
.onboarding-sync-arrows { color:var(--accent); font-size:27px; font-weight:800; }
.onboarding-sync { max-width:440px; }
.onboarding-sync .onboarding-description { margin-bottom:22px; }
.onboarding-benefit-list { display:grid; gap:9px; margin:0 0 23px; }
.onboarding-benefit { display:flex; align-items:center; gap:13px; min-height:62px; padding:11px 13px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.onboarding-benefit>span { display:grid; place-items:center; flex:0 0 34px; width:34px; height:34px; border-radius:11px; background:var(--accent-soft); color:var(--accent); font-size:19px; font-weight:800; }
.onboarding-benefit strong { display:block; font-size:12px; font-weight:800; }
.onboarding-benefit small { display:block; margin-top:3px; color:var(--muted); font-size:10px; line-height:1.4; }
.onboarding-primary { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; min-height:52px; border:1px solid var(--accent); border-radius:14px; background:var(--accent); color:#fff; font-size:13px; font-weight:780; box-shadow:0 8px 22px rgba(8,105,68,.16); transition:transform .18s ease,box-shadow .18s ease; }
.onboarding-primary:active { transform:translateY(1px); }
.onboarding-primary span { font-size:18px; font-weight:400; }
.onboarding-plans { max-width:520px; padding:10px 0 8px; }
.onboarding-plans .onboarding-description { margin:9px auto 17px; }
.onboarding-plan-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.onboarding-plan-card { min-width:0; padding:14px 12px 13px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.onboarding-plan-card.is-premium { border-color:rgba(190,151,79,.55); background:linear-gradient(155deg,rgba(190,151,79,.075),var(--surface) 72%); }
.onboarding-plan-label { display:block; margin-bottom:7px; color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.16em; }
.onboarding-plan-card.is-premium .onboarding-plan-label { color:#b58b43; }
.onboarding-plan-price { display:block; margin-bottom:10px; font-size:16px; font-weight:780; letter-spacing:-.025em; }
.onboarding-plan-card ul { display:grid; gap:7px; margin:0; padding-left:13px; color:var(--muted); font-size:10px; line-height:1.4; }
.onboarding-plan-card li::marker { color:var(--accent); }
.onboarding-plan-card.is-premium li::marker { color:#b58b43; }
.onboarding-footnote { margin:11px 0 14px; color:var(--muted); font-size:9px; text-align:center; }
.onboarding-back { display:block; margin:8px auto 0; padding:8px 18px; border:0; background:transparent; color:var(--muted); font-size:11px; font-weight:650; }
.onboarding-pagination { display:flex; justify-content:center; gap:7px; flex:0 0 auto; padding:10px 0 2px; }
.onboarding-pagination span { width:6px; height:6px; border-radius:99px; background:var(--border); transition:width .2s ease,background .2s ease; }
.onboarding-pagination span.active { width:19px; background:var(--accent); }
@media(max-height:740px) {
  .onboarding-screen { padding-top:calc(12px + env(safe-area-inset-top)); padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
  .onboarding-welcome { min-height:calc(100% + 24px + env(safe-area-inset-top) + env(safe-area-inset-bottom)); margin-top:calc(-12px - env(safe-area-inset-top)); margin-bottom:calc(-12px - env(safe-area-inset-bottom)); }
  .onboarding-hero-mark { width:88px; height:88px; margin-bottom:24px; border-radius:27px; }
  .onboarding-hero-mark img { width:64px; height:64px; }
  .onboarding-content { padding:14px 0 10px; }
  .onboarding-sync-visual { margin:13px auto 17px; }
  .onboarding-app-tile { width:76px; height:76px; border-radius:22px; }
  .onboarding-app-tile span { width:48px; height:48px; font-size:29px; }
  .onboarding-benefit-list { gap:6px; margin-bottom:13px; }
  .onboarding-benefit { min-height:54px; padding:8px 10px; }
  .onboarding-plan-card { padding:9px 8px; }
  .onboarding-plan-price { margin-bottom:6px; }
  .onboarding-plan-card ul { gap:5px; font-size:9px; }
  .onboarding-footnote { margin:7px 0 9px; }
  .onboarding-primary { min-height:47px; }
}
@media(max-width:360px) {
  .onboarding-screen { padding-left:16px; padding-right:16px; }
  .onboarding-plan-card { padding:9px 7px; }
  .onboarding-plan-card ul { font-size:8px; }
}
@media(prefers-reduced-motion:reduce) {
  .onboarding-screen,.onboarding-primary,.onboarding-pagination span { transition:none; }
}}

/* [ADDED] Onboarding neumorphism aligned with the main WAGRAM web interface. */
.onboarding-screen {
  padding:calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  background:var(--bg);
  color:var(--text);
}
.onboarding-welcome {
  position:relative;
  isolation:isolate;
  width:100%;
  min-height:0;
  max-width:480px;
  margin:auto;
  padding:clamp(20px,4vh,34px) 20px 26px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:30px;
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  color:var(--text);
  box-shadow:10px 10px 26px rgba(16,24,40,.10),-8px -8px 22px rgba(255,255,255,.78);
  text-align:center;
}
.onboarding-welcome::before,
.onboarding-welcome::after {
  width:210px;
  height:210px;
  border-color:color-mix(in srgb,var(--accent) 13%,transparent);
}
.onboarding-welcome::before { top:-125px; right:-110px; }
.onboarding-welcome::after { bottom:-140px; left:-120px; }
.onboarding-hero-art {
  position:relative;
  z-index:1;
  display:block;
  width:min(100%,360px);
  max-height:36vh;
  margin:0 auto 4px;
  object-fit:contain;
  filter:drop-shadow(5px 7px 10px rgba(0,0,0,.10));
}
.onboarding-welcome-kicker {
  position:relative;
  z-index:1;
  margin:4px 0 10px;
  color:var(--accent);
  font-size:9px;
  font-weight:850;
  letter-spacing:.18em;
}
.onboarding-welcome h1 {
  position:relative;
  z-index:1;
  color:var(--text);
  font-size:clamp(28px,7.5vw,36px);
}
.onboarding-welcome-description {
  position:relative;
  z-index:1;
  max-width:310px;
  margin:12px auto 20px;
  color:var(--muted);
}
.onboarding-hero-benefits {
  position:relative;
  z-index:1;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 20px;
}
.onboarding-hero-benefits span {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:36px;
  padding:0 11px;
  border:1px solid var(--border);
  border-radius:12px;
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  color:var(--text);
  font-size:10px;
  font-weight:700;
  box-shadow:inset 3px 3px 7px rgba(16,24,40,.055),inset -3px -3px 7px rgba(255,255,255,.8);
}
.onboarding-hero-benefits b { color:var(--accent); }
.onboarding-welcome-button,
.onboarding-primary {
  border:1px solid var(--accent);
  border-radius:15px;
  background:linear-gradient(145deg,#20c96b,#087b3d);
  color:#06130a;
  box-shadow:5px 5px 12px rgba(0,120,55,.18),-4px -4px 10px rgba(255,255,255,.62),inset 1px 1px 2px rgba(255,255,255,.24);
}
.onboarding-welcome-button {
  width:min(100%,250px);
  min-height:50px;
}
.onboarding-welcome-button:active,
.onboarding-primary:active {
  transform:translateY(1px);
  box-shadow:inset 3px 3px 7px rgba(0,0,0,.12),inset -2px -2px 5px rgba(255,255,255,.14);
}
.onboarding-content {
  color:var(--text);
}
.onboarding-benefit,
.onboarding-plan-card {
  border:1px solid var(--border);
  border-radius:17px;
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow:5px 5px 12px rgba(16,24,40,.07),-4px -4px 10px rgba(255,255,255,.72);
}
.onboarding-app-tile {
  border:1px solid var(--border);
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow:6px 6px 14px rgba(16,24,40,.09),-5px -5px 13px rgba(255,255,255,.78);
}
.onboarding-back {
  color:var(--muted);
}
html[data-theme="dark"] .onboarding-welcome {
  border-color:rgba(89,132,101,.18);
  background:linear-gradient(145deg,#142018,#0d1510);
  box-shadow:9px 9px 22px rgba(0,0,0,.48),-5px -5px 14px rgba(37,75,48,.07);
}
html[data-theme="dark"] .onboarding-hero-benefits span,
html[data-theme="dark"] .onboarding-benefit,
html[data-theme="dark"] .onboarding-plan-card,
html[data-theme="dark"] .onboarding-app-tile {
  border-color:rgba(79,119,88,.16);
  background:linear-gradient(145deg,#142018,#0d1510);
  box-shadow:5px 5px 12px rgba(0,0,0,.34),-3px -3px 9px rgba(37,72,46,.06);
}
html[data-theme="dark"] .onboarding-welcome h1 { color:var(--text); }
html[data-theme="dark"] .onboarding-welcome-button,
html[data-theme="dark"] .onboarding-primary {
  background:linear-gradient(145deg,#20c96b,#087b3d);
  color:#06130a;
  box-shadow:4px 5px 12px rgba(0,0,0,.32),inset 1px 1px 2px rgba(255,255,255,.08);
}
@media(max-height:740px) {
  .onboarding-welcome { padding-top:16px; padding-bottom:18px; }
  .onboarding-hero-art { max-height:32vh; width:min(100%,330px); }
}
@media(max-width:360px) {
  .onboarding-screen { padding-left:12px; padding-right:12px; }
  .onboarding-welcome { padding-left:14px; padding-right:14px; border-radius:24px; }
}



/* [ADDED] Full-viewport onboarding layout: remove the enclosing card. */
.onboarding-screen {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:stretch;
  width:100vw;
  height:100vh;
  height:100dvh;
  min-height:100vh;
  min-height:100dvh;
  padding:0;
  margin:0;
  overflow:hidden;
  background:
    radial-gradient(ellipse at 50% 24%,rgba(25,116,66,.16),transparent 48%),
    linear-gradient(155deg,#08130c 0%,#0b1710 52%,#07100b 100%);
}

.onboarding-welcome {
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  height:auto;
  min-height:0;
  max-width:none;
  margin:0;
  padding:calc(18px + env(safe-area-inset-top)) 22px calc(14px + env(safe-area-inset-bottom));
  overflow:hidden;
  border:0;
  border-radius:0;
  background:transparent;
  color:#eef8f0;
  box-shadow:none;
}

.onboarding-welcome::before,
.onboarding-welcome::after {
  border-color:rgba(65,190,112,.12);
  pointer-events:none;
}

.onboarding-hero-art {
  flex:0 1 auto;
  width:min(100%,440px);
  max-height:42vh;
  margin:0 auto 10px;
}

.onboarding-welcome h1 {
  color:#eef8f0;
}

.onboarding-welcome-description {
  color:rgba(220,235,224,.66);
}

.onboarding-hero-benefits {
  flex-wrap:wrap;
  margin-bottom:20px;
}

.onboarding-hero-benefits span {
  background:linear-gradient(145deg,#142219,#0c1710);
  border-color:rgba(89,150,108,.14);
  color:#e4f1e7;
  box-shadow:5px 5px 12px rgba(0,0,0,.34),-3px -3px 9px rgba(37,72,46,.06);
}

.onboarding-welcome-button {
  flex:0 0 auto;
}

.onboarding-pagination {
  flex:0 0 auto;
  width:100%;
  padding:8px 0 calc(14px + env(safe-area-inset-bottom));
  background:transparent;
}

@media(max-height:740px) {
  .onboarding-welcome {
    padding-top:calc(10px + env(safe-area-inset-top));
    padding-bottom:8px;
  }
  .onboarding-hero-art {
    width:min(100%,380px);
    max-height:38vh;
    margin-bottom:6px;
  }
  .onboarding-welcome-description {
    margin-top:10px;
    margin-bottom:14px;
  }
  .onboarding-hero-benefits {
    margin-bottom:14px;
  }
}

@media(max-width:360px) {
  .onboarding-welcome {
    padding-left:14px;
    padding-right:14px;
  }
}


/* [ADDED] Supplied onboarding benefit SVGs, styled to match WAGRAM neumorphism. */
.onboarding-hero-benefits .onboarding-benefit-icon {
  display:block;
  flex:0 0 auto;
  width:16px;
  height:16px;
  color:#39d889;
  fill:currentColor;
  opacity:.96;
}

.onboarding-hero-benefits span:first-child .onboarding-benefit-icon {
  width:15px;
  height:15px;
}

.onboarding-hero-benefits span:nth-child(2) .onboarding-benefit-icon {
  width:17px;
  height:17px;
}

.onboarding-hero-benefits span:nth-child(3) .onboarding-benefit-icon {
  width:16px;
  height:16px;
}


/* [ADDED] Premium selection step uses the same edge-to-edge viewport as welcome. */
.onboarding-screen:has(#onboardingFeatures:not(.hidden)) {
  width:100vw;
  height:100vh;
  height:100dvh;
  min-height:100vh;
  min-height:100dvh;
  padding:0;
  overflow:hidden;
}

.onboarding-plans {
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  justify-content:center;
  align-items:stretch;
  width:100%;
  max-width:none;
  min-height:0;
  margin:0;
  padding:clamp(18px,4vh,34px) clamp(16px,4vw,26px) 12px;
}

.onboarding-plans .onboarding-eyebrow {
  margin:0 0 12px;
  font-size:10px;
}

.onboarding-plans h2 {
  margin:0;
  font-size:clamp(29px,7.5vw,38px);
  line-height:1.08;
}

.onboarding-plans .onboarding-description {
  max-width:420px;
  margin:12px auto clamp(20px,4vh,32px);
  font-size:clamp(13px,3.5vw,15px);
}

.onboarding-plan-grid {
  width:100%;
  max-width:760px;
  margin:0 auto;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(10px,2.5vw,18px);
}

.onboarding-plan-card {
  min-height:0;
  padding:clamp(14px,3vh,22px) clamp(12px,3vw,20px);
  border-radius:20px;
  background:linear-gradient(145deg,#142219,#0c1710);
  border-color:rgba(89,150,108,.16);
  box-shadow:6px 6px 16px rgba(0,0,0,.30),-3px -3px 10px rgba(37,72,46,.06);
}

.onboarding-plan-card.is-premium {
  border-color:rgba(190,151,79,.30);
  background:linear-gradient(145deg,#1b1b13,#10170f);
}

.onboarding-plan-label {
  margin-bottom:10px;
  font-size:10px;
}

.onboarding-plan-price {
  margin-bottom:12px;
  font-size:clamp(17px,4.3vw,21px);
}

.onboarding-plan-card ul {
  gap:clamp(7px,1.5vh,11px);
  padding-left:14px;
  font-size:clamp(10px,2.8vw,13px);
  line-height:1.4;
}

.onboarding-plans .onboarding-footnote {
  margin:14px 0 18px;
  font-size:11px;
  text-align:center;
}

.onboarding-plans .onboarding-primary {
  width:100%;
  max-width:520px;
  min-height:56px;
  align-self:center;
  margin:0 auto;
  border-radius:18px;
  font-size:15px;
}

.onboarding-plans .onboarding-back {
  margin:12px auto 0;
  padding:10px 20px;
  font-size:13px;
}

.onboarding-pagination {
  width:100%;
  flex:0 0 auto;
  padding:10px 0 calc(14px + env(safe-area-inset-bottom));
}

@media(max-height:740px) {
  .onboarding-plans {
    padding-top:calc(10px + env(safe-area-inset-top));
    padding-bottom:6px;
  }
  .onboarding-plans .onboarding-description {
    margin-top:8px;
    margin-bottom:14px;
  }
  .onboarding-plan-card {
    padding:12px 10px;
  }
  .onboarding-plan-price {
    margin-bottom:8px;
  }
  .onboarding-plan-card ul {
    gap:6px;
    font-size:10px;
  }
  .onboarding-plans .onboarding-footnote {
    margin:10px 0 12px;
  }
  .onboarding-plans .onboarding-primary {
    min-height:50px;
  }
  .onboarding-plans .onboarding-back {
    margin-top:6px;
    padding:7px 16px;
  }
  .onboarding-pagination {
    padding-top:6px;
    padding-bottom:calc(8px + env(safe-area-inset-bottom));
  }
}

@media(max-width:360px) {
  .onboarding-plans {
    padding-left:12px;
    padding-right:12px;
  }
  .onboarding-plan-grid {
    gap:8px;
  }
  .onboarding-plan-card {
    padding:11px 9px;
  }
  .onboarding-plan-card ul {
    font-size:9px;
  }
}


/* [ADDED] Compact WAGRAM countdown chip beside the WhatsApp Connect state. */
.free-pause-countdown {
  display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center;
  min-width:42px; min-height:30px; padding:0 7px;
  border:1px solid rgba(234,179,8,.24); border-radius:8px;
  background:linear-gradient(145deg,rgba(234,179,8,.10),rgba(13,25,17,.82));
  color:#d9b45a; font-size:10px; font-weight:700; font-variant-numeric:tabular-nums;
  letter-spacing:.3px; line-height:1;
  box-shadow:3px 3px 8px rgba(0,0,0,.22),-2px -2px 6px rgba(44,76,51,.06);
}

/* [ADDED] Connecting state for the profile WhatsApp status button. */
.whatsapp-connection-state.is-connecting {
  border-color:rgba(234,179,8,.32);
  color:#d9b45a;
  opacity:.9;
}
.whatsapp-connection-state.is-connecting i {
  width:7px;
  height:7px;
  background:#d9b45a;
  animation:whatsapp-connecting-pulse 1s ease-in-out infinite;
}
@keyframes whatsapp-connecting-pulse {
  50% { opacity:.35; transform:scale(.8); }
}


/* [MODIFIED] Countdown is integrated into the WhatsApp status button. */
.whatsapp-connection-state .free-pause-countdown {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:0;
  margin-left:3px;
  padding:0 0 0 8px;
  border:0;
  border-left:1px solid currentColor;
  border-radius:0;
  background:none;
  color:inherit;
  font-size:10px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  letter-spacing:.2px;
  line-height:1;
  box-shadow:none;
}
.whatsapp-connection-state .free-pause-countdown.hidden {
  display:none;
}


/* [ADDED] Premium subscription status below the plan badge. */
.profile-membership-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}
.profile-membership-meta:empty { display:none; }


/* [ADDED] Full-page Premium purchase experience replaces the bottom sheet. */
.premium-page-content {
  border: 1px solid color-mix(in srgb,var(--text) 6%,transparent);
  border-radius: 18px;
  background: linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow: 8px 8px 24px rgba(0,0,0,.12),-4px -4px 14px rgba(255,255,255,.025);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}

.premium-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 16px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.premium-page-content {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 0 20px;
}
.premium-page .premium-panel,
.premium-page-content .premium-panel {
  max-height: none;
  overflow: visible;
}
.premium-page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  margin: 0 0 12px -7px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.premium-page-back .i { width: 18px; height: 18px; }
.premium-page .premium-heading { padding-top: 8px; }
.premium-page .premium-continue-button {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
}
.premium-page .premium-payment-note { padding-bottom: 4px; }
body.premium-page-active #bottomNav { display: none !important; }
body.premium-page-active #topbarSearchWrap,
body.premium-page-active #addContactButton { display: none !important; }
body.premium-page-active .premium-sheet { display: none !important; }
@media (min-width: 700px) {
  .premium-page { padding-right: 24px; padding-left: 24px; }
  .premium-page-content { padding-top: 14px; }
}


/* [MODIFIED] Premium is a headerless, fixed 100vh screen with all content fitted without page scrolling. */
html, body {
  overscroll-behavior: none;
}
body.premium-page-active {
  height: 100vh;
  height: 100dvh;
  overflow: hidden !important;
  touch-action: none;
}
body.premium-page-active .app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}
body.premium-page-active .topbar,
body.premium-page-active #bottomNav {
  display: none !important;
}
body.premium-page-active #premiumPage {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex !important;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  box-sizing: border-box;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
body.premium-page-active .premium-page-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding: 7px 12px 8px;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  gap: 0;
}
body.premium-page-active .premium-page-back {
  flex: 0 0 29px;
  min-height: 29px;
  margin: 0 0 4px -5px;
}
body.premium-page-active .premium-heading {
  flex: 0 0 auto;
  gap: 9px;
  padding: 2px 0 7px;
}
body.premium-page-active .premium-crown {
  flex-basis: 32px;
  width: 32px;
  height: 32px;
}
body.premium-page-active .premium-crown img {
  width: 25px;
  height: 25px;
}
body.premium-page-active .premium-heading h2 {
  margin-top: 1px;
  font-size: clamp(15px, 4.2vw, 18px);
}
body.premium-page-active .premium-subtitle {
  margin-top: 2px;
  font-size: 9px;
}
body.premium-page-active .premium-duration-tabs {
  flex: 0 0 39px;
  min-height: 39px;
  padding: 3px;
}
body.premium-page-active .premium-duration-tab {
  min-height: 31px;
}
body.premium-page-active .premium-price-panel {
  flex: 0 0 auto;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 12px;
}
body.premium-page-active .premium-price-line {
  margin-top: 1px;
  gap: 7px;
}
body.premium-page-active .premium-price-line strong {
  font-size: clamp(21px, 6vw, 25px);
}
body.premium-page-active .premium-price-note {
  margin-top: 0;
  font-size: 8px;
}
body.premium-page-active .premium-session-benefit {
  gap: 7px;
  margin-top: 6px;
  padding-top: 6px;
}
body.premium-page-active .premium-session-icon {
  flex-basis: 25px;
  width: 25px;
  height: 25px;
}
body.premium-page-active .premium-session-icon .i {
  width: 15px;
  height: 15px;
}
body.premium-page-active .premium-session-benefit strong {
  font-size: 10px;
}
body.premium-page-active .premium-session-benefit small {
  font-size: 8px;
}
body.premium-page-active .premium-comparison {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 7px;
}
body.premium-page-active .premium-comparison h3 {
  flex: 0 0 auto;
  margin: 0 0 4px;
  font-size: 11px;
}
body.premium-page-active .premium-comparison-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
body.premium-page-active .premium-comparison-table {
  height: 100%;
  font-size: 8px;
}
body.premium-page-active .premium-comparison-table th,
body.premium-page-active .premium-comparison-table td {
  padding: 3px 5px;
  line-height: 1.1;
}
body.premium-page-active .premium-comparison-table th {
  padding-top: 5px;
  padding-bottom: 5px;
}
body.premium-page-active .premium-table-check {
  font-size: 13px;
}
body.premium-page-active .premium-continue-button {
  position: static;
  flex: 0 0 42px;
  min-height: 42px;
  margin-top: 7px;
  font-size: 12px;
}
body.premium-page-active .premium-payment-note {
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 0;
  font-size: 7px;
  line-height: 1.2;
}
@media (max-height: 700px) {
  body.premium-page-active .premium-page-content { padding-top: 4px; padding-bottom: 4px; }
  body.premium-page-active .premium-page-back { flex-basis: 25px; min-height: 25px; margin-bottom: 2px; }
  body.premium-page-active .premium-heading { padding-bottom: 4px; }
  body.premium-page-active .premium-price-panel { margin-top: 5px; padding: 6px 8px; }
  body.premium-page-active .premium-comparison { margin-top: 5px; }
  body.premium-page-active .premium-comparison-table th,
  body.premium-page-active .premium-comparison-table td { padding-top: 2px; padding-bottom: 2px; }
  body.premium-page-active .premium-continue-button { flex-basis: 38px; min-height: 38px; margin-top: 5px; }
}


/* [ADDED] Premium page visual polish: cleaner hierarchy, calmer surfaces and clearer plan selection. */
body.premium-page-active #premiumPage {
  background:
    radial-gradient(ellipse at 88% 3%, color-mix(in srgb,#d9a441 12%,transparent), transparent 38%),
    var(--bg);
}
body.premium-page-active .premium-page-content {
  position: relative;
  gap: 0;
  padding: 9px 14px 10px;
  background: transparent;
}
body.premium-page-active .premium-page-back {
  width: fit-content;
  padding: 0 9px 0 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb,var(--surface) 78%,transparent);
  color: var(--muted);
  font-size: 11px;
  transition: background .18s ease, color .18s ease;
}
body.premium-page-active .premium-heading {
  position: relative;
  align-items: center;
  gap: 11px;
  padding: 5px 0 12px;
}
body.premium-page-active .premium-crown {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(217,164,65,.34);
  border-radius: 14px;
  background: linear-gradient(145deg,#fff0c5,#e4b957);
  box-shadow: 0 5px 14px rgba(164,116,30,.16);
}
body.premium-page-active .premium-crown img {
  width: 30px;
  height: 30px;
}
body.premium-page-active .premium-eyebrow {
  color: #b8872d;
  font-size: 9px;
  letter-spacing: .16em;
}
body.premium-page-active .premium-heading h2 {
  margin-top: 3px;
  font-size: clamp(17px,4.6vw,20px);
  font-weight: 850;
  letter-spacing: -.65px;
  line-height: 1.15;
}
body.premium-page-active .premium-subtitle {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
}
body.premium-page-active .premium-duration-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb,var(--surface) 82%,var(--bg));
  box-shadow: none;
}
body.premium-page-active .premium-duration-tab {
  min-height: 34px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
body.premium-page-active .premium-duration-tab.active {
  background: linear-gradient(135deg,#f5d98f,#d9a441);
  color: #382708;
  box-shadow: 0 2px 7px rgba(151,105,25,.2);
}
body.premium-page-active .premium-price-panel {
  position: relative;
  margin-top: 9px;
  padding: 10px 12px 9px;
  border: 1px solid color-mix(in srgb,#d9a441 34%,var(--border));
  border-radius: 14px;
  background: linear-gradient(125deg,color-mix(in srgb,#d9a441 9%,var(--surface)),var(--surface));
  box-shadow: 0 4px 14px rgba(0,0,0,.045);
}
body.premium-page-active .premium-plan-label {
  font-size: 9px;
  letter-spacing: .13em;
}
body.premium-page-active .premium-price-line strong {
  font-size: clamp(24px,6.5vw,29px);
  letter-spacing: -1.1px;
}
body.premium-page-active .premium-price-line del {
  font-size: 11px;
}
body.premium-page-active .premium-price-note {
  color: #a97920;
  font-size: 9px;
}
body.premium-page-active .premium-session-benefit {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb,#d9a441 20%,var(--divider));
}
body.premium-page-active .premium-session-icon {
  flex-basis: 29px;
  width: 29px;
  height: 29px;
  border-radius: 9px;
}
body.premium-page-active .premium-session-benefit strong {
  font-size: 10px;
  font-weight: 800;
}
body.premium-page-active .premium-session-benefit small {
  font-size: 8px;
}
body.premium-page-active .premium-comparison {
  margin-top: 10px;
}
body.premium-page-active .premium-comparison h3 {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -.15px;
}
body.premium-page-active .premium-comparison-scroll {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(0,0,0,.035);
}
body.premium-page-active .premium-comparison-table {
  font-size: 9px;
}
body.premium-page-active .premium-comparison-table th {
  background: color-mix(in srgb,var(--surface-2) 82%,var(--bg));
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .02em;
}
body.premium-page-active .premium-comparison-table th:last-child {
  color: #a97920;
}
body.premium-page-active .premium-comparison-table td:first-child {
  color: var(--text);
  font-weight: 600;
}
body.premium-page-active .premium-comparison-table td:nth-child(2) {
  color: var(--muted);
}
body.premium-page-active .premium-comparison-table td:nth-child(3) {
  color: var(--text);
  font-weight: 750;
}
body.premium-page-active .premium-table-dash {
  color: #a0a0a0;
  font-size: 8px;
}
body.premium-page-active .premium-table-check {
  color: #159b58;
  font-size: 14px;
}
body.premium-page-active .premium-continue-button {
  min-height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg,#f4d78e,#d8a33e);
  color: #342507;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .01em;
  box-shadow: 0 5px 13px rgba(166,119,31,.2);
  transition: transform .16s ease, filter .16s ease;
}
body.premium-page-active .premium-continue-button:active {
  transform: translateY(1px) scale(.995);
  filter: brightness(.97);
}
body.premium-page-active .premium-payment-note {
  color: var(--muted);
  font-size: 8px;
}
@media (max-height:700px) {
  body.premium-page-active .premium-heading { padding-bottom: 8px; }
  body.premium-page-active .premium-crown { flex-basis: 36px; width: 36px; height: 36px; }
  body.premium-page-active .premium-crown img { width: 26px; height: 26px; }
  body.premium-page-active .premium-price-panel { margin-top: 7px; }
  body.premium-page-active .premium-comparison { margin-top: 7px; }
}


/* [ADDED] Premium page rebuilt around the clean ChatGPT Plus comparison layout. */
body.premium-page-active #premiumPage {
  background: var(--bg);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow-y: auto;
  touch-action: pan-y;
}
body.premium-page-active .premium-page-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  min-height: 100%;
  height: auto;
  max-height: none;
  margin: 0 auto;
  padding: 22px 24px 24px;
  overflow: visible;
  gap: 0;
  background: transparent;
}
body.premium-page-active .premium-page-back {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-height: 42px;
  justify-content: center;
  margin: 0 0 24px -4px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
}
body.premium-page-active .premium-page-back span { display: none; }
body.premium-page-active .premium-page-back .i { width: 21px; height: 21px; }
body.premium-page-active .premium-heading {
  display: block;
  padding: 0 0 34px;
}
body.premium-page-active .premium-crown { display: none; }
body.premium-page-active .premium-eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
body.premium-page-active .premium-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(32px, 8vw, 43px);
  font-weight: 650;
  letter-spacing: -1.8px;
  line-height: 1.12;
}
body.premium-page-active .premium-heading h2 span { color: var(--premium-accent, #d9a441); }
body.premium-page-active .premium-subtitle {
  max-width: 440px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
body.premium-page-active .premium-comparison {
  display: block;
  flex: 0 0 auto;
  min-height: 0;
  margin: 0;
}
body.premium-page-active .premium-comparison h3 {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
body.premium-page-active .premium-comparison-scroll {
  overflow: visible;
}
body.premium-page-active .premium-comparison-table {
  width: 100%;
  height: auto;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--text);
  font-size: 13px;
}
body.premium-page-active .premium-comparison-table th,
body.premium-page-active .premium-comparison-table td {
  padding: 13px 5px;
  border: 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
  text-align: center;
}
body.premium-page-active .premium-comparison-table th:first-child,
body.premium-page-active .premium-comparison-table td:first-child {
  width: 66%;
  padding-left: 0;
  text-align: left;
}
body.premium-page-active .premium-comparison-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* [ADDED] Allow the Premium duration column heading to wrap instead of clipping. */
body.premium-page-active #premiumMemberFeatures .premium-comparison-table th:last-child {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.25;
  padding-left: 8px;
  padding-right: 8px;
}
body.premium-page-active .premium-comparison-table th:last-child,
body.premium-page-active .premium-comparison-table td:last-child {
  color: var(--premium-accent, #d9a441);
}
body.premium-page-active .premium-table-check {
  color: var(--premium-accent, #d9a441);
  font-size: 19px;
  font-weight: 600;
}
body.premium-page-active .premium-table-dash {
  color: var(--muted);
  font-size: 19px;
  font-weight: 500;
}
body.premium-page-active .premium-purchase {
  margin-top: 27px;
}
body.premium-page-active .premium-purchase-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
body.premium-page-active .premium-duration-tabs {
  display: flex;
  flex: 0 0 auto;
  min-height: 44px;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
body.premium-page-active .premium-duration-tab {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
body.premium-page-active .premium-duration-tab.active {
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
}
body.premium-page-active .premium-price-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.premium-page-active .premium-plan-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
}
body.premium-page-active .premium-price-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
body.premium-page-active .premium-price-line strong {
  color: var(--text);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.7px;
}
body.premium-page-active .premium-price-line del {
  color: var(--muted);
  font-size: 12px;
}
body.premium-page-active .premium-price-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}
body.premium-page-active .premium-session-benefit {
  max-width: 145px;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}
body.premium-page-active .premium-session-icon {
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
}
body.premium-page-active .premium-session-icon .i { width: 16px; height: 16px; }
body.premium-page-active .premium-session-benefit strong {
  color: var(--text);
  font-size: 10px;
}
body.premium-page-active .premium-session-benefit small {
  color: var(--muted);
  font-size: 9px;
}
body.premium-page-active .premium-cta-wrap {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: auto -24px 0;
  padding: 18px 24px max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, color-mix(in srgb,var(--bg) 0%,transparent), var(--bg) 20%);
}
body.premium-page-active .premium-continue-button {
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  box-shadow: none;
}
body.premium-page-active .premium-payment-note {
  margin: 9px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}
@media (max-width: 380px) {
  body.premium-page-active .premium-page-content { padding-right: 18px; padding-left: 18px; }
  body.premium-page-active .premium-cta-wrap { margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  body.premium-page-active .premium-comparison-table { font-size: 12px; }
}


/* [MODIFIED] Premium screen follows the clean black-and-white subscription reference. */
body.premium-page-active #premiumPage {
  background: #000;
  color: #f7f7f7;
}
body.premium-page-active .premium-page-content {
  color: #f7f7f7;
}
body.premium-page-active .premium-page-back {
  border: 1px solid #454545;
  background: #292929;
  color: #fff;
}
body.premium-page-active .premium-eyebrow,
body.premium-page-active .premium-subtitle,
body.premium-page-active .premium-comparison h3,
body.premium-page-active .premium-comparison-table th,
body.premium-page-active .premium-price-note,
body.premium-page-active .premium-price-line del,
body.premium-page-active .premium-payment-note,
body.premium-page-active .premium-session-benefit small {
  color: #b8b8b8;
}
body.premium-page-active .premium-heading h2 {
  color: #f7f7f7;
}
body.premium-page-active .premium-heading h2 span,
body.premium-page-active .premium-comparison-table th:last-child,
body.premium-page-active .premium-comparison-table td:last-child,
body.premium-page-active .premium-table-check {
  color: #d9a441;
}
body.premium-page-active .premium-comparison-table th,
body.premium-page-active .premium-comparison-table td {
  border-bottom: 0;
  padding-top: 15px;
  padding-bottom: 15px;
}
body.premium-page-active .premium-comparison-table th:first-child,
body.premium-page-active .premium-comparison-table td:first-child {
  width: 72%;
}
body.premium-page-active .premium-comparison-table th:nth-child(2),
body.premium-page-active .premium-comparison-table td:nth-child(2),
body.premium-page-active .premium-comparison-table th:nth-child(3),
body.premium-page-active .premium-comparison-table td:nth-child(3) {
  width: 14%;
}
body.premium-page-active .premium-comparison-table td:first-child {
  color: #f2f2f2;
  font-size: 13px;
  font-weight: 500;
}
body.premium-page-active .premium-comparison-table td:nth-child(2) {
  color: #a7a7a7;
}
body.premium-page-active .premium-duration-tabs {
  border-color: #353535;
  background: #171717;
}
body.premium-page-active .premium-duration-tab {
  color: #b8b8b8;
}
body.premium-page-active .premium-duration-tab.active {
  background: #f4f4f4;
  color: #111;
}
body.premium-page-active .premium-price-panel {
  border-bottom-color: #333;
}
body.premium-page-active .premium-plan-label {
  color: #b8b8b8;
}
body.premium-page-active .premium-price-line strong,
body.premium-page-active .premium-session-benefit strong {
  color: #f7f7f7;
}
body.premium-page-active .premium-session-icon {
  border-color: #444;
  color: #f7f7f7;
}
body.premium-page-active .premium-cta-wrap {
  background: linear-gradient(to bottom, rgba(0,0,0,0), #000 20%);
}
body.premium-page-active .premium-continue-button {
  background: #f7f7f7;
  color: #111;
  font-size: 15px;
  font-weight: 750;
}
body.premium-page-active .premium-payment-note {
  color: #aaa;
}


/* [MODIFIED] Keep the complete Premium screen inside one viewport; no vertical scrolling. */
body.premium-page-active,
body.premium-page-active .app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden !important;
}
body.premium-page-active #premiumPage {
  position: fixed;
  inset: 0;
  display: flex !important;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  box-sizing: border-box;
  padding: max(8px, env(safe-area-inset-top)) 0 max(6px, env(safe-area-inset-bottom));
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}
body.premium-page-active .premium-page-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
  padding: 8px 24px 8px;
  overflow: hidden;
  gap: 0;
}
body.premium-page-active .premium-page-back {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  margin: 0 0 10px -2px;
}
body.premium-page-active .premium-heading {
  flex: 0 0 auto;
  padding: 0 0 15px;
}
body.premium-page-active .premium-eyebrow {
  margin-bottom: 4px;
  font-size: 10px;
}
body.premium-page-active .premium-heading h2 {
  font-size: clamp(27px, 7vw, 36px);
  line-height: 1.08;
}
body.premium-page-active .premium-subtitle {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.35;
}
body.premium-page-active .premium-comparison {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}
body.premium-page-active .premium-comparison h3 {
  flex: 0 0 auto;
  margin: 0 0 5px;
  font-size: 11px;
}
body.premium-page-active .premium-comparison-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
body.premium-page-active .premium-comparison-table {
  width: 100%;
  height: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}
body.premium-page-active .premium-comparison-table thead {
  height: 26px;
}
body.premium-page-active .premium-comparison-table tbody tr {
  height: calc((100% - 26px) / 8);
}
body.premium-page-active .premium-comparison-table th,
body.premium-page-active .premium-comparison-table td {
  padding: 2px 4px;
  line-height: 1.15;
  vertical-align: middle;
}
body.premium-page-active .premium-comparison-table th:first-child,
body.premium-page-active .premium-comparison-table td:first-child {
  width: 72%;
  padding-left: 0;
}
body.premium-page-active .premium-comparison-table th:nth-child(2),
body.premium-page-active .premium-comparison-table td:nth-child(2),
body.premium-page-active .premium-comparison-table th:nth-child(3),
body.premium-page-active .premium-comparison-table td:nth-child(3) {
  width: 14%;
}
body.premium-page-active .premium-comparison-table th {
  font-size: 10px;
}
body.premium-page-active .premium-comparison-table td:first-child {
  font-size: 11px;
}
body.premium-page-active .premium-table-check,
body.premium-page-active .premium-table-dash {
  font-size: 16px;
}
body.premium-page-active .premium-purchase {
  flex: 0 0 auto;
  margin-top: 8px;
}
body.premium-page-active .premium-purchase-label {
  margin-bottom: 5px;
  font-size: 10px;
}
body.premium-page-active .premium-duration-tabs {
  min-height: 36px;
  padding: 3px;
}
body.premium-page-active .premium-duration-tab {
  min-height: 28px;
  font-size: 11px;
}
body.premium-page-active .premium-price-panel {
  gap: 8px;
  margin-top: 5px;
  padding: 7px 0;
}
body.premium-page-active .premium-plan-label {
  font-size: 8px;
}
body.premium-page-active .premium-price-line {
  gap: 6px;
  margin-top: 1px;
}
body.premium-page-active .premium-price-line strong {
  font-size: 21px;
}
body.premium-page-active .premium-price-line del,
body.premium-page-active .premium-price-note {
  font-size: 8px;
}
body.premium-page-active .premium-session-benefit {
  max-width: 125px;
  gap: 5px;
}
body.premium-page-active .premium-session-icon {
  flex-basis: 24px;
  width: 24px;
  height: 24px;
}
body.premium-page-active .premium-session-icon .i {
  width: 13px;
  height: 13px;
}
body.premium-page-active .premium-session-benefit strong {
  font-size: 9px;
}
body.premium-page-active .premium-session-benefit small {
  font-size: 8px;
  line-height: 1.2;
}
body.premium-page-active .premium-cta-wrap {
  position: static;
  flex: 0 0 auto;
  margin: auto -24px 0;
  padding: 8px 24px 0;
  background: #000;
}
body.premium-page-active .premium-continue-button {
  min-height: 46px;
  height: 46px;
  font-size: 14px;
}
body.premium-page-active .premium-payment-note {
  margin-top: 5px;
  font-size: 8px;
  line-height: 1.2;
}
@media (max-height: 700px) {
  body.premium-page-active .premium-page-content { padding-top: 5px; padding-bottom: 5px; }
  body.premium-page-active .premium-page-back { flex-basis: 32px; width: 32px; height: 32px; min-height: 32px; margin-bottom: 6px; }
  body.premium-page-active .premium-heading { padding-bottom: 8px; }
  body.premium-page-active .premium-heading h2 { font-size: 28px; }
  body.premium-page-active .premium-subtitle { margin-top: 4px; font-size: 10px; }
  body.premium-page-active .premium-comparison-table thead { height: 22px; }
  body.premium-page-active .premium-comparison-table th,
  body.premium-page-active .premium-comparison-table td { padding-top: 1px; padding-bottom: 1px; }
  body.premium-page-active .premium-purchase { margin-top: 5px; }
  body.premium-page-active .premium-price-panel { padding: 4px 0; }
  body.premium-page-active .premium-continue-button { min-height: 40px; height: 40px; }
  body.premium-page-active .premium-cta-wrap { padding-top: 5px; }
}
@media (max-width: 380px) {
  body.premium-page-active .premium-page-content { padding-right: 18px; padding-left: 18px; }
  body.premium-page-active .premium-cta-wrap { margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  body.premium-page-active .premium-comparison-table td:first-child { font-size: 10px; }
}


/* [MODIFIED] Fit every Premium element within the device's visible 100dvh area. */
body.premium-page-active #premiumPage {
  box-sizing: border-box;
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}
body.premium-page-active .premium-page-content {
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
body.premium-page-active .premium-comparison {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
body.premium-page-active .premium-comparison-scroll {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
body.premium-page-active .premium-comparison-table {
  height: 100%;
  table-layout: fixed;
}
body.premium-page-active .premium-comparison-table tbody tr {
  height: calc((100% - 22px) / 8);
}
body.premium-page-active .premium-cta-wrap {
  flex: 0 0 auto;
  margin-top: auto;
}
@media (max-height: 760px) {
  body.premium-page-active .premium-page-content { padding-top: 5px; padding-bottom: 5px; }
  body.premium-page-active .premium-page-back { margin-bottom: 5px; }
  body.premium-page-active .premium-heading { padding-bottom: 8px; }
  body.premium-page-active .premium-heading h2 { font-size: clamp(25px, 6.5vw, 32px); }
  body.premium-page-active .premium-subtitle { margin-top: 5px; font-size: 11px; line-height: 1.25; }
  body.premium-page-active .premium-comparison-table th,
  body.premium-page-active .premium-comparison-table td { padding-top: 1px; padding-bottom: 1px; }
  body.premium-page-active .premium-purchase { margin-top: 5px; }
  body.premium-page-active .premium-price-panel { margin-top: 3px; padding-top: 4px; padding-bottom: 4px; }
  body.premium-page-active .premium-cta-wrap { padding-top: 5px; }
}
@media (max-height: 650px) {
  body.premium-page-active .premium-page-content { padding-top: 3px; padding-bottom: 3px; }
  body.premium-page-active .premium-page-back { flex-basis: 28px; width: 28px; height: 28px; min-height: 28px; margin-bottom: 3px; }
  body.premium-page-active .premium-heading { padding-bottom: 5px; }
  body.premium-page-active .premium-eyebrow { margin-bottom: 2px; font-size: 8px; }
  body.premium-page-active .premium-heading h2 { font-size: 25px; }
  body.premium-page-active .premium-subtitle { margin-top: 3px; font-size: 9px; }
  body.premium-page-active .premium-comparison h3 { margin-bottom: 2px; font-size: 9px; }
  body.premium-page-active .premium-comparison-table { font-size: 9px; }
  body.premium-page-active .premium-comparison-table td:first-child { font-size: 9px; }
  body.premium-page-active .premium-table-check,
  body.premium-page-active .premium-table-dash { font-size: 13px; }
  body.premium-page-active .premium-purchase-label { margin-bottom: 3px; font-size: 9px; }
  body.premium-page-active .premium-duration-tabs { min-height: 30px; }
  body.premium-page-active .premium-duration-tab { min-height: 24px; font-size: 9px; }
  body.premium-page-active .premium-price-line strong { font-size: 18px; }
  body.premium-page-active .premium-session-benefit small { display: none; }
  body.premium-page-active .premium-continue-button { min-height: 36px; height: 36px; font-size: 12px; }
  body.premium-page-active .premium-payment-note { margin-top: 3px; font-size: 7px; }
}


/* [MODIFIED] Remove the comparison card so the feature list sits directly on the page. */
body.premium-page-active .premium-comparison-scroll {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.premium-page-active .premium-comparison-table,
body.premium-page-active .premium-comparison-table thead,
body.premium-page-active .premium-comparison-table tbody,
body.premium-page-active .premium-comparison-table tr,
body.premium-page-active .premium-comparison-table th,
body.premium-page-active .premium-comparison-table td {
  background: transparent !important;
  box-shadow: none !important;
}
body.premium-page-active .premium-comparison-table th,
body.premium-page-active .premium-comparison-table td {
  border: 0 !important;
}
body.premium-page-active .premium-comparison-table th {
  padding-bottom: 9px;
}
body.premium-page-active .premium-comparison-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}


/* [MODIFIED] Remove repeated brand, plan and session labels for a cleaner Premium page. */
body.premium-page-active .premium-eyebrow,
body.premium-page-active .premium-plan-label,
body.premium-page-active .premium-session-benefit {
  display: none !important;
}


/* [MODIFIED] The comparison table stands on its own without a redundant section heading. */
body.premium-page-active .premium-comparison h3 {
  display: none !important;
}


/* [MODIFIED] Place the duration selector beside the Premium heading, above the feature list. */
body.premium-page-active .premium-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
body.premium-page-active .premium-heading > div {
  flex: 1 1 auto;
  min-width: 0;
}
body.premium-page-active #premiumDurationTabs {
  flex: 0 0 190px;
  width: 190px;
  min-width: 0;
  margin: 0 0 2px;
}
body.premium-page-active .premium-comparison {
  margin-top: 4px;
}
@media (max-width: 520px) {
  body.premium-page-active .premium-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  body.premium-page-active #premiumDurationTabs {
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
  }
}


/* [MODIFIED] Keep the duration selector inside the heading flex row, never as a full-height page item. */
body.premium-page-active .premium-heading #premiumDurationTabs {
  flex-grow: 0;
  flex-shrink: 0;
  align-self: center;
}
@media (max-width: 520px) {
  body.premium-page-active .premium-heading #premiumDurationTabs {
    flex: 0 0 100%;
    align-self: stretch;
  }
}


/* [MODIFIED] Keep the compact duration choices on the same row as the Premium title. */
body.premium-page-active .premium-heading {
  display: grid;
  grid-template-columns: minmax(0,1fr) 138px;
  align-items: center;
  column-gap: 8px;
  row-gap: 5px;
}
body.premium-page-active .premium-heading > div {
  display: contents;
}
body.premium-page-active .premium-heading h2 {
  grid-column: 1;
  grid-row: 1;
  white-space: nowrap;
  font-size: clamp(19px,5.5vw,25px);
  letter-spacing: -1px;
}
body.premium-page-active .premium-subtitle {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0;
  font-size: 11px;
}
body.premium-page-active .premium-heading #premiumDurationTabs {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex: none;
  width: 138px;
  min-width: 0;
  min-height: 31px;
  height: 31px;
  gap: 1px;
  margin: 0;
  padding: 2px;
  border-radius: 999px;
}
body.premium-page-active .premium-heading .premium-duration-tab {
  min-width: 0;
  min-height: 25px;
  height: 25px;
  padding: 0 2px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}
@media (max-width: 520px) {
  body.premium-page-active .premium-heading {
    grid-template-columns: minmax(0,1fr) 138px;
    flex-wrap: nowrap;
    align-items: center;
  }
  body.premium-page-active .premium-heading #premiumDurationTabs {
    flex: none;
    width: 138px;
  }
}
@media (max-width: 360px) {
  body.premium-page-active .premium-heading {
    grid-template-columns: minmax(0,1fr) 126px;
    column-gap: 5px;
  }
  body.premium-page-active .premium-heading h2 {
    font-size: 19px;
  }
  body.premium-page-active .premium-heading #premiumDurationTabs {
    width: 126px;
  }
  body.premium-page-active .premium-heading .premium-duration-tab {
    font-size: 8px;
  }
}


/* [MODIFIED] Keep Free and Premium comparison headers on a single line. */
body.premium-page-active .premium-comparison-table {
  table-layout: fixed;
}
body.premium-page-active .premium-comparison-table th:first-child,
body.premium-page-active .premium-comparison-table td:first-child {
  width: 64%;
}
body.premium-page-active .premium-comparison-table th:nth-child(2),
body.premium-page-active .premium-comparison-table td:nth-child(2),
body.premium-page-active .premium-comparison-table th:nth-child(3),
body.premium-page-active .premium-comparison-table td:nth-child(3) {
  width: 18%;
}
body.premium-page-active .premium-comparison-table thead th:nth-child(2),
body.premium-page-active .premium-comparison-table thead th:nth-child(3) {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  font-size: 10px;
}


/* [MODIFIED] Show the selected plan price inside the primary action button. */
body.premium-page-active .premium-price-panel {
  display: none !important;
}
body.premium-page-active .premium-continue-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}


/* [MODIFIED] Show the previous price crossed out beside the current price in the CTA. */
body.premium-page-active .premium-continue-button {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}
body.premium-page-active .premium-button-old-price {
  color: #858585;
  font-size: 11px;
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
body.premium-page-active .premium-button-old-price[hidden] {
  display: none !important;
}
body.premium-page-active .premium-button-current-price {
  color: #111;
  font-size: 15px;
  font-weight: 750;
}


/* [ADDED] Premium page follows the WAGRAM light-green neumorphic theme without introducing cards. */
body.premium-page-active {
  background: var(--bg, #edf6f0) !important;
  color: var(--text, #17251d);
}

body.premium-page-active #premiumPage,
body.premium-page-active .premium-page-content,
body.premium-page-active .premium-heading,
body.premium-page-active .premium-comparison,
body.premium-page-active .premium-comparison-scroll,
body.premium-page-active .premium-purchase,
body.premium-page-active .premium-cta-wrap {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.premium-page-active .premium-page-content {
  color: var(--text, #17251d);
}

body.premium-page-active .premium-page-back {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--border, rgba(255,255,255,.88));
  border-radius: 12px;
  background: var(--surface, #f4fbf6);
  color: var(--text, #17251d);
  box-shadow: var(--shadow, 7px 7px 18px rgba(39,88,58,.12), -7px -7px 18px rgba(255,255,255,.92));
}

body.premium-page-active .premium-heading h2 {
  color: var(--text, #17251d);
  font-weight: 800;
  letter-spacing: -.45px;
}

body.premium-page-active .premium-heading h2 span {
  color: var(--accent, #08a94f);
}

body.premium-page-active .premium-subtitle,
body.premium-page-active .premium-payment-note {
  color: var(--muted, #718078);
}

body.premium-page-active .premium-duration-tabs {
  padding: 4px;
  border: 1px solid var(--border, rgba(255,255,255,.88));
  border-radius: 14px;
  background: var(--surface-2, #e5f0e8);
  box-shadow: inset 3px 3px 7px rgba(39,88,58,.08), inset -3px -3px 7px rgba(255,255,255,.82);
}

body.premium-page-active .premium-duration-tab {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #718078);
  font-weight: 700;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

body.premium-page-active .premium-duration-tab.active,
body.premium-page-active .premium-duration-tab[aria-selected="true"] {
  background: var(--surface, #f4fbf6);
  color: var(--accent, #08a94f);
  box-shadow: 3px 3px 7px rgba(39,88,58,.12), -3px -3px 7px rgba(255,255,255,.9);
}

body.premium-page-active .premium-comparison-table {
  color: var(--text, #17251d);
}

body.premium-page-active .premium-comparison-table thead th {
  color: var(--muted, #718078);
  font-weight: 700;
}

body.premium-page-active .premium-comparison-table tbody tr {
  border-bottom: 1px solid var(--divider, rgba(113,145,123,.13));
}

body.premium-page-active .premium-comparison-table tbody tr:last-child {
  border-bottom: 0;
}

body.premium-page-active .premium-table-check {
  color: var(--accent, #08a94f);
  font-weight: 800;
}

body.premium-page-active .premium-table-dash {
  color: var(--muted, #718078);
}

body.premium-page-active .premium-continue-button {
  min-height: 48px;
  border: 1px solid rgba(8,169,79,.18);
  border-radius: 15px;
  background: linear-gradient(145deg, #0dbb59, #079747);
  color: #fff;
  box-shadow: 5px 5px 12px rgba(0,125,57,.2), -4px -4px 10px rgba(255,255,255,.75);
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease;
}

body.premium-page-active .premium-continue-button:active {
  transform: translateY(1px);
  box-shadow: inset 3px 3px 7px rgba(0,90,40,.2), inset -3px -3px 7px rgba(255,255,255,.16);
}

body.premium-page-active .premium-button-old-price {
  color: rgba(255,255,255,.68);
}

body.premium-page-active .premium-button-current-price {
  color: #fff;
}

html[data-theme="dark"] body.premium-page-active .premium-page-back {
  background: var(--surface, #111a14);
}

html[data-theme="dark"] body.premium-page-active .premium-duration-tabs {
  background: var(--surface-2, #18251c);
  box-shadow: inset 3px 3px 7px rgba(0,0,0,.3), inset -3px -3px 7px rgba(51,81,57,.12);
}

html[data-theme="dark"] body.premium-page-active .premium-duration-tab.active,
html[data-theme="dark"] body.premium-page-active .premium-duration-tab[aria-selected="true"] {
  background: var(--surface, #111a14);
  color: var(--accent, #27d477);
  box-shadow: 3px 3px 7px rgba(0,0,0,.35), -3px -3px 7px rgba(51,81,57,.12);
}

@media (prefers-reduced-motion: reduce) {
  body.premium-page-active .premium-duration-tab,
  body.premium-page-active .premium-continue-button {
    transition: none;
  }
}


/* [MODIFIED] Fix Premium feature text contrast in light and dark themes. */
body.premium-page-active .premium-comparison-table,
body.premium-page-active .premium-comparison-table tbody,
body.premium-page-active .premium-comparison-table tr,
body.premium-page-active .premium-comparison-table td {
  color: var(--text, #17251d) !important;
}

body.premium-page-active .premium-comparison-table thead th {
  color: var(--muted, #718078) !important;
}

body.premium-page-active .premium-comparison-table td:first-child {
  color: var(--text, #17251d) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body.premium-page-active .premium-comparison-table,
html[data-theme="dark"] body.premium-page-active .premium-comparison-table tbody,
html[data-theme="dark"] body.premium-page-active .premium-comparison-table tr,
html[data-theme="dark"] body.premium-page-active .premium-comparison-table td,
html[data-theme="dark"] body.premium-page-active .premium-comparison-table td:first-child {
  color: #edf7ef !important;
}

html[data-theme="dark"] body.premium-page-active .premium-comparison-table thead th {
  color: #8b9b8f !important;
}

/* [MODIFIED] Remove light neumorphic highlights from Premium controls in dark mode. */
html[data-theme="dark"] body.premium-page-active .premium-page-back {
  border-color: rgba(69,103,78,.22);
  box-shadow: 4px 4px 10px rgba(0,0,0,.42), -3px -3px 8px rgba(37,64,44,.12);
}

html[data-theme="dark"] body.premium-page-active .premium-continue-button {
  box-shadow: 5px 5px 12px rgba(0,0,0,.5), -3px -3px 8px rgba(37,64,44,.12);
}

html[data-theme="dark"] body.premium-page-active .premium-continue-button:active {
  box-shadow: inset 3px 3px 7px rgba(0,0,0,.35), inset -3px -3px 7px rgba(39,212,119,.08);
}

html[data-theme="dark"] body.premium-page-active .premium-button-old-price {
  color: rgba(255,255,255,.68);
}


/* [ADDED] Premium QRIS popup UI in WAGRAM neumorphic style. */
body.premium-payment-open { overflow: hidden !important; }
/* [MODIFIED] Premium payment is a compact dialog over the Premium page. */
.premium-payment-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(3, 10, 6, .68);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.premium-payment-modal.hidden { display: none !important; }
.premium-payment-content {
  position: relative;
  width: min(100%, 390px);
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 58px 22px 24px;
  border: 1px solid var(--border, rgba(255,255,255,.8));
  border-radius: 28px;
  background: var(--surface, #f4fbf6);
  color: var(--text, #17251d);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  overscroll-behavior: contain;
}
.premium-payment-back {
  position: absolute;
  top: 14px;
  left: 14px !important; /* [MODIFIED] Force the back button to the left edge. */
  right: auto !important;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border, rgba(255,255,255,.88));
  border-radius: 13px;
  background: var(--surface, #f4fbf6);
  color: var(--text, #17251d);
  font-size: 25px;
  line-height: 1;
  box-shadow: var(--shadow, 5px 5px 12px rgba(39,88,58,.1), -4px -4px 10px rgba(255,255,255,.8));
}
.premium-payment-content h2 {
  margin: 0;
  color: var(--text, #17251d);
  font-size: 21px;
  font-weight: 850;
}
.premium-payment-plan {
  margin: 0;
  color: var(--muted, #718078);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
}
.premium-payment-amount {
  color: var(--accent, #08a94f);
  font-size: clamp(27px, 7vw, 32px);
  font-weight: 900;
}
.premium-payment-unique {
  margin: -6px 0 0;
  color: var(--muted, #718078);
  font-size: 12px;
}
.premium-payment-qr-wrap {
  position: relative;
  display: inline-flex;
  padding: 9px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 4px 4px 12px rgba(39,88,58,.1);
}
#premiumPaymentQr {
  display: block;
  width: min(260px, 66vw);
  height: auto;
  image-rendering: pixelated;
}
.premium-payment-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  padding: 5px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
/* [ADDED] Show WAGRAM branding only after the QR canvas is ready. */
.premium-payment-qr-wrap.is-ready .premium-payment-logo {
  opacity: 1;
  visibility: visible;
}
.premium-payment-qr-loader {
  position: absolute;
  inset: 9px;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  color: #26352c;
  font-size: 12px;
  font-weight: 700;
}
.premium-payment-qr-wrap.is-loading .premium-payment-qr-loader {
  display: flex;
}
.premium-payment-qr-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(8,169,79,.18);
  border-top-color: #08a94f;
  border-radius: 50%;
  animation: premium-qr-spin .75s linear infinite;
}
@keyframes premium-qr-spin {
  to { transform: rotate(360deg); }
}
.premium-payment-status {
  margin: 2px 0 0;
  color: var(--text, #17251d);
  font-size: 12px;
  font-weight: 750;
}
/* [ADDED] 15-minute QRIS countdown and automatic payment success animation. */
.premium-payment-countdown {
  margin: 0;
  color: var(--accent, #08a94f);
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.premium-payment-success-mark {
  position: absolute;
  inset: 9px;
  z-index: 4;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(5, 25, 15, .82);
  color: #fff;
  font-size: clamp(76px, 22vw, 112px);
  font-weight: 900;
  opacity: 0;
  visibility: hidden;
  transform: scale(.65);
  transition: opacity .22s ease, transform .3s cubic-bezier(.2,.8,.2,1), visibility .22s ease;
}
.premium-payment-qr-wrap.is-paid .premium-payment-success-mark {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.premium-payment-qr-wrap.is-paid .premium-payment-logo {
  opacity: 0;
  visibility: hidden;
}
.premium-payment-qr-wrap.is-paid {
  box-shadow: 0 0 0 3px #20c878, 0 0 34px rgba(32,200,120,.35);
}
.premium-payment-paid:disabled {
  opacity: 1;
  background: color-mix(in srgb, var(--accent, #08a94f) 16%, var(--surface, #fff));
  color: var(--accent, #08a94f);
}

.premium-payment-hint {
  margin: 0;
  color: var(--muted, #718078);
  font-size: 11px;
  line-height: 1.5;
}
html[data-theme="dark"] .premium-payment-content {
  background: #111a14;
  border-color: rgba(69,103,78,.28);
  color: #edf7ef;
}
html[data-theme="dark"] .premium-payment-content h2,
html[data-theme="dark"] .premium-payment-status { color: #edf7ef; }
html[data-theme="dark"] .premium-payment-back {
  background: #18231b;
  border-color: rgba(69,103,78,.22);
  color: #edf7ef;
  box-shadow: 4px 4px 10px rgba(0,0,0,.35);
}
/* [ADDED] Actions for the QRIS payment dialog. */
.premium-payment-logo {
  background: #092016;
  border: 3px solid #092016;
  box-shadow: 0 0 0 2px #ffffff;
  object-fit: contain;
  filter: none;
}
.premium-payment-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
  width: 100%;
  margin-top: 7px;
}
.premium-payment-actions button {
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}
.premium-payment-download {
  background: var(--surface, #f4fbf6);
  color: var(--text, #17251d);
  border: 1px solid var(--border, rgba(20,70,40,.16)) !important;
}
.premium-payment-paid {
  background: var(--accent, #08a94f);
  color: #fff;
}
.premium-payment-actions button:disabled {
  opacity: .45;
}
.premium-payment-confirmation {
  min-height: 16px;
  margin: 0;
  color: var(--accent, #08a94f);
  font-size: 11px;
  line-height: 1.45;
}
html[data-theme="dark"] .premium-payment-download {
  background: #18231b;
  border-color: rgba(69,103,78,.3) !important;
  color: #edf7ef;
}
@media (max-width: 420px) {
  .premium-payment-modal { padding-left: 14px; padding-right: 14px; }
  .premium-payment-content { padding-left: 16px; padding-right: 16px; }
}

/* [ADDED] Premium payment proof upload popup. */
.premium-proof-modal{position:fixed;inset:0;z-index:220;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.72);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}
.premium-proof-modal.hidden{display:none!important}
.premium-proof-content{width:min(100%,360px);display:flex;flex-direction:column;gap:12px;padding:24px;border:1px solid var(--border,rgba(255,255,255,.12));border-radius:24px;background:var(--surface,#111a14);color:var(--text,#edf7ef);box-shadow:0 24px 80px rgba(0,0,0,.4)}
.premium-proof-content h2{margin:0;font-size:20px}
.premium-proof-description{margin:0;color:var(--muted,#91a096);font-size:13px;line-height:1.5}
.premium-proof-picker{min-height:160px;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px dashed rgba(120,160,130,.5);border-radius:16px;background:rgba(100,140,110,.08);cursor:pointer}
.premium-proof-placeholder{display:flex;flex-direction:column;align-items:center;gap:7px;padding:20px;text-align:center}
.premium-proof-icon{font-size:34px;line-height:1;color:var(--accent,#18bd69)}
.premium-proof-placeholder small{color:var(--muted,#91a096);font-size:11px}
.premium-proof-preview{display:block;width:100%;max-height:260px;object-fit:contain;background:#080d09}
.premium-proof-preview.hidden,.premium-proof-placeholder.hidden{display:none!important}
.premium-proof-error{min-height:16px;margin:0;color:#ff7777;font-size:12px}
.premium-proof-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.premium-proof-actions button{min-height:46px;border:0;border-radius:13px;font:inherit;font-weight:750}
.premium-proof-cancel{background:var(--surface,#18231b);color:var(--text,#edf7ef);border:1px solid var(--border,rgba(120,160,130,.2))!important}
.premium-proof-confirm{background:var(--accent,#08a94f);color:#fff}
.premium-proof-confirm:disabled,.premium-proof-cancel:disabled{opacity:.45}


/* [ADDED] WhatsApp session manager popup, matching WAGRAM neumorphic surfaces. */
.whatsapp-sessions-modal{position:fixed;inset:0;z-index:230;display:flex;align-items:flex-end;justify-content:center;padding:16px;background:rgba(0,0,0,.62);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}
.whatsapp-sessions-modal.hidden{display:none!important}
.whatsapp-sessions-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent}
.whatsapp-sessions-panel{position:relative;width:min(100%,480px);max-height:min(86dvh,760px);overflow-y:auto;padding:22px 18px max(20px,env(safe-area-inset-bottom));border:1px solid var(--border,rgba(255,255,255,.12));border-radius:26px;background:var(--surface);color:var(--text);box-shadow:0 24px 80px rgba(0,0,0,.38);animation:whatsappSessionEnter .22s ease-out}
@keyframes whatsappSessionEnter{from{transform:translateY(24px);opacity:.65}to{transform:translateY(0);opacity:1}}
.whatsapp-sessions-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px}
.whatsapp-sessions-header h2{margin:3px 0 4px;font-size:21px;font-weight:800}
.whatsapp-sessions-header p{margin:0;color:var(--muted);font-size:12px}
.whatsapp-sessions-eyebrow{font-size:9px;letter-spacing:1.5px;font-weight:800;color:#25c96a}
.whatsapp-session-list{display:grid;gap:9px}
.whatsapp-session-item{width:100%;display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--divider);border-radius:16px;background:var(--surface-2);color:var(--text);text-align:left;box-shadow:3px 3px 8px rgba(0,0,0,.09),-2px -2px 7px rgba(255,255,255,.025)}
.whatsapp-session-item.is-active{border-color:rgba(37,211,102,.55);background:color-mix(in srgb,#25d366 8%,var(--surface-2))}
.whatsapp-session-avatar{width:38px;height:38px;flex:0 0 38px;display:grid;place-items:center;border-radius:13px;background:rgba(37,211,102,.12);color:#25d366}
.whatsapp-session-avatar .i{width:20px;height:20px}
.whatsapp-session-info{min-width:0;flex:1;display:grid;gap:4px}
.whatsapp-session-info strong{font-size:13px}
.whatsapp-session-info small{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.whatsapp-session-status{font-size:10px;font-weight:700;color:var(--muted)}
.whatsapp-session-status.status-connected{color:#25c96a}
.whatsapp-session-status.status-qr,.whatsapp-session-status.status-connecting{color:#d99b31}
.whatsapp-session-check{color:#25c96a;font-weight:900}
.whatsapp-session-add-action{width:100%;min-height:46px;display:flex;align-items:center;justify-content:center;gap:8px;margin-top:13px;border:1px dashed rgba(37,211,102,.5);border-radius:14px;background:rgba(37,211,102,.08);color:#25c96a;font-weight:800;font-size:12px}
.whatsapp-session-add-action:disabled{border-color:var(--divider);background:var(--surface-2);color:var(--muted)}
.whatsapp-session-add-action .i{width:17px;height:17px}
.whatsapp-session-qr{display:grid;justify-items:center;gap:8px;margin-top:15px;padding:14px;border-radius:16px;background:#fff;color:#17221b}
.whatsapp-session-qr img{width:min(100%,240px);aspect-ratio:1;object-fit:contain}
.whatsapp-session-qr p{margin:0;color:#34443a;font-size:11px;text-align:center}
.whatsapp-session-footer{display:flex;gap:9px;margin-top:14px}
.whatsapp-session-footer button{flex:1;min-height:40px}
.whatsapp-sessions-open{overflow:hidden}

.whatsapp-session-footer #whatsappSessionDeleteButton{border:1px solid color-mix(in srgb,var(--danger) 42%,transparent);background:var(--danger-soft);color:var(--danger);border-radius:12px;font-weight:800;font-size:11px}

/* [ADDED] Focused QR pairing popup: hide account manager controls while pairing. */
/* [MODIFIED] Compact, focused pairing header with clear device-link context. */
.whatsapp-sessions-modal.is-pairing .whatsapp-sessions-header { margin-bottom:18px; align-items:center; }
.whatsapp-sessions-modal.is-pairing .whatsapp-sessions-eyebrow { display:block; font-size:10px; letter-spacing:1.4px; }
.whatsapp-sessions-modal.is-pairing .whatsapp-sessions-header h2 { margin-top:5px; font-size:23px; letter-spacing:-.45px; }
.whatsapp-sessions-modal.is-pairing .whatsapp-sessions-header p { margin-top:5px; font-size:12px; }
.whatsapp-sessions-modal.is-pairing .whatsapp-session-list,
.whatsapp-sessions-modal.is-pairing #createWhatsAppSessionButton,
.whatsapp-sessions-modal.is-pairing .whatsapp-session-footer { display:none!important; }
.whatsapp-sessions-modal.is-pairing .whatsapp-session-qr { display:flex; flex-direction:column; align-items:center; gap:13px; }
.whatsapp-sessions-modal.is-pairing .whatsapp-session-qr img { width:100%; max-width:360px; border-radius:18px; background:#fff; }
.whatsapp-sessions-modal.is-pairing .whatsapp-session-qr > p { display:flex; align-items:center; justify-content:center; width:100%; min-height:38px; margin:0; padding:8px 12px; border:1px solid var(--border,rgba(255,255,255,.1)); border-radius:12px; background:var(--surface-2,rgba(255,255,255,.035)); color:var(--text); font-size:12px; font-weight:600; letter-spacing:.1px; }
.whatsapp-pairing-cancel { width:100%; min-height:46px; margin-top:2px; border-radius:13px; font-size:13px; font-weight:700; }

/* [ADDED] Compact method tabs and pairing-code form for WhatsApp Linked Devices. */
.whatsapp-pairing-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;width:100%;padding:4px;border:1px solid var(--border,rgba(255,255,255,.1));border-radius:13px;background:var(--surface-2);margin-bottom:2px}
.whatsapp-pairing-tab{min-height:40px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-size:12px;font-weight:750}
.whatsapp-pairing-tab.is-active{background:var(--surface);color:#25c96a;box-shadow:2px 2px 6px rgba(0,0,0,.12),-2px -2px 6px rgba(255,255,255,.035)}
.whatsapp-pairing-method-panel{display:flex;width:100%;flex-direction:column;align-items:center;gap:12px}
.whatsapp-pairing-method-panel.hidden{display:none!important}
.whatsapp-pairing-label{width:100%;font-size:12px;font-weight:750;color:var(--text)}
.whatsapp-pairing-phone-input{width:100%;min-height:48px;padding:0 14px;border:1px solid var(--border,rgba(255,255,255,.12));border-radius:13px;outline:none;background:var(--surface-2);color:var(--text);font-size:15px;letter-spacing:.3px}
.whatsapp-pairing-phone-input:focus{border-color:rgba(37,201,106,.7);box-shadow:0 0 0 3px rgba(37,201,106,.1)}
.whatsapp-pairing-hint{width:100%;margin:-5px 0 0;color:var(--muted);font-size:11px;line-height:1.5}
.whatsapp-pairing-submit{width:100%;min-height:46px;border:0;border-radius:13px;background:#25c96a;color:#062311;font-size:13px;font-weight:850}
.whatsapp-pairing-submit:disabled{opacity:.55}
.whatsapp-pairing-code-result{display:grid;justify-items:center;gap:9px;width:100%;padding:18px 14px;border:1px solid rgba(37,201,106,.3);border-radius:16px;background:color-mix(in srgb,#25c96a 8%,var(--surface-2));text-align:center}
.whatsapp-pairing-code-result.hidden{display:none!important}
.whatsapp-pairing-code-result>span{font-size:9px;font-weight:850;letter-spacing:1.6px;color:#25c96a}
.whatsapp-pairing-code-result>strong{font-size:30px;line-height:1.2;letter-spacing:5px;font-variant-numeric:tabular-nums;color:var(--text)}
.whatsapp-pairing-code-result>p{margin:0;color:var(--muted);font-size:11px;line-height:1.55}
.whatsapp-pairing-status{width:100%;min-height:30px;margin:0;padding:8px 11px;border:1px solid var(--border,rgba(255,255,255,.1));border-radius:11px;background:var(--surface-2);color:var(--muted);font-size:11px;line-height:1.45;text-align:center}

/* [MODIFIED] WhatsApp pairing QR stays hidden behind a loader until the image is decoded. */
.whatsapp-qr-brand-frame { position:relative; display:inline-flex; width:100%; max-width:360px; min-height:280px; align-items:center; justify-content:center; overflow:hidden; border-radius:18px; background:#fff; }
.whatsapp-qr-brand-frame > #whatsappSessionQrImage { display:block; width:100%; height:auto; border-radius:18px; background:#fff; opacity:0; visibility:hidden; }
.whatsapp-qr-brand-frame.is-ready > #whatsappSessionQrImage { opacity:1; visibility:visible; }
.whatsapp-qr-center-logo { position:absolute; z-index:2; left:50%; top:50%; display:grid; place-items:center; width:21%; aspect-ratio:1; padding:2.2%; transform:translate(-50%,-50%); border:3px solid #fff; border-radius:17px; background:#fff; box-shadow:0 1px 8px rgba(0,0,0,.16); opacity:0; visibility:hidden; transition:opacity .18s ease,visibility .18s ease; }
.whatsapp-qr-brand-frame.is-ready .whatsapp-qr-center-logo { opacity:1; visibility:visible; }
.whatsapp-qr-center-logo img { display:block; width:100%; height:100%; object-fit:contain; }
.whatsapp-qr-loader { position:absolute; inset:0; z-index:3; display:none; align-items:center; justify-content:center; flex-direction:column; gap:14px; border-radius:18px; background:#fff; color:#26352c; font-size:13px; font-weight:650; }
.whatsapp-qr-brand-frame.is-loading .whatsapp-qr-loader { display:flex; }
.whatsapp-qr-loader-ring { width:42px; height:42px; border:4px solid rgba(0,169,79,.16); border-top-color:#08a94f; border-right-color:#08a94f; border-radius:50%; animation:whatsapp-qr-ring-spin .75s linear infinite; }
@keyframes whatsapp-qr-ring-spin { to { transform:rotate(360deg); } }
.whatsapp-sessions-modal.is-pairing .whatsapp-session-qr img { width:100%; max-width:none; }


/* [ADDED] WAGRAM AI uses the same compact avatar and row dimensions as WhatsApp chats. */
.wagram-ai-chat-row {
  margin-bottom: 10px;
}
.wagram-ai-chat-row .chat-row-content {
  width: 100%;
}
.wagram-ai-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2, #10251a);
  border: 1px solid var(--border, rgba(255,255,255,.08));
}
.wagram-ai-avatar .avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wagram-ai-chat-row .item-time {
  font-size: 11px;
  white-space: nowrap;
}


/* [ADDED] Full-screen WAGRAM AI conversation layout. */
.ai-business-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.ai-business-page.hidden {
  display: none !important;
}
.ai-business-conversation-header {
  flex: 0 0 auto;
  min-height: 64px;
}
.ai-business-header-avatar {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
}
.ai-business-header-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ai-business-conversation-header #aiBusinessSettingsButton {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}
.ai-business-page .ai-business-intro {
  flex: 0 0 auto;
  margin: 12px 12px 4px;
}
.ai-business-page .ai-business-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ai-business-page .ai-business-composer {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.ai-business-page .ai-business-composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 120px;
  min-height: 42px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  outline: none;
  resize: none;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.ai-business-page .ai-business-composer button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}
.ai-business-page .ai-business-composer button .i {
  width: 20px;
  height: 20px;
}
.ai-business-not-connected {
  border-left: 3px solid var(--muted);
}
body.in-chat #topbar {
  display: none !important;
}


/* [ADDED] Style the WAGRAM AI welcome state and quick actions to match the app theme. */
.ai-business-page .ai-business-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
}
.ai-business-page .ai-business-intro-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  color: var(--accent);
}
.ai-business-page .ai-business-intro h2 {
  font-size: 17px;
  font-weight: 750;
  line-height: 1.3;
}
.ai-business-page .ai-business-intro p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.ai-business-page .ai-business-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.ai-business-page .ai-business-suggestions button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}
.ai-business-page .ai-business-messages:empty {
  display: block;
}
/* [ADDED] Minimal mascot-only welcome state before the first WAMO AI message. */
.ai-business-page .ai-business-empty-state {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.ai-business-page .ai-business-mascot {
  display: block;
  width: min(220px, 62vw);
  max-height: 34vh;
  height: auto;
  object-fit: contain;
}
.ai-business-page .ai-business-messages:empty {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .ai-business-page .ai-business-mascot {
    animation: none;
  }
}



/* [ADDED] Centered business setup menu and responsive form cards. */
/* [MODIFIED] Professional WAGRAM AI settings layout. */
.ai-business-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.ai-business-settings-modal.hidden { display: none !important; }
.ai-business-settings-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}
.ai-business-settings-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 480px);
  max-height: min(88dvh, 780px);
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,.42);
}
.ai-business-settings-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.ai-business-settings-eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.ai-business-settings-heading h2 { margin-top: 5px; font-size: 22px; font-weight: 800; }
.ai-business-settings-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.ai-business-settings-close {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 23px;
}
.ai-business-settings-menu {
  flex: 1 1 auto; /* [MODIFIED] Keep the settings menu scrollable inside the fixed-height panel. */
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
/* [ADDED] Outlet/product detail forms need their own scroll container; the panel clips overflow. */
.ai-business-settings-detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ai-business-settings-group + .ai-business-settings-group { margin-top: 24px; }
.ai-business-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ai-business-section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.15px;
}
.ai-business-section-heading > span { color: var(--muted); font-size: 10px; }
.ai-business-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.ai-business-setting-tile {
  display: flex;
  min-width: 0;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.ai-business-setting-tile:active { transform: scale(.99); }
.ai-business-setting-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-business-setting-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb,var(--accent) 13%,var(--surface));
  color: var(--accent);
}
.ai-business-setting-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ai-business-setting-copy {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 4px;
}
.ai-business-setting-copy strong { font-size: 13px; font-weight: 750; }
.ai-business-setting-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.ai-business-setting-arrow { color: var(--muted); font-size: 23px; line-height: 1; }
.ai-business-ai-group { padding-top: 20px; border-top: 1px solid var(--border); }
.ai-business-settings-note {
  flex: 0 0 auto;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.ai-business-settings-back {
  margin: 0 0 14px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.ai-business-data-form { display: grid; gap: 12px; }
.ai-business-data-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.ai-business-data-form input,
.ai-business-data-form textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.ai-business-data-form textarea { resize: vertical; }
.ai-business-outlet-form,
.ai-business-product-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-2);
}
.ai-business-outlet-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-business-outlet-heading strong { color: var(--text); font-size: 12px; }
.ai-business-outlet-heading button { border: 0; background: transparent; color: #e47777; font: inherit; font-size: 11px; }
.ai-business-time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ai-business-save-button,
.ai-business-add-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}
.ai-business-save-button { background: var(--accent); color: #fff; }
.ai-business-add-button { border: 1px dashed var(--border); background: var(--surface-2); color: var(--accent); }
@media (max-width: 600px) {
  .ai-business-settings-modal {
    align-items: flex-end;
    padding: 0;
  }
  .ai-business-settings-panel {
    width: 100%;
    max-height: min(91dvh, 820px);
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
  }
}
@media (max-width: 360px) {
  .ai-business-settings-panel { padding-right: 15px; padding-left: 15px; }
  .ai-business-setting-tile { min-height: 62px; padding: 9px; }
  .ai-business-setting-icon { flex-basis: 38px; width: 38px; height: 38px; }
}

/* [MODIFIED] Clear, separated fields for WAGRAM AI configuration. */
.ai-business-rules {
  display: grid;
  gap: 14px;
  margin-top: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.ai-business-rule-field {
  display: grid;
  gap: 6px;
}
.ai-business-rules .ai-business-rule-field > label {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}
.ai-business-rules .ai-business-rule-field > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.ai-business-rules textarea {
  width: 100%;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
}
.ai-business-rules textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent);
}
.ai-business-rules .ai-business-save-button { width: 100%; }

/* [ADDED] Lock marker for WAGRAM AI when the account is not Premium C. */
.wagram-ai-chat-row {
  position: relative;
  margin: 8px 0 10px;
}
.wagram-ai-chat-row .chat-row-content {
  width: 100%;
}
.wagram-ai-lock-indicator {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
}
.wagram-ai-lock-indicator.hidden { display: none !important; }
.wagram-ai-chat-row.is-premium-locked .wagram-ai-chat-row .item-sub {
  color: var(--muted);
}


/* [MODIFIED] Align the pinned WAGRAM AI row with regular chat cards. */
.wagram-ai-chat-row {
  width: auto;
  margin: 0 18px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.wagram-ai-chat-row .chat-row-content {
  display: flex;
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(145deg,var(--surface),var(--surface-2));
  gap: 12px;
}
.wagram-ai-chat-row .chat-avatar-wrap {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: center;
}
.wagram-ai-chat-row .wagram-ai-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  margin: 0;
}
.wagram-ai-chat-row .item-body {
  flex: 1 1 auto;
  min-width: 0;
}
.wagram-ai-chat-row .item-row {
  min-width: 0;
}
.wagram-ai-chat-row .item-title,
.wagram-ai-chat-row .item-sub,
.wagram-ai-chat-row .item-time {
  line-height: 1.35;
}
.wagram-ai-chat-row .item-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wagram-ai-chat-row .wagram-ai-lock-indicator {
  margin-left: 0;
}
#chatList {
  padding-top: 0;
}


/* [MODIFIED] Make the pinned WAGRAM AI row identical in width, height, radius and spacing to regular chat rows. */
#wagramAiPinnedRow.wagram-ai-chat-row {
  display: block;
  width: auto;
  margin: 0 10px 7px !important;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
}
#wagramAiPinnedRow .chat-row-content {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 12px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow: var(--shadow);
}
#wagramAiPinnedRow .chat-avatar-wrap {
  display: inline-flex;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
}
#wagramAiPinnedRow .wagram-ai-avatar {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  margin: 0;
  overflow: hidden;
  place-items: center;
  border: 2px solid rgba(255,255,255,.06);
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: 3px 3px 8px rgba(0,0,0,.25);
}
#wagramAiPinnedRow .wagram-ai-avatar .avatar-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#wagramAiPinnedRow .item-body {
  flex: 1 1 auto;
  min-width: 0;
}
#wagramAiPinnedRow .item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
}
#wagramAiPinnedRow .item-title,
#wagramAiPinnedRow .item-sub,
#wagramAiPinnedRow .item-time {
  line-height: 1.35;
}
#wagramAiPinnedRow .item-title { font-size: 14px; }
#wagramAiPinnedRow .item-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#wagramAiPinnedRow .item-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
/* [MODIFIED] Match locked channel cards: warm gold card tint and crown floating above the WAMO avatar. */
#wagramAiPinnedRow.is-premium-locked .chat-row-content {
  background: color-mix(in srgb, #f59e0b 9%, var(--surface));
  border-color: color-mix(in srgb, #f59e0b 28%, var(--border));
}
#wagramAiPinnedRow.is-premium-locked .item-title {
  color: #f5a623;
}
#wagramAiPinnedRow .wagram-ai-lock-indicator {
  position: absolute;
  top: -9px;
  right: -7px;
  z-index: 4;
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#wagramAiPinnedRow .wagram-ai-lock-indicator .premium-crown-svg {
  display: block;
  width: 22px;
  height: 22px;
  transform: rotate(22deg);
}
#wagramAiPinnedRow .wagram-ai-lock-indicator.hidden {
  display: none !important;
}
#chatList {
  padding: 0 10px 12px !important;
  gap: 7px !important;
}
#chatList > .chat-swipe-row {
  margin: 0;
}
@media (max-width: 380px) {
  #wagramAiPinnedRow .chat-row-content { padding: 10px; gap: 10px; }
  #wagramAiPinnedRow .item-sub { max-width: 54vw; }
}


/* [MODIFIED] Align timestamps on both owner and WAMO AI bubbles like WhatsApp. */
.ai-business-page .message-time {
  display: block;
  width: 100%;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
}


/* [ADDED] WAGRAM AI overflow menu beside the settings button. */
.ai-business-conversation-header {
  position: relative;
}
.ai-business-conversation-header #aiBusinessMoreButton {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}
.ai-business-more-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% - 4px);
  right: 10px;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(0 0 0 / 24%);
}
.ai-business-more-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--danger);
  font: inherit;
  text-align: left;
}
.ai-business-more-menu button:active {
  background: var(--surface-2);
}
.ai-business-more-menu .i {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}


/* [ADDED] Visual distinction for simulated customers during WAGRAM AI training. */
.ai-business-training-active .ai-business-conversation-header .conversation-info p {
  color: var(--accent);
}
.ai-business-more-menu button.is-training-active {
  color: var(--accent);
}
.ai-business-training-customer {
  border-left: 3px solid var(--accent);
}
.ai-business-training-sender {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

/* [ADDED] Inspectable WAGRAM AI decision trace shown below assistant replies. */
.ai-business-trace {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(128, 160, 140, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  font-size: 12px;
}

.ai-business-trace summary {
  cursor: pointer;
  color: #27c979;
  font-weight: 600;
  list-style-position: inside;
}

.ai-business-trace-content {
  display: grid;
  gap: 5px;
  padding-top: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-business-trace-content strong {
  margin-top: 5px;
  color: inherit;
}

.ai-business-trace-content p,
.ai-business-trace-content ul {
  margin: 0;
  color: var(--text-secondary, #aeb9b1);
}

.ai-business-trace-content ul {
  padding-left: 18px;
}


/* [ADDED] Image-only QRIS upload and preview in WAGRAM AI business settings. */
.ai-business-qris-upload {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.ai-business-qris-preview-wrap {
  display: grid;
  width: 100%;
  min-height: 190px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}
.ai-business-qris-preview {
  display: block;
  width: min(100%, 300px);
  max-height: 300px;
  object-fit: contain;
  padding: 10px;
}
.ai-business-qris-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}
.ai-business-qris-placeholder svg,
.ai-business-qris-file-label svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ai-business-qris-placeholder strong { color: var(--text); font-size: 12px; }
.ai-business-qris-placeholder span,
.ai-business-qris-upload > small { color: var(--muted); font-size: 10px; }
.ai-business-qris-file-label {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ai-business-qris-file-label svg { width: 17px; height: 17px; }
.ai-business-qris-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}


/* [ADDED] Display the saved QRIS image as part of a WAGRAM AI chat reply. */
.ai-business-qris-message-image {
  display: block;
  width: min(100%, 280px);
  max-height: 380px;
  object-fit: contain;
  margin: 10px 0 4px;
  padding: 8px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  background: #ffffff;
}


/* [ADDED] Premium proof upload state: keep the selected image visible under a clear loading overlay. */
.premium-proof-picker{position:relative}
.premium-proof-picker:has(.premium-proof-upload-overlay:not(.hidden)){cursor:wait}
.premium-proof-upload-overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:20px;text-align:center;background:rgba(5,16,10,.82);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);color:#fff}
.premium-proof-upload-overlay.hidden{display:none!important}
.premium-proof-upload-overlay strong{font-size:13px;font-weight:800}
.premium-proof-upload-overlay small{max-width:240px;color:rgba(255,255,255,.76);font-size:11px;line-height:1.45}
.premium-proof-upload-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.25);border-top-color:#25d366;border-radius:50%;animation:premiumProofSpin .8s linear infinite}
.premium-proof-upload-track{display:block;width:min(100%,210px);height:4px;overflow:hidden;border-radius:99px;background:rgba(255,255,255,.2)}
.premium-proof-upload-track span{display:block;width:38%;height:100%;border-radius:inherit;background:#25d366;animation:premiumProofProgress 1.15s ease-in-out infinite}
.premium-proof-modal.is-uploading .premium-proof-picker{pointer-events:none}
.premium-proof-modal.is-uploading .premium-proof-actions{opacity:.7}
@keyframes premiumProofSpin{to{transform:rotate(360deg)}}
@keyframes premiumProofProgress{0%{transform:translateX(-110%)}100%{transform:translateX(280%)}}
@media(prefers-reduced-motion:reduce){.premium-proof-upload-spinner,.premium-proof-upload-track span{animation:none}.premium-proof-upload-track span{width:100%}}


/* [MODIFIED] Keep the proof picker instructions readable inside Telegram's dark WebView. */
.premium-proof-picker{color:var(--text,#edf7ef)}
.premium-proof-placeholder{width:100%;min-height:160px;box-sizing:border-box;color:#edf7ef!important;visibility:visible;opacity:1}
.premium-proof-placeholder strong{display:block;color:#edf7ef!important;font-size:14px;font-weight:800}
.premium-proof-placeholder small{display:block;color:#a6b5aa!important;font-size:11px;line-height:1.5}
.premium-proof-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:rgba(37,211,102,.12);color:#25d366!important;font-size:30px;line-height:1}
.premium-proof-upload-overlay{color:#fff!important}


/* [ADDED] Preview processing ring shown immediately after choosing a payment proof image. */
.premium-proof-preview-loading{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:18px;box-sizing:border-box;background:rgba(4,15,9,.88);color:#edf7ef;text-align:center}
.premium-proof-preview-loading.hidden{display:none!important}
.premium-proof-preview-loading strong{font-size:13px;font-weight:800}
.premium-proof-preview-loading small{max-width:230px;color:#a6b5aa;font-size:11px;line-height:1.45}
.premium-proof-reading-ring{position:relative;display:block;width:54px;height:54px;flex:0 0 54px;border-radius:50%;background:conic-gradient(from 0deg,rgba(37,211,102,.12),#25d366 105deg,#b6e96b 190deg,#f4d46c 255deg,rgba(37,211,102,.12) 360deg);-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 5px),#000 calc(100% - 3px));mask:radial-gradient(farthest-side,transparent calc(100% - 5px),#000 calc(100% - 3px));filter:drop-shadow(0 0 7px rgba(37,211,102,.35));animation:premiumProofReadingSpin 1.1s linear infinite}
.premium-proof-reading-ring::after{content:"";position:absolute;top:2px;left:50%;width:7px;height:7px;border-radius:50%;background:#eaffbb;box-shadow:0 0 9px 3px rgba(182,233,107,.7);transform:translateX(-50%)}
@keyframes premiumProofReadingSpin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.premium-proof-reading-ring{animation:none}}


/* [ADDED] Structured, accessible payment-proof error details. */
.premium-proof-error{width:100%;min-width:0}
.premium-proof-error.hidden{display:none!important}
.premium-proof-error-card{display:flex;align-items:flex-start;gap:11px;width:100%;box-sizing:border-box;padding:13px;border:1px solid rgba(255,105,105,.28);border-radius:14px;background:rgba(255,82,82,.075);color:#ffe4e4;text-align:left}
.premium-proof-error-icon{display:grid;place-items:center;flex:0 0 22px;width:22px;height:22px;border-radius:50%;background:rgba(255,95,95,.16);color:#ff8585;font-size:14px;font-weight:900}
.premium-proof-error-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.premium-proof-error-copy strong{color:#ffb0b0;font-size:12px;font-weight:800;line-height:1.4}
.premium-proof-error-copy span{color:#e7caca;font-size:11px;line-height:1.55;overflow-wrap:anywhere}
.premium-proof-error-copy small{color:#b99c9c;font-size:10px;letter-spacing:.02em}


/* [MODIFIED] Payment proof picker displays filename and metadata instead of rendering the image. */
.premium-proof-picker{min-height:180px}
.premium-proof-placeholder{width:100%;min-height:180px;box-sizing:border-box;justify-content:center}
.premium-proof-placeholder strong{max-width:100%;overflow-wrap:anywhere;color:var(--text,#edf7ef);font-size:13px}
.premium-proof-placeholder.has-file{background:rgba(37,211,102,.055)}
.premium-proof-change-label{margin-top:5px;padding:8px 12px;border:1px solid rgba(37,211,102,.3);border-radius:10px;color:#25d366;font-size:11px;font-weight:700}


/* [ADDED] WAMO AI welcome layout with mascot, greeting, and compact quick-action chips. */
.ai-business-page .ai-business-empty-state {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 18px;
  overflow-y: auto;
  text-align: center;
}
.ai-business-page .ai-business-mascot {
  flex: 0 1 auto;
  width: min(220px, 58vw);
  max-width: 220px;
  max-height: 29vh;
  height: auto;
  object-fit: contain;
}
.ai-business-welcome-copy {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 100%;
}
.ai-business-page .ai-business-welcome-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(21px, 5.5vw, 27px);
  font-weight: 850;
  letter-spacing: -0.7px;
  line-height: 1.2;
}
.ai-business-page .ai-business-welcome-copy h2 span {
  color: var(--accent);
}
.ai-business-page .ai-business-welcome-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.ai-business-page .ai-business-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.ai-business-page .ai-business-suggestions button {
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 13%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  transition: transform .16s ease, background .16s ease;
}
.ai-business-page .ai-business-suggestions button:active {
  transform: scale(.97);
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
}
.ai-business-page .ai-business-suggestions button svg {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ai-business-page .ai-business-suggestions button span {
  min-width: 0;
}
@media (max-width: 390px) {
  .ai-business-page .ai-business-empty-state {
    gap: 11px;
    padding-right: 12px;
    padding-left: 12px;
  }
  .ai-business-page .ai-business-mascot {
    width: min(190px, 54vw);
    max-height: 26vh;
  }
  .ai-business-page .ai-business-suggestions {
    gap: 6px;
  }
  .ai-business-page .ai-business-suggestions button {
    min-height: 50px;
    gap: 5px;
    padding: 8px 5px;
    font-size: 10px;
  }
  .ai-business-page .ai-business-suggestions button svg {
    flex-basis: 17px;
    width: 17px;
    height: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-business-page .ai-business-suggestions button {
    transition: none;
  }
}


/* [ADDED] Compact QRIS loading ring, shown only while the image is decoding. */
.ai-business-qris-preview-wrap {
  position: relative;
  contain: layout paint;
}
.ai-business-qris-loading-ring {
  position: absolute;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 3px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: ai-business-qris-spin .7s linear infinite;
  pointer-events: none;
}
.ai-business-qris-loading-ring.hidden {
  display: none;
}
@keyframes ai-business-qris-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-business-qris-loading-ring {
    animation-duration: 1.8s;
  }
}

/* [MODIFIED] Keep QRIS preview hidden until decoding completes; loading ring remains visible meanwhile. */
.ai-business-qris-preview.is-loading {
  opacity: 0;
}
.ai-business-qris-preview {
  transition: opacity .16s ease;
}


/* [ADDED] Touch-friendly QRIS crop editor. */
.ai-business-qris-crop-modal {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(8px);
}
.ai-business-qris-crop-panel {
  display: grid;
  gap: 14px;
  width: min(100%, 430px);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-2);
  color: var(--text);
}
.ai-business-qris-crop-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-business-qris-crop-heading span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}
.ai-business-qris-crop-heading h3 {
  margin: 4px 0 0;
  font-size: 20px;
}
.ai-business-qris-crop-heading button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font-size: 26px;
}
.ai-business-qris-crop-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.ai-business-qris-crop-stage {
  display: grid;
  width: min(100%, 320px);
  aspect-ratio: 1;
  place-self: center;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 14px;
  background: #fff;
  touch-action: none;
}
.ai-business-qris-crop-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.ai-business-qris-crop-stage canvas:active { cursor: grabbing; }
.ai-business-qris-crop-zoom {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.ai-business-qris-crop-zoom input { width: 100%; accent-color: var(--accent); }
.ai-business-qris-crop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ai-business-crop-cancel {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}
.ai-business-qris-crop-actions .ai-business-save-button { margin: 0; }
@media (max-width: 380px) {
  .ai-business-qris-crop-panel { padding: 15px; }
  .ai-business-qris-crop-stage { width: min(100%, 280px); }
}


/* [MODIFIED] Place the WAMO mascot outside the thinking bubble so the bubble appears to emerge from it. */
.ai-business-page .ai-business-thinking-row{display:flex;align-self:flex-start;align-items:flex-end;gap:7px;width:fit-content;max-width:92%}
.ai-business-page .ai-business-thinking-mascot{position:relative;z-index:1;display:block;flex:0 0 48px;width:48px;height:48px;margin-right:0;object-fit:contain}
.ai-business-page .ai-business-thinking{display:flex;align-items:center;width:fit-content;max-width:calc(100% - 40px);min-height:46px;margin:0;padding:10px 13px 10px 14px;border-radius:16px 16px 16px 4px}
.ai-business-page .ai-business-thinking-label{display:inline-flex;align-items:baseline;gap:4px;color:var(--text);font-size:13px;line-height:1.35;white-space:nowrap}
.ai-business-page .ai-business-thinking-dots{display:inline-flex;align-items:center;gap:3px;height:12px}
.ai-business-page .ai-business-thinking-dots i{display:block;width:4px;height:4px;border-radius:50%;background:var(--accent);opacity:.35;animation:ai-business-thinking-dot 1.05s infinite ease-in-out}
.ai-business-page .ai-business-thinking-dots i:nth-child(2){animation-delay:.15s}
.ai-business-page .ai-business-thinking-dots i:nth-child(3){animation-delay:.3s}
@keyframes ai-business-thinking-dot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
@media(max-width:380px){.ai-business-page .ai-business-thinking-mascot{flex-basis:44px;width:44px;height:44px}.ai-business-page .ai-business-thinking-label{font-size:12px}}
@media(prefers-reduced-motion:reduce){.ai-business-page .ai-business-thinking-dots i{animation:none;opacity:.85}}


/* [ADDED] Match every secondary WhatsApp account row to the primary account layout. */
.whatsapp-account-rows {
  gap: 0;
}
.whatsapp-account-rows .whatsapp-account-row {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--divider);
}
.whatsapp-account-select {
  width: 100%;
}
.whatsapp-account-select .whatsapp-account-avatar {
  position: relative;
  overflow: visible;
}
.whatsapp-account-select .whatsapp-account-avatar > img,
.whatsapp-account-select .whatsapp-account-avatar > .i {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.whatsapp-account-select .whatsapp-account-avatar > .i {
  inset: 50% auto auto 50%;
  width: 25px;
  height: 25px;
  transform: translate(-50%, -50%);
}
.whatsapp-account-selected-check {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 2;
  display: none;
  width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface, #102017);
  border-radius: 50%;
  background: #22c77a;
  color: #052b18;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
}
.whatsapp-account-avatar.is-selected .whatsapp-account-selected-check,
.whatsapp-account-select .whatsapp-account-avatar.is-selected .whatsapp-account-selected-check {
  display: inline-flex;
}
.whatsapp-account-row-chevron {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-2);
}
.whatsapp-account-row-chevron .i {
  width: 17px;
  height: 17px;
  transform: rotate(180deg);
}
.whatsapp-account-select:active .whatsapp-account-row-chevron {
  background: var(--surface);
}
@media (max-width: 380px) {
  .whatsapp-account-row-chevron {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }
}


/* [MODIFIED] Let the selected badge sit outside the primary avatar corner without clipping the photo. */
#accountWhatsAppAvatar {
  overflow: visible;
}
#accountWhatsAppAvatar #accountWhatsAppPhoto,
#accountWhatsAppAvatar > .i {
  border-radius: inherit;
}


/* [MODIFIED] Each WhatsApp session has its own selectable row and settings dropdown slot. */
.whatsapp-primary-account-row {
  align-items:center;
}
.whatsapp-primary-account-select {
  flex:1;
  min-width:0;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
}
.whatsapp-primary-account-select .whatsapp-account-avatar {
  flex:0 0 48px;
}
.whatsapp-primary-account-select .whatsapp-account-copy {
  flex:1;
  min-width:0;
}
.whatsapp-account-row-chevron {
  display:grid;
  flex:0 0 34px;
  width:34px;
  height:34px;
  padding:0;
  place-items:center;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--surface-2);
  color:var(--muted);
}
.whatsapp-account-row-chevron .i {
  width:17px;
  height:17px;
  transform:rotate(180deg);
}
.whatsapp-account-row-chevron[aria-expanded="true"] .i {
  transform:rotate(90deg);
}
.whatsapp-account-settings-slot {
  width:100%;
  min-width:0;
}
.whatsapp-account-settings-slot:empty {
  display:none;
}
.whatsapp-account-controls {
  width:100%;
  min-width:0;
}
.whatsapp-account-controls.is-collapsed {
  display:none;
}
.whatsapp-primary-account-select:active,
.whatsapp-account-select:active {
  opacity:.82;
}
@media(max-width:380px) {
  .whatsapp-primary-account-select .whatsapp-account-avatar {
    flex-basis:42px;
    width:42px;
    height:42px;
  }
  .whatsapp-account-row-chevron {
    flex-basis:28px;
    width:28px;
    height:28px;
  }
}


/* [MODIFIED] Locked secondary sessions stay recognizable while the row background is darker. */
.whatsapp-account-row.is-session-locked {
  padding: 10px;
  border-radius: 14px;
  background: color-mix(in srgb, #000 28%, var(--surface-2));
}
.whatsapp-account-select.is-session-locked,
.whatsapp-session-item.is-session-locked {
  opacity: 1;
}

/* [MODIFIED] Keep the profile photo visible and place the tilted Premium crown on its upper-left corner. */
.whatsapp-account-select .whatsapp-account-avatar {
  position: relative;
  overflow: visible;
}
.whatsapp-account-select .whatsapp-account-avatar > img {
  filter: none;
}
.whatsapp-session-lock {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  line-height: 1;
}
.whatsapp-session-lock .premium-crown-svg {
  display:block;
  width:21px;
  height:21px;
}
.whatsapp-avatar-lock {
  position: absolute;
  top: -7px;
  left: -7px;
  z-index: 4;
  transform: rotate(-22deg);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
}
.whatsapp-avatar-lock .premium-crown-svg {
  display:block;
  width:23px;
  height:23px;
}


/* [ADDED] Shared supplied Premium crown SVG for every WAGRAM Premium indicator. */
.premium-crown-svg {
  display:inline-block;
  width:18px;
  height:18px;
  flex:0 0 auto;
  object-fit:contain;
  vertical-align:middle;
}

/* [MODIFIED] Cleaner Premium payment hierarchy: compact header, amount and QR focus. */
.premium-payment-content {
  width: min(100%, 370px);
  max-height: min(86dvh, 720px);
  gap: 8px;
  padding: 54px 20px 18px;
  border-radius: 24px;
}
.premium-payment-content h2 {
  font-size: 19px;
  letter-spacing: -.25px;
}
.premium-payment-plan {
  font-size: 10px;
  letter-spacing: .8px;
}
.premium-payment-amount {
  margin-top: 1px;
  font-size: clamp(27px, 7vw, 31px);
  line-height: 1.1;
  letter-spacing: -.6px;
}
.premium-payment-unique {
  margin: -3px 0 0;
  font-size: 11px;
}
.premium-payment-countdown {
  font-size: 12px;
}
.premium-payment-qr-wrap {
  padding: 7px;
  border-radius: 16px;
}
#premiumPaymentQr {
  width: min(232px, 62vw);
}
.premium-payment-status:empty {
  display: none;
}
.premium-payment-hint {
  margin-top: 1px;
  font-size: 10px;
}
.premium-payment-actions {
  margin-top: 4px;
  gap: 8px;
}
.premium-payment-actions button {
  min-height: 44px;
  border-radius: 12px;
  font-size: 12px;
}
.premium-payment-confirmation:empty {
  display: none;
}
@media (max-height: 760px) {
  .premium-payment-modal {
    align-items: center;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .premium-payment-content {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    gap: 6px;
    padding-top: 48px;
    padding-bottom: 14px;
  }
  #premiumPaymentQr {
    width: min(210px, 56vw);
  }
}

/* [MODIFIED] Clean, wallet-neutral payment proof upload dialog. */
.premium-proof-modal {
  padding: 18px;
}
.premium-proof-content {
  width: min(100%, 350px);
  gap: 10px;
  padding: 22px;
  border-radius: 22px;
}
.premium-proof-content h2 {
  font-size: 19px;
  letter-spacing: -.3px;
}
.premium-proof-description {
  font-size: 12px;
  line-height: 1.5;
}
.premium-proof-picker {
  min-height: 148px;
  border-radius: 14px;
  background: rgba(100,140,110,.055);
}
.premium-proof-placeholder {
  min-height: 148px;
  gap: 6px;
  padding: 16px;
}
.premium-proof-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-size: 28px;
}
.premium-proof-placeholder strong {
  font-size: 13px;
}
.premium-proof-placeholder small {
  font-size: 10px;
}
.premium-proof-change-label {
  margin-top: 4px;
  padding: 7px 12px;
  font-size: 10px;
}
.premium-proof-actions {
  gap: 8px;
}
.premium-proof-actions button {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
}
.premium-proof-confirm:disabled {
  background: rgba(37,211,102,.28);
  color: rgba(237,247,239,.48);
}
.premium-proof-error:empty {
  display: none;
}

/* [MODIFIED] Professional pairing layout: tabs and actions stay outside the QR canvas. */
.whatsapp-sessions-modal.is-pairing .whatsapp-session-qr {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
  margin-top:14px;
  padding:0;
  border-radius:0;
  background:transparent;
  color:var(--text);
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-tabs {
  order:0;
  margin:0;
  padding:4px;
  border-radius:13px;
  background:var(--surface-2);
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-tab {
  min-height:42px;
  font-size:13px;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-method-panel {
  gap:12px;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-qr-brand-frame {
  width:min(100%, 340px);
  padding:10px;
  border:1px solid rgba(20,40,28,.08);
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}
.whatsapp-sessions-modal.is-pairing .whatsapp-qr-brand-frame > #whatsappSessionQrImage {
  border-radius:8px;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-status {
  min-height:0;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:11px;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-cancel {
  order:3;
  margin:2px 0 0;
  min-height:48px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--surface-2);
  color:var(--text);
  box-shadow:none;
  font-size:13px;
  font-weight:750;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-submit {
  min-height:46px;
  border-radius:12px;
  box-shadow:0 5px 14px rgba(37,201,106,.16);
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-hint {
  margin:0;
  line-height:1.45;
}

/* [MODIFIED] Cleaner pairing-code form: remove repeated instructions and strengthen hierarchy. */
.whatsapp-sessions-modal.is-pairing .whatsapp-code-method-panel,
.whatsapp-sessions-modal.is-pairing #whatsappCodeMethodPanel {
  gap:10px;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-label {
  margin:2px 0 0;
  color:var(--text);
  font-size:13px;
  font-weight:700;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-phone-input {
  min-height:50px;
  padding:0 15px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--surface-2);
  color:var(--text);
  font-size:15px;
  letter-spacing:.2px;
  box-shadow:none;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-phone-input::placeholder {
  color:var(--muted);
  opacity:.72;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-phone-input:focus {
  border-color:rgba(37,201,106,.65);
  box-shadow:0 0 0 3px rgba(37,201,106,.09);
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-submit {
  min-height:48px;
  margin-top:2px;
  border-radius:13px;
  background:#25c96a;
  color:#082516;
  font-size:13px;
  font-weight:800;
  box-shadow:0 5px 14px rgba(37,201,106,.13);
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-status {
  min-height:0;
  margin:0;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-code-result {
  padding:16px 14px;
  border-radius:14px;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-code-result > p {
  max-width:270px;
  line-height:1.5;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-cancel {
  min-height:46px;
  margin-top:2px;
}

/* [MODIFIED] Pairing code result is a focused, copy-ready panel without repeated status text. */
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-code-result {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:18px 16px;
  border:1px solid rgba(37,201,106,.25);
  border-radius:16px;
  background:linear-gradient(145deg, rgba(37,201,106,.10), rgba(37,201,106,.035));
  text-align:center;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-code-result > span {
  color:#35cf7a;
  font-size:10px;
  font-weight:800;
  letter-spacing:2px;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-code-result > strong {
  color:var(--text);
  font-size:clamp(28px, 8vw, 36px);
  font-weight:800;
  letter-spacing:5px;
  line-height:1.2;
  font-variant-numeric:tabular-nums;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-copy {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:132px;
  min-height:40px;
  padding:0 16px;
  border:1px solid rgba(37,201,106,.35);
  border-radius:11px;
  background:rgba(37,201,106,.12);
  color:#42d485;
  font-size:12px;
  font-weight:800;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-copy::before {
  content:"";
  width:14px;
  height:14px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='13' height='13' rx='2'/%3E%3Cpath d='M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='13' height='13' rx='2'/%3E%3Cpath d='M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E") center/contain no-repeat;
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-copy.is-copied {
  border-color:rgba(37,201,106,.55);
  background:rgba(37,201,106,.2);
}
.whatsapp-sessions-modal.is-pairing .whatsapp-pairing-code-result > p {
  max-width:260px;
  margin:0;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}
.whatsapp-sessions-modal.is-pairing #whatsappPairingCodeStatus:empty {
  display:none;
}

/* [ADDED] Center-out circular reveal for light/dark theme changes. */
::view-transition-group(root) {
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(.22, .75, .2, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 1;
}
::view-transition-new(root) {
  z-index: 2;
  clip-path: circle(0 at 50% 50%);
  animation: wagram-theme-reveal 620ms cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes wagram-theme-reveal {
  to {
    clip-path: circle(150vmax at 50% 50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 1ms !important;
  }
}
 
/* [ADDED] Clear, compact empty state when no WhatsApp account is linked. */
.whatsapp-empty-state {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:24px 12px 18px;
  text-align:center;
}
.whatsapp-empty-state strong {
  color:var(--text);
  font-size:14px;
  font-weight:700;
}
.whatsapp-empty-state span {
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
 
/* [MODIFIED] Ensure the primary WhatsApp row is fully removed from layout when hidden.
   The row uses display:flex, which otherwise overrides the browser's hidden presentation. */
.whatsapp-primary-account-row[hidden] {
  display: none !important;
}

/* [MODIFIED] WAMO AI settings: three-column icon grid with row-scoped expansion. */
.ai-business-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.ai-business-section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.ai-business-section-heading > span {
  color: var(--muted);
  font-size: 11px;
}
.ai-business-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(78px, auto));
  gap: 10px;
  padding: 2px 0 6px;
}
.ai-business-setting-tile {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  gap: 0;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition:
    background-color .28s cubic-bezier(.22, 1, .36, 1),
    border-color .28s cubic-bezier(.22, 1, .36, 1),
    opacity .28s cubic-bezier(.22, 1, .36, 1),
    transform .28s cubic-bezier(.22, 1, .36, 1);
}
.ai-business-setting-tile:nth-child(-n+3) { grid-row: 1; }
.ai-business-setting-tile:nth-child(n+4) { grid-row: 2; }
.ai-business-setting-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--accent);
  transition: background-color .28s cubic-bezier(.22, 1, .36, 1), transform .28s cubic-bezier(.22, 1, .36, 1);
}
.ai-business-setting-icon svg { width: 21px; height: 21px; }
.ai-business-setting-copy,
.ai-business-setting-arrow { display: none; }
.ai-business-setting-tile:hover,
.ai-business-setting-tile:focus-visible,
.ai-business-setting-tile.is-expanded {
  z-index: 2;
  grid-column: 1 / -1;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  justify-items: stretch;
  gap: 12px;
  padding: 12px 14px;
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
  text-align: left;
  transform: translateY(-1px);
}
.ai-business-setting-tile:hover .ai-business-setting-icon,
.ai-business-setting-tile:focus-visible .ai-business-setting-icon,
.ai-business-setting-tile.is-expanded .ai-business-setting-icon { transform: scale(.96); }
.ai-business-setting-tile:hover .ai-business-setting-copy,
.ai-business-setting-tile:focus-visible .ai-business-setting-copy,
.ai-business-setting-tile.is-expanded .ai-business-setting-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 3px;
  animation: aiSettingsLabelIn .28s cubic-bezier(.22, 1, .36, 1) both;
}
.ai-business-setting-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-business-setting-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-business-setting-tile:hover .ai-business-setting-arrow,
.ai-business-setting-tile:focus-visible .ai-business-setting-arrow,
.ai-business-setting-tile.is-expanded .ai-business-setting-arrow {
  display: block;
  align-self: center;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(1):hover) .ai-business-setting-tile:nth-child(2),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(1):hover) .ai-business-setting-tile:nth-child(3),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(2):hover) .ai-business-setting-tile:nth-child(1),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(2):hover) .ai-business-setting-tile:nth-child(3),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(3):hover) .ai-business-setting-tile:nth-child(1),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(3):hover) .ai-business-setting-tile:nth-child(2),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(4):hover) .ai-business-setting-tile:nth-child(5),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(4):hover) .ai-business-setting-tile:nth-child(6),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(5):hover) .ai-business-setting-tile:nth-child(4),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(5):hover) .ai-business-setting-tile:nth-child(6),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(6):hover) .ai-business-setting-tile:nth-child(4),
.ai-business-settings-grid:has(.ai-business-setting-tile:nth-child(6):hover) .ai-business-setting-tile:nth-child(5) {
  visibility: hidden;
  pointer-events: none;
}
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(1)) .ai-business-setting-tile:nth-child(2),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(1)) .ai-business-setting-tile:nth-child(3),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(2)) .ai-business-setting-tile:nth-child(1),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(2)) .ai-business-setting-tile:nth-child(3),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(3)) .ai-business-setting-tile:nth-child(1),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(3)) .ai-business-setting-tile:nth-child(2),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(4)) .ai-business-setting-tile:nth-child(5),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(4)) .ai-business-setting-tile:nth-child(6),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(5)) .ai-business-setting-tile:nth-child(4),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(5)) .ai-business-setting-tile:nth-child(6),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(6)) .ai-business-setting-tile:nth-child(4),
.ai-business-settings-grid:has(.ai-business-setting-tile.is-expanded:nth-child(6)) .ai-business-setting-tile:nth-child(5) {
  visibility: hidden;
  pointer-events: none;
}
@keyframes aiSettingsLabelIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}
.ai-business-setting-tile:active { transform: scale(.985); }
.ai-business-setting-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: none) {
  .ai-business-setting-tile:hover { transform: none; }
}
@media (max-width: 360px) {
  .ai-business-settings-grid { gap: 7px; }
  .ai-business-setting-tile { min-height: 70px; padding: 10px 5px; }
  .ai-business-setting-icon { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-business-setting-tile,
  .ai-business-setting-icon,
  .ai-business-setting-copy {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}


/* [ADDED] Separate tabs and directory rows for customer and employee lists. */
.directory-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 5px 2px 12px;
  scrollbar-width: none;
}
.directory-tabs::-webkit-scrollbar { display: none; }
.directory-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.directory-tab.selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
}
.directory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin: 0 0 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}
.directory-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.directory-row-main .item-body { min-width: 0; }
.directory-address {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.directory-row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}
.directory-row-actions button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.directory-row-actions .i { width: 16px; height: 16px; }
.field-optional { color: var(--muted); font-size: 11px; font-weight: 500; }
#customerContactAddressInput { width: 100%; resize: vertical; }
