/* =============================================================================
   PiChat — Design System
   Dark glassmorphism · RTL · Responsive (mobile-first breakpoints)
   ============================================================================= */

:root {
  --font: 'Vazirmatn', 'RG Apple Emoji', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-emoji: 'RG Apple Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  --radius-xs: 8px; --radius-sm: 12px; --radius: 16px; --radius-lg: 22px; --radius-xl: 28px;
  --sidebar-w: 380px; --info-w: 360px; --header-h: 64px;
  --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.56,.64,1);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --fs: 15px;
}

/* ---------- Accent palettes ---------- */
[data-accent="violet"] { --accent: #8b5cf6; --accent-2: #ec4899; --accent-rgb: 139,92,246; }
[data-accent="blue"]   { --accent: #3b82f6; --accent-2: #06b6d4; --accent-rgb: 59,130,246; }
[data-accent="emerald"]{ --accent: #10b981; --accent-2: #84cc16; --accent-rgb: 16,185,129; }
[data-accent="rose"]   { --accent: #f43f5e; --accent-2: #f97316; --accent-rgb: 244,63,94; }
[data-accent="amber"]  { --accent: #f59e0b; --accent-2: #ef4444; --accent-rgb: 245,158,11; }

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d14; --bg-2: #0f1220; --bg-3: #151929;
  --glass: rgba(255,255,255,.045); --glass-2: rgba(255,255,255,.075); --glass-3: rgba(255,255,255,.11);
  --border: rgba(255,255,255,.08); --border-2: rgba(255,255,255,.14);
  --text: #eef0f6; --text-2: #a5abbd; --text-3: #6b7288;
  --bubble-in: rgba(255,255,255,.07); --bubble-in-border: rgba(255,255,255,.06);
  --bubble-out: linear-gradient(135deg, rgba(var(--accent-rgb),.85), rgba(var(--accent-rgb),.55));
  --bubble-out-text: #fff;
  --shadow: 0 10px 40px rgba(0,0,0,.45); --shadow-sm: 0 4px 16px rgba(0,0,0,.35);
  --scroll: rgba(255,255,255,.12);
  --danger: #f87171; --success: #34d399; --warn: #fbbf24; --online: #22c55e;
  --orb-opacity: .55;
}
/* ---------- Light theme ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f7; --bg-2: #f6f7fb; --bg-3: #ffffff;
  --glass: rgba(255,255,255,.6); --glass-2: rgba(255,255,255,.8); --glass-3: rgba(255,255,255,.95);
  --border: rgba(15,18,40,.08); --border-2: rgba(15,18,40,.14);
  --text: #12141f; --text-2: #4c5266; --text-3: #8a90a3;
  --bubble-in: rgba(255,255,255,.92); --bubble-in-border: rgba(15,18,40,.06);
  --bubble-out: linear-gradient(135deg, rgba(var(--accent-rgb),1), rgba(var(--accent-rgb),.75));
  --bubble-out-text: #fff;
  --shadow: 0 10px 40px rgba(20,25,60,.14); --shadow-sm: 0 4px 16px rgba(20,25,60,.1);
  --scroll: rgba(0,0,0,.15);
  --danger: #dc2626; --success: #059669; --warn: #d97706; --online: #16a34a;
  --orb-opacity: .35;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: var(--fs); line-height: 1.6; color: var(--text); background: var(--bg);
  height: 100%; min-height: 100vh; min-height: 100dvh; overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; background: none; border: none; outline: none; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
img, video { max-width: 100%; display: block; }
ul { list-style: none; }
::selection { background: rgba(var(--accent-rgb), .35); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.ic { width: 22px; height: 22px; flex-shrink: 0; }
.ltr { direction: ltr; unicode-bidi: embed; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Background orbs ---------- */
#bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#bg-orbs i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb-opacity); animation: orb 26s var(--ease) infinite alternate; }
#bg-orbs i:nth-child(1) { width: 55vmax; height: 55vmax; background: rgba(var(--accent-rgb), .4); top: -20vmax; right: -15vmax; }
#bg-orbs i:nth-child(2) { width: 45vmax; height: 45vmax; background: color-mix(in srgb, var(--accent-2) 40%, transparent); bottom: -15vmax; left: -10vmax; animation-delay: -8s; }
#bg-orbs i:nth-child(3) { width: 35vmax; height: 35vmax; background: rgba(59,130,246,.25); top: 40%; left: 40%; animation-delay: -16s; }
@keyframes orb { from { transform: translate(0,0) scale(1); } to { transform: translate(6vmax, -4vmax) scale(1.12); } }

/* ---------- App shell ---------- */
#app { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.app-shell {
  display: grid; grid-template-columns: var(--sidebar-w) 1fr 0; height: 100vh; height: 100dvh; overflow: hidden;
  transition: grid-template-columns .35s var(--ease);
}
.app-shell.info-open { grid-template-columns: var(--sidebar-w) 1fr var(--info-w); }
.glass { background: var(--glass); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn-icon {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  color: var(--text-2); transition: background .2s, color .2s, transform .15s var(--spring); position: relative; flex-shrink: 0;
}
.btn-icon:hover { background: var(--glass-2); color: var(--text); }
.btn-icon:active { transform: scale(.9); }
.btn-icon.sm { width: 36px; height: 36px; } .btn-icon.sm svg.ic { width: 19px; height: 19px; }
.btn-icon.active { color: var(--accent); background: rgba(var(--accent-rgb), .14); }
.btn-icon .dot { position: absolute; top: 8px; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; height: 44px; border-radius: var(--radius-sm);
  font-weight: 600; transition: transform .15s var(--spring), filter .2s, background .2s, opacity .2s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 24px rgba(var(--accent-rgb), .35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--glass-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--glass-3); }
.btn-danger { background: rgba(248,113,113,.14); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,.22); }
.btn-text { background: none; color: var(--accent); padding: 0 10px; height: 36px; }
.btn-block { width: 100%; }
.btn-lg { height: 52px; font-size: 16px; border-radius: var(--radius); }
.btn .spinner { width: 18px; height: 18px; }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input, .textarea {
  width: 100%; background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s, background .2s; color: var(--text);
}
.input:focus, .textarea:focus { border-color: rgba(var(--accent-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); background: var(--glass-2); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: none; min-height: 90px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-start: 44px; }
.input-wrap > svg.ic { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 20px; height: 20px; pointer-events: none; }
.input-wrap .clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); }
.hint { font-size: 12px; color: var(--text-3); }
.error-text { font-size: 13px; color: var(--danger); margin-top: -8px; margin-bottom: 12px; min-height: 18px; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--glass-3); border: 1px solid var(--border-2); transition: background .25s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .25s var(--spring); }
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on::after { transform: translateX(-20px); }
[dir="ltr"] .switch.on::after { transform: translateX(20px); }
.seg { display: flex; padding: 4px; background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius-sm); gap: 2px; }
.seg button { flex: 1; height: 36px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 13.5px; transition: all .2s; }
.seg button.active { background: var(--glass-3); color: var(--text); box-shadow: var(--shadow-sm); }
.range { -webkit-appearance: none; width: 100%; height: 6px; background: var(--glass-3); border-radius: 99px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 8px rgba(var(--accent-rgb), .5); cursor: pointer; }
.checkbox { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.checkbox.on { background: var(--accent); border-color: var(--accent); }
.checkbox svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.5); transition: all .2s var(--spring); }
.checkbox.on svg { opacity: 1; transform: scale(1); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: rgba(var(--accent-rgb), .15); color: var(--text); border-radius: 99px; font-size: 13px; }
.chip .avatar { width: 22px; height: 22px; font-size: 10px; }
.chip button { display: inline-flex; color: var(--text-2); } .chip button svg { width: 16px; height: 16px; }

/* ---------- Avatar ---------- */
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px; background: var(--av-bg, linear-gradient(135deg, #6366f1, #8b5cf6)); overflow: hidden; position: relative; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 28px; height: 28px; font-size: 11px; } .avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; } .avatar.xl { width: 110px; height: 110px; font-size: 40px; }
.avatar.square { border-radius: 30%; }
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-wrap .online-dot { position: absolute; bottom: 2px; inset-inline-start: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--online); border: 2.5px solid var(--bg-2); opacity: 0; transform: scale(.4); transition: all .25s var(--spring); }
.avatar-wrap.online .online-dot { opacity: 1; transform: scale(1); }
.avatar-wrap .story-ring { position: absolute; inset: -3px; border-radius: 50%; padding: 2.5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.avatar-wrap .story-ring.seen { background: var(--border-2); }

/* =============================================================================
   AUTH
   ============================================================================= */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow: auto; }
.auth-card { width: 100%; max-width: 440px; padding: 36px 32px; border-radius: var(--radius-xl); box-shadow: var(--shadow); animation: pop .5s var(--spring); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo .mark { width: 72px; height: 72px; border-radius: 22px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; box-shadow: 0 12px 32px rgba(var(--accent-rgb), .45); }
.auth-logo .mark svg { width: 40px; height: 40px; color: #fff; }
.auth-logo h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.auth-logo p { color: var(--text-2); font-size: 14px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--text-2); font-size: 14px; }
.auth-switch button { color: var(--accent); font-weight: 600; margin-inline-start: 4px; }
.demo-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border-2); }
.demo-accounts p { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; text-align: center; }
.demo-accounts .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.demo-accounts button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--glass-2); border: 1px solid var(--border); font-size: 13px; transition: all .2s; }
.demo-accounts button:hover { background: var(--glass-3); transform: translateY(-1px); }
.demo-accounts button .avatar { width: 26px; height: 26px; font-size: 10px; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }

/* =============================================================================
   SIDEBAR
   ============================================================================= */
.sidebar { display: flex; flex-direction: column; border-inline-end: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%); min-width: 0; position: relative; overflow: hidden; }
.sb-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + var(--safe-top)); min-height: var(--header-h); }
.sb-header .search-wrap { flex: 1; }
.sb-header .search-wrap .input { height: 42px; border-radius: 99px; padding-block: 0; }
.sb-header .search-wrap > svg.ic { width: 19px; height: 19px; }
.sb-title { display: none; flex: 1; font-weight: 700; font-size: 18px; }

/* stories strip */
.stories-strip { display: flex; gap: 14px; padding: 6px 14px 12px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.stories-strip::-webkit-scrollbar { display: none; }
.story-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 66px; flex-shrink: 0; cursor: pointer; }
.story-item .avatar { width: 56px; height: 56px; font-size: 19px; }
.story-item .name { font-size: 11.5px; color: var(--text-2); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-item .add-badge { position: absolute; bottom: 0; inset-inline-start: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-2); display: grid; place-items: center; }
.story-item .add-badge svg { width: 12px; height: 12px; color: #fff; }
.story-item:hover .avatar { transform: scale(1.04); } .story-item .avatar { transition: transform .2s var(--spring); }

/* folders */
.folders { display: flex; gap: 4px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.folders::-webkit-scrollbar { display: none; }
.folders button { position: relative; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap; display: flex; align-items: center; gap: 6px; transition: color .2s; }
.folders button.active { color: var(--accent); }
.folders button.active::after { content: ''; position: absolute; bottom: -8px; left: 10px; right: 10px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.folders .count { font-size: 11px; background: var(--glass-3); padding: 0 6px; border-radius: 99px; min-width: 18px; text-align: center; line-height: 18px; }
.folders button.active .count { background: rgba(var(--accent-rgb), .2); }

/* chat list */
.chat-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 90px; }
.chat-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); cursor: pointer; position: relative;
  transition: background .18s; user-select: none; -webkit-user-select: none;
}
.chat-item:hover { background: var(--glass-2); }
.chat-item.active { background: rgba(var(--accent-rgb), .16); }
.chat-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-item .row { display: flex; align-items: center; gap: 6px; }
.chat-item .title { font-weight: 600; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.chat-item .title svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.chat-item .time { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }
.chat-item .preview { font-size: 13.5px; color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .preview .you { color: var(--accent); }
.chat-item .preview .typing { color: var(--accent); }
.chat-item .preview .draft { color: var(--danger); }
.chat-item .preview .sender { color: var(--text); }
.chat-item .meta { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.chat-item .ticks { display: inline-flex; color: var(--text-3); } .chat-item .ticks.read { color: var(--accent); } .chat-item .ticks svg { width: 17px; height: 17px; }
.badge { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.badge.muted { background: var(--text-3); }
.chat-item .pin-ic { color: var(--text-3); width: 15px; height: 15px; }
.chat-item .mute-ic { color: var(--text-3); width: 14px; height: 14px; }
.list-section { font-size: 12px; color: var(--text-3); padding: 12px 14px 4px; font-weight: 600; }

/* FAB */
.fab { position: absolute; bottom: calc(22px + var(--safe-bottom)); inset-inline-start: 22px; width: 58px; height: 58px; border-radius: 20px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(var(--accent-rgb), .45); transition: transform .25s var(--spring), box-shadow .2s; z-index: 5; }
.fab:hover { transform: translateY(-2px) scale(1.03); } .fab:active { transform: scale(.94); }
.fab svg { width: 26px; height: 26px; }

/* empty state */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; color: var(--text-3); gap: 10px; height: 100%; }
.empty .ill { width: 96px; height: 96px; border-radius: 30px; background: var(--glass-2); display: grid; place-items: center; margin-bottom: 8px; }
.empty .ill svg { width: 44px; height: 44px; color: var(--text-3); }
.empty h3 { color: var(--text); font-size: 17px; }
.empty p { font-size: 14px; max-width: 280px; line-height: 1.7; }

/* drawer menu */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(0,0,0,.5); animation: fade .25s; }
.drawer .panel { position: relative; width: min(320px, 85vw); height: 100%; background: var(--bg-2); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; animation: slide-in-r .3s var(--ease); padding-top: var(--safe-top); }
.drawer .me { padding: 22px 20px 16px; background: linear-gradient(160deg, rgba(var(--accent-rgb), .25), transparent); display: flex; flex-direction: column; gap: 10px; }
.drawer .me .name { font-weight: 700; font-size: 17px; }
.drawer .me .sub { font-size: 13px; color: var(--text-2); }
.drawer .me .top { display: flex; align-items: center; justify-content: space-between; }
.menu-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--text); font-size: 15px; width: 100%; text-align: start; transition: background .18s; }
.menu-item:hover { background: var(--glass-2); }
.menu-item svg { width: 22px; height: 22px; color: var(--text-2); }
.menu-item.danger { color: var(--danger); } .menu-item.danger svg { color: var(--danger); }
.menu-item .grow { flex: 1; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 12px; }
.drawer .version { margin-top: auto; padding: 14px 20px calc(14px + var(--safe-bottom)); font-size: 12px; color: var(--text-3); text-align: center; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in-r { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slide-in-l { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* =============================================================================
   MAIN / CHAT
   ============================================================================= */
.main { display: flex; flex-direction: column; min-width: 0; position: relative; background: var(--bg-2); }
.main::before { content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none; background-image: var(--wallpaper, none); background-size: 420px; }
[data-wallpaper="pattern"] .main::before { --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1.5'%3E%3Ccircle cx='20' cy='20' r='6'/%3E%3Cpath d='M70 15l8 8-8 8-8-8z'/%3E%3Ccircle cx='100' cy='70' r='4'/%3E%3Cpath d='M30 80h14M37 73v14'/%3E%3Cpath d='M80 100c6-6 12 0 18-6'/%3E%3C/g%3E%3C/svg%3E"); background-size: 120px; }
[data-wallpaper="gradient"] .main::before { --wallpaper: radial-gradient(ellipse at 20% 20%, rgba(var(--accent-rgb), .18), transparent 55%), radial-gradient(ellipse at 80% 80%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 55%); background-size: 100% 100%; }
.main.blank { align-items: center; justify-content: center; }
.main.blank .empty .ill { width: 120px; height: 120px; border-radius: 40px; }
.main.blank .empty .ill svg { width: 56px; height: 56px; color: var(--accent); }
.main.blank .kbd-hint { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
kbd { font-family: inherit; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--glass-2); border: 1px solid var(--border-2); color: var(--text-2); }

.chat-header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: calc(8px + var(--safe-top)); min-height: var(--header-h); border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); position: relative; z-index: 3; }
.chat-header .info { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.chat-header .info .title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.chat-header .info .title svg { width: 16px; height: 16px; color: var(--text-3); }
.chat-header .info .status { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header .info .status.online { color: var(--online); }
.chat-header .info .status.typing { color: var(--accent); }
.chat-header .back { display: none; }
.chat-header .actions { display: flex; align-items: center; gap: 2px; }
/* selection mode header */
.chat-header.selecting .info, .chat-header.selecting .actions, .chat-header.selecting .avatar-wrap { display: none; }
.sel-bar { display: none; flex: 1; align-items: center; gap: 8px; }
.chat-header.selecting .sel-bar { display: flex; }
.sel-bar .count { font-weight: 700; flex: 1; }

.pinned-bar { display: flex; align-items: center; gap: 12px; padding: 6px 14px; background: var(--glass); border-bottom: 1px solid var(--border); cursor: pointer; position: relative; z-index: 2; animation: slide-down .25s var(--ease); }
.pinned-bar .bar { width: 3px; height: 34px; border-radius: 3px; background: var(--accent); }
.pinned-bar .txt { flex: 1; min-width: 0; }
.pinned-bar .txt b { display: block; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.pinned-bar .txt span { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
@keyframes slide-down { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* messages area */
.messages { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 10px 10px; display: flex; flex-direction: column; gap: 3px; position: relative; scroll-behavior: auto; -webkit-overflow-scrolling: touch; }
.messages .spacer { flex: 1; }
/* v6.14.1: sticky حذف شد — چون همه‌ی جداکننده‌ها فرزند مستقیم .messages هستند، هنگام اسکرول تند همگی هم‌زمان به top می‌چسبیدند و روی هم می‌افتادند. حالا پیل شناور .float-date (مثل تلگرام) تاریخ بخش جاری را نشان می‌دهد. */
.date-sep { align-self: center; margin: 12px 0 8px; padding: 4px 14px; border-radius: 99px; background: var(--glass-2); backdrop-filter: blur(10px); font-size: 12.5px; color: var(--text-2); border: 1px solid var(--border); margin-top: 4px; }
.sys-msg { align-self: center; margin: 6px 0; padding: 5px 14px; border-radius: 99px; background: var(--glass); font-size: 12.5px; color: var(--text-2); text-align: center; max-width: 85%; }
.unread-sep { align-self: stretch; text-align: center; margin: 8px 0; position: relative; z-index: 3; font-size: 12.5px; color: var(--accent); padding: 4px; background: rgba(var(--accent-rgb), .08); border-radius: 8px; }
.loading-top { align-self: center; padding: 8px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* message row */
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: min(78%, 620px); position: relative; animation: msg-in .22s var(--ease); }
.msg.out { align-self: flex-start; flex-direction: row; }
.msg.in { align-self: flex-end; flex-direction: row-reverse; }
[dir="rtl"] .msg.out { align-self: flex-start; }
[dir="rtl"] .msg.in { align-self: flex-end; }
/* In RTL, "out" (my) messages should be on the LEFT? No — Telegram RTL puts own messages on the right. Fix: */
[dir="rtl"] .msg.out { align-self: flex-start; }
.msg.grp-first { margin-top: 8px; }
.msg .av-slot { width: 34px; flex-shrink: 0; align-self: flex-end; }
.msg .av-slot .avatar { width: 34px; height: 34px; font-size: 12px; cursor: pointer; }
.msg.in:not(.grp-last) .av-slot .avatar { visibility: hidden; }
.msg.out .av-slot { display: none; }
.msg .sel { width: 24px; flex-shrink: 0; align-self: center; display: none; }
.messages.selecting .msg .sel { display: block; }
.messages.selecting .msg { cursor: pointer; }
.msg.selected .bubble { outline: 2px solid var(--accent); outline-offset: 1px; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.bubble {
  position: relative; padding: 7px 12px 6px; border-radius: 18px; min-width: 64px; max-width: 100%; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: var(--shadow-sm);
  font-size: var(--fs); line-height: 1.55;
}
.msg.in .bubble { background: var(--bubble-in); border: 1px solid var(--bubble-in-border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.msg.out .bubble { background: var(--bubble-out); color: var(--bubble-out-text); }
.msg.in.grp-last .bubble { border-end-end-radius: 5px; }
.msg.out.grp-last .bubble { border-end-start-radius: 5px; }
.bubble .sender-name { font-size: 13px; font-weight: 700; margin-bottom: 2px; display: block; cursor: pointer; }
.bubble .fwd { font-size: 12.5px; opacity: .85; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; font-style: italic; }
.bubble .fwd svg { width: 14px; height: 14px; }
.bubble .quote { display: flex; gap: 8px; padding: 5px 8px; margin-bottom: 6px; border-radius: 8px; background: rgba(0,0,0,.14); border-inline-start: 3px solid currentColor; cursor: pointer; min-width: 0; }
.msg.in .bubble .quote { background: rgba(var(--accent-rgb), .1); border-color: var(--accent); }
.bubble .quote .q-name { font-size: 12.5px; font-weight: 700; display: block; }
.msg.in .bubble .quote .q-name { color: var(--accent); }
.bubble .quote .q-text { font-size: 13px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 260px; }
.bubble .quote img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.bubble .text { white-space: pre-wrap; }
.bubble .text a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.msg.in .bubble .text a { color: var(--accent); }
.bubble .text .mention { color: var(--accent); font-weight: 600; cursor: pointer; }
.msg.out .bubble .text .mention { color: #fff; }
.bubble .text code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .9em; background: rgba(0,0,0,.2); padding: 1px 5px; border-radius: 5px; direction: ltr; unicode-bidi: embed; }
.bubble .text pre { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .88em; background: rgba(0,0,0,.25); padding: 8px 10px; border-radius: 8px; direction: ltr; text-align: left; overflow-x: auto; margin: 4px 0; }
.bubble .meta { float: left; margin-inline-start: 10px; margin-top: 6px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; opacity: .75; direction: ltr; height: 16px; white-space: nowrap; }
[dir="rtl"] .bubble .meta { float: left; }
.bubble .meta svg { width: 16px; height: 16px; }
.msg.out .bubble .meta .ticks.read { color: #fff; filter: drop-shadow(0 0 3px rgba(255,255,255,.8)); }
.msg.in .bubble .meta .ticks { display: none; }
.bubble .meta .edited { font-style: italic; }
.bubble.only-emoji { background: none !important; box-shadow: none; border: none !important; padding: 0 4px; }
.bubble.only-emoji .text { font-size: 44px; line-height: 1.2; }
.bubble.only-emoji .meta { position: static; float: none; display: flex; justify-content: flex-end; background: var(--glass-2); border-radius: 99px; padding: 2px 8px; margin-top: 4px; width: fit-content; margin-inline-start: auto; }
.bubble.deleted .text { font-style: italic; opacity: .7; }
.bubble .clearfix { clear: both; }

/* media */
.bubble.has-media { padding: 4px; overflow: hidden; }
.bubble.has-media .text { padding: 4px 8px 2px; }
.bubble.has-media .sender-name, .bubble.has-media .fwd, .bubble.has-media .quote { margin: 4px 8px 6px; }
.bubble.has-media .meta { margin-inline-end: 8px; margin-bottom: 4px; }
.media-img { position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--glass-2); min-width: 180px; max-width: 360px; }
.media-img img, .media-img video { width: 100%; max-height: 420px; object-fit: cover; }
/* v6.9.3: جلوگیری از منوی بومی موبایل (ذخیره/کپی تصویر) روی رسانه‌ی پیام‌ها — با نگه‌داشتن انگشت باید منوی خودِ برنامه (با گزینه‌ی حذف) باز شود، نه منوی مرورگر/سیستم‌عامل */
.media-img img, .media-img video, .bubble .vnote video, .bubble .sec-img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

.media-img .play { position: absolute; inset: 0; display: grid; place-items: center; }
.media-img .play span { width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; backdrop-filter: blur(4px); }
.media-img .play svg { width: 28px; height: 28px; }
.media-img .dur { position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; }
.media-img .overlay-meta { position: absolute; bottom: 6px; left: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; display: inline-flex; gap: 4px; align-items: center; direction: ltr; }
.media-img .overlay-meta svg { width: 15px; height: 15px; }
.bubble.media-only { background: none !important; box-shadow: none; border: none !important; padding: 0; }
.bubble.media-only .media-img { box-shadow: var(--shadow-sm); }
.upload-progress { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.upload-progress .ring { width: 48px; height: 48px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), rgba(255,255,255,.25) 0); display: grid; place-items: center; }
.upload-progress .ring::after { content: ''; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.6); }

.file-card { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 6px; min-width: 220px; max-width: 320px; }
.file-card .ic-wrap { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex-shrink: 0; position: relative; }
.msg.in .file-card .ic-wrap { background: rgba(var(--accent-rgb), .18); color: var(--accent); }
.file-card .ic-wrap svg { width: 24px; height: 24px; }
.file-card .ext { position: absolute; bottom: -4px; font-size: 9px; font-weight: 800; padding: 0 4px; border-radius: 4px; background: var(--accent); color: #fff; text-transform: uppercase; }
.file-card .fi { flex: 1; min-width: 0; }
.file-card .fi b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.file-card .fi span { font-size: 12px; opacity: .75; }

.audio-player { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-width: 240px; max-width: 320px; }
.audio-player .pp { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; flex-shrink: 0; color: inherit; }
.msg.in .audio-player .pp { background: var(--accent); color: #fff; }
.audio-player .pp svg { width: 22px; height: 22px; }
.audio-player .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 32px; cursor: pointer; direction: ltr; }
.audio-player .wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .4; height: 30%; transition: opacity .15s; }
.audio-player .wave i.on { opacity: 1; }
.audio-player .dur { font-size: 11.5px; opacity: .8; min-width: 36px; text-align: center; direction: ltr; }
.audio-player .fname { font-size: 12.5px; opacity: .8; display: block; }

.location-card { width: 260px; height: 150px; border-radius: 12px; overflow: hidden; position: relative; background: linear-gradient(135deg, #1e293b, #334155); display: grid; place-items: center; cursor: pointer; }
.location-card::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 24px 24px; }
.location-card .pin { width: 40px; height: 40px; color: var(--danger); filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); position: relative; }
.location-card .coords { position: absolute; bottom: 6px; inset-inline-start: 8px; font-size: 11px; direction: ltr; color: #fff; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 99px; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 6px 8px; min-width: 220px; }
.contact-card .ci b { display: block; } .contact-card .ci span { font-size: 12.5px; opacity: .8; direction: ltr; display: block; text-align: right; }
.sticker { font-size: 96px; line-height: 1.1; padding: 4px; }
.story-reply-card { display: flex; gap: 8px; padding: 6px; margin-bottom: 6px; border-radius: 10px; background: rgba(0,0,0,.15); align-items: center; }
.msg.in .story-reply-card { background: rgba(var(--accent-rgb), .1); }
.story-reply-card .thumb { width: 40px; height: 56px; border-radius: 8px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; font-size: 9px; text-align: center; padding: 3px; color: #fff; }
.story-reply-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-reply-card small { font-size: 12px; opacity: .85; }

/* poll */
.poll { min-width: 240px; max-width: 340px; padding: 2px 2px 0; }
.poll-q { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.poll-meta { font-size: 11.5px; opacity: .75; margin-bottom: 8px; }
.poll-options { display: flex; flex-direction: column; gap: 6px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.14); overflow: hidden; text-align: start; color: inherit; width: 100%; transition: background .2s; }
.msg.in .poll-opt { background: rgba(var(--accent-rgb), .08); }
.poll-opt:not(:disabled):hover { background: rgba(0,0,0,.22); }
.msg.in .poll-opt:not(:disabled):hover { background: rgba(var(--accent-rgb), .14); }
.poll-opt:disabled { cursor: default; }
.poll-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; opacity: .6; display: grid; place-items: center; flex-shrink: 0; position: relative; z-index: 1; }
.poll-check svg { width: 12px; height: 12px; opacity: 0; }
.poll-opt.mine .poll-check { opacity: 1; background: currentColor; }
.poll-opt.mine .poll-check svg { opacity: 1; color: var(--accent); }
.msg.out .poll-opt.mine .poll-check svg { color: var(--accent); }
.poll-txt { flex: 1; position: relative; z-index: 1; font-size: 14px; }
.poll-pct { position: relative; z-index: 1; font-size: 12.5px; font-weight: 700; min-width: 34px; text-align: left; direction: ltr; }
.poll-bar { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: rgba(255,255,255,.18); transition: width .5s var(--ease); border-radius: 10px; }
.msg.in .poll-bar { background: rgba(var(--accent-rgb), .22); }
.poll-opt.mine .poll-bar { background: rgba(255,255,255,.3); }
.msg.in .poll-opt.mine .poll-bar { background: rgba(var(--accent-rgb), .35); }
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 12.5px; opacity: .9; flex-wrap: wrap; }
.poll-foot .btn-text { height: 28px; font-size: 12.5px; color: inherit; font-weight: 700; padding: 0 6px; }
.msg.in .poll-foot .btn-text { color: var(--accent); }
.poll-opts { display: flex; flex-direction: column; gap: 8px; }
.poll-opt-row { display: flex; gap: 6px; align-items: center; }

/* reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bubble.has-media .reactions { padding: 0 8px 4px; }
.reaction { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 99px; background: rgba(0,0,0,.18); font-size: 13px; cursor: pointer; transition: transform .15s var(--spring); border: 1px solid transparent; }
.msg.in .reaction { background: rgba(var(--accent-rgb), .12); }
.reaction.me { border-color: currentColor; background: rgba(255,255,255,.25); }
.msg.in .reaction.me { background: rgba(var(--accent-rgb), .25); border-color: var(--accent); }
.reaction:hover { transform: scale(1.08); }
.reaction .n { font-size: 12px; font-weight: 600; }

/* hover actions */
.msg .quick { position: absolute; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.msg.in .quick { inset-inline-start: calc(100% + 6px); }
.msg.out .quick { inset-inline-end: calc(100% + 6px); }
.msg:hover .quick { opacity: 1; }
.msg .quick button { width: 32px; height: 32px; border-radius: 50%; background: var(--glass-2); color: var(--text-2); display: grid; place-items: center; backdrop-filter: blur(6px); }
.msg .quick button svg { width: 17px; height: 17px; }
.msg .quick button:hover { background: var(--glass-3); color: var(--text); }
.messages.selecting .msg .quick { display: none; }
.msg.highlight .bubble { animation: hl 1.8s ease; }
@keyframes hl { 0%, 40% { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .7); } 100% { box-shadow: var(--shadow-sm); } }
.msg.swiping .bubble { transition: none; }
.swipe-reply-ic { position: absolute; top: 50%; inset-inline-start: 100%; transform: translate(0,-50%) scale(0); width: 32px; height: 32px; border-radius: 50%; background: var(--glass-3); color: var(--accent); display: grid; place-items: center; margin-inline-start: 10px; transition: transform .15s; }
.msg.out .swipe-reply-ic { inset-inline-start: auto; inset-inline-end: 100%; margin-inline-end: 10px; }
.msg.swipe-armed .swipe-reply-ic { transform: translate(0,-50%) scale(1); }
.swipe-reply-ic svg { width: 18px; height: 18px; }

/* scroll-to-bottom */
.scroll-down { position: absolute; bottom: 88px; inset-inline-start: 18px; width: 46px; height: 46px; border-radius: 50%; background: var(--glass-3); backdrop-filter: blur(14px); border: 1px solid var(--border-2); color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow-sm); z-index: 4; transition: opacity .2s, transform .25s var(--spring); }
.scroll-down.hide { opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; }
.scroll-down .badge { position: absolute; top: -6px; inset-inline-start: 50%; transform: translateX(50%); }

/* typing */
.typing-dots { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; margin-inline-start: 4px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: td 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; } .typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes td { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* =============================================================================
   COMPOSER
   ============================================================================= */
.composer-wrap { padding: 8px 10px calc(10px + var(--safe-bottom)); position: relative; z-index: 3; flex-shrink: 0; }
.composer-ctx { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 4px 6px; border-radius: var(--radius); background: var(--glass-2); backdrop-filter: blur(14px); border: 1px solid var(--border); animation: slide-up .2s var(--ease); }
.composer-ctx svg.lead { width: 22px; height: 22px; color: var(--accent); }
.composer-ctx .bar { width: 3px; height: 34px; border-radius: 3px; background: var(--accent); }
.composer-ctx .txt { flex: 1; min-width: 0; }
.composer-ctx .txt b { display: block; font-size: 12.5px; color: var(--accent); }
.composer-ctx .txt span { display: block; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-ctx img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.composer { display: flex; align-items: flex-end; gap: 6px; }
.composer .box { flex: 1; display: flex; align-items: flex-end; background: var(--glass-2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 24px; padding: 4px 6px; min-height: 48px; transition: border-color .2s, box-shadow .2s; }
.composer .box:focus-within { border-color: rgba(var(--accent-rgb), .5); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .1); }
.composer textarea { flex: 1; resize: none; max-height: 160px; min-height: 40px; padding: 9px 6px; line-height: 1.5; font-size: 15.5px; overflow-y: auto; }
.composer textarea::placeholder { color: var(--text-3); }
.composer .btn-icon { width: 40px; height: 40px; }
.composer .send { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(var(--accent-rgb), .4); transition: transform .2s var(--spring), background .2s; flex-shrink: 0; }
.composer .send:active { transform: scale(.9); }
.composer .send svg { width: 22px; height: 22px; }
[dir="rtl"] .composer .send svg { transform: scaleX(-1); }
.composer .send.mic { background: var(--glass-3); color: var(--text-2); box-shadow: none; border: 1px solid var(--border); }
.composer .send.mic svg { transform: none; }
.composer .send.recording { background: var(--danger); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,.5); } 50% { box-shadow: 0 0 0 12px rgba(248,113,113,0); } }
.composer.disabled .box { opacity: .6; pointer-events: none; }
.composer-blocked { text-align: center; padding: 12px; color: var(--text-2); font-size: 14px; background: var(--glass); border-radius: var(--radius); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.recording-bar { display: flex; align-items: center; gap: 10px; flex: 1; padding: 0 8px; height: 48px; }
.recording-bar .rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.recording-bar .time { font-weight: 600; direction: ltr; min-width: 44px; }
.recording-bar .hint { flex: 1; text-align: center; }
.mention-pop { position: absolute; bottom: calc(100% + 4px); inset-inline-start: 12px; inset-inline-end: 12px; max-height: 220px; overflow-y: auto; border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 5; background: var(--bg-3); }
.mention-pop .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.mention-pop .item:hover, .mention-pop .item.active { background: var(--glass-2); }
.mention-pop .item .un { color: var(--text-3); font-size: 12.5px; direction: ltr; }

/* attach sheet */
.attach-menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px; }
.attach-menu button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: var(--radius); transition: background .2s; font-size: 12.5px; color: var(--text-2); }
.attach-menu button:hover { background: var(--glass-2); }
.attach-menu button .ic-wrap { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: #fff; }
.attach-menu button .ic-wrap svg { width: 26px; height: 26px; }

/* emoji picker */
.emoji-picker { position: absolute; bottom: calc(100% + 6px); inset-inline-end: 10px; width: 340px; max-width: calc(100vw - 20px); height: 380px; border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; z-index: 20; animation: pop .2s var(--spring); background: var(--bg-3); }
.emoji-picker .tabs { display: flex; padding: 6px; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.emoji-picker .tabs button { min-width: 38px; height: 34px; border-radius: 9px; font-size: 18px; flex-shrink: 0; }
.emoji-picker .tabs button.active { background: var(--glass-2); }
.emoji-picker .grid { flex: 1; overflow-y: auto; padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; align-content: start; }
.emoji-picker .grid button { aspect-ratio: 1; font-size: 24px; border-radius: 8px; display: grid; place-items: center; transition: transform .12s, background .12s; }
.emoji-picker .grid button:hover { background: var(--glass-2); transform: scale(1.2); }
.emoji-picker .grid .sticker-btn { font-size: 40px; grid-column: span 2; }
.emoji-picker .search { padding: 8px; border-bottom: 1px solid var(--border); }
.emoji-picker .search .input { height: 36px; padding-block: 0; border-radius: 99px; }
.emoji-picker .grid .cat { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); padding: 6px 4px 2px; font-weight: 600; }

/* =============================================================================
   INFO PANEL
   ============================================================================= */
.info-panel { border-inline-start: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); overflow: hidden; display: flex; flex-direction: column; min-width: 0; width: 0; opacity: 0; transition: opacity .3s; }
.app-shell.info-open .info-panel { width: auto; opacity: 1; }
.info-panel .ip-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + var(--safe-top)); min-height: var(--header-h); border-bottom: 1px solid var(--border); }
.info-panel .ip-header h3 { flex: 1; font-size: 16px; font-weight: 700; }
.info-panel .ip-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.ip-hero { display: flex; flex-direction: column; align-items: center; padding: 26px 20px 18px; gap: 8px; text-align: center; background: linear-gradient(180deg, rgba(var(--accent-rgb), .18), transparent); }
.ip-hero .avatar { cursor: pointer; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.ip-hero h2 { font-size: 20px; font-weight: 800; margin-top: 8px; }
.ip-hero .st { font-size: 13.5px; color: var(--text-2); }
.ip-hero .st.online { color: var(--online); }
.ip-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 16px 16px; }
.ip-actions button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: var(--radius); background: var(--glass-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); transition: background .2s, transform .15s var(--spring); }
.ip-actions button:hover { background: var(--glass-3); } .ip-actions button:active { transform: scale(.95); }
.ip-actions button svg { width: 22px; height: 22px; color: var(--accent); }
.ip-actions button.danger svg { color: var(--danger); }
.ip-actions button.danger { color: var(--danger); }
.ip-section { padding: 8px 12px; }
.ip-section + .ip-section { border-top: 1px solid var(--border); }
.ip-row { display: flex; align-items: center; gap: 14px; padding: 11px 8px; border-radius: var(--radius-sm); width: 100%; text-align: start; transition: background .18s; }
.ip-row.clickable:hover { background: var(--glass-2); cursor: pointer; }
.ip-row > svg { width: 22px; height: 22px; color: var(--text-2); flex-shrink: 0; }
.ip-row .col { flex: 1; min-width: 0; }
.ip-row .col b { display: block; font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-row .col b.ltr { direction: ltr; text-align: right; }
.ip-row .col span { font-size: 12.5px; color: var(--text-3); display: block; }
.ip-row .col .bio { white-space: pre-wrap; font-weight: 400; line-height: 1.6; }
.ip-row .end { color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.ip-row .end svg { width: 18px; height: 18px; }
.ip-tabs { display: flex; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.ip-tabs button { flex: 1; padding: 12px 4px; font-size: 13.5px; font-weight: 600; color: var(--text-2); position: relative; }
.ip-tabs button.active { color: var(--accent); }
.ip-tabs button.active::after { content: ''; position: absolute; bottom: 0; left: 15%; right: 15%; height: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
.media-grid .cell { aspect-ratio: 1; overflow: hidden; cursor: pointer; background: var(--glass-2); position: relative; }
.media-grid .cell img, .media-grid .cell video { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.media-grid .cell:hover img { transform: scale(1.05); }
.media-grid .cell .vid { position: absolute; bottom: 4px; left: 4px; color: #fff; filter: drop-shadow(0 1px 3px #000); width: 18px; height: 18px; }
.media-grid .cell .cell-goto { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .18s, background .18s; z-index: 1; }
.media-grid .cell .cell-goto svg { width: 15px; height: 15px; }
.media-grid .cell .cell-goto:hover { background: rgba(var(--accent-rgb), .85); }
.media-grid .cell:hover .cell-goto, .media-grid .cell .cell-goto:focus-visible { opacity: 1; }
@media (max-width: 1024px) { .media-grid .cell .cell-goto { opacity: 1; background: rgba(0,0,0,.35); } }
.member-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); width: 100%; text-align: start; transition: background .18s; }
.member-item:hover { background: var(--glass-2); }
.member-item .col { flex: 1; min-width: 0; }
.member-item .col b { display: block; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-item .col span { font-size: 12.5px; color: var(--text-3); }
.member-item .col span.online { color: var(--online); }
.member-item .role { font-size: 11.5px; color: var(--accent); padding: 2px 8px; border-radius: 99px; background: rgba(var(--accent-rgb), .12); flex-shrink: 0; }
.link-item { display: flex; gap: 12px; padding: 10px; align-items: center; }
.link-item .lk { width: 44px; height: 44px; border-radius: 12px; background: rgba(var(--accent-rgb), .15); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: 18px; text-transform: uppercase; }
.link-item .col { flex: 1; min-width: 0; }
.link-item .col a { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.link-item .col span { font-size: 12px; color: var(--text-3); }

/* =============================================================================
   OVERLAYS: modal, sheet, context menu, toasts, lightbox
   ============================================================================= */
/* v6.9.2: مودال/شیت/منو باید همیشه بالاترین لایه باشند — حتی وقتی از داخل نمای تمام‌صفحه‌ی رسانه یا استوری باز می‌شوند
   (پیش‌تر z-index این‌ها از لایت‌باکس/استوری کمتر بود و تأیید حذف پشت آن‌ها پنهان و غیرقابل‌کلیک می‌شد) */
.modal-root { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-root .scrim { position: absolute; inset: 0; background: rgba(4,6,14,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s; }
.modal { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 40px);  max-height: calc(100dvh - 40px); border-radius: var(--radius-xl); background: var(--bg-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: pop .3s var(--spring); overflow: hidden; }
.modal.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; }
.modal-head h3 { flex: 1; font-size: 18px; font-weight: 700; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 20px; }
.modal-foot .btn { min-width: 100px; }
.modal p.desc { color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.modal .opt-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.modal .opt-row span { flex: 1; font-size: 14.5px; }

.sheet-root { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; }
.sheet-root .scrim { position: absolute; inset: 0; background: rgba(4,6,14,.55); animation: fade .2s; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 85vh;  max-height: 85dvh; border-radius: 26px 26px 0 0; background: var(--bg-3); border: 1px solid var(--border-2); border-bottom: 0; box-shadow: var(--shadow); padding: 8px 12px calc(16px + var(--safe-bottom)); animation: slide-up .3s var(--ease); display: flex; flex-direction: column; overflow: hidden; }
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: var(--border-2); margin: 4px auto 12px; flex-shrink: 0; }
.sheet .sheet-title { font-weight: 700; font-size: 16px; padding: 0 8px 8px; }
.sheet .sheet-body { overflow-y: auto; flex: 1; }
@media (min-width: 640px) { .sheet { border-radius: 26px; margin-bottom: 24px; border-bottom: 1px solid var(--border-2); } }

.ctx-menu { position: fixed; z-index: 121; min-width: 210px; padding: 6px; border-radius: var(--radius); background: var(--bg-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: pop .15s var(--spring); transform-origin: top right; }
.ctx-menu .menu-item { padding: 9px 12px; font-size: 14.5px; gap: 12px; border-radius: 10px; }
.ctx-menu .menu-item svg { width: 20px; height: 20px; }
.ctx-menu .menu-item .kbd { margin-inline-start: auto; font-size: 11px; color: var(--text-3); }
.ctx-menu .react-row { display: flex; gap: 2px; padding: 4px 4px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.ctx-menu .react-row button { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; flex-shrink: 0; transition: transform .15s var(--spring), background .15s; display: grid; place-items: center; }
.ctx-menu .react-row button:hover { transform: scale(1.25); background: var(--glass-2); }
.ctx-menu .react-row button.me { background: rgba(var(--accent-rgb), .2); }

#toast-root { position: fixed; top: calc(14px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 24px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--bg-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 14px; pointer-events: auto; animation: toast-in .35s var(--spring); }
.toast.out { animation: toast-out .25s var(--ease) forwards; }
.toast .ic-wrap { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.toast .ic-wrap svg { width: 18px; height: 18px; }
.toast.success .ic-wrap { background: rgba(52,211,153,.18); color: var(--success); }
.toast.error .ic-wrap { background: rgba(248,113,113,.18); color: var(--danger); }
.toast.info .ic-wrap { background: rgba(var(--accent-rgb), .18); color: var(--accent); }
.toast .txt { flex: 1; min-width: 0; }
.toast .txt b { display: block; font-size: 13.5px; }
.toast .txt span { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .avatar { width: 34px; height: 34px; font-size: 12px; }
.toast.notif { cursor: pointer; }
.toast .undo { color: var(--accent); font-weight: 700; padding: 4px 8px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-20px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-14px) scale(.96); } }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.94); display: flex; flex-direction: column; animation: fade .2s; touch-action: none; }
.lightbox .lb-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: calc(10px + var(--safe-top)); color: #fff; }
.lightbox .lb-head .col { flex: 1; min-width: 0; } .lightbox .lb-head b { display: block; font-size: 15px; } .lightbox .lb-head span { font-size: 12.5px; opacity: .7; }
.lightbox .lb-head .btn-icon { color: #fff; }
.lightbox .lb-head .dl-del { color: #ff6b6b; }
.lightbox .lb-head .dl-del:hover { background: rgba(255,107,107,.15); }
.lightbox .lb-body { flex: 1; display: grid; place-items: center; overflow: hidden; position: relative; }
.lightbox .lb-body img, .lightbox .lb-body video { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s; user-select: none; }
.lightbox .lb-body video { width: 100%; height: 100%; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.lightbox .nav.prev { right: 14px; } .lightbox .nav.next { left: 14px; } .lightbox .nav.next svg { transform: scaleX(-1); }
.lightbox .lb-caption { padding: 12px 20px calc(16px + var(--safe-bottom)); color: #fff; text-align: center; font-size: 14.5px; }

/* =============================================================================
   USER LIST / SEARCH RESULTS (shared)
   ============================================================================= */
.user-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); width: 100%; text-align: start; transition: background .18s; }
.user-row:hover { background: var(--glass-2); }
.user-row .col { flex: 1; min-width: 0; }
.user-row .col b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .col span { font-size: 12.5px; color: var(--text-3); display: block; }
.user-row .col span.online { color: var(--online); }
.user-row .col .un { direction: ltr; text-align: right; }
.user-row .col .hl { color: var(--accent); }
.search-results { padding: 6px 8px; }
.search-results .list-section { padding-top: 10px; }
.search-msg { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.search-msg:hover { background: var(--glass-2); }
.search-msg .col { flex: 1; min-width: 0; }
.search-msg .col .top { display: flex; justify-content: space-between; gap: 6px; }
.search-msg .col b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-msg .col small { color: var(--text-3); font-size: 11.5px; flex-shrink: 0; }
.search-msg .col span { display: block; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-msg .col span mark { background: rgba(var(--accent-rgb), .3); color: var(--text); border-radius: 3px; padding: 0 2px; }

/* =============================================================================
   STORIES VIEWER / CREATOR
   ============================================================================= */
.story-viewer { position: fixed; inset: 0; z-index: 110; background: #000; display: flex; align-items: center; justify-content: center; animation: fade .2s; user-select: none; -webkit-user-select: none; }
.story-stage { position: relative; width: min(100vw, 480px); height: min(100vh, 860px);  height: min(100dvh, 860px); background: #111; overflow: hidden; display: flex; flex-direction: column; touch-action: none; }
@media (min-width: 640px) { .story-stage { border-radius: 20px; height: min(92vh, 860px);  height: min(92dvh, 860px); } }
.story-stage .media { position: absolute; inset: 0; display: grid; place-items: center; }
.story-stage .media img, .story-stage .media video { width: 100%; height: 100%; object-fit: cover; }
.story-stage .media .textual { width: 100%; height: 100%; display: grid; place-items: center; padding: 40px 30px; text-align: center; font-size: 28px; font-weight: 700; color: #fff; line-height: 1.6; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.story-stage .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent 22%, transparent 78%, rgba(0,0,0,.6)); pointer-events: none; }
.story-stage .progress { position: absolute; top: calc(10px + var(--safe-top)); left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.story-stage .progress i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; }
.story-stage .progress i::after { content: ''; display: block; height: 100%; width: 0; background: #fff; }
.story-stage .progress i.done::after { width: 100%; }
.story-stage .progress i.active::after { animation: prog var(--dur, 5s) linear forwards; animation-play-state: var(--play, running); }
@keyframes prog { to { width: 100%; } }
.story-stage .head { position: absolute; top: calc(22px + var(--safe-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 10px; color: #fff; z-index: 3; }
.story-stage .head .avatar { width: 38px; height: 38px; font-size: 13px; }
.story-stage .head .col { flex: 1; min-width: 0; } .story-stage .head b { display: block; font-size: 14.5px; } .story-stage .head span { font-size: 12px; opacity: .75; }
.story-stage .head .btn-icon { color: #fff; }
.story-stage .caption { position: absolute; bottom: 90px; left: 20px; right: 20px; color: #fff; text-align: center; font-size: 16px; text-shadow: 0 2px 8px rgba(0,0,0,.6); z-index: 3; }
.story-stage .zones { position: absolute; inset: 0; display: flex; z-index: 2; }
.story-stage .zones div { flex: 1; }
.story-stage .foot { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px 14px calc(14px + var(--safe-bottom)); display: flex; gap: 8px; align-items: center; z-index: 3; }
.story-stage .foot .input { flex: 1; background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.3); color: #fff; border-radius: 99px; height: 44px; padding-block: 0; }
.story-stage .foot .input::placeholder { color: rgba(255,255,255,.7); }
.story-stage .foot .btn-icon { color: #fff; background: rgba(255,255,255,.14); }
.story-stage .views-btn { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 14px; padding: 8px 14px; border-radius: 99px; background: rgba(0,0,0,.35); }
.story-stage .views-btn svg { width: 20px; height: 20px; }
.story-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: none; place-items: center; z-index: 120; }
@media (min-width: 640px) { .story-nav-btn { display: grid; } .story-nav-btn.prev { right: calc(50% + 260px); } .story-nav-btn.next { left: calc(50% + 260px); } .story-nav-btn.next svg { transform: scaleX(-1); } }
.story-close { position: fixed; top: calc(14px + var(--safe-top)); right: 14px; z-index: 120; color: #fff; display: none; }
@media (min-width: 640px) { .story-close { display: inline-flex; } }

.story-creator .preview { position: relative; width: 100%; aspect-ratio: 9 / 14; max-height: 52vh;  max-height: 52dvh; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-2); display: grid; place-items: center; border: 1px solid var(--border); }
.story-creator .preview img, .story-creator .preview video { width: 100%; height: 100%; object-fit: cover; }
.story-creator .preview .textual { width: 100%; height: 100%; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 22px; font-weight: 700; color: #fff; line-height: 1.6; }
.story-creator .preview .textual textarea { background: none; color: #fff; text-align: center; font-size: 22px; font-weight: 700; width: 100%; height: 100%; resize: none; }
.story-creator .preview .textual textarea::placeholder { color: rgba(255,255,255,.6); }
.story-creator .bgs { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; scrollbar-width: none; }
.story-creator .bgs button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; flex-shrink: 0; transition: transform .15s var(--spring); }
.story-creator .bgs button.active { border-color: #fff; transform: scale(1.1); }
.story-creator .pick { display: flex; gap: 8px; padding: 10px 0; }

/* =============================================================================
   SETTINGS
   ============================================================================= */
.settings-page { display: flex; flex-direction: column; height: 100%; }
.settings-page .sp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + var(--safe-top)); min-height: var(--header-h); border-bottom: 1px solid var(--border); }
.settings-page .sp-head h3 { flex: 1; font-size: 17px; font-weight: 700; }
.settings-page .sp-body { flex: 1; overflow-y: auto; }
.settings-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 20px 18px; background: linear-gradient(180deg, rgba(var(--accent-rgb), .2), transparent); }
.settings-hero .avatar-wrap { cursor: pointer; }
.settings-hero .avatar-wrap .cam { position: absolute; bottom: 0; inset-inline-start: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 3px solid var(--bg-2); }
.settings-hero .avatar-wrap .cam svg { width: 17px; height: 17px; }
.settings-hero h2 { font-size: 20px; font-weight: 800; margin-top: 6px; }
.settings-hero span { font-size: 13.5px; color: var(--text-2); direction: ltr; }
.set-group { margin: 10px 12px; border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--border); overflow: hidden; }
.set-group .g-title { font-size: 12.5px; color: var(--accent); font-weight: 700; padding: 12px 16px 4px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; text-align: start; transition: background .18s; border-top: 1px solid var(--border); }
.set-group .set-row:first-child, .set-group .g-title + .set-row { border-top: 0; }
.set-row.clickable:hover { background: var(--glass-2); cursor: pointer; }
.set-row > svg { width: 22px; height: 22px; color: var(--text-2); flex-shrink: 0; }
.set-row .col { flex: 1; min-width: 0; }
.set-row .col b { display: block; font-size: 15px; font-weight: 500; }
.set-row .col span { display: block; font-size: 12.5px; color: var(--text-3); }
.set-row .end { color: var(--text-3); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.set-row .end svg { width: 18px; height: 18px; }
.set-row.danger .col b, .set-row.danger > svg { color: var(--danger); }
.accent-row { display: flex; gap: 10px; padding: 4px 16px 14px; }
.accent-row button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; transition: transform .15s var(--spring); position: relative; }
.accent-row button.active { border-color: var(--text); transform: scale(1.12); }
.wallpaper-row { display: flex; gap: 10px; padding: 4px 16px 14px; }
.wallpaper-row button { flex: 1; aspect-ratio: 4/3; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--bg-2); overflow: hidden; position: relative; font-size: 12px; color: var(--text-2); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.wallpaper-row button.active { border-color: var(--accent); }
.fs-preview { padding: 8px 16px 14px; }
.fs-preview .bubble { display: inline-block; }
.session-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.session-item .ic-wrap { width: 44px; height: 44px; border-radius: 12px; background: rgba(var(--accent-rgb), .12); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.session-item .col { flex: 1; min-width: 0; } .session-item .col b { display: block; font-size: 14px; } .session-item .col span { font-size: 12px; color: var(--text-3); direction: ltr; display: block; text-align: right; }
.session-item .cur { font-size: 11px; color: var(--success); background: rgba(52,211,153,.14); padding: 2px 8px; border-radius: 99px; }

/* =============================================================================
   NEW CHAT / GROUP WIZARD
   ============================================================================= */
.wizard-avatar { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 16px; }
.wizard-avatar .avatar { cursor: pointer; border: 2px dashed var(--border-2); }
.wizard-avatar .avatar svg { width: 34px; height: 34px; color: var(--text-3); }
.picker-list { max-height: 300px; overflow-y: auto; margin: 0 -8px; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 1200px) { :root { --sidebar-w: 340px; --info-w: 330px; } }
@media (max-width: 1024px) {
  .app-shell.info-open { grid-template-columns: var(--sidebar-w) 1fr 0; }
  .info-panel { position: fixed; inset: 0 0 0 auto; width: min(400px, 100vw) !important; z-index: 50; transform: translateX(-100%); transition: transform .32s var(--ease); opacity: 1; background: var(--bg-2); box-shadow: var(--shadow); }
  [dir="rtl"] .info-panel { inset: 0 auto 0 0; transform: translateX(-100%); }
  .app-shell.info-open .info-panel { transform: none; }
  .info-scrim { position: fixed; inset: 0; z-index: 49; background: rgba(0,0,0,.45); animation: fade .25s; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 100vw; --header-h: 58px; }
  .app-shell, .app-shell.info-open { grid-template-columns: 100vw; grid-template-rows: 100vh;  grid-template-rows: 100dvh; }
  .sidebar, .main { grid-area: 1 / 1; width: 100vw; }
  .sidebar { border: 0; transition: transform .32s var(--ease), opacity .3s; z-index: 2; }
  .main { transition: transform .32s var(--ease); z-index: 3; transform: translateX(-100%); visibility: hidden; }
  .app-shell.chat-open .main { transform: none; visibility: visible; }
  .app-shell.chat-open .sidebar { transform: translateX(15%); opacity: .0; pointer-events: none; }
  .main.blank { display: none; }
  .chat-header .back { display: inline-flex; }
  .chat-header .actions .btn-icon.desk-only { display: none; }
  .info-panel { width: 100vw !important; }
  .msg { max-width: 86%; }
  .msg .quick { display: none; }
  .fab { bottom: calc(20px + var(--safe-bottom)); inset-inline-start: 16px; }
  .composer textarea { font-size: 16px; } /* iOS zoom prevention */
  .input { font-size: 16px; }
  .emoji-picker { position: fixed; bottom: 0; inset-inline: 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; height: 45vh;  height: 45dvh; padding-bottom: var(--safe-bottom); }
  .scroll-down { bottom: 84px; }
  .media-img { min-width: 160px; max-width: 280px; }
  .modal { max-height: calc(100vh - 24px);  max-height: calc(100dvh - 24px); border-radius: 22px; }
  .modal-root { padding: 12px; }
  .ip-actions { grid-template-columns: repeat(4, 1fr); }
  .stories-strip { padding-inline: 12px; }
  #bg-orbs i { filter: blur(70px); }
  .chat-item { padding: 9px 10px; }
  .bubble.only-emoji .text { font-size: 38px; }
}
@media (max-width: 380px) {
  .msg { max-width: 92%; }
  .story-item { width: 60px; } .story-item .avatar { width: 52px; height: 52px; }
  .chat-header .actions .btn-icon:not(.always) { display: none; }
}
@media (hover: none) {
  .msg .quick { display: none; }
  .btn-icon:hover { background: none; color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* iOS specific: prevent rubber-band scrolling on body and use dvh */
@supports (-webkit-touch-callout: none) {
  #app, .app-shell { height: 100vh; height: 100dvh; }
  .messages { -webkit-overflow-scrolling: touch; }
}

/* =============================================================================
   v3 — رادیکال‌گرام: قالب‌بندی متن، اسپویلر، رسانه‌ی زمان‌دار، ویدیو‌مسیج،
   چت مخفی، منوی زمینه‌ای موبایل، پین چندگانه، پریمیوم، پنل مدیریت، تنظیمات،
   پوشه‌ها، قفل برنامه، استوری پیشرفته
   ============================================================================= */
[data-accent="sky"]  { --accent: #0ea5e9; --accent-2: #6366f1; --accent-rgb: 14,165,233; }
[data-accent="pink"] { --accent: #ec4899; --accent-2: #f43f5e; --accent-rgb: 236,72,153; }
[data-accent="teal"] { --accent: #14b8a6; --accent-2: #3b82f6; --accent-rgb: 20,184,166; }
/* تیک‌ها: خوانده‌شده = رنگ accent روشن (مثل تلگرام) */
.msg.out .bubble .meta .ticks { color: rgba(255,255,255,.75); display: inline-flex; }
.msg.out .bubble .meta .ticks.read { color: #fff; filter: drop-shadow(0 0 4px rgba(255,255,255,.9)); }
.msg.out .bubble .meta .ticks.read svg { stroke-width: 2.4; }
.overlay-meta svg { width: 15px; height: 15px; }

/* ---------- متن: entities ---------- */
.bubble .text u { text-decoration: underline; text-underline-offset: 2px; }
.bubble .text s { opacity: .8; }
.bubble .text blockquote { margin: 4px 0; padding: 4px 10px; border-inline-start: 3px solid currentColor; border-radius: 6px; background: rgba(0,0,0,.12); font-size: .95em; opacity: .92; }
.msg.in .bubble .text blockquote { border-color: var(--accent); background: rgba(var(--accent-rgb),.08); }
.bubble .text .spoiler { background: rgba(128,128,128,.55); color: transparent; border-radius: 4px; cursor: pointer; transition: all .3s; text-shadow: none; user-select: none; padding: 0 1px; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 2px, transparent 2px 6px); animation: spoiler-shimmer 1.6s linear infinite; }
.bubble .text .spoiler * { visibility: hidden; }
.bubble .text .spoiler.revealed { background: rgba(128,128,128,.18); color: inherit; animation: none; user-select: text; }
.bubble .text .spoiler.revealed * { visibility: visible; }
@keyframes spoiler-shimmer { to { background-position: 40px 0; } }
.bubble .text .mention { color: var(--accent); cursor: pointer; font-weight: 500; }
.msg.out .bubble .text .mention, .msg.out .bubble .text a { color: #fff; text-decoration: underline; }
.bubble .text .hashtag { color: var(--accent); cursor: pointer; }
.msg.out .bubble .text .hashtag { color: #fff; }

/* رسانه‌ی اسپویلر */
.media-img.spoiler-media img, .media-img.spoiler-media video { filter: blur(28px) saturate(1.4); transform: scale(1.12); transition: filter .4s, transform .4s; }
.media-img.spoiler-media.revealed img, .media-img.spoiler-media.revealed video { filter: none; transform: none; }
.media-img .spoiler-cover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.2); cursor: pointer; }
.media-img .spoiler-cover span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; backdrop-filter: blur(8px); }
.media-img .spoiler-cover svg { width: 16px; height: 16px; }
.media-img.spoiler-media.revealed .spoiler-cover { display: none; }
.media-img.gif .dur { font-weight: 700; letter-spacing: .5px; }

/* ---------- نوار قالب‌بندی ---------- */
.fmt-bar { display: flex; gap: 2px; align-items: center; margin: 0 4px 6px; padding: 4px 6px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--border); backdrop-filter: blur(14px); overflow-x: auto; scrollbar-width: none; animation: slide-up .18s var(--ease); }
.fmt-bar::-webkit-scrollbar { display: none; }
.fmt-btn { min-width: 34px; height: 32px; padding: 0 8px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 4px; transition: background .15s, color .15s; flex-shrink: 0; }
.fmt-btn:hover { background: var(--glass-3); color: var(--text); }
.fmt-btn svg { width: 18px; height: 18px; }
.fmt-btn .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.fmt-btn .sp { letter-spacing: -2px; }
.fmt-btn.danger { color: var(--danger); }
.fmt-bar .sep { width: 1px; height: 20px; background: var(--border-2); margin: 0 4px; flex-shrink: 0; }
.composer .box .fmt-toggle { opacity: .75; }
.composer .box .fmt-toggle.on { color: var(--accent); opacity: 1; }
@media (max-width: 480px) { .composer .box .fmt-toggle { display: none; } .fmt-bar { margin: 0 0 6px; } }

/* ---------- منوی زمینه‌ای موبایل (تلگرام‌گونه) ---------- */
.ctx-root { align-items: flex-end; justify-content: center; }
.ctx-root .scrim { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(0,0,0,.55); }
.ctx-sheet { position: relative; z-index: 1; width: 100%; max-width: 480px; max-height: calc(100vh - 20px);  max-height: calc(100dvh - 20px); display: flex; flex-direction: column; gap: 8px; padding: 10px 10px calc(10px + var(--safe-bottom)); overflow-y: auto; animation: ctx-in .22s var(--spring); }
.ctx-sheet.out { animation: ctx-out .16s var(--ease) forwards; }
@keyframes ctx-in { from { transform: translateY(40px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ctx-out { to { transform: translateY(30px); opacity: 0; } }
.ctx-sheet .react-row { align-self: center; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 99px; padding: 6px; display: flex; gap: 2px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.ctx-sheet .react-row button { width: 42px; height: 42px; font-size: 24px; border-radius: 50%; flex-shrink: 0; transition: transform .15s var(--spring), background .15s; }
.ctx-sheet .react-row button:active { transform: scale(1.35); }
.ctx-sheet .react-row button.me { background: rgba(var(--accent-rgb),.2); }
.ctx-sheet .react-row .more svg { width: 20px; height: 20px; transform: rotate(-90deg); color: var(--text-2); }
.ctx-preview { pointer-events: none; display: flex; flex-direction: column; max-height: 30vh;  max-height: 30dvh; overflow: hidden; padding: 0 4px; }
.ctx-preview .msg { max-width: 100%; margin: 0; }
.ctx-preview .msg.out { align-self: flex-start; } .ctx-preview .msg.in { align-self: flex-end; }
.ctx-preview .bubble { box-shadow: var(--shadow); }
.ctx-items { border-radius: var(--radius-lg); overflow: hidden; padding: 4px; box-shadow: var(--shadow); flex-shrink: 0; }
.ctx-items .menu-item { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.ctx-items .menu-item svg { width: 21px; height: 21px; }
.ctx-items .menu-item .grow small { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.ctx-items .menu-item .end { color: var(--text-3); font-size: 12px; }
.ctx-items .menu-sep { margin: 4px 8px; }
.menu-item.has-sub { align-items: flex-start; } .menu-item.has-sub svg { margin-top: 2px; }
.menu-item .grow small { display: block; font-size: 11.5px; color: var(--text-3); }
.ctx-menu .react-row { display: flex; gap: 2px; padding: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ctx-menu .react-row button { width: 36px; height: 36px; font-size: 20px; border-radius: 50%; flex-shrink: 0; transition: transform .15s var(--spring); }
.ctx-menu .react-row button:hover { transform: scale(1.3); background: var(--glass-2); }
.ctx-menu .react-row button.me { background: rgba(var(--accent-rgb),.2); }
.ctx-menu .react-row .more svg { width: 18px; height: 18px; transform: rotate(-90deg); }
.msg.pressed .bubble { transform: scale(.97); transition: transform .12s; }
.msg.vanish { animation: vanish .35s var(--ease) forwards; }
@keyframes vanish { to { opacity: 0; transform: scale(.85); filter: blur(6px); max-height: 0; margin: 0; padding: 0; } }
.react-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; max-height: 45vh; overflow-y: auto; padding: 4px; }
.react-grid button { height: 48px; font-size: 26px; border-radius: 12px; transition: transform .15s var(--spring), background .15s; }
.react-grid button:hover, .react-grid button.me { background: var(--glass-2); transform: scale(1.1); }
.prem-hint { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 8px; border-radius: 12px; background: linear-gradient(90deg, rgba(245,158,11,.18), rgba(236,72,153,.14)); font-size: 13px; cursor: pointer; }
.prem-hint svg { width: 20px; height: 20px; color: #f59e0b; }
.kv-list { display: flex; flex-direction: column; gap: 2px; }
.kv-list .kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--glass); font-size: 14px; }
.kv-list .kv span { color: var(--text-3); } .kv-list .kv b { font-weight: 500; text-align: left; direction: ltr; word-break: break-all; }

/* ---------- متادیتای پیام: تایمر، بی‌صدا، بازدید ---------- */
.bubble .meta .ttl-badge { display: inline-flex; align-items: center; gap: 2px; padding: 0 5px; border-radius: 99px; background: rgba(0,0,0,.2); font-size: 10.5px; height: 16px; }
.bubble .meta .ttl-badge svg { width: 12px; height: 12px; }
.bubble .meta .silent-ic svg, .bubble .meta .views svg { width: 13px; height: 13px; }
.bubble .meta .views { display: inline-flex; align-items: center; gap: 3px; }
.bubble .meta .pin-ic svg { width: 12px; height: 12px; }

/* ---------- رسانه‌ی یک‌بارمصرف / زمان‌دار ---------- */
.view-once { display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-width: 210px; cursor: pointer; }
.view-once .vo-ic { position: relative; width: 48px; height: 48px; border-radius: 50%; background: rgba(var(--accent-rgb),.2); display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.msg.out .view-once .vo-ic { background: rgba(255,255,255,.2); color: #fff; }
.view-once .vo-ic svg { width: 22px; height: 22px; }
.view-once .vo-ic .vo-ring { position: absolute; inset: -3px; border-radius: 50%; border: 2px dashed currentColor; opacity: .6; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view-once.opened { opacity: .7; cursor: default; }
.view-once.opened .vo-ic .vo-ring { display: none; }
.view-once .vo-txt b { display: block; font-size: 14px; font-weight: 600; }
.view-once .vo-txt span { display: block; font-size: 12px; opacity: .75; }
.lightbox.vo-mode .lb-head .btn-icon[title="دانلود"] { display: none; }
.lightbox .vo-timer { position: absolute; top: calc(14px + var(--safe-top)); left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: 14px; z-index: 3; backdrop-filter: blur(8px); }
.lightbox .vo-timer svg { width: 16px; height: 16px; }
.lightbox.vo-mode .lb-body img, .lightbox.vo-mode .lb-body video { -webkit-user-drag: none; user-select: none; pointer-events: none; }

/* ---------- ویدیو‌مسیج (گرد) ---------- */
.bubble.vnote-bubble { background: none !important; border: none !important; box-shadow: none; padding: 0; }
.vnote { position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden; background: #000; cursor: pointer; box-shadow: var(--shadow-sm); }
@media (max-width: 480px) { .vnote { width: 200px; height: 200px; } }
.vnote video { width: 100%; height: 100%; object-fit: cover; }
.vnote .vn-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform: rotate(-90deg); }
.vnote .vn-ring .p { stroke: #fff; stroke-width: 3; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; stroke-linecap: round; transition: stroke-dashoffset .2s linear; }
.vnote .vn-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25); transition: opacity .2s; }
.vnote .vn-play svg { width: 44px; height: 44px; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.vnote.playing .vn-play { opacity: 0; }
.vnote .vn-time { position: absolute; bottom: 10px; inset-inline-start: 50%; transform: translateX(50%); padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; }
.vnote .vn-muted { position: absolute; top: 10px; inset-inline-end: 10px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.vnote .vn-muted svg { width: 15px; height: 15px; }
.msg .vnote + .meta, .vnote-bubble .meta { position: absolute; bottom: 6px; inset-inline-end: 0; background: rgba(0,0,0,.5); color: #fff; padding: 2px 8px; border-radius: 99px; }
.vn-recorder { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; }
.vn-recorder .scrim { position: absolute; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(10px); }
.vn-panel { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 16px 22px; width: min(420px, 100vw); animation: pop-in .25s var(--spring); }
.vn-head { width: 100%; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.vn-head b { font-size: 16px; } .vn-head .btn-icon { color: #fff; }
.vn-circle { position: relative; width: min(300px, 78vw); height: min(300px, 78vw); border-radius: 50%; overflow: hidden; background: #111; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.vn-circle video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.vn-circle .vn-rec-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.vn-circle .vn-rec-ring .p { stroke-dasharray: 295.3; stroke-dashoffset: 295.3; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .2s linear; }
.vn-panel .vn-time { color: #fff; font-size: 18px; font-weight: 700; }
.vn-hint { color: rgba(255,255,255,.7); font-size: 13px; min-height: 18px; text-align: center; }
.vn-btn { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 30px rgba(var(--accent-rgb),.5); transition: transform .15s var(--spring), background .2s; }
.vn-btn:active { transform: scale(.94); } .vn-btn svg { width: 30px; height: 30px; }
.vn-btn.rec { background: var(--danger); animation: pulse-rec 1.2s ease-in-out infinite; }
@keyframes pulse-rec { 0%,100% { box-shadow: 0 0 0 0 rgba(248,113,113,.5); } 50% { box-shadow: 0 0 0 14px rgba(248,113,113,0); } }

/* ---------- چت مخفی ---------- */
.secret-ic { color: var(--success) !important; }
.chat-item .title.secret { color: var(--success); }
.chat-item .title .secret-ic { width: 15px; height: 15px; margin-inline-end: 3px; }
.chat-header .title .secret-ic, .ip-hero h2 .secret-ic { width: 18px; height: 18px; vertical-align: -3px; margin-inline-end: 4px; }
.ttl-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 99px; background: rgba(34,197,94,.15); color: var(--success); font-size: 11px; margin-inline-start: 6px; vertical-align: middle; }
.ttl-chip svg { width: 12px; height: 12px; }
.secret-text { display: flex; align-items: flex-start; gap: 6px; }
.secret-text .sec-lock { display: inline-flex; opacity: .6; margin-top: 3px; } .secret-text .sec-lock svg { width: 13px; height: 13px; }
.secret-text .sec-body { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.secret-text .sec-unavail { font-size: 12.5px; opacity: .7; font-style: italic; display: inline-flex; gap: 4px; align-items: center; } .secret-text .sec-unavail svg { width: 13px; height: 13px; }
.secret-text .sec-img { max-width: 280px; max-height: 320px; border-radius: 12px; display: block; cursor: zoom-in; }
.secret-banner { align-self: center; max-width: 340px; margin: 12px 0; padding: 14px 16px; border-radius: 16px; background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2); font-size: 12.5px; color: var(--text-2); text-align: center; line-height: 1.8; }
.secret-banner svg { width: 28px; height: 28px; color: var(--success); display: block; margin: 0 auto 6px; }
.secret-banner b { display: block; color: var(--text); margin-bottom: 4px; }
.composer-blocked .secret-accept { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- پین چندگانه ---------- */
.pinned-bar .pin-bars { display: flex; flex-direction: column; gap: 2px; height: 34px; width: 3px; justify-content: center; }
.pinned-bar .pin-bars i { flex: 1; width: 3px; border-radius: 3px; background: rgba(var(--accent-rgb),.3); }
.pinned-bar .pin-bars i.on { background: var(--accent); }
.pinned-bar .btn-icon.sm svg { width: 18px; height: 18px; }

/* ---------- زمان‌بندی ---------- */
.sched-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--glass); margin-bottom: 6px; }
.sched-item .col { flex: 1; min-width: 0; } .sched-item .col b { display: block; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.sched-item .col span { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-item .btn-icon.sm svg { width: 18px; height: 18px; }

/* ---------- دیالوگ ارسال رسانه ---------- */
.send-modal .send-preview { position: relative; border-radius: 14px; overflow: hidden; background: #000; max-height: 46vh; display: grid; place-items: center; }
.send-modal .send-preview img, .send-modal .send-preview video { max-width: 100%; max-height: 46vh; object-fit: contain; transition: filter .3s; }
.send-modal .send-preview.blur img, .send-modal .send-preview.blur video { filter: blur(20px); }
.send-modal .send-preview.blur::after { content: 'اسپویلر'; position: absolute; inset: auto; padding: 6px 14px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; }
.send-tools { display: flex; align-items: center; gap: 4px; padding: 8px 2px; }
.send-tools .grow { flex: 1; }
.send-tools .tool { width: 36px; height: 36px; color: var(--text-2); } .send-tools .tool.on { color: var(--accent); background: rgba(var(--accent-rgb),.15); }
.send-tools .tool-lbl { font-size: 12px; font-weight: 700; color: var(--accent); }

/* ---------- نشان پریمیوم / وضعیت ایموجی ---------- */
.prem-badge { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-inline-start: 4px; vertical-align: -2px; color: #f59e0b; }
.prem-badge svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.prem-badge.lg { width: 22px; height: 22px; } .prem-badge.lg svg { width: 20px; height: 20px; }
.emoji-status { display: inline-block; margin-inline-start: 4px; font-size: .95em; vertical-align: -1px; }
.emoji-status.lg { font-size: 22px; background: none; }
.chat-header .title .prem-badge, .chat-header .title .emoji-status { vertical-align: middle; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--glass-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.chip-btn svg { width: 15px; height: 15px; }
.drawer .menu-item.prem-item svg { color: #f59e0b; } .drawer .menu-item.admin-item svg { color: var(--danger); }
.color-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); display: inline-block; }
.ic-grad { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg,#f59e0b,#ec4899); color: #fff; flex-shrink: 0; }
.ic-grad.red { background: linear-gradient(135deg,#ef4444,#f97316); }
.ic-grad svg { width: 18px; height: 18px; }
.set-row.prem-row .col b { background: linear-gradient(90deg,#f59e0b,#ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }

/* ---------- صفحه‌ی پریمیوم ---------- */
.modal.prem-modal { max-width: 520px; }
.prem-page { padding: 0 12px 20px; }
.prem-hero { text-align: center; padding: 28px 16px 20px; background: radial-gradient(ellipse at top, rgba(245,158,11,.25), transparent 60%), radial-gradient(ellipse at bottom left, rgba(236,72,153,.18), transparent 60%); border-radius: 0 0 28px 28px; margin: 0 -12px 12px; }
.prem-logo { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(135deg,#f59e0b,#ec4899,#8b5cf6); color: #fff; box-shadow: 0 16px 40px rgba(236,72,153,.35); animation: prem-float 3s ease-in-out infinite; }
.prem-logo svg { width: 44px; height: 44px; fill: currentColor; stroke: none; }
@keyframes prem-float { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.prem-hero h2 { font-size: 24px; font-weight: 800; background: linear-gradient(90deg,#f59e0b,#ec4899,#8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prem-hero p { font-size: 13.5px; color: var(--text-2); margin-top: 6px; line-height: 1.7; }
.prem-active { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 5px 12px; border-radius: 99px; background: rgba(52,211,153,.15); color: var(--success); font-size: 12.5px; font-weight: 600; }
.prem-active svg { width: 14px; height: 14px; }
.prem-feats { display: flex; flex-direction: column; gap: 2px; border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--border); overflow: hidden; }
.prem-feat { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--border); }
.prem-feat:first-child { border-top: 0; } .prem-feat.hl { background: rgba(var(--accent-rgb),.1); }
.prem-feat .pf-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.prem-feat .pf-ic svg { width: 19px; height: 19px; }
.prem-feat .col b { display: block; font-size: 14.5px; font-weight: 600; } .prem-feat .col span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.prem-plans { display: flex; flex-direction: column; gap: 8px; }
.prem-plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 2px solid var(--border); text-align: start; transition: all .2s; }
.prem-plan.on { border-color: var(--accent); background: rgba(var(--accent-rgb),.1); }
.prem-plan .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-2); flex-shrink: 0; position: relative; }
.prem-plan.on .radio { border-color: var(--accent); } .prem-plan.on .radio::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.prem-plan .col { flex: 1; } .prem-plan .col b { display: flex; align-items: center; gap: 8px; font-size: 15px; } .prem-plan .col span { display: block; font-size: 12px; color: var(--text-3); }
.prem-plan .price { font-size: 14px; white-space: nowrap; }
.badge-off { padding: 2px 8px; border-radius: 99px; background: linear-gradient(90deg,#f59e0b,#ef4444); color: #fff; font-size: 11px; font-weight: 700; }
.btn-premium { width: 100%; height: 50px; margin-top: 12px; border-radius: 16px; background: linear-gradient(90deg,#f59e0b,#ec4899,#8b5cf6); background-size: 200% 100%; color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 30px rgba(236,72,153,.35); animation: grad-move 4s linear infinite; }
.btn-premium svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
@keyframes grad-move { to { background-position: 200% 0; } }
.prem-pending { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 10px; border-radius: 14px; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3); }
.prem-pending svg { width: 22px; height: 22px; color: var(--warn); } .prem-pending .col { flex: 1; } .prem-pending .col b { display: block; font-size: 14px; } .prem-pending .col span { font-size: 12px; color: var(--text-3); }
.prem-gift { display: flex; gap: 8px; } .prem-gift .input { flex: 1; font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 500; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: confetti-fall 3s ease-in forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(720deg); opacity: .6; } }

/* ---------- پنل مدیریت ---------- */
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; background: var(--glass-3); font-size: 11px; font-weight: 600; color: var(--text-2); vertical-align: middle; }
.tag.admin { background: rgba(248,113,113,.15); color: var(--danger); } .tag.prem { background: rgba(245,158,11,.15); color: #f59e0b; } .tag.ban { background: rgba(248,113,113,.2); color: var(--danger); }
.tag svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
@media (max-width: 900px) {
}

/* ---------- تنظیمات (صفحات پشته‌ای) ---------- */
.sp-page { animation: none; padding-bottom: 10px; }
.sp-page.slide-in { animation: sp-in .22s var(--ease); } .sp-page.slide-back { animation: sp-back .22s var(--ease); }
@keyframes sp-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes sp-back { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.set-note { padding: 4px 24px 8px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.set-row .acts { display: flex; gap: 2px; align-items: center; }
.set-row .end span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row.radio-row .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-2); flex-shrink: 0; position: relative; margin-inline-end: 2px; }
.set-row.radio-row.on .radio { border-color: var(--accent); } .set-row.radio-row.on .radio::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.radio-list { display: flex; flex-direction: column; gap: 2px; }
.radio-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-align: start; font-size: 14.5px; transition: background .15s; width: 100%; }
.radio-row:hover { background: var(--glass-2); }
.radio-row .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-2); position: relative; flex-shrink: 0; }
.radio-row.on .radio { border-color: var(--accent); } .radio-row.on .radio::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.checkbox { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-2); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: all .15s; }
.checkbox svg { width: 14px; height: 14px; opacity: 0; } .checkbox.on { background: var(--accent); border-color: var(--accent); } .checkbox.on svg { opacity: 1; }
.lock-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 24px 10px; gap: 10px; }
.lock-hero .ill { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: rgba(var(--accent-rgb),.15); color: var(--accent); }
.lock-hero .ill svg { width: 40px; height: 40px; }
.lock-hero p { font-size: 13.5px; color: var(--text-2); line-height: 1.8; max-width: 380px; }
.f-emoji { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0 12px; }
.emoji-row button { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; } .emoji-row button.on { background: rgba(var(--accent-rgb),.2); }
.folder-modal .set-group { margin: 8px 0; }
.rot90 { transform: rotate(90deg); }
.fs-preview.theme-preview { display: flex; flex-direction: column; gap: 6px; padding: 14px; margin: 10px 14px; }
.wallpaper-row button { position: relative; overflow: hidden; }
.wallpaper-row button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .7; } .wallpaper-row button span { position: relative; }
.folders .add-folder { flex: none; width: 34px; padding: 0; color: var(--text-3); } .folders .add-folder svg { width: 16px; height: 16px; }
.ttl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ttl-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--glass); border: 1px solid var(--border); font-size: 13px; transition: all .15s; }
.ttl-grid button svg { width: 22px; height: 22px; color: var(--text-2); }
.ttl-grid button.on { border-color: var(--accent); background: rgba(var(--accent-rgb),.12); color: var(--accent); } .ttl-grid button.on svg { color: var(--accent); }
.slow-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.slow-row button { padding: 7px 12px; border-radius: 99px; background: var(--glass); border: 1px solid var(--border); font-size: 13px; } .slow-row button.on { background: rgba(var(--accent-rgb),.15); border-color: var(--accent); color: var(--accent); }
.faq-item .faq-a { padding: 0 16px 14px 56px; font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.faq-item .set-row > svg:last-child { width: 18px; height: 18px; transform: rotate(90deg); }
.terms { padding: 16px; font-size: 13.5px; line-height: 1.9; color: var(--text-2); } .terms h4 { color: var(--text); margin: 10px 0 4px; font-size: 14.5px; }
.hl-row { display: flex; gap: 8px; padding: 6px 16px 14px; overflow-x: auto; scrollbar-width: none; } .hl-row.wrap { flex-wrap: wrap; padding: 4px; }
.hl-item { position: relative; width: 74px; height: 110px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: var(--glass-2); border: 2px solid rgba(var(--accent-rgb),.5); }
.hl-item img, .hl-item video { width: 100%; height: 100%; object-fit: cover; } .hl-item .thumb { width: 100%; height: 100%; display: grid; place-items: center; font-size: 10px; color: #fff; padding: 6px; text-align: center; }
.hl-item .pin { position: absolute; top: 4px; inset-inline-end: 4px; width: 14px; height: 14px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }

/* ---------- قفل برنامه ---------- */
#lock-screen { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: var(--bg); background-image: radial-gradient(ellipse at 20% 10%, rgba(var(--accent-rgb),.25), transparent 50%), radial-gradient(ellipse at 80% 90%, rgba(236,72,153,.18), transparent 50%); animation: fade-in .2s; }
#lock-screen.out { animation: fade-out .25s forwards; }
@keyframes fade-out { to { opacity: 0; } }
.lock-card { width: min(380px, calc(100vw - 32px)); padding: 30px 26px; border-radius: 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lock-card .mark { width: 70px; height: 70px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; margin-bottom: 6px; } .lock-card .mark svg { width: 34px; height: 34px; }
.lock-card h2 { font-size: 20px; font-weight: 800; } .lock-card p { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.lock-card .input { width: 100%; } .lock-card .btn { margin-top: 4px; }

/* ---------- اعلان سراسری / احراز هویت ---------- */
#announce-bar { position: fixed; top: calc(8px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 250; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 13px; max-width: min(92vw, 560px); animation: slide-down .3s var(--ease); }
#announce-bar > svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; } #announce-bar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-announce { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(var(--accent-rgb),.1); font-size: 12.5px; color: var(--text-2); }
.auth-announce svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.demo-accounts button.adm { border-color: rgba(245,158,11,.4); }
.demo-accounts .avatar.xs svg { width: 12px; height: 12px; color: #fff; }

/* ---------- استوری پیشرفته ---------- */
.story-stage.cube-next { animation: cube-next .3s var(--ease); } .story-stage.cube-prev { animation: cube-prev .3s var(--ease); }
@keyframes cube-next { from { transform: perspective(1000px) rotateY(-25deg) translateX(30%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes cube-prev { from { transform: perspective(1000px) rotateY(25deg) translateX(-30%); opacity: .4; } to { transform: none; opacity: 1; } }
.story-stage.held .head, .story-stage.held .foot, .story-stage.held .progress { opacity: 0; transition: opacity .2s; }
.story-stage .head .col { cursor: pointer; } .story-stage .head .priv-ic { display: inline-flex; margin-inline-start: 6px; vertical-align: middle; } .story-stage .head .priv-ic svg { width: 13px; height: 13px; }
.story-stage .textual.font-bold span { font-weight: 900; } .story-stage .textual.font-serif span { font-family: Georgia, 'Times New Roman', serif; } .story-stage .textual.font-mono span { font-family: ui-monospace, Menlo, monospace; }
.story-stage .textual.align-right { text-align: right; } .story-stage .textual.align-left { text-align: left; } .story-stage .textual span { white-space: pre-wrap; }
.story-stage .foot.mine { justify-content: space-between; }
.story-stage .views-btn .rx { margin-inline-start: 8px; font-size: 12px; }
.story-stage .foot .heart.on { color: #f43f5e; } .story-stage .foot .heart.on svg { fill: currentColor; } .story-stage .foot .heart .em { font-size: 22px; }
.story-reacts { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 6px; border-radius: 99px; background: rgba(20,20,30,.85); backdrop-filter: blur(10px); animation: pop-in .2s var(--spring); z-index: 4; }
.story-reacts button { width: 42px; height: 42px; font-size: 24px; border-radius: 50%; transition: transform .15s var(--spring); } .story-reacts button:hover { transform: scale(1.3); }
.story-float { position: absolute; left: 50%; top: 50%; font-size: 64px; pointer-events: none; animation: story-float 1.1s var(--ease) forwards; z-index: 5; transform: translate(-50%, -50%); }
@keyframes story-float { 0% { transform: translate(-50%,-50%) scale(.4); opacity: 0; } 20% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; } 100% { transform: translate(-50%,-160%) scale(1); opacity: 0; } }
.stealth-badge { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; z-index: 4; }
.stealth-badge svg { width: 14px; height: 14px; }
.story-tools { display: flex; gap: 6px; align-items: center; margin: 8px 0; }
.story-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.story-opts .priv-btn { height: 36px; padding: 0 12px; gap: 6px; } .story-opts .priv-btn svg { width: 16px; height: 16px; } .story-opts .priv-btn svg:last-child { transform: rotate(90deg); width: 14px; height: 14px; opacity: .6; }
.story-creator .preview .textual.font-bold textarea { font-weight: 900; } .story-creator .preview .textual.font-serif textarea { font-family: Georgia, serif; } .story-creator .preview .textual.font-mono textarea { font-family: ui-monospace, Menlo, monospace; }
.story-creator .seg button { height: 32px; font-size: 12.5px; }
.user-row .rx-em { font-size: 20px; }
.avatar-wrap.has-story::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(var(--accent), var(--accent-2), var(--accent)); z-index: -1; }

/* ---------- عمومی ---------- */
.btn-danger { background: var(--danger); color: #fff; }
.g-title + .set-row.clickable { border-top: 0; }
.toast .btn-icon.sm svg { width: 16px; height: 16px; }
.msg .bubble .text .quote-hdr { font-size: 11.5px; opacity: .7; margin-bottom: 2px; }

/* page-style modals: body without padding, full height */
.modal.settings-modal { height: min(720px, calc(100vh - 40px));  height: min(720px, calc(100dvh - 40px)); }
.modal.prem-modal { height: min(760px, calc(100vh - 40px));  height: min(760px, calc(100dvh - 40px)); }

/* media-only bubbles: time/ticks live on the image overlay */
.bubble.media-only > .meta { display: none; }
.media-img img, .media-img video { height: 100%; }
.bubble .text a, .bubble .text { overflow-wrap: anywhere; word-break: break-word; }

/* ---- Emoji images (Twemoji, self-hosted) ---- */
img.em { width: 1.25em; height: 1.25em; vertical-align: -0.28em; margin: 0 0.05em; display: inline-block; object-fit: contain; }
.bubble.only-emoji img.em { width: 1em; height: 1em; vertical-align: -0.15em; }
.reactions img.em, .react-row img.em, .reaction img.em { width: 1.2em; height: 1.2em; }
.emoji-picker img.em, .emoji-grid img.em, .picker-grid img.em { width: 1.45em; height: 1.45em; vertical-align: middle; margin: 0; }
.chat-item .last-msg img.em, .chat-item .preview img.em { width: 1.15em; height: 1.15em; vertical-align: -0.22em; }
.story-react img.em, .emoji-status img.em { width: 1.3em; height: 1.3em; }
