/* Payra Islamic Chat App — Design System CSS */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Kufi+Arabic:wght@400;500;700&family=Hind+Siliguri:wght@400;500;600&display=swap');

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #06201C;
  color: #EAF6F1;
  overflow: hidden;
}
::selection { background: #1FBE8B; color: #06201C; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }
* { -webkit-tap-highlight-color: transparent; }

/* ── CSS Variables ───────────────────────────────────────────────────────────── */
:root {
  --bg-0: #06201C;
  --bg-1: #0B2A25;
  --bg-2: #11352F;
  --bg-3: #18443C;
  --primary: #1FBE8B;
  --primary-dark: #0E8F7E;
  --gold: #E6B655;
  --gold-dark: #d99a3a;
  --violet: #7C5CFF;
  --pink: #FF5CA8;
  --cyan: #38E0D0;
  --amber: #FFB020;
  --coral: #FF7A59;
  --text-1: #EAF6F1;
  --text-2: #A9CFC4;
  --text-3: #7FB3A5;
  --text-4: #5d877b;
  --border: rgba(255,255,255,0.08);
  --border-focus: rgba(31,190,139,0.5);
  --field-glass: rgba(255,255,255,0.22);
  --grad-primary: linear-gradient(135deg, #1FBE8B, #0E8F7E);
  --grad-violet-pink: linear-gradient(135deg, #7C5CFF, #FF5CA8);
  --grad-pink-violet: linear-gradient(135deg, #FF5CA8, #7C5CFF);
  --grad-teal: linear-gradient(135deg, #38E0D0, #1FBE8B);
  --grad-gold: linear-gradient(135deg, #E6B655, #d99a3a);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-full: 999px;
}

/* Light mode overrides */
.light-mode {
  --bg-0: #F2EFE7;
  --bg-1: #FFFFFF;
  --bg-2: #EAE6DC;
  --bg-3: #DDD8CE;
  --text-1: #081510;
  --text-2: #1A3028;
  --text-3: #2C4E44;
  --text-4: #456058;
  --border: rgba(10,30,24,0.10);
  --border-focus: rgba(14,143,126,0.5);
  background: #F2EFE7;
  color: #081510;
}
.light-mode body { background: #F2EFE7; }

/* ── Light mode structural overrides ─────────────────────────────────────── */
.light-mode .tab-bar {
  background: rgba(242,239,231,0.97);
  border-top-color: rgba(10,30,24,0.09);
}
.light-mode .tab-item { color: var(--text-4); }
.light-mode .tab-item.active { color: var(--primary-dark); }

.light-mode .top-bar { border-bottom: none; }

/* Chat list */
.light-mode .chat-item:hover  { background: rgba(0,0,0,0.035); }
.light-mode .chat-item:active { background: rgba(0,0,0,0.06); }
.light-mode .chip-inactive { background: var(--bg-3); color: var(--text-2); border-color: var(--border); }

/* Conversation view */
.light-mode .conv-header {
  background: rgba(242,239,231,0.93) !important;
  border-bottom-color: rgba(10,30,24,0.09);
}
.light-mode .conv-date-sep { background: rgba(0,0,0,0.08); color: var(--text-3); }
.light-mode .msg-bubble.recv {
  background: rgba(10,30,24,0.09);
  color: var(--text-1);
}
.light-mode .msg-sender  { color: var(--text-2); }
.light-mode .msg-bubble.sent .msg-meta { color: rgba(3,20,13,0.65); opacity: 1; }
.light-mode .msg-bubble.recv .msg-meta { color: var(--text-2); opacity: 1; }
.light-mode .typing-indicator { background: rgba(10,30,24,0.09); }
.light-mode .composer { background: linear-gradient(0deg, var(--bg-0) 55%, transparent); }
.light-mode .composer-input-wrap {
  background: var(--bg-2);
  border-color: rgba(10,30,24,0.12);
}
.light-mode .composer-input::placeholder { color: var(--text-4); }

/* Cards / Settings */
.light-mode .card            { background: var(--bg-2); border-color: var(--border); }
.light-mode .settings-profile {
  background: var(--bg-1);
  border-color: var(--border);
}
.light-mode .settings-list   {
  background: var(--bg-1);
  border-color: var(--border);
}
.light-mode .settings-row    { border-bottom-color: rgba(10,30,24,0.07); }
.light-mode .settings-row:hover { background: rgba(0,0,0,0.03); }
.light-mode .settings-icon   { background: rgba(14,143,126,0.10); }

/* Role / relationship selectors */
.light-mode .role-card        { background: var(--bg-2); border-color: var(--border); }
.light-mode .role-card-active { background: rgba(31,190,139,0.13); border-color: rgba(31,190,139,0.4); }
.light-mode .rel-chip.unsel   { background: var(--bg-3); border-color: var(--border); color: var(--text-2); }
.light-mode .am-rel.unsel     { background: var(--bg-3); color: var(--text-2); }
.light-mode .am-type.unsel    { background: var(--bg-3); color: var(--text-2); }

/* Effect picker */
.light-mode .effect-icon             { background: rgba(0,0,0,0.06); }
.light-mode .effect-tile:hover       { border-color: rgba(0,0,0,0.15); }
.light-mode .effect-label            { color: var(--text-3); }

/* Approval card */
.light-mode .approval-message { background: rgba(0,0,0,0.04); }

/* Modals */
.light-mode .modal-sheet      { background: var(--bg-1); }
.light-mode .modal-handle     { background: var(--bg-3); }

/* Misc text */
.light-mode .family-subtitle  { color: var(--text-2); }
.light-mode .section-header   { color: var(--text-1); }
.light-mode .empty-state-title { color: var(--text-1); }
.light-mode .empty-state-desc  { color: var(--text-3); }

/* Themes tab */
.light-mode #bg-preview         { border-color: var(--border) !important; }
.light-mode .mode-toggle-wrap   { background: var(--bg-2) !important; border-color: var(--border) !important; }

/* Notifications / other sub-screens */
.light-mode .notif-icon  { background: rgba(14,143,126,0.10); }
.light-mode .notif-title { color: var(--text-1); }
.light-mode .notif-row   { border-bottom-color: rgba(10,30,24,0.07); }
.light-mode .card-gold   { background: linear-gradient(180deg,rgba(230,182,85,0.22),rgba(230,182,85,0.10)); border-color: rgba(180,130,30,0.45); }
.light-mode .card-gold-text { color: #7A5000 !important; }

/* ── Light chat background adaptation ───────────────────────────────────────── */
[data-chat-light="1"] .conv-header {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(0,0,0,0.06);
}
[data-chat-light="1"] .conv-name { color: #102A25; }
[data-chat-light="1"] .conv-status { color: #5E7A72; }
[data-chat-light="1"] .conv-status.online { color: #0E8F7E; }
[data-chat-light="1"] .conv-date-sep { background: rgba(0,0,0,0.07); color: #5E7A72; }
[data-chat-light="1"] .msg-bubble.recv { background: rgba(0,0,0,0.08); color: #102A25; }
[data-chat-light="1"] .msg-sender { color: #5E7A72; }
[data-chat-light="1"] .msg-bubble.sent .msg-meta { color: rgba(3,20,13,0.65); opacity: 1; }
[data-chat-light="1"] .msg-bubble.recv .msg-meta { color: #3A5A50; opacity: 1; }
[data-chat-light="1"] .composer { background: linear-gradient(0deg, rgba(255,255,255,0.96) 55%, rgba(255,255,255,0)); }
[data-chat-light="1"] .composer-input-wrap { background: #ebe7de; border-color: rgba(0,0,0,0.1); }
[data-chat-light="1"] .composer-input { color: #102A25; }
[data-chat-light="1"] .composer-input::placeholder { color: #8a9e98; }

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes pyShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes pyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pyTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes pyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,190,139,0.45); }
  50% { box-shadow: 0 0 0 10px rgba(31,190,139,0); }
}
@keyframes pyHeart {
  0% { transform: translateY(8px) scale(0.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-26px) scale(1); opacity: 0; }
}
@keyframes pyBurst {
  0% { transform: scale(0.2); opacity: 1; }
  80% { opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes pyFall {
  0% { transform: translateY(-14px) rotate(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(26px) rotate(180deg); opacity: 0; }
}
@keyframes pyShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px) rotate(-2deg); }
  40% { transform: translateX(3px) rotate(2deg); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Contact info screen ─────────────────────────────────────────────────────── */
#screen-contact-info.active {
  animation: slideInRight 0.3s cubic-bezier(.18,.8,.3,1) both;
}
.ci-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.ci-info-row:last-child { border-bottom: none; }
.ci-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(31,190,139,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
@keyframes ripple {
  from { transform: scale(0); opacity: 0.5; }
  to { transform: scale(2); opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }

/* ── Splash Screen ───────────────────────────────────────────────────────────── */
@keyframes splashFadeOut {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}
@keyframes splashLogoIn {
  0% { opacity: 0; transform: scale(.6); }
  55% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes pyDots {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}
#screen-splash {
  background: linear-gradient(160deg, #1FBE8B, #0E8F7E 45%, #0a3a33);
  align-items: center;
  justify-content: center;
}
.splash-dots {
  position: absolute;
  inset: 0;
  opacity: .12;
  background-image: radial-gradient(circle at 16px 16px, #fff 1.5px, transparent 1.6px);
  background-size: 46px 46px;
  pointer-events: none;
}
.splash-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.splash-logo {
  width: 108px;
  height: 108px;
  border-radius: 32px;
  background: rgba(255,255,255,.96);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 24px 60px -14px rgba(0,0,0,.5);
  animation: splashLogoIn .9s cubic-bezier(.2,.8,.3,1) both;
}
.splash-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -1px;
  color: #fff;
  margin-top: 24px;
  animation: fadeIn .6s .35s both;
}
.splash-dots-loader {
  position: absolute;
  bottom: 60px;
  display: flex;
  gap: 6px;
}
.splash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pyDots 1.2s infinite;
}
.splash-dot:nth-child(2) { animation-delay: .15s; }
.splash-dot:nth-child(3) { animation-delay: .3s; }

/* ── App Shell ───────────────────────────────────────────────────────────────── */
#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── Screens ─────────────────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}
.screen.active { display: flex; }

/* ── Scrollable area ─────────────────────────────────────────────────────────── */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(31,190,139,0.3) transparent;
}
.scroll-area::-webkit-scrollbar { width: 4px; }
.scroll-area::-webkit-scrollbar-thumb { background: rgba(31,190,139,0.3); border-radius: 2px; }

/* ── Background decorations ──────────────────────────────────────────────────── */
.girih-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(circle at 20px 20px, #1FBE8B 1.5px, transparent 1.6px);
  background-size: 46px 46px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--grad-primary);
  color: #06201C;
  box-shadow: 0 16px 32px -10px rgba(31,190,139,0.75);
}
.btn-primary:hover { box-shadow: 0 20px 38px -8px rgba(31,190,139,0.85); }
.btn-secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
}
.btn-gold {
  background: rgba(230,182,85,0.14);
  border: 1.5px solid rgba(230,182,85,0.4);
  color: var(--gold);
}
.btn-danger {
  background: rgba(255,77,109,0.12);
  border: 1.5px solid rgba(255,77,109,0.4);
  color: #FF4D6D;
}
.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }

/* ── Inputs ──────────────────────────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-3);
  text-transform: uppercase;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  transition: border-color 0.15s;
}
.input-wrap:focus-within { border-color: var(--border-focus); }
.input-wrap input, .input-wrap textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 14px;
}
.input-wrap i { color: var(--text-3); font-size: 18px; flex: none; }
.input-hint { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.input-error { font-size: 11px; color: #FF5CA8; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}
.card-gold {
  background: linear-gradient(180deg, rgba(230,182,85,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(230,182,85,0.25);
}

/* ── Avatar ──────────────────────────────────────────────────────────────────── */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  border-radius: 50%;
}
.avatar-sm { width: 36px; height: 36px; font-size: 12px; }
.avatar-md { width: 46px; height: 46px; font-size: 16px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 76px; height: 76px; font-size: 28px; }
.avatar-sq { border-radius: 14px !important; }
.avatar-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg-0);
}
.avatar-online { background: #1FBE8B; }
.avatar-offline { background: var(--text-3); }
.avatar-mahram-badge {
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

/* ── Chips ───────────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-active {
  background: linear-gradient(135deg, #1FBE8B, #0E8F7E);
  color: #06201C;
  font-weight: 700;
  border-color: transparent;
}
.chip-inactive {
  background: var(--bg-2);
  border-color: var(--border);
  color: var(--text-3);
  font-weight: 500;
}

/* ── Toggles ─────────────────────────────────────────────────────────────────── */
.toggle {
  width: 46px;
  height: 27px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex: none;
}
.toggle.on { background: var(--grad-primary); border-color: transparent; }
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.toggle.on .toggle-knob { left: 22px; }

/* ── Toast notifications ─────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  min-width: 200px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-color: rgba(31,190,139,0.4); }
.toast.error { border-color: rgba(255,92,168,0.4); }
.toast.warning { border-color: rgba(230,182,85,0.4); }

/* ── Loader ──────────────────────────────────────────────────────────────────── */
.loader {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(31,190,139,0.3);
  border-top-color: #1FBE8B;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}

/* ── Modal overlay ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-sheet {
  background: var(--bg-1);
  border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  animation: slideUp 0.3s ease;
}
.modal-drag-handle {
  width: 42px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 18px;
}

/* ── Welcome Screen ──────────────────────────────────────────────────────────── */
#screen-welcome {
  background: radial-gradient(135% 85% at 50% -10%, #22d39a 0%, #0E8F7E 28%, #0a3a33 60%, #06201C 100%);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 44px;
}
.welcome-logo-wrap {
  position: relative;
  margin-bottom: 34px;
}
.welcome-logo-glow {
  position: absolute;
  inset: -20px;
  border-radius: 40px;
  filter: blur(28px);
  opacity: 0.65;
  background: linear-gradient(135deg, #1FBE8B, rgba(255,255,255,0.67));
}
.welcome-logo {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 32px;
  background: rgba(255,255,255,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 24px 54px -14px rgba(0,0,0,0.55);
  animation: pyFloat 5s ease-in-out infinite;
}
.welcome-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 46px;
  letter-spacing: -1px;
  color: #fff;
  margin-top: 6px;
}
.welcome-subtitle {
  font-family: 'Noto Kufi Arabic', sans-serif;
  font-size: 18px;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
}
.welcome-tagline {
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  margin-top: 12px;
  line-height: 1.5;
}
.welcome-actions { margin-top: 46px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.welcome-lang { display: flex; gap: 18px; margin-top: 26px; justify-content: center; font-size: 13px; font-weight: 600; }
.welcome-lang span { cursor: pointer; opacity: 0.5; color: #fff; transition: opacity 0.15s; }
.welcome-lang span.active { opacity: 1; }

/* ── Auth Screen ─────────────────────────────────────────────────────────────── */
.auth-screen {
  background: var(--bg-0);
}

/* Gradient auth screens (Login, Forgot) */
.auth-grad-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(135% 80% at 50% -10%, #1FBE8B 0%, #0E8F7E 26%, #0a3a33 55%, #06201C 100%);
}
.light-mode .auth-grad-wrap {
  background: radial-gradient(135% 80% at 50% -10%, #1FBE8B 0%, #0E8F7E 18%, #cdeee5 50%, var(--bg-0) 100%);
}
.auth-grad-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.light-mode .auth-grad-glow { opacity: .07 !important; }

/* Text / icon tokens for gradient screens */
.auth-grd-title   { color: #fff; }
.auth-grd-sub     { color: rgba(255,255,255,.78); line-height: 1.5; }
.auth-grd-label   { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: rgba(255,255,255,.72); }
.auth-grd-back    { display:flex; align-items:center; gap:6px; color:rgba(255,255,255,.88); font-size:14px; background:transparent; border:none; cursor:pointer; font-family:inherit; padding:0; }
.auth-grd-footer  { color: rgba(255,255,255,.78); line-height: 1.5; }
.auth-grd-input   { flex:1; background:transparent; border:none; outline:none; color:#fff; font-size:14px; font-family:inherit; padding:0; margin:0; height:20px; line-height:20px; align-self:center; }
.auth-grd-input::placeholder { color: rgba(255,255,255,.42); }
.light-mode .login-field { border-color: rgba(0,0,0,.12); }
.light-mode .login-field:focus-within { border-color: var(--border-focus); }
.auth-icon-wrap { background: rgba(31,190,139,.22); }
.light-mode .auth-icon-wrap { background: #0b2a25; }
.light-mode .auth-grd-input { color: var(--text-1); }
.light-mode .auth-grd-input::placeholder { color: var(--text-4); }
.light-mode .auth-grd-icon { color: var(--text-3); }
.light-mode .auth-grd-icon-sm { color: var(--text-4); }
.auth-grd-icon    { color: rgba(255,255,255,.72); font-size: 18px; }
.auth-grd-icon-sm { color: rgba(255,255,255,.55); cursor: pointer; font-size: 18px; }

.light-mode .auth-grd-title   { color: var(--text-1); }
.light-mode .auth-grd-sub     { color: var(--text-3); }
.light-mode .auth-grd-label   { color: var(--text-3); }
.light-mode .auth-grd-back    { color: var(--text-2); }
.light-mode .auth-grd-footer  { color: var(--text-3); }
.auth-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 22px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.auth-body { padding: 0 26px 32px; flex: 1; overflow-y: auto; }
.auth-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--text-1);
  letter-spacing: -0.5px;
}
.auth-subtitle { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.auth-notice {
  display: flex;
  gap: 11px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(230,182,85,0.1);
  border: 1px solid rgba(230,182,85,0.3);
}
.auth-notice i { color: var(--gold); font-size: 20px; flex: none; margin-top: 1px; }
.auth-notice p { font-size: 12px; color: var(--gold); line-height: 1.5; font-weight: 600; }

/* Login field (glass style on gradient bg) */
.login-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--field-glass);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 14px;
  padding: 15px;
  transition: border-color 0.15s;
}
.login-field:focus-within { border-color: rgba(255,255,255,.5); }

/* Signup-specific field style (matches design exactly) */
.signup-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-3);
}
.signup-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  margin-top: 9px;
  transition: border-color 0.15s;
}
.signup-field:focus-within { border-color: var(--border-focus); }

/* Add member — relationship chips */
.am-rel {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.am-rel.sel { background: linear-gradient(135deg,#1FBE8B,#0E8F7E); color: #06201C; font-weight: 700; border: none; }
.am-rel.unsel { background: var(--bg-2); color: var(--text-3); font-weight: 500; border: 1px solid var(--border); }

/* Add member — member type buttons */
.am-type {
  flex: 1;
  border-radius: 14px;
  padding: 13px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.am-type.sel { background: linear-gradient(135deg,#1FBE8B,#0E8F7E); color: #06201C; font-weight: 700; border: none; }
.am-type.unsel { background: var(--bg-2); color: var(--text-3); font-weight: 500; border: 1px solid var(--border); }

.signup-field input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
  padding: 0;
  margin: 0;
  line-height: 1;
}

/* ── OTP Screen ──────────────────────────────────────────────────────────────── */
.otp-grid { display: flex; gap: 9px; justify-content: center; margin: 30px 0; }
.otp-box {
  width: 46px;
  height: 58px;
  border-radius: 13px;
  background: var(--field-glass);
  border: 1.5px solid rgba(255,255,255,.35);
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  outline: none;
  padding: 0;
  caret-color: var(--primary);
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
}
.otp-box:focus { border-color: var(--primary); }
.otp-box.filled { border-color: var(--primary); }
.light-mode .otp-box { border-color: rgba(0,0,0,.12); color: var(--text-1); }

/* ── Role picker ─────────────────────────────────────────────────────────────── */
.role-pick { display: flex; gap: 10px; }
.role-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.role-option.selected { background: var(--grad-primary); color: #06201C; }
.role-option.unselected { background: var(--bg-2); border: 1px solid var(--border); color: var(--text-3); }

/* Role card (signup screen) */
.role-card {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.role-card-active {
  background: rgba(31,190,139,.16);
  border-color: rgba(31,190,139,.45);
}

/* ── Relationship chips ──────────────────────────────────────────────────────── */
.rel-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.rel-chip {
  padding: 9px 15px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.rel-chip.sel { background: var(--grad-primary); color: #06201C; font-weight: 700; }
.rel-chip.unsel { background: var(--bg-2); border: 1px solid var(--border); color: var(--text-3); }

/* ── Tab text utilities (use CSS vars so light mode works) ───────────────────── */
.tab-heading      { font-family:'Sora',sans-serif; font-weight:800; font-size:24px; color:var(--text-1); letter-spacing:-.5px; }
.tab-subtext      { font-size:12px; color:var(--text-3); margin-top:3px; line-height:1.5; }
.tab-section-title{ font-family:'Sora',sans-serif; font-weight:700; font-size:17px; color:var(--text-1); }
.tab-label-xs     { font-size:11px; color:var(--text-3); font-weight:700; letter-spacing:1px; margin-bottom:10px; }

/* ── Main App Layout ─────────────────────────────────────────────────────────── */
#screen-app {
  background: var(--bg-0);
  display: none;
  flex-direction: column;
}
#screen-app.active { display: flex; }

/* ── Top bar ─────────────────────────────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  padding: 10px 22px 0;
  gap: 12px;
  flex: none;
}
.top-bar-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: var(--text-1);
  flex: 1;
}
.top-bar-actions { display: flex; gap: 16px; align-items: center; }
.top-bar-icon { color: var(--text-3); font-size: 23px; cursor: pointer; transition: color 0.15s; }
.top-bar-icon:hover { color: var(--text-1); }
.top-bar-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Tab bar ─────────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  justify-content: space-around;
  padding: 12px 0 20px;
  background: rgba(10,31,27,0.95);
  border-top: 1px solid var(--border);
  flex: none;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-4);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0 12px;
}
.tab-item i { font-size: 23px; }
.tab-item.active { color: var(--primary); }

/* ── Filter chips row ────────────────────────────────────────────────────────── */
.filter-row { display: flex; gap: 9px; padding: 10px 22px 12px; overflow-x: auto; flex: none; }
.filter-row::-webkit-scrollbar { display: none; }

/* ── Chat list ───────────────────────────────────────────────────────────────── */
.chat-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-item:hover { background: rgba(255,255,255,0.02); }
.chat-item:active { background: rgba(255,255,255,0.04); }
.chat-info { flex: 1; min-width: 0; }
.chat-row1 { display: flex; justify-content: space-between; align-items: center; }
.chat-name { font-weight: 700; font-size: 15px; color: var(--text-1); }
.chat-time { font-size: 11px; color: var(--text-3); }
.chat-row2 { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.chat-preview { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge {
  background: var(--primary);
  color: #06201C;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex: none;
}

/* ── FAB ─────────────────────────────────────────────────────────────────────── */
.fab {
  position: absolute;
  right: 22px;
  bottom: 104px;
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1FBE8B, #0E8F7E);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px -8px rgba(31,190,139,0.6);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s;
}
.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(0.95); }
.fab i { color: #06201C; font-size: 26px; }

/* ── Conversation view ───────────────────────────────────────────────────────── */
#conv-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0E0E10;
  transition: background 0.3s;
}
.conv-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
}
.conv-name { font-weight: 700; font-size: 15px; color: var(--text-1); display: flex; align-items: center; gap: 5px; }
.conv-status { font-size: 11px; color: var(--text-3); }
.conv-status.online { color: var(--primary); }

/* conv 3-dot dropdown */
.conv-menu-dropdown {
  position: fixed;
  top: 58px;
  right: 14px;
  z-index: 3000;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  min-width: 200px;
  overflow: hidden;
  animation: popIn .15s cubic-bezier(.18,.8,.3,1) both;
}
.conv-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 17px;
  background: none;
  border: none;
  color: var(--text-1);
  font-size: 14.5px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.conv-menu-item:hover { background: var(--bg-2); }
.conv-messages {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.conv-date-sep {
  align-self: center;
  font-size: 11px;
  color: var(--text-3);
  background: rgba(0,0,0,0.3);
  padding: 5px 13px;
  border-radius: var(--radius-full);
}
.msg-wrap { display: flex; flex-direction: column; max-width: 78%; }
.msg-wrap.sent { align-self: flex-end; align-items: flex-end; }
.msg-wrap.recv { align-self: flex-start; align-items: flex-start; }
.msg-sender { font-size: 11px; font-weight: 700; margin: 0 0 3px 12px; }
.msg-bubble {
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  animation: fadeIn 0.2s ease;
}
.msg-bubble.sent {
  background: var(--grad-primary);
  color: #06201C;
  font-weight: 500;
  border-radius: 18px 18px 6px 18px;
}
.msg-bubble.recv {
  background: rgba(40,46,54,0.92);
  color: var(--text-1);
  border-radius: 18px 18px 18px 6px;
}
.msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0.8;
  font-size: 10px;
  margin-left: 6px;
}
.msg-ticks { font-size: 14px; }
.msg-ticks.delivered { color: var(--text-3); }
.msg-ticks.read { color: #0a5a8a; }

/* Effect overlays */
.msg-effect {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}
.effect-particle {
  position: absolute;
  top: 0;
  left: 50%;
  font-size: 18px;
  animation: pyFall 1.5s ease-out forwards;
}

/* Media messages */
.msg-media { border-radius: 15px; overflow: hidden; max-width: 200px; cursor: pointer; }
.msg-media img, .msg-media video { width: 100%; display: block; border-radius: 15px; }
.msg-file {
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
}
.msg-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255,92,108,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.msg-file-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-size { font-size: 11px; color: var(--text-3); }

/* ── Composer ─────────────────────────────────────────────────────────────────── */
.composer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 13px 26px;
  background: rgba(10,15,18,0.6);
  backdrop-filter: blur(8px);
}
.composer-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #15171a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  padding: 8px 8px 8px 14px;
}
.composer-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 14px;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
}
.composer-input::placeholder { color: var(--text-3); }
.composer-icon { color: var(--text-3); font-size: 20px; cursor: pointer; flex: none; transition: color 0.15s; }
.composer-icon:hover { color: var(--text-1); }
.composer-effect-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(124,92,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  flex: none;
  animation: pyPulse 3s infinite;
}
.composer-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -6px rgba(31,190,139,0.6);
  transition: transform 0.15s, box-shadow 0.15s;
}
.composer-send:hover { transform: scale(1.05); box-shadow: 0 8px 20px -4px rgba(31,190,139,0.7); }
.composer-send:active { transform: scale(0.93); }

/* ── Image crop modal ────────────────────────────────────────────────────────── */
#img-crop-modal { background: var(--bg-0); color: var(--text-1); }
#img-crop-modal button { color: var(--text-2); }

/* ── Emoji & attach pickers ──────────────────────────────────────────────────── */
#composer-emoji-picker {
  background: var(--bg-1);
  border: 1px solid var(--border);
  flex-direction: column;
  overflow: hidden;
  height: 310px;
}
#composer-attach-picker {
  background: var(--bg-1);
  border: 1px solid var(--border);
}
.light-mode #composer-emoji-picker,
.light-mode #composer-attach-picker {
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
}

/* ── Composer icon buttons ───────────────────────────────────────────────────── */
.composer-icon-btn {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-3);
  transition: color 0.15s;
  flex: none;
}
.composer-icon-btn:hover { color: var(--text-1); }
.composer-icon-btn.active { color: var(--primary); }

/* ── Emoji & attach overlay panels ──────────────────────────────────────────── */
.composer-overlay-panel {
  animation: slideUp 0.22s cubic-bezier(.18,.8,.3,1) both;
}

/* ── Categorized emoji picker ────────────────────────────────────────────────── */
.emoji-cat-tabs {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 4px 6px;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  flex: none;
  scrollbar-width: none;
}
.emoji-cat-tabs::-webkit-scrollbar { display: none; }
.emoji-cat-tab {
  font-size: 20px;
  background: transparent;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
}
.emoji-cat-tab:hover { opacity: 0.85; background: rgba(255,255,255,.06); }
.emoji-cat-tab.active { opacity: 1; background: rgba(255,255,255,.1); }
.light-mode .emoji-cat-tab:hover { background: rgba(0,0,0,.06); }
.light-mode .emoji-cat-tab.active { background: rgba(0,0,0,.08); }

.emoji-grid-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.emoji-grid-scroll::-webkit-scrollbar { width: 4px; }
.emoji-grid-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.emoji-cat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 2px 4px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.emoji-btn-in-grid {
  font-size: 24px;
  background: transparent;
  border: none;
  width: 100%;
  height: 38px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.1s;
  line-height: 1;
}
.emoji-btn-in-grid:hover { background: rgba(255,255,255,.08); }
.light-mode .emoji-btn-in-grid:hover { background: rgba(0,0,0,.07); }

/* ── Attach picker ───────────────────────────────────────────────────────────── */
.attach-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}
.attach-option:hover { background: rgba(255,255,255,.05); }
.attach-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* Typing indicator */
.typing-indicator {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(24,68,60,0.92);
  padding: 11px 16px;
  border-radius: 18px 18px 18px 6px;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: blink 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Effect picker ───────────────────────────────────────────────────────────── */
.effect-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.effect-tile {
  height: 78px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--bg-2);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.effect-tile:hover { border-color: rgba(255,255,255,0.15); }
.effect-tile.sel { background: rgba(124,92,255,0.2); border-color: var(--violet); }
.effect-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
}
.effect-tile.sel .effect-icon { background: var(--violet); }
.effect-tile.sel .effect-icon i { color: #fff; }
.effect-label { font-size: 10.5px; color: var(--text-3); font-weight: 600; text-align: center; }
.effect-tile.sel .effect-label { color: var(--text-1); }
.sound-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sound-chip {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.sound-chip.sel { background: var(--grad-primary); color: #06201C; }
.sound-chip.unsel { background: var(--bg-2); border: 1px solid var(--border); color: var(--text-3); }

/* ── Family circle ───────────────────────────────────────────────────────────── */
.family-member {
  position: absolute;
  text-align: center;
  cursor: pointer;
}

/* ── Mahram approval card ────────────────────────────────────────────────────── */
.approval-card {
  background: linear-gradient(180deg, rgba(230,182,85,0.1), rgba(255,255,255,0.02));
  border: 1px solid rgba(230,182,85,0.28);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
}
.approval-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.approval-people { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.approval-message {
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 11px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 12px;
}
.approval-actions { display: flex; gap: 10px; }

/* ── Settings ────────────────────────────────────────────────────────────────── */
.settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 20px;
  cursor: pointer;
}
.settings-list {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover { background: rgba(255,255,255,0.02); }
.settings-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(31,190,139,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.settings-row-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-1); }
.settings-row-desc { font-size: 12px; color: var(--text-3); }

/* ── Settings card ───────────────────────────────────────────────────────────── */
.settings-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  overflow: hidden;
}
.light-mode .settings-card {
  background: var(--bg-1);
  border-color: var(--border);
}
/* Profile card button — reuse .settings-profile but make it a button */
button.settings-profile {
  cursor: pointer;
  width: 100%;
}
.light-mode .settings-profile {
  background: var(--bg-1);
  border-color: var(--border);
}

/* ── Sub-page header bar ─────────────────────────────────────────────────────── */
.subpage-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex: none;
}
.light-mode .subpage-hdr {
  border-bottom-color: var(--border);
}

/* ── Contact info screen ─────────────────────────────────────────────────────── */
#screen-contact-info .ci-action-btn {
  flex: 1;
  background: rgba(31,190,139,.12);
  border: 1px solid rgba(31,190,139,.3);
  color: var(--primary);
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}
.light-mode #screen-contact-info .ci-action-btn {
  background: rgba(14,143,126,.10);
  border-color: rgba(14,143,126,.25);
}
#ci-avatar { box-shadow: 0 0 0 3px var(--bg-1), 0 0 0 5px rgba(31,190,139,.35); }

/* ── Settings sub-page rows ──────────────────────────────────────────────────── */
.st-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.st-row:hover { background: rgba(255,255,255,.02); }
.light-mode .st-row { border-bottom-color: var(--border); }
.light-mode .st-row:hover { background: rgba(0,0,0,.03); }
.st-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(31,190,139,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.light-mode .st-icon { background: rgba(14,143,126,.10); }
.st-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-1); }
.priv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.light-mode .priv-row { border-bottom-color: var(--border); }
.lang-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  width: 100%;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.light-mode .lang-row { border-bottom-color: var(--border); }

/* ── Storage card (privacy screen) ──────────────────────────────────────────── */
.storage-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(31,190,139,.2);
  border-radius: 16px;
  padding: 16px;
}
.light-mode .storage-card { background: var(--bg-1); }
.storage-track { background: rgba(255,255,255,.08); }
.light-mode .storage-track { background: var(--border); }

/* ── Animation tiles (screen-animations) ────────────────────────────────────── */
.light-mode #anim-list button { border-color: rgba(10,30,24,.09) !important; background: var(--bg-1) !important; }
.light-mode #anim-list button[style*="7C5CFF"] { background: rgba(124,92,255,.08) !important; border-color: #7C5CFF !important; }

/* ── QR code ─────────────────────────────────────────────────────────────────── */
.qr-card {
  background: #fff;
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qr-label { font-size: 12px; color: #5E7A72; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.invite-code { font-family: 'Sora', sans-serif; font-size: 22px; color: #102A25; font-weight: 800; letter-spacing: 4px; margin-top: 14px; }

/* ── Call screen ─────────────────────────────────────────────────────────────── */
#screen-call {
  background: radial-gradient(120% 70% at 50% 0%, #13123a 0%, #0a1f1b 55%, #06140f 100%);
}
.call-avatar-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto;
}
.call-avatar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(31,190,139,0.3);
}
.call-controls { display: flex; gap: 18px; justify-content: center; }
.call-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.call-btn-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.call-btn-circle:hover { background: rgba(255,255,255,0.14); }
.call-end {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF4D6D, #E5384D);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  box-shadow: 0 14px 30px -8px rgba(229,56,77,0.6);
}

/* ── Video call ──────────────────────────────────────────────────────────────── */
#screen-video-call {
  background: linear-gradient(165deg, #2a3142, #141a26 60%, #0a0f17);
  position: relative;
}
.video-self {
  position: absolute;
  right: 18px;
  top: 120px;
  width: 96px;
  height: 132px;
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.25);
  z-index: 10;
  background: var(--grad-primary);
}
.video-controls {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 10;
}
.video-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ── Theme swatches ──────────────────────────────────────────────────────────── */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-swatch {
  cursor: pointer;
}
.theme-preview {
  height: 56px;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.theme-preview.sel {
  border-color: #fff;
  box-shadow: 0 0 0 2.5px var(--primary);
}
.theme-name { font-size: 10.5px; color: var(--text-3); text-align: center; margin-top: 5px; }

/* ── Search screen ───────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 11px 16px;
  margin: 12px 18px;
}
.search-bar input { flex: 1; background: none; border: none; outline: none; color: var(--text-1); font-size: 15px; }
.search-bar input::placeholder { color: var(--text-3); }

/* ── Notification row ────────────────────────────────────────────────────────── */
.notif-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-row:last-child { border-bottom: none; }
.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(31,190,139,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.notif-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-1); }
.notif-row .toggle { flex: none; margin-left: auto; }

/* ── Offline/Server status banner ───────────────────────────────────────────── */
.status-banner {
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  display: none;
}
.status-banner.offline { background: rgba(255,92,168,0.15); color: #FF5CA8; display: block; }
.status-banner.connecting { background: rgba(230,182,85,0.15); color: var(--gold); display: block; }

/* ── Section header ──────────────────────────────────────────────────────────── */
.section-header {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  padding: 16px 18px 4px;
  color: var(--text-1);
}

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
  gap: 12px;
}
.empty-state i { font-size: 48px; color: var(--text-4); }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text-2); }
.empty-state-desc { font-size: 14px; color: var(--text-3); line-height: 1.5; }

/* ── Profile picture placeholder ────────────────────────────────────────────── */
.pending-badge {
  background: var(--gold);
  color: #3a2c08;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

/* ── Gradient themes ─────────────────────────────────────────────────────────── */
.theme-aurora    { background: linear-gradient(120deg,#1FBE8B,#38C9E0,#7C5CFF,#1FBE8B); background-size: 300% 300%; animation: pyShift 8s ease infinite; }
.theme-sunset    { background: linear-gradient(120deg,#FF5CA8,#FFB020,#FF7A59,#FF5CA8); background-size: 300% 300%; animation: pyShift 9s ease infinite; }
.theme-nebula    { background: linear-gradient(120deg,#7C5CFF,#38E0D0,#FF5CA8,#7C5CFF); background-size: 300% 300%; animation: pyShift 7s ease infinite; }
.theme-emerald   { background: linear-gradient(120deg,#0B2A25,#11352F,#18443C,#0E8F7E); background-size: 300% 300%; animation: pyShift 10s ease infinite; }

/* ── Responsive tweaks ───────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  body { display: flex; align-items: center; justify-content: center; background: #020f0c; }
  #app {
    width: 390px;
    height: 844px;
    border-radius: 46px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
    overflow: hidden;
  }
  .tab-bar { border-radius: 0 0 46px 46px; }
}

/* ── RTL support ─────────────────────────────────────────────────────────────── */
[dir="rtl"] { font-family: 'Noto Kufi Arabic', 'Plus Jakarta Sans', sans-serif; }
[dir="rtl"] .msg-bubble.sent { border-radius: 18px 18px 18px 6px; }
[dir="rtl"] .msg-bubble.recv { border-radius: 18px 18px 6px 18px; }

/* ── Modal open state (JS uses .open) ──────────────────────────────────────── */
.modal-overlay.open { display: flex; }

/* ── Toast classes (JS uses toast-success, toast-error, toast-warn) ─────────── */
.toast-success { border-color: rgba(31,190,139,0.4); color: var(--text-1); }
.toast-error   { border-color: rgba(255,92,168,0.4); color: #FF5CA8; }
.toast-warn    { border-color: rgba(230,182,85,0.4); color: var(--gold); }
.toast.fade-out { opacity: 0; transform: translateX(20px); transition: all 0.4s ease; }

/* ── Status banner visible state ─────────────────────────────────────────────── */
.status-banner.visible { display: block; }
.status-banner.warn  { background: rgba(230,182,85,0.18); color: var(--gold); }
.status-banner.error { background: rgba(255,92,168,0.18); color: #FF5CA8; }

/* ── Chat list item layout helpers ──────────────────────────────────────────── */
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-row  { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.chat-item-name { font-weight: 700; font-size: 15px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-item-time { font-size: 11px; color: var(--text-3); flex: none; }
.chat-item-time-unread { color: var(--primary); }
.chat-item-preview { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; margin-top: 3px; }

/* ── Message row wrapper ─────────────────────────────────────────────────────── */
.msg-row { display: flex; align-items: flex-end; gap: 2px; margin-bottom: 4px; }
.msg-row.sent { justify-content: flex-end; }
.msg-row.recv { justify-content: flex-start; }
.msg-receipt {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 2px;
  transition: background 0.15s;
}
.msg-receipt:hover { background: rgba(255,255,255,0.15); }
.light-mode .msg-receipt:hover { background: rgba(0,0,0,0.1); }

/* ── Message info popup ──────────────────────────────────────────────────────── */
.msg-info-popup {
  position: fixed;
  z-index: 8000;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 10px;
  min-width: 220px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  animation: popIn 0.18s cubic-bezier(.18,.8,.3,1) both;
}
.light-mode .msg-info-popup {
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(4px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
.msg-info-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.msg-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.msg-info-row + .msg-info-row {
  border-top: 1px solid var(--border);
}
.msg-info-row--dim { opacity: 0.38; }
.msg-info-icon { font-size: 17px; flex: none; }
.msg-info-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
}
.msg-info-time {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.msg-text { white-space: pre-wrap; }
.msg-image { max-width: 200px; border-radius: 12px; cursor: pointer; display: block; }
.msg-file-link { display: flex; align-items: center; gap: 8px; color: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; }

/* ── Theme tile ──────────────────────────────────────────────────────────────── */
.theme-tile {
  height: 66px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: flex-end;
}
.theme-tile:hover { border-color: rgba(255,255,255,0.3); }
.theme-tile.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }
.theme-tile-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  padding: 4px 8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Effect tile selected state in JS (selected class) ──────────────────────── */
.effect-tile.selected { background: rgba(124,92,255,0.2); border-color: var(--violet); }
.effect-tile.selected .effect-label { color: var(--text-1); }
.effect-tile.selected .effect-icon { background: var(--violet); }

.family-member-label { font-size: 10px; color: var(--text-3); margin-top: 5px; white-space: nowrap; }

/* ── Avatar badge default (online indicator) ─────────────────────────────────── */
.avatar-badge { background: #1FBE8B; }

/* ── Shake animation for OTP grid ────────────────────────────────────────────── */
.shake { animation: pyShake 0.5s ease; }

/* ── Chat background themes ─────────────────────────────────────────────────── */
.chat-bg { position: absolute; inset: 0; z-index: 0; transition: background 0.3s; }
.chat-bg.theme-aurora  { background: linear-gradient(120deg,#1FBE8B,#38C9E0,#7C5CFF,#1FBE8B); background-size:300% 300%; animation:pyShift 8s ease infinite; }
.chat-bg.theme-sunset  { background: linear-gradient(120deg,#FF5CA8,#FFB020,#FF7A59,#FF5CA8); background-size:300% 300%; animation:pyShift 9s ease infinite; }
.chat-bg.theme-nebula  { background: linear-gradient(120deg,#7C5CFF,#38E0D0,#FF5CA8,#7C5CFF); background-size:300% 300%; animation:pyShift 7s ease infinite; }
.chat-bg.theme-emerald { background: linear-gradient(120deg,#0B2A25,#11352F,#18443C,#0E8F7E); background-size:300% 300%; animation:pyShift 10s ease infinite; }
.chat-bg.bg-payra          { background: radial-gradient(900px 600px at 50% -10%, rgb(22, 48, 42), rgb(10, 15, 18) 60%); }
.chat-bg.bg-midnight-radial{ background: radial-gradient(900px 600px at 50% -10%, rgb(6, 32, 28), rgb(5, 8, 10) 60%); }
.chat-bg.bg-violet-radial  { background: radial-gradient(900px 600px at 50% -10%, rgb(30, 5, 51), rgb(10, 10, 18) 60%); }
.chat-bg.bg-midnight   { background: #06201C; }
.chat-bg.bg-slate      { background: #0F172A; }
.chat-bg.bg-forest     { background: #052e16; }
.chat-bg.bg-plum       { background: #1e0533; }
.chat-bg.bg-crimson    { background: #1f0a0a; }
.chat-bg.bg-ocean      { background: #0c1a2e; }
.chat-bg.bg-sand       { background: #f5f0e8; }
.chat-bg.bg-ivory      { background: #fffef4; }
.chat-bg.bg-mint       { background: #e8f5f0; }
.chat-bg.bg-rose       { background: #fdf0f5; }

/* ── Key exchange modal ──────────────────────────────────────────────────────── */
.ke-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  justify-content: center;
}
.ke-active  { background: rgba(31,190,139,.14); color: #1FBE8B; border: 1px solid rgba(31,190,139,.35); }
.ke-pending { background: rgba(230,182,85,.12);  color: #E6B655; border: 1px solid rgba(230,182,85,.35); }
.light-mode .ke-active  { background: rgba(14,143,126,.1);  border-color: rgba(14,143,126,.3); }
.light-mode .ke-pending { background: rgba(180,130,20,.1);  color: #A07010; border-color: rgba(180,130,20,.3); }

.ke-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
}

.ke-textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  color: var(--text-1);
  resize: none;
  outline: none;
  line-height: 1.6;
  transition: border-color .15s;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.ke-textarea:focus { border-color: var(--border-focus); }
.ke-textarea::placeholder { color: var(--text-4); }

.ke-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity .15s, transform .1s;
}
.ke-btn:active { transform: scale(.98); opacity: .85; }
.ke-btn-primary { background: var(--bg-2); color: var(--text-1); border: 1px solid var(--border); }
.ke-btn-confirm { background: var(--grad-primary); color: #06201C; }
.ke-btn-ghost   { background: transparent; color: var(--text-3); border: 1px solid var(--border); font-size: 13px; padding: 10px; }

/* ── Key setup overlay ───────────────────────────────────────────────────────── */
#key-setup-overlay {
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

/* ── Reply feature ───────────────────────────────────────────────────────────── */

/* Action button (appears beside bubble on hover / swipe) */
.msg-actions {
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s;
  flex: none;
  padding: 0 2px;
}
.msg-row:hover .msg-actions { opacity: 1; }
.msg-action-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  font-size: 15px;
  transition: color 0.15s, background 0.15s;
  flex: none;
}
.msg-action-btn:hover { color: var(--primary); background: var(--bg-3); }
.light-mode .msg-action-btn { background: var(--bg-3); border-color: var(--border); }

/* Reply quote inside bubble */
.msg-reply-quote {
  background: rgba(0,0,0,.18);
  border-left: 3px solid rgba(255,255,255,.45);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: background 0.15s;
  overflow: hidden;
}
.msg-reply-quote:hover { background: rgba(0,0,0,.28); }
.msg-bubble.recv .msg-reply-quote {
  background: rgba(255,255,255,.08);
  border-left-color: var(--primary);
}
.msg-bubble.recv .msg-reply-quote:hover { background: rgba(255,255,255,.14); }
.msg-reply-name {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  margin-bottom: 2px;
}
.msg-bubble.recv .msg-reply-name { color: var(--primary); }
.msg-reply-text {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-bubble.recv .msg-reply-text { color: var(--text-2); }

/* Light mode reply quote */
.light-mode .msg-bubble.sent .msg-reply-quote { background: rgba(0,0,0,.12); border-left-color: rgba(0,0,0,.3); }
.light-mode .msg-bubble.sent .msg-reply-name  { color: rgba(0,0,0,.6); }
.light-mode .msg-bubble.sent .msg-reply-text  { color: rgba(0,0,0,.5); }

/* Highlight flash when jumping to original message */
@keyframes msgHighlight {
  0%   { box-shadow: inset 0 0 0 9999px rgba(31,190,139,.22), 0 0 0 2px rgba(31,190,139,.5); }
  100% { box-shadow: none; }
}
.msg-highlight { animation: msgHighlight 1.4s ease-out forwards; border-radius: 18px; }

/* Reply bar above composer input */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex: none;
  animation: slideUp .15s ease;
}
.reply-bar-accent {
  width: 3px;
  min-height: 32px;
  align-self: stretch;
  background: var(--primary);
  border-radius: 3px;
  flex: none;
}
.reply-bar-body { flex: 1; min-width: 0; }
.reply-bar-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}
.reply-bar-text {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-bar-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  padding: 4px;
  flex: none;
  transition: color .15s;
}
.reply-bar-close:hover { color: var(--text-1); }
