@font-face {
  font-family: 'Vazir';
  src: url('../font/Vazir.eot');
  src: url('../font/Vazir.eot?#iefix') format('embedded-opentype'),
       url('../font/Vazir.woff') format('woff'),
       url('../font/Vazir.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0e1621;
  --bg-soft: #17212b;
  --surface: rgba(23, 33, 43, 0.92);
  --surface-strong: #1f2c38;
  --surface-dark: #0e1621;
  --text: #eef6fd;
  --text-secondary: #c8d6e2;
  --muted: #8ea2b3;
  --primary: #54a9eb;
  --primary-soft: rgba(84, 169, 235, 0.15);
  --primary-strong: #2f8dd6;
  --secondary: #0ea5a4;
  --accent: #ff9f43;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --info: #0ea5e9;
  --info-soft: rgba(14, 165, 233, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.24);
  --shadow-card: 0 22px 44px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 32px 64px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 6px;
  --container: min(1200px, calc(100vw - 32px));
  --transition: 220ms ease;
  --transition-fast: 150ms ease;
  --focus-ring: 0 0 0 0.25rem rgba(84, 169, 235, 0.3);
  --surface-hover: rgba(31, 44, 56, 0.98);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

body {
  direction: rtl;
  font-family: 'Vazir', Tahoma, sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(84, 169, 235, 0.2), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(47, 141, 214, 0.13), transparent 30rem),
    linear-gradient(135deg, #09111b 0%, #0e1621 42%, #101c29 100%);
  height: 100%;
  min-height: 100vh;
  min-width: 320px;
  line-height: 1.75;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  display: none;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: inherit;
}

.container,
.container-fluid,
.page-shell,
.app-shell {
  width: var(--container);
  max-width: var(--container);
}

.text-muted,
.form-text,
.section-subtitle,
.muted {
  color: var(--muted) !important;
}

/* ══════════════════════════════════════════════════
   Navbar
   ══════════════════════════════════════════════════ */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.app-navbar .container,
.app-navbar .container-fluid {
  position: relative;
}

.app-navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  box-shadow: 0 16px 30px rgba(15, 98, 254, 0.22);
  font-size: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-mark:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 30px rgba(84, 169, 235, 0.35);
}

.navbar-toggler {
  border: 0;
  box-shadow: none !important;
  transition: opacity var(--transition-fast);
}

.navbar-toggler:not(.collapsed) {
  opacity: 0.8;
}

.nav-pills-soft,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar-user {
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ══════════════════════════════════════════════════
   Hero sections
   ══════════════════════════════════════════════════ */
.hero-panel,
.auth-hero,
.page-hero,
.chat-hero,
.account-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 26%),
    linear-gradient(135deg, #0f172a 0%, #153e8c 48%, #0ea5a4 100%);
  color: #fff;
  border-radius: calc(var(--radius-lg) + 4px);
  padding: clamp(1.1rem, 2vw, 1.7rem);
  box-shadow: var(--shadow);
}

.hero-panel::after,
.auth-hero::after,
.page-hero::after,
.chat-hero::after,
.account-hero::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  top: -80px;
  left: -50px;
  pointer-events: none;
}

.hero-title {
  font-size: clamp(1.5rem, 2vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.hero-copy {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.82);
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════
   Cards — dark theme
   ══════════════════════════════════════════════════ */
.glass-card,
.app-card,
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card {
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: rgba(84, 169, 235, 0.16);
}

.card-header {
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 1rem 1.25rem;
  font-weight: 700;
}

.card-body {
  padding: 1.25rem;
}

.card-glass {
  background: rgba(23, 33, 43, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card-flat {
  background: rgba(23, 33, 43, 0.5);
  border-color: transparent;
  box-shadow: none;
}

.card-flat:hover {
  background: rgba(23, 33, 43, 0.7);
  transform: none;
}

.surface-dark {
  background: var(--surface-dark);
  color: #fff;
}

.surface-gradient {
  background: linear-gradient(135deg, rgba(84, 169, 235, 0.12), rgba(14, 165, 164, 0.08));
}

.soft-section {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(23, 33, 43, 0.5);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.section-subtitle {
  font-size: 0.88rem;
}

/* ══════════════════════════════════════════════════
   Stat cards — dark theme
   ══════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(23, 33, 43, 0.7);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.stat-card:hover {
  background: rgba(23, 33, 43, 0.9);
  transform: translateY(-1px);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: auto auto -32px -18px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(84, 169, 235, 0.16), transparent 68%);
  pointer-events: none;
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════
   Form controls — dark theme
   ══════════════════════════════════════════════════ */
.form-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.form-control,
.form-select,
textarea.form-control,
input.form-control {
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: rgba(23, 33, 43, 0.8);
  color: var(--text);
  padding: 0.85rem 1rem;
  font-size: 0.94rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

textarea.form-control {
  min-height: 130px;
  resize: vertical;
}

.form-control:hover,
.form-select:hover {
  border-color: rgba(84, 169, 235, 0.3);
  background: rgba(23, 33, 43, 0.9);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  background: rgba(23, 33, 43, 0.95);
  color: var(--text);
}

.form-control::placeholder {
  color: rgba(142, 162, 179, 0.6);
}

input[type="file"].form-control {
  padding: 0.75rem 0.9rem;
}

textarea.form-control.form-control-compact {
  min-height: 56px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238ea2b3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  background-size: 16px 12px;
  appearance: none;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  margin-bottom: 0;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(23, 33, 43, 0.5);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.form-check:hover {
  background: rgba(23, 33, 43, 0.7);
  border-color: var(--border-strong);
}

.form-check-input {
  float: none;
  margin: 0;
  border-color: rgba(84, 169, 235, 0.3);
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  background-color: transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  box-shadow: var(--focus-ring);
  border-color: var(--primary);
}

.form-check-label {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.form-control:disabled,
.form-select:disabled {
  cursor: not-allowed;
  filter: saturate(0.6);
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════
   Buttons
   ══════════════════════════════════════════════════ */
.btn {
  --bs-btn-font-size: 0.92rem;
  --bs-btn-font-weight: 700;
  --bs-btn-border-radius: 16px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.15rem;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), background var(--transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  border: 0;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

.btn-primary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-secondary,
.btn-info {
  border: 0;
  box-shadow: 0 16px 24px rgba(15, 23, 42, 0.12);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4389ff);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5cb3ff, #4a94ff);
  box-shadow: 0 16px 28px rgba(84, 169, 235, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
}

.btn-success:hover {
  background: linear-gradient(135deg, #06b17a, #16d092);
  box-shadow: 0 16px 28px rgba(16, 185, 129, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ff9f43, #f59e0b);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ff4d4d, #ef4444);
  box-shadow: 0 16px 28px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #475569, #64748b);
}

.btn-info {
  background: linear-gradient(135deg, #0891b2, #0ea5e9);
  color: #fff;
}

.btn-outline-light,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
  border-width: 1px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.04);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger);
}

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

.btn-outline-secondary {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

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

.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
  filter: saturate(0.6);
  opacity: 0.6;
}

.btn-sm,
.btn-group-sm > .btn {
  min-height: 36px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 12px;
}

.btn-xs {
  min-height: 30px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  border-radius: 10px;
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transform: none;
}

/* ══════════════════════════════════════════════════
   Badges
   ══════════════════════════════════════════════════ */
.badge {
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font-weight: 700;
  font-size: 0.78rem;
}

/* ══════════════════════════════════════════════════
   Alerts
   ══════════════════════════════════════════════════ */
.alert {
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.1rem;
}

.alert.fade {
  transition: opacity 240ms ease, transform 240ms ease;
  transform: translateY(-6px);
}

/* ══════════════════════════════════════════════════
   Tables — dark
   ══════════════════════════════════════════════════ */
.table-responsive {
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  margin-bottom: 0;
  color: var(--text) !important;
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  background: transparent;
  border-bottom-color: var(--border);
  padding: 1rem 0.9rem;
}

.table td[data-label] {
  position: relative;
}

.table thead th,
.table tr:first-child th {
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 2px solid var(--border-strong);
}

.table-hover tbody tr,
.table-hover tr {
  transition: background-color var(--transition), transform var(--transition);
}

.table-hover tbody tr:hover,
.table-hover tr:hover {
  background-color: rgba(84, 169, 235, 0.06);
}

/* ══════════════════════════════════════════════════
   List items
   ══════════════════════════════════════════════════ */
.list-card {
  display: grid;
  gap: 1rem;
}

.room-entry,
.user-directory-item {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(23, 33, 43, 0.5);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background-color var(--transition);
}

.room-entry:hover,
.user-directory-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(84, 169, 235, 0.18);
  background: rgba(23, 33, 43, 0.7);
}

.room-entry-meta,
.user-directory-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.room-entry-actions,
.user-directory-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════
   Layout
   ══════════════════════════════════════════════════ */
.sidebar-stack {
  display: grid;
  gap: 1rem;
}

.page-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.account-layout {
  grid-template-columns: 340px minmax(0, 1fr);
}

.search-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px;
  gap: 0.85rem;
  align-items: center;
}

.stack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.chat-status-panel {
  display: grid;
  gap: 0.8rem;
}

.chat-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.78rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}

.composer-aside {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-meta-pill {
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: var(--primary-soft);
  border: 1px solid rgba(84, 169, 235, 0.1);
}

.footer-shell {
  color: var(--muted);
  padding: 1.25rem 0 2rem;
  text-align: center;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.1fr minmax(320px, 480px);
  gap: 1.5rem;
  align-items: stretch;
}

.auth-card {
  padding: 1.5rem;
}

.auth-bullet-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.auth-bullet {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
}

.auth-bullet-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.otp-box {
  text-align: center;
  letter-spacing: 0.55rem;
  font-size: 1.4rem;
  font-weight: 800;
  direction: ltr;
}

.profile-shell,
.chat-shell,
.account-shell {
  width: var(--container);
  max-width: var(--container);
}

.profile-card,
.stats-card,
.info-card,
.chat-panel,
.chat-meta-card,
.message-composer {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

/* ══════════════════════════════════════════════════
   Avatars
   ══════════════════════════════════════════════════ */
.avatar-badge,
.chat-avatar,
.account-avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-badge img,
.chat-avatar img,
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 0.95rem;
}

.avatar-xs {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.8rem;
}

.avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  font-size: 2rem;
}

.avatar-circle {
  border-radius: 50%;
}

/* ══════════════════════════════════════════════════
   Chat containers — dark
   ══════════════════════════════════════════════════ */
.chat-container,
#privateChatBox,
#chatcontainer {
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 164, 0.06), transparent 28%),
    radial-gradient(circle at bottom left, rgba(84, 169, 235, 0.06), transparent 30%),
    linear-gradient(180deg, rgba(14, 22, 33, 0.95), rgba(23, 33, 43, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chat-container,
#chatcontainer {
  min-height: 56vh;
  max-height: 62vh;
  overflow-y: auto;
  padding: 1rem;
}

#privateChatBox {
  height: 58vh;
  overflow-y: auto;
  padding: 1rem;
}

/* ══════════════════════════════════════════════════
   Messages
   ══════════════════════════════════════════════════ */
.message-row {
  display: flex;
  margin: 0.8rem 0;
}

.message-row.is-self {
  justify-content: flex-start;
}

.message-row.is-other {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(82%, 640px);
  padding: 1rem 1rem 0.85rem;
  border-radius: 22px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
  animation: floatUp 0.35s ease;
  position: relative;
}

.message-bubble.is-self {
  background: linear-gradient(135deg, var(--primary), #488cff);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.message-bubble.is-other {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
  border-bottom-left-radius: 8px;
}

.message-author {
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0.82;
  margin-bottom: 0.45rem;
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
}

.message-file {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
}

.message-preview {
  margin-top: 0.85rem;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  display: block;
  width: 100%;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  cursor: zoom-in;
  appearance: none;
}

.message-preview img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(15,23,42,0.08)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 12px, transparent 12px, transparent 24px);
}

.message-meta,
.file-meta {
  margin-top: 0.6rem;
  font-size: 0.76rem;
  opacity: 0.8;
}

.file-link {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
}

.chat-toolbar,
.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.composer-grid-private {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.chat-toolbar {
  align-items: stretch;
}

.message-composer {
  padding: 0.95rem;
  background: rgba(23, 33, 43, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.message-composer textarea,
.message-composer input,
.chat-input {
  border: 0;
  box-shadow: none !important;
  background: transparent;
}

.message-composer textarea:focus,
.chat-input:focus {
  box-shadow: none !important;
}

.toolbar-card {
  padding: 1rem;
  min-height: 100%;
}

/* ══════════════════════════════════════════════════
   Upload dropzone — dark
   ══════════════════════════════════════════════════ */
.upload-dropzone {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  border: 1px dashed rgba(84, 169, 235, 0.28);
  border-radius: 18px;
  background: rgba(23, 33, 43, 0.5);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.upload-dropzone:hover {
  border-color: rgba(84, 169, 235, 0.48);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: rgba(23, 33, 43, 0.7);
}

.upload-dropzone-title {
  font-weight: 800;
  color: var(--primary);
}

.upload-dropzone-meta {
  color: var(--muted);
  font-size: 0.82rem;
  word-break: break-word;
}

.upload-dropzone-compact {
  min-height: 86px;
  align-content: center;
}

/* ══════════════════════════════════════════════════
   Reveal animation
   ══════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal] {
  transform-origin: center bottom;
}

.reveal {
  will-change: transform, opacity;
}

/* ══════════════════════════════════════════════════
   Utilities
   ══════════════════════════════════════════════════ */
.floating-action {
  position: sticky;
  bottom: 1rem;
  box-shadow: 0 16px 28px rgba(84, 169, 235, 0.24);
}

.small-action {
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
}

.separator {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 1rem 0;
}

.online-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

/* ══════════════════════════════════════════════════
   Account components — dark
   ══════════════════════════════════════════════════ */
.account-progress-card,
.account-preview-card,
.account-insight-card,
.account-save-bar {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(23, 33, 43, 0.6);
}

.account-progress-card {
  padding: 1rem;
}

.account-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.account-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 500ms ease;
}

.account-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background:
    radial-gradient(circle at top left, rgba(84, 169, 235, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(23, 33, 43, 0.8), rgba(14, 22, 33, 0.9));
}

.account-preview-avatar {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 64px;
  border-radius: 22px;
  color: #fff;
  font-weight: 900;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 16px 28px rgba(84, 169, 235, 0.18);
  overflow: hidden;
}

.account-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.account-insight-card {
  padding: 1rem;
  background: rgba(23, 33, 43, 0.5);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.account-insight-card:hover {
  background: rgba(23, 33, 43, 0.7);
  transform: translateY(-1px);
}

.account-insight-card span,
.account-insight-card small {
  display: block;
  color: var(--muted);
}

.account-insight-card strong {
  display: block;
  margin: 0.35rem 0;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.2;
  font-weight: 900;
}

.account-insight-card .small-value {
  font-size: 0.9rem;
  word-break: break-word;
}

.account-save-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  background: rgba(23, 33, 43, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  border-radius: 18px;
}

.account-preview-bio {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ══════════════════════════════════════════════════
   Empty state
   ══════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.empty-state-sm {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 16px 0;
}

/* ══════════════════════════════════════════════════
   Media lightbox
   ══════════════════════════════════════════════════ */
.media-lightbox[hidden] {
  display: none;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 200ms ease;
}

.media-lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.media-lightbox-close {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-lightbox-close:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

.media-lightbox-caption {
  margin-top: 1rem;
  color: rgba(255,255,255,0.9);
  text-align: center;
  font-weight: 700;
}

body.lightbox-open {
  overflow: hidden;
}

/* ══════════════════════════════════════════════════
   Focus & Interaction helpers
   ══════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

button,
a,
.btn,
.form-control,
.form-select,
.card,
.room-entry,
.user-directory-item {
  -webkit-tap-highlight-color: transparent;
}

.card,
.glass-card,
.app-card,
.message-composer,
.account-save-bar,
.media-lightbox img {
  will-change: transform;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

/* ══════════════════════════════════════════════════
   Loading states
   ══════════════════════════════════════════════════ */
.is-loading,
[data-loading="true"] {
  cursor: progress;
}

.btn.is-loading,
button.is-loading,
[data-loading="true"] .btn[type="submit"] {
  pointer-events: none;
  opacity: 0.78;
}

.btn.is-loading::after,
button.is-loading::after,
[data-loading="true"] .btn[type="submit"]::after {
  content: "";
  width: 1em;
  height: 1em;
  margin-inline-start: 0.45rem;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

/* ══════════════════════════════════════════════════
   Skeleton loading
   ══════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-text:last-child {
  width: 60%;
}

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

.skeleton-button {
  width: 120px;
  height: 42px;
  border-radius: 16px;
}

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

/* ══════════════════════════════════════════════════
   Toast notifications
   ══════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(23, 33, 43, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-elevated);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  animation: toastSlideIn 300ms ease both;
  max-width: 460px;
}

.toast-item.toast-exit {
  animation: toastSlideOut 250ms ease both;
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-item.toast-success { border-right: 4px solid var(--success); }
.toast-item.toast-error { border-right: 4px solid var(--danger); }
.toast-item.toast-warning { border-right: 4px solid var(--warning); }
.toast-item.toast-info { border-right: 4px solid var(--primary); }

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

/* ══════════════════════════════════════════════════
   Modal enhancements
   ══════════════════════════════════════════════════ */
.modal-content {
  background: rgba(23, 33, 43, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

.modal-title {
  font-weight: 800;
  color: var(--text);
}

.btn-close {
  filter: invert(0.8) brightness(1.2);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.btn-close:hover {
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   Custom scrollbar
   ══════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(142, 162, 179, 0.2);
  border-radius: 999px;
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(142, 162, 179, 0.35);
}

#chatcontainer::-webkit-scrollbar,
#privateChatBox::-webkit-scrollbar {
  width: 10px;
}

#chatcontainer::-webkit-scrollbar-track,
#privateChatBox::-webkit-scrollbar-track {
  background: transparent;
}

#chatcontainer::-webkit-scrollbar-thumb,
#privateChatBox::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(84, 169, 235, 0.34), rgba(14, 165, 164, 0.34));
  border-radius: 999px;
}

.hove-status:hover {
  background-color: rgba(84, 169, 235, 0.08);
  color: var(--text);
  border-radius: 14px;
}

/* ══════════════════════════════════════════════════
   Animations
   ══════════════════════════════════════════════════ */
@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ══════════════════════════════════════════════════
   Utility classes
   ══════════════════════════════════════════════════ */
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-break { word-break: break-word; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Flex */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-1 { gap: 0.25rem; }
.flex-gap-2 { gap: 0.5rem; }
.flex-gap-3 { gap: 0.75rem; }
.flex-gap-4 { gap: 1rem; }
.flex-gap-5 { gap: 1.25rem; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }

/* Spacing */
.m-0 { margin: 0; }
.p-0 { padding: 0; }

/* Text */
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.35rem; }
.text-2xl { font-size: 1.75rem; }
.text-center { text-align: center; }
.text-end { text-align: end; }
.text-start { text-align: start; }
.fw-bold { font-weight: 700; }
.fw-bolder { font-weight: 800; }
.fw-normal { font-weight: 400; }

/* Colors */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-white { color: #fff; }
.text-white-50 { color: rgba(255, 255, 255, 0.5); }

/* Borders & radius */
.rounded-circle { border-radius: 50%; }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.border-0 { border: 0; }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }

/* Position */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Misc */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.object-fit-cover { object-fit: cover; }
.object-fit-contain { object-fit: contain; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1 { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.justify-content-start { justify-content: flex-start; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.me-auto { margin-inline-end: auto; }
.ms-auto { margin-inline-start: auto; }
.my-2 { margin-block: 0.5rem; }
.my-3 { margin-block: 0.75rem; }
.my-4 { margin-block: 1rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 0.75rem; }
.py-4 { padding-block: 1rem; }
.px-3 { padding-inline: 0.75rem; }
.px-4 { padding-inline: 1rem; }
.px-5 { padding-inline: 1.25rem; }

/* ══════════════════════════════════════════════════
   Responsive — Tablet
   ══════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .page-grid,
  .auth-layout,
  .chat-toolbar,
  .composer-grid,
  .composer-grid-private,
  .search-toolbar,
  .account-insight-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    padding-top: 0.75rem;
  }

  .chat-container,
  #chatcontainer,
  #privateChatBox {
    min-height: 48vh;
    max-height: 55vh;
  }

  .message-bubble {
    max-width: 92%;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════
   Responsive — Mobile
   ══════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  body {
    font-size: 0.92rem;
    overflow-x: hidden;
  }

  .container,
  .container-fluid,
  .page-shell,
  .app-shell,
  .profile-shell,
  .chat-shell,
  .account-shell {
    width: min(calc(100vw - 20px), 100%);
    max-width: min(calc(100vw - 20px), 100%);
  }

  .hero-panel,
  .auth-hero,
  .page-hero,
  .chat-hero,
  .account-hero,
  .card-body,
  .card-header,
  .auth-card,
  .message-composer {
    padding: 1rem;
  }

  .btn {
    width: 100%;
  }

  .topbar-actions .btn,
  .room-entry-actions .btn,
  .user-directory-actions .btn,
  .d-flex .btn {
    width: auto;
  }

  .topbar-actions,
  .room-entry-actions,
  .user-directory-actions,
  .account-save-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions .btn,
  .room-entry-actions .btn,
  .user-directory-actions .btn {
    width: 100%;
  }

  .room-entry,
  .user-directory-item {
    grid-template-columns: 1fr;
  }

  .room-entry-actions,
  .user-directory-actions {
    justify-content: stretch;
  }

  .table-responsive {
    border: 0;
    overflow: visible;
  }

  .table,
  .table thead,
  .table tbody,
  .table tr,
  .table td,
  .table th {
    display: block;
    width: 100%;
  }

  .table tr {
    padding: 1rem;
    border-radius: 18px;
    margin-bottom: 0.9rem;
    background: rgba(23, 33, 43, 0.6);
    border: 1px solid var(--border);
  }

  .table tr:first-child {
    display: none;
  }

  .table td,
  .table th {
    border: 0 !important;
    padding: 0.35rem 0;
  }

  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.18rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
  }

  .card:hover,
  .room-entry:hover,
  .user-directory-item:hover,
  .btn:hover {
    transform: none;
  }

  .container,
  .container-fluid,
  .page-shell,
  .app-shell,
  .profile-shell,
  .chat-shell,
  .account-shell {
    width: min(calc(100vw - 18px), 100%);
    max-width: min(calc(100vw - 18px), 100%);
  }
}

/* ══════════════════════════════════════════════════
   Responsive — Small Mobile
   ══════════════════════════════════════════════════ */
@media (max-width: 575.98px) {
  .brand-mark,
  .account-avatar,
  .chat-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 1.3rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .chat-container,
  #chatcontainer,
  #privateChatBox {
    min-height: 46vh;
    max-height: 50vh;
    padding: 0.8rem;
  }

  .message-bubble {
    max-width: 100%;
    padding: 0.9rem 0.9rem 0.78rem;
  }

  .chat-status-strip,
  .composer-meta {
    flex-direction: column;
    align-items: stretch;
  }
}

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

/* ══════════════════════════════════════════════════
   Profile page — dark inline style replacements
   ══════════════════════════════════════════════════ */
.profile-section-card {
  background: rgba(23, 33, 43, 0.5);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.profile-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}

.call-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

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

.call-icon-sm {
  width: 38px; height: 38px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}

.call-icon-sm.out  { background: var(--success-soft); }
.call-icon-sm.in   { background: var(--primary-soft); }
.call-icon-sm.miss { background: var(--danger-soft); }

.call-row-info { flex: 1; min-width: 0; }
.call-row-peer { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.call-row-meta {
  font-size: 0.78rem; color: var(--muted);
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.1rem;
}
.call-dur { font-size: 0.85rem; font-weight: 700; color: var(--primary); white-space: nowrap; }

.xp-bar-wrap {
  height: 8px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden; margin-top: 0.5rem;
}

.xp-bar-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 500ms ease;
}

/* ── Profile action buttons ── */
.profile-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  border: 1px solid transparent;
}

.profile-action-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.profile-action-btn.primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(84, 169, 235, 0.25);
}

.profile-action-btn.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

.profile-action-btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.profile-action-btn.ghost {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.1);
}

/* ══════════════════════════════════════════════════
   Verified badge
   ══════════════════════════════════════════════════ */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-inline-start: 4px;
  vertical-align: middle;
}

/* ══════════════════════════════════════════════════
   Input group / file input enhancements
   ══════════════════════════════════════════════════ */
.input-group-custom {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-group-custom .form-control {
  flex: 1;
}

/* ══════════════════════════════════════════════════
   Dropdown / context menu — dark theme fix
   ══════════════════════════════════════════════════ */
.dropdown-menu {
  background: rgba(23, 33, 43, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}

.dropdown-item {
  color: var(--text);
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(84, 169, 235, 0.12);
  color: var(--text);
}

.dropdown-item:active {
  background: rgba(84, 169, 235, 0.2);
}

/* ══════════════════════════════════════════════════
   Nav pills — dark
   ══════════════════════════════════════════════════ */
.nav-pills .nav-link {
  color: var(--muted);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.nav-pills .nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-pills .nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ══════════════════════════════════════════════════
   Profile hero — specific layout for profile page
   ══════════════════════════════════════════════════ */
.profile-hero {
  position: relative;
  background: linear-gradient(135deg, var(--surface-dark) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 1.75rem 1.5rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.profile-hero::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(84,169,235,0.12), transparent 70%);
  top: -80px; right: -80px;
  pointer-events: none;
}

.profile-hero-body {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-strong), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 900; color: #fff;
  border: 3px solid rgba(255,255,255,0.15);
  overflow: hidden;
}

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

.profile-online-dot {
  position: absolute;
  bottom: 5px; left: 5px;
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  background: var(--muted);
}

.profile-online-dot.is-online  { background: var(--success); }
.profile-online-dot.is-away    { background: var(--warning); }
.profile-online-dot.is-busy    { background: var(--danger); }

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

.profile-name-row {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}

.profile-display-name {
  font-size: 1.5rem; font-weight: 900; color: var(--text); margin: 0;
}

.profile-username {
  font-size: 0.9rem; color: var(--muted);
}

.profile-verified {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--primary);
  font-size: 0.7rem; color: #fff;
  flex-shrink: 0;
}

.profile-role-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.profile-role-badge.moderator {
  background: var(--warning-soft); color: var(--warning);
}

.profile-role-badge.user {
  background: rgba(255, 255, 255, 0.07); color: var(--muted);
}

.profile-tagline {
  font-size: 0.95rem; color: var(--text-secondary); margin-top: 0.2rem;
}

.profile-custom-status {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem;
}

.profile-bio {
  font-size: 0.95rem; color: var(--text-secondary);
  line-height: 1.75; white-space: pre-wrap; word-break: break-word;
}

.premium-badge {
  display: inline-flex !important;
  align-items: center;
  vertical-align: middle;
  margin-left: 3px;
  animation: premium-glow 2s ease-in-out infinite;
}
@keyframes premium-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(245,158,11,0.3)); }
  50% { filter: drop-shadow(0 0 6px rgba(245,158,11,0.7)); }
}
.premium-tag {
  display: inline-block;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.premium-divider {
  border: none; height: 2px;
  background: linear-gradient(90deg, transparent, #f59e0b, #d97706, transparent);
  margin: 1rem 0; opacity: 0.5;
}

.tg-pinned-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.06));
  border-bottom: 1px solid rgba(245,158,11,0.2);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.tg-pinned-bar:hover {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.10));
}
.tg-pinned-header {
  color: #f59e0b;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.75rem;
}
.tg-pinned-content {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}
.tg-pinned-content .pinned-author {
  color: var(--primary);
  font-weight: 600;
}
.tg-pinned-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.tg-pinned-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.profile-action-btns {
  display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.25rem;
}

.profile-status-line {
  font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem;
}

.profile-xp-area {
  margin-top: 0.8rem; max-width: 260px;
}

.profile-xp-header {
  display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted);
}

/* ══════════════════════════════════════════════════
   Stat mini — profile page stats
   ══════════════════════════════════════════════════ */
.stat-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.stat-mini {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  text-align: center;
  transition: background 180ms;
}

.stat-mini:hover { background: rgba(255, 255, 255, 0.09); }

.stat-mini-value {
  display: block; font-size: 1.5rem; font-weight: 900;
  color: var(--primary); line-height: 1.1;
}

.stat-mini-label {
  display: block; font-size: 0.78rem;
  color: var(--muted); margin-top: 0.25rem;
}

.text-success-em { color: var(--success) !important; }
.text-warning-em { color: var(--warning) !important; }
.text-danger-em { color: var(--danger) !important; }
.text-info-em { color: var(--info) !important; }

/* ══════════════════════════════════════════════════
   Responsive — profile page
   ══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .profile-avatar { width: 72px; height: 72px; font-size: 1.6rem; }
  .profile-display-name { font-size: 1.2rem; }
  .profile-hero { padding: 1.25rem; }
  .profile-hero-body { flex-direction: column; align-items: center; text-align: center; }
  .profile-name-row { justify-content: center; }
  .profile-action-btns { justify-content: center; }
  .profile-xp-area { max-width: 100%; }
}

@media (max-width: 480px) {
  .profile-action-btns { flex-direction: column; }
  .profile-action-btn { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════
   Call history — status colors
   ══════════════════════════════════════════════════ */
.call-status-missed { color: var(--danger); }
.call-status-answered { color: var(--success); }
.call-status-outgoing { color: var(--primary); }
.call-status-cancelled { color: var(--muted); }

/* ══════════════════════════════════════════════════
   Enhanced loading states
   ══════════════════════════════════════════════════ */
.tg-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tg-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotPulse 1.4s ease-in-out infinite both;
}
.tg-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.tg-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.tg-loading-dots span:nth-child(3) { animation-delay: 0s; }

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

/* ══════════════════════════════════════════════════
   Friend search modal improvements
   ══════════════════════════════════════════════════ */
.fa-search-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fa-search-input-group .form-control {
  flex: 1;
  min-height: 44px;
}
.fa-search-status {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}
.fa-modal-tabs .nav-link {
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
}
.fa-modal-body {
  min-height: 200px;
}

/* ══════════════════════════════════════════════════
   Better small-screen search toolbar
   ══════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  .search-toolbar {
    grid-template-columns: 1fr;
  }
  .search-toolbar .btn {
    width: 100%;
  }
  .fa-search-input-group {
    flex-direction: column;
  }
  .fa-search-input-group .btn {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════
   Smooth page transitions
   ══════════════════════════════════════════════════ */
.page-enter {
  animation: pageEnter 300ms ease both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════
   Button Ripple effect
   ══════════════════════════════════════════════════ */
.ripple-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.ripple-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ══════════════════════════════════════════════════
   Skeleton loading
   ══════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}
.skeleton-line:last-child { width: 55%; }
.skeleton-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

/* ══════════════════════════════════════════════════
   Custom scrollbar
   ══════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }

/* ══════════════════════════════════════════════════
   Selection style
   ══════════════════════════════════════════════════ */
::selection { background: rgba(84,169,235,0.35); color: #fff; }

/* ══════════════════════════════════════════════════
   OTP digit input boxes
   ══════════════════════════════════════════════════ */
.otp-digits {
  display: flex;
  gap: 8px;
  justify-content: center;
  direction: ltr;
}
.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  caret-color: var(--primary, #54a9eb);
}
.otp-digit:focus {
  border-color: var(--primary, #54a9eb);
  box-shadow: 0 0 0 3px rgba(84,169,235,0.2);
  transform: translateY(-2px);
}
.otp-digit.filled {
  border-color: rgba(84,169,235,0.4);
  background: rgba(84,169,235,0.08);
}

/* ══════════════════════════════════════════════════
   Better focus states for form controls
   ══════════════════════════════════════════════════ */
.form-control:focus {
  border-color: var(--primary, #54a9eb);
  box-shadow: 0 0 0 3px rgba(84,169,235,0.15);
  background-color: var(--input-bg, rgba(255,255,255,0.06));
}

/* ══════════════════════════════════════════════════
   Empty state with illustration feel
   ══════════════════════════════════════════════════ */
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
  display: block;
  animation: emptyFloat 3s ease-in-out infinite;
}
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ══════════════════════════════════════════════════
   Message appear animation
   ══════════════════════════════════════════════════ */
.message-row {
  animation: msgSlideIn 0.25s ease both;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════════════
   Button loading spinner (inline)
   ══════════════════════════════════════════════════ */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════
   Card hover lift effect
   ══════════════════════════════════════════════════ */
.card-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ══════════════════════════════════════════════════
   Toast slide-in animation enhancement
   ══════════════════════════════════════════════════ */
.tg-toast {
  animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
}
@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastFadeOut {
  to { transform: translateX(100%); opacity: 0; }
}

/* ══════════════════════════════════════════════════
   XP bar animation
   ══════════════════════════════════════════════════ */
.xp-bar-fill {
  transition: width 1s ease;
  background: linear-gradient(90deg, #54a9eb, #7c3aed);
  border-radius: 999px;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.xp-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: xpShimmer 2s ease-in-out infinite;
}
@keyframes xpShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ══════════════════════════════════════════════════
   Form transition (swipe between forms)
   ══════════════════════════════════════════════════ */
.form-transition {
  animation: formSlide 0.35s ease both;
}
@keyframes formSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════════════
   Pinned bar animation
   ══════════════════════════════════════════════════ */
.tg-pinned-bar {
  animation: pinnedSlide 0.3s ease both;
}
@keyframes pinnedSlide {
  from { max-height: 0; opacity: 0; }
  to { max-height: 60px; opacity: 1; }
}

/* ══════════════════════════════════════════════════
   Call history card improvements
   ══════════════════════════════════════════════════ */
.call-item {
  transition: transform 0.15s ease, background 0.15s ease;
}
.call-item:hover {
  transform: translateX(-4px);
}
.call-stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.call-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ══════════════════════════════════════════════════
   Profile stat card hover
   ══════════════════════════════════════════════════ */
.stat-mini {
  transition: transform 0.2s ease, background 0.2s ease;
}
.stat-mini:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.08);
}

/* ══════════════════════════════════════════════════
   Mobile bottom navigation for chats
   ══════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  .tg-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1050;
  }
  .tg-sidebar.is-open {
    transform: translateX(0);
  }
  .tg-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1049;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .tg-sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .tg-chat-header .tg-icon-button:first-child {
    display: inline-flex;
  }
}

/* ══════════════════════════════════════════════════
   Friend request badge bounce
   ══════════════════════════════════════════════════ */
.friend-count-badge {
  animation: badgeBounce 2s ease-in-out infinite;
}
@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ══════════════════════════════════════════════════
   Smooth theme transition
   ══════════════════════════════════════════════════ */
.telegram-theme,
.telegram-theme * {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ══════════════════════════════════════════════════
   🔮 Glassmorphism
   ══════════════════════════════════════════════════ */
.glass {
  background: rgba(23, 33, 43, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.07);
}
.glass-strong {
  background: rgba(23, 33, 43, 0.85);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.09);
}

/* ══════════════════════════════════════════════════
   🌟 Gradient buttons
   ══════════════════════════════════════════════════ */
.btn-gradient {
  background: linear-gradient(135deg, #54a9eb, #3b82f6);
  border: none;
  color: #fff;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(84,169,235,0.25);
  color: #fff;
}
.btn-gradient:active { transform: translateY(0); }
.btn-gradient-success {
  background: linear-gradient(135deg, #10b981, #059669);
}
.btn-gradient-success:hover {
  box-shadow: 0 8px 24px rgba(16,185,129,0.25);
}
.btn-gradient-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.btn-gradient-danger:hover {
  box-shadow: 0 8px 24px rgba(239,68,68,0.25);
}
.btn-gradient-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.btn-gradient-warning:hover {
  box-shadow: 0 8px 24px rgba(245,158,11,0.25);
}

/* ══════════════════════════════════════════════════
   💬 Chat bubble enhancements — Telegram-like
   ══════════════════════════════════════════════════ */
.message-bubble.is-self {
  background: linear-gradient(135deg, #2b6f9e, #1a8cff) !important;
  border-bottom-left-radius: 4px !important;
  box-shadow: 0 2px 8px rgba(26,140,255,0.15);
}
.message-bubble.is-other {
  background: var(--surface-strong) !important;
  border-bottom-right-radius: 4px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.message-bubble {
  position: relative;
  overflow: hidden;
}
/* Message grouping — consecutive bubbles merge */
.message-row.is-self + .message-row.is-self .message-bubble.is-self {
  border-top-right-radius: 4px !important;
}
.message-row.is-self + .message-row.is-self .message-bubble.is-self {
  margin-top: 2px;
}
.message-row.is-other + .message-row.is-other .message-bubble.is-other {
  border-top-left-radius: 4px !important;
  margin-top: 2px;
}
/* First in group gets full radius */
.message-row:not(.is-self) + .message-row.is-self .message-bubble.is-self,
.message-row:not(.is-other) + .message-row.is-other .message-bubble.is-other {
  border-top-right-radius: 18px !important;
  border-top-left-radius: 18px !important;
}

/* ══════════════════════════════════════════════════
   🏠 Room cards (glass design for index)
   ══════════════════════════════════════════════════ */
.room-glass-card {
  background: rgba(23,33,43,0.65);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.room-glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.12);
}
.room-glass-card.public {
  border-left: 3px solid #10b981;
}
.room-glass-card.private {
  border-left: 3px solid #f59e0b;
}
.room-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #eef6fd;
  margin-bottom: 0.25rem;
}
.room-card-subtitle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}
.room-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}
.room-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}
.room-card-actions .btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
}

/* ══════════════════════════════════════════════════
   👤 Avatar with status ring
   ══════════════════════════════════════════════════ */
.avatar-ring {
  position: relative;
  display: inline-flex;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #54a9eb, #7c3aed);
}
.avatar-ring img,
.avatar-ring .avatar-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-ring .avatar-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg, #0e1621);
}
.avatar-ring .avatar-dot.online { background: #10b981; }
.avatar-ring .avatar-dot.offline { background: #475569; }
.avatar-ring .avatar-dot.away { background: #f59e0b; }
.avatar-ring .avatar-dot.busy { background: #ef4444; }

/* ══════════════════════════════════════════════════
   📋 Profile cover area
   ══════════════════════════════════════════════════ */
.profile-cover {
  position: relative;
  height: 200px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a3a5c, #2d1b69);
  margin: -1rem -1rem 0;
}
.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(84,169,235,0.2), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(124,58,237,0.15), transparent 50%);
}
.profile-cover-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    radial-gradient(circle at 25% 25%, #fff 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, #fff 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ══════════════════════════════════════════════════
   🎭 Staggered list animation
   ══════════════════════════════════════════════════ */
.stagger-item {
  opacity: 0;
  transform: translateY(12px);
}
.stagger-item.is-visible {
  animation: staggerIn 0.35s ease forwards;
}
@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════
   🍬 SweetAlert2 dark overrides
   ══════════════════════════════════════════════════ */
.swal2-popup {
  background: var(--surface) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg) !important;
  color: var(--text) !important;
  font-family: inherit !important;
}
.swal2-title { color: var(--text) !important; }
.swal2-html-container { color: var(--text-secondary) !important; }
.swal2-confirm {
  background: linear-gradient(135deg, #54a9eb, #3b82f6) !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
}
.swal2-cancel {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
}
.swal2-input,
.swal2-textarea,
.swal2-select {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
  font-family: inherit !important;
}

/* ══════════════════════════════════════════════════
   🧭 Navbar glass
   ══════════════════════════════════════════════════ */
.app-navbar {
  background: rgba(14, 22, 33, 0.82) !important;
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.app-navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ══════════════════════════════════════════════════
   🔵 Auth page — glass card redesign
   ══════════════════════════════════════════════════ */
.auth-glass-card {
  background: rgba(23,33,43,0.7);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 32px 64px rgba(0,0,0,0.35);
}

/* ══════════════════════════════════════════════════
   📱 Mobile bottom nav
   ══════════════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: rgba(14,22,33,0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0.35rem 0 env(safe-area-inset-bottom, 0.35rem) 0;
  justify-content: space-around;
  align-items: center;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.5);
  padding: 0.3rem 0.5rem;
  border-radius: 12px;
  transition: color 0.15s;
  text-decoration: none;
  min-width: 56px;
}
.mobile-nav-item.active {
  color: var(--primary);
}
.mobile-nav-item .nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

@media (max-width: 767.98px) {
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: 56px; }
}

/* ══════════════════════════════════════════════════
   ✨ Floating particles background (login)
   ══════════════════════════════════════════════════ */
.particles-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(84,169,235,0.25);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ══════════════════════════════════════════════════
   🌀 Brand mark pulse
   ══════════════════════════════════════════════════ */
.brand-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #54a9eb, #3b82f6);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 8px 24px rgba(84,169,235,0.3);
  animation: brandPulse 2s ease-in-out infinite;
}
@keyframes brandPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(84,169,235,0.3); }
  50% { box-shadow: 0 8px 32px rgba(84,169,235,0.5); }
}

/* ══════════════════════════════════════════════════
   📊 Circular stat
   ══════════════════════════════════════════════════ */
.circular-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.circular-stat svg {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}
.circular-stat svg circle {
  fill: none;
  stroke-width: 4;
  cx: 28; cy: 28; r: 24;
}
.circular-stat .bg-circle {
  stroke: rgba(255,255,255,0.06);
}
.circular-stat .fg-circle {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.circular-stat-value {
  font-size: 1.1rem;
  font-weight: 900;
  margin-top: -48px;
  position: relative;
}

/* ══════════════════════════════════════════════════
   📦 Room table → card grid for index
   ══════════════════════════════════════════════════ */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ══════════════════════════════════════════════════
   🔘 Better call buttons for profile
   ══════════════════════════════════════════════════ */
.profile-action-btn {
  border-radius: 12px !important;
  font-weight: 600 !important;
  padding: 0.45rem 1rem !important;
  border: none !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}
.profile-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ══════════════════════════════════════════════════
   🎯 Tooltip for icon buttons
   ══════════════════════════════════════════════════ */
[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 999;
  font-family: inherit;
  pointer-events: none;
}
.tg-icon-button,
.tg-call-btn,
.call-back-btn {
  position: relative;
}

/* ══════════════════════════════════════════════════
   🔥 Message reaction popup
   ══════════════════════════════════════════════════ */
.reaction-menu {
  background: rgba(23,33,43,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 0.5rem;
  display: flex;
  gap: 0.25rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 9999;
  position: fixed;
  animation: reactPop 0.2s ease both;
}
@keyframes reactPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.reaction-option {
  font-size: 1.5rem;
  padding: 0.3rem;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.15s, background 0.15s;
  line-height: 1;
}
.reaction-option:hover {
  transform: scale(1.3);
  background: rgba(255,255,255,0.06);
}

/* ══════════════════════════════════════════════════
   🖼️ Media lightbox enhancements
   ══════════════════════════════════════════════════ */
.media-lightbox {
  background: rgba(0,0,0,0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ══════════════════════════════════════════════════
   📱 Mobile chat input improvements
   ══════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  .tg-composer {
    padding-bottom: env(safe-area-inset-bottom, 0.5rem) !important;
  }
  .tg-peer-title {
    font-size: 0.95rem !important;
  }
  .tg-peer-subtitle {
    font-size: 0.72rem !important;
  }
}

/* ══════════════════════════════════════════════════
   📨 Message forward header — Telegram style
   ══════════════════════════════════════════════════ */
.message-forwarded {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  padding: 2px 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64c4ff;
  border-bottom: 1px solid rgba(100,196,255,0.15);
}
.forwarded-icon {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ══════════════════════════════════════════════════
   🍸 Context menu — glass card
   ══════════════════════════════════════════════════ */
.tg-ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 180px;
  background: rgba(23,33,43,0.92);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 0.35rem;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  animation: ctxPop 0.15s ease both;
  overflow: hidden;
}
@keyframes ctxPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.tg-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.tg-ctx-item:hover {
  background: rgba(84,169,235,0.12);
}
.tg-ctx-danger {
  color: #ef4444;
}
.tg-ctx-danger:hover {
  background: rgba(239,68,68,0.12) !important;
}

/* ══════════════════════════════════════════════════
   🎤 Voice / Send button toggle
   ══════════════════════════════════════════════════ */
.tg-voice-btn,
.tg-send-button {
  transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}
.tg-voice-btn.is-hidden,
.tg-send-button.is-hidden {
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  transform: scale(0);
}

/* ══════════════════════════════════════════════════
   📅 Date separator pill — Telegram style
   ══════════════════════════════════════════════════ */
.tg-date-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  margin: 6px auto 10px;
  padding: 5px 14px;
  background: rgba(13,20,29,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  font-size: 0.75rem;
  color: #c8d6e2;
  font-weight: 600;
  position: sticky;
  top: 8px;
  z-index: 5;
}

/* ══════════════════════════════════════════════════
   📋 Telegram conversation list items
   ══════════════════════════════════════════════════ */
.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: background 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  position: relative;
}
.conv-item:hover { background: rgba(255,255,255,0.04); }
.conv-item.active { background: rgba(84,169,235,0.1); }
.conv-avatar { position: relative; flex-shrink: 0; }
.conv-avatar .tg-avatar {
  width: 48px; height: 48px; font-size: 1.1rem;
}
.conv-avatar .online-dot {
  position: absolute; bottom: 1px; right: -1px;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid var(--bg, #0e1621);
}
.conv-avatar .online-dot.online { background: #10b981; }
.conv-avatar .online-dot.offline { background: #475569; }
.conv-avatar .online-dot.away { background: #f59e0b; }
.conv-avatar .online-dot.busy { background: #ef4444; }
.conv-body { flex: 1; min-width: 0; }
.conv-name {
  font-weight: 700; font-size: 0.92rem;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 1px;
}
.conv-preview {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-time {
  position: absolute; top: 10px; left: 12px;
  font-size: 0.68rem; color: rgba(255,255,255,0.3);
}
[dir="rtl"] .conv-time { left: auto; right: 12px; }
.conv-badge {
  position: absolute; bottom: 10px; left: 12px;
  min-width: 20px; height: 20px;
  display: grid; place-items: center;
  padding: 0 5px; border-radius: 999px;
  background: var(--primary, #54a9eb);
  color: #fff; font-size: 0.65rem; font-weight: 700;
  box-shadow: 0 2px 8px rgba(84,169,235,0.3);
}
[dir="rtl"] .conv-badge { left: auto; right: 12px; }
.conv-pin {
  position: absolute; bottom: 10px; left: 12px;
  font-size: 0.7rem; opacity: 0.4;
}
[dir="rtl"] .conv-pin { left: auto; right: 12px; }

/* ══════════════════════════════════════════════════
   📱 Mobile sidebar drawer
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .tg-sidebar {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 300px; z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    border-left: none;
    border-right: 1px solid var(--line-soft);
    border-radius: 0;
    box-shadow: -8px 0 32px rgba(0,0,0,0.3);
  }
  .tg-sidebar.open { transform: translateX(0); }
  .tg-sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1049;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .tg-sidebar-overlay.show { opacity: 1; pointer-events: auto; }
}
/* ══════════════════════════════════════════════════
   🔘 Pinned bar — Telegram left accent
   ══════════════════════════════════════════════════ */
.tg-pinned-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(23,33,43,0.95);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.82rem;
  position: relative; overflow: hidden;
}
.tg-pinned-bar::before {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary, #54a9eb);
  border-radius: 0 3px 3px 0;
}
.tg-pinned-header {
  font-weight: 700; color: var(--primary, #54a9eb);
  font-size: 0.72rem; white-space: nowrap;
}
.tg-pinned-content {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-secondary);
}
.tg-pinned-close {
  border: none; background: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.1rem; cursor: pointer;
  padding: 4px; border-radius: 50%;
  transition: background 0.15s;
  flex-shrink: 0;
}
.tg-pinned-close:hover { background: rgba(255,255,255,0.06); }

/* ══════════════════════════════════════════════════
   💬 Reply preview — Telegram accent border
   ══════════════════════════════════════════════════ */
.tg-reply-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 8px;
  background: rgba(23,33,43,0.9);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  position: relative; overflow: hidden;
}
.tg-reply-preview::before {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary, #54a9eb);
  border-radius: 0 3px 3px 0;
}
.reply-content { flex: 1; min-width: 0; font-size: 0.82rem; }
.reply-author { font-weight: 700; color: var(--primary, #54a9eb); }
.reply-cancel {
  border: none; background: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.2rem; cursor: pointer;
  padding: 4px 8px; border-radius: 50%;
  transition: background 0.15s;
  flex-shrink: 0;
}
.reply-cancel:hover { background: rgba(255,255,255,0.06); }

/* ══════════════════════════════════════════════════
   👤 Profile page — shared class definitions
   ══════════════════════════════════════════════════ */
.profile-hero { margin-top:-48px; position:relative; z-index:2; }
.profile-avatar-wrap { text-align:center; }
.profile-avatar-ring { width:96px; height:96px; }
.avatar-initials-fallback {
  display:flex; align-items:center; justify-content:center;
  background:var(--primary); color:#fff;
  font-size:2rem; font-weight:900;
}
.profile-name-row { justify-content:center; }
.profile-username { text-align:center; }
.profile-tagline { text-align:center; }
.profile-custom-status { justify-content:center; }
.profile-status-line { text-align:center; }

.profile-action-btns { justify-content:center; }
.profile-action-btn-success {
  background:rgba(16,185,129,0.15); color:#10b981;
}
.profile-action-btn-primary {
  background:rgba(84,169,235,0.15); color:#54a9eb;
}
.profile-action-btn-danger {
  background:rgba(239,68,68,0.15); color:#ef4444;
}
.profile-action-btn-muted {
  background:rgba(255,255,255,0.06); color:rgba(255,255,255,0.6);
}

.profile-call-btn-sm { width:32px; height:32px; font-size:.9rem; }
.profile-call-actions { gap:0.35rem; margin-right:0.5rem; }
.profile-no-calls { padding:2rem; color:var(--muted); }
.profile-no-calls-icon { font-size:2rem; margin-bottom:.5rem; }

.xp-hist-grid { gap:.35rem; max-height:300px; overflow-y:auto; }
.xp-hist-row { padding:.35rem 0; border-bottom:1px solid var(--border,#334155); }
.xp-hist-label { font-size:.85rem; }
.xp-hist-time { font-size:.7rem; color:var(--muted,#94a3b8); }
.xp-hist-amount { font-weight:700; font-size:.9rem; }

.bio-empty { font-size:.9rem; }
.info-grid { gap:.75rem; }
.common-rooms-wrap { gap:0.5rem; }

.file-mini { padding:0.7rem; cursor:default; }
.file-mini-icon { font-size:1.4rem; margin-bottom:0.25rem; }
.file-mini-name { line-height:1.3; }
.file-mini-size { margin-top:0.2rem; opacity:0.5; }

.profile-spacer { height:1.5rem; }

/* ══════════════════════════════════════════════════
   📞 Call history shared styles
   ══════════════════════════════════════════════════ */
.call-history-wrap { max-width:780px; margin:0 auto; padding:1rem; }
.call-history-header { display:flex; align-items:center; gap:1rem; margin-bottom:1.25rem; }
.call-stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0.75rem; margin-bottom:1.25rem; }
.call-stat-card {
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.08);
  border-radius:16px; padding:0.9rem 1rem; text-align:center;
}
.call-stat-value { display:block; font-size:1.6rem; font-weight:900; color:#54a9eb; }
.call-stat-label { display:block; font-size:0.82rem; color:rgba(255,255,255,0.55); margin-top:0.2rem; }
.call-list { display:grid; gap:0.65rem; }
.call-item {
  display:flex; align-items:center; gap:1rem;
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.07);
  border-radius:16px; padding:0.85rem 1rem; transition:background 180ms;
}
.call-item:hover { background:rgba(255,255,255,0.09); }
.call-icon {
  width:46px; height:46px; border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.3rem; flex-shrink:0;
}
.call-icon.outgoing  { background:rgba(16,185,129,0.15); }
.call-icon.incoming  { background:rgba(84,169,235,0.15); }
.call-icon.missed    { background:rgba(239,68,68,0.15); }
.call-info { flex:1; min-width:0; }
.call-peer { font-weight:700; font-size:0.97rem; color:#eef6fd; }
.call-meta { font-size:0.82rem; color:rgba(255,255,255,0.5); margin-top:0.15rem; }
.call-duration { font-size:0.85rem; font-weight:700; color:#54a9eb; white-space:nowrap; }
.call-type-badge { font-size:0.78rem; padding:0.25rem 0.6rem; border-radius:999px; background:rgba(255,255,255,0.08); color:rgba(255,255,255,0.7); }
.call-action-btns { display:flex; gap:0.4rem; }
.call-back-btn {
  width:36px; height:36px; border-radius:999px; border:none;
  background:rgba(16,185,129,0.15); color:#10b981;
  font-size:1rem; cursor:pointer; transition:background 150ms, transform 120ms;
}
.call-back-btn:hover { background:rgba(16,185,129,0.28); transform:scale(1.06); }
.call-back-btn.video { background:rgba(84,169,235,0.15); color:#54a9eb; }
.empty-calls { text-align:center; padding:2rem 1rem; }
.empty-state-icon { font-size:3rem; display:block; margin-bottom:0.5rem; }

@media (max-width:600px) {
  .call-stats-grid { grid-template-columns:repeat(2,1fr); }
  .call-action-btns { display:none; }
}

/* ══════════════════════════════════════════════════
   🔄 Real-time online status pulse
   ══════════════════════════════════════════════════ */
@keyframes onlinePulse {
  0%, 100% { opacity:1; }
  50% { opacity:0.5; }
}
.tg-online-pulse {
  animation: onlinePulse 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   🔘 Sidebar toggle — always visible on mobile
   ══════════════════════════════════════════════════ */
.tg-sidebar-toggle { display:none; }
@media (max-width:900px) {
  .tg-sidebar-toggle { display:inline-flex !important; }
}
