/* =============================================================================
   رادیکال‌گرام — لایه‌ی ظاهری «تلگرام» (Telegram Desktop look)
   این فایل بعد از app.css بارگذاری می‌شود و ظاهر را دقیقاً شبیه تلگرام دسکتاپ می‌کند:
   Night theme: sidebar #17212b · chat #0e1621 · out bubble #2b5278 · in bubble #182533
   Day theme:   sidebar #ffffff · chat #e7ebf0 · out bubble #effdde · in bubble #ffffff
   ============================================================================= */

:root {
  --radius-xs: 6px; --radius-sm: 10px; --radius: 12px; --radius-lg: 14px; --radius-xl: 16px;
  --sidebar-w: 380px; --info-w: 360px; --header-h: 56px;
  --tg-blue: #3390ec;
}

/* ---------- Palette: Telegram Night ---------- */
[data-theme="dark"] {
  --bg: #0e1621; --bg-2: #0e1621; --bg-3: #17212b;
  --glass: #17212b; --glass-2: #202b36; --glass-3: #242f3d;
  --border: #101921; --border-2: #232e3c;
  --text: #f5f5f5; --text-2: #8b98a5; --text-3: #6c7883;
  --bubble-in: #182533; --bubble-in-border: transparent;
  --bubble-out: #2b5278; --bubble-out-text: #fff;
  --shadow: 0 6px 24px rgba(0,0,0,.5); --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --scroll: rgba(255,255,255,.14);
  --danger: #ef5b5b; --success: #4dcd5e; --warn: #f5b400; --online: #4dcd5e;
  --tg-out-time: #7da8d3; --tg-out-tick: #6db2f1; --tg-link: #6ab3f3; --tg-name: #6ab3f3;
  --tg-badge: #4082bc; --tg-badge-muted: #37475a; --tg-active: #2b5278; --tg-hover: #202b36;
  --tg-search: #242f3d; --tg-date: rgba(0,0,0,.35); --tg-side-active-text: #fff;
  --tg-composer: #17212b; --tg-quote-bg: rgba(106,179,243,.12);
  --orb-opacity: 0;
}
[data-theme="dark"][data-accent] { --accent: #5288c1; --accent-2: #5288c1; --accent-rgb: 82,136,193; }

/* ---------- Palette: Telegram Day ---------- */
[data-theme="light"] {
  --bg: #e7ebf0; --bg-2: #e7ebf0; --bg-3: #ffffff;
  --glass: #ffffff; --glass-2: #f1f3f5; --glass-3: #e6ebef;
  --border: #e0e4e8; --border-2: #d3d9de;
  --text: #000000; --text-2: #707579; --text-3: #999ea3;
  --bubble-in: #ffffff; --bubble-in-border: transparent;
  --bubble-out: #effdde; --bubble-out-text: #000;
  --shadow: 0 6px 24px rgba(0,0,0,.14); --shadow-sm: 0 1px 2px rgba(16,35,47,.15);
  --scroll: rgba(0,0,0,.18);
  --danger: #e53935; --success: #4fae4e; --warn: #f5a623; --online: #4fae4e;
  --tg-out-time: #62ac55; --tg-out-tick: #4fae4e; --tg-link: #3390ec; --tg-name: #3390ec;
  --tg-badge: #3390ec; --tg-badge-muted: #c4c9cc; --tg-active: #3390ec; --tg-hover: #f4f4f5;
  --tg-search: #f1f3f5; --tg-date: rgba(255,255,255,.85); --tg-side-active-text: #fff;
  --tg-composer: #ffffff; --tg-quote-bg: rgba(51,144,236,.1);
  --orb-opacity: 0;
}
[data-theme="light"][data-accent] { --accent: #3390ec; --accent-2: #3390ec; --accent-rgb: 51,144,236; }

/* accent choices still apply to the *out* bubble & highlights only when user picks a non-default one */
[data-theme="dark"][data-accent="violet"]  { --accent: #8774e1; --accent-rgb: 135,116,225; --bubble-out: #3d3564; --tg-active: #4b4180; --tg-out-time: #b2a6f2; --tg-out-tick: #c8bfff; --tg-badge: #8774e1; }
[data-theme="dark"][data-accent="emerald"] { --accent: #3fb47d; --accent-rgb: 63,180,125; --bubble-out: #2a5340; --tg-active: #2f6b4f; --tg-out-time: #8fd2b1; --tg-out-tick: #b6f0d1; --tg-badge: #3fb47d; }
[data-theme="dark"][data-accent="rose"]    { --accent: #e35d7a; --accent-rgb: 227,93,122; --bubble-out: #5a2a38; --tg-active: #7a3448; --tg-out-time: #f0a3b6; --tg-out-tick: #ffd0da; --tg-badge: #e35d7a; }
[data-theme="dark"][data-accent="amber"]   { --accent: #e5a02e; --accent-rgb: 229,160,46; --bubble-out: #5a4322; --tg-active: #7a5a2a; --tg-out-time: #f2cf93; --tg-out-tick: #ffe6b8; --tg-badge: #e5a02e; }
[data-theme="light"][data-accent="violet"]  { --accent: #7e5bef; --accent-rgb: 126,91,239; --bubble-out: #efe9ff; --tg-active: #7e5bef; --tg-out-time: #8b74c9; --tg-out-tick: #7e5bef; --tg-badge: #7e5bef; }
[data-theme="light"][data-accent="emerald"] { --accent: #2f9e6b; --accent-rgb: 47,158,107; --bubble-out: #e3f7ec; --tg-active: #2f9e6b; --tg-out-time: #5fa982; --tg-out-tick: #2f9e6b; --tg-badge: #2f9e6b; }
[data-theme="light"][data-accent="rose"]    { --accent: #e0457b; --accent-rgb: 224,69,123; --bubble-out: #ffe9f0; --tg-active: #e0457b; --tg-out-time: #c86a8d; --tg-out-tick: #e0457b; --tg-badge: #e0457b; }
[data-theme="light"][data-accent="amber"]   { --accent: #d68a10; --accent-rgb: 214,138,16; --bubble-out: #fff4dc; --tg-active: #d68a10; --tg-out-time: #b98a3f; --tg-out-tick: #d68a10; --tg-badge: #d68a10; }

/* ---------- Global: flat surfaces, no blur, no orbs ---------- */
#bg-orbs { display: none !important; }
body { background: var(--bg); line-height: 1.45; }
.glass, .sidebar, .info-panel, .composer .box, .msg.in .bubble, .date-sep, .scroll-down, .msg .quick button, .composer-ctx, .pinned-bar, .modal-root .scrim, .sheet-root .scrim, .ctx-menu, .toast, .emoji-picker {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
::selection { background: rgba(var(--accent-rgb), .35); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; } *::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 6px; } *::-webkit-scrollbar-track { background: transparent; }

/* ---------- Buttons / inputs ---------- */
.btn-icon { width: 40px; height: 40px; border-radius: 50%; color: var(--text-2); }
.btn-icon:hover { background: var(--tg-hover); color: var(--text-2); }
[data-theme="light"] .btn-icon:hover { background: #f1f3f5; }
.btn-icon.active { color: var(--accent); background: transparent; }
.btn { height: 42px; border-radius: 10px; font-weight: 600; font-size: 14.5px; }
.btn-primary { background: var(--accent); box-shadow: none; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: rgba(var(--accent-rgb), .1); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: rgba(229,57,53,.1); }
.input, .textarea { background: var(--tg-search); border: 1px solid transparent; border-radius: 10px; padding: 11px 14px; }
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: none; background: var(--bg-3); }
[data-theme="light"] .input, [data-theme="light"] .textarea { background: #f4f4f5; }
[data-theme="light"] .input:focus { background: #fff; }
.switch { background: var(--text-3); } .switch.on { background: var(--accent); }

/* ---------- Auth page (Telegram-like login card) ---------- */
.auth-page { background: var(--bg-3); }
[data-theme="dark"] .auth-page { background: #0e1621; }
.auth-card { background: var(--bg-3); border: none; border-radius: 16px; box-shadow: var(--shadow); padding: 40px 36px; }
[data-theme="dark"] .auth-card { background: #17212b; }
.auth-logo .mark { width: 96px; height: 96px; border-radius: 50%; background: var(--accent); box-shadow: none; }
.auth-logo .mark svg { width: 52px; height: 52px; transform: translateX(-3px); }
.auth-logo h1 { font-size: 24px; font-weight: 700; letter-spacing: 0; }
.auth-card .btn-primary { height: 48px; border-radius: 10px; font-size: 15px; }
.auth-card .input { height: 50px; }

/* ---------- Sidebar (chat list) — v6.9.3: مدرن‌تر، روان‌تر، با عمق و انتقال‌های نرم‌تر ---------- */
.sidebar { background: var(--bg-3); border-inline-end: 1px solid var(--border); }
.sb-header { padding: 10px 12px; min-height: var(--header-h); gap: 8px; }
.sb-header .search-wrap { border-radius: 22px; transition: box-shadow .2s var(--ease); }
.sb-header .search-wrap .input { height: 40px; background: var(--tg-search); border-radius: 20px; font-size: 14px; border-color: transparent; transition: background .2s var(--ease), box-shadow .2s var(--ease); }
[data-theme="light"] .sb-header .search-wrap .input { background: #f4f4f5; }
.sb-header .search-wrap:focus-within { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .16); }
.sb-header .search-wrap > svg.ic { color: var(--text-3); }
.stories-bar { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.story-item .avatar { width: 52px; height: 52px; }
.avatar-wrap .story-ring { background: linear-gradient(180deg, #3390ec, #7bc7ff); padding: 2px; inset: -3px; }
.avatar-wrap .story-ring.seen { background: var(--text-3); }
/* تب‌های پوشه: کپسول نرم به‌جای فقط زیرخط، با گرادیان روی حالت فعال برای شکیل‌تر شدن */
.folders { padding: 4px 10px 8px; gap: 6px; border-bottom: 1px solid var(--border); }
.folders button { padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 500; color: var(--text-2); transition: background .2s var(--ease), color .2s var(--ease); }
.folders button:hover { background: var(--tg-hover); color: var(--text); }
.folders button.active { color: #fff; font-weight: 600; background: linear-gradient(135deg, var(--accent), var(--tg-blue)); box-shadow: 0 3px 12px rgba(var(--accent-rgb), .32); }
.folders button.active::after { display: none; }
.folders .count { background: var(--tg-badge-muted); color: #fff; font-size: 11px; line-height: 18px; min-width: 18px; }
.folders button.active .count { background: rgba(255,255,255,.28); color: #fff; }
.chat-list { padding: 4px 6px 90px; }
/* ردیف‌های لیست: کارت با گوشه‌ی گرد و فاصله‌ی عمودی خفیف به‌جای نوار تخت تمام‌عرض */
.chat-item { border-radius: 12px; padding: 9px 12px; margin-bottom: 2px; gap: 11px; min-height: 68px; transition: background .2s var(--ease), transform .12s var(--ease); }
.chat-item:hover { background: var(--tg-hover); }
.chat-item:active { transform: scale(.99); }
.chat-item.active, .chat-item.active:hover { background: linear-gradient(135deg, var(--tg-active), var(--tg-active)); box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.chat-item.active .title, .chat-item.active .preview, .chat-item.active .preview .you, .chat-item.active .preview .sender, .chat-item.active .time, .chat-item.active .title svg, .chat-item.active .ticks, .chat-item.active .pin-ic, .chat-item.active .mute-ic { color: var(--tg-side-active-text) !important; }
.chat-item.active .badge { background: #fff; color: var(--tg-active); }
.chat-item .avatar { width: 54px; height: 54px; font-size: 19px; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.chat-item .title { font-size: 15px; font-weight: 600; }
.chat-item .time { font-size: 12px; color: var(--text-3); }
.chat-item .preview { font-size: 14px; color: var(--text-2); }
.chat-item .preview .you { color: var(--text-2); }
.chat-item .preview .sender { color: var(--text); }
.chat-item .preview .typing, .chat-item .preview .draft { color: var(--accent); }
.chat-item .preview .draft { color: var(--danger); }
.chat-item .ticks { color: var(--tg-out-tick); } .chat-item .ticks.read { color: var(--tg-out-tick); }
[data-theme="light"] .chat-item .ticks, [data-theme="light"] .chat-item .ticks.read { color: var(--tg-out-tick); }
.badge { background: linear-gradient(135deg, var(--tg-badge), var(--accent)); color: #fff; font-size: 12px; min-width: 22px; height: 22px; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.badge.muted { background: var(--tg-badge-muted); box-shadow: none; }
.list-section { color: var(--text-3); font-size: 13px; padding: 10px 14px 6px; background: var(--bg-3); }
.avatar-wrap .online-dot { width: 12px; height: 12px; border: 2px solid var(--bg-3); background: var(--online); }
.chat-item.active .avatar-wrap .online-dot { border-color: var(--tg-active); }

/* FAB (pencil) — v6.9.3: سایه‌ی ملایم‌تر و بازخورد فشردن نرم‌تر */
.fab { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--tg-blue)); box-shadow: 0 4px 16px rgba(0,0,0,.28); inset-inline-start: auto; inset-inline-end: 18px; bottom: 18px; transition: transform .2s var(--spring), box-shadow .2s var(--ease); }
[dir="rtl"] .fab { inset-inline-end: 18px; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.32); filter: brightness(1.06); }
.fab:active { transform: scale(.93); }
.fab svg { width: 24px; height: 24px; }

/* Drawer (hamburger menu) */
.drawer .panel { background: var(--bg-3); width: min(300px, 85vw); }
.drawer .me { background: var(--bg-3); border-bottom: 1px solid var(--border); padding: 16px 16px 12px; }
[data-theme="dark"] .drawer .me { background: #17212b; }
.drawer .menu-item, .drawer nav button, .drawer .item { border-radius: 0; padding: 12px 18px; font-size: 14.5px; }
.drawer .menu-item svg, .drawer nav button svg { color: var(--text-2); width: 22px; height: 22px; }
.drawer .menu-item:hover, .drawer nav button:hover { background: var(--tg-hover); }

/* ---------- Main chat area ---------- */
.main { background: var(--bg); }
.main::before { opacity: .55; background-size: 360px; }
[data-theme="dark"] .main::before, [data-theme="dark"][data-wallpaper="default"] .main::before {
  --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480' viewBox='0 0 480 480' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='60' cy='70' r='18'/%3E%3Cpath d='M130 40l14 22-14 22M170 40l-14 22 14 22'/%3E%3Cpath d='M250 50c-14 0-24 10-24 22s10 22 24 22h12l14 12v-12c12-2 20-12 20-22 0-12-10-22-24-22z'/%3E%3Crect x='340' y='40' width='44' height='30' rx='6'/%3E%3Cpath d='M340 48l22 14 22-14'/%3E%3Cpath d='M420 90l20-20M420 70l20 20'/%3E%3Cpath d='M40 170c10-16 30-16 40 0M50 200h20'/%3E%3Cpath d='M130 160l30 30M130 190l30-30'/%3E%3Cpath d='M220 150l12 24 26 4-19 18 5 26-24-13-24 13 5-26-19-18 26-4z'/%3E%3Ccircle cx='330' cy='180' r='22'/%3E%3Cpath d='M330 166v14l10 6'/%3E%3Cpath d='M400 160h50M400 175h36M400 190h44'/%3E%3Cpath d='M60 290c0-14 12-24 26-24s26 10 26 24-12 24-26 24l-16 10v-14c-6-4-10-12-10-20z'/%3E%3Cpath d='M160 270l40 40M160 310l40-40'/%3E%3Cpath d='M250 300c0-12 10-22 22-22 6 0 12 4 14 8 2-4 8-8 14-8 12 0 22 10 22 22 0 18-36 40-36 40s-36-22-36-40z'/%3E%3Crect x='360' y='270' width='40' height='50' rx='6'/%3E%3Cpath d='M370 285h20M370 300h14'/%3E%3Cpath d='M430 300l30-30v40h-30z'/%3E%3Ccircle cx='70' cy='400' r='20'/%3E%3Cpath d='M62 400l6 6 12-12'/%3E%3Cpath d='M140 380h50l-25 40z'/%3E%3Cpath d='M240 380c20 0 36 14 36 32s-16 32-36 32-36-14-36-32'/%3E%3Cpath d='M320 380l30 40M320 420l30-40'/%3E%3Cpath d='M400 390c0-10 8-18 18-18s18 8 18 18-8 18-18 18v12'/%3E%3Ccircle cx='418' cy='430' r='2'/%3E%3C/svg%3E");
}
[data-theme="light"] .main::before, [data-theme="light"][data-wallpaper="default"] .main::before {
  --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480' viewBox='0 0 480 480' fill='none' stroke='%23000000' stroke-opacity='0.06' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='60' cy='70' r='18'/%3E%3Cpath d='M130 40l14 22-14 22M170 40l-14 22 14 22'/%3E%3Cpath d='M250 50c-14 0-24 10-24 22s10 22 24 22h12l14 12v-12c12-2 20-12 20-22 0-12-10-22-24-22z'/%3E%3Crect x='340' y='40' width='44' height='30' rx='6'/%3E%3Cpath d='M340 48l22 14 22-14'/%3E%3Cpath d='M420 90l20-20M420 70l20 20'/%3E%3Cpath d='M40 170c10-16 30-16 40 0M50 200h20'/%3E%3Cpath d='M130 160l30 30M130 190l30-30'/%3E%3Cpath d='M220 150l12 24 26 4-19 18 5 26-24-13-24 13 5-26-19-18 26-4z'/%3E%3Ccircle cx='330' cy='180' r='22'/%3E%3Cpath d='M330 166v14l10 6'/%3E%3Cpath d='M400 160h50M400 175h36M400 190h44'/%3E%3Cpath d='M60 290c0-14 12-24 26-24s26 10 26 24-12 24-26 24l-16 10v-14c-6-4-10-12-10-20z'/%3E%3Cpath d='M160 270l40 40M160 310l40-40'/%3E%3Cpath d='M250 300c0-12 10-22 22-22 6 0 12 4 14 8 2-4 8-8 14-8 12 0 22 10 22 22 0 18-36 40-36 40s-36-22-36-40z'/%3E%3Crect x='360' y='270' width='40' height='50' rx='6'/%3E%3Cpath d='M370 285h20M370 300h14'/%3E%3Cpath d='M430 300l30-30v40h-30z'/%3E%3Ccircle cx='70' cy='400' r='20'/%3E%3Cpath d='M62 400l6 6 12-12'/%3E%3Cpath d='M140 380h50l-25 40z'/%3E%3Cpath d='M240 380c20 0 36 14 36 32s-16 32-36 32-36-14-36-32'/%3E%3Cpath d='M320 380l30 40M320 420l30-40'/%3E%3Cpath d='M400 390c0-10 8-18 18-18s18 8 18 18-8 18-18 18v12'/%3E%3Ccircle cx='418' cy='430' r='2'/%3E%3C/svg%3E");
  background-color: #d5dde6;
}
[data-theme="light"] .main { background: linear-gradient(180deg, #dbe7f0, #c9dbe9); }
[data-wallpaper="gradient"] .main::before { --wallpaper: linear-gradient(160deg, #1b2a3a, #0e1621 45%, #16303f); }
[data-theme="light"][data-wallpaper="gradient"] .main::before { --wallpaper: linear-gradient(160deg, #a8d5a2, #cfe9d0 45%, #9fcfd6); }

/* Header */
.chat-header { background: var(--bg-3); border-bottom: 1px solid var(--border); padding: 6px 12px; min-height: var(--header-h); gap: 12px; }
.chat-header .avatar { width: 42px; height: 42px; font-size: 15px; }
.chat-header .info .title { font-size: 15.5px; font-weight: 600; }
.chat-header .info .status { font-size: 13px; color: var(--text-2); }
.chat-header .info .status.online { color: var(--accent); }
.chat-header .info .status.typing { color: var(--accent); }
.pinned-bar { background: var(--bg-3); border-bottom: 1px solid var(--border); padding: 5px 14px; }
.pinned-bar .bar { background: var(--accent); border-radius: 2px; width: 2px; height: 32px; }
.pinned-bar .txt b { color: var(--accent); font-size: 13px; }

/* Messages */
.messages { padding: 10px 12px 8px; gap: 2px; }
.date-sep { background: var(--tg-date); color: #fff; font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 12px; margin: 10px 0 6px; box-shadow: none; }
[data-theme="light"] .date-sep { color: #4f6a80; background: rgba(255,255,255,.9); box-shadow: 0 1px 2px rgba(16,35,47,.15); }
.sys-msg { background: var(--tg-date); color: #fff; font-size: 13px; padding: 4px 12px; border-radius: 12px; }
[data-theme="light"] .sys-msg { color: #4f6a80; background: rgba(255,255,255,.9); }
.unread-sep { background: var(--tg-date); color: #fff; font-size: 13px; border-radius: 0; margin: 6px -12px; padding: 4px; }
[data-theme="light"] .unread-sep { color: #4f6a80; background: rgba(255,255,255,.9); }
.msg { max-width: min(72%, 560px); gap: 6px; animation: none; }
/* انیمیشن پیام‌ها (مثل تلگرام): پیام تازه‌رسیده از پایین با فنر وارد می‌شود؛ پیام ارسالی از سمت نویسنده */
[data-anim="on"] .msg.msg-new { animation: tg-msg-in .32s cubic-bezier(.22,1,.36,1) both; }
[data-anim="on"] .msg.msg-new.out { animation-name: tg-msg-out; transform-origin: bottom right; }
[data-anim="on"] .msg.msg-new.in { transform-origin: bottom left; }
@keyframes tg-msg-in { from { opacity: 0; transform: translateY(18px) scale(.94); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes tg-msg-out { from { opacity: 0; transform: translateY(24px) translateX(-6px) scale(.9); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
[data-anim="on"] .msg.msg-new .bubble { animation: tg-bubble-pop .32s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes tg-bubble-pop { from { transform: scale(.96); } to { transform: none; } }
[data-anim="on"] .sys-msg.msg-new, [data-anim="on"] .date-sep.msg-new { animation: fade .3s both; }
[data-anim="on"] .msg .reactions .rx { transition: transform .18s var(--spring); } [data-anim="on"] .msg .reactions .rx:active { transform: scale(.9); }
[data-anim="on"] .msg.out .ticks svg { animation: tick-in .25s both; } @keyframes tick-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
[data-anim="on"] .composer .btn-icon.send { transition: transform .2s var(--spring), background .2s; } [data-anim="on"] .composer .btn-icon.send:active { transform: scale(.88); }
[data-anim="on"] .chat-item { transition: background .15s; }
[data-anim="on"] .typing-dots i { animation: td 1.2s infinite; }

.msg.grp-first { margin-top: 6px; }
.msg .av-slot { width: 34px; }
.bubble { border-radius: 12px; padding: 6px 10px 5px; min-width: 56px; box-shadow: var(--shadow-sm); font-size: var(--fs); line-height: 1.5; }
.msg.in .bubble { background: var(--bubble-in); border: none; }
.msg.out .bubble { background: var(--bubble-out); color: var(--bubble-out-text); }
/* tails (Telegram style: last bubble in group gets a tail) */
.msg.in.grp-last .bubble { border-end-end-radius: 4px; }
.msg.out.grp-last .bubble { border-end-start-radius: 4px; }
.msg.in.grp-last .bubble::after, .msg.out.grp-last .bubble::after { content: ''; position: absolute; bottom: 0; width: 9px; height: 14px; background: inherit; }
.msg.in.grp-last .bubble::after { inset-inline-end: -8px; clip-path: path('M0 0v14C3 12 6 9 9 14 4 12 1 8 0 0z'); }
.msg.out.grp-last .bubble::after { inset-inline-start: -8px; clip-path: path('M9 0v14C6 12 3 9 0 14 5 12 8 8 9 0z'); }
[dir="rtl"] .msg.in.grp-last .bubble::after { clip-path: path('M9 0v14C6 12 3 9 0 14 5 12 8 8 9 0z'); }
[dir="rtl"] .msg.out.grp-last .bubble::after { clip-path: path('M0 0v14C3 12 6 9 9 14 4 12 1 8 0 0z'); }
.bubble.only-emoji::after, .bubble.has-media-only::after { display: none; }
.bubble .sender, .msg.in .bubble .sender { color: var(--tg-name); font-weight: 600; font-size: 13.5px; }
.bubble .text a, .msg.in .bubble .text a { color: var(--tg-link); text-decoration: none; }
.bubble .text a:hover { text-decoration: underline; }
.msg.out .bubble .text a { color: var(--bubble-out-text); text-decoration: underline; }
.bubble .text .mention { color: var(--tg-link); font-weight: 500; }
.msg.out .bubble .text .mention { color: inherit; }
.bubble .quote { background: var(--tg-quote-bg); border-inline-start: 2px solid var(--tg-link); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; }
.bubble .quote .q-name { color: var(--tg-link); font-size: 13px; font-weight: 600; }
.msg.out .bubble .quote { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.9); }
.msg.out .bubble .quote .q-name { color: #fff; }
[data-theme="light"] .msg.out .bubble .quote { background: rgba(98,172,85,.14); border-color: #62ac55; }
[data-theme="light"] .msg.out .bubble .quote .q-name { color: #62ac55; }
.bubble .meta { font-size: 12px; opacity: 1; color: var(--text-3); margin-top: 4px; gap: 3px; }
.msg.out .bubble .meta { color: var(--tg-out-time); }
.bubble .meta svg { width: 17px; height: 17px; }
.msg.out .bubble .meta .ticks { color: var(--tg-out-tick); display: inline-flex; }
.msg.out .bubble .meta .ticks.read { color: var(--tg-out-tick); filter: none; }
.msg.out .bubble .meta .ticks.read svg { stroke-width: 2.2; }
.bubble .meta .edited { font-style: normal; }
.bubble .text code { background: rgba(0,0,0,.18); }
.msg.out .bubble .text code, .msg.out .bubble .text pre { background: rgba(0,0,0,.2); }
[data-theme="light"] .bubble .text code, [data-theme="light"] .bubble .text pre { background: rgba(0,0,0,.06); }
.bubble.only-emoji .text { font-size: 42px; }
.bubble.only-emoji .meta { background: var(--tg-date); color: #fff; }
/* reactions */
.reactions { gap: 4px; margin-top: 5px; }
.reactions button, .reactions .reaction { height: 26px; padding: 0 8px 0 6px; border-radius: 13px; font-size: 13px; font-weight: 600; background: rgba(var(--accent-rgb), .18); color: var(--tg-link); border: none; display: inline-flex; align-items: center; gap: 4px; }
.reactions button.me, .reactions .reaction.me { background: var(--accent); color: #fff; }
.msg.out .reactions button, .msg.out .reactions .reaction { background: rgba(255,255,255,.16); color: #fff; }
.msg.out .reactions button.me, .msg.out .reactions .reaction.me { background: #fff; color: var(--accent); }
[data-theme="light"] .msg.out .reactions button { background: rgba(98,172,85,.18); color: #3f8a34; }
[data-theme="light"] .msg.out .reactions button.me { background: #62ac55; color: #fff; }
/* hover quick actions */
.msg .quick button { background: var(--bg-3); border: 1px solid var(--border-2); color: var(--text-2); width: 30px; height: 30px; }
.scroll-down { background: var(--bg-3); border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.3); width: 44px; height: 44px; color: var(--text-2); }
.scroll-down .badge { background: var(--tg-badge); }
/* media */
.media-img { border-radius: 10px; }
.file-card .ic-wrap, .doc .ic-wrap { background: var(--accent); border-radius: 50%; }
.msg.out .file-card .ic-wrap, .msg.out .doc .ic-wrap { background: rgba(255,255,255,.22); }
[data-theme="light"] .msg.out .file-card .ic-wrap { background: #62ac55; }
.voice .play, .audio .play { background: var(--accent); }
.msg.out .voice .play, .msg.out .audio .play { background: #fff; color: var(--accent); }
[data-theme="light"] .msg.out .voice .play { background: #62ac55; color: #fff; }
.voice .wave i { background: rgba(var(--accent-rgb), .45); } .voice .wave i.on { background: var(--accent); }
.msg.out .voice .wave i { background: rgba(255,255,255,.4); } .msg.out .voice .wave i.on { background: #fff; }
[data-theme="light"] .msg.out .voice .wave i { background: rgba(98,172,85,.4); } [data-theme="light"] .msg.out .voice .wave i.on { background: #62ac55; }
.poll-opt .poll-bar i { background: var(--accent); }
.msg.out .poll-opt .poll-bar i { background: #fff; }

/* ---------- Composer (flat Telegram bar) ---------- */
.composer-wrap { padding: 0; background: transparent; }
.composer-ctx { margin: 0; border-radius: 0; background: var(--tg-composer); border-top: 1px solid var(--border); padding: 6px 14px; }
.composer-ctx .bar { background: var(--accent); width: 2px; }
.composer-ctx .txt b { color: var(--accent); }
.composer { gap: 0; align-items: flex-end; background: var(--tg-composer); border-top: 1px solid var(--border); padding: 5px 6px calc(5px + var(--safe-bottom)); }
.composer .box { background: transparent; border: none; border-radius: 0; min-height: 50px; padding: 0 2px; box-shadow: none; }
.composer .box:focus-within { border: none; box-shadow: none; }
.composer textarea { font-size: 15.5px; padding: 12px 8px; min-height: 48px; max-height: 200px; }
.composer .btn-icon { width: 44px; height: 44px; color: var(--text-3); }
.composer .btn-icon:hover { color: var(--accent); background: transparent; }
.composer .btn-icon svg.ic { width: 24px; height: 24px; }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: transparent; color: var(--accent); box-shadow: none; }
.composer .send svg { width: 26px; height: 26px; }
.composer .send.mic { background: transparent; border: none; color: var(--text-3); }
.composer .send.mic:hover { color: var(--accent); }
.composer .send.recording { background: var(--danger); color: #fff; }
.composer-blocked { border-radius: 0; background: var(--tg-composer); border: none; border-top: 1px solid var(--border); padding: 14px; }
.composer-blocked .btn { color: var(--accent); }
.fmt-bar { background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); }
.emoji-picker { background: var(--bg-3); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); inset-inline-end: 6px; bottom: calc(100% + 4px); width: 370px; height: 420px; }
.emoji-picker .tabs button.active { background: var(--tg-hover); }
.emoji-picker .grid button:hover { background: var(--tg-hover); transform: none; }
.attach-menu { background: var(--bg-3); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 12px; }

/* ---------- Right info panel ---------- */
.info-panel { background: var(--bg-3); border-inline-start: 1px solid var(--border); }
.info-panel .ip-header { border-bottom: 1px solid var(--border); min-height: var(--header-h); }
.info-panel .ip-header h3 { font-size: 16px; }
.ip-hero .avatar.xl { width: 120px; height: 120px; font-size: 42px; }
.ip-section, .settings-group, .group { background: var(--bg-3); border: none; border-radius: 0; border-bottom: 8px solid var(--bg); }
[data-theme="light"] .ip-section, [data-theme="light"] .settings-group, [data-theme="light"] .group { border-bottom-color: #f1f1f1; }
.ip-row, .settings-row, .s-row { border-radius: 0; padding: 10px 18px; }
.ip-row:hover, .settings-row:hover, .s-row:hover { background: var(--tg-hover); }
.ip-row .ic, .settings-row .ic, .s-row .ic { color: var(--text-2); }
.ip-row .label, .settings-row .label { font-size: 14.5px; }
.ip-row .sub, .settings-row .sub { color: var(--accent); font-size: 13px; }
.ic-grad { border-radius: 8px; width: 30px; height: 30px; }
.tabs-line button.active { color: var(--accent); }
.tabs-line button.active::after { background: var(--accent); height: 3px; }

/* ---------- Modals / sheets / menus / toasts ---------- */
.modal-root .scrim { background: rgba(0,0,0,.4); }
.modal { border-radius: 14px; background: var(--bg-3); border: none; box-shadow: var(--shadow); max-width: 420px; }
.modal-head { padding: 18px 22px 8px; } .modal-head h3 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 4px 22px 14px; }
.modal-foot { padding: 6px 12px 12px; gap: 2px; }
.modal-foot .btn { min-width: 0; height: 40px; padding: 0 16px; background: transparent; color: var(--accent); font-weight: 600; box-shadow: none; text-transform: uppercase; }
.modal-foot .btn:hover { background: rgba(var(--accent-rgb), .1); }
.modal-foot .btn.btn-danger { color: var(--danger); } .modal-foot .btn.btn-danger:hover { background: rgba(229,57,53,.1); }
.modal.settings-modal, .modal.prem-modal, .modal.wide, .modal.adm-modal { max-width: 640px; }
.modal.settings-modal { max-width: 520px; height: min(760px, calc(100vh - 24px));  height: min(760px, calc(100dvh - 24px)); max-height: calc(100vh - 24px);  max-height: calc(100dvh - 24px); }
.sheet { border-radius: 14px 14px 0 0; background: var(--bg-3); border: none; }
.sheet .grip { background: var(--text-3); opacity: .5; }
.ctx-menu { border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 5px; min-width: 220px; }
.ctx-menu .menu-item { border-radius: 6px; padding: 8px 14px; font-size: 14.5px; gap: 14px; }
.ctx-menu .menu-item:hover { background: var(--tg-hover); }
.ctx-menu .menu-item svg { color: var(--text-2); width: 20px; height: 20px; }
.ctx-menu .menu-item.danger, .ctx-menu .menu-item.danger svg { color: var(--danger); }
.ctx-menu .react-row button.me { background: rgba(var(--accent-rgb), .25); }
.toast { border-radius: 10px; background: rgba(0,0,0,.82); color: #fff; border: none; box-shadow: none; padding: 10px 16px; }
[data-theme="light"] .toast { background: rgba(20,20,20,.88); }
.toast .txt b, .toast .txt span { color: #fff; }
.toast .ic-wrap { background: transparent !important; }
.toast .undo { color: #6ab3f3; }
.toast .btn-icon { color: #fff; }

/* ---------- Settings pages ---------- */
.settings-page .sp-head { border-bottom: 1px solid var(--border); background: var(--bg-3); }
.settings-page .sp-body { background: var(--bg); }
[data-theme="light"] .settings-page .sp-body { background: #f1f1f1; }
.sp-profile { background: var(--bg-3); }
.accent-dot { border-radius: 50%; }
.wallpaper-row button { border-radius: 8px; border-width: 2px; }
.wallpaper-row button.active { border-color: var(--accent); }

/* ---------- Premium page tint ---------- */
/* v6.9 · هدر پریمیوم — مثل Telegram Premium */
.prem-hero { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: 30px 18px 22px; margin: 0 -12px 14px; border-radius: 0 0 30px 30px; color: #fff;
  background: linear-gradient(160deg, #5b8def 0%, #7a5cf5 45%, #c94fd6 80%, #ee5f8a 100%); box-shadow: inset 0 -40px 60px -30px rgba(0,0,0,.25), 0 12px 32px -14px rgba(122,92,245,.55); }
.prem-hero::before { content: ''; position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.28), transparent 60%); pointer-events: none; }
.prem-hero::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.035) 22px 23px); mix-blend-mode: overlay; pointer-events: none; }
.prem-stars { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.prem-stars i { position: absolute; left: var(--x); top: 100%; width: var(--s); height: var(--s); background: #fff; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); opacity: 0; animation: prem-rise var(--d) linear infinite; animation-delay: calc(var(--i) * -0.37s); filter: drop-shadow(0 0 6px rgba(255,255,255,.9)); }
@keyframes prem-rise { 0% { transform: translateY(0) scale(.6) rotate(0); opacity: 0; } 15% { opacity: .95; } 100% { transform: translateY(-260px) scale(1.1) rotate(160deg); opacity: 0; } }
.prem-orbit { position: absolute; left: 50%; top: 62px; width: 0; height: 0; z-index: 0; pointer-events: none; }
.prem-orbit .po { position: absolute; width: 30px; height: 30px; margin: -15px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); animation: prem-orbit 14s linear infinite; animation-delay: calc(var(--i) * -2.333s); }
.prem-orbit .po svg { width: 15px; height: 15px; color: #fff; }
@keyframes prem-orbit { from { transform: rotate(0) translateX(118px) rotate(0); } to { transform: rotate(360deg) translateX(118px) rotate(-360deg); } }
.prem-hero .prem-logo { position: relative; z-index: 1; width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%; background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(255,255,255,.75)); color: #7a5cf5; box-shadow: 0 18px 44px -10px rgba(0,0,0,.35), inset 0 -6px 14px rgba(122,92,245,.18); animation: prem-float 3.4s ease-in-out infinite; }
.prem-hero .prem-logo svg { width: 46px; height: 46px; fill: currentColor; stroke: none; filter: drop-shadow(0 2px 4px rgba(122,92,245,.35)); }
.prem-logo-ring { position: absolute; inset: -7px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); border-top-color: transparent; border-bottom-color: transparent; animation: prem-spin 6s linear infinite; }
@keyframes prem-spin { to { transform: rotate(360deg); } }
.prem-hero h2 { position: relative; z-index: 1; font-size: 26px; font-weight: 900; letter-spacing: -.2px; background: none; -webkit-text-fill-color: #fff; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.18); }
.prem-hero h2 .prem-word { background: linear-gradient(90deg, #fff3b0, #ffd166 45%, #fff); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.prem-hero p { position: relative; z-index: 1; color: rgba(255,255,255,.88); font-size: 14px; margin-top: 6px; }
.prem-status { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 14px 8px 12px; border-radius: 99px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(8px); font-size: 13px; color: #fff; box-shadow: 0 8px 22px -10px rgba(0,0,0,.35); }
.prem-status b { font-weight: 700; } .prem-status .ps-until { opacity: .85; font-size: 12px; padding-inline-start: 8px; border-inline-start: 1px solid rgba(255,255,255,.35); }
.prem-status .ps-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.28); animation: rg-pulse 1.6s ease-in-out infinite; }
.prem-status svg { width: 16px; height: 16px; } .prem-status.ghost { background: rgba(255,255,255,.12); }
[data-theme="light"] .prem-hero { box-shadow: 0 14px 36px -14px rgba(122,92,245,.5); }
html.m-shell .prem-hero { margin: 0 -14px 14px; border-radius: 0 0 26px 26px; padding-top: 26px; }
.prem-plans > *.active { border-color: var(--accent); }

/* ---------- Stories viewer / lightbox ---------- */
.story-viewer .bar i { background: #fff; }

/* ---------- Mobile (Telegram Android/iOS-like) ---------- */
@media (max-width: 900px) {
  :root { --header-h: 56px; }
  .sb-header { background: var(--bg-3); }
  .chat-item { min-height: 72px; padding: 8px 12px; }
  .chat-item .avatar { width: 56px; height: 56px; }
  .msg { max-width: 84%; }
  .composer .btn-icon { width: 42px; height: 42px; }
  .fab { bottom: calc(16px + var(--safe-bottom)); }
  .emoji-picker { position: fixed; top: auto; bottom: 0; inset-inline: 0; width: 100vw; max-width: 100vw; border-radius: 12px 12px 0 0; height: 48vh;  height: 48dvh; padding-bottom: var(--safe-bottom); z-index: 60; animation: sheetUp .22s var(--ease); }
  .composer-wrap.picker-open { padding-bottom: 48vh;  padding-bottom: 48dvh; }
  .modal { border-radius: 14px; }
}

/* ---------- Bubble radius option (settings) ---------- */
[data-bubbles="square"] .bubble { border-radius: 6px; }
[data-bubbles="square"] .msg.in.grp-last .bubble::after, [data-bubbles="square"] .msg.out.grp-last .bubble::after { display: none; }
[data-bubbles="pill"] .bubble { border-radius: 18px; }

/* ---------- Font size option ---------- */
[data-fs="small"] { --fs: 14px; } [data-fs="large"] { --fs: 16px; } [data-fs="xl"] { --fs: 17px; }

/* ---------- Reduce motion / power saving ---------- */
[data-anim="off"] *, [data-power="on"] * { animation: none !important; transition: none !important; }

/* ---------- Settings groups (Telegram sectioned lists) ---------- */
.set-group { margin: 0 0 8px; border-radius: 0; background: var(--bg-3); border: none; }
.set-group .g-title { color: var(--accent); font-size: 14px; font-weight: 600; padding: 14px 18px 4px; }
.set-row { padding: 11px 18px; border-top: none; font-size: 14.5px; }
.set-row.clickable:hover { background: var(--tg-hover); }
.set-row .col b { font-size: 14.5px; font-weight: 400; }
.set-row .col span { color: var(--text-2); font-size: 13px; }
.set-row .end { color: var(--accent); }
.settings-hero { background: var(--bg-3); padding: 22px 18px 14px; margin-bottom: 8px; }
.settings-hero h2 { font-weight: 600; font-size: 19px; }
.settings-hero .avatar-wrap .cam { background: var(--accent); }
.ip-section { padding: 6px 0; }
.ip-row { border-radius: 0; padding: 10px 18px; }
.ip-row.clickable:hover { background: var(--tg-hover); }
.ip-row .col b { font-weight: 400; }
.ip-row .col span { color: var(--accent); }
.sender-name { font-size: 13.5px; font-weight: 600; }
.file-card .ic-wrap { border-radius: 50%; background: var(--accent); color: #fff; }
.file-card .ext { background: transparent; color: #fff; }
.msg.out .file-card .ic-wrap { background: rgba(255,255,255,.22); }
[data-theme="light"] .msg.out .file-card .ic-wrap { background: #62ac55; }
/* emoji picker (image emoji) */
.emoji-picker .tabs button { min-width: 36px; height: 34px; }
.emoji-picker .tabs button img.em { width: 22px; height: 22px; }
.emoji-picker .tabs button svg { width: 20px; height: 20px; color: var(--text-2); }
.emoji-picker .grid { grid-template-columns: repeat(8, 1fr); gap: 0; padding: 4px 8px 8px; }
.emoji-picker .grid button { border-radius: 8px; }
.emoji-picker .grid button img.em { width: 30px; height: 30px; }
.emoji-picker .grid .sticker-btn img.em { width: 64px; height: 64px; }
.emoji-picker .grid .cat { padding: 8px 4px 4px; }
.ctx-menu .react-row button img.em { width: 26px; height: 26px; }
.chat-item .preview svg.type-ic { width: 15px; height: 15px; vertical-align: -3px; margin-inline-end: 4px; color: var(--text-3); }
.chat-item.active .preview svg.type-ic { color: #fff; }
[data-theme="light"] .unread-sep { background: rgba(255,255,255,.75); color: #4f6a80; }
[data-theme="light"] .msg.out .bubble .meta { color: #62ac55; }
[data-theme="light"] .chat-header .info .status.online { color: #3390ec; }
.bubble.only-emoji .text img.em-svg { width: 1em; height: 1em; vertical-align: -0.15em; }
.bubble.only-emoji .text.sticker img.em-svg { width: 112px; height: 112px; image-rendering: auto; }

/* ===== Wallpapers: built-in gallery + custom image (Telegram "Chat Background") ===== */
[data-wallpaper="custom"] .main::before, [data-wallpaper^="wp:"] .main::before { --wallpaper: var(--custom-wp, none); background-size: cover; background-position: center; opacity: 1; }
[data-theme="dark"][data-wallpaper="custom"] .main::before, [data-theme="dark"][data-wallpaper^="wp:"] .main::before { opacity: .85; }
[data-wpblur="on"][data-wallpaper="custom"] .main::before, [data-wpblur="on"][data-wallpaper^="wp:"] .main::before { filter: blur(6px) saturate(.9); inset: -14px; }
/* لایه‌ی پس‌زمینه هرگز نباید از کادر گفتگو بیرون بزند (باگ محوشدن سایدبار/هدر) */
.main { overflow: hidden; isolation: isolate; contain: paint; }
.main::before { z-index: -1; }
[data-wallpaper^="wp:"] .messages .msg .bubble.in, [data-wallpaper="custom"] .messages .msg .bubble.in { box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.wallpaper-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 16px 14px; }
.wallpaper-grid button { aspect-ratio: 4/3; border-radius: 10px; border: 2px solid var(--border); background: var(--bg-2); overflow: hidden; position: relative; font: inherit; color: #fff; cursor: pointer; padding: 0; }
.wallpaper-grid button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wallpaper-grid button span { position: absolute; inset-inline: 0; bottom: 0; padding: 3px 6px; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.6)); text-align: start; }
.wallpaper-grid button.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.wallpaper-grid button.active::after { content: ''; position: absolute; top: 6px; inset-inline-end: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; }
.main > .chat-header, .main > .composer-wrap, .main > .pinned-bar { position: relative; z-index: 3; }
.main > .messages { position: relative; z-index: 1; }
.main > .scroll-down { z-index: 4; }
.main::before { z-index: 0; }

/* Layout hard-lock: grid row must never exceed viewport (prevents header being pushed off-screen) */
.app-shell { grid-template-rows: minmax(0, 100vh);  grid-template-rows: minmax(0, 100dvh); }
.app-shell > .sidebar, .app-shell > .main, .app-shell > .info-panel { min-height: 0; max-height: 100vh;  max-height: 100dvh; }
.main > .messages { min-height: 0; }

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

/* ===== تیک آبی تأیید رسمی (Telegram verified badge) ===== */
.verified-badge { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-inline-start: 4px; vertical-align: -3px; flex-shrink: 0; }
.verified-badge svg.vb { width: 16px; height: 16px; fill: none; stroke: none; color: inherit; }
.verified-badge.lg { width: 22px; height: 22px; } .verified-badge.lg svg.vb { width: 22px; height: 22px; }
.chat-item .title .verified-badge { vertical-align: -2px; }
.chat-header .title .verified-badge { vertical-align: middle; }
.sender-name .verified-badge { width: 14px; height: 14px; vertical-align: -2px; } .sender-name .verified-badge svg.vb { width: 14px; height: 14px; }
.member-item b .verified-badge, .user-row b .verified-badge { width: 14px; height: 14px; } .member-item b .verified-badge svg.vb, .user-row b .verified-badge svg.vb { width: 14px; height: 14px; }
.ip-hero h2 .verified-badge, .settings-hero h2 .verified-badge { vertical-align: -3px; }

/* ===== لایه‌های روی نمایشگر استوری: منو/شیت/مودال/تأیید باید بالاتر از استوری (z 110) باشند ===== */
.story-viewer ~ .modal-root, .story-viewer ~ .sheet-root, .story-viewer ~ .drawer { z-index: 130; }
.story-viewer ~ .modal-root .ctx-menu { z-index: 131; }
.sheet .user-row .rx-em { font-size: 20px; }

/* ===== مدیریت گروه/کانال (Manage) ===== */
.mg-modal { max-width: 460px; }
.mg-modal .modal-body { padding: 0 !important; max-height: min(84vh, 760px); overflow: auto; background: var(--bg); }
.mg-head { position: sticky; top: 0; z-index: 2; background: var(--sidebar-bg, var(--panel)); border-bottom: 1px solid var(--border); gap: 6px; }
.mg-head h3 { flex: 1; font-size: 17px; }
.mg-body { padding-bottom: 12px; }
.mg-body .set-group { margin: 12px 0 0; border-radius: 0; border-left: 0; border-right: 0; background: var(--sidebar-bg, var(--panel)); }
.mg-body .set-row { padding: 11px 16px; border-top: 1px solid var(--border); background: transparent; }
.mg-body .set-row.sub { padding-inline-start: 52px; }
.mg-body .set-row.dim .col b { color: var(--text-3); }
.mg-body .set-row .col b { font-size: 14.5px; font-weight: 500; }
.mg-body .set-row .col span { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.mg-body .member-item { padding: 8px 16px; border-top: 1px solid var(--border); width: 100%; text-align: start; }
.mg-body .member-item .col span { font-size: 12.5px; color: var(--text-3); }
.mg-hero { display: flex; align-items: center; gap: 14px; padding: 18px 16px 8px; }
.mg-hero .col { flex: 1; min-width: 0; }
.mg-hero .col b { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; }
.mg-hero .col span { color: var(--text-3); font-size: 13px; }
.mg-hint { padding: 8px 16px 0; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.mg-foot { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; margin-top: 12px; background: var(--sidebar-bg, var(--panel)); border-top: 1px solid var(--border); }
.mg-foot .btn { min-width: 110px; }
.mg-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mg-link { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--accent); word-break: break-all; direction: ltr; text-align: left; }
.mg-color { width: 20px; height: 20px; border-radius: 50%; display: inline-block; }
.mg-radio .set-row { border-top: 1px solid var(--border); }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-3); flex-shrink: 0; position: relative; }
.radio.on { border-color: var(--accent); }
.radio.on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.slow-row { display: flex; gap: 4px; }
.slow-row button { flex: 1; height: 34px; border-radius: 8px; background: var(--bg); color: var(--text-2); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.slow-row button.on { background: var(--accent); color: #fff; }
.mg-react { padding: 0 12px 12px; }
.mg-react button { opacity: .45; transition: opacity .15s, transform .15s; }
.mg-react button.me { opacity: 1; background: var(--accent-soft, rgba(51,144,236,.12)); }
.mg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 12px 0; }
.mg-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; background: var(--sidebar-bg, var(--panel)); border: 1px solid var(--border); border-radius: 12px; }
.mg-stat svg { width: 20px; height: 20px; color: var(--accent); }
.mg-stat b { font-size: 18px; font-weight: 700; }
.mg-stat span { font-size: 11.5px; color: var(--text-3); }
.mg-chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 14px 16px 4px; }
.mg-chart .bar { flex: 1; min-height: 3px; border-radius: 3px 3px 0 0; opacity: .85; transition: opacity .15s; }
.mg-chart .bar:hover { opacity: 1; }
.mg-chart-x { display: flex; justify-content: space-between; padding: 2px 16px 12px; font-size: 11.5px; color: var(--text-3); }
.switch.disabled { opacity: .4; cursor: not-allowed; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.msg .meta .signature { font-size: 11.5px; color: var(--text-3); margin-inline-end: 6px; }
.msg .meta .signature.clickable { cursor: pointer; color: var(--accent); }
.msg .meta .views { cursor: pointer; }
.member-item .rank, .sender-name .rank { font-size: 11px; color: var(--text-3); font-weight: 400; margin-inline-start: 6px; }
@media (max-width: 680px) { .mg-modal { max-width: 100%; width: 100%; height: 100%; max-height: 100%; border-radius: 0; } .mg-modal .modal-body { max-height: none; height: calc(100% - 56px); } .mg-stats { grid-template-columns: repeat(2, 1fr); } }
.join-pending { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 4px 4px; text-align: center; }
.join-pending h3 { font-size: 18px; }
.join-pending .muted { color: var(--text-3); font-size: 13.5px; margin-top: -6px; }
.jp-note { display: flex; gap: 10px; align-items: flex-start; text-align: start; padding: 12px; border-radius: 12px; background: var(--bg); font-size: 13.5px; line-height: 1.6; margin: 6px 0 10px; }
.jp-note svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }

/* =====================================================================
   انتقال رسانه (Transfer) — حلقه‌ی پیشرفت تلگرامی، برچسب حجم، کارت فایل
   ===================================================================== */
/* ---------- حلقه‌ی پیشرفت تلگرامی (آپلود/دانلود) ---------- */
.tg-ring { position: relative; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.5); cursor: pointer; color: #fff; transition: transform .25s var(--spring), opacity .2s; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.tg-ring.enter { transform: scale(.6); opacity: 0; }
.tg-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tg-ring .t { stroke: rgba(255,255,255,.22); }
.tg-ring .p { stroke: #fff; transition: stroke-dashoffset .25s cubic-bezier(.2,.8,.2,1); }
.tg-ring.indeterminate svg { animation: spin .9s linear infinite; }
.tg-ring .pct { font-size: 11px; font-weight: 600; letter-spacing: -.2px; transition: opacity .15s; }
.tg-ring.no-pct .pct, .tg-ring.indeterminate .pct { opacity: 0; }
.tg-ring .x, .tg-ring .ok { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s, transform .25s var(--spring); transform: scale(.6); }
.tg-ring .x svg, .tg-ring .ok svg { position: static; width: 18px; height: 18px; }
.tg-ring:hover .pct, .tg-ring:active .pct { opacity: 0; } .tg-ring:hover .x, .tg-ring:active .x { opacity: 1; transform: none; }
.tg-ring.indeterminate .x { opacity: 1; transform: none; }
.tg-ring.done .p { stroke-dashoffset: 0 !important; stroke: #4fae4e; } .tg-ring.done .pct, .tg-ring.done .x { opacity: 0 !important; } .tg-ring.done .ok { opacity: 1; transform: none; color: #4fae4e; }
.tg-ring.done { animation: ring-done .4s var(--spring); } @keyframes ring-done { 40% { transform: scale(1.12); } }
/* پوشش روی عکس/ویدیو در حال ارسال/دریافت */
.upload-progress.tg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0,0,0,.28); cursor: pointer; overflow: hidden; animation: fade .2s; }
.upload-progress.tg .shimmer { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%); background-size: 220% 100%; animation: tg-shimmer 1.6s linear infinite; pointer-events: none; }
@keyframes tg-shimmer { from { background-position: 200% 0; } to { background-position: -20% 0; } }
.upload-progress.tg .up-lbl { position: relative; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.62); color: #fff; font-size: 11.5px; white-space: nowrap; direction: rtl; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.upload-progress.tg.finishing .shimmer { animation-duration: .8s; }
.media-img .vid-size { display: inline-flex; align-items: center; gap: 4px; } .media-img .vid-size svg { width: 13px; height: 13px; }
/* کارت فایل */
.file-card.tg-file { cursor: pointer; min-width: 240px; gap: 12px; align-items: center; }
.file-card.tg-file .ic-wrap { background: var(--accent); color: #fff; border-radius: 50%; width: 46px; height: 46px; overflow: visible; display: grid; place-items: center; transition: background .2s, transform .2s var(--spring); }
.file-card.tg-file:active .ic-wrap { transform: scale(.92); }
.file-card.tg-file .ic-wrap .dl-ic { display: grid; place-items: center; animation: fade .2s; } .file-card.tg-file .ic-wrap .dl-ic svg { width: 22px; height: 22px; }
.file-card.tg-file .ic-wrap .doc { position: relative; display: grid; place-items: center; animation: doc-in .3s var(--spring); } .file-card.tg-file .ic-wrap .doc > svg { width: 24px; height: 24px; }
.file-card.tg-file .ic-wrap .doc .ext { position: absolute; bottom: -3px; inset-inline-start: 50%; transform: translateX(50%); font-size: 8px; font-weight: 800; letter-spacing: .3px; padding: 1px 4px; border-radius: 4px; background: #fff; color: var(--accent); line-height: 1.2; direction: ltr; }
@keyframes doc-in { from { transform: scale(.5) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.file-card.tg-file .ic-wrap .tg-ring { width: 46px; height: 46px; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.file-card.tg-file .ic-wrap .tg-ring .t { stroke: rgba(255,255,255,.35); }
.file-card.tg-file .fi { min-width: 0; flex: 1; } .file-card.tg-file .fi .fname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; font-weight: 600; }
.file-card.tg-file .fi-sub { font-size: 12px; opacity: .8; display: block; margin-top: 2px; direction: rtl; }
.file-card.tg-file .fi-bar { display: block; height: 0; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.18); transition: height .2s, margin .2s; }
.file-card.tg-file .fi-bar.on { height: 3px; margin-top: 6px; } .msg.in .file-card.tg-file .fi-bar { background: rgba(var(--accent-rgb),.18); }
.file-card.tg-file .fi-bar b { display: block; height: 100%; width: 0; border-radius: 99px; background: #fff; transition: width .25s cubic-bezier(.2,.8,.2,1); } .msg.in .file-card.tg-file .fi-bar b { background: var(--accent); }
.file-card.tg-file .fi-bar.ind b { width: 40% !important; animation: bar-ind 1.1s ease-in-out infinite; } @keyframes bar-ind { 0% { margin-inline-start: -40%; } 100% { margin-inline-start: 100%; } }
.msg.out .file-card.tg-file .ic-wrap { background: rgba(255,255,255,.22); } .msg.out .file-card.tg-file .ic-wrap .doc .ext { color: var(--bubble-out); }
[data-theme="light"] .msg.out .file-card.tg-file .ic-wrap { background: #4fae4e; } [data-theme="light"] .msg.out .file-card.tg-file .ic-wrap .doc .ext { color: #4fae4e; }
/* گالری */
.lb-dl-lbl { font-size: 12px; color: #fff; opacity: .85; margin-inline-end: 6px; direction: rtl; animation: fade .2s; }
.lb-head .btn-icon.dl .tg-ring { background: transparent; width: 36px; height: 36px; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* صدا/ویس در حال ارسال */
.audio-player .up-lbl { font-size: 11.5px; opacity: .8; direction: rtl; }

/* پنجره‌ی ارسال رسانه (آلبوم) */
.send-grid { display: grid; gap: 4px; border-radius: 14px; overflow: hidden; background: #000; max-height: 50vh; }
.send-grid[data-n="1"] { grid-template-columns: 1fr; } .send-grid[data-n="2"] { grid-template-columns: 1fr 1fr; } .send-grid[data-n="3"], .send-grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
.send-cell { position: relative; min-height: 120px; max-height: 50vh; display: grid; place-items: center; background: #111; overflow: hidden; }
.send-grid[data-n="1"] .send-cell img, .send-grid[data-n="1"] .send-cell video { max-height: 46vh; object-fit: contain; width: 100%; }
.send-grid:not([data-n="1"]) .send-cell { aspect-ratio: 1; } .send-grid:not([data-n="1"]) .send-cell img, .send-grid:not([data-n="1"]) .send-cell video { width: 100%; height: 100%; object-fit: cover; }
.send-cell.blur img, .send-cell.blur video { filter: blur(18px); }
.send-cell .size { position: absolute; top: 6px; inset-inline-start: 6px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; }
.send-cell .rm { position: absolute; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; } .send-cell .rm svg { width: 14px; height: 14px; }
.send-cell .play { position: absolute; width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; } .send-cell .play svg { width: 22px; height: 22px; }
.send-cell .file-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; color: #fff; text-align: center; width: 100%; }
.send-cell .file-tile svg { width: 36px; height: 36px; color: var(--accent); } .send-cell .file-tile b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; } .send-cell .file-tile span { font-size: 11.5px; opacity: .7; }
.send-cell.as-file img, .send-cell.as-file video { opacity: .35; }
.send-tools .hint { font-size: 12px; color: var(--text-3); }

/* موسیقی پروفایل */
.music-bar { position: relative; display: flex; align-items: center; gap: 10px; margin: 0 12px 10px; padding: 8px 12px; border-radius: 14px; background: var(--glass-2); cursor: pointer; overflow: hidden; width: calc(100% - 24px); text-align: start; }
.music-bar .mb-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; } .music-bar .mb-ic svg { width: 16px; height: 16px; }
.music-bar .mb-ic.lg { width: 44px; height: 44px; } .music-bar .mb-ic.lg svg { width: 22px; height: 22px; }
.music-bar .mb-text { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; direction: rtl; }
.music-bar .mb-marquee { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.music-bar.playing .mb-marquee { max-width: none; overflow: visible; padding-inline-start: 100%; animation: mb-scroll 14s linear infinite; }
@keyframes mb-scroll { from { transform: translateX(0); } to { transform: translateX(50%); } }
.music-bar .mb-dur { font-size: 12px; color: var(--text-3); }
.music-bar > svg.ic { width: 18px; height: 18px; color: var(--text-3); }
.music-bar .mb-prog { position: absolute; bottom: 0; inset-inline-start: 0; height: 2px; background: var(--accent); width: 0; transition: width .3s linear; }
.music-bar.add { color: var(--accent); } .music-bar.add .mb-text { color: var(--accent); }
.music-prev { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--glass-2); margin-bottom: 12px; position: relative; overflow: hidden; }
.music-prev .col { flex: 1; min-width: 0; } .music-prev .col b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .music-prev .col span { font-size: 12px; color: var(--text-3); }
.music-prev .mb-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; } .music-prev .mb-ic svg { width: 22px; height: 22px; }
.up-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: transparent; } .up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; } .up-bar.on { background: rgba(var(--accent-rgb), .2); }
.music-modal .lbl { display: block; font-size: 12.5px; color: var(--text-3); margin: 10px 0 4px; }
.music-modal .hint { margin-top: 12px; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

/* =====================================================================
   موبایل — پوسته‌ی تلگرام اندروید (نوار پایین: گفتگوها/مخاطبین/تنظیمات/پروفایل)
   ===================================================================== */
.m-tabbar, .m-page, .m-head { display: none; }
@media (max-width: 900px) {
  html.m-shell[data-theme="dark"] { --bg: #000000; --bg-2: #000000; --bg-3: #181818; --glass: #181818; --glass-2: #232323; --glass-3: #272727; --border: #0e0e0e; --border-2: #2a2a2a; --tg-search: #272727; --tg-hover: #232323; --tg-active: #2b313d; --tg-composer: #181818; --tg-badge: var(--accent); --tg-out-tick: var(--m-accent-soft); --tg-link: var(--m-accent-soft); --tg-name: var(--m-accent-soft); --bubble-in: #212121; }
  /* رنگ اصلی موبایل از انتخاب کاربر پیروی می‌کند (پیش‌فرض: آبی تلگرام اندروید) */
  html.m-shell { --m-accent-soft: #7aa2ff; }
  html.m-shell[data-theme="dark"][data-accent="blue"] { --accent: #517bf4; --accent-2: #517bf4; --accent-rgb: 81,123,244; --bubble-out: #2b5278; --tg-active: #2b313d; }
  html.m-shell[data-theme="dark"][data-accent="violet"] { --m-accent-soft: #b9adff; --tg-active: #332c52; }
  html.m-shell[data-theme="dark"][data-accent="emerald"] { --m-accent-soft: #8fe0b8; --tg-active: #244536; }
  html.m-shell[data-theme="dark"][data-accent="rose"] { --m-accent-soft: #ffa9bf; --tg-active: #4a2833; }
  html.m-shell[data-theme="dark"][data-accent="amber"] { --m-accent-soft: #ffd28a; --tg-active: #4a3a22; }
  html.m-shell[data-theme="light"] { --m-accent-soft: var(--accent); }

  html.m-shell .sidebar { background: var(--bg); padding-bottom: 0; }
  html.m-shell .sb-header { background: var(--bg); padding: 4px 12px 6px; min-height: 0; }
  html.m-shell .sb-header .btn-icon[aria-label="منو"] { display: none; }
  html.m-shell .sb-header .search-wrap .input { height: 42px; border-radius: 14px; background: var(--glass-3); font-size: 14.5px; }
  html.m-shell .m-head { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-top)) 10px 2px 8px; min-height: 52px; }
  html.m-shell .m-head-av { position: relative; width: 36px; height: 36px; display: grid; place-items: center; } html.m-shell .m-head-av .avatar.sm { width: 30px; height: 30px; font-size: 11px; } html.m-shell .m-head-av .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #4dcd5e; }
  html.m-shell .m-head .btn-icon { color: var(--text); }
  html.m-shell .m-head .m-head-title { flex: 1; font-size: 20px; font-weight: 600; padding-inline-start: 6px; }
  html.m-shell .folders { background: var(--glass); margin: 4px 12px 0; border-radius: 14px; border: 0; padding: 4px; gap: 2px; }
  html.m-shell .folders button { padding: 7px 12px; border-radius: 10px; font-size: 13.5px; color: var(--text-2); }
  html.m-shell .folders button.active { background: var(--tg-active); color: var(--m-accent-soft); }
  html.m-shell .folders button.active::after { display: none; }
  html.m-shell .folders .count { background: var(--glass-3); color: var(--text); }
  html.m-shell .folders button.active .count { background: rgba(var(--accent-rgb),.28); color: var(--m-accent-soft); }
  html.m-shell .stories-strip { padding: 6px 12px 2px; gap: 12px; }
  html.m-shell .story-item { width: 56px; } html.m-shell .story-item .avatar { width: 48px; height: 48px; font-size: 16px; } html.m-shell .story-item span { font-size: 11px; }
  html.m-shell .chat-list { padding: 2px 0 calc(76px + var(--safe-bottom)); }
  html.m-shell .chat-item { min-height: 70px; padding: 8px 12px; gap: 11px; }
  html.m-shell .chat-item .avatar { width: 54px; height: 54px; font-size: 19px; }
  html.m-shell .chat-item .title { font-size: 15.5px; font-weight: 600; }
  html.m-shell .chat-item .preview { font-size: 14px; }
  html.m-shell .chat-item .time { font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--glass-2); }
  html.m-shell .chat-item .badge { background: var(--tg-badge); }
  html.m-shell .fab { inset-inline-start: auto; inset-inline-end: auto; left: 16px; right: auto; bottom: calc(78px + var(--safe-bottom)); width: 54px; height: 54px; border-radius: 50%; background: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
  html.m-shell .fab svg { width: 23px; height: 23px; }
  html.m-shell .fab.m-fab { position: fixed; bottom: calc(78px + var(--safe-bottom)); }
  /* نوار پایین */
  html.m-shell .m-tabbar { position: absolute; bottom: calc(8px + var(--safe-bottom)); left: 10px; right: 10px; height: 58px; display: flex; align-items: center; justify-content: space-around; padding: 4px; border-radius: 29px; background: #232323; box-shadow: 0 4px 20px rgba(0,0,0,.45); z-index: 5; }
  html.m-shell .m-tab { flex: 1; height: 50px; border-radius: 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #cfcfcf; font-size: 11px; line-height: 1.2; transition: background .2s, color .2s; }
  html.m-shell .m-tab.active { background: var(--tg-active); color: var(--m-accent-soft); }
  html.m-shell .m-tab-ic { position: relative; width: 26px; height: 26px; display: grid; place-items: center; } html.m-shell .m-tab-ic svg { width: 23px; height: 23px; }
  html.m-shell .m-tab-ic .avatar.sm { width: 24px; height: 24px; font-size: 10px; } html.m-shell .m-tab.active .m-tab-ic .avatar { box-shadow: 0 0 0 2px var(--m-accent-soft); }
  html.m-shell .m-badge { position: absolute; top: -4px; inset-inline-start: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
  html.m-shell .m-tab-lbl { font-weight: 500; }
  /* صفحه‌ی برگه‌ها */
  html.m-shell .m-page { display: block; position: absolute; inset: 0; overflow-y: auto; background: var(--bg); z-index: 4; padding: 0 0 calc(84px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
  html.m-shell .m-page.hidden { display: none; }
  html.m-shell.m-tab-page .sb-header, html.m-shell.m-tab-page .m-head, html.m-shell.m-tab-page .story-cam, html.m-shell.m-tab-page .folders, html.m-shell.m-tab-page .stories-strip, html.m-shell.m-tab-page .chat-list, html.m-shell.m-tab-page .sidebar > .fab { visibility: hidden; }
  .m-top { display: flex; align-items: center; gap: 4px; padding: calc(6px + var(--safe-top)) 8px 4px; min-height: 54px; }
  .m-top h1 { flex: 1; font-size: 21px; font-weight: 600; padding-inline-start: 8px; }
  .m-top .grow { flex: 1; }
  .m-search { display: flex; align-items: center; gap: 10px; margin: 2px 12px 10px; padding: 0 14px; height: 42px; border-radius: 14px; background: var(--glass-3); }
  .m-search svg { width: 20px; height: 20px; color: var(--text-3); } .m-search .input { background: transparent; border: 0; height: 100%; padding: 0; flex: 1; font-size: 15px; }
  .m-card { margin: 0 12px 10px; border-radius: 16px; background: var(--glass); overflow: hidden; }
  .m-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px; text-align: start; min-height: 54px; }
  .m-row:active { background: var(--glass-2); }
  .m-row .m-ic { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex-shrink: 0; } .m-row .m-ic svg { width: 17px; height: 17px; }
  .m-row > b { font-size: 15px; font-weight: 500; }
  .m-row .col { flex: 1; min-width: 0; } .m-row .col b { display: block; font-size: 15px; font-weight: 500; } .m-row .col span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
  .m-sec { padding: 12px 14px 2px; font-size: 13px; color: var(--m-accent-soft); font-weight: 500; }
  .m-contact { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 14px; text-align: start; min-height: 64px; }
  .m-contact:active { background: var(--glass-2); }
  .m-contact .avatar { width: 50px; height: 50px; font-size: 18px; }
  .m-contact .col { flex: 1; min-width: 0; } .m-contact .col b { display: flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 500; } .m-contact .col span { display: block; font-size: 13px; color: var(--text-3); margin-top: 1px; } .m-contact .col span.online { color: var(--m-accent-soft); }
  .m-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 16px 12px; text-align: center; }
  .m-hero .avatar-wrap { position: relative; } .m-hero .avatar.xl { width: 100px; height: 100px; font-size: 36px; }
  .m-hero.big .avatar.xl { width: 110px; height: 110px; }
  .m-hero.colored { margin: 0 0 10px; padding: 14px 16px 18px; border-radius: 0 0 24px 24px; color: #fff; } .m-hero.colored h2, .m-hero.colored .sub, .m-hero.colored .sub.online { color: #fff; } .m-hero.colored .avatar { box-shadow: 0 8px 24px rgba(0,0,0,.25); }
  html.m-shell .m-page.profile.colored { background: linear-gradient(180deg, rgba(0,0,0,.18), transparent 120px), var(--bg); }
  html.m-shell .m-page.profile.colored > .m-top { position: relative; z-index: 1; margin-bottom: -54px; color: #fff; } html.m-shell .m-page.profile.colored > .m-top .btn-icon { color: #fff; }
  .m-hero.colored { padding-top: calc(52px + var(--safe-top)); }
  .m-hero .cam { position: absolute; bottom: 2px; inset-inline-start: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 3px solid var(--bg); } .m-hero .cam svg { width: 18px; height: 18px; }
  .m-hero h2 { font-size: 20px; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
  .m-hero .sub { font-size: 13.5px; color: var(--text-3); direction: ltr; } .m-hero .sub.online { color: var(--text-3); }
  .m-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 2px 12px 12px; }
  .m-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px 6px; border-radius: 14px; background: var(--glass); color: var(--text); font-size: 12.5px; }
  .m-act svg { width: 22px; height: 22px; } .m-act:active { background: var(--glass-2); }
  .m-info { display: block; width: 100%; padding: 10px 14px; text-align: start; }
  .m-info + .m-info { border-top: 1px solid var(--border-2); }
  .m-info b { display: block; font-size: 15px; font-weight: 400; } .m-info b.ltr { direction: ltr; text-align: right; } .m-info b.bio { white-space: pre-wrap; line-height: 1.6; }
  .m-info span { display: block; font-size: 13px; color: var(--text-3); margin-top: 2px; }
  .m-status { width: 42px; height: 42px; display: grid; place-items: center; } .m-status img.em { width: 30px; height: 30px; }
  .m-ptabs { display: flex; gap: 4px; margin: 2px 12px 8px; padding: 4px; border-radius: 14px; background: var(--glass); }
  .m-ptabs button { flex: 1; height: 36px; border-radius: 12px; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
  .m-ptabs button.active { background: var(--tg-active); color: var(--m-accent-soft); }
  .m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0 12px; border-radius: 16px; overflow: hidden; }
  .m-cell { position: relative; aspect-ratio: 9 / 13; background: var(--glass); overflow: hidden; }
  .m-cell img, .m-cell video { width: 100%; height: 100%; object-fit: cover; }
  .m-cell .txt { width: 100%; height: 100%; display: grid; place-items: center; padding: 10px; font-size: 12px; color: #fff; text-align: center; }
  .m-cell .views { position: absolute; bottom: 6px; inset-inline-start: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; } .m-cell .views svg { width: 12px; height: 12px; }
  .m-empty { grid-column: 1 / -1; padding: 36px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; line-height: 1.7; }
  .m-hint { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 6px 0 20px; }
  html.m-shell .music-bar { margin: 0 12px 12px; border-radius: 16px; background: var(--glass); padding: 10px 14px; }
  .qr-box { display: inline-grid; place-items: center; padding: 12px; border-radius: 16px; background: #fff; } .qr-fallback svg { width: 120px; height: 120px; color: #000; }
  /* مودال‌ها روی موبایل: تمام‌صفحه‌تر و با گوشه‌های تلگرامی */
  html.m-shell .modal { border-radius: 20px; }
  html.m-shell .sheet { background: var(--glass); border-radius: 22px 22px 0 0; }
}
@media (max-width: 900px) and (display-mode: standalone) { html.m-shell .m-tabbar { bottom: calc(12px + var(--safe-bottom)); } }

.ip-music { padding: 8px 12px 0; } .ip-music .music-bar { margin: 0; }
.modal .music-bar { margin: 10px 0 4px; }

/* Telegram Android shell — Day theme */
@media (max-width: 900px) {
  html.m-shell[data-theme="light"] .m-tabbar { background: #ffffff; box-shadow: 0 4px 24px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.05); }
  html.m-shell[data-theme="light"] .m-tab { color: #707579; }
  html.m-shell[data-theme="light"] .m-tab.active { background: #e7effd; color: #3390ec; }
  html.m-shell[data-theme="light"] .m-tab.active .m-tab-ic .avatar { box-shadow: 0 0 0 2px #3390ec; }
  html.m-shell[data-theme="light"] .m-sec { color: #3390ec; }
  /* v6.9.1: در تم روشن --tg-active همان رنگ اصلی است → متن پوشه‌ی فعال هم‌رنگ زمینه و ناپیدا می‌شد (گزارش اندروید) */
  html.m-shell[data-theme="light"] .folders button.active, html.m-shell[data-theme="light"] .m-ptabs button.active { background: rgba(var(--accent-rgb), .12); color: var(--accent); }
  html.m-shell[data-theme="light"] .folders button.active .count { background: var(--accent); color: #fff; }
  html.m-shell[data-theme="light"] .m-card, html.m-shell[data-theme="light"] .m-ptabs, html.m-shell[data-theme="light"] .m-acts button { background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
  html.m-shell[data-theme="light"] .m-page, html.m-shell[data-theme="light"] .sidebar { background: #f0f2f5; }
  html.m-shell[data-theme="light"] .m-search, html.m-shell[data-theme="light"] .sb-header .search-wrap .input { background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
}

/* =====================================================================
   v6.1 — رنگ پروفایل پریمیوم (مثل Telegram Premium)
   ===================================================================== */
.pc-section { padding: 6px 0 10px; } .pc-section .g-title { padding: 4px 4px 8px; }
.pc-preview { padding: 14px; border-radius: 14px; background: var(--chat-bg, var(--bg)); background-image: var(--wp-pattern, none); margin-bottom: 10px; }
.pc-preview-bubble { position: relative; max-width: 86%; background: var(--bubble-in); border-radius: 12px; padding: 6px 10px 18px; box-shadow: var(--shadow-sm); font-size: 14px; }
.pc-preview-bubble .sender-name { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; color: var(--tg-name); transition: color .2s; }
.pc-preview-bubble .time { position: absolute; bottom: 4px; inset-inline-start: 8px; font-size: 11px; color: var(--text-3); }
.pc-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px 16px; border-radius: 14px; background: var(--glass-2); margin-bottom: 10px; transition: background .25s; }
.pc-hero b { font-size: 17px; margin-top: 6px; } .pc-hero span { font-size: 12.5px; color: var(--text-3); }
.pc-hero.colored, .pc-hero.colored span { color: #fff; } .pc-hero.colored .avatar { box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.pc-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 10px; padding: 2px 2px 8px; }
.pc-sw { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--c, var(--glass-3)); transition: transform .2s var(--spring), box-shadow .2s; box-shadow: inset 0 0 0 0 var(--bg-3); }
.pc-sw.grad { background: linear-gradient(135deg, var(--c) 0%, var(--c) 50%, var(--c2) 50%, var(--c2) 100%); }
.pc-sw.on { box-shadow: 0 0 0 2px var(--bg-3), 0 0 0 4px var(--c, var(--accent)); transform: scale(.94); }
.pc-sw.none { display: grid; place-items: center; color: var(--text-2); background: var(--glass-3); } .pc-sw.none svg { width: 18px; height: 18px; } .pc-sw.none.on { box-shadow: 0 0 0 2px var(--bg-3), 0 0 0 4px var(--accent); }
.pc-sw:active { transform: scale(.88); }
.pc-modal .hint { font-size: 12.5px; padding: 0 4px 6px; }
/* هدرهای رنگی */
.ip-hero.colored, .settings-hero.colored { color: #fff; }
.ip-hero.colored h2, .ip-hero.colored .st, .m-hero.colored h2, .settings-hero.colored h2, .settings-hero.colored > span { color: #fff !important; }
.ip-hero.colored .avatar, .settings-hero.colored .avatar { box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.ip-hero.colored .verified-badge, .settings-hero.colored .verified-badge { filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }

/* =====================================================================
   v6.1 — ریسپانسیو: آیفون (safe-area، ارتفاع ویوپورت)، تبلت، دسکتاپ باریک
   ===================================================================== */
@supports (padding: max(0px)) {
  .chat-header { padding-top: max(var(--safe-top), 0px); }
  .composer { padding-bottom: max(var(--safe-bottom), 6px); }
}
@media (max-width: 900px) {
  html, body { overscroll-behavior: none; }
  .modal-root { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; max-height: calc(100vh - 12px);  max-height: calc(100dvh - 12px); border-radius: 20px 20px 0 0; animation: slide-up .3s var(--ease); }
  .modal.settings-modal, .modal.prem-modal, .modal.pc-modal { height: calc(100vh - 12px);  height: calc(100dvh - 12px); max-height: calc(100vh - 12px);  max-height: calc(100dvh - 12px); }
  .modal .modal-head, .modal-title { padding-top: 6px; }
  .ip-hero { padding-top: calc(14px + var(--safe-top)); }
  .lightbox .lb-head { padding-top: calc(8px + var(--safe-top)); }
  .story-stage { height: 100vh; height: 100dvh; }
  .send-modal { max-height: calc(100vh - 12px);  max-height: calc(100dvh - 12px); }
  .send-grid[data-n="1"] .send-cell { max-height: 46vh;  max-height: 46dvh; }
}
@media (max-width: 420px) {
  html { --fs: 14.5px; }
  .chat-header .title { font-size: 15px; } .chat-header .sub { font-size: 12px; }
  .bubble { font-size: var(--fs); }
  .m-acts { gap: 6px; } .m-act { font-size: 12px; padding: 10px 4px; }
  .ip-actions button { font-size: 11.5px; }
}
@media (max-width: 360px) {
  html.m-shell .m-tab { font-size: 10px; } html.m-shell .m-tab-ic svg { width: 21px; height: 21px; }
  .folders button { padding: 6px 9px; font-size: 12.5px; }
  html.m-shell .chat-item .avatar { width: 50px; height: 50px; }
}
/* لپ‌تاپ‌های کوچک / پنجره‌ی باریک دسکتاپ */
@media (min-width: 901px) and (max-width: 1100px) {
  :root { --sidebar-w: 300px; --info-w: 300px; }
  .msg { max-width: min(80%, 560px); }
  .chat-item .avatar { width: 48px; height: 48px; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .modal.settings-modal { height: calc(100vh - 24px);  height: calc(100dvh - 24px); }
  .stories-strip { padding-block: 4px; } .story-item .avatar { width: 46px; height: 46px; }
}
/* لندسکیپ موبایل */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  html.m-shell .m-tabbar { height: 48px; bottom: 6px; } html.m-shell .m-tab { height: 42px; flex-direction: row; gap: 6px; } html.m-shell .m-tab-lbl { display: none; }
  html.m-shell .stories-strip, html.m-shell .m-head { display: none; }
  .emoji-picker { height: 70vh;  height: 70dvh; }
}

/* ---- لمس طولانی روی پیام: بدون انتخاب متن/منوی سیستم (مثل تلگرام) ---- */
@media (hover: none) and (pointer: coarse) {
  .messages .msg, .messages .msg .bubble, .messages .msg .text { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .messages .msg .text a { -webkit-touch-callout: none; }
  .ctx-sheet { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
}

/* =============================================================================
   Motion system — انیمیشن‌های نرم، سبک و یکدست برای جابه‌جایی بین منوها/صفحات/دکمه‌ها
   فقط transform و opacity (بدون layout) → روی موبایل ضعیف هم ۶۰fps
   ============================================================================= */
:root { --mo-fast: .14s; --mo: .22s; --mo-slow: .3s; --mo-ease: cubic-bezier(.25,.1,.25,1); --mo-out: cubic-bezier(.05,.7,.1,1); --mo-in: cubic-bezier(.3,0,.8,.15); }

/* دکمه‌ها و ردیف‌های قابل کلیک: فشار نرم */
.btn, .btn-icon, .menu-item, .set-row.clickable, .chat-item, .m-tab, .m-row, .m-contact, .chip, .tabs-line button, .accent-row button, .pc-sw, .m-acts button, .fab, .quick button, .react-row button, .emoji-picker .tabs button {
  transition: background-color var(--mo) var(--mo-ease), color var(--mo) var(--mo-ease), opacity var(--mo) var(--mo-ease), transform var(--mo-fast) var(--mo-ease), box-shadow var(--mo) var(--mo-ease), border-color var(--mo) var(--mo-ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .menu-item:active, .set-row.clickable:active, .m-row:active, .m-contact:active, .chip:active, .m-acts button:active { transform: scale(.985); }
.btn-icon:active, .m-tab:active, .fab:active, .accent-row button:active, .pc-sw:active { transform: scale(.9); }
.chat-item:active { transform: none; background: var(--tg-hover, var(--glass-2)); }
.switch, .switch::after, .switch i { transition: background-color var(--mo-slow) var(--mo-ease), transform var(--mo-slow) var(--mo-out), border-color var(--mo-slow) var(--mo-ease); }

/* لایه‌ها (مودال، شیت، منو): ورود/خروج نرم */
.modal-root .scrim, .sheet-root .scrim, .drawer .scrim { animation: fade var(--mo) var(--mo-ease) both; }
.modal { animation: mo-pop var(--mo-slow) var(--mo-out) both; }
.sheet { animation: mo-up var(--mo-slow) var(--mo-out) both; }
.ctx-menu { animation: mo-menu var(--mo) var(--mo-out) both; }
.ctx-sheet { animation: mo-up var(--mo-slow) var(--mo-out) both; }
.ctx-sheet.out { animation: mo-down var(--mo-fast) var(--mo-in) forwards; }
.modal-root.out .scrim, .sheet-root.out .scrim, .modal-root.out .ctx-menu { animation: mo-fade-out var(--mo-fast) var(--mo-in) forwards; }
.modal-root.out .modal { animation: mo-pop-out var(--mo-fast) var(--mo-in) forwards; }
.sheet-root.out .sheet { animation: mo-down var(--mo-fast) var(--mo-in) forwards; }
.drawer .panel { animation: slide-in-r var(--mo-slow) var(--mo-out) both; }
.toast { animation-timing-function: var(--mo-out); }
@keyframes mo-pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mo-pop-out { to { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes mo-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes mo-down { to { opacity: 0; transform: translateY(18px); } }
@keyframes mo-menu { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes mo-fade-out { to { opacity: 0; } }

/* صفحات تنظیمات (پشته‌ای) و برگه‌های نوار پایین موبایل */
.sp-page.slide-in { animation: mo-sp-in var(--mo) var(--mo-out) both; } .sp-page.slide-back { animation: mo-sp-back var(--mo) var(--mo-out) both; }
@keyframes mo-sp-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes mo-sp-back { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
html.m-shell .m-page.mo-enter { animation: mo-tab var(--mo) var(--mo-out) both; }
html.m-shell .sidebar.mo-enter > .chat-list, html.m-shell .sidebar.mo-enter > .stories-strip, html.m-shell .sidebar.mo-enter > .folders { animation: mo-tab var(--mo) var(--mo-out) both; }
@keyframes mo-tab { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html.m-shell .m-tab .m-tab-ic { transition: transform var(--mo) var(--mo-out); }
html.m-shell .m-tab.active .m-tab-ic { transform: translateY(-1px); }

/* پنل اطلاعات، باز/بسته شدن گفتگو روی موبایل */
.info-panel { transition-timing-function: var(--mo-out); }
@media (max-width: 900px) { .main, .sidebar { transition-duration: var(--mo-slow); transition-timing-function: var(--mo-out); } }

/* تب‌های فهرست (همه/شخصی/گروه‌ها…): زیرخط سُرنده */
.tabs-line button::after { transition: transform var(--mo) var(--mo-out), opacity var(--mo) var(--mo-ease), background-color var(--mo) var(--mo-ease); }

/* هایلایت پیام هدف، پین بار، کانتکست کامپوزر */
.pinned-bar { animation-duration: var(--mo); animation-timing-function: var(--mo-out); }
.composer-ctx { animation: mo-tab var(--mo) var(--mo-out) both; }

/* احترام به تنظیم کاربر/سیستم */
@media (prefers-reduced-motion: reduce) { :root { --mo-fast: .01ms; --mo: .01ms; --mo-slow: .01ms; } }

/* ---- حالت آفلاین / صف ارسال ---- */
html.m-shell .outbox-hint { bottom: calc(108px + var(--safe-bottom)); }
.msg.queued .bubble .meta .ticks { color: var(--text-3); }
.msg.queued .bubble { opacity: .82; }
.msg.failed .bubble { box-shadow: 0 0 0 1px var(--danger, #e5484d) inset; }
.outbox-hint { position: fixed; bottom: calc(76px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: var(--bg-3); color: var(--text); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 13px; animation: mo-up var(--mo-slow) var(--mo-out) both; }
.outbox-hint svg { width: 18px; height: 18px; color: var(--text-2); }
html.m-shell .outbox-hint { bottom: calc(70px + var(--safe-bottom)); }
html.is-offline .composer .btn-icon.attach, html.is-offline .composer .btn-icon.mic { opacity: .5; }

/* ایموجی اپل: بدون حاشیه‌ی اضافه، رندر نرم */
img.em { image-rendering: -webkit-optimize-contrast; image-rendering: auto; }
.msg .meta .views.bump { animation: views-bump .4s var(--mo-out); } @keyframes views-bump { 30% { transform: scale(1.25); } }

/* ---- نوار قالب‌بندی متن روی موبایل: شناور، فشرده، قابل اسکرول افقی ---- */
@media (hover: none) and (pointer: coarse), (max-width: 900px) {
  .fmt-bar { margin: 0 6px 6px; padding: 4px; border-radius: 14px; gap: 0; background: var(--bg-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .fmt-bar .fmt-btn { min-width: 40px; height: 38px; font-size: 15px; border-radius: 10px; }
  .fmt-bar .fmt-btn:active { background: var(--tg-hover, var(--glass-3)); }
  .fmt-bar .grow { display: none; }
  .fmt-bar.float { animation: mo-up var(--mo) var(--mo-out) both; }
  .fmt-bar.float .fmt-btn[title="بستن"] { display: none; }
}
@media (max-width: 360px) { .fmt-bar .fmt-btn { min-width: 36px; } }

/* ===== v6.3: قابلیت‌های جدید ===== */
.search-filters { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--tg-border, var(--border)); }
.search-filters::-webkit-scrollbar { display: none; }
.search-filters .chip { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--glass-2, rgba(128,128,128,.12)); color: var(--text-2); font-size: 13px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.search-filters .chip.on { background: rgba(var(--accent-rgb), .16); color: var(--accent); border-color: rgba(var(--accent-rgb), .4); }
.search-filters .chip svg { width: 15px; height: 15px; }
.search-msg .snippet { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-msg .row { display: flex; justify-content: space-between; gap: 8px; }
.search-msg mark { background: rgba(var(--accent-rgb), .25); color: inherit; border-radius: 3px; padding: 0 1px; }
/* نقل‌قول بخشی از پیام */
.bubble .quote .q-text.q-quote { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-style: normal; }
.bubble .quote .q-text.q-quote::before { content: '❝'; opacity: .6; margin-inline-end: 3px; font-size: 12px; }
/* پیش‌نمایش لینک */
.bubble .link-preview { display: flex; gap: 10px; margin-top: 6px; padding: 6px 8px 6px 10px; border-inline-start: 2px solid var(--tg-link); background: var(--tg-quote-bg); border-radius: 6px; text-decoration: none; color: inherit; max-width: 100%; overflow: hidden; }
.msg.out .bubble .link-preview { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.9); }
.bubble .link-preview.hidden { display: none; }
.bubble .link-preview .lp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bubble .link-preview .lp-site { color: var(--tg-link); font-size: 13px; font-weight: 600; }
.msg.out .bubble .link-preview .lp-site { color: #fff; }
.bubble .link-preview .lp-title { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bubble .link-preview .lp-desc { font-size: 13px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.msg.out .bubble .link-preview .lp-desc { color: rgba(255,255,255,.85); }
.bubble .link-preview .lp-img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
/* آزمون */
.poll.quiz .poll-opt.correct { --pc: #4dcd5e; }
.poll.quiz .poll-opt.correct .poll-check { background: #4dcd5e; border-color: #4dcd5e; color: #fff; }
.poll.quiz .poll-opt.correct .poll-bar { background: #4dcd5e; opacity: .35; }
.poll.quiz .poll-opt.wrong .poll-check { background: #e5484d; border-color: #e5484d; color: #fff; }
.poll.quiz .poll-opt.wrong .poll-bar { background: #e5484d; opacity: .3; }
.poll .poll-meta { display: flex; align-items: center; gap: 6px; }
.poll .quiz-hint { display: inline-flex; color: var(--tg-link); cursor: pointer; }
.poll .quiz-hint svg { width: 15px; height: 15px; }
.msg.out .poll .quiz-hint { color: #fff; }
.poll-opt-row { display: flex; gap: 6px; align-items: center; }
.poll-opt-row .quiz-radio { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex: none; color: transparent; cursor: pointer; }
.poll-opt-row .quiz-radio.on { background: #4dcd5e; border-color: #4dcd5e; color: #fff; }
.poll-opt-row .quiz-radio svg { width: 14px; height: 14px; }
.poll-opt-row.correct .input { border-color: #4dcd5e; }
/* هدایت: گزینه‌ها */
.fwd-opts { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 6px; }
.fwd-opts .opt-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
/* جزئیات پیام: تاریخچه‌ی ویرایش */
.edit-hist { padding: 8px 10px; border-inline-start: 2px solid var(--border); margin: 6px 0; font-size: 14px; }
.edit-hist small { display: block; color: var(--text-2); margin-bottom: 2px; }
.kv.clickable { cursor: pointer; } .kv.clickable b { color: var(--accent); }
/* واکنش‌گرها */
.user-row .react-big { margin-inline-start: auto; font-size: 20px; }
.user-row .react-big img.em { width: 24px; height: 24px; }
/* یادداشت مخاطب */
.note-row.empty .note-val { color: var(--accent); font-weight: 500; }
.note-row .note-val { white-space: pre-wrap; }
/* نشان خوانده‌نشده‌ی دستی */
.chat-item .badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; border-radius: 50%; }
.audio-player .rate { flex: none; align-self: center; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(128,128,128,.18); color: var(--text-2); cursor: pointer; margin-inline-start: 6px; }
.audio-player .rate.on { background: var(--accent); color: #fff; }
.msg.out .audio-player .rate { background: rgba(255,255,255,.2); color: #fff; }

/* ===== رسانه با کپشن: حباب دقیقاً هم‌عرض رسانه (مثل تلگرام) ===== */
.bubble.has-media { width: fit-content; width: -moz-fit-content; max-width: 100%; }
.bubble.has-media > .media-img, .bubble.has-media > .album-grid { max-width: 100%; }
.bubble.has-media > .media-img img, .bubble.has-media > .media-img video { display: block; width: 100%; height: 100%; }
.bubble.has-media > .text, .bubble.has-media > .reactions, .bubble.has-media > .link-preview, .bubble.has-media > .quote, .bubble.has-media > .fwd, .bubble.has-media > .sender-name { width: 0; min-width: 100%; box-sizing: border-box; }
.bubble.has-media > .sender-name, .bubble.has-media > .fwd, .bubble.has-media > .quote { min-width: calc(100% - 16px); }
.bubble.has-media > .quote { width: auto; }

/* ===== آلبوم دریافتی/ارسالی در حباب پیام — گرید مشترک برای چند عکس/ویدیو (مثل تلگرام) ===== */
.album-grid { display: grid; gap: 2px; border-radius: 12px; overflow: hidden; width: 320px; max-width: 100%; grid-template-columns: repeat(6, 1fr); --album-scale: 1; }
.album-cell { position: relative; overflow: hidden; cursor: pointer; background: var(--glass-2); height: calc(var(--h, 120px) * var(--album-scale)); min-height: 60px; }
.album-cell.tall { height: auto; align-self: stretch; }
.album-cell img, .album-cell video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.album-cell .media-ph { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px); transform: scale(1.12); z-index: 0; }
.album-cell.has-ph > img:not(.media-ph), .album-cell.has-ph > video { z-index: 1; opacity: 0; transition: opacity .28s ease; }
.album-cell.has-ph.loaded > img:not(.media-ph), .album-cell.has-ph.loaded > video { opacity: 1; }
.album-cell.has-ph.loaded .media-ph { opacity: 0; transition: opacity .4s .2s; }
.album-cell:not(.has-ph):not(.loaded) { background: linear-gradient(110deg, var(--glass-2) 30%, var(--glass-3) 50%, var(--glass-2) 70%); background-size: 200% 100%; animation: rg-shimmer 1.4s linear infinite; }
.album-cell .play { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: grid; place-items: center; z-index: 2; pointer-events: none; }
.album-cell .play span { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; }
.album-cell .play svg { width: 22px; height: 22px; }
.album-cell .dur { position: absolute; z-index: 2; bottom: 6px; inset-inline-start: 6px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; }
.album-cell.spoiler-media img, .album-cell.spoiler-media video { filter: blur(24px) saturate(1.4); transform: scale(1.12); }
.album-cell.spoiler-media.revealed img, .album-cell.spoiler-media.revealed video { filter: none; transform: none; }
.album-cell .spoiler-cover { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: grid; place-items: center; background: rgba(0,0,0,.2); z-index: 3; }
.album-cell .spoiler-cover span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; }
.album-cell.spoiler-media.revealed .spoiler-cover { display: none; }
.album-cell .upload-progress { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); z-index: 3; }
.album-cell .upload-progress .ring { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: rg-spin .8s linear infinite; }
@media (max-width: 480px) { .album-grid { width: 284px; --album-scale: .9; } }

/* =====================================================================
   v6.4 — صفحه‌ی ورود / ثبت‌نام (Telegram-style، دو ستونه، مدرن)
   ===================================================================== */
.au-page { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); place-items: stretch; padding: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); position: relative; overflow: hidden; }
[data-theme="dark"] .au-page { background: #0e1621; }
.au-theme { position: fixed; top: 14px; inset-inline-start: 14px; z-index: 5; background: var(--bg-3); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
/* ---- hero ---- */
.au-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 48px; color: #fff;
  background: linear-gradient(160deg, #1d4ed8 0%, #2b8cee 45%, #37b5ff 100%); }
[data-accent="purple"] .au-hero { background: linear-gradient(160deg, #5b21b6, #7c3aed 45%, #a78bfa); }
[data-accent="green"] .au-hero, [data-accent="emerald"] .au-hero { background: linear-gradient(160deg, #047857, #10b981 45%, #6ee7b7); }
[data-accent="orange"] .au-hero, [data-accent="amber"] .au-hero { background: linear-gradient(160deg, #b45309, #f59e0b 45%, #fcd34d); }
[data-accent="pink"] .au-hero, [data-accent="rose"] .au-hero { background: linear-gradient(160deg, #9d174d, #ec4899 45%, #f9a8d4); }
[data-accent="red"] .au-hero { background: linear-gradient(160deg, #991b1b, #ef4444 45%, #fca5a5); }
.au-hero::before { content: ''; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120' fill='none' stroke='%23ffffff' stroke-opacity='0.16' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M20 30l6-6M60 20a6 6 0 1 0 0-12 6 6 0 0 0 0 12zM95 40l-4 8 8-4zM30 90h14M37 83v14M85 95a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM100 75l8 8M108 75l-8 8M15 60c4-4 8 4 12 0'/%3E%3C/svg%3E"); background-size: 180px; opacity: .9; animation: au-drift 60s linear infinite; }
@keyframes au-drift { to { background-position: 360px 360px; } }
.au-orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; pointer-events: none; animation: au-float 14s ease-in-out infinite; }
.au-orb.a { width: 420px; height: 420px; background: #fff; opacity: .16; top: -140px; inset-inline-end: -120px; }
.au-orb.b { width: 320px; height: 320px; background: #7dd3fc; bottom: -100px; inset-inline-start: -80px; animation-delay: -5s; }
.au-orb.c { width: 220px; height: 220px; background: #a5b4fc; top: 45%; inset-inline-start: 40%; opacity: .35; animation-delay: -9s; }
@keyframes au-float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-26px) } }
.au-hero-inner { position: relative; z-index: 1; width: min(460px, 100%); display: flex; flex-direction: column; gap: 32px; }
.au-brand { display: flex; align-items: center; gap: 14px; }
.au-brand b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.au-brand small { display: block; opacity: .85; font-size: 13.5px; margin-top: 2px; }
.au-mark { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,.18); flex: none; }
.au-mark svg, .au-plane svg { width: 32px; height: 32px; color: #fff; transform: translateX(-2px) rotate(-8deg); }
.au-plane { animation: au-plane 3.6s ease-in-out infinite; display: grid; place-items: center; }
@keyframes au-plane { 0%, 100% { transform: translate(0, 0) } 30% { transform: translate(3px, -4px) rotate(4deg) } 60% { transform: translate(-2px, 2px) } }
/* پیش‌نمایش گفتگو */
.au-bubbles { display: flex; flex-direction: column; gap: 8px; }
.au-bub { position: relative; max-width: 78%; padding: 8px 12px 7px; border-radius: 14px; font-size: 14px; line-height: 1.5; box-shadow: 0 2px 8px rgba(0,0,0,.12); opacity: 0; animation: au-pop .5s var(--ease, ease) forwards; }
.au-bub.in { align-self: flex-start; background: #fff; color: #111; border-end-start-radius: 4px; }
.au-bub.out { align-self: flex-end; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.3); color: #fff; border-end-end-radius: 4px; backdrop-filter: blur(6px); }
.au-bub i { display: block; font-style: normal; font-size: 10.5px; opacity: .65; text-align: left; direction: ltr; margin-top: 2px; }
.au-bub i svg { width: 13px; height: 13px; vertical-align: -3px; }
.au-bub:nth-child(1) { animation-delay: .2s } .au-bub:nth-child(2) { animation-delay: .9s } .au-bub:nth-child(3) { animation-delay: 1.7s } .au-bub:nth-child(4) { animation-delay: 2.5s }
.au-bub.typing { align-self: flex-start; background: #fff; display: flex; gap: 4px; padding: 12px 14px; border-end-start-radius: 4px; }
.au-bub.typing b { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: au-dot 1.2s infinite; }
.au-bub.typing b:nth-child(2) { animation-delay: .2s } .au-bub.typing b:nth-child(3) { animation-delay: .4s }
@keyframes au-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5 } 30% { transform: translateY(-4px); opacity: 1 } }
@keyframes au-pop { from { opacity: 0; transform: translateY(10px) scale(.96) } to { opacity: 1; transform: none } }
.au-feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.au-feats li { display: flex; gap: 10px; align-items: flex-start; }
.au-feats .fi { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; flex: none; }
.au-feats .fi svg { width: 18px; height: 18px; color: #fff; }
.au-feats b { display: block; font-size: 14px; }
.au-feats small { display: block; font-size: 12px; opacity: .8; line-height: 1.5; margin-top: 1px; }
/* ---- panel ---- */
.au-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; overflow-y: auto; }
.au-card { width: min(420px, 100%); animation: au-in .4s var(--ease, ease); }
.au-card.slide-l { animation-name: au-in-l } .au-card.slide-r { animation-name: au-in-r }
@keyframes au-in { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes au-in-l { from { opacity: 0; transform: translateX(-24px) } to { opacity: 1; transform: none } }
@keyframes au-in-r { from { opacity: 0; transform: translateX(24px) } to { opacity: 1; transform: none } }
.au-card.shake { animation: au-shake .4s; }
@keyframes au-shake { 20%, 60% { transform: translateX(-6px) } 40%, 80% { transform: translateX(6px) } }
.au-card.done { animation: au-done .3s forwards; }
@keyframes au-done { to { opacity: 0; transform: scale(.98) translateY(-6px) } }
.au-head { text-align: center; margin-bottom: 26px; }
.au-head .au-mark.sm { width: 84px; height: 84px; margin: 0 auto 16px; background: var(--accent); border: none; box-shadow: 0 12px 30px rgba(var(--accent-rgb), .35); }
.au-head .au-mark.sm svg { width: 42px; height: 42px; }
.au-head h1 { font-size: 24px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.2px; }
.au-head p { color: var(--text-2); font-size: 14px; margin: 0; line-height: 1.6; }
.au-form { display: flex; flex-direction: column; gap: 14px; }
.au-field { display: block; }
.au-lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 0 4px 6px; }
.au-inp { position: relative; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; border-radius: 12px; background: var(--bg-2); border: 1.5px solid var(--border); transition: border-color .18s, box-shadow .18s, background .18s; }
[data-theme="dark"] .au-inp { background: #242f3d; border-color: #2b3a4a; }
.au-inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); background: var(--bg-3); }
.au-inp > svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.au-inp:focus-within > svg, .au-inp:focus-within .au-at { color: var(--accent); }
.au-inp .input { flex: 1; min-width: 0; height: 100%; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; font-size: 15.5px; border-radius: 0; }
.au-inp.ltr { direction: ltr; } .au-inp.ltr .input { text-align: left; }
.au-at { font-weight: 700; color: var(--text-3); font-size: 17px; width: 20px; text-align: center; }
.au-eye { display: inline-flex; color: var(--text-3); padding: 6px; border-radius: 8px; flex: none; } .au-eye:hover { color: var(--text); background: var(--glass-2); } .au-eye svg { width: 19px; height: 19px; }
.au-state { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.au-state svg { width: 14px; height: 14px; } .au-state.ok { background: #22c55e; color: #fff; } .au-state.bad { background: #ef4444; color: #fff; }
.au-state .spinner.sm { width: 16px; height: 16px; border-width: 2px; }
.au-hint { display: block; color: var(--text-3); font-size: 12px; margin: 6px 4px 0; }
.au-caps { display: flex; align-items: center; gap: 6px; margin: 6px 4px 0; font-size: 12px; color: #d97706; } .au-caps svg { width: 14px; height: 14px; }
.au-meter-row { display: flex; align-items: center; gap: 10px; margin: 8px 4px 0; }
.au-meter { display: flex; gap: 4px; flex: 1; } .au-meter i { flex: 1; height: 4px; border-radius: 4px; background: var(--border-2); transition: background .25s; }
.au-meter[data-s="1"] i:nth-child(-n+1) { background: #ef4444 } .au-meter[data-s="2"] i:nth-child(-n+2) { background: #f59e0b } .au-meter[data-s="3"] i:nth-child(-n+3) { background: #84cc16 } .au-meter[data-s="4"] i { background: #22c55e }
.au-meter-lbl { font-size: 12px; color: var(--text-2); min-width: 36px; text-align: left; }
.au-err { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(239,68,68,.1); color: #ef4444; font-size: 13.5px; border: 1px solid rgba(239,68,68,.25); animation: au-in .25s; }
.au-submit { height: 52px; border-radius: 12px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; position: relative; overflow: hidden; box-shadow: 0 8px 22px rgba(var(--accent-rgb), .3); transition: transform .15s, box-shadow .15s; }
.au-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(var(--accent-rgb), .38); }
.au-submit:active:not(:disabled) { transform: translateY(0); }
.au-submit svg { width: 20px; height: 20px; transition: transform .2s; } .au-submit:hover svg { transform: translateX(-3px); }
.au-submit.busy .lbl, .au-submit.busy svg { visibility: hidden; }
.au-submit.busy::after { content: ''; position: absolute; width: 22px; height: 22px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.au-switch { text-align: center; margin-top: 20px; color: var(--text-2); font-size: 14px; display: flex; justify-content: center; gap: 6px; align-items: center; }
.au-switch button { color: var(--accent); font-weight: 700; } .au-switch button:hover { text-decoration: underline; }
.au-switch.muted svg { width: 15px; height: 15px; }
.au-foot { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 28px; font-size: 12px; color: var(--text-3); }
.au-foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); } .au-foot a { color: var(--text-3); } .au-foot a:hover { color: var(--accent); }
.au-page .auth-announce { margin-top: 16px; }
@media (max-width: 1100px) { .au-hero { padding: 36px; } .au-feats { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .au-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow: auto; }
  .au-hero { padding: calc(20px + var(--safe-top)) 22px 26px; min-height: 0; border-radius: 0 0 28px 28px; }
  .au-hero-inner { gap: 18px; }
  .au-brand b { font-size: 21px; } .au-mark { width: 50px; height: 50px; } .au-mark svg { width: 26px; height: 26px; }
  .au-bubbles { display: none; } .au-feats { display: none; }
  .au-panel { padding: 22px 18px calc(28px + var(--safe-bottom)); align-items: flex-start; }
  .au-head .au-mark.sm { display: none; } .au-head { margin-bottom: 18px; text-align: right; } .au-head h1 { font-size: 22px; }
  .au-theme { top: calc(10px + var(--safe-top)); inset-inline-start: auto; inset-inline-end: 12px; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff; }
}
@media (max-width: 860px) and (min-height: 700px) { .au-bubbles { display: flex; } .au-bub:nth-child(n+3) { display: none; } }
@media (prefers-reduced-motion: reduce) { .au-hero::before, .au-orb, .au-plane, .au-bub { animation: none !important; opacity: 1; } }

/* ---- ایموجی اپل داخل کادر نوشتن/ورودی‌ها/تکست‌اریاها (جایی که تصویر ایموجی نمی‌نشیند) ---- */
.composer textarea, textarea, input, .input, .textarea, [contenteditable] { font-family: 'Vazirmatn', 'RG Apple Emoji', system-ui, sans-serif; }
.emoji-picker .grid button, .react-grid button, .reaction-bar button, .em-text { font-family: var(--font-emoji); }

/* =====================================================================
   نسخه ۶٫۵ — پرداخت، صفحات، تبلیغات، بوست، ظاهر کانال
   ===================================================================== */
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: rgba(var(--accent-rgb), .08); }
.btn.danger { color: var(--danger); }
.gr-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.gr-chip.ok { background: rgba(16,185,129,.15); color: #10b981; }
.gr-chip.wait { background: rgba(245,158,11,.16); color: #d97706; }
.gr-chip.bad { background: rgba(239,68,68,.14); color: #ef4444; }
.gr-chip.muted { background: var(--glass-2); color: var(--text-3); }
[data-theme="dark"] .gr-chip.wait { color: #fbbf24; }
.col.end { align-items: flex-end; gap: 6px; }

/* --- پرداخت --- */
.pay-steps { display: flex; gap: 6px; padding: 14px 16px 4px; }
.pay-step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--glass-2); font-size: 12.5px; color: var(--text-3); }
.pay-step b { width: 22px; height: 22px; border-radius: 50%; background: var(--border-2); color: var(--text); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.pay-step.on { color: var(--text); } .pay-step.on b { background: var(--accent); color: #fff; }
.pay-page .prem-plans { padding: 6px 16px 12px; }
.pay-card { margin: 8px 16px 0; padding: 16px 18px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #38bdf8); box-shadow: 0 10px 30px rgba(37,99,235,.28); position: relative; overflow: hidden; }
.pay-card::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); top: -120px; left: -60px; }
.pay-card-top { display: flex; align-items: center; gap: 8px; font-size: 13px; opacity: .9; } .pay-card-top svg { width: 22px; height: 22px; }
.pay-card-no { font-size: 22px; letter-spacing: 1px; margin: 16px 0 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.pay-card-bot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; gap: 8px; flex-wrap: wrap; }
.pay-card-bot .btn { background: rgba(255,255,255,.18); color: #fff; border: 0; }
.pay-iban { margin-top: 8px; font-size: 12px; opacity: .85; text-align: center; }
.pay-amount { display: flex; align-items: center; gap: 10px; margin: 10px 16px 6px; padding: 10px 14px; border-radius: 14px; background: var(--glass-2); }
.pay-amount span { color: var(--text-3); font-size: 13px; flex: 1; } .pay-amount b { font-size: 16px; }
.pay-form { display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 14px; }
.pay-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; border: 2px dashed var(--border-2); border-radius: 16px; background: var(--glass); color: var(--text-2); font: inherit; cursor: pointer; overflow: hidden; padding: 12px; transition: border-color .2s, background .2s; }
.pay-drop:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .05); }
.pay-drop svg { width: 34px; height: 34px; color: var(--accent); }
.pay-drop img { max-height: 200px; max-width: 100%; border-radius: 10px; object-fit: contain; }
.pay-drop.has { border-style: solid; border-color: var(--accent); }
.pay-list { display: flex; flex-direction: column; gap: 6px; }
.pay-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--glass); }
.pay-item .col { flex: 1; min-width: 0; } .pay-item .col b { display: block; font-size: 14px; } .pay-item .col span { display: block; font-size: 12px; color: var(--text-3); }
.pay-item .pay-note { color: var(--text-2); margin-top: 2px; }
.pay-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex-shrink: 0; cursor: zoom-in; background: var(--glass-2); }
.pay-thumb.ic { display: grid; place-items: center; cursor: default; } .pay-thumb.ic svg { width: 24px; height: 24px; color: var(--text-3); }
.pay-c2c { margin-top: 10px; height: 46px; border-radius: 16px; }

/* --- صفحات متنی --- */
.page-doc { padding: 6px 18px 12px; line-height: 1.9; font-size: 14.5px; color: var(--text); }
.page-doc h1, .page-doc h2, .page-doc h3 { margin: 18px 0 8px; line-height: 1.5; } .page-doc h1 { font-size: 20px; } .page-doc h2 { font-size: 17px; } .page-doc h3 { font-size: 15px; }
.page-doc p { margin: 0 0 10px; } .page-doc ul, .page-doc ol { margin: 0 0 12px; padding-inline-start: 22px; } .page-doc li { margin-bottom: 4px; }
.page-doc a { color: var(--accent); text-decoration: underline; } .page-doc blockquote { margin: 10px 0; padding: 8px 14px; border-inline-start: 3px solid var(--accent); background: var(--glass); border-radius: 0 10px 10px 0; color: var(--text-2); }
.page-doc hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; } .page-doc img { max-width: 100%; border-radius: 12px; } .page-doc code { background: var(--glass-2); padding: 1px 6px; border-radius: 6px; font-family: ui-monospace, monospace; font-size: 13px; }
.page-doc table { width: 100%; border-collapse: collapse; margin: 10px 0; } .page-doc td, .page-doc th { border: 1px solid var(--border); padding: 6px 10px; text-align: start; }

/* --- تبلیغات: نوار «پیشنهادی» --- */
.promo-strip { padding: 6px 0 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.promo-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 14px 4px; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.promo-head span { display: inline-flex; align-items: center; gap: 6px; } .promo-head svg { width: 15px; height: 15px; }
.promo-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 10px 8px; scrollbar-width: none; scroll-snap-type: x proximity; } .promo-row::-webkit-scrollbar { display: none; }
.promo-card { position: relative; flex: 0 0 116px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; border-radius: 16px; background: var(--glass); border: 1px solid var(--border); font: inherit; color: var(--text); cursor: pointer; scroll-snap-align: start; transition: transform .15s var(--spring), background .15s; }
.promo-card:hover { background: var(--glass-2); transform: translateY(-2px); }
.promo-card b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 3px; }
.promo-card > span { font-size: 11.5px; color: var(--text-3); }
.promo-card.vip { border-color: rgba(245,158,11,.5); background: linear-gradient(180deg, rgba(245,158,11,.10), transparent); }
.promo-card.pro { border-color: rgba(var(--accent-rgb), .45); }
.promo-tag { position: absolute; top: 6px; inset-inline-start: 6px; display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-size: 10px; padding: 2px 6px; border-radius: 99px; background: linear-gradient(90deg, #f59e0b, #ec4899); color: #fff; font-weight: 700; } .promo-tag svg { width: 10px; height: 10px; }
.promo-card.pro .promo-tag { background: var(--accent); }
.promo-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); opacity: 0; transition: opacity .15s; background: var(--glass-2); } .promo-x svg { width: 13px; height: 13px; }
.promo-card:hover .promo-x, html.m-shell .promo-x { opacity: 1; }
.promo-prev { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 6px 0; }
.promo-prev h3 { display: flex; align-items: center; gap: 6px; font-size: 18px; margin: 4px 0 0; } .promo-prev .sub { color: var(--text-3); font-size: 13px; } .promo-prev p { color: var(--text-2); font-size: 14px; line-height: 1.7; margin: 4px 0; white-space: pre-wrap; }
.promo-ad { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); margin-bottom: 6px; } .promo-ad svg { width: 12px; height: 12px; }
.promo-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 20px 14px; }
.promo-hero .ph-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, #f97316, #ec4899); color: #fff; box-shadow: 0 10px 28px rgba(236,72,153,.3); } .promo-hero .ph-ic svg { width: 32px; height: 32px; }
.promo-hero b { font-size: 16px; } .promo-hero span { font-size: 13px; color: var(--text-3); line-height: 1.7; }
.promo-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 6px 16px 14px; }
.promo-plan { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 10px 12px; border-radius: 18px; background: var(--glass); border: 1.5px solid var(--border); }
.promo-plan.hot { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.promo-plan b { font-size: 15px; } .pp-days { font-size: 12px; color: var(--text-3); } .pp-price { font-size: 15px; font-weight: 700; color: var(--accent); } .promo-plan p { font-size: 12px; color: var(--text-2); line-height: 1.6; flex: 1; margin: 0; white-space: pre-wrap; }
.pp-badge { position: absolute; top: -10px; inset-inline-start: 50%; transform: translateX(50%); font-style: normal; font-size: 11px; padding: 2px 10px; border-radius: 99px; background: linear-gradient(90deg, #f59e0b, #ec4899); color: #fff; font-weight: 700; white-space: nowrap; }
html.m-shell .promo-plans { grid-template-columns: 1fr; }

/* --- بوست --- */
.boost-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 20px 12px; }
.boost-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 12px 30px rgba(139,92,246,.35); } .boost-ic svg { width: 36px; height: 36px; fill: currentColor; stroke: none; }
.boost-hero b { font-size: 18px; margin-top: 4px; } .boost-hero > span { font-size: 13px; color: var(--text-3); }
.boost-bar { position: relative; width: 100%; height: 30px; border-radius: 99px; background: var(--glass-2); margin-top: 10px; overflow: hidden; }
.boost-bar i { position: absolute; inset: 0 auto 0 0; inset-inline-start: 0; background: linear-gradient(90deg, #8b5cf6, #ec4899); border-radius: 99px; transition: width .6s var(--spring); min-width: 0; }
.boost-bar em { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font-style: normal; font-size: 12px; font-weight: 700; padding: 0 12px; color: #fff; mix-blend-mode: difference; } .boost-bar em.r { inset-inline-end: 0; } .boost-bar em:not(.r) { inset-inline-start: 0; }
.boost-actions { padding: 4px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.boost-actions .btn-premium { margin-top: 0; }
.boost-levels .boost-lv { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; font-size: 12.5px; font-weight: 700; color: var(--text-3); } .boost-lv.done { color: #10b981; } .boost-lv i { font-style: normal; font-weight: 500; }
.boost-levels .set-row.locked { opacity: .7; } .boost-levels .set-row.ok > svg:first-child { color: #10b981; }
.boost-levels .ic-round { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .1); } .boost-levels .ic-round svg { width: 18px; height: 18px; }
.boost-badge { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 1px 7px 1px 5px; border-radius: 99px; background: linear-gradient(90deg, #8b5cf6, #ec4899); color: #fff; margin-inline-start: 6px; vertical-align: middle; cursor: pointer; } .boost-badge svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.chat-emoji-status { display: inline-flex; margin-inline-start: 4px; vertical-align: middle; } .chat-emoji-status img.em { width: 1.15em; height: 1.15em; }

/* --- ظاهر کانال --- */
.look-prev { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 24px 16px 18px; background: var(--glass); overflow: hidden; }
.look-prev.colored { color: #fff; } .look-prev.colored > span { color: rgba(255,255,255,.8); }
.look-prev b { font-size: 17px; display: flex; align-items: center; gap: 6px; position: relative; } .look-prev > span { font-size: 12.5px; color: var(--text-3); position: relative; }
.look-prev .avatar { position: relative; }
.look-pattern { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); place-items: center; opacity: .18; font-size: 22px; pointer-events: none; }
.look-status img.em { width: 1.1em; height: 1.1em; }
.look-bubble-prev { margin: 12px 16px 4px; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--bubble-in, var(--glass-2)); font-size: 13.5px; max-width: 320px; }
.lb-name { color: var(--nc); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.lb-quote { display: flex; align-items: center; gap: 6px; border-inline-start: 3px solid var(--nc); padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--nc) 12%, transparent); font-size: 12px; margin-bottom: 4px; } .lb-quote i { font-style: normal; color: var(--text-2); } .lb-quote img.em { width: 16px; height: 16px; }
.look-colors { flex-wrap: wrap; padding: 4px 0 8px; } .look-colors button.none { background: var(--glass-2); display: grid; place-items: center; color: var(--text-3); } .look-colors button.none svg { width: 16px; height: 16px; }
.look-colors button.locked { opacity: .35; position: relative; }
.look-colors.dis button:not(.none) { opacity: .35; }
.look-emojis { max-height: none; padding: 4px 0 8px; } .look-emojis.dis button { opacity: .4; } .look-emojis button svg { width: 18px; height: 18px; color: var(--text-3); } .look-emojis button img.em { width: 26px; height: 26px; }
.look-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); padding: 3px 10px; border-radius: 99px; background: var(--glass-2); cursor: pointer; } .look-lock svg { width: 13px; height: 13px; }
.look-wps { padding: 4px 0 8px; } .look-wps.dis button { opacity: .5; } .look-wps .wp-none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); } .look-wps .wp-none svg { width: 22px; height: 22px; }
.look-wps .wp-gradient { position: absolute; inset: 0; background: linear-gradient(160deg, #1b2a3a, #0e1621 45%, #16303f); } .look-wps .wp-pattern { position: absolute; inset: 0; background: #17212b; }
[data-theme="light"] .look-wps .wp-gradient { background: linear-gradient(160deg, #a8d5a2, #cfe9d0 45%, #9fcfd6); } [data-theme="light"] .look-wps .wp-pattern { background: #c9dbe9; }
/* والپیپر اختصاصی کانال — بر همه‌ی تنظیمات کاربر اولویت دارد */
html[data-chatwp][data-chatwp][data-chatwp] .main::before { --wallpaper: var(--chat-wp, none); background-size: cover; background-position: center; opacity: 1; }
html[data-chatwp][data-chatwp][data-chatwp="gradient"] .main::before { --wallpaper: linear-gradient(160deg, #1b2a3a, #0e1621 45%, #16303f); }
html[data-theme="light"][data-chatwp][data-chatwp][data-chatwp="gradient"] .main::before { --wallpaper: linear-gradient(160deg, #a8d5a2, #cfe9d0 45%, #9fcfd6); }
html[data-chatwp][data-chatwp][data-chatwp="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='.08' stroke-width='1.5'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3Cpath d='M70 20l20 20-20 20-20-20z'/%3E%3Ccircle cx='90' cy='90' r='12'/%3E%3Cpath d='M20 80h30v30H20z'/%3E%3C/g%3E%3C/svg%3E"); background-size: 240px; opacity: .8; }
html[data-theme="dark"][data-chatwp][data-chatwp][data-chatwp="custom"] .main::before, html[data-theme="dark"][data-chatwp][data-chatwp][data-chatwp^="wp:"] .main::before { opacity: .85; }
html[data-chatwp] .messages .msg .bubble.in { box-shadow: 0 1px 2px rgba(0,0,0,.25); }
/* رنگ نام و آیکون پاسخ کانال در پیام‌ها */
html[data-chatnc] .msg.in .bubble .quote { border-color: var(--chat-name-color); background: color-mix(in srgb, var(--chat-name-color) 12%, transparent); }
html[data-chatnc] .msg.in .bubble .quote .q-name { color: var(--chat-name-color); }
html[data-chatnc] .msg.in .bubble .sender-name { color: var(--chat-name-color) !important; }
html[data-chatnc] .msg.in .bubble a { color: var(--chat-name-color); }
.bubble .quote .q-icon { display: inline-flex; margin-inline-end: 4px; vertical-align: middle; } .bubble .quote .q-icon img.em { width: 14px; height: 14px; }

/* --- سازگاری وب‌ویو: بنر اعلان و راهنمای دسترسی --- */
.notif-ask { position: fixed; z-index: 150; inset-inline: 12px; bottom: 16px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: fade .25s; }
.notif-ask > svg { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; } .notif-ask .col { flex: 1; min-width: 0; } .notif-ask b { display: block; font-size: 14px; } .notif-ask span { font-size: 12px; color: var(--text-3); }
html:not(.m-shell) .notif-ask { inset-inline: auto 20px; width: 380px; }
html.m-shell .notif-ask { bottom: calc(76px + var(--safe-bottom, 0px)); }
.perm-help { text-align: center; } .perm-help .ph-ic { width: 64px; height: 64px; border-radius: 20px; margin: 4px auto 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .12); color: var(--accent); } .perm-help .ph-ic svg { width: 30px; height: 30px; }
.perm-help p { color: var(--text-2); font-size: 14px; line-height: 1.7; } .perm-help ol { text-align: start; margin: 10px 0 0; padding-inline-start: 22px; line-height: 2; font-size: 14px; } .perm-help .hint { margin-top: 10px; font-size: 12.5px; }

/* ===== v6.6: ظاهر بوست کانال/گروه در پنل اطلاعات (رنگ پروفایل + الگوی لوگو) ===== */
.ip-hero { position: relative; overflow: hidden; }
.ip-hero > * { position: relative; }
.look-pattern.hero { position: absolute; inset: 0; grid-template-columns: repeat(8, 1fr); opacity: .22; font-size: 20px; }
.look-pattern.hero img.em, .look-pattern.hero img.em-svg, .look-pattern.hero .em-wrap img { width: 20px; height: 20px; }
.ip-hero.colored h2 .verified-badge, .ip-hero.colored .boost-badge { filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.look-pattern img.em, .look-pattern .em-wrap img { width: 22px; height: 22px; }
.perm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.perm-dot.ok { background: #31b545; box-shadow: 0 0 0 3px rgba(49,181,69,.18); } .perm-dot.bad { background: #e53935; box-shadow: 0 0 0 3px rgba(229,57,53,.18); } .perm-dot.idle { background: #f5a623; }
/* پس‌زمینه‌ی گفتگو هرگز روی سایدبار/پنل نمی‌افتد (حتی با blur و inset منفی) */
.main { clip-path: inset(0); }
html.m-shell .m-hero.colored .sub { color: rgba(255,255,255,.85); }

/* ===== v6.7: نوار پایین کانال برای اعضا — دکمه‌ی آبی تلگرامی «بی‌صدا / روشن‌کردن اعلان» ===== */
.composer-blocked.channel-bar { padding: 8px 10px calc(8px + var(--safe-bottom)); background: var(--tg-composer); border-top: 1px solid var(--border); display: flex; justify-content: center; }
.ch-mute-btn { width: 100%; max-width: 560px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; border: 0; cursor: pointer; box-shadow: 0 4px 14px rgba(var(--accent-rgb), .28); transition: transform var(--mo-fast) var(--mo-out), filter var(--mo-fast), background var(--mo); }
.ch-mute-btn svg { width: 20px; height: 20px; }
.ch-mute-btn:hover { filter: brightness(1.06); } .ch-mute-btn:active { transform: scale(.985); } .ch-mute-btn:disabled { opacity: .7; }
.ch-mute-btn.muted { background: rgba(var(--accent-rgb), .12); color: var(--accent); box-shadow: none; }
[data-theme="light"] .ch-mute-btn.muted { background: rgba(var(--accent-rgb), .1); }
html.m-shell .composer-blocked.channel-bar { padding-bottom: calc(8px + var(--safe-bottom)); }

/* ===== v6.7: تقویم «پرش به تاریخ» (کلیک روی کادر تاریخ) ===== */
.date-sep { cursor: pointer; user-select: none; transition: transform var(--mo-fast) var(--mo-out), filter var(--mo-fast); }
.date-sep:hover { filter: brightness(1.15); } .date-sep:active { transform: scale(.96); }
.modal.cal-modal { width: 340px; max-width: calc(100vw - 24px); padding: 0; }
.cal-modal .modal-body { padding: 0; }
.cal { padding: 10px 12px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.cal-title { font-size: 16px; font-weight: 700; }
.cal-head .btn-icon:disabled { opacity: .3; cursor: default; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--text-3); padding-bottom: 6px; }
.cal-grid { overflow: hidden; }
.cal-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 2px; }
.cal-cells.slide-in { animation: cal-in var(--mo) var(--mo-out) both; } .cal-cells.slide-back { animation: cal-back var(--mo) var(--mo-out) both; }
@keyframes cal-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes cal-back { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.cal-day { position: relative; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: var(--text-3); background: transparent; border: 0; cursor: default; }
.cal-day .num { position: relative; z-index: 1; }
.cal-day.has { color: var(--text); cursor: pointer; font-weight: 600; }
.cal-day.has .dot { position: absolute; inset: 3px; border-radius: 50%; background: rgba(var(--accent-rgb), calc(var(--n, .5) * .9)); }
.cal-day.has:hover .dot { filter: brightness(1.15); } .cal-day.has:active { transform: scale(.92); }
.cal-day.has { color: #fff; }
.cal-day.today .num::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.cal-day.focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-hint { text-align: center; font-size: 12px; color: var(--text-3); padding-top: 10px; }
html.m-shell .modal.cal-modal { width: min(360px, calc(100vw - 20px)); }

/* ===== v6.7: وضعیت اتصال مثل تلگرام ===== */
/* عنوان صفحه‌ی اصلی موبایل: «رادیکال‌گرام» ⇄ «در حال اتصال…» */
html.m-shell .m-head .m-head-title { display: grid; align-items: center; }
html.m-shell .m-head .m-head-title > * { grid-area: 1 / 1; transition: opacity var(--mo) var(--mo-out), transform var(--mo) var(--mo-out); }
html.m-shell .m-head .m-head-name { font-size: 20px; font-weight: 600; }
html.m-shell .m-head .m-head-conn { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--text); opacity: 0; transform: translateY(8px); pointer-events: none; }
html.m-shell .m-head .m-head-conn .spinner { width: 16px; height: 16px; border-width: 2px; border-color: rgba(var(--accent-rgb), .25); border-top-color: var(--accent); }
html.m-shell.net-connecting .m-head .m-head-name, html.m-shell.net-down .m-head .m-head-name { opacity: 0; transform: translateY(-8px); }
html.m-shell.net-connecting .m-head .m-head-conn, html.m-shell.net-down .m-head .m-head-conn { opacity: 1; transform: none; }
html.m-shell.net-down .m-head .m-head-conn { color: var(--text-2); }
.m-head-conn { display: none; }
/* در صفحه‌ی اصلی موبایل (تب گفتگوها) نوتیف بالای صفحه لازم نیست — عنوان کافی است */
html.m-shell.net-home .net-bar { display: none; }
/* نوتیف باریک و مدرن بالای صفحه برای سایر صفحات (گفتگو، دسکتاپ، تب‌ها) */
.net-bar { position: fixed; top: calc(8px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 300; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 99px; background: rgba(24, 32, 42, .92); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06) inset; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); animation: net-in var(--mo) var(--mo-out) both; white-space: nowrap; max-width: calc(100vw - 24px); }
[data-theme="light"] .net-bar { background: rgba(255,255,255,.94); color: #1c2733; box-shadow: 0 8px 28px rgba(16,35,47,.18), 0 0 0 1px rgba(0,0,0,.05) inset; }
.net-bar .spinner { width: 15px; height: 15px; border-width: 2px; border-color: rgba(var(--accent-rgb), .25); border-top-color: var(--accent); }
.net-bar .ok-ic { display: none; width: 18px; height: 18px; border-radius: 50%; background: #31b545; color: #fff; place-items: center; } .net-bar .ok-ic svg { width: 12px; height: 12px; }
.net-bar.ok .ok-ic { display: grid; animation: pop var(--mo) var(--spring) both; } .net-bar.ok { background: rgba(28, 44, 36, .94); } [data-theme="light"] .net-bar.ok { background: #e9f8ee; color: #1e6b36; }
.net-bar.offline { background: rgba(58, 63, 71, .94); } .net-bar.offline::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #f5a623; box-shadow: 0 0 0 3px rgba(245,166,35,.22); }
[data-theme="light"] .net-bar.offline { background: #f3f4f6; color: #374151; }
.net-bar.out { animation: net-out var(--mo-fast) var(--mo-in) forwards; }
@keyframes net-in { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes net-out { to { opacity: 0; transform: translate(-50%, -10px) scale(.96); } }
html.m-shell .net-bar { top: calc(6px + var(--safe-top)); font-size: 12.5px; padding: 6px 12px 6px 10px; }
html.m-shell .net-bar.in-chat { top: calc(var(--header-h) + 6px + var(--safe-top)); }

/* ===== v6.7: سوایپ بین پوشه‌ها (لیست گفتگوها) — سبک و GPU-friendly ===== */
html.m-shell .chat-list { touch-action: pan-y; }
html.m-shell .chat-list.fold-drag { overflow-y: hidden; }
.chat-list.fold-in-next { animation: fold-next .24s cubic-bezier(.2,.8,.2,1) both; }
.chat-list.fold-in-prev { animation: fold-prev .24s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fold-next { from { opacity: .2; transform: translateX(46%); } to { opacity: 1; transform: none; } }
@keyframes fold-prev { from { opacity: .2; transform: translateX(-46%); } to { opacity: 1; transform: none; } }
html.m-shell .folders { scroll-behavior: smooth; }
html.m-shell .folders button { transition: background var(--mo) var(--mo-out), color var(--mo) var(--mo-out); }
[data-anim="off"] .chat-list.fold-in-next, [data-anim="off"] .chat-list.fold-in-prev { animation: none; }

/* ---------- v6.8 · کارایی: رندر تنبل ردیف‌های خارج از دید (فهرست‌های طولانی مثل تلگرام روان می‌مانند) ---------- */
.chat-list .chat-item { content-visibility: auto; contain-intrinsic-size: auto 68px; }

/* ---------- v6.8 · امکاناتی که مدیر سراسری خاموش کرده (html.off-*) ---------- */
html.off-voice .composer .send.mic { display: none; }
html.off-stories .stories-strip, html.off-stories .m-head-av, html.off-stories .m-stories, html.off-stories .stories-row { display: none !important; }
html.off-calls .chat-header button[title="تماس صوتی"], html.off-calls .chat-header button[title="تماس تصویری"], html.off-calls .ip-actions button.call, html.off-calls .m-call { display: none !important; }
html.off-theme-switch .theme-toggle, html.off-theme-switch .seg.theme-seg { display: none !important; }
html.off-boosts .boost-entry, html.off-promotions .promo-entry, html.off-promotions .promo-banner { display: none !important; }
html.off-folders .folders { display: none !important; }
/* بنر سکوت کاربر */
.mute-bar { position: sticky; bottom: 0; z-index: 3; margin: 0 10px 8px; padding: 10px 14px; border-radius: 12px; background: var(--glass-2); color: var(--text-2); font-size: 13px; text-align: center; border: 1px solid var(--border-2); }
.composer-blocked .mute-bar { margin: 0; width: 100%; }

/* v6.9 · «در حال ارسال…» در فهرست گفتگوها */
.chat-item .preview .typing.sending { color: var(--text-2); } .chat-item .preview .typing.sending svg { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 4px; animation: rg-pulse 1.2s ease-in-out infinite; }
.chat-item .ticks.pending svg { color: var(--text-3); }
@keyframes rg-pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* v6.9 · جای‌نگهدار محو رسانه (مثل تلگرام) */
.media-img .media-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px); transform: scale(1.12); z-index: 0; }
.media-img.has-ph > img:not(.media-ph), .media-img.has-ph > video { position: relative; z-index: 1; opacity: 0; transition: opacity .28s ease; }
.media-img.has-ph.loaded > img:not(.media-ph), .media-img.has-ph.loaded > video { opacity: 1; }
.media-img.has-ph.loaded .media-ph { opacity: 0; transition: opacity .4s .2s; }
.media-img:not(.has-ph):not(.loaded) { background: linear-gradient(110deg, var(--glass-2) 30%, var(--glass-3) 50%, var(--glass-2) 70%); background-size: 200% 100%; animation: rg-shimmer 1.4s linear infinite; }
.media-img.loaded, .media-img.gif { animation: none; }
.media-img .play, .media-img .dur, .media-img .overlay-meta, .media-img .upload-progress, .media-img .spoiler-cover { z-index: 2; }
@keyframes rg-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* v6.9 · کارت پاسخ به استوری + جای‌نگهدار استوری */
.story-reply-card { border-inline-start: 3px solid currentColor; padding: 6px 8px; gap: 10px; }
.story-reply-card .thumb { width: 42px; height: 58px; position: relative; } .story-reply-card .thumb img, .story-reply-card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-reply-card .thumb .st-txt { font-size: 8.5px; line-height: 1.3; } .story-reply-card .thumb .st-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; } .story-reply-card .thumb .st-play svg { width: 16px; height: 16px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.story-reply-card .col { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .story-reply-card small { font-weight: 600; font-size: 12.5px; } .story-reply-card .st-sub { font-size: 11.5px; opacity: .75; }
.story-reply-card.clickable { cursor: pointer; } .story-reply-card.clickable:hover { filter: brightness(1.08); }
.story-viewer .media .story-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px); transform: scale(1.1); }
.story-viewer .media .story-spin { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: rg-spin .8s linear infinite; z-index: 2; }
.story-viewer .media > img:not(.story-ph), .story-viewer .media > video { position: relative; z-index: 1; opacity: 0; transition: opacity .25s; }
.story-viewer .media.ready > img:not(.story-ph), .story-viewer .media.ready > video { opacity: 1; } .story-viewer .media.ready .story-spin { display: none; }
@keyframes rg-spin { to { transform: rotate(360deg); } }

/* v6.9 · تولد */
.ip-row.bday-today svg { color: #ec4899; } .bday-tag { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 99px; background: linear-gradient(90deg,#ec4899,#f97316); color: #fff; font-size: 11px; font-weight: 600; vertical-align: middle; }
.bday-age { padding: 0 2px 8px; color: var(--accent) !important; font-weight: 600; }
.bday-modal .modal { max-width: 360px; overflow: hidden; } .bday-modal .modal-body, .bday-modal .modal-b { padding: 0 !important; }
.bday-card { position: relative; text-align: center; padding: 34px 22px 28px; background: linear-gradient(160deg, #6c93ff 0%, #976fff 50%, #e46ace 100%); color: #fff; overflow: hidden; }
.bday-card h2 { font-size: 22px; font-weight: 800; margin: 14px 0 6px; position: relative; z-index: 1; } .bday-card p { opacity: .92; font-size: 14px; position: relative; z-index: 1; }
.bday-cake { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; position: relative; z-index: 1; animation: prem-float 3s ease-in-out infinite; } .bday-cake svg { width: 44px; height: 44px; }
.bday-gift { display: inline-flex; gap: 8px; align-items: center; margin-top: 16px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.2); font-weight: 600; font-size: 13.5px; position: relative; z-index: 1; } .bday-gift svg { width: 18px; height: 18px; }
.bday-confetti { position: absolute; inset: 0; pointer-events: none; } .bday-confetti i { position: absolute; top: -12px; left: calc(var(--i) * 4.2%); width: 8px; height: 12px; border-radius: 2px; background: hsl(calc(var(--i) * 40deg), 90%, 65%); animation: bday-fall 3.2s linear infinite; animation-delay: calc(var(--i) * -0.13s); opacity: .9; }
@keyframes bday-fall { to { transform: translateY(420px) rotate(540deg); } }
.msg .bday-msg { display: flex; gap: 10px; align-items: center; padding: 4px 0 6px; } .msg .bday-msg svg { width: 28px; height: 28px; color: #ec4899; flex-shrink: 0; }

/* v6.9 · حلقه‌ی استوری در لیست گفتگوها + دکمه‌ی دوربین */
.chat-item .avatar-wrap.has-story::before { inset: -3.5px; background: conic-gradient(from 200deg, #3390ec, #61b3ff, #2f7be0, #3390ec); }
.chat-item .avatar-wrap.has-story::after { content: ''; position: absolute; inset: -1.5px; border-radius: 50%; background: var(--bg-2); z-index: -1; }
.chat-item .avatar-wrap.has-story.story-seen::before { background: var(--border-2); }
.chat-item.active .avatar-wrap.has-story::after { background: var(--accent); }
.chat-item .avatar-wrap.has-story { cursor: pointer; } .chat-item .avatar-wrap.has-story .avatar { transition: transform .15s; } .chat-item .avatar-wrap.has-story:active .avatar { transform: scale(.94); }
.fab-stack { position: absolute; inset-inline-start: auto; inset-inline-end: 18px; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 5; }
.fab-stack .fab { position: static; bottom: auto; inset-inline-end: auto; }
.fab-stack .fab-story { width: 46px; height: 46px; border-radius: 50%; background: var(--bg-2); color: var(--accent); box-shadow: 0 3px 12px rgba(0,0,0,.2); border: 1px solid var(--border); }
.fab-stack .fab-story svg { width: 22px; height: 22px; }
[data-theme="dark"] .fab-stack .fab-story { background: var(--bg-3); }
/* دسکتاپ: فقط مداد (مثل تلگرام دسکتاپ) — دوربین فقط در موبایل */
html:not(.m-shell) .fab-stack .fab-story { display: none; }
html.m-shell .fab-stack { inset-inline-start: auto; inset-inline-end: auto; left: 16px; right: auto; bottom: calc(78px + var(--safe-bottom)); transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; }
html.m-shell .fab-stack .fab { position: static; left: auto; bottom: auto; }
html.m-shell.m-scrolling .fab-stack { transform: translateY(calc(100% + 120px)); opacity: 0; pointer-events: none; }
html.m-shell.m-tab-page .sidebar > .fab-stack { display: none; }

/* v6.9 · هدر اسکرولی موبایل: نوار جستجو ↔ آیکن جستجو */
html.m-shell .m-head-search { display: none; opacity: 0; transform: scale(.6); transition: opacity .22s, transform .22s cubic-bezier(.2,.8,.2,1); }
html.m-shell .sb-header { flex: 0 0 auto; max-height: var(--m-search-h, 60px); overflow: hidden; transition: max-height .28s cubic-bezier(.2,.8,.2,1), opacity .2s, padding .28s; }
html.m-shell.m-search-collapsed .sb-header { max-height: 0 !important; min-height: 0 !important; opacity: 0; padding-top: 0 !important; padding-bottom: 0 !important; margin: 0 !important; pointer-events: none; }
/* v6.9.1 · پایداری چیدمان خانه‌ی موبایل: هدر/استوری/پوشه‌ها هرگز فشرده نمی‌شوند، فقط لیست اسکرول می‌خورد؛
   بدون لایه‌ی GPU اجباری (will-change) که در وب‌ویوهای اندروید باعث «سیاه‌شدن/به‌هم‌ریختن» لیست هنگام اسکرول می‌شد */
html.m-shell .sidebar { display: flex; flex-direction: column; overflow: hidden; }
html.m-shell .m-head, html.m-shell .stories-strip, html.m-shell .folders, html.m-shell .m-tabbar, html.m-shell .sel-bar { flex: 0 0 auto; min-height: 0; }
html.m-shell .chat-list { flex: 1 1 0; min-height: 0; overflow-anchor: none; -webkit-overflow-scrolling: touch; }
html.m-shell .stories-strip { overflow-y: hidden; }
html.m-shell[data-anim="off"] .sb-header, html.m-shell[data-power="on"] .sb-header { transition: none; }
@media (prefers-reduced-motion: reduce) { html.m-shell .sb-header, html.m-shell .fab-stack { transition: none !important; } }
html.m-shell.m-search-collapsed .m-head-search { display: inline-flex; opacity: 1; transform: none; }
html.m-shell .m-head { transition: box-shadow .2s; } html.m-shell.m-search-collapsed .m-head { box-shadow: 0 1px 0 var(--border); }

/* v6.9 · انتخاب چندتایی گفتگوها */
.sel-bar { display: none; align-items: center; gap: 2px; padding: 6px 8px; min-height: 56px; background: var(--bg-2); border-bottom: 1px solid var(--border); animation: sel-in .2s ease-out; }
.sel-bar.on { display: flex; } .sel-bar .sel-count { font-size: 17px; font-weight: 600; padding-inline-start: 6px; } .sel-bar .grow { flex: 1; } .sel-bar .hidden { display: none; }
.sel-bar.busy { opacity: .6; pointer-events: none; }
@keyframes sel-in { from { transform: translateY(-8px); opacity: 0; } }
html.sel-mode .sb-header, html.sel-mode .m-head, html.sel-mode .stories-strip, html.sel-mode .folders { display: none !important; }
html.sel-mode .fab, html.sel-mode .fab-stack { display: none !important; }
.chat-item .sel-box { display: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--text-3); align-items: center; justify-content: center; flex-shrink: 0; margin-inline-end: 4px; transition: background .15s, border-color .15s, transform .15s; }
.chat-item .sel-box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.5); transition: all .15s; }
.chat-item.selectable .sel-box { display: inline-flex; animation: sel-in .2s ease-out; }
.chat-item.selected .sel-box { background: var(--accent); border-color: var(--accent); } .chat-item.selected .sel-box svg { opacity: 1; transform: none; }
.chat-item.selected { background: rgba(var(--accent-rgb), .12); }
.chat-item.selected.active { background: var(--accent); }

/* v6.9 · شخصی‌سازی */
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 8px 16px 12px; }
html.m-shell .preset-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); }
.preset .pv { width: 100%; aspect-ratio: 3/4; border-radius: 14px; border: 2px solid transparent; position: relative; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: transform .15s, border-color .15s; }
.preset .pv i { position: absolute; height: 14px; border-radius: 7px; } .preset .pv i:first-child { left: 10%; top: 22%; width: 55%; } .preset .pv i:last-child { right: 10%; top: 50%; width: 60%; }
.preset.active .pv { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); } .preset:active .pv { transform: scale(.95); }
.preset b { font-size: 12px; font-weight: 500; }
.seg.wrap { flex-wrap: wrap; } .seg.wrap button { flex: 1 1 auto; min-width: 70px; }
.font-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 8px 16px 6px; }
.font-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--glass); color: var(--text); cursor: pointer; }
.font-opt b { font-size: 20px; font-weight: 600; } .font-opt span { font-size: 11.5px; color: var(--text-2); font-family: var(--font); }
.font-opt.active { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
/* سبک دکمه‌ها */
html[data-btnstyle="soft"] .btn, html[data-btnstyle="soft"] .input, html[data-btnstyle="soft"] .fab { border-radius: 10px !important; }
html[data-btnstyle="square"] .btn, html[data-btnstyle="square"] .input, html[data-btnstyle="square"] .fab, html[data-btnstyle="square"] .btn-icon { border-radius: 6px !important; }
html[data-btnstyle="pill"] .btn, html[data-btnstyle="pill"] .input { border-radius: 99px !important; }
/* تراکم */
html[data-density="compact"] .chat-item { padding-top: 6px; padding-bottom: 6px; } html[data-density="compact"] .set-row { min-height: 40px; } html[data-density="compact"] .msg { margin-bottom: 2px; }
html[data-density="cozy"] .chat-item { padding-top: 12px; padding-bottom: 12px; } html[data-density="cozy"] .set-row { min-height: 56px; } html[data-density="cozy"] .msg { margin-bottom: 6px; }
/* شکل آواتار */
html[data-avshape="rounded"] .avatar, html[data-avshape="rounded"] .avatar img { border-radius: 30% !important; }
html[data-avshape="squircle"] .avatar, html[data-avshape="squircle"] .avatar img { border-radius: 38% / 42% !important; }
html[data-avshape="rounded"] .chat-item .avatar-wrap.has-story::before, html[data-avshape="rounded"] .chat-item .avatar-wrap.has-story::after { border-radius: 32%; }
html[data-avshape="squircle"] .chat-item .avatar-wrap.has-story::before, html[data-avshape="squircle"] .chat-item .avatar-wrap.has-story::after { border-radius: 40% / 44%; }
/* دنباله‌ی حباب / درخشش */
html.no-tail .msg .bubble::before, html.no-tail .msg .bubble::after, html.no-tail .bubble .tail { display: none !important; }
html.no-glow .btn:hover, html.no-glow .btn-icon:hover, html.no-glow .chat-item:hover { filter: none !important; box-shadow: none !important; }
html:not(.no-glow) .btn-primary:hover { box-shadow: 0 6px 18px -6px rgba(var(--accent-rgb), .6); }
html.no-react-fx .react-burst, html.no-react-fx .reaction-fx { display: none !important; }
html.no-typing-fx .typing-dots i { animation: none !important; }
/* افکت ارسال */
.send-fx { position: fixed; pointer-events: none; z-index: 9999; }
.send-fx i { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 2px; background: hsl(calc(var(--h) * 1deg), 90%, 60%); animation: fx-burst .9s cubic-bezier(.2,.7,.3,1) forwards; }
.send-fx.hearts i { width: 12px; height: 12px; background: none; border-radius: 0; } .send-fx.hearts i::before { content: ''; position: absolute; inset: 0; background: #ff4d6d; clip-path: path('M6 11 L1 5.8 C-0.6 4 0.2 1 2.7 1 C4 1 5.3 1.8 6 3 C6.7 1.8 8 1 9.3 1 C11.8 1 12.6 4 11 5.8 Z'); }
.send-fx.stars i { background: #ffd166; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); width: 12px; height: 12px; }
.send-fx.pop i { border-radius: 50%; background: var(--accent); width: 7px; height: 7px; animation-duration: .55s; }
@keyframes fx-burst { 0% { transform: translate(0,0) scale(.4) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; } }
html[data-sendbtn="square"] .composer .send:not(.mic) { border-radius: 10px !important; }
html[data-sendbtn="text"] .composer .send:not(.mic) svg { display: none; }
html[data-sendbtn="text"] .composer .send:not(.mic)::after { content: 'ارسال'; font-size: 13px; font-weight: 600; }
html[data-sendbtn="text"] .composer .send:not(.mic) { width: auto !important; padding: 0 14px; border-radius: 18px; }

/* v6.9 · زبان‌های چپ‌به‌راست: چیدمان آینه‌ای؛ فونت لاتین/سیریلیک با Vazirmatn (لاتین را هم دارد) */
html.lang-ltr { direction: ltr; }
html.lang-ltr .msg.out { flex-direction: row-reverse; } html.lang-ltr .ticks { direction: ltr; }
html.lang-ltr .num, html.lang-ltr .time { direction: ltr; }
html[data-lang="zh"] body, html[data-lang="hi"] body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'RG Apple Emoji', sans-serif; }

/* v6.9 · لوگوی اختصاصی رادیکال‌گرام در صفحه‌ی ورود + تم آبی پیش‌فرض */
.au-mark { background: #fff; border: 0; box-shadow: 0 10px 30px rgba(0,0,0,.2); overflow: hidden; }
.au-mark .au-logo, .au-plane .au-logo { width: 64px; height: 64px; display: block; transform: none; }
.au-mark.sm { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px; background: transparent; box-shadow: none; }
.au-mark.sm .au-logo { width: 72px; height: 72px; filter: drop-shadow(0 8px 20px rgba(31,111,229,.35)); }
.au-plane { animation: au-float 3.6s ease-in-out infinite; }
@keyframes au-float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }

/* =============================================================================
   v6.13 — «۳ کلمه درباره‌ی من» (چیپ‌های پروفایل) + استایل ویژه‌ی تیک آبی
   ============================================================================= */

/* ---- چیپ‌های «۳ کلمه درباره‌ی من» — مدرن، ریسپانسیو، با انیمیشن ورود نرم ---- */
.ptags { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 8px; max-width: 100%; }
.ptag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px 5px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.4; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); background: linear-gradient(135deg, rgba(var(--accent-rgb), .14), rgba(var(--accent-rgb), .07));
  border: 1px solid rgba(var(--accent-rgb), .28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ptag i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .55)); box-shadow: 0 0 6px rgba(var(--accent-rgb), .6); }
.ptag:nth-child(2) { background: linear-gradient(135deg, rgba(139,92,246,.14), rgba(139,92,246,.07)); border-color: rgba(139,92,246,.28); }
.ptag:nth-child(2) i { background: linear-gradient(135deg, #8b5cf6, #c084fc); box-shadow: 0 0 6px rgba(139,92,246,.6); }
.ptag:nth-child(3) { background: linear-gradient(135deg, rgba(16,185,129,.14), rgba(16,185,129,.07)); border-color: rgba(16,185,129,.28); }
.ptag:nth-child(3) i { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 0 6px rgba(16,185,129,.6); }
.ptag:hover { transform: translateY(-1px); box-shadow: 0 4px 14px -6px rgba(var(--accent-rgb), .45); }
[data-anim="on"] .ptags .ptag { animation: ptag-in .4s cubic-bezier(.34,1.4,.64,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes ptag-in { from { opacity: 0; transform: translateY(6px) scale(.92); } to { opacity: 1; transform: none; } }
/* روی هدرهای رنگی (پروفایل رنگی پریمیوم) چیپ‌ها شیشه‌ای سفید می‌شوند */
.ip-hero.colored .ptag, .settings-hero.colored .ptag, .m-hero.colored .ptag { color: #fff; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); }
.ip-hero.colored .ptag i, .settings-hero.colored .ptag i, .m-hero.colored .ptag i { background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.8); }
/* فرم ویرایش پروفایل */
.ptag-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 480px) { .ptag-inputs { grid-template-columns: 1fr; } }
.ptags-preview { margin-top: 8px; min-height: 30px; display: flex; justify-content: center; }
.ptags-preview .ptags { margin-top: 0; }
/* موبایل: چیپ‌ها زیر نام در m-hero */
.m-hero .ptags { margin-top: 6px; padding: 0 12px; }

/* ---- نشان تیک آبی رنگی (شخصی‌سازی حساب رسمی) ---- */
.verified-badge.vb-glow svg.vb { filter: drop-shadow(0 0 4px rgba(51,144,236,.55)); }
.verified-badge.vb-gold.vb-glow svg.vb { filter: drop-shadow(0 0 4px rgba(245,158,11,.6)); }
.verified-badge.vb-purple.vb-glow svg.vb { filter: drop-shadow(0 0 4px rgba(139,92,246,.6)); }
.verified-badge.vb-emerald.vb-glow svg.vb { filter: drop-shadow(0 0 4px rgba(16,185,129,.6)); }
.verified-badge.vb-rose.vb-glow svg.vb { filter: drop-shadow(0 0 4px rgba(244,63,94,.6)); }
.verified-badge.vb-black.vb-glow svg.vb { filter: drop-shadow(0 0 4px rgba(75,85,99,.65)); }
[data-anim="on"] .verified-badge.vb-anim svg.vb { animation: vb-pop 2.8s ease-in-out infinite; transform-origin: center; }
@keyframes vb-pop { 0%, 88%, 100% { transform: scale(1); } 92% { transform: scale(1.14) rotate(-4deg); } 96% { transform: scale(1.06) rotate(2deg); } }
[data-power="on"] .verified-badge.vb-anim svg.vb { animation: none; }

/* ---- حباب پیام ویژه‌ی تیک آبی (کاربر رسمی / کانال رسمی) ----
   سبک و بهینه: فقط border/box-shadow/گرادیان — بدون فیلتر سنگین */
.msg.vip .bubble { position: relative; }
/* ۱) سلطنتی: قاب آبی + هاله */
.msg.vip.vip-royal .bubble { border: 1.5px solid rgba(51,144,236,.55); }
.msg.vip.vip-royal.vip-glow .bubble { box-shadow: 0 0 0 1px rgba(51,144,236,.12), 0 4px 18px -6px rgba(51,144,236,.35); }
.msg.vip.vip-royal .bubble .sender-name { background: linear-gradient(90deg, #3390ec, #6cb7ff); -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; }
/* ۲) طلایی */
.msg.vip.vip-gold .bubble { border: 1.5px solid rgba(245,158,11,.55); }
.msg.vip.vip-gold.vip-glow .bubble { box-shadow: 0 0 0 1px rgba(245,158,11,.12), 0 4px 18px -6px rgba(245,158,11,.4); }
.msg.vip.vip-gold .bubble .sender-name { background: linear-gradient(90deg, #d97706, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; }
/* ۳) شفق: قاب گرادیان متحرک با border-image جایگزین (لایه‌ی پس‌زمینه) */
.msg.vip.vip-aurora .bubble { border: 1.5px solid transparent; background-clip: padding-box; }
.msg.vip.vip-aurora .bubble::before { content: ''; position: absolute; inset: -1.5px; z-index: -1; border-radius: inherit; background: linear-gradient(120deg, #8b5cf6, #3390ec, #22d3ee, #8b5cf6); background-size: 300% 300%; }
[data-anim="on"] .msg.vip.vip-aurora.vip-anim .bubble::before { animation: vip-aurora 6s linear infinite; }
@keyframes vip-aurora { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.msg.vip.vip-aurora.vip-glow .bubble { box-shadow: 0 4px 20px -6px rgba(139,92,246,.4); }
.msg.vip.vip-aurora .bubble .sender-name { background: linear-gradient(90deg, #8b5cf6, #3390ec); -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; }
/* ۴) نئون */
.msg.vip.vip-neon .bubble { border: 1.5px solid rgba(34,211,238,.6); }
.msg.vip.vip-neon.vip-glow .bubble { box-shadow: 0 0 10px -2px rgba(34,211,238,.45), inset 0 0 12px -8px rgba(34,211,238,.4); }
[data-anim="on"] .msg.vip.vip-neon.vip-anim .bubble { animation: vip-neon 3.2s ease-in-out infinite; }
@keyframes vip-neon { 0%, 100% { border-color: rgba(34,211,238,.6); } 50% { border-color: rgba(34,211,238,.95); } }
.msg.vip.vip-neon .bubble .sender-name { color: #22d3ee !important; }
/* ۵) شیشه‌ای: مینیمال */
.msg.vip.vip-glass .bubble { border: 1px solid rgba(255,255,255,.28); }
[data-theme="light"] .msg.vip.vip-glass .bubble { border-color: rgba(0,0,0,.14); }
.msg.vip.vip-glass.vip-glow .bubble { box-shadow: 0 6px 22px -10px rgba(0,0,0,.35); }
/* دم حباب با قاب‌های ویژه تداخل ظاهری دارد؛ برای پیام‌های VIP حذف می‌شود */
.msg.vip .bubble::after { display: none !important; }
/* ذخیره‌ی انرژی: همه‌ی انیمیشن‌های VIP خاموش */
[data-power="on"] .msg.vip .bubble, [data-power="on"] .msg.vip .bubble::before { animation: none !important; }
/* پیام‌های خروجی (خود مدیر): قاب حفظ می‌شود ولی رنگ نام سفید می‌ماند */
.msg.out.vip .bubble .sender-name { -webkit-text-fill-color: initial; }

/* ---- دیالوگ «استایل تیک آبی» ---- */
.vsp-modal .modal { max-width: 520px; }
.vsp-page { padding: 0 14px 18px; }
.vsp-hero { text-align: center; padding: 22px 14px 16px; margin: 0 -14px 10px; border-radius: 0 0 26px 26px; background: linear-gradient(160deg, rgba(51,144,236,.18), rgba(139,92,246,.12)); }
.vsp-hero .verified-badge.lg { width: 54px; height: 54px; display: inline-flex; }
.vsp-hero .verified-badge.lg svg.vb { width: 54px; height: 54px; }
[data-anim="on"] .vsp-hero .verified-badge svg.vb { animation: vsp-float 3s ease-in-out infinite; }
@keyframes vsp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.vsp-hero b { display: block; font-size: 17px; margin-top: 8px; }
.vsp-hero span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.7; }
.vsp-preview { padding: 14px 10px; border-radius: 14px; background: var(--glass-2); margin-bottom: 6px; overflow: hidden; }
.vsp-msg { max-width: 100%; }
.vsp-msg .bubble { max-width: 300px; }
.vsp-badges { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 8px; }
@media (max-width: 480px) { .vsp-badges { grid-template-columns: repeat(3, 1fr); } }
.vsp-badge { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 14px; background: var(--glass-2); border: 2px solid transparent; cursor: pointer; transition: border-color .18s, transform .15s, background .18s; }
.vsp-badge:hover { transform: translateY(-2px); }
.vsp-badge.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.vsp-badge .verified-badge { width: 26px; height: 26px; margin: 0; }
.vsp-badge .verified-badge svg.vb { width: 26px; height: 26px; }
.vsp-badge small { font-size: 11px; color: var(--text-2); }
.vsp-bubbles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 480px) { .vsp-bubbles { grid-template-columns: 1fr; } }
.vsp-bubble { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: start; padding: 10px 12px; border-radius: 14px; background: var(--glass-2); border: 2px solid transparent; cursor: pointer; transition: border-color .18s, background .18s, transform .15s; }
.vsp-bubble:hover { transform: translateY(-1px); }
.vsp-bubble.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.vsp-bubble b { font-size: 13.5px; grid-column: 2; }
.vsp-bubble small { font-size: 11.5px; color: var(--text-2); grid-column: 2; }
.vsp-swatch { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 12px; background: var(--bubble-in); border: 2px solid transparent; }
.vsp-swatch.vip-royal { border-color: rgba(51,144,236,.7); box-shadow: 0 0 8px -2px rgba(51,144,236,.6); }
.vsp-swatch.vip-gold { border-color: rgba(245,158,11,.7); box-shadow: 0 0 8px -2px rgba(245,158,11,.6); }
.vsp-swatch.vip-aurora { border-color: transparent; background: linear-gradient(120deg, #8b5cf6, #3390ec, #22d3ee); }
.vsp-swatch.vip-neon { border-color: rgba(34,211,238,.8); box-shadow: 0 0 8px -2px rgba(34,211,238,.7); }
.vsp-swatch.vip-glass { border-color: rgba(150,150,150,.4); }
.vsp-swatch.vip-none { border-color: transparent; }
.vsp-actions { display: flex; gap: 10px; margin-top: 14px; }
.vsp-actions .btn { flex: 1; }

/* =============================================================================
   v6.14 — تزئین پروفایل پریمیوم (نمادهای شناور، هاله، موج براق — مثل Telegram Premium)
   ============================================================================= */
.settings-hero, .m-hero, .pc-hero { position: relative; overflow: hidden; }
.settings-hero > *, .m-hero > * { position: relative; z-index: 1; }
.settings-hero > .hero-deco, .m-hero > .hero-deco, .ip-hero > .hero-deco, .pc-hero > .hero-deco { z-index: 0; }
.hero-deco { position: absolute; inset: 0; pointer-events: none; }
/* هاله‌ی نورانی بالای هدر */
.hero-deco .hd-glow { position: absolute; inset: -30% -10% auto; height: 90%; background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.30), transparent 62%); }
[data-theme="light"] .hero-deco .hd-glow { background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.45), transparent 62%); }
/* موج براق عبوری */
.hero-deco .hd-shine { position: absolute; top: 0; bottom: 0; width: 46%; background: linear-gradient(105deg, transparent, rgba(255,255,255,.16) 48%, rgba(255,255,255,.05) 52%, transparent); transform: translateX(-160%) skewX(-14deg); }
[data-anim="on"] .hero-deco .hd-shine { animation: hd-shine 5.5s ease-in-out infinite; }
@keyframes hd-shine { 0%, 55% { transform: translateX(-160%) skewX(-14deg); } 85%, 100% { transform: translateX(420%) skewX(-14deg); } }
[dir="rtl"] .hero-deco .hd-shine { transform: translateX(160%) skewX(14deg); }
[dir="rtl"][data-anim="on"] .hero-deco .hd-shine, [dir="rtl"] [data-anim="on"] .hero-deco .hd-shine { animation: hd-shine-rtl 5.5s ease-in-out infinite; }
@keyframes hd-shine-rtl { 0%, 55% { transform: translateX(160%) skewX(14deg); } 85%, 100% { transform: translateX(-420%) skewX(14deg); } }
/* نمادهای شناور */
.hero-deco .hd-icons { position: absolute; inset: 0; }
.hero-deco .hd-ic { position: absolute; left: var(--x); top: var(--y); font-size: 15px; opacity: .34; transform: scale(var(--s, 1)); filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
.hero-deco .hd-ic img.em, .hero-deco .hd-ic .em-wrap img { width: 16px; height: 16px; }
[data-anim="on"] .hero-deco.anim .hd-ic { animation: hd-float var(--d, 4s) ease-in-out var(--dl, 0s) infinite; }
@keyframes hd-float {
  0%, 100% { transform: translateY(0) scale(var(--s, 1)) rotate(0deg); opacity: .30; }
  50% { transform: translateY(-9px) scale(calc(var(--s, 1) * 1.12)) rotate(7deg); opacity: .48; }
}
/* ذخیره‌ی انرژی / انیمیشن خاموش: همه‌چیز ساکن ولی دیده می‌شود */
[data-power="on"] .hero-deco .hd-ic, [data-power="on"] .hero-deco .hd-shine { animation: none !important; }
/* روی هدرهای بدون رنگ (پیش‌فرض) هم تزئین کمی محوتر باشد */
.settings-hero:not(.colored) .hd-ic, .m-hero:not(.colored) .hd-ic, .ip-hero:not(.colored) .hd-ic { opacity: .22; }

/* گرید انتخاب نماد تزئین در دیالوگ «رنگ و تزئین پروفایل» */
.pc-deco-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 4px 0 2px; }
@media (max-width: 480px) { .pc-deco-grid { grid-template-columns: repeat(4, 1fr); } }
.pc-deco { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 7px; border-radius: 13px; background: var(--glass-2); border: 2px solid transparent; cursor: pointer; transition: border-color .18s, background .18s, transform .15s; font-size: 21px; }
.pc-deco img.em, .pc-deco .em-wrap img { width: 24px; height: 24px; }
.pc-deco:hover { transform: translateY(-2px); }
.pc-deco.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.pc-deco.none { color: var(--text-3); } .pc-deco.none svg { width: 20px; height: 20px; }
.pc-deco small { font-size: 10.5px; color: var(--text-2); }
.pc-hero { min-height: 118px; }

/* =============================================================================
   v6.14.1 — پیل تاریخ شناور + لودینگ مدرن (مثل تلگرام)
   ============================================================================= */

/* ---- پیل تاریخ شناور: هنگام اسکرول تاریخ بخش جاری را بالای پیام‌ها نشان می‌دهد ---- */
.float-date { position: absolute; top: calc(var(--header-h) + 10px); left: 50%; transform: translate(-50%, -8px); z-index: 5; padding: 4px 12px; border-radius: 12px; background: var(--tg-date); color: #fff; font-size: 13px; font-weight: 500; pointer-events: none; opacity: 0; transition: opacity .18s ease, transform .18s ease; white-space: nowrap; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
[data-theme="light"] .float-date { color: #4f6a80; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(16,35,47,.2); }
.float-date.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }
.main .pinned-bar:not(.hidden) ~ .float-date { top: calc(var(--header-h) + 58px); }

/* ---- اسکلتون باز شدن گفتگو: حباب‌های خاکستری سوسوزن مثل تلگرام به‌جای یک اسپینر خالی ---- */
.chat-skel { display: flex; flex-direction: column; gap: 8px; padding: 8px 6px; margin-top: auto; }
.chat-skel .sk-row { display: flex; }
.chat-skel .sk-row.out { justify-content: flex-start; flex-direction: row; }
.chat-skel .sk-b { border-radius: 14px; background: var(--glass-2); position: relative; overflow: hidden; }
.chat-skel .sk-b::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 32%, rgba(255,255,255,.09) 50%, transparent 68%); background-size: 220% 100%; animation: rg-shimmer 1.3s linear infinite; }
[data-theme="light"] .chat-skel .sk-b { background: rgba(16,35,47,.07); }
[data-theme="light"] .chat-skel .sk-b::after { background: linear-gradient(100deg, transparent 32%, rgba(255,255,255,.65) 50%, transparent 68%); background-size: 220% 100%; }
.chat-skel .in { align-self: flex-start; border-end-start-radius: 4px; }
.chat-skel .out2 { align-self: flex-end; border-end-end-radius: 4px; background: rgba(var(--accent-rgb), .14); }
[data-power="on"] .chat-skel .sk-b::after { animation: none; }

/* ---- لودینگ سه‌نقطه‌ی تلگرامی برای «پیام‌های قدیمی‌تر» به‌جای اسپینر ساده ---- */
.loading-top { display: flex; justify-content: center; padding: 10px 8px; }
.loading-top .spinner { display: none; }
.loading-top::after { content: ''; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(var(--accent-rgb), .22); border-top-color: var(--accent); animation: spin .65s linear infinite; }
[data-power="on"] .loading-top::after { animation-duration: 1.2s; }

/* ---- مدیا: به‌جای شیمر تخت، گرادیان + آیکن و حس عمق مثل تلگرام ---- */
.media-img:not(.has-ph):not(.loaded):not(.gif) { background: linear-gradient(140deg, rgba(var(--accent-rgb), .10), var(--glass-2) 45%, rgba(var(--accent-rgb), .06)); animation: none; position: relative; }
.media-img:not(.has-ph):not(.loaded):not(.gif)::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 34%, rgba(255,255,255,.08) 50%, transparent 66%); background-size: 220% 100%; animation: rg-shimmer 1.25s linear infinite; }
.media-img.has-ph:not(.loaded)::after { content: ''; position: absolute; inset: 0; z-index: 2; background: linear-gradient(100deg, transparent 36%, rgba(255,255,255,.10) 50%, transparent 64%); background-size: 220% 100%; animation: rg-shimmer 1.25s linear infinite; pointer-events: none; }
.media-img.loaded::after, .media-img.loaded::before { display: none; }
[data-power="on"] .media-img::before, [data-power="on"] .media-img::after, [data-power="on"] .album-cell::after { animation: none !important; }
/* ظاهر شدن نرم تصویر بعد از لود (فقط وقتی placeholder نداریم) */
[data-anim="on"] .media-img:not(.has-ph) > img { opacity: 0; transition: opacity .25s ease; }
[data-anim="on"] .media-img:not(.has-ph).loaded > img { opacity: 1; }
.album-cell.has-ph:not(.loaded)::after { content: ''; position: absolute; inset: 0; z-index: 2; background: linear-gradient(100deg, transparent 36%, rgba(255,255,255,.10) 50%, transparent 64%); background-size: 220% 100%; animation: rg-shimmer 1.25s linear infinite; pointer-events: none; }
.album-cell.loaded::after { display: none; }

/* ---- لودینگ نمای تمام‌صفحه (لایت‌باکس) مثل تلگرام ---- */
.lb-body { position: relative; }
.lb-body .lb-thumb { position: absolute; max-width: 92vw; max-height: 82vh; filter: blur(18px); transform: scale(1.04); opacity: 1; transition: opacity .3s ease; pointer-events: none; }
.lb-body .lb-thumb.out { opacity: 0; }
.lb-body img.lb-wait { opacity: 0; }
.lb-body img { transition: opacity .28s ease; }
.lb-loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.lb-ring { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .7s linear infinite; filter: drop-shadow(0 1px 6px rgba(0,0,0,.4)); }
.lb-err { padding: 8px 16px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; }
[data-power="on"] .lb-ring { animation-duration: 1.3s; }

/* ---- v6.14.1: اسکلتون ردیفی (جستجو، فایل/لینک/صوت پنل اطلاعات) ---- */
.list-skel { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; }
.list-skel .ls-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.list-skel .ls-av { width: 42px; height: 42px; border-radius: 50%; flex: none; background: var(--glass-2); position: relative; overflow: hidden; }
.list-skel .ls-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.list-skel .ls-lines i { height: 11px; border-radius: 6px; background: var(--glass-2); position: relative; overflow: hidden; display: block; }
.list-skel .ls-av::after, .list-skel .ls-lines i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 34%, rgba(255,255,255,.09) 50%, transparent 66%); background-size: 220% 100%; animation: rg-shimmer 1.3s linear infinite; }
[data-theme="light"] .list-skel .ls-av, [data-theme="light"] .list-skel .ls-lines i { background: rgba(16,35,47,.07); }
[data-theme="light"] .list-skel .ls-av::after, [data-theme="light"] .list-skel .ls-lines i::after { background: linear-gradient(100deg, transparent 34%, rgba(255,255,255,.65) 50%, transparent 66%); background-size: 220% 100%; }
[data-power="on"] .list-skel .ls-av::after, [data-power="on"] .list-skel .ls-lines i::after { animation: none; }

/* ---- اسکلتون گرید رسانه (تب «رسانه» پنل اطلاعات) ---- */
.media-grid.skel .cell.sk { background: var(--glass-2); position: relative; overflow: hidden; }
.media-grid.skel .cell.sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 34%, rgba(255,255,255,.09) 50%, transparent 66%); background-size: 220% 100%; animation: rg-shimmer 1.3s linear infinite; }
.media-grid.skel .cell.sk:nth-child(2n)::after { animation-delay: .18s; }
.media-grid.skel .cell.sk:nth-child(3n)::after { animation-delay: .36s; }
[data-theme="light"] .media-grid.skel .cell.sk { background: rgba(16,35,47,.07); }
[data-power="on"] .media-grid.skel .cell.sk::after { animation: none; }

/* ---- گرید رسانه: عکس‌ها بعد از لود نرم ظاهر شوند ---- */
[data-anim="on"] .media-grid .cell img { opacity: 0; animation: mg-in .25s ease forwards; }
@keyframes mg-in { to { opacity: 1; } }
[data-power="on"] .media-grid .cell img { opacity: 1; animation: none; }

/* ---- v6.14.1: حلقه‌ی بافر روی دکمه‌ی پخش ویس/موسیقی (مثل تلگرام) ---- */
.audio-player .pp { position: relative; }
.audio-player .pp.buffering::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; }
.msg.in .audio-player .pp.buffering::after { border-color: rgba(var(--accent-rgb), .25); border-top-color: var(--accent); }
[data-power="on"] .audio-player .pp.buffering::after { animation-duration: 1.3s; }

/* =============================================================================
   v6.15 — پلیر سراسری صوت (نوار بالای گفتگو) + پلیر ویدیوی تلگرامی + پیام ویدیویی
   ============================================================================= */

/* ---- نوار پخش بالای گفتگو (مثل تلگرام) ---- */
.player-bar { position: relative; display: flex; align-items: center; gap: 2px; padding: 5px 8px 7px; background: var(--bg-3); border-bottom: 1px solid var(--border); z-index: 4; flex: 0 0 auto; }
.player-bar .pb-pp { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: none; position: relative; flex: none; }
.player-bar .pb-pp svg { width: 22px; height: 22px; }
.player-bar .pb-pp.buffering::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .25); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.player-bar .pb-nav { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: none; flex: none; }
.player-bar .pb-nav svg { width: 17px; height: 17px; }
.player-bar .pb-nav:disabled { opacity: .35; }
.player-bar .pb-info { flex: 1; min-width: 0; cursor: pointer; padding: 0 6px; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.player-bar .pb-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.player-bar .pb-sub { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar .pb-time { font-size: 11px; color: var(--text-3); flex: none; padding: 0 4px; direction: ltr; }
.player-bar .pb-rate { min-width: 34px; height: 24px; border-radius: 12px; font-size: 11.5px; font-weight: 700; color: var(--text-2); background: var(--glass-2); border: 1px solid var(--border-2); padding: 0 7px; flex: none; }
.player-bar .pb-rate.on { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); background: rgba(var(--accent-rgb), .1); }
.player-bar .pb-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); background: none; flex: none; }
.player-bar .pb-x svg { width: 17px; height: 17px; }
.player-bar .pb-seek { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; cursor: pointer; background: transparent; touch-action: none; }
.player-bar .pb-seek::before { content: ''; position: absolute; inset: -6px 0; }
.player-bar .pb-seek .buf { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; background: rgba(var(--accent-rgb), .2); width: 0; }
.player-bar .pb-seek .fill { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; background: var(--accent); width: 0; }
.player-bar:hover .pb-seek, .player-bar .pb-seek:active { height: 4px; }
[data-anim="on"] .player-bar { animation: slide-down .22s var(--ease); }
html.m-shell .sidebar > .player-bar { border-top: 1px solid var(--border); }

/* ---- پلیر ویدیوی تلگرامی (لایت‌باکس) ---- */
.video-player { position: relative; display: grid; place-items: center; max-width: 100%; max-height: 100%; width: 100%; height: 100%; background: #000; border-radius: 0; overflow: hidden; }
.video-player video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.video-player .vp-big { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.video-player .vp-big span { width: 72px; height: 72px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; backdrop-filter: blur(6px); transition: transform .18s var(--spring); }
.video-player .vp-big:hover span { transform: scale(1.08); }
.video-player .vp-big svg { width: 34px; height: 34px; margin-inline-start: 3px; }
.video-player .vp-spin { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .7s linear infinite; z-index: 3; pointer-events: none; filter: drop-shadow(0 1px 6px rgba(0,0,0,.4)); }
.video-player .vp-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 26px 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,.72)); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.video-player.ctrls .vp-bar, .video-player.paused .vp-bar { opacity: 1; transform: none; pointer-events: auto; }
.video-player .vp-row { display: flex; align-items: center; gap: 4px; direction: ltr; }
.video-player .vp-row .grow { flex: 1; }
.video-player .vp-btn { min-width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: none; padding: 0 6px; }
.video-player .vp-btn:hover { background: rgba(255,255,255,.12); }
.video-player .vp-btn svg { width: 20px; height: 20px; }
.video-player .vp-rate { font-size: 12.5px; font-weight: 700; }
.video-player .vp-rate.on { color: #6cb8ff; }
.video-player .vp-time { color: #fff; font-size: 12.5px; opacity: .9; padding: 0 6px; direction: ltr; }
.video-player .vp-seek { position: relative; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); cursor: pointer; margin-bottom: 8px; touch-action: none; direction: ltr; }
.video-player .vp-seek::before { content: ''; position: absolute; inset: -8px 0; }
.video-player .vp-seek .buf { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: rgba(255,255,255,.35); width: 0; }
.video-player .vp-seek .fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: #fff; width: 0; }
.video-player .vp-seek .knob { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); inset-inline-start: -6px; transform: scale(0); transition: transform .15s; }
.video-player .vp-seek:hover .knob, .video-player .vp-seek:active .knob { transform: scale(1); }
.video-player .vp-skip { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; padding: 14px 20px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 16px; font-weight: 700; pointer-events: none; animation: vp-skip .55s ease both; }
.video-player .vp-skip.l { left: 12%; } .video-player .vp-skip.r { right: 12%; }
@keyframes vp-skip { from { opacity: 0; transform: translateY(-50%) scale(.7); } 30% { opacity: 1; transform: translateY(-50%) scale(1); } to { opacity: 0; transform: translateY(-50%) scale(1.1); } }
.video-player:fullscreen { border-radius: 0; }
[data-power="on"] .video-player .vp-spin { animation-duration: 1.3s; }

/* ---- پیام ویدیویی (دایره‌ای) ---- */
.vnote .vn-mute { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; backdrop-filter: blur(4px); pointer-events: none; transition: opacity .2s; }
.vnote .vn-mute svg { width: 15px; height: 15px; }
.vnote .vn-mute.hidden { opacity: 0; }
.vnote.sound { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .55), var(--shadow-sm); }
.vnote.buffering::before { content: ''; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; z-index: 2; pointer-events: none; }

/* ---- v6.15: اسلایدر صدای پلیر ویدیو (با هاور، مثل تلگرام دسکتاپ) ---- */
.video-player .vp-volwrap { position: relative; display: grid; }
.video-player .vp-vol { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding: 10px 12px 6px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.video-player .vp-volwrap:hover .vp-vol, .video-player .vp-vol:active { opacity: 1; pointer-events: auto; }
.video-player .vp-vol-track { position: relative; width: 4px; height: 64px; border-radius: 4px; background: rgba(255,255,255,.28); overflow: hidden; }
.video-player .vp-vol-track .fill { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; height: 100%; }
@media (pointer: coarse) { .video-player .vp-vol { display: none; } }

/* ===== v6.16.1: عکس پس‌زمینه‌ی پروفایل + افکت‌ها ===== */
.ip-hero, .m-hero { position: relative; overflow: hidden; }
.ip-hero > *, .pc-hero > * { position: relative; z-index: 1; }
/* مهم: این قانون باید بعد از «> *» بیاید تا position:absolute تزئین از بین نرود (باگ v6.16 — پس‌زمینه برای بقیه دیده نمی‌شد) */
.settings-hero > .hero-deco, .m-hero > .hero-deco, .ip-hero > .hero-deco, .pc-hero > .hero-deco { position: absolute; inset: 0; z-index: 0; }
.hero-deco .hd-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
/* پوشش کامل با background-size:cover — بدون هیچ محاسبه‌ی عرض/جهت (رفع باگ نوار خالی کنار عکس در RTL) */
.hero-deco .hd-bg-im { position: absolute; inset: 0; background-position: center; background-size: cover; background-repeat: no-repeat; will-change: transform; }
[data-anim="on"] .hero-deco .hd-bg-im.motion { animation: hd-kenburns 26s ease-in-out infinite alternate; }
@keyframes hd-kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.hero-deco .hd-bg .hd-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, var(--dim, 0)); pointer-events: none; }
/* لایه‌های تزئین روی عکس بمانند */
.hero-deco .hd-glow, .hero-deco .hd-shine, .hero-deco .hd-icons, .hero-deco .hd-ic { z-index: 1; }
/* کنترل‌های دیالوگ */
.pc-bg-btns { display: flex; gap: 8px; }
.pc-bg-btns .btn { flex: 1; justify-content: center; }
.pc-bg-btns .btn.danger { color: var(--danger); }
.pc-range { direction: ltr; width: 130px; accent-color: var(--accent); flex: 0 0 auto; }
