
:root{--bg:#171717;--panel:#212121;--line:#303030;--text:#f2f4f5;--muted:#92999f;--accent:#6387f5;--accent2:#5078ed;--out:#303f69}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;font-family:Vazirmatn,Tahoma,Arial,sans-serif;color:var(--text)}body{background:var(--bg)}button,input,textarea{font:inherit}button{cursor:pointer}.auth-page{display:grid;place-items:center;min-height:100%;padding:20px;background:linear-gradient(135deg,#171d2a,#101010)}.auth-card{width:min(420px,100%);background:#212121;padding:34px;border-radius:22px;box-shadow:0 20px 60px #203b5018;text-align:center}.brand-mark,.brand-mini{display:grid;place-items:center;background:var(--accent);color:#fff;font-weight:800;border-radius:15px}.brand-mark{width:58px;height:58px;margin:auto;font-size:28px}.auth-card h1{font-size:24px;margin:14px 0 2px}.muted{color:var(--muted);margin:0 0 24px}.auth-card form{text-align:right}.auth-card label{display:block;font-size:13px;font-weight:600;margin:14px 0 6px}.auth-card input{width:100%;border:1px solid #dce4ea;border-radius:10px;padding:12px;outline:none}.auth-card input:focus{border-color:var(--accent)}.primary-btn{width:100%;margin-top:22px;border:0;border-radius:10px;background:var(--accent);color:white;padding:12px;font-weight:700}.auth-bottom{margin-top:20px;font-size:13px;color:var(--muted)}a{color:var(--accent);text-decoration:none}.alert{padding:10px;border-radius:9px;background:#fff0f0;color:#b83434;font-size:13px}
.messenger-body{overflow:hidden}.app-shell{height:100dvh;display:flex;direction:rtl;background:#dce4e9;max-width:1600px;margin:auto;box-shadow:0 0 50px #26374612}.sidebar{width:360px;min-width:300px;background:#171717;display:flex;flex-direction:column;border-left:1px solid var(--line);height:100%;z-index:2}.side-header{height:76px;display:flex;align-items:center;gap:12px;padding:0 18px;border-bottom:1px solid var(--line);flex-shrink:0;position:relative}.brand-mini{width:42px;height:42px;font-size:22px}.side-title{display:flex;flex-direction:column;line-height:1.5}.side-title small,.contact-info small,.profile small{font-size:11px;color:var(--muted)}.logout{margin-right:auto;font-size:23px;color:#73818d}.search-wrap{margin:15px 14px 12px;background:#242424;border-radius:14px;display:flex;align-items:center;gap:10px;padding:0 12px;height:42px;flex-shrink:0;color:#91a0ad}.search-wrap span{font-size:26px}.search-wrap input{width:100%;border:0;outline:0;background:transparent;font-size:13px}.section-label{padding:0 18px 9px;color:var(--accent);font-size:12px;font-weight:700}.contact-list{overflow-y:auto;overscroll-behavior:contain;flex:1;min-height:0}.contact{width:100%;border:0;background:#171717;display:flex;align-items:center;gap:12px;padding:14px 16px;text-align:right;border-top:1px solid #292929;transition:background .15s}.contact:hover,.contact.active{background:#242833}.avatar{width:47px;height:47px;min-width:47px;border-radius:50%;display:grid;place-items:center;background:#303b57;color:#91aaff;font-weight:700;font-size:18px}.contact-info{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}.contact-info strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.online-dot{width:8px;height:8px;border-radius:50%;background:#27b58e}.empty-list{padding:20px;color:var(--muted);font-size:13px;text-align:center}.profile{display:flex;align-items:center;gap:11px;padding:14px 16px;border-top:1px solid var(--line);flex-shrink:0}.profile>span:last-child{display:flex;flex-direction:column}.profile strong{font-size:13px}.me-avatar{width:40px;height:40px;min-width:40px;background:#e8e1f7;color:#7861b3}
.chat-area{flex:1;min-width:0;height:100%;position:relative;background:#101010;background-image:radial-gradient(#ffffff08 1px,transparent 1px);background-size:20px 20px}.welcome{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:25px}.welcome-icon{width:92px;height:92px;display:grid;place-items:center;border-radius:50%;background:#d7e8e8;color:var(--accent);font-size:42px}.welcome h2{margin:20px 0 5px;font-size:23px}.welcome p{color:#788b99;font-size:14px}.welcome-pills{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:14px}.welcome-pills span{font-size:11px;color:#68817f;background:#ffffffb8;padding:7px 10px;border-radius:20px}.conversation{height:100%;display:flex;flex-direction:column;min-height:0}.hidden{display:none!important}.chat-header{height:76px;display:flex;align-items:center;gap:12px;padding:0 22px;background:#1c1c1c;border-bottom:1px solid var(--line);flex-shrink:0}.chat-header .avatar{width:43px;height:43px;min-width:43px}.chat-heading{display:flex;flex-direction:column;gap:3px}.chat-heading strong{font-size:14px}.chat-heading small{font-size:11px;color:var(--muted)}.header-actions{margin-right:auto;color:#84949e}.messages{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:22px clamp(14px,4vw,56px);display:flex;flex-direction:column;gap:9px;overscroll-behavior:contain;scrollbar-width:none}.messages::-webkit-scrollbar,.contact-list::-webkit-scrollbar{display:none}.message{max-width:min(72%,620px);padding:10px 13px 6px;border-radius:13px;box-shadow:0 1px 1px #1833450b;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.75;font-size:14px;position:relative}.message.in{align-self:flex-start;background:#292929;border-top-right-radius:4px}.message.out{align-self:flex-end;background:var(--out);border-top-left-radius:4px}.message-meta{display:flex;align-items:center;justify-content:flex-end;gap:5px;color:#84958d;font-size:10px;margin-top:2px}.message-loading,.no-messages{align-self:center;margin:auto;color:#81929d;font-size:13px;background:#ffffffc9;padding:10px 16px;border-radius:18px}.composer{display:flex;align-items:flex-end;gap:12px;padding:14px clamp(12px,3vw,32px);background:#1c1c1c;border-top:1px solid var(--line);flex-shrink:0}.composer textarea{resize:none;max-height:140px;min-height:45px;flex:1;border:0;outline:0;border-radius:13px;background:#292929;color:#f2f4f5;padding:12px 15px;line-height:1.5;box-shadow:0 1px 3px #2037470a;overflow-y:auto}.composer button{width:45px;height:45px;flex-shrink:0;border:0;border-radius:50%;background:var(--accent);color:#fff;font-size:22px;transform:rotate(180deg)}.composer button:disabled{opacity:.5}.mobile-back{display:none;border:0;background:transparent;font-size:30px;color:#647582}
@media(max-width:720px){.sidebar{width:100%;min-width:0;border-left:0}.chat-area{display:none}.app-shell.mobile-chat-open .sidebar{display:none}.app-shell.mobile-chat-open .chat-area{display:block;width:100%}.mobile-back{display:block}.chat-header{padding:0 12px}.message{max-width:88%}.messages{padding:16px 12px}.composer{padding:10px}.welcome h2{font-size:20px}.side-header{height:68px}}

/* ویراکسا: صفحه جستجوی مستقل با تم تیره و چیدمان موبایلی */
.search-entry{color:#9aa0a6;text-decoration:none;cursor:pointer}
.search-entry .search-placeholder{font-size:14px;color:#9aa0a6}
.search-page{margin:0;min-height:100dvh;background:#171717;color:#f4f4f5;font-family:inherit}
.search-screen{max-width:820px;min-height:100dvh;margin:0 auto;background:#171717;display:flex;flex-direction:column}
.search-page-header{height:70px;display:flex;align-items:center;gap:18px;padding:0 18px;border-bottom:1px solid #2a2a2a;flex-shrink:0}
.search-back{font-size:34px;line-height:1;color:#aab2ba;text-decoration:none;width:30px;text-align:center}
.search-page-title{font-size:20px;font-weight:800;letter-spacing:.1px}
.search-page-title:after{content:'  ویراکسا';font-size:12px;font-weight:500;color:#6387f5;margin-right:8px}
.search-page-input-wrap{height:50px;margin:16px 16px 12px;display:flex;align-items:center;gap:10px;padding:0 15px;border-radius:15px;background:#242424;color:#a0a8b0;border:1px solid #2c2c2c}
.search-page-input-wrap>span{font-size:27px;line-height:1}
.search-page-input-wrap input{min-width:0;flex:1;border:0;outline:0;background:transparent;font:inherit;font-size:15px;color:#f4f4f5}
.search-page-input-wrap input::placeholder{color:#969da5}
.search-page-input-wrap input::-webkit-search-cancel-button{display:none}
.search-clear{border:0;background:transparent;font-size:24px;color:#a0a8b0;padding:0 3px}
.search-section{padding-top:8px}
.search-section-heading{display:flex;align-items:center;justify-content:space-between;padding:10px 20px;color:#aab1b8;font-size:13px}
.search-section-heading button{border:0;background:transparent;color:#819dff;font:inherit}
.search-results{display:flex;flex-direction:column}
.search-result{width:100%;display:flex;align-items:center;gap:13px;padding:13px 18px;border:0;border-top:1px solid #292929;background:#171717;color:inherit;text-align:right;text-decoration:none;cursor:pointer;min-height:76px}
.search-result:hover{background:#202020}
.search-result .avatar{flex-shrink:0;width:50px;height:50px;min-width:50px;background:#303b57;color:#a8baff}
.search-result-info{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}
.search-result-info strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.search-result-info small{font-size:12px;color:#90979e;direction:ltr;text-align:right}
.search-result-arrow{font-size:22px;color:#7f8b96}
.search-status{padding:26px 18px;text-align:center;font-size:13px;color:#8d969f}
.search-empty{padding:22px 18px;text-align:center;font-size:13px;color:#8d969f}
@media(min-width:721px){.search-screen{min-height:calc(100dvh - 32px);margin:16px auto;border:1px solid #2b2b2b;border-radius:16px;overflow:hidden}}


/* Fix: keep chat header and composer fixed while only messages scroll */
html, body.messenger-body { height:100%; min-height:100%; overflow:hidden; }
.app-shell { height:100dvh; min-height:0; overflow:hidden; }
.chat-area { height:100%; min-height:0; overflow:hidden; }
.conversation { height:100%; min-height:0; max-height:100%; overflow:hidden; }
.chat-header { flex:0 0 76px; position:relative; z-index:3; }
.messages { flex:1 1 auto; min-height:0; height:0; overflow-y:auto; overscroll-behavior:contain; }
.composer { flex:0 0 auto; position:relative; z-index:3; padding-bottom:max(10px, env(safe-area-inset-bottom)); }
.contact-info strong,
.chat-heading strong,
.profile strong,
.search-result-info strong,
.side-title strong { color:#fff !important; }
@media(max-width:720px) {
  .app-shell.mobile-chat-open .chat-area { height:100dvh; min-height:0; overflow:hidden; }
  .app-shell.mobile-chat-open .conversation { height:100dvh; }
  .app-shell.mobile-chat-open .chat-header { flex-basis:68px; }
  .app-shell.mobile-chat-open .messages { min-height:0; height:0; }
  .app-shell.mobile-chat-open .composer { flex-shrink:0; }
}


/* Viraksa: pin message composer to the bottom of the conversation */
.conversation { position:relative; }
.messages { padding-bottom:110px; }
.composer { position:absolute; left:0; right:0; bottom:0; width:100%; z-index:10; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
@media(max-width:720px) {
  .app-shell.mobile-chat-open .chat-area { position:fixed; inset:0; width:100%; height:100dvh; }
  .app-shell.mobile-chat-open .conversation { position:relative; height:100%; min-height:0; }
  .app-shell.mobile-chat-open .messages { height:auto; flex:1 1 auto; min-height:0; padding-bottom:105px; }
  .app-shell.mobile-chat-open .composer { position:absolute; left:0; right:0; bottom:0; padding-bottom:max(12px, env(safe-area-inset-bottom)); }
}

/* Account menu, public profiles, and desktop/browser responsive polish */
.sidebar{position:relative;min-width:280px}
.menu-toggle{border:0;background:transparent;color:var(--text);font-size:25px;width:42px;height:42px;border-radius:12px;display:grid;place-items:center}
.menu-toggle:hover{background:#ffffff12}
.account-menu{position:absolute;z-index:50;top:66px;left:14px;width:230px;padding:8px;background:#252525;border:1px solid #393939;border-radius:15px;box-shadow:0 16px 42px #0008}
.account-menu a{display:block;color:var(--text);text-decoration:none;padding:12px;border-radius:9px;font-size:14px}
.account-menu a:hover{background:#ffffff12}.account-menu .menu-logout{color:#ff8b8b;border-top:1px solid #393939}
.hidden{display:none!important}
.profile{color:inherit;text-decoration:none;cursor:pointer;border-radius:12px}.profile:hover{background:#ffffff0c}
.chat-profile-link{color:inherit;text-decoration:none}.chat-profile-link:hover{text-decoration:underline}
.profile-page{min-height:100%;padding:28px 16px;background:var(--bg);display:flex;justify-content:center;align-items:flex-start}
.profile-card{width:min(680px,100%);background:var(--panel);border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:0 18px 55px #0002}
.profile-top{height:65px;display:flex;align-items:center;gap:18px;padding:0 22px;border-bottom:1px solid var(--line)}
.profile-top strong{font-size:18px;flex:1}.profile-back,.profile-menu-link{color:var(--text);text-decoration:none}.profile-back{font-size:30px}.profile-menu-link{font-size:13px;color:var(--muted)}
.profile-hero{text-align:center;padding:30px 20px 22px;border-bottom:1px solid var(--line)}
.profile-big-avatar{margin:auto;width:96px;height:96px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(135deg,#6688f7,#8b5cf6);font-size:40px;font-weight:700;color:white}
.profile-hero h1{font-size:24px;margin:14px 0 3px}.profile-hero p{margin:0;color:var(--muted)}.profile-id{display:inline-block;margin-top:12px;color:var(--muted);font-size:12px}
.profile-form,.profile-details{padding:24px;display:grid;gap:16px}.profile-form label{display:grid;gap:8px;color:#d8dce2;font-size:14px}
.profile-form input,.profile-form textarea{width:100%;padding:12px 14px;border:1px solid #414141;border-radius:11px;background:#171717;color:var(--text);outline:none;resize:vertical}
.profile-form input:focus,.profile-form textarea:focus{border-color:var(--accent)}
.profile-form .primary-btn,.profile-message{display:block;text-align:center;text-decoration:none;background:var(--accent);color:white;border:0;border-radius:11px;padding:13px 16px;cursor:pointer}
.profile-details{line-height:1.9}.profile-details h3{margin:0}.profile-details p{margin:0;overflow-wrap:anywhere}.profile-details a{color:#91aaff;overflow-wrap:anywhere}
.profile-success,.profile-error{margin:16px 24px 0;padding:12px;border-radius:10px}.profile-success{background:#174a35;color:#b8f7d4}.profile-error{background:#5b2424;color:#ffd0d0}
@media(min-width:1100px){.app-shell{max-width:1600px;margin:0 auto;height:100dvh}.sidebar{width:360px;flex-shrink:0}.chat-area{min-width:0}.messages{padding:24px clamp(18px,4vw,70px)}.composer{padding:18px clamp(18px,4vw,70px)}}
@media(max-width:700px){.profile-page{padding:0}.profile-card{min-height:100dvh;border-radius:0;border:0}.profile-form,.profile-details{padding:20px}.sidebar{min-width:0}.account-menu{left:10px;top:60px}}

/* اصلاحات منو و پروفایل: آیکن منو در سمت چپ و اسکرول مستقل */
.side-header .menu-toggle{position:absolute;left:18px;right:auto;z-index:52;margin:0}
.account-menu{left:12px;right:auto;top:64px}
.profile-page{height:auto;min-height:100vh;min-height:100dvh;display:block;overflow-x:hidden;overflow-y:auto;padding:20px 14px 40px;overscroll-behavior-y:contain}
.profile-card{margin:0 auto;overflow:visible}
.profile-hero{overflow-wrap:anywhere}
.profile-big-avatar{overflow:hidden}
.profile-big-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.profile-form{padding-bottom:36px}
.profile-form input[type=file]{padding:10px;font-size:13px}
.field-help{color:var(--muted);font-size:12px}
.public-avatar{width:90px;height:90px;border-radius:50%;object-fit:cover;display:block;margin:8px auto 14px}
html:has(.profile-page),body.profile-page{height:auto;min-height:100%;}
@media(max-width:700px){.profile-page{padding:0 0 28px;display:block;min-height:100dvh}.profile-card{min-height:100dvh;border-radius:0;border:0;overflow:visible}.profile-form,.profile-details{padding:20px 18px 34px}.profile-hero{padding:28px 18px 24px}.profile-top{position:sticky;top:0;z-index:5;background:var(--panel)}}


/* Reliable mobile profile scrolling */
html:has(body.profile-page) { height:auto !important; min-height:100%; overflow-x:hidden; overflow-y:auto !important; }
body.profile-page { display:block !important; height:auto !important; min-height:100dvh; overflow-x:hidden !important; overflow-y:visible !important; padding-bottom:calc(40px + env(safe-area-inset-bottom)); touch-action:pan-y; -webkit-overflow-scrolling:touch; }
body.profile-page .profile-card { height:auto; min-height:100dvh; overflow:visible !important; }
body.profile-page .profile-form { padding-bottom:calc(56px + env(safe-area-inset-bottom)); }
.contact-presence { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; min-width:22px; }
.online-dot { display:inline-block; width:9px; height:9px; border-radius:50%; background:#737b84; flex:0 0 auto; }
.online-dot.is-online { background:#27b58e; box-shadow:0 0 0 3px #27b58e20; }
.contact-status { font-size:10px; color:var(--muted); white-space:nowrap; }
.unread-badge { min-width:21px; height:21px; padding:0 6px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; background:var(--accent); color:white; font-size:11px; font-weight:700; }
.unread-badge[hidden] { display:none !important; }
.contact.has-unread .contact-info strong { font-weight:800; }
.contact.has-unread .contact-info small { color:#d6dcff; }
.avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }


/* Viraxa mobile contact-list scrolling fix (2026-10) */
html, body.messenger-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
}
body.messenger-body { position: fixed; inset: 0; }
.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  flex: 0 0 360px;
}
.contact-list {
  display: block;
  flex: 1 1 0%;
  height: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
}
@media (max-width: 720px) {
  .app-shell { display: flex; height: 100vh; height: 100dvh; }
  .sidebar { width: 100%; min-width: 0; flex: 0 0 100%; }
  .contact-list { flex: 1 1 0%; height: 0; min-height: 0; overflow-y: scroll !important; }
  .app-shell.mobile-chat-open .sidebar { display: none; }
  .app-shell.mobile-chat-open .chat-area { display: block; width: 100%; height: 100%; }
}

/* اصلاح نمایش عکس مخاطب در سربرگ گفتگوی خصوصی و تیک خوانده‌شدن */
.chat-header .avatar{overflow:hidden;flex-shrink:0}
.chat-header .avatar img,.avatar img{width:100%;height:100%;display:block;object-fit:cover;border-radius:50%}
.message-receipt{font-size:13px;letter-spacing:-4px;padding-left:3px;color:#84958d;direction:ltr;white-space:nowrap}
.message-receipt.is-read{color:#55aaff}


/* Viraxa fixes: reliable full-page scrolling on mobile profile pages */
html:has(body.profile-page) {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
body.profile-page {
  position: relative !important;
  display: block !important;
  width: 100%;
  height: auto !important;
  min-height: 100dvh;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  padding-bottom: calc(56px + env(safe-area-inset-bottom)) !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
body.profile-page .profile-card {
  height: auto !important;
  min-height: 100dvh;
  overflow: visible !important;
}
body.profile-page .profile-form,
body.profile-page .profile-details {
  padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important;
}


/* 2026-10 mobile profile scroll + live chat preview/typing */
html:has(body.profile-page), html:has(body.profile-page) body { height:auto !important; min-height:100% !important; overflow-x:hidden !important; overflow-y:auto !important; }
body.profile-page { position:static !important; display:block !important; height:auto !important; min-height:100dvh !important; overflow-x:hidden !important; overflow-y:auto !important; padding-bottom:calc(90px + env(safe-area-inset-bottom)) !important; touch-action:pan-y; -webkit-overflow-scrolling:touch; }
body.profile-page .profile-card { height:auto !important; min-height:100dvh; overflow:visible !important; }
body.profile-page .profile-form { padding-bottom:calc(100px + env(safe-area-inset-bottom)) !important; }
.contact-preview { display:block; max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px !important; color:var(--muted); }
.contact-preview.is-typing { color:#75d7b0 !important; font-weight:700; }


/* Message actions, replies and correct left/right conversation layout */
.messages{direction:ltr}
.message{direction:rtl;text-align:right}
.message.in{align-self:flex-start}
.message.out{align-self:flex-end}
.message-body{white-space:pre-wrap;overflow-wrap:anywhere}
.reply-quote{display:flex;flex-direction:column;gap:2px;width:100%;text-align:right;border:0;border-right:3px solid var(--accent);background:#00000018;color:inherit;padding:5px 8px;margin:0 0 7px;border-radius:5px;cursor:pointer;font:inherit}
.reply-quote b{font-size:11px;color:#75aaff}.reply-quote span{font-size:12px;opacity:.82;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.reply-preview{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 18px;background:#202020;border-top:1px solid #343434;border-right:3px solid var(--accent);flex-shrink:0}
.reply-preview>div{display:flex;flex-direction:column;gap:3px;min-width:0}.reply-preview strong{font-size:12px;color:#75aaff}.reply-preview small{font-size:12px;color:#c5c5c5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reply-preview button{border:0;background:transparent;color:#ddd;font-size:26px;line-height:1;padding:2px 8px;cursor:pointer}.edit-preview strong{color:#e6bd62}
.message-actions{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;padding-top:7px;border-top:1px solid #ffffff22}
.message-actions button{border:1px solid #ffffff24;background:#171717;color:#f1f1f1;border-radius:8px;padding:6px 9px;font-size:11px;cursor:pointer}.message-actions button.danger{color:#ff8989}
.reply-swipe{outline:2px solid #6c91ff;outline-offset:2px;transition:outline .2s}.edited-label{font-size:10px;color:#a9b4bf}
@media(max-width:720px){.reply-preview{padding:7px 12px}.message-actions button{padding:7px 10px}}

/* Telegram-inspired message context menu and delete confirmation */
.message-menu-backdrop,.delete-dialog-backdrop{position:fixed;inset:0;z-index:9998;background:rgba(0,0,0,.42);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
.message-menu{position:fixed;z-index:9999;max-width:calc(100vw - 28px);max-height:calc(100dvh - 24px);overflow-y:auto;background:#242424;color:#f4f4f5;border:1px solid #ffffff12;border-radius:16px;padding:8px;box-shadow:0 12px 38px #0008;direction:rtl;animation:viraxMenuIn .13s ease-out}
@keyframes viraxMenuIn{from{opacity:0;transform:translateY(5px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
.message-reactions{display:flex;align-items:center;justify-content:space-between;gap:2px;padding:3px 2px 9px;border-bottom:1px solid #ffffff15;margin-bottom:5px}
.message-reactions button{border:0;background:transparent;border-radius:50%;width:36px;height:38px;font-size:23px;cursor:pointer;transition:background .15s,transform .15s}
.message-reactions button:active{background:#ffffff18;transform:scale(1.12)}
.message-menu-actions{display:flex;flex-direction:column;gap:1px}
.message-menu-actions button{width:100%;min-height:46px;display:flex;align-items:center;gap:15px;padding:8px 12px;border:0;border-radius:9px;background:transparent;color:#f2f2f2;text-align:right;font:inherit;font-size:14px;cursor:pointer}
.message-menu-actions button:active{background:#ffffff12}
.menu-action-icon{width:25px;text-align:center;font-size:22px;color:#d2d6df;line-height:1}
.message-menu-actions button.danger,.message-menu-actions button.danger .menu-action-icon{color:#ff747e}
.delete-dialog-backdrop{z-index:10000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.62)}
.delete-dialog{width:min(100%,420px);background:#242424;color:#f5f5f5;border-radius:25px;padding:23px 22px 16px;box-shadow:0 18px 60px #0009;direction:rtl;animation:viraxMenuIn .14s ease-out}
.delete-dialog h3{font-size:21px;font-weight:700;margin:0 0 14px}.delete-dialog p{font-size:15px;line-height:1.8;color:#e0e0e0;margin:0 0 20px;overflow-wrap:anywhere}.delete-for-both{display:flex;align-items:center;gap:12px;min-height:48px;margin:0 0 15px;font-size:14px;cursor:pointer}.delete-for-both input{width:19px;height:19px;accent-color:#6b8cff;flex-shrink:0}.delete-dialog-actions{display:flex;justify-content:flex-start;gap:10px;margin-top:12px}.delete-dialog-actions button{border:0;background:transparent;border-radius:10px;padding:10px 17px;font:inherit;font-size:14px;font-weight:600;cursor:pointer}.cancel-delete{color:#8eafff}.confirm-delete{color:#ff747e}.delete-dialog-actions button:disabled{opacity:.55}.delete-dialog .dialog-error{color:#ff9a9a}
@media(max-width:520px){.message-menu{border-radius:15px}.message-menu-actions button{min-height:48px;font-size:15px}.delete-dialog{border-radius:24px;padding:22px 20px 15px}}

/* Telegram-inspired message context menu and delete confirmation */
.message-menu-backdrop,.delete-dialog-backdrop{position:fixed;inset:0;z-index:9998;background:rgba(0,0,0,.42);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
.message-menu{position:fixed;z-index:9999;max-width:calc(100vw - 28px);max-height:calc(100dvh - 24px);overflow-y:auto;background:#242424;color:#f4f4f5;border:1px solid #ffffff12;border-radius:16px;padding:8px;box-shadow:0 12px 38px #0008;direction:rtl;animation:viraxMenuIn .13s ease-out}
@keyframes viraxMenuIn{from{opacity:0;transform:translateY(5px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
.message-reactions{display:flex;align-items:center;justify-content:space-between;gap:2px;padding:3px 2px 9px;border-bottom:1px solid #ffffff15;margin-bottom:5px}
.message-reactions button{border:0;background:transparent;border-radius:50%;width:36px;height:38px;font-size:23px;cursor:pointer;transition:background .15s,transform .15s}
.message-reactions button:active{background:#ffffff18;transform:scale(1.12)}
.message-menu-actions{display:flex;flex-direction:column;gap:1px}
.message-menu-actions button{width:100%;min-height:46px;display:flex;align-items:center;gap:15px;padding:8px 12px;border:0;border-radius:9px;background:transparent;color:#f2f2f2;text-align:right;font:inherit;font-size:14px;cursor:pointer}
.message-menu-actions button:active{background:#ffffff12}
.menu-action-icon{width:25px;text-align:center;font-size:22px;color:#d2d6df;line-height:1}
.message-menu-actions button.danger,.message-menu-actions button.danger .menu-action-icon{color:#ff747e}
.delete-dialog-backdrop{z-index:10000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.62)}
.delete-dialog{width:min(100%,420px);background:#242424;color:#f5f5f5;border-radius:25px;padding:23px 22px 16px;box-shadow:0 18px 60px #0009;direction:rtl;animation:viraxMenuIn .14s ease-out}
.delete-dialog h3{font-size:21px;font-weight:700;margin:0 0 14px}.delete-dialog p{font-size:15px;line-height:1.8;color:#e0e0e0;margin:0 0 20px;overflow-wrap:anywhere}.delete-for-both{display:flex;align-items:center;gap:12px;min-height:48px;margin:0 0 15px;font-size:14px;cursor:pointer}.delete-for-both input{width:19px;height:19px;accent-color:#6b8cff;flex-shrink:0}.delete-dialog-actions{display:flex;justify-content:flex-start;gap:10px;margin-top:12px}.delete-dialog-actions button{border:0;background:transparent;border-radius:10px;padding:10px 17px;font:inherit;font-size:14px;font-weight:600;cursor:pointer}.cancel-delete{color:#8eafff}.confirm-delete{color:#ff747e}.delete-dialog-actions button:disabled{opacity:.55}.delete-dialog .dialog-error{color:#ff9a9a}
@media(max-width:520px){.message-menu{border-radius:15px}.message-menu-actions button{min-height:48px;font-size:15px}.delete-dialog{border-radius:24px;padding:22px 20px 15px}}

/* Telegram-style persistent message reactions and emoji picker */
.message-reaction-chips{display:none;flex-wrap:wrap;align-items:center;gap:4px;margin:5px 0 0;direction:ltr}
.message-reaction-chips.has-reactions{display:flex}
.reaction-chip{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:27px;padding:2px 8px;border:1px solid #ffffff22;border-radius:14px;background:#202b40;color:#f3f6ff;font-size:13px;line-height:1;box-shadow:0 1px 2px #0002}
.reaction-chip .reaction-emoji{font-size:16px}
.reaction-chip .reaction-count{font-size:11px;color:#d9e3ff;font-weight:600}
.reaction-chip.is-mine{background:#344d86;border-color:#83a5ff;box-shadow:inset 0 0 0 1px #83a5ff55}
.message-reactions{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
.message-reactions::-webkit-scrollbar{display:none}
.message-reactions button{flex:0 0 34px}
.message-reactions .more-reactions{font-size:22px;color:#c7d2e8;background:#343434;width:31px;height:31px}
.reaction-picker-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;padding:8px 2px;max-height:220px;overflow:auto;border-bottom:1px solid #ffffff15;margin-bottom:5px}
.reaction-picker-grid button{border:0;border-radius:8px;background:transparent;font-size:23px;min-width:0;min-height:35px;padding:3px}
.reaction-picker-grid button:active{background:#ffffff20}
.message-menu{min-width:230px}

/* Telegram-style attachments */
.attach-btn{border:0;background:transparent;color:#aeb8c5;font-size:23px;padding:5px 9px;flex-shrink:0}
.attach-btn:hover{color:#fff}.attach-btn:disabled{opacity:.5}
.attachment-image{display:block;max-width:min(340px,65vw);margin-bottom:6px}
.attachment-image img{display:block;max-width:100%;max-height:360px;object-fit:contain;border-radius:12px}
.attachment-file{display:inline-flex;align-items:center;gap:7px;max-width:100%;overflow-wrap:anywhere;padding:8px 10px;border-radius:10px;background:#ffffff12;color:#d8e5ff;text-decoration:none}

/* VIRAXA attachment media */
.attachment-video{display:block;width:min(100%,420px);max-height:420px;border-radius:12px;background:#000;margin:5px 0;object-fit:contain}
.attachment-audio{display:block;width:min(100%,360px);margin:6px 0}
.attachment-image img{display:block;max-width:min(100%,360px);max-height:360px;object-fit:contain;border-radius:12px}
