/* ==========================================================================
   1. Theme Variables & Base Resets
   ========================================================================== */

:root {
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dark-theme {
  --bg-base: #07050a;
  --bg-gradient: linear-gradient(135deg, #07050a 0%, #150921 50%, #0d0414 100%);
  --bg-panel: rgba(18, 10, 28, 0.6);
  --bg-panel-solid: #120a1c;
  --bg-input: rgba(255, 255, 255, 0.03);
  --border-color: rgba(230, 28, 93, 0.15); /* deep crimson */
  --border-color-hover: rgba(230, 28, 93, 0.3);
  --text-primary: #fbfbfc;
  --text-secondary: #c9b1d6; /* lavender secondary */
  --accent-primary: #e61c5d; /* neon pink/crimson */
  --accent-primary-hover: #ff3374;
  --accent-glow: rgba(230, 28, 93, 0.35);
  --accent-secondary: #bb2beb; /* neon magenta/purple */
  --danger-color: #ff3838;
  --danger-hover: #ff4d4d;
  --success-color: #05c46b;
  --shadow-color: rgba(0, 0, 0, 0.7);
}

.after-dark-theme {
  --bg-base: #030105;
  --bg-gradient: linear-gradient(135deg, #030105 0%, #0b0216 50%, #010003 100%);
  --bg-panel: rgba(11, 4, 18, 0.7);
  --bg-panel-solid: #0b0412;
  --bg-input: rgba(255, 255, 255, 0.02);
  --border-color: rgba(168, 59, 245, 0.2); /* neon ultraviolet */
  --border-color-hover: rgba(168, 59, 245, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #d8b2eb; /* ultraviolet-tinted secondary */
  --accent-primary: #a83bf5; /* neon ultraviolet */
  --accent-primary-hover: #b85cf7;
  --accent-glow: rgba(168, 59, 245, 0.45);
  --accent-secondary: #ff007f; /* contrast neon pink */
  --shadow-color: rgba(0, 0, 0, 0.85);
}

.light-theme {
  --bg-base: #f5f4fa;
  --bg-gradient: linear-gradient(135deg, #f5f4fa 0%, #eae7f5 100%);
  --bg-panel: rgba(255, 255, 255, 0.65);
  --bg-panel-solid: #ffffff;
  --bg-input: rgba(0, 0, 0, 0.03);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.15);
  --text-primary: #1c1829;
  --text-secondary: #746c85;
  --accent-primary: #7822ec;
  --accent-primary-hover: #6113cc;
  --accent-glow: rgba(120, 34, 236, 0.18);
  --accent-secondary: #00b4d8;
  --danger-color: #ff3b30;
  --danger-hover: #d32f2f;
  --success-color: #20af53;
  --shadow-color: rgba(28, 24, 41, 0.08);
}

.after-dark-theme {
  --bg-base: #020106;
  --bg-gradient: radial-gradient(circle at 20% 0%, rgba(123, 40, 255, 0.18) 0%, transparent 34%),
                 linear-gradient(135deg, #020106 0%, #0b0216 50%, #16031f 100%);
  --bg-panel: rgba(9, 4, 22, 0.72);
  --bg-panel-solid: #090416;
  --bg-input: rgba(168, 100, 255, 0.08);
  --border-color: rgba(175, 96, 255, 0.22);
  --border-color-hover: rgba(235, 77, 255, 0.42);
  --text-primary: #fffaff;
  --text-secondary: #d9c5ff;
  --accent-primary: #eb4dff;
  --accent-primary-hover: #ff74fb;
  --accent-glow: rgba(188, 88, 255, 0.38);
  --accent-secondary: #7c5cff;
  --shadow-color: rgba(4, 0, 18, 0.82);
}

body.after-dark-theme {
  background-size: 220% 220%;
}

body.after-dark-theme .glass-panel {
  box-shadow: 0 10px 38px 0 var(--shadow-color),
              0 0 20px rgba(124, 92, 255, 0.16),
              0 0 42px rgba(235, 77, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overscroll-behavior: none;
  background: var(--bg-base, #0c0914);
}

body {
  font-family: var(--font-primary);
  background: var(--bg-gradient);
  background-size: 200% 200%;
  animation: background-motion 25s infinite ease-in-out;
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile Safari */
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  transition: var(--transition-smooth);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  body,
  body.after-dark-theme,
  body.reduced-motion {
    animation: none !important;
    background-size: 100% 100%;
  }

  .emoji-shower-overlay,
  .emoji-bubble {
    display: none !important;
  }
}

/* ==========================================================================
   2. Layout & Global Component Styles
   ========================================================================== */

.app-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1;
  visibility: hidden;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
  visibility: visible;
}

/* Glassmorphism Panel base */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 32px 0 var(--shadow-color), 
              0 0 15px rgba(230, 28, 93, 0.05), 
              0 0 25px rgba(187, 43, 235, 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: var(--border-color-hover);
  box-shadow: 0 8px 32px 0 var(--shadow-color), 
              0 0 22px rgba(230, 28, 93, 0.12), 
              0 0 35px rgba(187, 43, 235, 0.08);
}

/* Forms and Inputs */
.custom-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

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

.select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.custom-select:focus {
  border-color: var(--accent-primary);
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.8rem;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-primary-hover) 0%, var(--accent-secondary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230, 28, 93, 0.45);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  transform: rotate(30deg);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.btn-primary:hover:not(:disabled)::after {
  transform: rotate(30deg) translate(15%, 15%);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

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

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.btn-small:hover {
  background: var(--border-color);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-input);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  transition: var(--transition-fast);
}

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

.error-msg {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 4px;
}

.success-msg {
  color: var(--accent-primary);
  font-size: 0.85rem;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   3. Screen Specific Styles
   ========================================================================== */

/* ONBOARDING SCREEN */
#screen-onboarding {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 12px;
}

.onboarding-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 40px;
  text-align: center;
  animation: floatIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.brand-title span {
  color: var(--accent-primary);
}

.brand-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.growth-landing {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(230, 28, 93, 0.14);
  border-radius: var(--border-radius-lg);
  background:
    radial-gradient(circle at top left, rgba(230, 28, 93, 0.18), transparent 36%),
    rgba(255, 255, 255, 0.025);
  text-align: left;
}

.growth-eyebrow {
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.growth-title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.1;
}

.growth-copy {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.growth-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.growth-proof-grid > div {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.growth-proof-grid strong,
.growth-proof-grid span {
  display: block;
}

.growth-proof-grid strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.growth-proof-grid span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  margin-top: 3px;
}

.growth-safety-strip,
.growth-auth-recommendation,
.growth-age-note {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.growth-safety-strip,
.growth-auth-recommendation {
  padding: 10px 12px;
  border: 1px solid rgba(5, 196, 107, 0.2);
  border-radius: var(--border-radius-md);
  background: rgba(5, 196, 107, 0.06);
}

.growth-age-note {
  text-align: left;
  margin-top: -6px;
}

.growth-campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.growth-campaign-card {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.growth-campaign-card:hover,
.growth-campaign-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(230, 28, 93, 0.12);
  transform: translateY(-1px);
}

.growth-campaign-card strong,
.growth-campaign-card span {
  display: block;
}

.growth-campaign-card strong {
  font-family: var(--font-display);
  font-size: 0.84rem;
}

.growth-campaign-card span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.35;
  margin-top: 4px;
}

.onboarding-step {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.onboarding-step.active {
  display: flex;
}

.label-title {
  font-family: var(--font-display);
  font-weight: 600;
  text-align: left;
  font-size: 0.9rem;
}

.auth-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

@media (max-width: 640px) {
  #screen-onboarding {
    align-items: flex-start;
  }

  .onboarding-card {
    padding: 24px 18px;
    max-height: none;
  }

  .growth-proof-grid,
  .growth-campaign-grid {
    grid-template-columns: 1fr;
  }
}

/* MAIN DASHBOARD SCREEN */
#screen-dashboard {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

.app-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.room-title-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent-secondary);
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
}

.btn-leave-room {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
  margin-right: -4px;
}

.btn-leave-room:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-secondary);
}

.btn-leave-room.hidden {
  display: none !important;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-admin {
  background: var(--bg-input);
  border: 1px solid var(--accent-secondary);
  color: var(--accent-secondary);
}

.btn-admin:hover {
  background: var(--accent-secondary);
  color: #000;
}

.btn-dev {
  background: var(--bg-input);
  border: 1px solid #a29bfe;
  color: #a29bfe;
}

.btn-dev:hover {
  background: #a29bfe;
  color: #000;
}

/* Grid Layout */
.dashboard-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 112px); /* Header offset */
}

/* Sidebar */
.sidebar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  position: relative;
}

.profile-avatar-container {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  position: relative;
  margin-bottom: 12px;
}

.profile-avatar-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
}

.badge-verified {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--success-color);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  border: 2px solid var(--bg-panel-solid);
}

.username-display {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.ai-bot-profile-badge {
  background: var(--accent-secondary);
  color: #000;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 6px;
}

.status-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: inline-block;
}

.profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.profile-actions button {
  flex: 1;
}

.upgrade-banner {
  padding: 12px;
  background: linear-gradient(135deg, rgba(143, 67, 235, 0.2) 0%, rgba(0, 210, 252, 0.1) 100%);
  border: 1px solid var(--accent-primary);
  border-radius: var(--border-radius-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upgrade-banner p {
  font-size: 0.8rem;
  font-weight: 500;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.room-list-tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.room-list-tools-toggle {
  flex: 0 0 auto;
  height: 28px;
  max-width: 118px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-tools-toggle:hover,
.room-list-tools-toggle:focus-visible {
  border-color: rgba(84, 196, 255, 0.5);
  background: rgba(84, 196, 255, 0.12);
  color: var(--text-primary);
  outline: none;
}

.room-list-tools-panel {
  display: block;
}

.room-list-tools-panel.hidden {
  display: none;
}

.room-list-tools-collapsed {
  gap: 8px;
}

.room-join-box {
  display: flex;
  gap: 8px;
}

.room-join-box input {
  flex: 1;
}

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

.room-list-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.room-list-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-filter-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-list-filter-count {
  flex: 0 0 auto;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 17px;
  text-align: center;
}

.room-list-filter-count.hidden {
  display: none;
}

.room-list-filter-btn:hover,
.room-list-filter-btn:focus-visible {
  color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
}

.room-list-filter-btn[aria-pressed="true"],
.room-list-filter-btn.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(230, 28, 93, 0.24), rgba(187, 43, 235, 0.18));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.room-list-filter-btn[aria-pressed="true"] .room-list-filter-count,
.room-list-filter-btn.active .room-list-filter-count {
  background: rgba(255, 255, 255, 0.18);
}

.room-list-search-wrap {
  position: relative;
  margin: 7px 0 6px;
}

.room-list-search-input {
  width: 100%;
  height: 34px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.78rem;
  outline: none;
  transition: var(--transition-fast);
}

.room-list-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(230, 28, 93, 0.16);
}

.room-list-search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: var(--transition-fast);
}

.room-list-search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

.room-list-search-clear:hover,
.room-list-search-clear:focus-visible {
  color: var(--text-primary);
  background: rgba(230, 28, 93, 0.22);
  outline: none;
}

.room-list-search-enter-hint {
  margin: -2px 0 7px;
  padding: 0 2px;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.3;
}

.room-list-search-enter-hint.hidden {
  display: none;
}

.room-list-search-enter-hint.is-no-match {
  color: rgba(255, 168, 120, 0.95);
}

.room-link.is-search-preview {
  outline: 1px solid rgba(108, 92, 231, 0.55);
  outline-offset: 1px;
  background: rgba(108, 92, 231, 0.12);
}

.room-list-saved-searches {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  margin: 0 0 7px;
}

.room-list-saved-searches.hidden {
  display: none;
}

.room-list-saved-searches-label {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.room-list-saved-search-chips {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.room-list-saved-search-chip {
  flex: 0 0 auto;
  max-width: 112px;
  height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(187, 43, 235, 0.26);
  border-radius: var(--border-radius-sm);
  background: rgba(187, 43, 235, 0.08);
  color: var(--text-secondary);
  font-size: 0.67rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-save-search,
.room-list-clear-saved-searches {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(77, 208, 225, 0.28);
  border-radius: var(--border-radius-sm);
  background: rgba(77, 208, 225, 0.08);
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-clear-saved-searches {
  width: 25px;
  padding: 0;
}

.room-list-clear-saved-searches.hidden {
  display: none;
}

.room-list-save-search:disabled,
.room-list-clear-saved-searches:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.room-list-saved-search-chip:hover,
.room-list-saved-search-chip:focus-visible,
.room-list-save-search:not(:disabled):hover,
.room-list-save-search:not(:disabled):focus-visible,
.room-list-clear-saved-searches:not(:disabled):hover,
.room-list-clear-saved-searches:not(:disabled):focus-visible {
  color: var(--text-primary);
  border-color: rgba(230, 28, 93, 0.5);
  background: rgba(230, 28, 93, 0.16);
  outline: none;
}

.room-list-sort-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 7px;
}

.room-list-sort-btn {
  min-width: 0;
  height: 28px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-sort-btn:hover,
.room-list-sort-btn:focus-visible {
  color: var(--text-primary);
  border-color: rgba(230, 28, 93, 0.45);
  outline: none;
}

.room-list-sort-btn[aria-pressed="true"],
.room-list-sort-btn.active {
  color: var(--text-primary);
  border-color: rgba(230, 28, 93, 0.48);
  background: rgba(230, 28, 93, 0.16);
}

.room-list-density-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 7px;
}

.room-list-density-btn {
  min-width: 0;
  height: 26px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-density-btn:hover,
.room-list-density-btn:focus-visible {
  color: var(--text-primary);
  border-color: rgba(187, 43, 235, 0.45);
  outline: none;
}

.room-list-density-btn[aria-pressed="true"],
.room-list-density-btn.active {
  color: var(--text-primary);
  border-color: rgba(187, 43, 235, 0.48);
  background: rgba(187, 43, 235, 0.15);
}

.room-list-quiet-hours {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 7px;
}

.room-list-quiet-hours-btn {
  min-width: 0;
  height: 26px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-quiet-hours-btn:hover,
.room-list-quiet-hours-btn:focus-visible {
  color: var(--text-primary);
  border-color: rgba(84, 196, 255, 0.48);
  outline: none;
}

.room-list-quiet-hours-btn[aria-pressed="true"],
.room-list-quiet-hours-btn.active {
  color: var(--text-primary);
  border-color: rgba(84, 196, 255, 0.5);
  background: rgba(84, 196, 255, 0.13);
}

.room-list-reset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  padding: 6px 7px 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.25;
}

.room-list-reset-bar.hidden {
  display: none;
}

.room-list-reset-btn {
  flex: 0 0 auto;
  min-width: 56px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-reset-btn:hover,
.room-list-reset-btn:focus-visible {
  border-color: rgba(230, 28, 93, 0.5);
  background: rgba(230, 28, 93, 0.16);
  outline: none;
}

.room-list-recents {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  min-width: 0;
}

.room-list-recents.hidden {
  display: none;
}

.room-list-recents-label {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.room-list-recents-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.room-list-recents-chips::-webkit-scrollbar {
  display: none;
}

.room-list-clear-recents,
.room-list-clear-favorites {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-clear-recents.hidden,
.room-list-clear-favorites.hidden {
  display: none;
}

.room-list-clear-recents:hover,
.room-list-clear-recents:focus-visible,
.room-list-clear-favorites:hover,
.room-list-clear-favorites:focus-visible {
  border-color: rgba(230, 28, 93, 0.5);
  background: rgba(230, 28, 93, 0.14);
  color: var(--text-primary);
  outline: none;
}

.room-list-recent-chip {
  flex: 0 0 auto;
  max-width: 132px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(187, 43, 235, 0.28);
  border-radius: 999px;
  background: rgba(187, 43, 235, 0.08);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-recent-chip:hover,
.room-list-recent-chip:focus-visible {
  border-color: rgba(230, 28, 93, 0.55);
  background: rgba(230, 28, 93, 0.16);
  outline: none;
}

.room-list-favorites {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  min-width: 0;
}

.room-list-favorites.hidden {
  display: none;
}

.room-list-snoozed-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(84, 196, 255, 0.28);
  border-radius: var(--border-radius-sm);
  background: rgba(84, 196, 255, 0.08);
  color: var(--text-primary);
  font-size: 0.74rem;
  line-height: 1.3;
}

.room-list-snoozed-tools.hidden {
  display: none;
}

.room-list-snoozed-tools-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 780;
}

.room-list-clear-snoozes {
  flex: 0 0 auto;
  min-width: 82px;
  height: 26px;
  border: 1px solid rgba(84, 196, 255, 0.42);
  border-radius: 6px;
  background: rgba(84, 196, 255, 0.13);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-clear-snoozes:hover,
.room-list-clear-snoozes:focus-visible {
  border-color: rgba(84, 196, 255, 0.72);
  background: rgba(84, 196, 255, 0.23);
  outline: none;
}

.room-list-clear-snoozes:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.room-list-muted-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(255, 183, 77, 0.28);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 183, 77, 0.08);
  color: var(--text-primary);
  font-size: 0.74rem;
  line-height: 1.3;
}

.room-list-muted-tools.hidden {
  display: none;
}

.room-list-muted-tools-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 780;
}

.room-list-clear-mutes {
  flex: 0 0 auto;
  min-width: 82px;
  height: 26px;
  border: 1px solid rgba(255, 183, 77, 0.42);
  border-radius: 6px;
  background: rgba(255, 183, 77, 0.13);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-clear-mutes:hover,
.room-list-clear-mutes:focus-visible {
  border-color: rgba(255, 183, 77, 0.72);
  background: rgba(255, 183, 77, 0.23);
  outline: none;
}

.room-list-clear-mutes:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.room-list-favorites-label {
  flex: 0 0 auto;
  color: #ffd54f;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.room-list-favorites-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.room-list-favorites-chips::-webkit-scrollbar {
  display: none;
}

.room-list-favorite-chip {
  flex: 0 0 auto;
  max-width: 132px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 213, 79, 0.32);
  border-radius: 999px;
  background: rgba(255, 213, 79, 0.09);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-favorite-chip:hover,
.room-list-favorite-chip:focus-visible {
  border-color: rgba(255, 213, 79, 0.62);
  background: rgba(255, 213, 79, 0.17);
  outline: none;
}

.room-list-unread-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(230, 28, 93, 0.28);
  border-radius: var(--border-radius-sm);
  background: rgba(230, 28, 93, 0.09);
  color: var(--text-primary);
  font-size: 0.76rem;
  line-height: 1.3;
}

.room-list-unread-summary.hidden {
  display: none;
}

.room-list-jump-unread {
  flex: 0 0 auto;
  min-width: 62px;
  height: 26px;
  border: 1px solid rgba(230, 28, 93, 0.42);
  border-radius: 6px;
  background: rgba(230, 28, 93, 0.18);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-mark-visible-read {
  flex: 0 0 auto;
  min-width: 74px;
  height: 26px;
  border: 1px solid rgba(84, 196, 255, 0.38);
  border-radius: 6px;
  background: rgba(84, 196, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-jump-unread:hover,
.room-list-jump-unread:focus-visible,
.room-list-mark-visible-read:hover,
.room-list-mark-visible-read:focus-visible {
  border-color: rgba(230, 28, 93, 0.72);
  background: rgba(230, 28, 93, 0.28);
  outline: none;
}

.room-list-mark-visible-read:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.room-list-active-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(187, 43, 235, 0.28);
  border-radius: var(--border-radius-sm);
  background: rgba(187, 43, 235, 0.08);
  color: var(--text-primary);
  font-size: 0.74rem;
  line-height: 1.3;
}

.room-list-active-room.hidden {
  display: none;
}

.room-list-active-room-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 750;
}

.room-list-jump-active {
  flex: 0 0 auto;
  min-width: 58px;
  height: 26px;
  border: 1px solid rgba(187, 43, 235, 0.42);
  border-radius: 6px;
  background: rgba(187, 43, 235, 0.16);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-jump-active:hover,
.room-list-jump-active:focus-visible {
  border-color: rgba(187, 43, 235, 0.72);
  background: rgba(187, 43, 235, 0.26);
  outline: none;
}

.room-list-result-summary-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
}

.room-list-result-summary-wrap.hidden {
  display: none;
}

.room-list-result-summary {
  min-width: 0;
  padding: 0 2px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: right;
}

.room-list-result-summary:empty,
.room-list-copy-visible.hidden {
  display: none;
}

.room-list-copy-visible {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(77, 208, 225, 0.34);
  border-radius: var(--border-radius-sm);
  background: rgba(77, 208, 225, 0.08);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-list-copy-visible:hover,
.room-list-copy-visible:focus-visible {
  color: var(--text-primary);
  border-color: rgba(77, 208, 225, 0.54);
  background: rgba(77, 208, 225, 0.16);
  outline: none;
}

.room-list-result-summary-wrap.is-compact .room-list-copy-visible {
  min-height: 24px;
  padding: 0 7px;
  font-size: 0.64rem;
}

.room-list-empty-state,
.room-list-loading-state,
.featured-room-list-loading-state,
.message-history-loading-state,
.wall-posts-loading-state,
.wall-comments-loading-state,
.nearby-users-list-loading-state,
.browse-grid-loading-state,
.games-grid-loading-state,
.chat-search-loading-state,
.view-user-profile-loading-state,
.blocked-users-loading-state,
.active-sessions-loading-state,
.my-media-loading-state,
.profile-tags-loading-state,
.profile-gallery-loading-state {
  padding: 10px 12px;
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.my-media-loading-state {
  padding: 40px 16px;
  font-size: 0.95rem;
}

.my-media-error-state {
  padding: 40px 16px;
  border: 1px dashed rgba(255, 118, 117, 0.45);
  border-radius: var(--border-radius-sm);
  color: #ff7675;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.room-list-loading-state,
.featured-room-list-loading-state,
.message-history-loading-state,
.wall-posts-loading-state,
.wall-comments-loading-state,
.nearby-users-list-loading-state,
.browse-grid-loading-state,
.games-grid-loading-state,
.view-user-profile-loading-state {
  border-style: solid;
  opacity: 0.9;
}

.view-user-profile-loading-state {
  margin: 12px 0 16px;
  text-align: center;
}

.message-history-loading-state,
.wall-posts-loading-state,
.wall-comments-loading-state {
  margin: 12px;
}

.wall-comments-error-state,
.blocked-users-error-state,
.active-sessions-error-state,
.profile-tags-error-state,
.profile-gallery-error-state {
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  color: var(--danger-color);
  font-size: 0.78rem;
  text-align: center;
}

.browse-grid-loading-state,
.games-grid-loading-state {
  grid-column: 1 / -1;
  padding: 40px;
}

.room-link-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.room-favorite-btn,
.room-mute-btn,
.room-snooze-btn,
.room-copy-name-btn,
.room-share-link-btn,
.room-copy-link-btn {
  flex: 0 0 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-favorite-btn:hover,
.room-favorite-btn:focus-visible,
.room-mute-btn:hover,
.room-mute-btn:focus-visible,
.room-snooze-btn:hover,
.room-snooze-btn:focus-visible,
.room-copy-name-btn:hover,
.room-copy-name-btn:focus-visible,
.room-share-link-btn:hover,
.room-share-link-btn:focus-visible,
.room-copy-link-btn:hover,
.room-copy-link-btn:focus-visible {
  color: var(--text-primary);
  border-color: rgba(255, 213, 79, 0.45);
  background: rgba(255, 213, 79, 0.12);
  outline: none;
}

.room-favorite-btn[aria-pressed="true"] {
  color: #ffd54f;
  border-color: rgba(255, 213, 79, 0.58);
  background: rgba(255, 213, 79, 0.16);
  text-shadow: 0 0 10px rgba(255, 213, 79, 0.45);
}

.room-mute-btn:hover,
.room-mute-btn:focus-visible {
  border-color: rgba(187, 43, 235, 0.46);
  background: rgba(187, 43, 235, 0.12);
}

.room-mute-btn[aria-pressed="true"] {
  color: var(--accent-secondary);
  border-color: rgba(187, 43, 235, 0.56);
  background: rgba(187, 43, 235, 0.16);
  text-shadow: 0 0 10px rgba(187, 43, 235, 0.45);
}

.room-snooze-btn:hover,
.room-snooze-btn:focus-visible {
  border-color: rgba(84, 196, 255, 0.48);
  background: rgba(84, 196, 255, 0.12);
}

.room-snooze-btn[aria-pressed="true"] {
  color: #81d4fa;
  border-color: rgba(84, 196, 255, 0.58);
  background: rgba(84, 196, 255, 0.16);
  text-shadow: 0 0 10px rgba(84, 196, 255, 0.45);
}

.room-copy-name-btn:hover,
.room-copy-name-btn:focus-visible {
  border-color: rgba(255, 167, 38, 0.5);
  background: rgba(255, 167, 38, 0.13);
}

.room-share-link-btn:hover,
.room-share-link-btn:focus-visible {
  border-color: rgba(129, 199, 132, 0.5);
  background: rgba(129, 199, 132, 0.13);
}

.room-copy-link-btn:hover,
.room-copy-link-btn:focus-visible {
  border-color: rgba(77, 208, 225, 0.46);
  background: rgba(77, 208, 225, 0.12);
}

.room-link-row.is-muted .room-link {
  color: var(--text-secondary);
  opacity: 0.72;
}

.room-link-row.is-snoozed .room-link {
  opacity: 0.58;
}

.rooms-nav-list.room-list-density-compact {
  gap: 4px;
}

.room-list-density-compact .room-link-row {
  gap: 4px;
}

.room-list-density-compact .room-link {
  padding: 7px 10px;
  font-size: 0.82rem;
  gap: 6px;
}

.room-list-density-compact .room-link::before {
  margin-right: 5px;
}

.room-list-density-compact .room-favorite-btn,
.room-list-density-compact .room-mute-btn,
.room-list-density-compact .room-snooze-btn,
.room-list-density-compact .room-copy-name-btn,
.room-list-density-compact .room-share-link-btn,
.room-list-density-compact .room-copy-link-btn {
  flex-basis: 25px;
  font-size: 0.88rem;
}

.room-list-density-compact .room-list-favorite-chip {
  height: 24px;
  max-width: 116px;
  padding: 0 8px;
  font-size: 0.66rem;
}

.room-list-density-compact .room-link-meta {
  gap: 4px;
  margin-left: 5px;
}

.room-list-density-compact .room-relative-time {
  font-size: 0.64rem;
}

.room-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.room-link::before {
  content: '#';
  margin-right: 8px;
  color: var(--accent-primary);
}

.room-link:hover, .room-link:focus-visible {
  background: var(--bg-input);
  color: var(--text-primary);
}

.room-link:focus-visible {
  outline: 2px solid rgba(230, 28, 93, 0.55);
  outline-offset: 2px;
}

/* The room you are currently in — clearly distinct from a merely-hovered row
   so "which room am I in?" is obvious at a glance. */
.room-link.active {
  background: rgba(230, 28, 93, 0.14);
  color: var(--text-primary);
  font-weight: 700;
  border-left: 3px solid var(--accent-primary);
  box-shadow: inset 0 0 0 1px rgba(230, 28, 93, 0.22);
}

.room-link.active::before {
  color: var(--accent-primary);
  font-weight: 700;
}

.room-link.active .room-link-name {
  color: var(--text-primary);
}

.room-link-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-link-search-highlight {
  border-radius: 4px;
  background: rgba(255, 213, 79, 0.22);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(255, 213, 79, 0.16);
}

.room-link:hover .room-link-search-highlight,
.room-link:focus-visible .room-link-search-highlight,
.room-link.active .room-link-search-highlight {
  background: rgba(255, 213, 79, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 213, 79, 0.28);
}

.room-link-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}

.featured-room-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.featured-room-link:hover,
.featured-room-link:focus-visible,
.featured-room-link.active {
  background: var(--bg-input);
  color: var(--text-primary);
}

.featured-room-link:focus-visible {
  outline: 2px solid rgba(230, 28, 93, 0.55);
  outline-offset: 2px;
}

.featured-room-link.active {
  border-left: 3px solid var(--accent-primary);
}

.featured-room-main {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.featured-room-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-room-last-update {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.featured-room-activity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.featured-room-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-primary);
  box-shadow: 0 0 10px rgba(230, 28, 93, 0.62);
}

.room-relative-time {
  font-size: 0.68rem;
  color: var(--text-secondary);
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.room-activity-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 0 rgba(230, 28, 93, 0.45);
  animation: roomActivityPulse 2.8s infinite ease-in-out;
}

@keyframes roomActivityPulse {
  0%, 100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(230, 28, 93, 0.42);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.16);
    box-shadow: 0 0 0 7px rgba(230, 28, 93, 0);
    opacity: 1;
  }
}

/* Chat Pane */
.chat-pane {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.chat-state-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.chat-state-hidden {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.lobby-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.lobby-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounce 2s infinite ease-in-out;
}

.lobby-welcome h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.lobby-welcome p {
  color: var(--text-secondary);
  max-width: 400px;
  font-size: 0.95rem;
}

/* Chat Active State */
.presence-bar {
  position: relative;
  height: 48px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.05);
  gap: 8px;
}

.presence-bar__info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.presence-bar__actions,
.chat-search-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.presence-bar__action-btn {
  padding: 4px 8px;
  font-size: 0.8rem;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
}

.chat-search-input {
  padding: 4px 8px;
  font-size: 0.85rem;
  width: 180px;
  min-height: unset;
  height: 28px;
}

.btn-toggle-search {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition-fast);
  padding: 2px 4px;
  border-radius: var(--border-radius-sm);
}

.btn-toggle-search:hover {
  opacity: 1;
}

.btn-toggle-search:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  opacity: 1;
}

.search-results-popover {
  position: absolute;
  top: 40px;
  right: 16px;
  width: 280px;
  max-height: 350px;
  overflow-y: auto;
  z-index: 100;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 30px var(--shadow-color);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-panel-solid);
}

.search-results-popover__header {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.6;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.search-results-count {
  color: var(--accent-primary);
}

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

.chat-search-loading-state {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .presence-bar {
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    padding: 8px 12px;
  }

  .presence-bar__info {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .presence-bar__actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .presence-bar__action-btn {
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  .chat-search-input:not(.hidden) {
    flex: 1 1 100%;
    width: 100%;
    order: 3;
  }

  .search-results-popover {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
  }
}

.active-users-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.presence-avatars-row {
  display: flex;
  align-items: center;
  gap: -8px; /* Negative margin overlap */
}

.presence-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-panel-solid);
  margin-left: -6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.presence-mini-avatar:hover {
  transform: translateY(-2px);
  z-index: 10;
}

.messages-viewport {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty-room-starters {
  align-self: center;
  width: min(100%, 560px);
  margin: auto 0;
  padding: 18px;
  border: 1px solid rgba(230, 28, 93, 0.22);
  text-align: center;
}

.empty-room-starters-title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.empty-room-starters-subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.45;
}

.empty-room-starter-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.empty-room-starter-chip {
  max-width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  padding: 8px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.empty-room-starter-chip:hover,
.empty-room-starter-chip:focus-visible {
  border-color: var(--accent-primary);
  background: rgba(230, 28, 93, 0.15);
  transform: translateY(-1px);
  outline: none;
}

.chat-starter-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.chat-starter-dock.hidden {
  display: none;
}

.chat-starter-dock-label {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-starter-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-starter-chip-row::-webkit-scrollbar {
  display: none;
}

.chat-starter-chip,
.wall-chat-start-chip {
  flex: 0 0 auto;
  max-width: min(280px, 70vw);
  min-height: 32px;
  border: 1px solid rgba(230, 28, 93, 0.2);
  border-radius: 999px;
  background: rgba(230, 28, 93, 0.09);
  color: var(--text-primary);
  padding: 7px 11px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chat-starter-chip:hover,
.chat-starter-chip:focus-visible,
.wall-chat-start-chip:hover,
.wall-chat-start-chip:focus-visible {
  border-color: var(--accent-primary);
  background: rgba(230, 28, 93, 0.16);
  transform: translateY(-1px);
  outline: none;
}

.composer-draft-status {
  margin: 0 8px 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.3;
  opacity: 0.85;
}

/* Chat Message Render */
.msg-bubble-wrap {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: msgSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.msg-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.msg-sender-name {
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.msg-sender-name:hover {
  text-decoration: underline;
}

.msg-badge-ver {
  color: var(--success-color);
  font-weight: bold;
}

.msg-time {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.msg-content-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) var(--border-radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

/* Smart Text Rendering: clickable URLs & @mention highlights */
.msg-link {
  color: var(--accent-secondary);
  text-decoration: none;
  word-break: break-all;
  transition: var(--transition-fast);
}

.msg-link:hover {
  text-decoration: underline;
  color: var(--accent-primary-hover);
}

.msg-link::after {
  content: ' ↗';
  font-size: 0.7em;
  opacity: 0.6;
}

.msg-bubble-wrap.me .msg-link {
  color: rgba(255, 255, 255, 0.85);
}

.msg-bubble-wrap.me .msg-link:hover {
  color: #ffffff;
}

.msg-mention {
  color: var(--accent-primary);
  background: rgba(230, 28, 93, 0.1);
  padding: 1px 4px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-fast);
}

.msg-mention:hover {
  background: rgba(230, 28, 93, 0.2);
  box-shadow: 0 0 6px rgba(230, 28, 93, 0.15);
}

.msg-bubble-wrap.me .msg-mention {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.msg-bubble-wrap.me .msg-mention:hover {
  background: rgba(255, 255, 255, 0.28);
}

.msg-bubble-wrap.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-bubble-wrap.me .msg-content-box {
  background: var(--accent-primary);
  border-color: transparent;
  color: #fff;
  border-radius: var(--border-radius-md) 0 var(--border-radius-md) var(--border-radius-md);
}

.msg-bubble-wrap.me .msg-header {
  flex-direction: row-reverse;
}

/* System Message Alert */
.msg-system-alert {
  align-self: center;
  background: var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}

.chat-image-embed {
  max-width: 260px;
  max-height: 200px;
  border-radius: var(--border-radius-sm);
  margin-top: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  display: block;
}

/* Typing Indicator bar */
.typing-indicator-box {
  height: 24px;
  padding: 0 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.typing-dots span {
  animation: typing-bounce 1.4s infinite both;
  display: inline-block;
  font-weight: bold;
}

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

/* Input controls footer container */
.chat-input-footer {
  min-height: 64px;
  height: auto;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 16px;
  gap: 8px;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

.chat-input-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-action-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.input-action-btn:hover {
  background: var(--bg-input);
  transform: scale(1.05);
}

.message-input-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: 24px;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  /* Textarea auto-resize support */
  resize: none;
  overflow-y: auto;
  min-height: 44px;
  max-height: 100px;
  line-height: 1.4;
  scrollbar-width: thin;
}

.message-input-field:focus {
  border-color: var(--accent-primary);
  background: var(--bg-panel-solid);
}

/* ==========================================================================
   4. Modals and Popups
   ========================================================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile Safari */
  background: rgba(6, 4, 10, 0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)) 20px;
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px); /* Dynamic viewport for iOS Safari */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px;
  padding-bottom: 40px; /* Extra bottom padding so save button isn't cut off */
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Password input wrapper with show/hide toggle */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .custom-input {
  width: 100%;
  padding-right: 44px;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  transition: color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
}

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

/* Guest-restricted sections */
.guest-restricted {
  display: none;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.4;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Profile specific modal */
.avatar-edit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.avatar-edit-row img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
}

.voice-recorder-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.record-status-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Liveness Verification styling */
.verification-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.challenge-indicator {
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  text-align: center;
}

.challenge-indicator h3 {
  font-size: 1.25rem;
  color: var(--accent-secondary);
  margin-top: 4px;
}

.selfie-upload-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 30px;
  text-align: center;
  transition: var(--transition-fast);
}

.selfie-upload-box:hover {
  border-color: var(--accent-primary);
}

.success-label {
  color: var(--success-color);
  font-weight: 600;
  font-size: 0.85rem;
}

.full-width {
  width: 100%;
}

/* Stickers grid */
.stickers-modal {
  max-width: 360px;
}

.stickers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.sticker-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--border-radius-md);
  text-align: center;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.sticker-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  background: var(--bg-panel);
}

/* Admin console styling */
.admin-modal {
  max-width: 760px;
  width: 90%;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.tab-btn:hover, .tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-input);
}

.tab-btn.active {
  border-bottom: 2px solid var(--accent-primary);
}

.admin-tab-content {
  flex: 1;
  overflow-y: auto;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.tab-pane.active {
  display: flex;
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background: var(--bg-panel-solid);
  font-family: var(--font-display);
  font-weight: 600;
}

.admin-table tbody tr:hover {
  background: var(--bg-input);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

/* User profile view styling */
.user-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.view-profile-avatar-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  margin-bottom: 8px;
}

.view-profile-avatar-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--accent-primary);
}

.user-bio-text {
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
}

.user-gender-text {
  font-size: 0.85rem;
  text-align: center;
  font-weight: 500;
  margin-bottom: 12px;
}

.voice-bio-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
}

.voice-bio-container span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.voice-bio-container audio {
  width: 100%;
}

.profile-gallery-section {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-gallery-header h3 {
  margin: 0;
  font-size: 1rem;
}

.profile-gallery-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.profile-gallery-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 120px;
}

.profile-gallery-card button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.profile-gallery-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.profile-gallery-card:hover .profile-gallery-thumb {
  transform: scale(1.03);
}

.profile-gallery-card.is-blurred .profile-gallery-thumb {
  filter: blur(16px) saturate(0.8);
}

.profile-gallery-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.profile-gallery-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(7, 5, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.profile-gallery-badge.warning {
  color: #ffd479;
  border-color: rgba(255, 212, 121, 0.35);
}

.profile-gallery-badge.avatar {
  color: #8ef4ff;
  border-color: rgba(142, 244, 255, 0.35);
}

.profile-gallery-empty {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 18px 10px 6px;
  line-height: 1.5;
}

.my-media-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
  overflow: hidden;
}

.my-media-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
}

.my-media-preview {
  width: 100%;
  height: 90px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.my-media-preview img,
.my-media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-media-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.my-media-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.my-media-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.my-media-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  width: 100%;
  flex-wrap: wrap;
}

.my-media-gallery-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.my-media-gallery-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.my-media-inline-select {
  min-height: unset;
  height: 30px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

.my-media-inline-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.my-media-gallery-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.my-media-gallery-badge {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.my-media-gallery-badge.warning {
  color: #ffd479;
  border-color: rgba(255, 212, 121, 0.35);
}

.my-media-gallery-badge.avatar {
  color: #8ef4ff;
  border-color: rgba(142, 244, 255, 0.35);
}

.profile-gallery-manager {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.profile-gallery-manager-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-gallery-manager-header .label-desc {
  margin: 4px 0 0;
  line-height: 1.4;
}

.profile-gallery-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px;
}

.profile-gallery-manager-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-gallery-manager-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.25);
}

.profile-gallery-manager-preview img,
.profile-gallery-manager-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-gallery-manager-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-gallery-manager-controls {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.profile-gallery-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.profile-gallery-manager-actions .btn-small {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.68rem;
}

.user-trust-vouch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 6px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.user-rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 12px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}

.star-rating .star {
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  user-select: none;
}

.star-rating .star.active {
  color: hsl(45, 100%, 60%);
  text-shadow: 0 0 8px rgba(255, 180, 0, 0.4);
}

/* Reset active styles when parent is hovered so hover takes precedence */
.star-rating:hover .star {
  color: rgba(255, 255, 255, 0.15) !important;
  text-shadow: none !important;
}

/* Hover highlights hovered star and all subsequent sibling stars in DOM (which are visually to its left) */
.star-rating .star:hover,
.star-rating .star:hover ~ .star {
  color: hsl(45, 100%, 65%) !important;
  text-shadow: 0 0 10px rgba(255, 190, 0, 0.6) !important;
  transform: scale(1.15);
}

.star-rating.readonly {
  pointer-events: none;
}

.user-moderation-row {
  display: flex;
  gap: 12px;
}

.user-moderation-row button {
  flex: 1;
}

/* ==========================================================================
   5. Dynamic Micro-Animations & Scrollbars
   ========================================================================== */

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Floating Emojis animation */
.emoji-shower-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.emoji-bubble {
  position: absolute;
  bottom: -60px;
  font-size: 2.5rem;
  animation: floatUp 3.2s ease-in-out forwards;
  pointer-events: none;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.6) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(-10vh) scale(1) rotate(15deg);
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-110vh) scale(0.8) rotate(360deg);
    opacity: 0;
  }
}

/* Core Pop Animations */
@keyframes floatIn {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

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

@keyframes msgSlideIn {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Responsive Overrides */
@media (max-width: 768px) {
  #screen-dashboard {
    padding: 8px;
    gap: 8px;
    height: 100vh;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: calc(100vh - 88px);
  }

  .sidebar {
    display: none; /* Collapsed by default on mobile in simple implementation */
  }

  .sidebar.active {
    display: flex;
    position: absolute;
    top: 80px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 96px);
    z-index: 10;
  }

  body.in-room .header-brand .brand-logo {
    display: none !important;
  }
  
  body.in-room .header-brand .room-title-display {
    border-left: none !important;
    padding-left: 0 !important;
  }
}

/* ==========================================================================
   4. Feature Expansion Styles (Bot, Mic, Video, Countdowns, View-Once)
   ========================================================================== */

/* Embedded Audio & Video Chat Elements */
.chat-audio-embed {
  margin-top: 6px;
  display: block;
  width: 240px;
  height: 40px;
  border-radius: var(--border-radius-sm);
  outline: none;
}

.chat-video-embed {
  margin-top: 6px;
  display: block;
  max-width: 280px;
  max-height: 200px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: #000;
}

/* Audio & Video Recording UI overlays */
.record-bar-container {
  position: absolute;
  bottom: 64px;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-panel-solid);
  border-top: 1px solid var(--accent-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.record-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--danger-color);
}

.record-dot-blinking {
  width: 10px;
  height: 10px;
  background: var(--danger-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--danger-color);
  animation: blink 1s infinite alternate;
}

.record-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Floating Camera Preview */
.camera-preview-container {
  position: absolute;
  bottom: 120px;
  right: 20px;
  width: 260px;
  height: 195px;
  background: #000;
  border: 2px solid var(--accent-primary);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px var(--shadow-color);
  z-index: 105;
  display: flex;
  flex-direction: column;
}

.camera-preview-video {
  width: 100%;
  flex: 1;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror camera preview */
}

/* Message Countdowns */
.message-countdown-badge {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.msg-bubble-wrap.me .message-countdown-badge {
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.7);
  border-color: transparent;
}

.msg-fade-out {
  animation: fadeOutAndCollapse 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* View Once Messages */
.view-once-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-color);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

.view-once-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.view-once-opened {
  color: var(--text-secondary) !important;
  font-style: italic;
  background: transparent;
  border: 1px solid var(--border-color);
  cursor: not-allowed;
  pointer-events: none;
}

.view-once-opened::before {
  content: '✓';
  margin-right: 4px;
}

/* View Once Fullscreen Reveal Overlay */
.view-once-reveal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 6, 15, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 20px;
  padding: 20px;
}

.view-once-reveal-content-box {
  max-width: 90%;
  max-height: 70%;
  border-radius: var(--border-radius-lg);
  border: 2px solid var(--accent-secondary);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 210, 252, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
}

.reveal-blurred {
  filter: blur(25px) grayscale(80%);
  pointer-events: none;
  transition: filter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-once-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s, transform 0.1s;
  z-index: 10001;
  outline: none;
}

.view-once-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.view-once-close-btn:active {
  transform: scale(0.95);
}

.view-once-hold-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.view-once-hold-prompt .fingerprint-icon {
  font-size: 2.5rem;
  animation: pulse-glow 2s infinite ease-in-out;
}

.view-once-hold-prompt .prompt-text {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.85;
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(0, 210, 252, 0.4));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(0, 210, 252, 0.7));
  }
}

.view-once-text-reveal {
  padding: 24px;
  font-size: 1.25rem;
  font-weight: 500;
  text-align: center;
  color: #fff;
  word-break: break-word;
  max-width: 500px;
}

.view-once-timer-bar {
  width: 240px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.view-once-timer-progress {
  height: 100%;
  background: var(--accent-secondary);
  width: 100%;
  transform-origin: left center;
}

.view-once-timer-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Toggle Option States in Input Bar */
.input-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}

.input-option-active {
  background: var(--accent-primary) !important;
  color: #fff !important;
  box-shadow: 0 0 8px var(--accent-glow);
}

.input-option-active-secondary {
  background: var(--accent-secondary) !important;
  color: #000 !important;
}

.blocked-users-loading-state,
.active-sessions-loading-state {
  margin: 4px 0;
}

/* Settings block lists UI */
.blocked-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

.blocked-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
}

/* Active Sessions UI */
.active-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.active-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  gap: 8px;
}

.session-device-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.session-device-name {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-current-badge {
  font-size: 0.7rem;
  background: linear-gradient(135deg, #a55eea, #8f43eb);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: bold;
}

.session-metadata {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Keyframes animations */
@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes slideUp {
  0% { transform: translateY(15px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOutAndCollapse {
  0% {
    opacity: 1;
    transform: scale(1);
    max-height: 250px;
    margin-bottom: 16px;
    padding: inherit;
    border-width: 1px;
  }
  100% {
    opacity: 0;
    transform: scale(0.92);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    border-width: 0;
    overflow: hidden;
  }
}

.msg-delete-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  display: flex;
  align-items: center;
}

.msg-delete-btn:hover {
  opacity: 1;
  color: var(--danger-color);
}

/* ==========================================================================
   5. Responsive & Offline Indicator Overrides
   ========================================================================== */

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Offline Sender style on Messages */
.msg-bubble-wrap.offline-sender {
  opacity: 0.55;
  filter: grayscale(40%);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Presence Status Dot in message headers and lists */
.presence-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 6px;
  margin-right: 6px;
  vertical-align: middle;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.presence-status-dot.online {
  background-color: #2ec4b6; /* Gen-Z cyan-green */
  box-shadow: 0 0 8px rgba(46, 196, 182, 0.7);
}

.presence-status-dot.offline {
  background-color: #95a5a6; /* modern slate gray */
  box-shadow: none;
}

/* User Presence Sidebar List */
.presence-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.presence-user-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.presence-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.presence-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-primary);
  flex-shrink: 0;
}

.presence-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-user-badge {
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

.btn-dm-init {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  padding: 2px;
}

.btn-dm-init:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Tablet / Narrow Screen Input Bar Adjustments */
@media (max-width: 900px) {
  .chat-input-footer {
    padding: 8px 10px;
  }

  .chat-input-bar {
    padding: 8px 12px;
    gap: 8px;
  }
}

/* Mobile Sidebar & Header Adjustments */
@media (max-width: 768px) {
  .sidebar-toggle-btn {
    display: block;
  }

  .dashboard-grid {
    position: relative; /* Anchor for absolute sidebar drawer positioning */
  }

  .sidebar.active {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200; /* Ensure overlay shows above components */
    background: var(--bg-panel-solid) !important;
    border: 1px solid var(--border-color);
  }

  .app-header {
    padding: 0 12px;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
  }
}

/* Very Narrow Screen (Phone) Layout Mutes */
@media (max-width: 600px) {
  .btn-text {
    display: none;
  }
  .btn-icon-fallback {
    display: inline !important;
  }
  #btn-logout {
    padding: 8px 12px;
  }
}

/* ==========================================================================
   6. Message Emoji Reactions
   ========================================================================== */

.msg-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
  margin-left: 6px;
  opacity: 0.35;
  transition: opacity 0.2s, transform 0.15s;
}

.msg-action-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.msg-reactions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.reaction-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.reaction-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

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

/* Floating Emoji Picker Tooltip */
.emoji-picker-tooltip {
  position: absolute;
  background: var(--bg-panel-solid);
  border: 1px solid var(--accent-primary);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  gap: 8px;
  box-shadow: 0 4px 15px var(--shadow-color);
  z-index: 1000;
  backdrop-filter: blur(10px);
  animation: slideUp 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.picker-emoji-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.15s;
}

.picker-emoji-btn:hover {
  transform: scale(1.25);
}

/* Pinned Messages Banner */
.pinned-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel-solid);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  z-index: 10;
  cursor: pointer;
}

.pinned-banner:hover {
  background: var(--bg-input);
}

.pinned-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pinned-icon {
  font-size: 0.95rem;
}

.pinned-text {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-unpin-x {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: var(--transition-fast);
}

.btn-unpin-x:hover {
  color: var(--danger-color);
}

.msg-badge-pinned {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  color: var(--accent-primary);
  margin-left: 6px;
  background: var(--accent-glow);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  gap: 2px;
}

.msg-bubble-wrap.pinned-message .msg-body {
  border-left: 3px solid var(--accent-primary);
}

.highlight-glow {
  animation: pulseHighlight 2s ease;
}

@keyframes pulseHighlight {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 15px 5px var(--accent-glow); background: var(--accent-glow); }
  100% { box-shadow: 0 0 0 0 var(--accent-glow); }
}

/* Search Results Styles */
.search-result-item {
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.search-result-item:hover,
.search-result-item:focus-visible {
  background: var(--accent-glow);
  border-color: var(--accent-primary);
  outline: none;
}

.search-result-item:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.75rem;
}

.search-result-body {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

/* ==========================================================================
   7. Mobile Message Actions Bottom Sheet
   ========================================================================== */

.msg-actions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.msg-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 1rem;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.msg-action-item:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.98);
}

.msg-action-emoji-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.msg-action-emoji-btn {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}

.msg-action-emoji-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .bottom-sheet-modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  
  .bottom-sheet-modal .modal-content.bottom-sheet-content {
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    padding: 24px 20px 40px 20px !important;
    transform: translateY(100%);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

/* Chatbot Thinking Dots Animation */
.msg-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
}

.msg-thinking-dots span {
  width: 7px;
  height: 7px;
  background-color: var(--text-primary);
  border-radius: 50%;
  opacity: 0.4;
  animation: msg-dots-bounce 1.4s infinite ease-in-out both;
}

.msg-thinking-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.msg-thinking-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes msg-dots-bounce {
  0%, 80%, 100% { 
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% { 
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Proximity Badges */
.badge-proximity {
  font-size: 0.62rem;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-proximity-local {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

.badge-proximity-nearby {
  background: rgba(52, 152, 219, 0.15);
  border: 1px solid #3498db;
  color: #3498db;
}

.badge-proximity-regional {
  background: rgba(155, 89, 182, 0.15);
  border: 1px solid #9b59b6;
  color: #9b59b6;
}

/* Dev-only Impersonation Control Panel Styles */
.dev-impersonate-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(135, 78, 230, 0.15) !important;
  border: 1px dashed var(--accent-secondary) !important;
  border-radius: var(--border-radius-sm);
  padding: 6px 12px;
  margin-bottom: 8px;
}
.dev-impersonate-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-secondary);
}

/* Hidden message styles for developers */
.msg-bubble-wrap.msg-dev-hidden {
  opacity: 0.5;
  border: 1.5px dashed var(--accent-secondary) !important;
  background: rgba(135, 78, 230, 0.05);
}

/* Soft deleted message styles for developers */
.msg-bubble-wrap.msg-dev-deleted {
  opacity: 0.4;
  border: 1.5px dashed var(--danger-color) !important;
  background: rgba(214, 48, 49, 0.05);
}

/* ==========================================================================
   Phase 26: Message Reply/Quote & Unread Count Badges
   ========================================================================== */

/* Reply Preview Bar (above chat input) */
.reply-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-panel);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: slideUp 0.2s ease-out;
  max-width: 100%;
  overflow: hidden;
}

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

.reply-preview-bar .reply-preview-sender {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1px;
}

.reply-preview-bar .reply-preview-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.reply-preview-bar .reply-preview-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.reply-preview-bar .reply-preview-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--danger-color);
}

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

/* Reply Quote Block (inside message bubbles) */
.msg-reply-quote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  background: rgba(143, 67, 235, 0.08);
  border-left: 2.5px solid var(--accent-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  max-width: 100%;
  overflow: hidden;
}

.msg-reply-quote:hover {
  background: rgba(143, 67, 235, 0.15);
}

.msg-reply-quote .reply-quote-sender {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
}

.msg-reply-quote .reply-quote-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* Unread Count Badge */
.room-link {
  position: relative;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: #fff;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #b44bff 100%);
  border-radius: 10px;
  margin-left: 6px;
  box-shadow: 0 2px 8px var(--accent-glow);
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), heartbeat-glow 2s infinite ease-in-out;
  flex-shrink: 0;
}

.room-link-meta .unread-badge {
  margin-left: 0;
}

@keyframes badgePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Reply button in msg-action-btn row */
.msg-reply-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  opacity: 0.5;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}

.msg-reply-btn:hover {
  opacity: 1;
  color: var(--accent-primary);
  transform: scale(1.15);
}

/* Scroll highlight animation for jumping to replied message */
.msg-highlight-flash {
  animation: highlightFlash 1.5s ease;
}

@keyframes highlightFlash {
  0% {
    background: rgba(143, 67, 235, 0.25);
    box-shadow: 0 0 0 2px var(--accent-primary);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .msg-reply-quote .reply-quote-text {
    max-width: 180px;
  }
  
  .reply-preview-bar {
    padding: 6px 10px;
  }
}

/* ==========================================================================
   Phase 27: Read Receipts & Last Seen Timestamps
   ========================================================================== */

/* Read receipt status indicators */
.msg-read-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  margin-left: 4px;
  letter-spacing: -1px;
  vertical-align: middle;
}

.msg-read-status.sent {
  color: var(--text-secondary);
  opacity: 0.5;
}

.msg-read-status.read {
  color: #00b4d8;
  opacity: 0.9;
}

/* Last seen text */
.last-seen-text {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.7;
}

.last-seen-text.online {
  color: var(--success-color);
  font-style: normal;
  opacity: 1;
  font-weight: 600;
}

/* DM header subtitle for last seen */
.room-header-subtitle {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 1px;
  opacity: 0.7;
  transition: var(--transition-fast);
}

.room-header-subtitle.online {
  color: var(--success-color);
  opacity: 1;
}

/* ==========================================================================
   Phase 28: Smart Scroll & Message Forwarding
   ========================================================================== */

/* New Messages Floating Pill */
.new-messages-pill {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #b44bff 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-glow);
  animation: pillSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.new-messages-pill:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.new-messages-pill:active {
  transform: translateX(-50%) scale(0.97);
}

@keyframes pillSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Forwarded message label */
.msg-forwarded-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.7;
  margin-bottom: 2px;
}

/* Forward room picker */
.forward-room-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px 0;
}

.forward-room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.forward-room-item:hover {
  background: rgba(143, 67, 235, 0.12);
  border-color: var(--accent-primary);
}

.forward-room-item:active {
  transform: scale(0.98);
  transform: scale(0.98);
}

/* ==========================================================================
   Phase 29: Guest UX, Thai Rooms, Browse, Activity, Back Button
   ========================================================================== */

/* Guest badge */
.guest-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

/* Browse Panel */
.browse-panel {
  padding: 12px;
  overflow-y: auto;
  max-height: 100%;
}

.browse-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.browse-search input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

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

.browse-status-filters {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

.browse-status-filter {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.browse-status-filter:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.browse-status-filter.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(230, 28, 93, 0.85), rgba(187, 43, 235, 0.85));
  box-shadow: 0 0 12px rgba(230, 28, 93, 0.2);
}

/* Premium Discovery Toolbar */
.browse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  padding: 12px;
  background: rgba(31, 40, 51, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 12px 12px 0 0;
  margin-bottom: 16px;
}
.browse-toolbar::-webkit-scrollbar {
  display: none;
}

.browse-toolbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  padding: 8px 12px;
  min-width: 65px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.browse-toolbar-btn span.icon {
  font-size: 1.3rem;
  transition: transform var(--transition-fast);
}

.browse-toolbar-btn span.label {
  font-size: 0.72rem;
  font-weight: 500;
}

.browse-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.browse-toolbar-btn:hover span.icon {
  transform: scale(1.15);
}

/* Active themed styles for filter buttons */
.browse-toolbar-btn.filter-female.active {
  background: rgba(230, 28, 93, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(230, 28, 93, 0.25);
  text-shadow: 0 0 5px rgba(230, 28, 93, 0.5);
}

.browse-toolbar-btn.filter-male.active {
  background: rgba(187, 43, 235, 0.12);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
  box-shadow: 0 0 10px rgba(187, 43, 235, 0.25);
  text-shadow: 0 0 5px rgba(187, 43, 235, 0.5);
}

.browse-toolbar-btn.filter-location.active {
  background: rgba(0, 206, 201, 0.12);
  border-color: #00cec9;
  color: #00cec9;
  box-shadow: 0 0 10px rgba(0, 206, 201, 0.25);
  text-shadow: 0 0 5px rgba(0, 206, 201, 0.5);
}

.browse-toolbar-btn.filter-favorites.active {
  background: rgba(255, 118, 117, 0.12);
  border-color: #ff7675;
  color: #ff7675;
  box-shadow: 0 0 10px rgba(255, 118, 117, 0.25);
  text-shadow: 0 0 5px rgba(255, 118, 117, 0.5);
}

.browse-toolbar-btn.filter-search.active {
  background: rgba(253, 203, 110, 0.12);
  border-color: #fdcb6e;
  color: #fdcb6e;
  box-shadow: 0 0 10px rgba(253, 203, 110, 0.25);
}

.browse-toolbar-btn.filter-online.active {
  background: rgba(0, 184, 148, 0.12);
  border-color: #00b894;
  color: #00b894;
  box-shadow: 0 0 10px rgba(0, 184, 148, 0.25);
  text-shadow: 0 0 5px rgba(0, 184, 148, 0.5);
}

.browse-toolbar-btn.filter-refresh:active {
  transform: rotate(180deg) scale(0.9);
}

/* Elegant Dynamic Search Container */
.browse-search-wrapper {
  padding: 0 12px 12px 12px;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Premium 1:1 Aspect Square User Card Grid */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  padding: 0 12px 12px 12px;
}

@media (min-width: 768px) {
  .browse-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }
}

.user-card {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-surface);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Decorative gender-based neon hover border */
.user-card.gender-female:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(230, 28, 93, 0.35);
}

.user-card.gender-male:hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 15px rgba(187, 43, 235, 0.35);
}

.user-card.tier-pro {
  border: 1.5px solid rgba(255, 215, 0, 0.25);
}
.user-card.tier-pro:hover {
  border-color: #FFD700;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
}

.user-card-avatar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  border: none;
  margin: 0;
  transition: transform 0.5s ease;
}

.user-card:hover .user-card-avatar {
  transform: scale(1.06);
}

/* Full bleed bottom gradient overlay */
.user-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  pointer-events: none;
}

.user-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.user-card-bio {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin-bottom: 2px;
}

/* Float status dot and badges */
.user-card-online {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success-color);
  box-shadow: 0 0 8px var(--success-color);
  border: 1.5px solid #000;
  z-index: 2;
}

.badge-proximity-float {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 0.62rem;
  color: #fff;
  padding: 3px 8px;
  z-index: 2;
  font-weight: 600;
}

/* Activity time text */
.activity-time {
  font-size: 0.6rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.6;
}

/* Guest rename input */
.guest-rename-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  align-items: center;
}

.guest-rename-row input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

.guest-rename-row input:focus {
  border-color: var(--accent-primary);
}

.guest-rename-row button {
  padding: 6px 12px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.guest-rename-row button:hover {
  background: var(--accent-hover);
}

/* Browse tab in sidebar */
.sidebar-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-display);
}

.sidebar-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

/* ==========================================================================
   Phase 30: Profile Inspector Mobile Fix & Dev Media Gallery
   ========================================================================== */

/* Mobile Profile Inspector Fix */
@media (max-width: 768px) {
  #modal-view-user .modal-content {
    max-height: 85vh;
    max-height: 85dvh;
    width: 92vw;
    padding: 20px 16px 32px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #modal-view-user .modal-close {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-surface);
    padding: 4px 8px;
    border-radius: 50%;
    float: right;
  }

  /* Also fix edit profile modal on mobile */
  #modal-edit-profile .modal-content,
  #modal-settings .modal-content {
    max-height: 85vh;
    max-height: 85dvh;
    width: 92vw;
    padding: 20px 16px 32px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* Dev Media Gallery */
.dev-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.dev-media-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-fast);
}

.dev-media-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.dev-media-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.03);
}

.dev-media-icon {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.03);
}

.dev-media-info {
  padding: 8px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dev-media-info strong {
  color: var(--text-primary);
  font-size: 0.75rem;
}

.dev-media-badge {
  display: inline-block;
  font-size: 0.55rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(143, 67, 235, 0.15);
  color: var(--accent-primary);
  margin-left: 4px;
}

/* Dev User Stats Panel */
.dev-stats-panel {
  margin-top: 12px;
  padding: 12px;
  background: rgba(143, 67, 235, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.dev-stats-panel h4 {
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: 8px;
  font-weight: 700;
}

.dev-stats-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.dev-stats-row:last-child {
  border-bottom: none;
}

.dev-stats-label {
  color: var(--text-secondary);
}

.dev-stats-value {
  color: var(--text-primary);
  font-weight: 600;
}

.dev-stats-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.dev-stats-section-title {
  font-size: 0.72rem;
  color: var(--accent-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.dev-stats-ip-list {
  font-size: 0.65rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Dev media gallery pagination */
.dev-media-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}

.dev-media-pagination button {
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.dev-media-pagination button:hover {
  border-color: var(--accent-primary);
}

.dev-media-pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Custom slider styles for volume range input */
.custom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  outline: none;
  transition: opacity .2s;
}

.custom-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: var(--bg-input);
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 6px var(--accent-glow);
  transition: transform 0.1s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent-primary-hover);
}


.verification-camera-preview {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: scaleX(-1);
  background: #000;
  margin: 10px auto;
}

.verification-preview-image {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  margin: 8px auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

@keyframes background-motion {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse-neon {
  0%, 100% {
    box-shadow: 0 0 10px rgba(230, 28, 93, 0.1), inset 0 0 10px rgba(230, 28, 93, 0.05);
    border-color: rgba(230, 28, 93, 0.15);
  }
  50% {
    box-shadow: 0 0 20px rgba(230, 28, 93, 0.3), inset 0 0 15px rgba(230, 28, 93, 0.1);
    border-color: var(--accent-primary);
  }
}

@keyframes heartbeat-glow {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px var(--accent-glow));
    opacity: 0.85;
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--accent-primary));
    opacity: 1;
  }
}

@keyframes radar-scan {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
    box-shadow: 0 0 0 0 rgba(230, 28, 93, 0.4), 0 0 0 0 rgba(187, 43, 235, 0.3);
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
    box-shadow: 0 0 0 40px rgba(230, 28, 93, 0), 0 0 0 60px rgba(187, 43, 235, 0);
  }
}

.onboarding-card {
  animation: floatIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards, pulse-neon 4s infinite ease-in-out;
}

/* Pulsing Online User Badge */
.pulse-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  margin-right: 6px;
  animation: heartbeat-glow 2s infinite ease-in-out;
}

/* Avatar Presets Grid Layout */
.avatar-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
  padding: 4px;
}

.avatar-preset-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.avatar-preset-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.avatar-preset-item img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: box-shadow 0.2s ease;
}

.avatar-preset-item.selected {
  border-color: var(--accent-primary);
  background: rgba(230, 28, 93, 0.08);
  box-shadow: 0 0 10px rgba(230, 28, 93, 0.3);
  transform: scale(1.03);
}

.avatar-preset-name {
  font-size: 0.7rem;
  margin-top: 6px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.avatar-preset-tag {
  font-size: 0.55rem;
  color: var(--text-secondary);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Adjustments for mobile viewports */
@media (max-width: 480px) {
  .avatar-presets-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .avatar-preset-item {
    padding: 6px;
  }
  .avatar-preset-item img {
    width: 36px;
    height: 36px;
  }
  .avatar-preset-name {
    font-size: 0.6rem;
  }
}

/* =========================================================================
   Wall / Timeline Mode
   ========================================================================= */
.wall-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.wall-timeline.hidden {
  display: none;
}

.wall-compose {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wall-compose.is-submitting {
  border-color: var(--accent-primary-40);
}

.wall-compose.is-submitting textarea,
.wall-compose.is-submitting #btn-wall-attach {
  opacity: 0.72;
}

.wall-compose textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  font-size: 0.9rem;
}

.wall-compose-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

#btn-wall-submit.is-loading {
  opacity: 0.82;
  cursor: wait;
}

.wall-chat-start-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(230, 28, 93, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.wall-chat-start-panel.hidden {
  display: none;
}

.wall-chat-start-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wall-chat-start-label {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.wall-chat-start-hint {
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.35;
}

.wall-chat-start-chips {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.wall-chat-start-chips::-webkit-scrollbar {
  display: none;
}

.wall-posts-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wall-post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  transition: var(--transition-fast);
  position: relative;
}

.wall-post-card:hover {
  border-color: var(--accent-primary-40);
  box-shadow: 0 4px 20px rgba(143, 67, 235, 0.08);
}

.wall-post-card.pinned {
  border-left: 3px solid var(--accent-primary);
}

.wall-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wall-post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border-color);
  transition: var(--transition-fast);
}

.wall-post-avatar:hover {
  border-color: var(--accent-primary);
}

.wall-post-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.wall-post-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.wall-post-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 12px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.wall-post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  margin-bottom: 12px;
  cursor: pointer;
}

.wall-post-actions {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.wall-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.wall-action-btn:hover {
  background: rgba(143, 67, 235, 0.1);
  color: var(--accent-primary);
}

.wall-action-btn.liked {
  color: #ff4757;
}

.wall-action-btn .wall-action-count {
  font-weight: 600;
}

/* Wall Comments Thread */
.wall-comments-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wall-comment {
  display: flex;
  gap: 8px;
  padding: 6px 0;
}

.wall-comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
}

.wall-comment-body {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 6px 10px;
}

.wall-comment-author {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.wall-comment-text {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.4;
}

.wall-comment-time {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 2px;
}

.wall-comment-input-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.wall-comment-input-row.is-submitting {
  opacity: 0.82;
}

.wall-comment-input-row input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.82rem;
}

.wall-comment-input-row button {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
}

.wall-comment-submit-btn.is-loading {
  cursor: wait;
  opacity: 0.8;
}

.wall-load-more {
  padding: 8px 0;
}

.wall-load-more.hidden {
  display: none;
}

.wall-load-more.is-loading #btn-wall-load-more {
  opacity: 0.75;
  cursor: wait;
}

#section-feedback.is-submitting {
  opacity: 0.92;
}

.onboarding-form.is-submitting {
  opacity: 0.92;
}

#form-upgrade.is-submitting {
  opacity: 0.92;
}

#form-edit-profile.is-submitting {
  opacity: 0.92;
}

.verification-box.is-submitting {
  opacity: 0.92;
}

#btn-submit-login.is-loading,
#btn-submit-register.is-loading,
#btn-submit-forgot-request.is-loading,
#btn-submit-forgot-reset.is-loading,
#btn-submit-upgrade.is-loading,
#btn-submit-edit-profile.is-loading,
#btn-submit-verification.is-loading {
  opacity: 0.8;
  cursor: wait;
}

#btn-submit-feedback.is-loading {
  opacity: 0.8;
  cursor: wait;
}

#form-file-report.is-submitting {
  opacity: 0.92;
}

#btn-submit-report.is-loading {
  opacity: 0.8;
  cursor: wait;
}

.wall-post-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.4;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}

.wall-post-delete-btn:hover {
  opacity: 1;
  color: #ff4757;
}

@media (max-width: 600px) {
  .wall-timeline {
    padding: 10px;
    gap: 10px;
  }
  .wall-compose {
    padding: 12px;
  }
  .wall-post-card {
    padding: 12px;
  }
}

/* Interactive Vibe Poll Styles */
.poll-opt-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  outline: none;
}

.poll-opt-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(230, 28, 93, 0.25);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.poll-opt-btn:active {
  transform: translateY(0);
}

/* Vibe Share Styles */
.vibe-share-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  user-select: none;
}

.vibe-share-checkbox-label:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(187, 43, 235, 0.25);
  color: var(--text-primary);
}

.vibe-share-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Profile Tag Styling */
.tag-suggest-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-suggest-chip:hover {
  background: rgba(143, 67, 235, 0.15);
  border-color: var(--accent-primary);
  color: var(--text-main);
  transform: translateY(-1px);
}

.profile-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(143, 67, 235, 0.1);
  border: 1px solid rgba(143, 67, 235, 0.2);
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 14px;
}

.profile-tag-chip.private {
  background: rgba(255, 117, 140, 0.1);
  border-color: rgba(255, 117, 140, 0.2);
}

.profile-tag-chip .btn-delete-tag {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.profile-tag-chip .btn-delete-tag:hover {
  color: var(--danger-color);
}

/* ==========================================================================
   Phase 49: Tag-Based Engagement & Friend Discovery
   ========================================================================== */

/* Browse Tabs (All / Suggested) */
.browse-tab {
  padding: 6px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.browse-tab:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.browse-tab.active {
  background: linear-gradient(135deg, var(--accent-primary), #b44bff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Vibe Match Badge */
.vibe-match-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: #FFD700;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(255, 215, 0, 0.1));
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 12px;
  letter-spacing: 0.3px;
  animation: vibeGlow 2s ease-in-out infinite;
}

@keyframes vibeGlow {
  0%, 100% {
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.15);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
  }
}

/* ==========================================================================
   Phase 50: Doobot Erotic Story Mode
   ========================================================================== */

/* Story Mode Container */
.story-mode-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 107, 0, 0.05);
  border-bottom: 1px solid rgba(255, 107, 0, 0.1);
  flex-wrap: wrap;
}

/* Story Mode Toggle Button */
.story-mode-toggle {
  padding: 5px 14px;
  border: 1px solid rgba(255, 107, 0, 0.3);
  border-radius: 20px;
  background: rgba(255, 107, 0, 0.08);
  color: #FF6B35;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.story-mode-toggle:hover {
  background: rgba(255, 107, 0, 0.15);
  border-color: #FF6B35;
  transform: scale(1.03);
}

.story-mode-toggle.active {
  background: linear-gradient(135deg, #FF6B35, #FF3D00);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(255, 107, 0, 0.35);
  animation: storyPulse 2s ease-in-out infinite;
}

@keyframes storyPulse {
  0%, 100% {
    box-shadow: 0 2px 10px rgba(255, 107, 0, 0.25);
  }
  50% {
    box-shadow: 0 2px 18px rgba(255, 107, 0, 0.5);
  }
}

/* Category Picker */
.story-category-picker {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.story-category-picker::-webkit-scrollbar {
  display: none;
}

.story-category-picker.hidden {
  display: none;
}

.story-category-btn {
  padding: 4px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.story-category-btn:hover {
  border-color: #FF6B35;
  color: #FF6B35;
  background: rgba(255, 107, 0, 0.08);
}

.story-category-btn.active,
.story-companion-btn.active {
  border-color: #FF6B35;
  background: rgba(255, 107, 0, 0.16);
  color: #FF6B35;
  box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.18);
}

.story-picker-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0 2px;
}

.story-new-btn {
  border-color: rgba(0, 200, 83, 0.3);
  color: var(--success-color);
}

.story-new-btn:hover {
  background: rgba(0, 200, 83, 0.08);
  border-color: var(--success-color);
}

.story-new-btn.hidden,
.story-off-btn.hidden {
  display: none;
}

.story-off-btn {
  border-color: rgba(255, 59, 48, 0.3);
  color: var(--danger-color);
}

.story-off-btn:hover {
  background: rgba(255, 59, 48, 0.08);
  border-color: var(--danger-color);
}

/* Disclaimer Banner */
.story-disclaimer-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.12), rgba(255, 59, 48, 0.08));
  border-bottom: 1px solid rgba(255, 107, 0, 0.15);
  color: #FF6B35;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.3px;
  animation: disclaimerFadeIn 0.3s ease;
}

@keyframes disclaimerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .story-mode-container {
    padding: 4px 8px;
    gap: 6px;
  }

  .story-mode-toggle {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  .story-category-btn {
    font-size: 0.65rem;
    padding: 3px 10px;
  }
}

.bot-whisper-voice-note {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 6px;
  width: fit-content;
  margin-top: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 107, 0, 0.28);
  border-radius: 999px;
  background: rgba(255, 107, 0, 0.08);
  color: #ffb18c;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

.bot-whisper-voice-note:hover:not(:disabled) {
  border-color: rgba(255, 107, 0, 0.58);
  background: rgba(255, 107, 0, 0.14);
  color: #ffe0d2;
  transform: translateY(-1px);
}

.bot-whisper-voice-note:disabled,
.bot-whisper-voice-note.disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.bot-whisper-voice-note.playing {
  border-color: rgba(255, 107, 0, 0.72);
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.22), rgba(187, 43, 235, 0.16));
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.22);
}

.bot-whisper-icon,
.bot-whisper-label {
  flex: 0 0 auto;
}

.bot-whisper-bars {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 11px;
}

.bot-whisper-bars span {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.55;
}

.bot-whisper-voice-note.playing .bot-whisper-bars span {
  animation: botWhisperBars 0.72s ease-in-out infinite;
}

.bot-whisper-voice-note.playing .bot-whisper-bars span:nth-child(2) {
  animation-delay: 0.12s;
}

.bot-whisper-voice-note.playing .bot-whisper-bars span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes botWhisperBars {
  0%, 100% {
    height: 4px;
    opacity: 0.5;
  }
  50% {
    height: 11px;
    opacity: 1;
  }
}

/* ==========================================================================
   Vibe Match CTA — Premium Redesign
   ========================================================================== */

.vibe-match-cta {
  padding: 10px 14px 6px;
}

.vibe-match-trigger-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    rgba(187, 43, 235, 0.12) 0%,
    rgba(230, 28, 93, 0.10) 50%,
    rgba(108, 92, 231, 0.14) 100%);
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
  box-shadow:
    0 0 0 1px rgba(187, 43, 235, 0.2),
    0 2px 12px rgba(187, 43, 235, 0.08);
}

/* Animated shimmer sweep */
.vibe-match-trigger-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  animation: vibeShimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes vibeShimmer {
  0% { left: -100%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

/* Animated border glow */
.vibe-match-trigger-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1.5px;
  background: linear-gradient(135deg,
    rgba(187, 43, 235, 0.5),
    rgba(230, 28, 93, 0.4),
    rgba(108, 92, 231, 0.5),
    rgba(187, 43, 235, 0.5));
  background-size: 300% 300%;
  animation: vibeBorderGlow 5s ease infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes vibeBorderGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.vibe-match-trigger-card:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 0 0 1px rgba(187, 43, 235, 0.35),
    0 4px 20px rgba(187, 43, 235, 0.18);
}

.vibe-match-trigger-card:active {
  transform: scale(0.97);
  box-shadow:
    0 0 0 1.5px rgba(230, 28, 93, 0.5),
    0 1px 6px rgba(187, 43, 235, 0.15);
  transition: transform 0.06s ease;
}

/* Orb icon with glow ring */
.vibe-match-icon-ring {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(187, 43, 235, 0.2) 0%,
    transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vibe-match-icon-ring::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid rgba(187, 43, 235, 0.3);
  animation: vibeRingPulse 3s ease-in-out infinite;
}

@keyframes vibeRingPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
    border-color: rgba(187, 43, 235, 0.3);
  }
  50% {
    transform: scale(1.12);
    opacity: 0.9;
    border-color: rgba(230, 28, 93, 0.5);
  }
}

.vibe-match-orb {
  font-size: 1.4rem;
  line-height: 1;
  animation: vibeOrbFloat 3s ease-in-out infinite;
}

@keyframes vibeOrbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* CTA text */
.vibe-match-cta-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.vibe-match-cta-text strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.vibe-match-cta-text span {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.2;
  opacity: 0.85;
}

/* Arrow indicator */
.vibe-match-arrow {
  font-size: 1.4rem;
  font-weight: 300;
  color: rgba(187, 43, 235, 0.5);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.vibe-match-trigger-card:hover .vibe-match-arrow {
  transform: translateX(3px);
  color: rgba(230, 28, 93, 0.7);
}

/* Mobile touch */
@media (max-width: 768px) {
  .vibe-match-cta {
    padding: 8px 10px 4px;
  }

  .vibe-match-trigger-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .vibe-match-icon-ring {
    width: 34px;
    height: 34px;
  }

  .vibe-match-orb {
    font-size: 1.2rem;
  }

  .vibe-match-cta-text strong {
    font-size: 0.82rem;
  }

  .vibe-match-cta-text span {
    font-size: 0.64rem;
  }
}

/* Mood button haptic feedback */
.vibe-mood-btn:active {
  transform: scale(0.96) !important;
  transition: transform 0.06s ease !important;
}

/* ==========================================================================
   Connection Status Banner & Offline Recovery UI
   ========================================================================== */

.connection-status-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 20px;
  background: rgba(30, 10, 10, 0.9);
  border-bottom: 2px solid #ff3b30;
  color: #ff4d4d;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(255, 59, 48, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateY(0);
}

.connection-status-banner.hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.connection-status-banner .warning-icon {
  animation: warningPulse 1.5s infinite ease-in-out;
  font-size: 1.1rem;
}

@keyframes warningPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* ==========================================================================
   Phase 72: UI Revamp & Sleek Rename UX Styles
   ========================================================================== */

.chatbox-tabs {
  display: flex;
  background: rgba(10, 10, 15, 0.4);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}

.chatbox-tab {
  flex: 1;
  padding: 14px 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
}

.chatbox-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.chatbox-tab.active {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  border-bottom: 2px solid var(--accent-primary);
  text-shadow: 0 0 10px rgba(108, 92, 231, 0.4);
}

.chat-tab-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  gap: 20px;
  min-height: 0;
}

.chat-tab-section.hidden {
  display: none !important;
}

.username-display-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.btn-icon-inline {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-inline:hover {
  opacity: 1;
  transform: scale(1.15);
}

.inline-rename-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
  max-width: 220px;
}

.inline-rename-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  outline: none;
  min-height: unset;
}

.inline-rename-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

.btn-action-inline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-action-inline:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* ==========================================================================
   Phase 74: Games Section Collection
   ========================================================================== */

.games-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(187, 43, 235, 0.35);
}

.games-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-bottom: 24px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.game-card {
  padding: 24px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(187, 43, 235, 0.4);
  box-shadow: 0 8px 30px rgba(187, 43, 235, 0.15);
}

.game-card-icon {
  font-size: 3rem;
  line-height: 1;
}

.game-card-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.game-card-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0;
}

.game-card-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.btn-play-game {
  margin-top: 10px;
  align-self: center;
  width: 100%;
  max-width: 200px;
}

/* Active game screen styling */
:root {
  --active-game-viewport-height: 70vh;
}

#active-game-container {
  width: 100%;
  height: var(--active-game-viewport-height, 70vh);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: min(500px, calc(100dvh - 180px));
}

@media (min-width: 900px) {
  #active-game-container {
    height: min(760px, var(--active-game-viewport-height, 70vh));
  }
}

.active-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

#active-game-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(187, 43, 235, 0.3);
}

#game-frame {
  width: 100%;
  height: calc(var(--active-game-viewport-height, 70vh) - 64px);
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  min-height: min(360px, calc(100dvh - 240px));
  aspect-ratio: 16 / 9;
}

/* ==========================================================================
   Phase 72: Message Delivery Status Indicators & Retry on Failure
   ========================================================================== */

/* Delivery status container — appended to own messages only */
.msg-delivery-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 0.62rem;
  font-family: var(--font-display);
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.3s ease;
}

/* Sending state — subtle animated dot */
.msg-delivery-status.sending {
  color: var(--text-secondary);
  opacity: 0.6;
}

.msg-delivery-sending-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: deliveryPulse 1.2s ease-in-out infinite;
}

@keyframes deliveryPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Sent state — subtle gray checkmark */
.msg-delivery-status.sent {
  color: var(--text-secondary);
  opacity: 0.45;
}

.msg-delivery-status.sent .msg-delivery-icon {
  font-size: 0.7rem;
  letter-spacing: -2px;
}

/* Failed state — red warning with retry tap target */
.msg-delivery-status.failed {
  color: var(--danger-color);
  opacity: 1;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(214, 48, 49, 0.08);
  border: 1px solid rgba(214, 48, 49, 0.2);
  transition: all 0.2s ease;
}

.msg-delivery-status.failed:hover {
  background: rgba(214, 48, 49, 0.15);
  border-color: rgba(214, 48, 49, 0.4);
}

.msg-delivery-status.failed:active {
  transform: scale(0.96);
}

.msg-delivery-status.failed .msg-delivery-icon {
  font-size: 0.72rem;
}

.msg-delivery-retry-label {
  font-weight: 600;
  font-size: 0.6rem;
}

/* Fade-in animation for status transitions */
@keyframes deliveryStatusFadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-delivery-status.sent,
.msg-delivery-status.failed {
  animation: deliveryStatusFadeIn 0.25s ease-out;
}

/* Ensure delivery status aligns correctly inside msg-body */
.msg-bubble-wrap.me .msg-body .msg-delivery-status {
  align-self: flex-end;
}

/* Mobile touch-friendly sizing for retry button */
@media (max-width: 768px) {
  .msg-delivery-status.failed {
    padding: 5px 10px;
    min-height: 28px;
  }
}

/* ==========================================================================
   Phase 78: Media Lightbox & Image Preview Overlay
   ========================================================================== */

/* Root overlay — fullscreen modal */
.media-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: lightboxFadeIn 0.25s ease-out;
}

.media-lightbox-overlay.hidden {
  display: none !important;
}

.media-lightbox-overlay.closing {
  animation: lightboxFadeOut 0.2s ease-in forwards;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lightboxFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Darkened backdrop with blur */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Top toolbar — sender info + action buttons */
.lightbox-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
}

/* Sender avatar + name/time */
.lightbox-sender-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-sender-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(108, 92, 231, 0.3);
}

.lightbox-sender-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.lightbox-sender-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.2px;
}

.lightbox-sender-time {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Action buttons (zoom, download, close) */
.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-action-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}

.lightbox-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.lightbox-action-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-close-btn {
  font-size: 1.5rem;
  font-weight: 300;
  background: rgba(214, 48, 49, 0.12);
  border-color: rgba(214, 48, 49, 0.25);
  color: #ff6b6b;
}

.lightbox-close-btn:hover {
  background: rgba(214, 48, 49, 0.25);
  border-color: rgba(214, 48, 49, 0.5);
  color: #ff4757;
}

/* Main content area — image/video */
.lightbox-content-area {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 60px 50px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.lightbox-content-area:active {
  cursor: grabbing;
}

.lightbox-content-area img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-content-area video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.5);
}

/* Navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  left: 8px;
}

.lightbox-nav.lightbox-nav-right {
  left: auto;
  right: 8px;
}

.lightbox-nav.hidden {
  display: none !important;
}

.lightbox-nav-btn {
  width: 44px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 2rem;
  font-weight: 200;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.06);
}

.lightbox-nav-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.15);
}

/* Media counter badge (e.g. "2 / 5") */
.lightbox-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 5px 16px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-counter.hidden {
  display: none !important;
}

/* Clickable chat images — cursor hint */
.chat-image-embed {
  cursor: pointer;
}

.wall-post-image {
  cursor: pointer;
}

/* Image zoom scale animation */
@keyframes lightboxZoomBounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .chat-starter-dock {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin: 0 4px 8px;
  }

  .chat-starter-chip-row {
    width: 100%;
  }

  .chat-starter-chip,
  .wall-chat-start-chip {
    max-width: 82vw;
  }

  .wall-chat-start-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .wall-chat-start-chips {
    justify-content: flex-start;
    width: 100%;
  }

  .lightbox-toolbar {
    padding: 10px 14px;
  }

  .lightbox-sender-avatar {
    width: 30px;
    height: 30px;
  }

  .lightbox-sender-name {
    font-size: 0.8rem;
  }

  .lightbox-action-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .lightbox-content-area {
    padding: 56px 16px;
  }

  .lightbox-nav-btn {
    width: 36px;
    height: 52px;
    font-size: 1.5rem;
    border-radius: 10px;
  }

  .lightbox-counter {
    bottom: 12px;
    font-size: 0.7rem;
    padding: 4px 12px;
  }
}

/* Vibe Streaks Badges */
.msg-badge-streak {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  background: linear-gradient(135deg, #ff7675 0%, #fdcb6e 100%);
  color: #fff !important;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(253, 203, 110, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Unified Chat Input Bar */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.chat-input-bar .message-input-field {
  background: transparent;
  border: none;
  padding: 8px 4px;
  font-size: 0.9rem;
  color: var(--text-primary);
  min-height: 24px;
  max-height: 120px;
  line-height: 1.4;
  flex: 1;
}

.chat-input-bar .message-input-field:focus {
  background: transparent;
  border: none;
  box-shadow: none;
}

.input-action-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.05);
}

.attachments-flyout {
  background: var(--bg-panel-solid) !important;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: floatIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.flyout-item-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--accent-primary) !important;
}

.action-btn-dynamic {
  background: var(--accent-primary) !important;
  color: #000 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.action-btn-dynamic.mic-mode {
  background: var(--accent-secondary) !important;
  box-shadow: 0 0 12px rgba(0, 210, 252, 0.3) !important;
}

.action-btn-dynamic.mic-mode.recording {
  background: var(--danger-color) !important;
  color: #fff !important;
  animation: pulse-glow 1s infinite alternate;
  box-shadow: 0 0 16px var(--danger-color) !important;
  transform: scale(1.1);
}

@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 107, 107, 0.5); }
  100% { transform: scale(1.08); box-shadow: 0 0 18px rgba(255, 107, 107, 0.8); }
}

.inline-recording-overlay {
  animation: floatIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.recording-cancel-hint {
  font-family: var(--font-display);
}

/* ===== Progressive disclosure: advanced / power-user controls ===== */
/* Power tools stay hidden until the user enables Advanced mode. They remain
   role-gated by their own .hidden logic, so non-privileged users never see them. */
body:not(.advanced-mode) .power-tool { display: none !important; }

#btn-toggle-advanced.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* ===== Room context chip in the chat presence bar ("where am I") ===== */
.presence-room-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.presence-room-name:empty { display: none; }

/* ===== Simpler "My Rooms" by default =====
   When the tools drawer is collapsed (the default), keep room rows clean —
   just the name, unread badge and time. The per-row quick actions (copy,
   favorite, mute, snooze, share) return as soon as the tools drawer is opened. */
.room-list-tools-collapsed .room-copy-name-btn,
.room-list-tools-collapsed .room-favorite-btn,
.room-list-tools-collapsed .room-mute-btn,
.room-list-tools-collapsed .room-snooze-btn,
.room-list-tools-collapsed .room-share-link-btn,
.room-list-tools-collapsed .room-copy-link-btn {
  display: none;
}

/* ===== Admin user-management stats console ===== */
.admin-user-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.admin-stat-loading { grid-column: 1 / -1; color: var(--text-secondary); font-size: 0.85rem; padding: 8px 0; }

.admin-table-loading-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-user-stats-loading-state {
  grid-column: 1 / -1;
}
.admin-stat-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-stat-card.is-highlight {
  border-color: var(--accent-primary);
  background: rgba(230, 28, 93, 0.08);
}
.admin-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.admin-stat-card.is-highlight .admin-stat-value { color: var(--accent-primary); }
.admin-stat-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.admin-stat-sub { font-size: 0.68rem; color: var(--text-secondary); opacity: 0.8; }
.admin-user-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  border: 1px solid var(--border-color); color: var(--text-secondary);
}
.admin-user-badge.test { color: #ffb86b; border-color: rgba(255,184,107,0.4); background: rgba(255,184,107,0.1); }
.admin-user-badge.bot { color: #74b9ff; border-color: rgba(116,185,255,0.4); background: rgba(116,185,255,0.1); }

/* admin extra: 7-day trend + top tags */
.admin-user-extra { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-trend, .admin-toptags { display: flex; flex-direction: column; gap: 6px; }
.admin-trend-title, .admin-toptags-title { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.admin-trend-bars { display: flex; align-items: flex-end; gap: 5px; height: 44px; padding-top: 14px; }
.admin-trend-bar { width: 16px; background: var(--accent-primary); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: 0.85; }
.admin-trend-count { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 0.6rem; color: var(--text-secondary); }
.admin-toptags-chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 360px; }
.admin-toptag-chip { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-secondary); }
.admin-toptag-chip b { color: var(--accent-primary); margin-left: 3px; }
