/* ============================================================
   AETHER MESSENGER — DESIGN SYSTEM & STYLES
   PRD Compliant (PRD §5, §7, §8.4)
   ============================================================ */

/* 1. CSS Variables & Brand Tokens */
:root {
  /* Surface Tokens (Deep blue-charcoal #1E252B with layered elevation) */
  --bg: #1E252B;
  --surface: #262F37;
  --surface-2: #2E3A43;
  --surface-3: #384651;
  --border: #3D4C58;
  --border-light: rgba(255, 255, 255, 0.08);

  /* Typography Colors */
  --text: #F8FAFC;
  --text-dim: #94A3B8;     /* Contrast >= 4.5:1 on #262F37 and #1E252B */
  --text-muted: #64748B;

  /* Brand Accents & Gradients (Cyan -> Violet -> Magenta) */
  --accent: #00E5E0;
  --primary: #7B5CFF;
  --magenta: #FF00E5;
  --gradient-primary: linear-gradient(135deg, #00E5E0 0%, #7B5CFF 50%, #FF00E5 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(0,229,224,0.12) 0%, rgba(123,92,255,0.12) 50%, rgba(255,0,229,0.12) 100%);
  --gradient-accent: linear-gradient(135deg, #00E5E0, #7B5CFF);

  /* Status Colors */
  --success: #22C55E;
  --danger: #EF4444;
  --warning: #F59E0B;

  /* Spacing Scale (4 / 8 / 12 / 16 / 24) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography */
  --font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 2. Reset & Native-Feel Baseline (PRD Appendix A) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg) !important;
  color: var(--text);
  height: 100%;
  overscroll-behavior: none; /* Prevents rubber-banding & pull-to-refresh */
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
}

.app-chrome {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button, [role="button"], a {
  touch-action: manipulation; /* Eliminates 300ms double-tap delay */
  font-family: inherit;
  box-sizing: border-box;
}

.scroll-area {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

input, textarea, select {
  font-size: 16px; /* Prevents iOS Safari auto-zoom */
  font-family: inherit;
  box-sizing: border-box;
}

/* Global SVG & Lucide Icon alignment normalization */
svg.lucide-icon,
.lucide-icon {
  display: block;
  flex-shrink: 0;
}

button svg,
.btn svg,
.btn-icon svg,
a svg {
  flex-shrink: 0;
  vertical-align: middle;
}

/* Checkbox & Radio baseline alignment */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  user-select: none;
}

.checkbox-row:hover {
  background: var(--surface-2);
}

.app {
  height: 100dvh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* 3. Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 4. Auth Screen */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  width: 100vw;
  background: radial-gradient(circle at center, #262F37 0%, #1E252B 100%);
  padding: var(--space-4);
}

.auth-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: fadeIn 0.4s ease-out;
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.auth-logo-img {
  width: 72px;
  height: auto;
  margin-bottom: var(--space-1);
}

.auth-logo-title {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-dim);
  font-size: 0.9375rem;
}

/* 5. Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  height: 44px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-4);
  color: var(--text);
  font-size: 16px;
  line-height: normal;
  transition: var(--transition);
  box-sizing: border-box;
}

.form-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  background-color: var(--surface-3);
}

/* Generic .input class matching form-input */
.input {
  width: 100%;
  height: 44px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-4);
  color: var(--text);
  font-size: 16px;
  line-height: normal;
  font-family: var(--font-family);
  transition: var(--transition);
  box-sizing: border-box;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  background-color: var(--surface-3);
}

/* Textarea normalization for .form-input and .input */
textarea.form-input,
textarea.input {
  height: auto;
  min-height: 80px;
  padding: 10px var(--space-4);
  line-height: 1.45;
  resize: vertical;
}

/* 6. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 44px;
  min-height: 44px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  box-sizing: border-box;
  user-select: none;
}

.btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(123, 92, 255, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-dim);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-sizing: border-box;
  flex-shrink: 0;
}

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

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

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

.btn-sm {
  height: 36px;
  min-height: 36px;
  padding: 0 var(--space-3);
  font-size: 0.8125rem;
  line-height: 1.2;
}

.btn-block {
  width: 100%;
}

/* 7. Chat Layout */
.chat-layout {
  display: flex;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg);
  position: relative;
}

/* 8. Sidebar */
.sidebar {
  width: 360px;
  background-color: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.sidebar-header {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-4));
  padding-left: calc(env(safe-area-inset-left, 0px) + var(--space-4));
  padding-right: calc(env(safe-area-inset-right, 0px) + var(--space-4));
  padding-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
}

.brand-header-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-header-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.brand-header-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  position: relative;
}

/* Header 3-Dots Dropdown Menu */
.header-more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 224px;
  background: rgba(18, 25, 33, 0.96);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(0, 229, 224, 0.08);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
  animation: headerMenuIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-more-menu.hidden {
  display: none !important;
}

@keyframes headerMenuIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.header-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: none;
  border: none;
  color: #E2E8F0;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
  user-select: none;
}

.header-menu-item svg {
  color: var(--text-dim);
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.header-menu-item:hover,
.header-menu-item:active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.header-menu-item:hover svg,
.header-menu-item:active svg {
  color: var(--accent);
}

.header-menu-item.danger {
  color: #FB7185;
}

.header-menu-item.danger svg {
  color: #FB7185;
}

.header-menu-item.danger:hover,
.header-menu-item.danger:active {
  background: rgba(251, 113, 133, 0.12);
  color: #FDA4AF;
}

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

/* Search Field (PRD Item 3) */
.search-box {
  padding: var(--space-2) var(--space-4) var(--space-3);
  background-color: var(--bg);
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon-svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
  display: block;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 44px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-4) 0 42px;
  color: var(--text);
  font-size: 16px;
  line-height: normal;
  box-sizing: border-box;
  font-family: var(--font-family);
  transition: var(--transition);
}

.search-input::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

.search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  background-color: var(--surface-2);
}

/* Chat List & Rows (PRD Item 8) */
.contact-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-1) 0;
  display: flex;
  flex-direction: column;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  margin: 0 var(--space-2) 2px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.contact-item:hover, .contact-item.active {
  background-color: var(--surface);
}

.contact-item:active {
  transform: scale(0.99);
}

.contact-avatar-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  min-width: 0;
}

.contact-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.contact-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
  line-height: 1;
}

.contact-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.contact-last-msg {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.unread-badge {
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 7px;
  height: 18px;
  min-width: 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line-title {
  width: 50%;
  height: 14px;
}

.skeleton-line-sub {
  width: 80%;
  height: 12px;
}

/* 9. Bottom Tab Bar & FAB (Redesigned) */
.bottom-tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(14, 20, 26, 0.92);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45), 0 -1px 0 rgba(0, 229, 224, 0.06);
  padding-top: 6px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
  padding-left: calc(env(safe-area-inset-left, 0px) + var(--space-2));
  padding-right: calc(env(safe-area-inset-right, 0px) + var(--space-2));
  height: calc(env(safe-area-inset-bottom, 0px) + 64px);
  position: relative;
  z-index: 25;
}

.tab-item {
  flex: 1;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-dim);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 14px;
  min-height: 48px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.tab-item:active {
  transform: scale(0.92);
}

.tab-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 28px;
  border-radius: 14px;
  transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.tab-item.active .tab-icon-wrapper {
  background: rgba(0, 229, 224, 0.15);
  box-shadow: 0 0 16px rgba(0, 229, 224, 0.22);
}

.tab-item svg {
  color: var(--text-dim);
  transition: color 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.tab-item.active svg {
  color: #00E5A3;
  filter: drop-shadow(0 0 6px rgba(0, 229, 224, 0.5));
  transform: translateY(-0.5px);
}

.tab-item .tab-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  transition: color 0.2s ease, font-weight 0.2s ease;
  line-height: 1.2;
}

.tab-item.active .tab-label {
  color: #ffffff;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tab-badge {
  position: absolute;
  top: -3px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #FB7185;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  border-radius: 9px;
  border: 2px solid #0E141A;
  box-shadow: 0 2px 8px rgba(251, 113, 133, 0.45);
}

.tab-badge-dot {
  position: absolute;
  top: -1px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00E5A3;
  border: 2px solid #0E141A;
  box-shadow: 0 0 8px rgba(0, 229, 163, 0.6);
}

/* Calls Tab Styles */
.calls-view-container {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.calls-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calls-action-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 229, 224, 0.25);
  transform: translateY(-1px);
}

.calls-action-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 229, 224, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0, 229, 224, 0.2);
}

.calls-action-card-text {
  flex: 1;
  min-width: 0;
}

.calls-action-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.calls-action-card-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.calls-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 4px;
}

.calls-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.calls-clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #FB7185;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.calls-clear-btn:hover {
  background: rgba(251, 113, 133, 0.12);
}

.call-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  transition: all 0.18s ease;
  cursor: pointer;
}

.call-item-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.09);
}

.call-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.call-item-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.call-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  margin-top: 3px;
  color: var(--text-dim);
}

.call-icon-missed {
  color: #FB7185 !important;
}

.call-icon-incoming {
  color: #34D399 !important;
}

.call-icon-outgoing {
  color: #60A5FA !important;
}

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

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

.call-action-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #00E5A3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.call-action-icon-btn:hover {
  background: rgba(0, 229, 224, 0.18);
  border-color: rgba(0, 229, 224, 0.35);
  transform: scale(1.08);
}

.call-action-icon-btn.video-btn {
  color: #7B5CFF;
}

.call-action-icon-btn.video-btn:hover {
  background: rgba(123, 92, 255, 0.18);
  border-color: rgba(123, 92, 255, 0.35);
}


/* Floating Action Button (FAB) */
.fab-new-chat {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
  right: var(--space-4);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(123, 92, 255, 0.45);
  cursor: pointer;
  z-index: 25;
  transition: var(--transition);
}

.fab-new-chat svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.fab-new-chat:active {
  transform: scale(0.92);
}

/* 10. Chat Area & Header */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg);
  position: relative;
  z-index: 5;
}

.chat-header {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-3));
  padding-left: calc(env(safe-area-inset-left, 0px) + var(--space-4));
  padding-right: calc(env(safe-area-inset-right, 0px) + var(--space-4));
  padding-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  min-height: calc(env(safe-area-inset-top, 0px) + 64px);
}

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

.chat-header-name {
  font-weight: 700;
  font-size: clamp(0.78rem, 2.4vw, 1.05rem);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  display: block;
  max-width: 100%;
}

.chat-header-status {
  font-size: 0.8125rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  margin-top: 2px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.date-separator {
  align-self: center;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin: var(--space-3) 0;
  border: 1px solid var(--border-light);
}

.message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.message-wrapper.sent,
.message-wrapper.message-sent {
  align-self: flex-end;
  align-items: flex-end;
  margin-left: auto;
}

.message-wrapper.received,
.message-wrapper.message-received {
  align-self: flex-start;
  align-items: flex-start;
  margin-right: auto;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.message-wrapper.sent .message-bubble,
.message-wrapper.message-sent .message-bubble {
  background: var(--gradient-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message-wrapper.received .message-bubble,
.message-wrapper.message-received .message-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
  line-height: 1;
}

.message-status {
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* Typing Indicator */
.typing-indicator {
  padding: 6px var(--space-4);
  font-size: 0.8125rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.typing-dots span {
  animation: bounce 1.2s infinite ease-in-out both;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Message Input Bar */
.message-input-bar {
  padding-top: var(--space-2);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-2));
  padding-left: max(8px, calc(env(safe-area-inset-left, 0px) + var(--space-2)));
  padding-right: max(8px, calc(env(safe-area-inset-right, 0px) + var(--space-2)));
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--border);
  background-color: var(--bg);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  position: relative;
}

.message-input-bar .btn-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.message-input {
  flex: 1 1 0%;
  min-width: 0;
  width: 0;
  height: 42px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 16px;
  color: var(--text);
  font-size: 16px;
  line-height: normal;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.message-input:focus {
  border-color: var(--accent);
  background-color: var(--surface-2);
}

/* 11. Empty State (PRD Item 6) */
.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-5) var(--space-4);
  max-width: 400px;
  margin: auto;
}

.empty-state-illustration {
  width: 140px;
  height: 140px;
  margin-bottom: var(--space-4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-illustration-glow {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--gradient-primary);
  filter: blur(28px);
  opacity: 0.35;
  animation: pulse 3s infinite ease-in-out;
}

.empty-state-logo {
  width: 90px;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.empty-state-subtitle {
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: var(--space-5);
}

.empty-state-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

/* 12. Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  animation: fadeIn 0.25s ease;
}

.modal {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-sizing: border-box;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

/* 13. Call UI */
.call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 900;
}

.incoming-call-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}

.incoming-call-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 340px;
}

.caller-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  position: relative;
  animation: ring 2s infinite;
}

.caller-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.call-type {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.incoming-call-actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.btn-accept, .btn-reject {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  transition: var(--transition);
}

.btn-accept {
  background-color: var(--success);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.btn-reject {
  background-color: var(--danger);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-accept:active, .btn-reject:active {
  transform: scale(0.92);
}

.active-call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: var(--bg);
  z-index: 900;
  display: flex;
  flex-direction: column;
}

.video-container {
  flex: 1;
  position: relative;
  background-color: #000;
}

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

.local-video {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + var(--space-4));
  right: var(--space-4);
  width: 110px;
  height: 145px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background-color: var(--surface);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.voice-call-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, var(--surface) 0%, var(--bg) 100%);
  gap: var(--space-5);
}

.voice-avatar-wrapper {
  position: relative;
}

.voice-waves {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ring 2s infinite;
  z-index: 0;
}

.call-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-4));
  padding-top: var(--space-4);
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  backdrop-filter: blur(5px);
}

.control-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.control-btn.active {
  background-color: var(--danger);
  color: #fff;
}

.control-btn.btn-end-call {
  background-color: var(--danger);
  color: #fff;
}

/* 14. Status Dots */
.status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background-color: var(--text-muted);
  border: 2.5px solid var(--bg);
}

.status-dot.online {
  background-color: var(--success);
}

/* 15. Toast Notifications (Premium Activity Badge) */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #f8fafc;
  padding: 8px 18px 8px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 9999;
  font-size: 0.875rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-exit {
  opacity: 0;
  transform: translateX(-50%) translateY(8px) scale(0.96);
}

.toast-badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-badge-icon svg {
  display: block;
}

/* Premium Success Badge */
.toast.success {
  background: linear-gradient(135deg, rgba(10, 25, 20, 0.94), rgba(15, 23, 42, 0.94));
  border-color: rgba(0, 229, 163, 0.35);
  color: #f0fdf4;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 229, 163, 0.22), 0 0 0 1px rgba(0, 229, 163, 0.2);
}

.toast.success .toast-badge-icon {
  background: linear-gradient(135deg, rgba(0, 229, 163, 0.28), rgba(16, 185, 129, 0.15));
  border-color: rgba(0, 229, 163, 0.5);
  box-shadow: 0 0 10px rgba(0, 229, 163, 0.35);
  color: #00E5A3;
}

/* Error Badge */
.toast.error {
  background: linear-gradient(135deg, rgba(35, 15, 15, 0.94), rgba(15, 23, 42, 0.94));
  border-color: rgba(239, 68, 68, 0.35);
  color: #fef2f2;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.7), 0 0 24px rgba(239, 68, 68, 0.22), 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.toast.error .toast-badge-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(220, 38, 38, 0.15));
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* Info Badge */
.toast.info {
  background: linear-gradient(135deg, rgba(15, 25, 45, 0.94), rgba(15, 23, 42, 0.94));
  border-color: rgba(59, 130, 246, 0.35);
  color: #eff6ff;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.7), 0 0 24px rgba(59, 130, 246, 0.22);
}

.toast.info .toast-badge-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(37, 99, 235, 0.15));
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* 16. Splash & Unlock Screen (Mockup: aether_splash_unlock) */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: #0d141a;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 1.25rem) var(--space-4) calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow: hidden;
  user-select: none;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-glow-top {
  position: absolute;
  top: -6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,224,0.15) 0%, rgba(123,92,255,0.1) 50%, rgba(255,0,229,0.15) 100%);
  filter: blur(80px);
  pointer-events: none;
}

.splash-glow-bottom {
  position: absolute;
  bottom: -7rem;
  left: 50%;
  transform: translateX(-50%);
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123,92,255,0.12) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
}

.splash-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #252D35;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.splash-pulse-dot {
  position: relative;
  display: flex;
  width: 8px;
  height: 8px;
}

.splash-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #00E5A3;
  opacity: 0.75;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.splash-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #00E5A3;
  box-shadow: 0 0 8px #00E5A3;
}

.splash-security-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #9BA8B5;
  letter-spacing: -0.01em;
}

.splash-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  text-align: center;
  z-index: 10;
  width: 100%;
  max-width: 320px;
}

.splash-logo-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.splash-aura-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00E5E0, #7B5CFF, #FF00E5);
  opacity: 0.35;
  filter: blur(14px);
  animation: pulse 3s infinite ease-in-out;
}

.splash-logo-circle {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #2C3640;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.splash-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(0, 229, 224, 0.45));
}

.splash-particle {
  position: absolute;
  border-radius: 50%;
}

.splash-particle-cyan {
  top: -4px;
  right: 8px;
  width: 10px;
  height: 10px;
  background-color: #3ffaf5;
  box-shadow: 0 0 8px #3ffaf5;
}

.splash-particle-magenta {
  bottom: 8px;
  left: -4px;
  width: 7px;
  height: 7px;
  background-color: #FF00E5;
  box-shadow: 0 0 8px #FF00E5;
  opacity: 0.8;
}

.splash-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #F4F7F9;
  margin-bottom: 4px;
}

.splash-tagline {
  font-size: 0.95rem;
  color: #9BA8B5;
  margin-bottom: var(--space-3);
}

.splash-session-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(37, 45, 53, 0.8);
  color: #647382;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.splash-actions-section {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  z-index: 10;
  padding-bottom: var(--space-2);
}

.splash-btn-biometric {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #00E5E0, #7B5CFF, #FF00E5);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 24px -4px rgba(123, 92, 255, 0.45);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.splash-btn-biometric:hover {
  opacity: 0.95;
}

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

.splash-btn-pin {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-full);
  background: #252D35;
  color: #9BA8B5;
  font-size: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.splash-btn-pin:hover {
  color: #F4F7F9;
  background: #2C3640;
}

.splash-btn-pin:active {
  transform: scale(0.99);
}

.splash-pin-tray {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  transition: all 0.2s ease;
}

.splash-pin-tray.hidden {
  display: none;
}

.splash-pin-dots {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.splash-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2C3640;
  transition: all 0.2s ease;
}

.splash-pin-dot.filled {
  background: #3ffaf5;
  box-shadow: 0 0 8px #3ffaf5;
}

.splash-pin-status {
  font-size: 0.75rem;
  color: #647382;
  margin-top: 4px;
}

.splash-micro-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #647382;
}

.splash-micro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(0, 229, 163, 0.7);
}

.splash-micro-sep {
  opacity: 0.4;
}

/* 17. Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

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

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.1); opacity: 0.55; }
}

@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 224, 0.6); }
  70% { box-shadow: 0 0 0 16px rgba(0, 229, 224, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 224, 0); }
}

/* 18. Mobile (<600px & <=768px) Responsive Layout */
.sidebar-toggle {
  display: none !important;
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: absolute;
    height: 100%;
    z-index: 10;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.hidden {
    transform: translateX(-100%);
    pointer-events: none;
  }

  .chat-area {
    width: 100%;
    position: absolute;
    height: 100%;
    z-index: 5;
  }

  .chat-area.hidden-mobile {
    display: none;
  }

  .sidebar-toggle {
    display: inline-flex !important;
  }

  .message-wrapper {
    max-width: 86%;
  }

  .bottom-tab-bar.hidden-mobile,
  .fab-new-chat.hidden-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .sidebar-toggle {
    display: none !important;
  }
  .bottom-tab-bar {
    display: flex !important;
  }
  .fab-new-chat {
    display: flex !important;
  }
}

/* 19. WhatsApp-Style Status Updates Feature */
.status-ring {
  position: relative;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-ring.seen {
  background: var(--border);
}

.status-avatar-wrapper {
  position: relative;
  display: inline-flex;
}

.status-plus-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #1E252B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.status-creator-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.status-preview-box {
  min-height: 240px;
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  position: relative;
  transition: background 0.3s ease;
  overflow: hidden;
}

.status-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  resize: none;
  font-family: var(--font-family);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.status-textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.gradient-swatches {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.swatch-btn:hover {
  transform: scale(1.15);
}

.swatch-btn.active {
  border-color: #ffffff;
  transform: scale(1.18);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Fullscreen Status Viewer */
.status-viewer-overlay {
  position: fixed;
  inset: 0;
  background: #0B0E11;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  user-select: none;
}

.status-viewer-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

@media (min-width: 600px) {
  .status-viewer-card {
    height: 85vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
  }
}

.story-progress-container {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  display: flex;
  gap: 5px;
  padding: 12px 14px 4px;
  z-index: 30;
}

.story-progress-segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.story-progress-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 2px;
  transition: width 0.1s linear;
}

.status-viewer-header {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  z-index: 30;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.status-viewer-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #fff;
}

.status-viewer-content {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  position: relative;
}

.status-viewer-text {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  word-break: break-word;
  max-width: 90%;
}

.status-viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.status-viewer-tap-left,
.status-viewer-tap-right {
  position: absolute;
  top: 60px;
  bottom: 60px;
  width: 40%;
  z-index: 20;
  cursor: pointer;
}

.status-viewer-tap-left { left: 0; }
.status-viewer-tap-right { right: 0; }

/* 20. Profile Photo Modal & UI Polish (aether_messenger_ui Specifications) */
.header-profile-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 1.5px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
}

.header-profile-btn:hover .profile-avatar-circle {
  border-color: var(--accent);
  transform: scale(1.05);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.contact-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* User Profile & Photo Modal */
.profile-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-photo-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.profile-photo-preview-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  padding: 3px;
  background: var(--gradient-primary);
  box-shadow: 0 0 24px -4px rgba(0, 229, 224, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.profile-photo-preview-wrap:hover {
  transform: scale(1.03);
}

.profile-photo-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  position: relative;
}

.profile-photo-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  font-size: 14px;
}

.profile-photo-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Atmospheric Telemetry Pill */
.security-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--space-4) 4px;
}

.security-telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.72rem;
}

.telemetry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00E5A3;
  box-shadow: 0 0 8px rgba(0, 229, 163, 0.9);
  animation: pulse 2s infinite ease-in-out;
}

.telemetry-label {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #00E5A3;
  letter-spacing: -0.01em;
}

.telemetry-sub {
  color: var(--text-dim);
  font-size: 0.68rem;
}

.telemetry-latency {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Filter Chips Row (All, Unread, Direct, Groups, Security) */
.filter-chips-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

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

.filter-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition);
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface-2);
}

.filter-chip.active {
  background: var(--gradient-subtle);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 229, 224, 0.15);
}

.filter-chip-badge {
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
}

/* ============================================================
   21. Chat Thread Elements (Mockup: aether_chat_thread_elena)
   ============================================================ */
.chat-timeline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 500;
  margin: var(--space-2) auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* WhatsApp-Style Clean End-to-End Encryption Notice */
.e2ee-encryption-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 220, 100, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.16);
  border-radius: 8px;
  padding: 6px 14px;
  margin: 8px auto 14px;
  max-width: 360px;
  font-size: 0.725rem;
  line-height: 1.35;
  color: #f1cf7a;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.e2ee-encryption-notice .e2ee-lock-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Universal File & Document Message Card */
.chat-doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  max-width: 320px;
  min-width: 220px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.chat-doc-card:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

.chat-doc-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 229, 224, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-doc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.chat-doc-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.chat-doc-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-doc-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}

.chat-doc-card:hover .chat-doc-action {
  color: var(--accent);
  border-color: var(--accent);
}

/* Video Message Card */
.chat-video-card {
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.chat-video-player {
  width: 100%;
  max-height: 340px;
  display: block;
  object-fit: contain;
  background: #000;
}

.chat-video-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(18, 24, 29, 0.9);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
}

.ratchet-advisory-card {
  max-width: 380px;
  margin: var(--space-2) auto var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow);
}

.ratchet-advisory-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.ratchet-advisory-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ratchet-advisory-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.ratchet-badge-zk {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  background: rgba(0, 229, 163, 0.15);
  color: #00E5A3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ratchet-advisory-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.35;
}

/* Benchmark / Telemetry Attachment Card */
.benchmark-attachment-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-top: 4px;
  cursor: pointer;
  transition: transform var(--transition);
  max-width: 320px;
}

.benchmark-attachment-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.benchmark-chart-header {
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #151c22;
}

.benchmark-chart-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.benchmark-chart-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
}

.benchmark-chart-body {
  height: 90px;
  width: 100%;
  padding: 4px 10px;
  background: #0d141a;
  position: relative;
}

.benchmark-chart-footer {
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-top: 1px solid var(--border-light);
}

.benchmark-file-meta {
  display: flex;
  flex-direction: column;
}

.benchmark-file-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.benchmark-file-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ============================================================
   22. Communities & Channels Hub (Mockup: aether_communities_channels_hub)
   ============================================================ */
.communities-hub {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4) calc(var(--space-5) * 2);
  overflow-y: auto;
  flex: 1;
}

.communities-search-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  gap: 8px;
  color: var(--text-dim);
  transition: border-color var(--transition);
}

.communities-search-wrap:focus-within {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(0, 229, 224, 0.15);
}

.communities-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  line-height: normal;
  width: 100%;
  box-sizing: border-box;
}

.community-hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 14px 12px 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.community-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.community-hero-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,224,0.2) 0%, rgba(123,92,255,0.15) 50%, transparent 80%);
  filter: blur(30px);
  pointer-events: none;
}

.community-hero-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #00E5E0, #7B5CFF, #FF00E5);
  padding: 1.5px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(123, 92, 255, 0.35);
}

.community-hero-icon-inner {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius) - 1.5px);
  background: #192026;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.community-hero-content {
  flex: 1;
  min-width: 0;
}

.community-hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.community-hero-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.enclave-badge-pill,
.security-badge-pill {
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 224, 0.15);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.community-hero-desc {
  font-size: 0.8125rem;
  color: var(--text-dim);
  line-height: 1.35;
  margin: 0;
}

.community-hero-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important; /* CRITICAL: Never break into two rows */
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.community-hero-actions .community-hero-chip,
.community-hero-actions .btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  height: 36px !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  border-radius: var(--radius-full) !important;
  box-sizing: border-box !important;
  text-align: center !important;
  line-height: 1 !important;
  cursor: pointer;
}

.community-hero-actions .btn svg {
  flex-shrink: 0 !important;
  width: 15px !important;
  height: 15px !important;
}

.community-hero-actions .btn span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1 !important;
}

.community-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow);
}

.community-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.community-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  border: 1px solid var(--border-light);
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--transition);
}

.channel-row:hover {
  background: var(--surface-3);
  transform: translateX(2px);
}

.channel-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

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

.channel-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.channel-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
}

.channel-last-msg {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.btn-join-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  min-height: 28px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--accent);
  transition: all var(--transition);
  box-sizing: border-box;
}

.btn-join-toggle.joined {
  background: rgba(0, 229, 163, 0.15);
  color: #00E5A3;
  border-color: #00E5A3;
}

/* ============================================================
   23. End-to-End Encryption (Apple iMessage Invisible Security)
   ============================================================ */

/* ============================================================
   24. Multi-Device & Edge Relay Manager (Mockup: aether_multi_device_edge_relay_manager)
   ============================================================ */
.relay-modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0d141a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.edge-mesh-card {
  border-radius: var(--radius);
  background: #192026;
  border: 1px solid var(--border-light);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fleet-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-radius: var(--radius);
  background: #192026;
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.fleet-device-card:hover {
  background: #242b31;
}

/* ============================================================
   25. Voice Note Studio (Mockup: aether_voice_note_studio)
   ============================================================ */
.voice-studio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 var(--space-4) calc(env(safe-area-inset-bottom, 0px) + var(--space-3));
  animation: fadeIn 0.2s ease-out;
}

.voice-studio-card {
  width: 100%;
  max-width: 460px;
  border-radius: 28px;
  background: #2C3640;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.8);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
}

.voice-locked-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #252D35;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.waveform-display-box {
  width: 100%;
  background: #192026;
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.waveform-bars-row {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  padding: 0 4px;
}

.waveform-bar {
  width: 3.5px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, #00E5E0, #7B5CFF);
  transition: height 0.15s ease;
}

/* ============================================================
   26. Active Video Call HUD & Operations Deck (Mockup: aether_active_video_call)
   ============================================================ */
.video-call-fullscreen {
  position: fixed;
  inset: 0;
  background: #080f14;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.call-hud-top {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-pip-view {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  right: 16px;
  width: 110px;
  height: 160px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #2C3640;
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  z-index: 25;
  cursor: pointer;
}

.call-operations-deck {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 420px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: rgba(38, 47, 55, 0.9);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 30;
}

.call-deck-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #192026;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

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

.call-deck-btn.hangup {
  background: linear-gradient(135deg, #EF4444, #93000a);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* ============================================================
   27. Ephemeral Media & Raw Telemetry Viewer (Mockup: aether_ephemeral_media_raw_telemetry_viewer)
   ============================================================ */
.ephemeral-viewer-overlay {
  position: fixed;
  inset: 0;
  background: #080f14;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
  animation: fadeIn 0.2s ease;
}

.ephemeral-top-hud {
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: linear-gradient(180deg, rgba(13, 20, 26, 0.95) 0%, transparent 100%);
}

.ephemeral-burn-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: #080f14;
  color: #FF5C5C;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.8125rem;
}

.ephemeral-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-12deg);
  opacity: 0.35;
  mix-blend-mode: screen;
  color: #00E5E0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-align: center;
  gap: 6px;
}

.ephemeral-pulse-react-dock {
  background: rgba(37, 45, 53, 0.95);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  border: 1px solid var(--border-light);
  margin: var(--space-2) var(--space-4);
}

.pulse-emoji-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pulse-emoji-btn:active {
  transform: scale(1.35);
}

/* ============================================================
   Google Sign-In Styles
   ============================================================ */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 0.75rem;
  font-weight: 600;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #E2E8F0;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  border-radius: var(--radius);
  height: 44px;
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

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

.auth-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 224, 0.08);
  border: 1px solid rgba(0, 229, 224, 0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.auth-trust-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00E5A3;
  box-shadow: 0 0 6px #00E5A3;
}

.auth-logo-aura {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-1);
}

.auth-logo-aura::before {
  content: '';
  position: absolute;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 224, 0.28) 0%, rgba(123, 92, 255, 0.15) 50%, transparent 75%);
  pointer-events: none;
  filter: blur(8px);
  animation: auraBreathe 3s ease-in-out infinite alternate;
}

@keyframes auraBreathe {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

.google-icon-svg {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

/* ============================================================
   Device Contact Scanner & Sync Styles
   ============================================================ */
.scanner-hero {
  background: linear-gradient(135deg, rgba(0, 229, 224, 0.08) 0%, rgba(255, 0, 229, 0.05) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  margin-bottom: var(--space-3);
  position: relative;
  overflow: hidden;
}

.scanner-hero-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(0, 229, 163, 0.25) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.scanner-radar-box {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-2);
  border-radius: 50%;
  background: rgba(0, 229, 224, 0.1);
  border: 1px solid rgba(0, 229, 224, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  position: relative;
}

.scanner-radar-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0.6;
  animation: radarPing 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes radarPing {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.scanner-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: var(--space-3);
  border: 1px solid var(--border);
}

.scanner-tab-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
  min-height: 36px;
  box-sizing: border-box;
}

.scanner-tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.scanner-badge-count {
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  background: rgba(0, 229, 163, 0.15);
  color: #00E5A3;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.matched-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  transition: border-color 0.2s ease;
}

.matched-contact-item:hover {
  border-color: var(--border-light);
}

.matched-contact-info {
  flex: 1;
  min-width: 0;
}

.matched-contact-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.matched-contact-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.contact-match-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 229, 163, 0.12);
  color: #00E5A3;
}

.contact-match-tag.phone {
  background: rgba(0, 229, 224, 0.12);
  color: #00E5E0;
}

.contact-match-tag.email {
  background: rgba(255, 0, 229, 0.12);
  color: #FF00E5;
}

.privacy-enclave-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: rgba(0, 229, 163, 0.06);
  border: 1px solid rgba(0, 229, 163, 0.2);
  color: #00E5A3;
  font-size: 0.75rem;
  margin-top: var(--space-2);
}

/* 23. Premium Grouped Inset Settings & Security Modal */
.settings-modal-card {
  max-width: 440px;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 14px !important;
  gap: 8px !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

/* ============================================================
   Settings v2 — WhatsApp-style redesign
   ============================================================ */
.settings-modal-v2 {
  max-width: 440px !important;
  width: 100% !important;
  max-height: 88dvh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  background: var(--surface, #181F26) !important;
  animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpSheet {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.settings-v2-drag-handle {
  display: none;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  margin: 10px auto 2px;
  flex-shrink: 0;
}

.settings-v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(24, 31, 38, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.settings-v2-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
}

.settings-v2-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-v2-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: scale(1.05);
}

.settings-v2-close-btn:active {
  transform: scale(0.95);
}

.settings-v2-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Profile Hero — centered, large avatar with ambient glow */
.settings-v2-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 20px;
  cursor: pointer;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(38, 47, 56, 0.75) 0%, rgba(27, 34, 40, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.18s ease;
  user-select: none;
  flex-shrink: 0 !important;
  position: relative;
  overflow: hidden;
}

.settings-v2-profile::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 224, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.settings-v2-profile:hover {
  background: linear-gradient(180deg, rgba(46, 57, 68, 0.85) 0%, rgba(32, 40, 48, 0.95) 100%);
  border-color: rgba(0, 229, 224, 0.25);
  transform: translateY(-1px);
}

.settings-v2-profile:active {
  transform: scale(0.99);
}

.settings-v2-avatar-wrap {
  position: relative;
  width: 86px;
  height: 86px;
  margin-bottom: 12px;
}

.settings-v2-avatar-img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.settings-v2-avatar-initial {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 2.3rem;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.settings-v2-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #00E5A3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #080F14;
  border: 2.5px solid #181F26;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.settings-v2-profile-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.25;
}

.settings-v2-profile-bio {
  font-size: 0.85rem;
  color: #8C9BA8;
  text-align: center;
  margin-top: 4px;
  max-width: 280px;
  word-break: break-word;
}

.settings-v2-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent, #00E5E0);
}

/* Grouped settings rows */
.settings-v2-group {
  background: #20272E;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.settings-v2-signout-group {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.05);
}

.settings-v2-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--text, #FFFFFF);
  font-family: inherit;
  user-select: none;
  min-height: 58px;
  position: relative;
  flex-shrink: 0 !important;
}

/* Inset divider between rows - does not cut across the icon */
.settings-v2-row + .settings-v2-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 66px;
  right: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.settings-v2-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.settings-v2-row:active {
  background: rgba(255, 255, 255, 0.08);
}

/* Circular colored icon */
.settings-v2-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease;
}

.settings-v2-row:hover .settings-v2-icon {
  transform: scale(1.08);
}

/* Row body text */
.settings-v2-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-v2-row-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.25;
}

.settings-v2-row-hint {
  font-size: 0.78rem;
  color: #8C9BA8;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Chevron */
.settings-v2-chevron {
  color: rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.settings-v2-row:hover .settings-v2-chevron {
  color: rgba(255, 255, 255, 0.7);
  transform: translateX(2px);
}

/* Section label */
.settings-v2-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  margin: 6px 6px 0;
  flex-shrink: 0 !important;
}

/* Footer */
.settings-v2-footer {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  padding: 16px 0 10px;
  line-height: 1.5;
  flex-shrink: 0 !important;
}

/* Mobile Responsive Ergonomics */
@media (max-width: 600px) {
  #settingsModalOverlay.modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .settings-modal-v2 {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 88dvh !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 26px !important;
    border-top-right-radius: 26px !important;
    margin: 0 !important;
  }
  .settings-v2-drag-handle {
    display: block !important;
  }
  .settings-v2-scroll {
    padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 16px)) !important;
  }
}

/* Keep old classes for backward compat (legacy references) */
.settings-profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2, #262F37);
  border-radius: 16px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.settings-profile-hero:hover {
  background: rgba(45, 55, 65, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
}

.settings-profile-hero:active {
  transform: scale(0.99);
}

.settings-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-profile-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.settings-profile-bio {
  font-size: 0.8rem;
  color: var(--text-dim, #717D8A);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.settings-edge-badge {
  font-size: 0.72rem;
  color: #00E5A3;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-weight: 500;
  white-space: nowrap;
}

.settings-section-header {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim, #717D8A);
  margin: 10px 4px 4px 4px;
}

.settings-card-group {
  background: var(--surface-2, #262F37);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-tile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--text, #FFFFFF);
  font-family: inherit;
  user-select: none;
  min-height: 48px;
}

.settings-tile-item:last-child {
  border-bottom: none;
}

.settings-tile-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.settings-tile-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.settings-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.settings-tile-item:hover .settings-tile-icon {
  transform: scale(1.05);
}

.icon-teal { background: rgba(0, 229, 224, 0.12); color: #00E5E0; }
.icon-purple { background: rgba(139, 92, 246, 0.14); color: #A78BFA; }
.icon-blue { background: rgba(59, 130, 246, 0.12); color: #60A5FA; }
.icon-emerald { background: rgba(16, 185, 129, 0.12); color: #34D399; }
.icon-rose { background: rgba(244, 63, 94, 0.12); color: #FB7185; }

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

.settings-tile-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.25;
}

.settings-tile-desc {
  font-size: 0.72rem;
  color: var(--text-dim, #717D8A);
  line-height: 1.3;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.settings-tile-trailing {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim, #717D8A);
  flex-shrink: 0;
}

.settings-status-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 229, 163, 0.12);
  color: #00E5A3;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.settings-tile-chevron {
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  transition: transform 0.15s ease, color 0.15s ease;
}

.settings-tile-item:hover .settings-tile-chevron {
  color: rgba(255, 255, 255, 0.7);
  transform: translateX(2px);
}

/* ============================================================
   Watermark Removal & Lightbox Zoom / Full View
   ============================================================ */
.ephemeral-watermark {
  display: none !important;
}

.lightbox-zoom-container {
  position: relative;
  width: 100%;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.85);
}

.lightbox-zoom-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(25, 32, 38, 0.88);
  backdrop-filter: blur(12px);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 50;
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.lightbox-tool-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.lightbox-tool-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent);
}

.lightbox-zoom-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  padding: 2px 6px;
  min-width: 44px;
  text-align: center;
}

.lightbox-zoom-viewport {
  width: 100%;
  height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.lightbox-zoom-viewport.is-dragging {
  cursor: grabbing;
}

.lightbox-zoom-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.08s ease-out;
  transform-origin: center center;
  border-radius: 6px;
  will-change: transform;
}

/* ============================================================
   Message Action Toolbar & Edit Banner
   ============================================================ */
.message-wrapper {
  position: relative;
}

.message-actions-bar {
  display: none;
  align-items: center;
  gap: 2px;
  position: absolute;
  top: -14px;
  background: #192026;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 2px 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 20;
}

.message-wrapper:hover .message-actions-bar,
.message-wrapper:focus-within .message-actions-bar {
  display: flex;
}

.message-wrapper.sent .message-actions-bar,
.message-wrapper.message-sent .message-actions-bar {
  right: 6px;
}

.message-wrapper.received .message-actions-bar,
.message-wrapper.message-received .message-actions-bar {
  left: 6px;
}

.msg-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.msg-action-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.msg-action-btn.delete:hover {
  color: var(--danger, #ff5c5c);
}

.message-edited-tag {
  font-size: 0.68rem;
  opacity: 0.7;
  font-style: italic;
  margin-left: 5px;
}

.message-deleted .message-bubble {
  background: transparent !important;
  border: 1px dashed var(--border) !important;
  color: var(--text-muted) !important;
}

.chat-edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 229, 224, 0.08);
  border-top: 1px solid rgba(0, 229, 224, 0.2);
  color: var(--accent);
  font-size: 0.8rem;
  animation: fadeIn 0.2s ease;
}

.chat-edit-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.chat-edit-banner-text {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
}

/* ============================================================
   Pinned Chats UI
   ============================================================ */
.contact-item.pinned {
  background: rgba(0, 229, 224, 0.035);
  border-left: 3px solid var(--accent);
}

.contact-pin-badge {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  transform: rotate(45deg);
}

/* ============================================================
   Status Reactions Dock & Voice Status Update
   ============================================================ */
.status-reactions-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(15, 23, 30, 0.85);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-full);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 30;
}

.status-react-btn {
  font-size: 1.35rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-react-btn:hover {
  transform: scale(1.35);
}

.status-react-btn:active {
  transform: scale(0.9);
}

.status-reactions-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.status-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.status-voice-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 320px;
  width: 90%;
  margin: 0 auto;
}

.status-voice-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 44px;
  width: 100%;
}

.status-voice-bar {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  height: 12px;
  transition: height 0.15s ease;
}

.voice-status-record-card {
  padding: 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 12px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

/* ============================================================
   Chat Emoji Pack Popover & Refined High-Visibility Send Button
   ============================================================ */
.chat-emoji-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px;
  right: 8px;
  max-width: 360px;
  margin: 0 auto;
  background: #192026;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  animation: slideUpFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-emoji-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.emoji-search-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 16px;
  line-height: normal;
  color: #fff;
  outline: none;
  box-sizing: border-box;
}

.emoji-search-input:focus {
  border-color: var(--accent);
}

.chat-emoji-tabs {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.1);
}

.emoji-tab-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
}

.emoji-tab-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.emoji-tab-btn.active {
  opacity: 1;
  background: rgba(0, 229, 224, 0.15);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 224, 0.3);
  transform: scale(1.1);
}

.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
  user-select: none;
}

.chat-emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: transform 0.12s ease, background 0.12s ease;
}

.chat-emoji-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.2);
}

.chat-emoji-item:active {
  transform: scale(0.95);
}

/* ============================================================
   Refined High-Visibility Send Button
   ============================================================ */
.message-input-bar #sendBtn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #00E5E0 0%, #0077FF 100%) !important;
  color: #FFFFFF !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 18px rgba(0, 229, 224, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer !important;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.15s ease !important;
  border: none !important;
  flex-shrink: 0 !important;
  z-index: 10 !important;
  margin-left: 2px !important;
  box-sizing: border-box !important;
}

.message-input-bar #sendBtn:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 6px 24px rgba(0, 229, 224, 0.7), 0 0 14px rgba(0, 229, 224, 0.45) !important;
}

.message-input-bar #sendBtn:active {
  transform: scale(0.92) !important;
}

.message-input-bar #sendBtn svg {
  width: 20px !important;
  height: 20px !important;
  stroke: #FFFFFF !important;
  stroke-width: 2.2px !important;
  transform: translateX(1px);
}

/* ============================================================
   31. Refined Voice Note Studio Modal
   ============================================================ */
.voice-studio-modal-card {
  width: 100%;
  max-width: 440px;
  background: rgba(22, 28, 36, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 229, 224, 0.2);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 224, 0.15);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.voice-studio-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00E5E0, #7B5CFF, #FF00E5);
}

.voice-mic-hero {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 229, 224, 0.15), rgba(123, 92, 255, 0.25));
  border: 2px solid rgba(0, 229, 224, 0.4);
  color: var(--accent);
  margin: var(--space-2) 0;
  transition: all 0.3s ease;
}

.voice-mic-hero.recording {
  border-color: #FF5C5C;
  color: #FF5C5C;
  background: rgba(255, 92, 92, 0.15);
  box-shadow: 0 0 30px rgba(255, 92, 92, 0.4);
}

.voice-mic-hero.recording::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 92, 92, 0.4);
  animation: pulseRipple 1.4s ease-out infinite;
}

@keyframes pulseRipple {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

.voice-studio-timer-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-studio-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF5C5C;
  box-shadow: 0 0 10px #FF5C5C;
  animation: pulse 1s infinite;
}

.voice-live-canvas {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-studio-actions-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-2);
}

/* ============================================================
   32. Status Views Sheet & Viewed By Modal
   ============================================================ */
.status-viewers-pill {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 6px 16px;
  color: #fff;
  font-size: 0.825rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.status-viewers-pill:hover {
  background: rgba(0, 229, 224, 0.25);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.status-views-modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.status-viewer-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.status-viewer-item:hover {
  background: var(--surface-hover);
}

/* ============================================================
   33. Security Enclave & Crypto Fingerprint Modal
   ============================================================ */
.crypto-fingerprint-box {
  background: #0d1217;
  border: 1px solid rgba(0, 229, 224, 0.2);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.825rem;
  color: var(--accent);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
  letter-spacing: 1px;
}

/* ============================================================
   34. WhatsApp-style Message Reactions & Floating Emoji Bar
   ============================================================ */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: -6px;
  margin-bottom: 4px;
  z-index: 2;
  position: relative;
}

.message-sent .msg-reactions {
  justify-content: flex-end;
  margin-right: 4px;
}

.message-received .msg-reactions {
  justify-content: flex-start;
  margin-left: 4px;
}

.msg-reaction-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(30, 38, 46, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.85rem;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, background 0.12s ease;
  animation: reactionPop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-sizing: border-box;
}

.msg-reaction-pill:hover {
  transform: scale(1.1);
  background: rgba(45, 55, 65, 0.98);
}

.msg-reaction-count {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-dim, #94a3b8);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

@keyframes reactionPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Floating Quick Emoji Picker (WhatsApp / iOS style) */
.msg-emoji-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 28, 35, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 229, 224, 0.15);
  animation: pickerSlideUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

@keyframes pickerSlideUp {
  0% { transform: translateY(8px) scale(0.92); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.msg-emoji-btn {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.msg-emoji-btn:hover {
  transform: scale(1.35) translateY(-3px);
}

.msg-emoji-btn:active {
  transform: scale(1.1);
}

/* Call Log Items */
.call-log-row {
  transition: background 0.15s ease;
}

.call-log-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Call operations deck buttons active state */
.call-deck-btn.active {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #FB7185 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* WhatsApp-Style Groups & Channels */
.group-cover-banner {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 18px 18px 0 0;
  background-color: #1a2228;
}

.group-avatar-overlay-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 22px;
  border: 4px solid #192026;
  margin-top: -40px;
  margin-left: 16px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.group-avatar-overlay-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
}

.group-photo-camera-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #080f14;
  border: 2px solid #192026;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

.group-photo-camera-btn:hover {
  transform: scale(1.1);
}

.group-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  flex: 1;
  padding: 8px 4px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.group-quick-action:hover {
  background: rgba(255, 255, 255, 0.05);
}

.group-quick-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all 0.15s ease;
}

.group-quick-action:hover .group-quick-action-icon {
  background: var(--accent);
  color: #080f14;
}

.group-quick-action-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

.group-participant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.12s ease;
}

.group-participant-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ============================================================
   27. Phase 6: Intuitive Navigation & Accidental-Exit Engine
   ============================================================ */
.nav-exit-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(24, 32, 40, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  border: 1px solid rgba(0, 229, 224, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 229, 224, 0.2);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-exit-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive Viewport & Native Overscroll Containment */
.app-chrome,
.splash-screen,
.video-call-fullscreen,
.modal-overlay {
  height: 100vh;
  height: 100dvh;
}

.contacts-list,
.messages-container,
.chat-area,
.chat-scroll-view {
  overscroll-behavior-y: contain;
}

.chat-input-area {
  padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
}

.bottom-nav-bar {
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
}

/* Keypad fluid scaling for narrow viewports */
@media (max-width: 360px) {
  .pin-key {
    width: clamp(54px, 15vw, 68px) !important;
    height: clamp(54px, 15vw, 68px) !important;
    font-size: 1.2rem !important;
  }
  .pin-keypad {
    gap: 8px !important;
  }
}

/* ============================================================
   28. Premium Video Call Interface (Aether Spatial Aura & Liquid PiP)
   ============================================================ */
.aether-call-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: #060B0E;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aether-call-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid transparent;
  box-shadow: inset 0 0 60px rgba(0, 229, 224, 0.08);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
  z-index: 5;
}

.aether-call-aura.speaking {
  border-color: rgba(0, 229, 224, 0.35);
  box-shadow: inset 0 0 90px rgba(0, 229, 224, 0.22), 0 0 40px rgba(123, 92, 255, 0.2);
  animation: aetherAuraPulse 1.8s ease-in-out infinite alternate;
}

@keyframes aetherAuraPulse {
  0% {
    box-shadow: inset 0 0 60px rgba(0, 229, 224, 0.15);
  }
  100% {
    box-shadow: inset 0 0 110px rgba(0, 229, 224, 0.32), inset 0 0 50px rgba(123, 92, 255, 0.25);
  }
}

.aether-pip-tile {
  position: absolute;
  bottom: calc(96px + env(safe-area-inset-bottom, 16px));
  right: 18px;
  width: 110px;
  height: 154px;
  border-radius: 20px;
  background: #121A22;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 30;
  cursor: grab;
  touch-action: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.2s ease;
}

.aether-pip-tile:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.aether-pip-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aether-call-capsule {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 12px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  border-radius: 40px;
  background: rgba(22, 30, 38, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 0, 0, 0.3);
  z-index: 40;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.aether-call-capsule.autohide {
  opacity: 0.15;
  transform: translateX(-50%) translateY(10px);
}

.aether-call-capsule.autohide:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.aether-call-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.aether-call-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.06);
}

.aether-call-btn:active {
  transform: scale(0.94);
}

.aether-call-btn.active {
  background: rgba(0, 229, 224, 0.2);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 224, 0.4);
}

.aether-call-btn.muted {
  background: rgba(255, 179, 0, 0.2);
  color: #FFB300;
  border: 1px solid rgba(255, 179, 0, 0.4);
}

.aether-call-btn.end {
  background: #FF3B30;
  color: #fff;
  box-shadow: 0 4px 18px rgba(255, 59, 48, 0.45);
}

.aether-call-btn.end:hover {
  background: #E02820;
  box-shadow: 0 6px 24px rgba(255, 59, 48, 0.65);
}

/* ============================================================
   PROGRESSIVE ONBOARDING (WhatsApp-Style Multi-Screen Flow)
   ============================================================ */
.onboarding-card {
  background: rgba(22, 30, 38, 0.94);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: clamp(20px, 5vw, 32px);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 229, 224, 0.06);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  animation: fadeIn 0.25s ease-out;
}

.onboarding-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

.onboarding-step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  transition: all 0.25s ease;
}

.onboarding-dot.active {
  width: 24px;
  background: var(--accent);
}

.onboarding-dot.completed {
  background: #00E5A3;
}

.onboarding-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px 0;
  text-align: center;
  letter-spacing: -0.01em;
}

.onboarding-subtitle {
  font-size: 0.875rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.45;
  margin: 0 0 var(--space-3) 0;
}

/* Country Selector Field */
.country-selector-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 48px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-4);
  color: var(--text);
  font-size: 16px;
  line-height: normal;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.country-selector-btn:hover {
  border-color: var(--accent);
  background: var(--surface-3);
}

.country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.country-item:hover {
  background: rgba(0, 229, 224, 0.08);
}

.country-flag-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text);
}

.country-dial-badge {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 229, 224, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* OTP 6-Digit Auto-Advancing Boxes */
.otp-digit-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: var(--space-3) 0;
}

@media (max-width: 360px) {
  .otp-digit-group {
    gap: 5px;
  }
  .otp-digit-box {
    width: 38px;
    height: 48px;
    font-size: 1.25rem;
  }
}

.otp-digit-box {
  width: 44px;
  height: 52px;
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: all 0.18s ease;
  caret-color: var(--accent);
}

.otp-digit-box:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(0, 229, 224, 0.2);
  transform: translateY(-2px);
}

.otp-digit-box.filled {
  border-color: rgba(0, 229, 224, 0.5);
  background: rgba(0, 229, 224, 0.04);
}

/* Password Strength Meter */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--text);
}

.password-meter-bar {
  display: flex;
  gap: 4px;
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  overflow: hidden;
}

.password-meter-segment {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.25s ease;
}

.password-meter-segment.weak {
  background: #FF3B30;
}

.password-meter-segment.fair {
  background: #FF9500;
}

.password-meter-segment.good {
  background: #34C759;
}

.password-meter-segment.strong {
  background: #00E5A3;
}

.password-meter-label {
  font-size: 0.75rem;
  margin-top: 4px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

/* Phone Input with Country Code Badge */
.phone-field-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.phone-dial-addon {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 44px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
}

.phone-dial-addon:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

/* Avatar Photo Picker */
.onboarding-avatar-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: var(--space-2) 0;
}

.onboarding-avatar-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  position: relative;
  background: var(--surface-2);
  border: 2px dashed rgba(0, 229, 224, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.onboarding-avatar-circle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 229, 224, 0.25);
}

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

.onboarding-camera-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--accent);
  color: #12181F;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Security Callout Box */
.security-notice-callout {
  background: rgba(0, 229, 224, 0.06);
  border: 1px solid rgba(0, 229, 224, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.45;
}

.security-notice-callout b {
  color: var(--accent);
}

/* Device PIN Keypad */
.pin-digit-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: var(--space-3) 0;
}

.pin-digit-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  transition: all 0.2s ease;
}

.pin-digit-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0, 229, 224, 0.6);
}

/* ============================================================
   Aeni AI — Meta AI-Style Intelligent Partner UI
   ============================================================ */

/* Iridescent Avatar Ring (Signature Meta AI Style) */
.aeni-ai-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(from 180deg at 50% 50%, #00E5E0 0deg, #3B82F6 72deg, #8B5CF6 144deg, #EC4899 216deg, #00E5A3 288deg, #00E5E0 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(0, 229, 224, 0.4);
  flex-shrink: 0;
  animation: aeniRingSpin 14s linear infinite;
}

.aeni-ai-avatar.large {
  width: 72px;
  height: 72px;
  box-shadow: 0 0 32px rgba(0, 229, 224, 0.45);
}

.aeni-ai-avatar::before {
  content: '';
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: #0d141a;
  z-index: 1;
}

.aeni-ai-avatar.large::before {
  inset: 3.5px;
}

.aeni-ai-avatar-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #00E5E0;
}

@keyframes aeniRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Search Bar Quick AI Button */
.btn-aeni-ai-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #00E5E0, #3B82F6, #8B5CF6, #EC4899, #00E5E0);
  border: none;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  box-shadow: 0 0 12px rgba(0, 229, 224, 0.35);
  margin-left: 6px;
  flex-shrink: 0;
}

.btn-aeni-ai-search:hover {
  transform: scale(1.1);
  box-shadow: 0 0 18px rgba(0, 229, 224, 0.6);
}

.btn-aeni-ai-search span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #111827;
  border-radius: 50%;
  color: #00E5E0;
}

/* AI Verified Badges */
.ai-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00E5E0, #3B82F6);
  color: #0B0E14;
  font-size: 10px;
  font-weight: 900;
  margin-left: 4px;
  flex-shrink: 0;
}

.ai-pill-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 229, 224, 0.15);
  color: #00E5E0;
  border: 1px solid rgba(0, 229, 224, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: 6px;
}

/* Aeni AI Welcome Card & Suggestion Chips */
.ai-welcome-card {
  margin: auto;
  max-width: 580px;
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.ai-welcome-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 50%, #00E5E0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 4px 0 0;
}

.ai-welcome-subtitle {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 440px;
  margin: 0;
}

.ai-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 520px;
  margin-top: 14px;
}

.ai-chip-prompt {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 16px;
  color: #E2E8F0;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.ai-chip-prompt:hover {
  background: rgba(0, 229, 224, 0.12);
  border-color: rgba(0, 229, 224, 0.4);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 229, 224, 0.2);
}

/* AI Message Bubble Layout — Fluid & Fully Responsive */
.message-wrapper.ai-message {
  align-self: flex-start;
  max-width: 92%;
  width: auto;
  box-sizing: border-box;
}

.message-wrapper.ai-message .message-bubble {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border-bottom-left-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 14px 18px;
}

/* Markdown Formatted Typography inside AI Bubbles */
.ai-markdown-content {
  color: #F1F5F9;
  font-size: 0.9375rem;
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  box-sizing: border-box;
}

.ai-markdown-content p {
  margin: 0 0 10px 0;
}

.ai-markdown-content p:last-child {
  margin-bottom: 0;
}

.ai-markdown-content h1,
.ai-markdown-content h2,
.ai-markdown-content h3,
.ai-markdown-content h4 {
  color: #FFFFFF;
  font-weight: 700;
  margin: 16px 0 8px 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.ai-markdown-content h1 { font-size: 1.25rem; }
.ai-markdown-content h2 { font-size: 1.15rem; }
.ai-markdown-content h3 { font-size: 1.05rem; }
.ai-markdown-content h4 { font-size: 0.95rem; }

.ai-markdown-content ul,
.ai-markdown-content ol {
  margin: 8px 0 12px 22px;
  padding: 0;
}

.ai-markdown-content li {
  margin-bottom: 4px;
}

.ai-markdown-content blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid #00E5E0;
  background: rgba(0, 229, 224, 0.08);
  border-radius: 0 8px 8px 0;
  color: #CBD5E1;
  font-style: italic;
}

.ai-markdown-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ai-markdown-content th,
.ai-markdown-content td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 12px;
  font-size: 0.85rem;
  text-align: left;
}

.ai-markdown-content th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  color: #FFFFFF;
}

/* Code Container & Syntax Block — Mobile Resilient */
.ai-code-container {
  margin: 12px 0;
  background: #0B0F17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ai-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  gap: 8px;
}

.ai-code-copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #CBD5E1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.ai-code-copy-btn:hover {
  background: rgba(0, 229, 163, 0.2);
  border-color: rgba(0, 229, 163, 0.4);
  color: #00E5A3;
}

.ai-code-pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #F8FAFC;
  background: transparent;
  box-sizing: border-box;
  max-width: 100%;
  white-space: pre;
}

.ai-code-pre code {
  font-family: inherit;
  font-size: inherit;
}

.ai-inline-code {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.85em;
  color: #38BDF8;
}

/* AI Thinking Indicator */
.ai-thinking-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(0, 229, 224, 0.3);
  border-radius: 999px;
  color: #94A3B8;
  font-size: 0.825rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 229, 224, 0.15);
  margin: 10px 0;
  animation: fadeIn 0.25s ease forwards;
}

.ai-thinking-pill .ai-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00E5E0;
  box-shadow: 0 0 10px #00E5E0;
  animation: aiThinkingPulse 1.2s ease-in-out infinite;
}

@keyframes aiThinkingPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* Mobile Responsiveness for Aeni AI on screens <= 768px */
@media (max-width: 768px) {
  .message-wrapper.ai-message {
    max-width: 96% !important;
    width: 96% !important;
    margin-right: auto !important;
    margin-left: 0 !important;
  }
  .message-wrapper.ai-message .message-bubble {
    padding: 12px 14px;
    font-size: 0.9rem;
    border-radius: 16px 16px 16px 4px;
  }
  .ai-welcome-card {
    padding: 24px 14px;
    width: 100%;
    max-width: 100%;
  }
  .ai-welcome-title {
    font-size: 1.35rem;
  }
  .ai-welcome-subtitle {
    font-size: 0.82rem;
  }
  .ai-chips-grid {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .ai-chip-prompt {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.78rem;
    padding: 8px 12px;
  }
  .ai-code-container {
    margin: 8px 0;
    border-radius: 10px;
  }
  .ai-code-pre {
    padding: 10px 12px;
    font-size: 0.78rem;
  }
}

/* ============================================================
   Chat Emoji Pack Popover — Anchored & High Performance
   ============================================================ */
.chat-emoji-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 8px;
  right: 8px;
  max-width: 380px;
  height: 330px;
  max-height: 50dvh;
  background: rgba(18, 25, 33, 0.97);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 229, 224, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow: hidden;
  box-sizing: border-box;
  animation: emojiPopoverUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes emojiPopoverUp {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-emoji-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.emoji-search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 12px;
  color: #FFFFFF;
  font-size: 0.82rem;
  outline: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.emoji-search-input:focus {
  border-color: #00E5E0;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 229, 224, 0.2);
}

.chat-emoji-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(0, 0, 0, 0.2);
}

.chat-emoji-tabs::-webkit-scrollbar {
  display: none;
}

.emoji-tab-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.emoji-tab-btn:hover {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.06);
}

.emoji-tab-btn.active {
  opacity: 1;
  background: rgba(0, 229, 224, 0.18);
  box-shadow: inset 0 -2px 0 #00E5E0;
  transform: scale(1.08);
}

.chat-emoji-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 3px;
  padding: 10px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
  box-sizing: border-box;
}

.chat-emoji-grid::-webkit-scrollbar {
  width: 5px;
}
.chat-emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.chat-emoji-item {
  width: 36px;
  height: 36px;
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.12s ease;
  user-select: none;
  padding: 0;
  box-sizing: border-box;
}

.chat-emoji-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.22);
}

.chat-emoji-item:active {
  transform: scale(0.95);
}

@media (max-width: 600px) {
  .chat-emoji-popover {
    left: 4px;
    right: 4px;
    bottom: calc(100% + 6px);
    max-width: none;
    height: 300px;
    border-radius: 16px;
  }
  .chat-emoji-grid {
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 2px;
    padding: 8px;
  }
  .chat-emoji-item {
    width: 34px;
    height: 34px;
    font-size: 1.35rem;
  }
}

