/* ==========================================================================
   OUR SPACE / STEALTH NOTES v2.6 — COMPLETE CORE STYLESHEET
   Supports 5 Layered Glass Themes, Virtualized Chat Bubbles, Media Hub & Modals
   ========================================================================== */

:root,
body[data-theme="default"],
body[data-theme="midnight-onyx"] {
  --bg-deep: #07080d;
  --bg-surface: rgba(17, 19, 28, 0.88);
  --bg-card: rgba(24, 27, 38, 0.85);
  --bg-input: rgba(255, 255, 255, 0.06);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.32);
  --sent-bubble: linear-gradient(135deg, #33436b 0%, #24304f 100%);
  --sent-border: rgba(129, 140, 248, 0.26);
  --received-bubble: rgba(26, 29, 41, 0.92);
  --received-border: rgba(255, 255, 255, 0.09);
  --text-primary: #f4f4f6;
  --text-secondary: rgba(244, 244, 246, 0.58);
  --border: rgba(255, 255, 255, 0.1);
  --danger: #ef4444;
  --success: #10b981;
  --ambient-glow: radial-gradient(circle at 50% 18%, rgba(99, 102, 241, 0.14), transparent 68%);
}

body[data-theme="velvet-rose"],
body[data-theme="love"] {
  --bg-deep: #11070b;
  --bg-surface: rgba(28, 14, 20, 0.88);
  --bg-card: rgba(38, 19, 27, 0.85);
  --bg-input: rgba(255, 240, 245, 0.06);
  --accent: #e11d48;
  --accent-glow: rgba(225, 29, 72, 0.32);
  --sent-bubble: linear-gradient(135deg, #882947 0%, #5c1b30 100%);
  --sent-border: rgba(251, 113, 133, 0.28);
  --received-bubble: rgba(36, 18, 25, 0.92);
  --received-border: rgba(255, 228, 234, 0.1);
  --text-primary: #fff1f2;
  --text-secondary: rgba(255, 241, 242, 0.6);
  --border: rgba(255, 228, 234, 0.11);
  --ambient-glow: radial-gradient(circle at 50% 18%, rgba(225, 29, 72, 0.16), transparent 68%);
}

body[data-theme="nordic-slate"] {
  --bg-deep: #060e16;
  --bg-surface: rgba(13, 24, 36, 0.88);
  --bg-card: rgba(19, 34, 50, 0.85);
  --bg-input: rgba(240, 249, 255, 0.06);
  --accent: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.32);
  --sent-bubble: linear-gradient(135deg, #1b5478 0%, #123a54 100%);
  --sent-border: rgba(56, 189, 248, 0.28);
  --received-bubble: rgba(18, 31, 45, 0.92);
  --received-border: rgba(224, 242, 254, 0.1);
  --text-primary: #f0f9ff;
  --text-secondary: rgba(240, 249, 255, 0.58);
  --border: rgba(224, 242, 254, 0.1);
  --ambient-glow: radial-gradient(circle at 50% 18%, rgba(14, 165, 233, 0.15), transparent 68%);
}

body[data-theme="emerald-night"] {
  --bg-deep: #05100c;
  --bg-surface: rgba(11, 27, 21, 0.88);
  --bg-card: rgba(16, 38, 30, 0.85);
  --bg-input: rgba(236, 253, 245, 0.06);
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.32);
  --sent-bubble: linear-gradient(135deg, #155e48 0%, #0e4132 100%);
  --sent-border: rgba(52, 211, 153, 0.28);
  --received-bubble: rgba(15, 34, 27, 0.92);
  --received-border: rgba(209, 250, 229, 0.1);
  --text-primary: #ecfdf5;
  --text-secondary: rgba(236, 253, 245, 0.58);
  --border: rgba(209, 250, 229, 0.1);
  --ambient-glow: radial-gradient(circle at 50% 18%, rgba(16, 185, 129, 0.15), transparent 68%);
}

body[data-theme="sunset-amethyst"] {
  --bg-deep: #0c0714;
  --bg-surface: rgba(22, 14, 34, 0.88);
  --bg-card: rgba(31, 20, 48, 0.85);
  --bg-input: rgba(250, 245, 255, 0.06);
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.32);
  --sent-bubble: linear-gradient(135deg, #5b2c82 0%, #3d1d59 100%);
  --sent-border: rgba(192, 132, 252, 0.28);
  --received-bubble: rgba(27, 17, 42, 0.92);
  --received-border: rgba(243, 232, 255, 0.1);
  --text-primary: #faf5ff;
  --text-secondary: rgba(250, 245, 255, 0.58);
  --border: rgba(243, 232, 255, 0.1);
  --ambient-glow: radial-gradient(circle at 50% 18%, rgba(168, 85, 247, 0.16), transparent 68%);
}

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

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-deep);
  background-size: var(--wallpaper-fit, cover);
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(var(--wallpaper-blur, 0px));
  z-index: 1;
  pointer-events: none;
  transform: translateZ(0) scale(var(--wallpaper-blur-scale, 1));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: filter 0.18s ease;
}

#bg-wallpaper-scrim {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(5, 6, 10, var(--wallpaper-dim, 0.48));
  opacity: 0;
  transition: opacity 0.2s ease;
  transform: translateZ(0);
}

body.has-custom-wallpaper #bg-wallpaper-scrim {
  opacity: 1;
}

body.has-custom-wallpaper #chat-screen,
body.has-custom-wallpaper #messages-container {
  background: transparent !important;
}

body.has-custom-wallpaper .background-layers {
  display: none !important;
}

.wallpaper-preset-tile {
  position: relative;
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.2, 1), border-color 0.16s ease, box-shadow 0.16s ease;
}

.wallpaper-preset-tile:active {
  transform: scale(0.96);
}

.wallpaper-preset-tile.active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent-glow), 0 8px 20px rgba(0, 0, 0, 0.45);
}

.background-layers {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--ambient-glow);
}

.heart-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Battery Saver Mode */
body.battery-saver *,
body.app-backgrounded * {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
}

body.battery-saver .background-layers,
body.battery-saver #emotion-canvas,
body.battery-saver #emotion-screen-aura {
  display: none !important;
}

body.battery-saver header,
body.battery-saver footer,
body.battery-saver .dropdown-content,
body.battery-saver .context-menu,
body.battery-saver #partner-profile-sheet {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Loading Overlay — permanently hidden to eliminate 1s startup splash */
#loading-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  z-index: 5000;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* Login Screen */
#login-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-deep);
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--bg-surface);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-card h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
  color: var(--text-primary);
}

.login-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.login-btn:active {
  transform: scale(0.98);
}

#login-error {
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
  text-align: center;
  min-height: 18px;
}

/* Main Chat Screen */
#chat-screen {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--vv-height, 100dvh);
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  z-index: 10;
  will-change: height, transform;
  transition:
    height 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

body.vv-live-resizing #chat-screen {
  transition: none !important;
}

body:not(.keyboard-open) #chat-screen {
  transform: translate3d(0, 0, 0);
}

/* Chat Header */
#chat-screen > header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(env(safe-area-inset-top, 10px), 10px) 12px 10px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  flex-shrink: 0;
  min-height: 58px;
}

.other-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
  padding: 4px 6px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.other-user-info:hover,
.other-user-info:active {
  background: rgba(255, 255, 255, 0.05);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  user-select: none;
}

.user-name {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.status-dot.online {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-primary);
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@media (max-width: 680px) {
  .header-center-title {
    display: none !important;
  }
  .hide-mobile {
    display: none !important;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* Search Bar in Chat Header */
.search-bar {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  padding: max(env(safe-area-inset-top, 8px), 8px) 12px 8px;
  align-items: center;
  gap: 8px;
  z-index: 60;
}

.search-bar.active {
  display: flex;
}

.search-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}

.search-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-highlight-mark {
  background: rgba(245, 158, 11, 0.42);
  color: #ffffff;
  padding: 0 2px;
  border-radius: 3px;
}

/* Header 3-Dot Dropdown */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 228px;
  background: rgba(18, 20, 29, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  z-index: 200;
  overflow-y: auto;
}

.dropdown-content.show {
  display: block;
  animation: scaleIn 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease;
}

.dropdown-item:hover,
.dropdown-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item-left svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.dropdown-item-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 6px;
}

/* ==========================================================================
   MESSAGES CONTAINER & VIRTUALIZED BUBBLES
   ========================================================================== */

/* Pinned Messages Bar (Anchored below chat header) */
.pinned-messages-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(18, 20, 29, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent, #e11d48);
  z-index: 45;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.pinned-bar-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.pinned-bar-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(225, 29, 72, 0.14);
  color: var(--accent, #e11d48);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pinned-bar-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.pinned-bar-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pinned-bar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent, #e11d48);
}

.pinned-bar-counter {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.pinned-bar-preview {
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pinned-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pinned-bar-nav-btn,
.pinned-bar-unpin-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pinned-bar-nav-btn:hover,
.pinned-bar-unpin-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Subtle Pinned Badge in Message Footer Timeline */
.pinned-timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(225, 29, 72, 0.14);
  color: var(--accent, #f43f5e);
  letter-spacing: 0.02em;
  user-select: none;
  flex-shrink: 0;
}

.pinned-timeline-badge svg {
  width: 9px;
  height: 9px;
  stroke-width: 2.3;
}

/* Hide unwanted circular button next to masked link pill */
.link-share-circle-btn {
  display: none !important;
}

#messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

#messages-container::-webkit-scrollbar {
  width: 4px;
}

#messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

.empty-state {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  text-align: center;
  padding: 32px;
  font-size: 14px;
  line-height: 1.5;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  opacity: 0.45;
}

.date-separator {
  align-self: center;
  margin: 10px 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(18, 20, 29, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
  flex-shrink: 0;
  contain: layout style paint;
}

.message {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-shrink: 0;
  user-select: text;
  contain: layout style;
}

.message.me {
  align-items: flex-end;
}

.message.other {
  align-items: flex-start;
}

.message.grouped {
  margin-top: -3px;
}

.message.sending .bubble {
  opacity: 0.88;
}

.message.highlight .bubble {
  box-shadow: 0 0 0 2px var(--accent), 0 0 22px var(--accent-glow) !important;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: min(84%, 560px);
  position: relative;
}

.message.me .message-wrapper {
  flex-direction: row-reverse;
}

.message.other.not-last-in-group .message-wrapper {
  padding-left: 34px;
}

.message.me.not-last-in-group .message-wrapper {
  padding-right: 0;
}

.message-wrapper > .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  flex-shrink: 0;
}

.message.me .message-wrapper > .avatar {
  display: none;
}

.bubble-container {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.message.me .bubble-container {
  align-items: flex-end;
}

.message.other .bubble-container {
  align-items: flex-start;
}

.bubble {
  position: relative;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.42;
  color: var(--text-primary);
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.message.me .bubble {
  background: var(--sent-bubble);
  border: 1px solid var(--sent-border);
  border-bottom-right-radius: 5px;
}

.message.other .bubble {
  background: var(--received-bubble);
  border: 1px solid var(--received-border);
  border-bottom-left-radius: 5px;
}

.message.me.not-last-in-group .bubble {
  border-bottom-right-radius: 15px;
}

.message.other.not-last-in-group .bubble {
  border-bottom-left-radius: 15px;
}

.bubble.frameless-emoji,
.bubble.frameless-media {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 0 !important;
}

.bubble-body-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
}

.bubble-text {
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.42;
  word-break: break-word;
}

.bubble-text p {
  margin: 0;
}

.bubble-text p + p {
  margin-top: 6px;
}

.bubble-text a {
  color: #93c5fd;
  text-decoration: underline;
}

.bubble-text.emoji-only-msg {
  font-size: 44px;
  line-height: 1.1;
  padding: 2px 0;
  cursor: pointer;
}

.bubble-text.multi-emoji-msg {
  font-size: 26px;
  line-height: 1.25;
}

.message-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.68);
  flex-shrink: 0;
  user-select: none;
  transform: translateY(2px);
}

.seen-icon {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.2;
  color: rgba(255, 255, 255, 0.55);
}

.seen-icon.delivered {
  color: rgba(255, 255, 255, 0.82);
}

.seen-icon.seen {
  color: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.5));
}

/* Frameless Image & Video Cards in Chat */
.frameless-media-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 17, 24, 0.7);
  max-width: min(270px, 72vw);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.frameless-media-card img,
.frameless-media-card video {
  display: block;
  width: 100%;
  max-width: min(270px, 72vw);
  max-height: 320px;
  object-fit: cover;
  border-radius: 15px;
}

.frameless-media-badge {
  position: absolute;
  bottom: 7px;
  right: 8px;
  background: rgba(10, 12, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Reply Preview Inside Bubble */
.reply-bubble {
  background: rgba(0, 0, 0, 0.24);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 5px 9px;
  margin-bottom: 6px;
  cursor: pointer;
  max-width: 100%;
}

.reply-bubble-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1px;
}

.reply-bubble-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Swipe to Reply Indicator */
.swipe-indicator {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%) scale(0.75);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.swipe-indicator.visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Message Footer & Reactions */
.message-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.reaction-trigger {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reactions-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11.5px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, background 0.15s ease;
}

.reaction-badge.active {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.reaction-badge:active {
  transform: scale(0.92);
}

/* Reaction Picker Popover */
.reaction-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: rgba(18, 20, 29, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 6px;
  gap: 4px;
  align-items: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 90;
}

.message.other .reaction-picker {
  right: auto;
  left: 0;
}

.reaction-picker.flip-below {
  bottom: auto;
  top: calc(100% + 6px);
}

.picker-emoji {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: transform 0.14s ease, background 0.14s ease;
}

.picker-emoji:hover,
.picker-emoji.active-reaction {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.15);
}

/* Scroll to Bottom Floating Button */
.scroll-to-bottom-btn {
  display: none;
  position: fixed;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 23, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 45;
}

.new-msg-indicator {
  display: none;
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

/* Reply Input Container Above Footer */
.reply-input-container {
  display: none;
  padding: 6px 12px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 6px 10px;
}

.reply-preview-content {
  min-width: 0;
  flex: 1;
}

.reply-preview-sender {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
}

.reply-preview-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Composer Footer */
#chat-screen > footer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  padding: 8px 10px max(env(safe-area-inset-bottom, 10px), 10px);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 50;
  transition: padding-bottom 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

body.keyboard-open #chat-screen > footer,
body.emoji-drawer-open #chat-screen > footer {
  padding-bottom: 8px;
}

#file-input {
  display: none;
}

.input-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 8px 12px;
  min-height: 40px;
  transition:
    border-color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

#chat-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.35;
  resize: none;
  max-height: 96px;
  padding: 0;
}

#chat-input::placeholder {
  color: var(--text-secondary);
}

.send-btn-circle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform 0.14s ease;
}

.send-btn-circle:active {
  transform: scale(0.92);
}

.send-btn-circle svg {
  width: 18px;
  height: 18px;
}

/* Voice Recording Indicator */
#recording-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulseDot 1s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.recording-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.recording-wave-bar {
  width: 3px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
}

.cancel-recording-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.waveform-bar {
  height: 45%;
  background: rgba(255, 255, 255, 0.45);
}

/* Context Menu */
.context-menu {
  display: none;
  position: fixed;
  min-width: 175px;
  background: rgba(18, 20, 29, 0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 5px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.75);
  z-index: 3600;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.context-menu-item:hover,
.context-menu-item:active {
  background: rgba(255, 255, 255, 0.08);
}

/* Call Action Buttons & Pro Call Control Dock */
.call-action-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.call-action-btn:active {
  transform: scale(0.91);
}

.call-ctrl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 60px;
}

.call-ctrl-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

#call-avatar.speaking-pulse {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.22), 0 0 28px rgba(52, 211, 153, 0.45) !important;
  transform: scale(1.035);
}

#call-avatar.on-hold-avatar {
  border-color: #f59e0b !important;
  opacity: 0.72;
}

/* ==========================================================================
   PARTNER PROFILE & SHARED MEDIA HUB SHEET
   ========================================================================== */
#partner-profile-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3100;
  background: var(--bg-deep);
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

#partner-profile-sheet.open {
  opacity: 1;
  transform: translateY(0);
}

.profile-action-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.profile-action-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease;
}

.profile-action-circle:active .profile-action-icon-wrap {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.14);
}

.profile-setting-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.profile-setting-row:hover,
.profile-setting-row:active {
  background: rgba(255, 255, 255, 0.04);
}

.profile-media-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 62px;
  z-index: 15;
}

.profile-media-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.profile-media-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.profile-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
}

.profile-grid-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  cursor: pointer;
}

.profile-grid-tile img,
.profile-grid-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-video-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-video-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.profile-folder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 28px;
}

.profile-folder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-folder-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-folder-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 56px 20px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

/* ==========================================================================
   SHEET MODALS (THEME PICKER, DISAPPEARING MESSAGES, STORAGE)
   ========================================================================== */
.sheet-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3900;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sheet-modal-card {
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #14161f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 20px;
  color: var(--text-primary);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.theme-option-card,
.retention-sheet-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-option-card.active,
.retention-sheet-row.active {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.18);
  transition: 0.2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   ANDROID NATIVE WALLPAPER & STYLE STUDIO
   ========================================================================== */
.wp-studio-card {
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
  background: #101218;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  overflow: hidden;
  color: var(--text-primary);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.9);
}

@media (max-width: 520px) {
  #theme-picker-modal.sheet-modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .wp-studio-card {
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
}

.wp-studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(env(safe-area-inset-top, 12px), 12px) 16px 12px;
  background: rgba(18, 20, 28, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.wp-studio-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.wp-studio-footer {
  padding: 12px 16px max(env(safe-area-inset-bottom, 12px), 12px);
  background: rgba(18, 20, 28, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wp-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wp-phone-frame {
  position: relative;
  width: 176px;
  height: 256px;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  background: var(--bg-deep);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wp-phone-bg {
  position: absolute;
  inset: 0;
  background-color: var(--bg-deep);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: filter 0.15s ease, background 0.2s ease;
  z-index: 0;
}

.wp-phone-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.48);
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 1;
}

.wp-phone-notch {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px 6px;
  background: rgba(12, 14, 20, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.wp-phone-chats {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 10px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.wp-mock-bubble-in {
  align-self: flex-start;
  max-width: 82%;
  padding: 6px 9px;
  border-radius: 12px 12px 12px 4px;
  background: var(--bubble-received, rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 9.5px;
  line-height: 1.35;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.wp-mock-bubble-out {
  align-self: flex-end;
  max-width: 84%;
  padding: 6px 9px;
  border-radius: 12px 12px 4px 12px;
  background: var(--bubble-sent, var(--accent));
  color: #ffffff;
  font-size: 9.5px;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}

.wp-phone-bar {
  position: relative;
  z-index: 2;
  margin: 0 8px 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 17, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8.5px;
  color: rgba(255, 255, 255, 0.55);
}

.wp-section-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 13px;
}

.wp-fit-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.wp-fit-btn {
  padding: 6px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wp-fit-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.wp-save-btn {
  flex: 1;
  padding: 13px 18px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.wp-save-btn:active {
  transform: scale(0.98);
}

/* ==========================================================================
   STANDALONE RICH SITE PREVIEW CARDS & BOTTOM LINK PILL ROW
   ========================================================================== */
.bubble.frameless-link {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: min(312px, 82vw);
  overflow: visible !important;
}

.bubble.frameless-link::before,
.bubble.frameless-link::after {
  display: none !important;
}

.link-msg-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  width: 100%;
}

.message.other .link-msg-stack {
  align-items: flex-start;
}

.link-msg-caption {
  padding: 8px 13px;
  border-radius: 16px;
  background: var(--bubble-sent, #5b5bf6);
  color: #ffffff;
  font-size: 13.5px;
  line-height: 1.42;
  max-width: 100%;
  word-break: break-word;
}

.message.other .link-msg-caption {
  background: var(--bubble-received, #1e2028);
  color: var(--text-primary, #f4f4f5);
}

.link-preview-slot {
  width: min(304px, 78vw);
  margin: 0;
}

.link-preview-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none !important;
  background: #16181f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  color: #e4e4e7 !important;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.link-preview-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.56);
}

.link-preview-card:active {
  transform: scale(0.985);
}

.link-preview-media {
  position: relative;
  width: 100%;
  height: 158px;
  background: #0a0b0e;
  overflow: hidden;
}

.link-preview-og-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}

/* Rich Dark Split-Canvas Hero Fallback (matches dark SaaS / Ruqi OG card aesthetic) */
.link-preview-hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  padding: 16px 14px 14px;
  background:
    radial-gradient(circle at 18% 22%, rgba(99, 102, 241, 0.16), transparent 55%),
    radial-gradient(circle at 82% 78%, rgba(16, 185, 129, 0.12), transparent 52%),
    linear-gradient(145deg, #090a0f 0%, #0e1017 60%, #0b0c12 100%);
  overflow: hidden;
}

.lp-hero-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.lp-hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
}

.lp-hero-favicon {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.lp-hero-heading {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
  color: #f4f4f5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.lp-hero-sub {
  font-size: 7.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.42);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lp-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
  font-size: 7.5px;
  font-family: "JetBrains Mono", monospace;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-hero-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

.lp-hero-right {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.lp-hero-mock-window {
  width: 100%;
  border-radius: 8px;
  background: rgba(17, 19, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lp-mock-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}

.lp-mock-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.lp-mock-title {
  margin-left: auto;
  font-size: 6.5px;
  color: rgba(255, 255, 255, 0.36);
  font-family: "JetBrains Mono", monospace;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-mock-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.lp-mock-box {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lp-mock-line {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.lp-mock-line.w75 { width: 75%; }
.lp-mock-line.w50 { width: 50%; }
.lp-mock-line.w85 { width: 85%; }
.lp-mock-line.w60 { width: 60%; }

.lp-mock-badge {
  margin-top: auto;
  font-size: 6px;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: 0.06em;
}

.lp-mock-stat {
  font-size: 8px;
  font-weight: 700;
  color: #f4f4f5;
  font-family: "JetBrains Mono", monospace;
}

.link-preview-body {
  padding: 13px 15px 14px;
  background: #181a22;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.link-preview-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
  color: #e4e4e7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.link-preview-desc {
  font-size: 12px;
  line-height: 1.42;
  color: rgba(228, 228, 231, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Bottom Row: Circular Share Button + Rounded URL Pill (matches Screenshot 3) */
.link-pill-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}

.message.other .link-pill-row {
  justify-content: flex-start;
}

.link-share-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1c1e26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}

.link-share-circle-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}

.link-share-circle-btn:hover {
  background: #272a35;
  border-color: rgba(255, 255, 255, 0.16);
}

.link-share-circle-btn:active {
  transform: scale(0.92);
}

.link-url-pill {
  display: inline-flex;
  align-items: center;
  max-width: min(258px, 68vw);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bubble-sent, #5856f2);
  color: #ffffff !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.65);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.message.other .link-url-pill {
  background: var(--bubble-received, #232631);
  color: #93c5fd !important;
  text-decoration-color: rgba(147, 197, 253, 0.6);
}

.link-url-pill:active {
  transform: scale(0.98);
}

.link-url-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline Masked Link Chip (when multiple URLs appear mid-paragraph) */
.masked-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 240px;
  padding: 2px 10px;
  margin: 1px 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  vertical-align: baseline;
}

.masked-link-favicon {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.masked-link-label {
  max-width: 195px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masked-link-arrow,
.masked-link-ext {
  width: 12px !important;
  height: 12px !important;
  opacity: 0.78;
  flex-shrink: 0;
}

/* ==========================================================================
   INSTAGRAM-STYLE LIVE DOODLE STUDIO
   ========================================================================== */
.ig-doodle-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.ig-doodle-tool-btn.active {
  background: #ffffff;
  color: #0b0d13;
  border-color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}

.ig-vertical-slider-track {
  width: 24px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ig-vertical-slider-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 170px;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  outline: none;
  transform: rotate(-90deg);
  cursor: pointer;
}

.ig-vertical-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  border: 2px solid #ffffff;
}

.ig-vertical-slider-track input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  border: 2px solid #ffffff;
}

.ig-bottom-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.14s ease, background 0.14s ease;
}

.ig-bottom-circle-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.18);
}

.ig-color-swatches-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 3px 4px;
  flex: 1;
  justify-content: center;
}

.ig-color-swatches-strip::-webkit-scrollbar {
  display: none;
}

.ig-eyedropper-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.doodle-color-dot {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2.2px solid rgba(255, 255, 255, 0.88);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.doodle-color-dot.active {
  transform: scale(1.16);
  border-color: #ffffff;
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.35);
}

.ig-send-plane-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  border: none;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.ig-send-plane-btn:active {
  transform: scale(0.92);
}

#doodle-add-space-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   WHATSAPP / ANDROID NATIVE BOTTOM EMOJI & CUSTOM SEMANTIC KEYBOARD
   ========================================================================== */
#emoji-picker-container.wa-emoji-drawer {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 0px;
  max-height: 46dvh;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  pointer-events: none;
  visibility: hidden;
  background: #111519;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex !important;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 52;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.48);
  will-change: height, opacity, transform;
  contain: layout paint style;
  transition:
    height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.24s;
}

#emoji-picker-container.wa-emoji-drawer.wa-drawer-open {
  height: var(--emoji-drawer-height, 298px);
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  visibility: visible;
  transition:
    height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.wa-emoji-handle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 3px;
  flex-shrink: 0;
}

.wa-emoji-handle-bar {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.wa-emoji-reaction-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 14px;
  background: rgba(99, 102, 241, 0.14);
  border-bottom: 1px solid rgba(99, 102, 241, 0.24);
  font-size: 11.5px;
  font-weight: 600;
  color: #c7d2fe;
  flex-shrink: 0;
}

.wa-emoji-reaction-cancel {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  cursor: pointer;
}

.wa-emoji-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 12px 7px;
  flex-shrink: 0;
}

.wa-emoji-top-icon-btn {
  width: 36px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.14s ease, transform 0.12s ease;
}

.wa-emoji-top-icon-btn:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.92);
}

.wa-emoji-seg-pill {
  display: inline-grid;
  grid-template-columns: repeat(2, 68px);
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  padding: 0;
}

.wa-emoji-seg-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.wa-emoji-seg-btn + .wa-emoji-seg-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.wa-emoji-seg-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.wa-emoji-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 10px 0 12px;
}

.wa-emoji-search-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
}

.wa-emoji-search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.wa-emoji-search-clear {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.wa-emoji-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 8px 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.wa-emoji-scroll-area::-webkit-scrollbar {
  display: none;
}

.wa-emoji-cat-title {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.48);
  padding: 8px 6px 4px;
  letter-spacing: 0.01em;
}

/* 8-Column Crisp Emoji Grid (Matches WhatsApp Android Layout) */
.wa-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
  justify-items: center;
}

.wa-emoji-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 44px;
  max-height: 44px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 27px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: transform 0.1s ease, background 0.12s ease;
}

.wa-emoji-cell:hover {
  background: rgba(255, 255, 255, 0.07);
}

.wa-emoji-cell:active {
  transform: scale(1.22);
  background: rgba(255, 255, 255, 0.14);
}

/* Subtle bottom-right variant indicator triangle on gesture/hand emojis (like WhatsApp) */
.wa-emoji-cell.has-variant::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 5px 5px;
  border-color: transparent transparent rgba(255, 255, 255, 0.34) transparent;
}

/* Custom Expressive Facial & Physical Semantic Emoji Strip / Cards */
.wa-custom-reactions-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 2px 6px;
}

.wa-custom-reactions-grid-full {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 4px 12px;
}

.wa-custom-emoji-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #f4f4f5;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.wa-custom-emoji-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.wa-custom-emoji-card:active {
  transform: scale(0.95);
}

.wa-custom-emoji-preview {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.wa-custom-emoji-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.wa-custom-emoji-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-custom-emoji-desc {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.52);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Category Bar */
.wa-emoji-cat-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  height: 42px;
  padding: 0 6px max(env(safe-area-inset-bottom, 0px), 2px);
  background: #0d1014;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.wa-emoji-cat-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.46);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.wa-emoji-cat-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.wa-emoji-cat-btn:active {
  transform: scale(0.9);
}

/* ==========================================================================
   RECENT-APPS / APP-SWITCHER PRIVACY BLUR SHIELD
   Applies both direct GPU filter:blur() on underlying screens and a frosted
   full-screen shield so OS task-switcher snapshots never capture readable text
   ========================================================================== */
#privacy-blur-shield {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(11, 12, 16, 0.86);
  backdrop-filter: blur(30px) saturate(120%);
  -webkit-backdrop-filter: blur(30px) saturate(120%);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none !important;
  user-select: none;
}

.privacy-blur-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 32px;
  border-radius: 20px;
  background: rgba(24, 26, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.privacy-blur-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.privacy-blur-title {
  font-size: 16px;
  font-weight: 700;
  color: #f5f5f7;
  letter-spacing: 0.02em;
}

.privacy-blur-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.52);
}

body.app-switcher-blurred #chat-screen,
body.app-switcher-blurred #login-screen,
body.app-switcher-blurred #call-overlay,
body.app-switcher-blurred #partner-profile-sheet,
body.app-switcher-blurred #media-lightbox,
body.app-switcher-blurred #camera-overlay {
  filter: blur(26px) brightness(0.32) !important;
  -webkit-filter: blur(26px) brightness(0.32) !important;
  pointer-events: none !important;
  user-select: none !important;
}