/* =========================================================
   Dude App Authentic UI Stylesheet
   ========================================================= */

:root {
  --wa-green: #008069;
  --wa-teal: #00a884;
  --wa-bright: #25d366;
  --wa-bg: #ffffff;
  --wa-bg-alt: #f0f2f5;
  --wa-surface: #ffffff;
  --wa-border: #e9edef;
  --wa-text: #111b21;
  --wa-text-sec: #54656f;
  --wa-chip-bg: #f0f2f5;
  --wa-chip-active-bg: #d9fdd3;
  --wa-chip-active-text: #008069;
  --wa-wallpaper: #efeae2;
  --wa-bubble-me: #d9fdd3;
  --wa-bubble-them: #ffffff;
  --wa-bubble-text: #111b21;
  --wa-bubble-meta: #667781;
  --wa-tick-read: #53bdeb;
  --wa-hover: #f5f6f6;
  --wa-active-row: #f0f2f5;
  --wa-composer-bg: #f0f2f5;
  --wa-pill-bg: #ffffff;
  --wa-shadow: 0 2px 10px rgba(11, 20, 26, 0.12);
}

[data-theme="dark"] {
  --wa-green: #00a884;
  --wa-teal: #00a884;
  --wa-bright: #25d366;
  --wa-bg: #111b21;
  --wa-bg-alt: #0b141a;
  --wa-surface: #202c33;
  --wa-border: #222e35;
  --wa-text: #e9edef;
  --wa-text-sec: #8696a0;
  --wa-chip-bg: #202c33;
  --wa-chip-active-bg: #0a332c;
  --wa-chip-active-text: #00a884;
  --wa-wallpaper: #0b141a;
  --wa-bubble-me: #005c4b;
  --wa-bubble-them: #202c33;
  --wa-bubble-text: #e9edef;
  --wa-bubble-meta: #8696a0;
  --wa-tick-read: #53bdeb;
  --wa-hover: #202c33;
  --wa-active-row: #2a3942;
  --wa-composer-bg: #202c33;
  --wa-pill-bg: #2a3942;
  --wa-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

[hidden] {
  display: none !important;
}

body.wa-mode {
  margin: 0;
  padding: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--wa-bg);
  color: var(--wa-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.wa-mode .bg-glow {
  display: none;
}

.wa-shell {
  display: flex;
  width: 100vw;
  height: 100dvh;
  background: var(--wa-bg);
  overflow: hidden;
  position: relative;
}

/* ---------------- LEFT SIDEBAR ---------------- */
.wa-sidebar {
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--wa-bg);
  border-right: 1px solid var(--wa-border);
  position: relative;
  z-index: 2;
}

.wa-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.wa-tab-pane[hidden] {
  display: none !important;
}

/* Top App Bar */
.wa-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  background: var(--wa-bg);
  flex-shrink: 0;
}

.wa-appbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-logo-title {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--wa-green);
}

[data-theme="dark"] .wa-logo-title {
  color: var(--wa-text);
}

.wa-section-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--wa-text);
}

.wa-conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--wa-chip-bg);
  color: var(--wa-text-sec);
}

.wa-conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}

.wa-conn-dot.online {
  background: var(--wa-bright);
}

.wa-appbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.wa-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--wa-text-sec);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.wa-icon-btn:hover {
  background: var(--wa-hover);
  color: var(--wa-text);
}

.wa-icon-btn svg {
  width: 21px;
  height: 21px;
}

/* Dropdown Menu */
.wa-menu-wrap {
  position: relative;
}

.wa-dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  min-width: 235px;
  background: var(--wa-surface);
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  box-shadow: var(--wa-shadow);
  padding: 6px 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.wa-dropdown[hidden] {
  display: none !important;
}

.wa-dropdown button {
  border: none;
  background: transparent;
  color: var(--wa-text);
  text-align: left;
  padding: 11px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-dropdown button:hover {
  background: var(--wa-hover);
}

/* Search Bar */
.wa-search-wrap {
  padding: 4px 14px 8px;
  flex-shrink: 0;
}

.wa-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--wa-bg-alt);
  border-radius: 999px;
  padding: 8px 14px;
}

.wa-search-icon {
  width: 18px;
  height: 18px;
  color: var(--wa-text-sec);
  flex-shrink: 0;
}

.wa-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--wa-text);
  font-size: 0.92rem;
  outline: none;
  min-width: 0;
}

.wa-search-box input::placeholder {
  color: var(--wa-text-sec);
}

.wa-search-clear {
  border: none;
  background: transparent;
  color: var(--wa-text-sec);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0 4px;
}

/* Filter Chips */
.wa-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

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

.wa-chip {
  border: none;
  background: var(--wa-chip-bg);
  color: var(--wa-text-sec);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.wa-chip.active {
  background: var(--wa-chip-active-bg);
  color: var(--wa-chip-active-text);
}

/* Chat / List Scroll */
.wa-list-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 76px;
}

.wa-chat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.wa-chat-row::after {
  content: "";
  position: absolute;
  left: 74px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: var(--wa-border);
  opacity: 0.65;
}

.wa-chat-row:last-child::after {
  display: none;
}

.wa-chat-row:hover {
  background: var(--wa-hover);
}

.wa-chat-row.active {
  background: var(--wa-active-row);
}

.wa-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #dfe5e7;
  color: #54656f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative;
}

[data-theme="dark"] .wa-avatar {
  background: #2a3942;
  color: #d1d7db;
}

.wa-avatar.channel {
  background: rgba(0, 168, 132, 0.18);
  color: var(--wa-teal);
}

.wa-online-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--wa-bright);
  border: 2px solid var(--wa-bg);
}

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

.wa-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.wa-row-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--wa-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-row-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 168, 132, 0.14);
  color: var(--wa-teal);
}

.wa-row-time {
  font-size: 0.74rem;
  color: var(--wa-text-sec);
  flex-shrink: 0;
}

.wa-row-time.unread {
  color: var(--wa-bright);
  font-weight: 600;
}

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

.wa-row-preview {
  font-size: 0.85rem;
  color: var(--wa-text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-row-preview.typing {
  color: var(--wa-bright);
  font-weight: 600;
}

.wa-unread-pill {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--wa-bright);
  color: #111b21;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-list-section-label {
  padding: 10px 14px 4px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wa-teal);
}

.wa-empty-list {
  text-align: center;
  padding: 40px 24px;
  color: var(--wa-text-sec);
  font-size: 0.9rem;
}

/* FAB */
.wa-fab {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: var(--wa-teal);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 168, 132, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s;
}

.wa-fab:hover {
  transform: scale(1.05);
}

.wa-fab svg {
  width: 26px;
  height: 26px;
}

/* Bottom Navigation Bar */
.wa-bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--wa-bg);
  border-top: 1px solid var(--wa-border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.wa-nav-btn {
  border: none;
  background: transparent;
  color: var(--wa-text-sec);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
}

.wa-nav-icon {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.wa-nav-btn.active {
  color: var(--wa-text);
}

.wa-nav-btn.active .wa-nav-icon {
  background: var(--wa-chip-active-bg);
  color: var(--wa-chip-active-text);
}

.wa-nav-icon svg {
  width: 21px;
  height: 21px;
}

.wa-nav-badge {
  position: absolute;
  top: -2px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--wa-bright);
  color: #111b21;
  font-size: 0.66rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subheaders & Updates / Communities / Calls */
.wa-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--wa-text);
}

.wa-link-btn {
  border: none;
  background: transparent;
  color: var(--wa-teal);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.wa-count-pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--wa-chip-active-bg);
  color: var(--wa-chip-active-text);
}

.wa-status-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-comm-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 14px 12px;
}

.wa-comm-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--wa-border);
  background: var(--wa-surface);
  color: var(--wa-text);
  cursor: pointer;
  text-align: left;
}

.wa-comm-action.primary {
  background: rgba(0, 168, 132, 0.12);
  border-color: rgba(0, 168, 132, 0.35);
}

.wa-comm-action span {
  font-size: 1.35rem;
}

.wa-comm-action strong {
  display: block;
  font-size: 0.86rem;
}

.wa-comm-action small {
  color: var(--wa-text-sec);
  font-size: 0.72rem;
}

/* ---------------- RIGHT MAIN PANE (CHAT VIEW) ---------------- */
.wa-main {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--wa-wallpaper);
  position: relative;
}

.wa-welcome-pane {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--wa-bg-alt);
  border-bottom: 6px solid var(--wa-teal);
}

.wa-welcome-card {
  max-width: 460px;
  text-align: center;
}

.wa-welcome-logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: var(--wa-shadow);
}

.wa-welcome-card h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--wa-text);
}

.wa-welcome-card p {
  margin: 0 0 22px;
  color: var(--wa-text-sec);
  font-size: 0.92rem;
  line-height: 1.5;
}

.wa-welcome-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.wa-welcome-lock {
  font-size: 0.78rem;
  color: var(--wa-text-sec);
}

.wa-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.wa-btn.primary {
  background: var(--wa-teal);
  color: #ffffff;
}

.wa-btn.secondary {
  background: var(--wa-surface);
  color: var(--wa-text);
  border: 1px solid var(--wa-border);
}

.wa-btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Active Chat View */
.wa-chat-view {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--wa-wallpaper);
  background-image: radial-gradient(rgba(128, 128, 128, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
}

.wa-chat-view[hidden] {
  display: none !important;
}

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

[data-theme="dark"] .wa-chat-header {
  background: var(--wa-surface);
}

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

.wa-chat-peer .wa-avatar {
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
}

.wa-chat-peer-text {
  min-width: 0;
}

.wa-chat-peer-text strong {
  display: block;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-chat-peer-text span {
  display: block;
  font-size: 0.75rem;
  color: var(--wa-text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-chat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* In-chat Search Bar */
.wa-inchat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--wa-surface);
  border-bottom: 1px solid var(--wa-border);
}

.wa-inchat-search[hidden] {
  display: none !important;
}

.wa-inchat-search input {
  flex: 1;
  border: 1px solid var(--wa-border);
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--wa-bg-alt);
  color: var(--wa-text);
  outline: none;
  font-size: 0.88rem;
}

.wa-search-count {
  font-size: 0.76rem;
  color: var(--wa-text-sec);
}

/* Messages */
.wa-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-date-pill {
  align-self: center;
  background: var(--wa-surface);
  color: var(--wa-text-sec);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  margin: 6px 0;
}

.wa-bubble {
  max-width: min(78%, 540px);
  padding: 7px 10px 6px;
  border-radius: 0 10px 10px 10px;
  background: var(--wa-bubble-them);
  color: var(--wa-bubble-text);
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.12);
  position: relative;
  align-self: flex-start;
  word-wrap: break-word;
  margin-left: 6px;
}

.wa-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: -7px;
  width: 0;
  height: 0;
  border-top: 8px solid var(--wa-bubble-them);
  border-left: 8px solid transparent;
}

.wa-bubble.me {
  align-self: flex-end;
  background: var(--wa-bubble-me);
  border-radius: 10px 0 10px 10px;
  margin-left: 0;
  margin-right: 6px;
}

.wa-bubble.me::before {
  left: auto;
  right: -7px;
  border-top: 8px solid var(--wa-bubble-me);
  border-left: none;
  border-right: 8px solid transparent;
}

.wa-bubble.sticker-only::before {
  display: none;
}

.wa-bubble.sticker-only {
  background: transparent !important;
  box-shadow: none !important;
  padding: 2px;
}

.wa-sticker-big {
  font-size: 4.2rem;
  line-height: 1.05;
  display: block;
}

.wa-bubble-sender {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--wa-teal);
  margin-bottom: 2px;
}

.wa-bubble-reply {
  border-left: 3px solid var(--wa-teal);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 5px;
  font-size: 0.78rem;
}

[data-theme="dark"] .wa-bubble-reply {
  background: rgba(255, 255, 255, 0.06);
}

.wa-bubble-text {
  font-size: 0.92rem;
  line-height: 1.38;
  white-space: pre-wrap;
}

.wa-bubble-text mark {
  background: #fde047;
  color: #111b21;
  border-radius: 3px;
  padding: 0 2px;
}

.wa-bubble-media {
  margin-bottom: 4px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 290px;
}

.wa-bubble-media img,
.wa-bubble-media video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.wa-bubble-media audio {
  width: 240px;
  max-width: 100%;
  height: 36px;
}

.wa-bubble-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  margin-bottom: 4px;
}

[data-theme="dark"] .wa-bubble-file {
  background: rgba(255, 255, 255, 0.07);
}

.wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--wa-bubble-meta);
  margin-top: 2px;
}

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

.wa-bubble-actions {
  display: none;
  gap: 4px;
  position: absolute;
  top: -12px;
  right: 6px;
  background: var(--wa-surface);
  border: 1px solid var(--wa-border);
  border-radius: 999px;
  padding: 2px 6px;
  box-shadow: var(--wa-shadow);
  z-index: 4;
}

.wa-bubble:hover .wa-bubble-actions,
.wa-bubble.show-actions .wa-bubble-actions {
  display: flex;
}

.wa-bubble-actions button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 4px;
}

.wa-reactions-row {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.wa-react-pill {
  font-size: 0.74rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--wa-surface);
  border: 1px solid var(--wa-border);
  cursor: pointer;
}

.wa-scroll-bottom {
  position: absolute;
  right: 16px;
  bottom: 76px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--wa-border);
  background: var(--wa-surface);
  color: var(--wa-text);
  box-shadow: var(--wa-shadow);
  cursor: pointer;
  z-index: 6;
}

/* Drop Overlay */
.wa-drop-overlay {
  position: absolute;
  inset: 58px 0 64px;
  background: rgba(0, 168, 132, 0.18);
  border: 2px dashed var(--wa-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--wa-text);
  z-index: 15;
  backdrop-filter: blur(2px);
}

.wa-drop-overlay[hidden] {
  display: none !important;
}

/* Reply Bar */
.wa-reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--wa-surface);
  border-top: 1px solid var(--wa-border);
}

.wa-reply-bar[hidden] {
  display: none !important;
}

.wa-reply-accent {
  width: 4px;
  height: 32px;
  border-radius: 4px;
  background: var(--wa-teal);
}

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

.wa-reply-body strong {
  display: block;
  font-size: 0.78rem;
  color: var(--wa-teal);
}

.wa-reply-body span {
  display: block;
  font-size: 0.8rem;
  color: var(--wa-text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sticker & Emoji Picker */
.wa-sticker-picker {
  background: var(--wa-surface);
  border-top: 1px solid var(--wa-border);
  padding: 8px 12px 12px;
  max-height: 230px;
  overflow-y: auto;
}

.wa-sticker-picker[hidden] {
  display: none !important;
}

.wa-picker-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.wa-picker-tab {
  border: none;
  background: var(--wa-chip-bg);
  color: var(--wa-text-sec);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.wa-picker-tab.active {
  background: var(--wa-chip-active-bg);
  color: var(--wa-chip-active-text);
}

.wa-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
}

.wa-picker-grid button {
  border: none;
  background: transparent;
  font-size: 1.45rem;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
}

.wa-picker-grid button:hover {
  background: var(--wa-hover);
}

.wa-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.wa-sticker-grid[hidden] {
  display: none !important;
}

.wa-sticker-btn {
  border: 1px solid var(--wa-border);
  background: var(--wa-bg-alt);
  border-radius: 12px;
  padding: 8px 4px;
  font-size: 2.1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.wa-sticker-btn small {
  font-size: 0.62rem;
  color: var(--wa-text-sec);
}

/* Attachment Sheet */
.wa-attach-sheet {
  position: absolute;
  bottom: 68px;
  left: 12px;
  right: 12px;
  max-width: 360px;
  background: var(--wa-surface);
  border: 1px solid var(--wa-border);
  border-radius: 18px;
  box-shadow: var(--wa-shadow);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  z-index: 25;
}

.wa-attach-sheet[hidden] {
  display: none !important;
}

.wa-attach-item {
  border: none;
  background: transparent;
  color: var(--wa-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
}

.wa-attach-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
}

.wa-attach-circle.doc {
  background: #7f66ff;
}

.wa-attach-circle.gallery {
  background: #007bfc;
}

.wa-attach-circle.cam {
  background: #ff2e74;
}

.wa-attach-circle.audio {
  background: #ff7b00;
}

.wa-attach-circle.folder {
  background: #00a884;
}

.wa-attach-circle.hub {
  background: #0ea5e9;
}

/* Voice Recording Bar */
.wa-voice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--wa-surface);
  border-top: 1px solid var(--wa-border);
}

.wa-voice-bar[hidden] {
  display: none !important;
}

.wa-voice-hint {
  flex: 1;
  font-size: 0.84rem;
  color: var(--wa-text-sec);
}

/* Composer */
.wa-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: transparent;
  flex-shrink: 0;
}

.wa-composer-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--wa-pill-bg);
  border-radius: 999px;
  padding: 5px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wa-composer-pill input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--wa-text);
  font-size: 0.95rem;
  padding: 7px 4px;
  outline: none;
  min-width: 0;
}

.wa-comp-icon {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}

.wa-comp-icon:hover {
  background: var(--wa-hover);
}

.wa-send-fab {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--wa-teal);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 168, 132, 0.35);
}

.wa-send-fab svg {
  width: 21px;
  height: 21px;
}

/* Dude App Hub Modal */
.wa-hub-modal {
  width: min(980px, 96vw) !important;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
}

.wa-hub-body {
  overflow-y: auto;
  padding: 0 !important;
}

.wa-hub-body .app-shell {
  padding: 12px;
  max-width: 100%;
}

/* Call Overlay */
.wa-call-overlay {
  position: fixed;
  inset: 0;
  background: #0b141a;
  color: #fff;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-call-overlay[hidden] {
  display: none !important;
}

.wa-call-card {
  width: min(520px, 96vw);
  height: min(680px, 92dvh);
  background: #111b21;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.wa-call-top {
  text-align: center;
}

.wa-call-badge {
  font-size: 0.78rem;
  color: var(--wa-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wa-call-top h2 {
  margin: 6px 0 4px;
}

.wa-call-media {
  position: relative;
  width: 100%;
  flex: 1;
  margin: 14px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #202c33;
}

#waRemoteVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#waLocalVideo {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 110px;
  height: 150px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: #000;
}

.wa-call-controls {
  display: flex;
  gap: 16px;
}

.wa-call-ctrl {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: #2a3942;
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
}

.wa-call-ctrl.accept {
  background: var(--wa-bright);
}

.wa-call-ctrl.end {
  background: #ef4444;
}

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

.wa-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.wa-modal-form input,
.wa-modal-form textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--wa-border);
  background: var(--wa-bg-alt);
  color: var(--wa-text);
  font-size: 0.92rem;
}

/* ---------------- RESPONSIVE MOBILE & DESKTOP ---------------- */
@media (max-width: 899px) {

  .wa-shell,
  .wa-sidebar,
  .wa-main,
  .wa-chat-view {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .wa-main {
    display: none;
  }

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

  .wa-shell.chat-open .wa-main {
    display: flex;
    width: 100%;
  }

  .wa-appbar,
  .wa-chat-header {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .wa-chat-header {
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .wa-icon-btn {
    width: 40px;
    height: 40px;
    -webkit-tap-highlight-color: transparent;
  }

  .wa-bubble {
    max-width: 86%;
  }

  .wa-attach-sheet {
    left: 10px;
    right: 10px;
    max-width: none;
    bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .wa-fab {
    right: 16px;
    bottom: 16px;
  }

  .wa-call-card {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  }

  .wa-hub-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0 !important;
  }
}

@media (max-width: 480px) {
  .wa-logo-title {
    font-size: 1.28rem;
  }

  .wa-conn-pill {
    font-size: 0.64rem;
    padding: 2px 7px;
  }

  .wa-messages {
    padding: 10px 10px;
  }

  .wa-composer {
    gap: 6px;
    padding: 6px 8px max(8px, env(safe-area-inset-bottom));
  }

  .wa-composer-pill {
    padding: 3px 6px;
    gap: 2px;
  }

  .wa-composer-pill input {
    font-size: 16px;
    /* Prevents iOS auto-zoom on focus */
    padding: 7px 2px;
  }

  .wa-comp-icon {
    font-size: 1.15rem;
    padding: 5px;
  }

  .wa-send-fab {
    width: 44px;
    height: 44px;
  }

  .wa-comm-hero {
    grid-template-columns: 1fr;
  }

  .wa-bubble-media {
    max-width: 240px;
  }

  .wa-bubble-media audio {
    width: 210px;
  }

  .modal {
    width: calc(100vw - 20px) !important;
    max-height: 88dvh;
    overflow-y: auto;
  }
}

/* Override Dude App purple/neon modal & button styles inside WhatsApp mode */
body.wa-mode .modal {
  background: var(--wa-surface);
  color: var(--wa-text);
  border: 1px solid var(--wa-border);
  box-shadow: var(--wa-shadow);
  border-radius: 16px;
}

body.wa-mode .modal-header {
  border-bottom: 1px solid var(--wa-border);
}

body.wa-mode .btn.primary {
  background: var(--wa-teal);
  color: #ffffff;
  border: none;
  box-shadow: none;
}

body.wa-mode .btn.secondary {
  background: var(--wa-bg-alt);
  color: var(--wa-text);
  border: 1px solid var(--wa-border);
}

body.wa-mode .tool-tab.active {
  background: var(--wa-teal);
  color: #ffffff;
  border-color: var(--wa-teal);
}

body.wa-mode .toast {
  background: #111b21;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (min-width: 900px) {
  .wa-sidebar {
    width: 390px;
    min-width: 340px;
    max-width: 420px;
  }
}