/* ============================================================
   سكربت دردشتي — تنسيق كامل بدون أي مكتبات CSS (بدون RTL)
   ============================================================ */
:root {
    --bg:        #eef0f5;
    --card:      #ffffff;
    --card2:     #f3f4f8;
    --txt:       #1c1e26;
    --text:      #1c1e26;
    --muted:     #8a8f9c;
    --blue:      #1877f2;
    --primary:   #1877f2;
    --blue-dark: #0d5bd9;
    --orange:    #0ea5e9;
    --red:       #e23b3b;
    --green:     #22c55e;
    --gold:      #f2a900;
    --diamond:   #4fc3f7;
    --vip:       #8b7cf6;
    --premium:   #22b14c;
    --pink:      #ff3da6;
    --border:    #e4e6ef;
    --radius:    16px;
    --shadow:    0 2px 10px rgba(20, 30, 60, .07);
    --topbar-h:  54px;
    --nav-h:     54px;
    --side-w:    300px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
    font-family: 'Tajawal', "Segoe UI", Tahoma, "Arial", sans-serif;
    background: var(--bg);
    color: var(--txt);
    overflow: hidden;
}
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input { font-family: inherit; border: 0; outline: none; background: none; color: inherit; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.flex-sp { flex: 1; }
.blue-txt { color: var(--blue); }
.desk-only { display: none !important; }

#root { height: 100dvh; overflow: hidden; }
#app { height: 100%; display: flex; flex-direction: column; position: relative; max-width: 760px; margin: 0 auto; background: var(--bg); box-shadow: 0 0 30px rgba(0,0,0,.12); }

/* ============ شاشات ============ */
/* الـ padding-bottom فقط عند وجود bottomNav (داخل الدردشة) */
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-bottom: 0; }
#view-chat    { padding-bottom: var(--nav-h); }
#view-rooms   { padding-bottom: var(--nav-h); }
#view-menu    { padding-bottom: var(--nav-h); }
#view-pm-chat { padding-bottom: var(--nav-h); }

/* ============ تبويبات ============ */
.seg-tabs { display: flex; background: #e2e4ec; border-radius: 12px; padding: 4px; gap: 4px; }
.seg-tabs.big { margin: 12px 14px; }
.seg-tabs.inset { margin: 10px 12px; }
.seg-tab {
    flex: 1; padding: 10px 6px; border-radius: 9px; font-size: 15px; font-weight: 700;
    color: #555a68; transition: .15s;
}
.seg-tab.active { background: #fff; color: var(--txt); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.seg-tab.voice { background: linear-gradient(90deg, #7f9cf5, #5b8def); color: #fff; opacity: .82; }
.seg-tab.voice.active { opacity: 1; box-shadow: 0 2px 8px rgba(91,141,239,.45); }

/* ============ صفحة تسجيل الدخول ============ */
/* ═══════════ صفحة الدخول الجديدة ═══════════ */
/* ══════════════════════════════════════════
   صفحة الدخول — ثيم فاتح
══════════════════════════════════════════ */
.login-root {
    position: fixed; inset: 0; display: flex;
    align-items: center; justify-content: center;
    overflow: hidden; background: #f0f4ff; direction: rtl;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.login-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: orbFloat 9s ease-in-out infinite; }
.login-orb-1 { width: 500px; height: 500px; background: radial-gradient(circle,#bfdbfe,transparent); top: -180px; right: -120px; }
.login-orb-2 { width: 380px; height: 380px; background: radial-gradient(circle,#ddd6fe,transparent); bottom: -80px; left: -80px; animation-delay: -3s; }
.login-orb-3 { width: 260px; height: 260px; background: radial-gradient(circle,#bae6fd,transparent); bottom: 25%; right: 18%; animation-delay: -6s; }
@keyframes orbFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-26px) scale(1.04); } }
.login-particles { position: absolute; inset: 0; overflow: hidden; }
.login-particles span { position: absolute; bottom: -20px; border-radius: 50%; background: rgba(24,119,242,.12); animation: particleRise linear infinite; }
@keyframes particleRise { 0%{transform:translateY(0);opacity:0} 10%{opacity:1} 90%{opacity:.4} 100%{transform:translateY(-100vh);opacity:0} }

.login-card-wrap { position: relative; z-index: 2; width: 100%; max-width: 420px; padding: 20px 16px; }
.login-card {
    background: #fff; border-radius: 28px; padding: 28px 24px;
    box-shadow: 0 8px 40px rgba(24,119,242,.12), 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid rgba(24,119,242,.1);
}

/* الشعار والعنوان */
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo-ring {
    width: 76px; height: 76px; border-radius: 22px;
    background: linear-gradient(135deg,#1877f2,#0ea5e9);
    display: grid; place-items: center; margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(24,119,242,.3);
}
.login-logo-ring img { width: 46px; height: 46px; }
.login-site-name { font-size: 24px; font-weight: 900; color: #0f172a; margin-bottom: 4px; }
.login-tagline { color: #64748b; font-size: 13.5px; }

/* التبويبات */
.login-tabs {
    display: flex; position: relative;
    background: #f1f5f9; border-radius: 16px;
    padding: 4px; margin-bottom: 22px;
}
.login-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 10px 6px; border: none; background: none;
    color: #94a3b8; cursor: pointer; border-radius: 12px;
    font-size: 12px; font-weight: 700; position: relative; z-index: 1;
    transition: color .2s; font-family: inherit;
}
.login-tab.active { color: #1877f2; }
.login-tab i { font-size: 15px; }
.login-tab-slider {
    position: absolute; top: 4px; bottom: 4px;
    background: #fff; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: left .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1);
    pointer-events: none; z-index: 0;
}

/* الحقول */
.login-form { display: flex; flex-direction: column; gap: 11px; }
.lf-field {
    display: flex; align-items: center; gap: 10px;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 14px; padding: 12px 14px; transition: border-color .2s;
}
.lf-field:focus-within { border-color: #1877f2; background: #eff6ff; }
.lf-ic { color: #94a3b8; flex: none; font-size: 14px; }
.lf-field input { flex: 1; background: none; border: none; outline: none; color: #0f172a; font-size: 15px; font-family: inherit; }
.lf-field input::placeholder { color: #94a3b8; }
.lf-eye { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 0 2px; font-size: 14px; flex: none; transition: color .15s; }
.lf-eye:hover { color: #1877f2; }

/* الجنس */
.lf-gender { display: flex; gap: 10px; }
.lf-gender-opt { flex: 1; cursor: pointer; }
.lf-gender-opt input { display: none; }
.lf-gender-opt span {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 11px; border-radius: 13px;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    color: #64748b; font-weight: 700; font-size: 14px; transition: all .2s;
}
.lf-gender-opt input:checked + span { background: #eff6ff; border-color: #1877f2; color: #1877f2; }

/* زر الإرسال */
.lf-submit {
    width: 100%; padding: 14px; border: none; border-radius: 14px;
    background: linear-gradient(135deg,#1877f2,#0ea5e9); color: #fff;
    font-size: 16px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; box-shadow: 0 6px 20px rgba(24,119,242,.35);
    transition: transform .15s, box-shadow .15s; margin-top: 2px;
}
.lf-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(24,119,242,.45); }
.lf-submit:active { transform: translateY(0); }

/* رسالة الخطأ */
.lf-error {
    display: flex; align-items: center; gap: 8px;
    background: #fef2f2; border: 1px solid #fecaca;
    color: #dc2626; padding: 10px 13px; border-radius: 12px;
    font-size: 14px; margin-top: 8px;
}
.lf-error.hidden { display: none; }

/* الإحصائيات */
.login-stats {
    display: flex; align-items: center; justify-content: center;
    margin-top: 20px; background: #f8fafc; border-radius: 14px;
    padding: 12px 20px; border: 1px solid #e2e8f0;
}
.ls-item { flex: 1; text-align: center; }
.ls-item b { display: block; font-size: 19px; font-weight: 900; color: #1877f2; }
.ls-item span { font-size: 11px; color: #94a3b8; font-weight: 600; }
.ls-sep { width: 1px; height: 30px; background: #e2e8f0; flex: none; }

.btn-block{width:100%}
.field{display:flex;align-items:center;gap:10px;background:var(--card2);border-radius:13px;padding:13px 14px}
.field i{color:var(--muted)}
.field input{flex:1;font-size:16px}
.gender-row{display:flex;gap:10px}
.gender-opt{flex:1}
.gender-opt input{display:none}
.gender-opt span{display:block;padding:11px;border-radius:12px;background:var(--card2);font-weight:700;color:#555}
.gender-opt input:checked+span{background:#e3edff;color:var(--blue);outline:2px solid var(--blue)}
.login-error{color:var(--red);font-size:14px;margin-top:10px;min-height:18px}

/* ============ أزرار ============ */
.btn-primary {
    background: var(--blue); color: #fff; font-weight: 800; font-size: 16px;
    padding: 13px 26px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { background: var(--blue-dark); }
.btn-primary.sm { padding: 9px 20px; font-size: 14px; border-radius: 10px; }
.btn-ghost { background: #e3e5ec; color: var(--txt); font-weight: 800; font-size: 16px; padding: 13px 30px; border-radius: 13px; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--blue); border-radius: 12px; position: relative; }
.link-btn { color: var(--blue); font-size: 16px; font-weight: 600; }

.badge {
    position: absolute; top: 3px; right: 1px; background: var(--red); color: #fff;
    font-size: 10px; min-width: 17px; height: 17px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px; font-style: normal;
}

/* ============ ترويسة الغرف ============ */
.rooms-header {
    display: flex; align-items: center; gap: 8px;
    background: var(--card2); padding: 10px 14px; border-bottom: 1px solid #dfe2ea;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 800; }
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.user-pill { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 5px 6px 5px 12px; box-shadow: var(--shadow); color: var(--blue); font-size: 15px; }
.user-pill img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; order: 2; }

.rooms-body { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.search-pill { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 11px 18px; margin: 12px 14px 0; box-shadow: inset 0 0 0 1px #e6e8ef; }
.search-pill input { flex: 1; width: 100%; font-size: 15px; min-width: 0; }
.search-pill input::placeholder { color: #b6bac4; }
.search-pill.grow { flex: 1; margin: 0; padding: 9px 14px; }
.search-pill.slim { margin: 10px 12px 0; padding: 9px 14px; background: #eceef4; box-shadow: none; }
.search-pill i { color: #9aa0ad; font-size: 15px; }

/* بطاقات الغرف */
.rooms-list { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; }
.room-card {
    display: flex; align-items: center; gap: 12px; background: var(--card);
    border-radius: 16px; padding: 10px; box-shadow: var(--shadow); cursor: pointer; text-align: left;
    transition: transform .15s, box-shadow .15s;
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20, 30, 60, .13); }
.room-icon {
    width: 80px; height: 80px; border-radius: 14px; flex-shrink: 0;
    background: linear-gradient(135deg, #7dd3fc, #0ea5e9);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 19px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.25); position: relative;
    overflow: hidden; text-align: center; line-height: 1.2; padding: 4px;
}
.room-icon.voice { background: linear-gradient(135deg, #7f9cf5, #5b8def); font-size: 32px; }
.room-icon .beta { position: absolute; top: 4px; left: 4px; font-size: 9px; background: rgba(255,255,255,.25); border-radius: 6px; padding: 2px 5px; letter-spacing: .5px; font-style: normal; }
.room-info { flex: 1; min-width: 0; }
.room-name { font-size: 19px; font-weight: 800; }
.room-desc { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.room-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.room-count { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.room-count i { color: #555; font-size: 13px; }
.room-arrow { color: #333; font-size: 15px; }
.room-radio-tag { display: inline-flex; align-items: center; gap: 3px; background: rgba(24,119,242,.12); color: var(--blue); border-radius: 8px; padding: 1px 6px; font-size: 11px; margin-right: 4px; }
.room-mini-icons { color: #777; font-size: 13px; display: flex; gap: 7px; }

/* مستوى الغرفة وملئها */
.room-level-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    background: var(--blue); color: #fff;
    border-radius: 8px; padding: 1px 6px; margin-right: 5px; vertical-align: middle;
}
.room-level-badge.rl-silver { background: #64748b; }
.room-level-badge.rl-gold { background: var(--gold); }
.room-fill { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.room-fill i { font-size: 12px; }
.room-fill.fill-busy { color: var(--gold); }
.room-fill.fill-full { color: var(--red); }
/* إطار ذهبي للغرف من مستوى 5+ */
.room-icon.rl-5, .room-icon.rl-6, .room-icon.rl-7, .room-icon.rl-8, .room-icon.rl-9, .room-icon.rl-10 {
    box-shadow: 0 0 0 3px var(--gold), 0 4px 14px rgba(242,169,0,.3);
}
.room-icon.rl-3, .room-icon.rl-4 {
    box-shadow: 0 0 0 2px #94a3b8;
}

/* ============ شاشة الدردشة ============ */
.chat-topbar {
    height: var(--topbar-h); display: flex; align-items: center; gap: 5px; flex-shrink: 0;
    background: var(--card2); padding: 0 7px; border-bottom: 1px solid #dfe2ea; z-index: 7;
}
.chat-topbar .icon-btn { width: 34px; height: 34px; font-size: 16px; }
.icon-btn.back { font-size: 19px; }
.room-pill { background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-btn {
    width: 48px; height: 32px; border-radius: 999px; position: relative;
    background: linear-gradient(90deg, #f6d8e8, #d8c6f5, #cfe0f9);
    color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.live-btn .dot { position: absolute; bottom: 3px; left: 9px; width: 8px; height: 8px; background: #ff2d2d; border-radius: 50%; }
.sq-btn { min-width: 38px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 0 7px; }
.top-count { font-size: 11px; font-weight: 800; font-style: normal; }

/* هيكل الدردشة: المحتوى + الشريط الجانبي */
.chat-shell { flex: 1; display: flex; min-height: 0; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.live-strip {
    position: absolute; top: calc(var(--topbar-h) + 8px); left: 0; right: 0; z-index: 3;
    display: flex; align-items: center; gap: 10px; padding: 0 12px; pointer-events: none;
}
.live-strip > * { pointer-events: auto; }
.cam-fab { width: 50px; height: 50px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 18px; box-shadow: 0 4px 12px rgba(24,119,242,.4); }
.live-text { color: #fff; font-weight: 800; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
.live-badge { display: flex; flex-direction: column; align-items: center; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.45); font-size: 21px; gap: 2px; }
.live-badge small { font-size: 11.5px; font-weight: 700; }

.chat-area { flex: 1; position: relative; overflow: hidden; background: #ccd3de; }
.chat-watermark {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: .14; pointer-events: none; gap: 8px;
}
.chat-watermark img { width: 120px; }
.chat-watermark span { font-size: 42px; font-weight: 800; color: #9aa1ad; }

.messages { position: absolute; inset: 0; overflow-y: auto; padding: 74px 8px 12px; display: flex; flex-direction: column; gap: 7px; }

/* رسالة نظام — كما في الموقع الأصلي */
.msg-system { padding: 2px 6px 2px 10px; }
.msg-system .sys-head { display: flex; align-items: center; gap: 7px; color: var(--blue); font-weight: 800; font-size: 13.5px; }
.msg-system .sys-head .sys-ic { width: 23px; height: 23px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10.5px; }
.msg-system .sys-body { font-size: 14px; color: #2c313d; padding-left: 30px; margin-top: 2px; line-height: 1.6; }

/* رسالة مستخدم — صف كامل العرض كما في الصور */
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg .avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); background: #fff; margin-top: 2px; }
.m-card {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, .92);
    border-radius: 12px;
    padding: 2px 52px 2px 12px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(20,30,60,.08);
    transition: background .15s;
}
.m-card:hover { background: #fff; }
.msg.mine .m-card { background: #eaf3ff; }
.msg.mine .m-card:hover { background: #e2efff; }

.m-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.b-name { font-weight: 800; font-size: 14px; color: #2a2f3c; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-verified { color: var(--blue); font-size: 12.5px; }
.b-body { font-size: 15px; font-weight: 600; line-height: 1.65; word-wrap: break-word; white-space: pre-wrap; }
.b-body a { color: var(--blue); text-decoration: underline; word-break: break-all; }
.b-body.emoji-big { font-size: 34px; line-height: 1.3; }

.m-side { position: absolute; top: 7px; right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.b-time { color: #9aa1b1; font-size: 11px; white-space: nowrap; }
.b-role { font-size: 14px; line-height: 1; }
.b-rank-img { width: 15px; height: 15px; object-fit: contain; vertical-align: middle; }

/* ── الرد على رسالة ── */
.b-reply {
    display: flex; align-items: stretch;
    background: rgba(0,0,0,.05);
    border-radius: 8px;
    margin: 2px 0 5px;
    overflow: hidden;
    cursor: pointer;
    max-height: 54px;
}
.b-reply-bar { width: 3px; flex-shrink: 0; background: var(--blue); }
.b-reply-content { padding: 4px 8px; min-width: 0; flex: 1; }
.b-reply-name {
    display: block; font-weight: 800; font-size: 12px; color: var(--blue);
    margin-bottom: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-reply-body {
    display: block; font-size: 12px; color: #666;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-reply-body i { margin-left: 3px; }

/* رسائل متتالية من نفس المستخدم */
.msg.grouped { margin-top: -3px; }
.msg.grouped .avatar { visibility: hidden; height: 0; margin: 0; }
.msg.grouped .m-head { display: none; }

/* حذف رسالة */
.msg.removing, .msg-system.removing { opacity: 0; transform: scale(.97); transition: .25s; }

/* رتب */
.role-owner { color: var(--gold); }
.role-admin { color: var(--orange); }
.role-vip { color: var(--vip); }
.role-premium { color: var(--premium); }
.role-plus { color: var(--blue); }

.scroll-down {
    position: absolute; bottom: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%;
    background: #fff; color: var(--blue); font-size: 18px; box-shadow: 0 3px 10px rgba(0,0,0,.2); z-index: 4;
}

/* مؤشر الكتابة */
.typing-bar { display: flex; align-items: center; gap: 9px; background: var(--card2); padding: 6px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid #e7eaf1; flex-shrink: 0; }
.typing-bar .dots { display: inline-flex; gap: 3px; }
.typing-bar .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: tdots 1.1s infinite; }
.typing-bar .dots i:nth-child(2) { animation-delay: .18s; }
.typing-bar .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes tdots { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* شريط الرد */
.reply-bar { display: flex; align-items: center; gap: 10px; background: #eaf2ff; padding: 8px 14px; color: var(--blue); font-size: 13.5px; flex-shrink: 0; }
.reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #444; }
.reply-bar button { color: var(--red); font-size: 15px; }

/* شريط الرسالة المثبتة */
.pinned-bar {
    display: flex; align-items: center; gap: 9px;
    background: linear-gradient(90deg, #fff8e1, #fffde7);
    border-bottom: 1px solid #f9c74f;
    padding: 7px 14px; font-size: 13px; flex-shrink: 0;
    cursor: pointer; transition: background .15s;
}
.pinned-bar:hover { background: #fff3c4; }
.pinned-ic { color: #f59e0b; font-size: 13px; flex-shrink: 0; }
#pinnedBarText { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #555; }
#pinnedBarClose { color: var(--muted); font-size: 14px; padding: 2px 6px; flex-shrink: 0; }

/* زر أوامر الرسالة المختصر */
.msg-opt-btn {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 13px; padding: 0 3px;
    opacity: 0; transition: opacity .15s;
    line-height: 1; flex-shrink: 0;
}
.msg:hover .msg-opt-btn,
.msg-opt-btn:focus { opacity: 1; }

/* قائمة أوامر الرسالة */
.msg-opt-menu {
    position: fixed; z-index: 9999;
    background: #fff; border-radius: 12px;
    box-shadow: 0 6px 28px rgba(0,0,0,.18);
    border: 1px solid #e8eaf0;
    padding: 4px; min-width: 130px;
    animation: momIn .14s ease;
}
@keyframes momIn {
    from { opacity: 0; transform: scale(.92) translateY(-6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.mom-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; background: none; border: none;
    padding: 8px 12px; border-radius: 8px;
    font-size: 13.5px; font-family: inherit; cursor: pointer;
    color: #333; text-align: right; transition: background .1s;
}
.mom-item i { font-size: 12px; color: var(--muted); width: 14px; }
.mom-item:hover { background: #f4f6fb; }
.mom-del { color: #e53e3e; }
.mom-del i { color: #e53e3e; }
.mom-rep { color: #d97706; }
.mom-rep i { color: #d97706; }

/* تأثير وميض الرسالة المثبتة عند الانتقال إليها */
.msg.flash { animation: msgFlash .8s ease; }
@keyframes msgFlash {
    0%,100% { background: transparent; }
    40%     { background: rgba(245,158,11,.18); border-radius: 10px; }
}

/* صندوق الكتابة — صف واحد كما في الصورة */
.composer {
    display: flex; flex-direction: column; padding: 5px 5px;
    background: #f6f7f9; border-top: 1px solid #e7e9ef; flex-shrink: 0;
    position: relative;
}
.composer .icon-btn.round { width: 28px; height: 28px; border-radius: 50%; font-size: 16px; flex-shrink: 0; color: var(--blue); }
#btnEmoji { color: var(--blue); }
.color-flower { color: var(--blue) !important; }
.comp-row { display: flex; align-items: center; gap: 0; }
.composer input {
    flex: 1; background: #fff; border-radius: 999px; padding: 7px 13px;
    font-size: 16px; /* 16px يمنع التكبير التلقائي على iOS */
    box-shadow: inset 0 0 0 1px #e3e6ee; min-width: 0; transition: box-shadow .15s;
    margin: 0 2px;
}
.composer input::placeholder { color: #aab0bd; }
.composer input:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.send-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; flex-shrink: 0; transition: .15s; margin: 0 2px; }
.send-btn:active { background: var(--blue-dark); transform: scale(.94); }

/* ============ الشريط الجانبي للدردشة (حاسوب) ============ */
.chat-side {
    width: var(--side-w); flex-shrink: 0; background: #f0f1f6; border-left: 1px solid #dfe2ea;
    flex-direction: column; min-height: 0;
}
.side-profile { display: flex; align-items: center; gap: 10px; background: #e7e9f0; margin: 10px 12px 0; border-radius: 16px; padding: 10px; }
.sp-av { position: relative; }
.sp-av img { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.15); }
.sp-av::after { content: ""; position: absolute; bottom: -2px; right: -2px; width: 13px; height: 13px; background: var(--green); border: 2.5px solid #e7e9f0; border-radius: 50%; }
.sp-info { flex: 1; min-width: 0; }
.sp-info > b { font-size: 16px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-gold { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 14px; }
.sp-gold i { color: var(--blue); }

.side-tabs { display: flex; gap: 8px; margin: 10px 12px 0; }
.side-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    background: #e2e4ec; color: #424a5c; border-radius: 11px; padding: 10px 6px;
    font-size: 14px; font-weight: 800; transition: .15s; white-space: nowrap;
}
.side-tab.active { background: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(24,119,242,.35); }

.side-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.panel-count { padding: 8px 18px 6px; font-size: 15px; font-weight: 700; }
.panel-list { flex: 1; overflow-y: auto; }

/* صفوف المتصلين */
.u-row { display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer; transition: background .12s; }
.u-row:nth-child(odd) { background: #e8ecf5; }
.u-row:hover { background: #dde6f7; }
.u-row .crown { width: 22px; font-size: 15px; text-align: center; flex-shrink: 0; }
.u-row .av-wrap { position: relative; flex-shrink: 0; }
.u-row .av-wrap img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.u-row .av-wrap::after { content: ""; position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; background: var(--green); border: 2px solid #f0f1f6; border-radius: 50%; }
.u-row .u-name-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.u-row .u-name { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-row .u-mood { font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.u-row .gender-ic { font-size: 16px; flex-shrink: 0; }
.gender-ic.male { color: #1f6fd6; }
.gender-ic.female { color: #e0398f; }
.gender-ic.unknown { color: #9aa0ad; }

/* بطاقات الغرف داخل اللوحات */
.p-room { display: flex; align-items: center; gap: 10px; background: #fff; margin: 8px 12px 0; border-radius: 14px; padding: 9px; cursor: pointer; box-shadow: var(--shadow); transition: background .12s; }
.p-room:hover { background: #f4f7ff; }
.p-room.active { outline: 2px solid var(--blue); }
.p-room .room-icon { width: 56px; height: 56px; font-size: 13px; border-radius: 12px; }
.p-room .room-name { font-size: 15.5px; }
.p-room .room-desc { font-size: 12px; margin-top: 3px; }
.p-room .room-count { font-size: 13px; }
.p-room .room-arrow { font-size: 13px; }

/* الراديو */
.radio-card {
    margin: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-radius: 16px; padding: 12px;
    background: linear-gradient(110deg, #b89df3, #e6a9d8, #f0b9c8);
    display: flex; align-items: center; gap: 12px; color: #fff; box-shadow: 0 6px 18px rgba(160,120,220,.4);
    flex-shrink: 0;
}
.radio-btn { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92); color: #9b6fd8; font-size: 16px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.radio-info { flex: 1; min-width: 0; }
.radio-info > b { font-size: 15px; display: block; text-shadow: 0 1px 3px rgba(0,0,0,.2); }
.radio-info small { font-size: 11.5px; opacity: .95; }
.radio-row { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 12px; }
.radio-row input[type="range"] { flex: 1; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 99px; background: rgba(255,255,255,.55); outline: none; }
.radio-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.radio-row input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; }

/* ============ Dropdown Panels (رسائل + إشعارات) ============ */
.dp-overlay {
    position: fixed; inset: 0; z-index: 90; background: rgba(15,20,40,.35);
    animation: dpFade .2s ease;
}
@keyframes dpFade { from { opacity: 0; } to { opacity: 1; } }
/* هاتف: لوحة عائمة فوق الفوتر تغطي نصف الشاشة */
.dp-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    height: 64dvh;
    min-height: 360px;
    background: var(--card);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.22);
    z-index: 91;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dpSlideIn .26s cubic-bezier(.34,1.1,.5,1);
    border: 1px solid #e4e6ed;
    border-bottom: 0;
}
.dp-panel::before {
    content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 999px; background: #d4d7e0;
}
.dp-panel.hidden { display: none; }
@keyframes dpSlideIn {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
/* حاسوب: ينزلق من الأعلى كقائمة منسدلة */
@media (min-width: 1024px) {
    .dp-overlay { background: transparent; }
    .dp-panel {
        bottom: auto; top: 58px; left: auto; right: 16px; margin: 0;
        width: min(420px, 96vw); height: auto;
        max-height: calc(100dvh - 80px); min-height: 0;
        border-radius: 18px; border-bottom: 1px solid #e4e6ed;
        box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
        animation: dpDeskIn .2s ease;
    }
    .dp-panel::before { display: none; }
    @keyframes dpDeskIn {
        from { opacity: 0; transform: translateY(-10px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}
.dp-head {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px 14px;
    border-bottom: 1px solid #eceef4;
    font-weight: 800; font-size: 16px;
    flex-shrink: 0;
}
.dp-head > span { flex: 1; }
.dp-head-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #fff; flex-shrink: 0;
}
.dp-head-icon.pm { background: linear-gradient(135deg, #1877f2, #4f93f7); }
.dp-head-icon.notif { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.dp-close {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--card2); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: .15s; flex-shrink: 0;
}
.dp-close:hover { background: #e0e2ea; color: var(--txt); }
.dp-body {
    overflow-y: auto; flex: 1;
    padding: 6px 0;
}
.dp-body .pm-thread {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer; transition: background .12s; direction: rtl;
}
.dp-body .pm-thread:active { background: var(--card2); }
.dp-body .pm-thread:hover { background: #f7f8fb; }
.dp-body .pm-thread .pm-av-wrap { position: relative; flex-shrink: 0; }
.dp-body .pm-thread img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; }
.dp-body .pm-thread .pm-online {
    position: absolute; bottom: 0; left: 0;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--green); border: 2px solid #fff;
}
.dp-body .pm-thread .ti { flex: 1; min-width: 0; }
.dp-body .pm-thread .ti b { display: block; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-body .pm-thread .ti p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.dp-body .pm-thread .meta { text-align: left; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.dp-body .pm-thread .meta small { font-size: 11px; color: var(--muted); }
.dp-body .pm-thread .meta .badge { position: static; min-width: 18px; height: 18px; font-size: 10px; }
.dp-body .notif-row {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 12px 16px; border-bottom: 1px solid #f0f1f5;
    direction: rtl; cursor: default; transition: background .12s;
}
.dp-body .notif-row:hover { background: #f7f8fb; }
.dp-body .notif-row .notif-ic {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff; font-size: 15px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dp-body .notif-row .notif-txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.5; }
.dp-body .notif-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.dp-body .empty-state { padding: 30px 0; }

/* ============ التنقل السفلي (هاتف) ============ */
.bottom-nav {
    position: absolute; bottom: 0; left: 0; right: 0; height: var(--nav-h);
    background: #f6f7f9; border-top: 1px solid #e7e9ef;
    display: flex; align-items: stretch; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: #80869a; font-size: 11px; font-weight: 700; position: relative;
    transition: color .15s; padding: 4px 0;
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--blue); font-weight: 800; }
.nav-item.active i { color: var(--blue); }
.nav-item .nav-logo { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.nav-item .badge { top: 0; right: auto; left: calc(50% + 4px); min-width: 16px; height: 16px; font-size: 10px; border: 2px solid #f6f7f9; }
/* داخل الدردشة: يختفي التنقل على الهاتف ليظهر صندوق الكتابة كاملاً */

/* ============ صفحات عامة ============ */
.page-header { display: flex; align-items: center; background: var(--card2); border-bottom: 1px solid #dfe2ea; padding: 12px 14px; position: relative; direction: rtl; }
.page-header h2 { position: absolute; left: 56px; right: 56px; text-align: center; font-size: 17px; pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link { color: var(--blue); font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 5px; z-index: 1; }
.back-link i { transform: scaleX(-1); }
.page-subhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; }
.page-subhead h1 { font-size: 26px; }
.page-subhead i { font-size: 19px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 70px 20px; }
.empty-art { width: 160px; height: 160px; border-radius: 50%; background: #e3ecf7; display: flex; align-items: center; justify-content: center; font-size: 56px; color: #41507a; }
.empty-art.bell { color: var(--orange); }
.empty-state p { font-size: 19px; color: #333; }

.pm-threads, #notifList { flex: 1; overflow-y: auto; }
.pm-thread { display: flex; align-items: center; gap: 12px; background: #fff; margin: 8px 14px 0; padding: 11px 13px; border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; transition: background .12s; direction: rtl; }
.pm-thread:active { background: #eef3ff; }
.pm-thread .pm-av-wrap { position: relative; flex-shrink: 0; }
.pm-thread img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; display: block; }
.pm-thread .pm-online {
    position: absolute; bottom: 1px; left: 1px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--green); border: 2.5px solid #fff;
}
.pm-thread .ti { flex: 1; min-width: 0; }
.pm-thread .ti b { font-size: 16px; }
.pm-thread .ti p { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.pm-thread .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pm-thread .meta small { color: var(--muted); font-size: 11px; }
.pm-thread .meta .badge { position: static; }

.notif-row { background: #fff; margin: 8px 14px 0; padding: 13px 15px; border-radius: 14px; box-shadow: var(--shadow); }
.notif-row small { color: var(--muted); display: block; margin-top: 5px; }

/* ============ الرسائل الخاصة — نافذة عائمة ============ */

/* ── عناصر مشتركة ── */
.pm-av { position: relative; flex-shrink: 0; }
.pm-av img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.pm-dot {
    position: absolute; bottom: -1px; left: -1px; width: 11px; height: 11px;
    border-radius: 50%; background: var(--green); border: 2px solid #dce6f0;
}
.pm-dot.off { background: #9ca3af; }
.pm-peer-info { min-width: 0; flex: 1; }
.pm-peer-info b { font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1e293b; }
.pm-peer-info small { color: #64748b; font-size: 11px; display: block; }
.pm-peer-info small.typing { color: #16a34a; font-weight: 700; animation: pmTyping 1.1s infinite; }
@keyframes pmTyping { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ── النافذة العائمة الرئيسية ── */
.pm-win {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    width: 340px;
    z-index: 500;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    transition: height .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
    background: #e8eef5;
    animation: pmWinAppear .22s ease;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
}
.pm-win.hidden { display: none !important; }

@keyframes pmWinAppear {
    from { transform: translateY(24px) scale(.94); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

/* الأحجام الثلاثة */
.pm-win[data-size="mini"] {
    height: 52px;
    width: 52px !important;
    border-radius: 50% !important;
    overflow: hidden;
    background: transparent !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
}
.pm-win[data-size="normal"] { height: 440px; }
.pm-win[data-size="large"]  { height: 640px; width: 420px; }

/* ── رأس النافذة ── */
.pm-win-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 0 10px;
    height: 52px;
    min-height: 52px;
    flex-shrink: 0;
    background: #dce6f0;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid #c8d5e4;
    position: relative;
}
/* في وضع mini: رأس الصورة فقط */
.pm-win[data-size="mini"] .pm-win-head {
    padding: 0;
    border: none;
    background: transparent;
    height: 52px;
    overflow: hidden;
}
.pm-win[data-size="mini"] .pm-peer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: none;
    padding: 0;
    flex-shrink: 0;
}
.pm-win[data-size="mini"] .pm-peer-info,
.pm-win[data-size="mini"] .pm-win-actions,
.pm-win[data-size="mini"] .pm-unread-badge {
    display: none;
}
.pm-win[data-size="mini"] .pm-av img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
}
.pm-win[data-size="mini"] .pm-dot {
    width: 13px;
    height: 13px;
    bottom: 0;
    left: 0;
}
.pm-peer-btn {
    display: flex; align-items: center; gap: 9px;
    flex: 1; min-width: 0; padding: 4px 4px;
    border-radius: 10px; background: none; border: none; cursor: default;
    text-align: right;
}
.pm-peer-btn:hover { background: none; }

.pm-win-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.pmw-btn {
    width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(0,0,0,.06); color: #475569;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: background .12s, color .12s; flex-shrink: 0;
}
.pmw-btn:hover { background: rgba(0,0,0,.12); color: #1e293b; }
.pmw-close:hover { background: #ef4444; color: #fff; }

/* badge الرسائل غير المقروءة */
.pm-unread-badge {
    position: absolute;
    top: 6px; right: 70px;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 800; min-width: 18px; height: 18px;
    border-radius: 999px; padding: 0 5px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.pm-unread-badge.hidden { display: none !important; }

/* ── جسم النافذة (مخفي في mini) ── */
.pm-win-body {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #d4dde8 0%, #c8d3de 100%);
}
.pm-win[data-size="mini"] .pm-win-body { display: none; }

/* منطقة الرسائل */
.pm-scroll {
    flex: 1; overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 10px 10px; display: flex; flex-direction: column;
    position: relative;
}
.pm-win .scroll-down { bottom: 10px; right: 10px; }

/* ── Footer ── */
.pm-win-footer {
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    position: relative;
}
.pm-comp-row {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px;
}
.pm-comp-row input {
    flex: 1; border: none; outline: none; font-size: 14px;
    font-family: inherit; background: #f3f4f6;
    padding: 8px 12px; border-radius: 20px; color: #1f2937;
}
.pm-comp-row input::placeholder { color: #9ca3af; }
.pm-comp-row .pmw-btn {
    background: #f3f4f6; color: #6b7280;
    border-radius: 50%; flex-shrink: 0;
}
.pm-comp-row .pmw-btn:hover { background: #e5e7eb; color: #374151; }
.pmw-send { background: #1877f2 !important; color: #fff !important; }
.pmw-send:hover { background: #1565e0 !important; }

/* ── PM emoji popup ── */
.pm-emoji-popup {
    position: absolute; bottom: 100%; right: 0; left: 0;
    background: #fff; border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0,0,0,.1); z-index: 10;
    max-height: 160px; overflow-y: auto;
}
.pm-emoji-popup.hidden { display: none !important; }
.pm-emoji-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-bottom: 1px solid #f3f4f6;
    font-size: 12.5px; font-weight: 700; color: #374151;
}
.pm-emoji-head button { background: none; border: none; cursor: pointer; color: #6b7280; font-size: 14px; }

/* ── بطاقات المحادثة ── */
.pm-intro {
    align-self: center; text-align: center; max-width: 280px;
    background: rgba(255,255,255,.8); backdrop-filter: blur(6px);
    border-radius: 16px; padding: 14px 16px; margin: 4px 0 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.pm-intro img { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 8px; display: block; object-fit: cover; }
.pm-intro b { font-size: 14px; display: block; }
.pm-intro small { color: #5a6372; font-size: 11.5px; display: block; margin-top: 4px; line-height: 1.6; }

.pm-enc-banner {
    align-self: center; display: flex; align-items: center; gap: 6px;
    background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.2);
    border-radius: 999px; padding: 6px 14px; margin: 0 auto 12px;
    font-size: 11.5px; color: #15803d;
}
.pm-enc-banner i { font-size: 10px; }

.pm-day { align-self: center; margin: 10px 0 6px; }
.pm-day span {
    background: rgba(255,255,255,.75); color: #5a6372;
    font-size: 11px; font-weight: 700; padding: 4px 14px;
    border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── على الهاتف: النافذة أسفل اليمين كاملة العرض تقريباً ── */
@media (max-width: 1023px) {
    .pm-win {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        max-width: none;
        border-radius: 16px;
        left: auto !important;
        top: auto !important;
        /* بدون انيميشن فتح أو تغيير حجم */
        animation: none;
        transition: none;
    }
    .pm-win[data-size="mini"] {
        width: 52px !important;
        right: 14px;
        bottom: 80px;
    }
    .pm-win[data-size="normal"] { height: 60vh; }
    .pm-win[data-size="large"]  {
        height: calc(100dvh - 10px);
        width: calc(100vw - 20px);
        bottom: 5px;
        border-radius: 20px 20px 16px 16px;
    }
    /* إيقاف نبضة الـ bubble على الهاتف */
    .pmf-ring { animation: none; }
    .pm-bubble-float { animation: none; filter: none; }
}

/* ── على الحاسوب: large بجانب sidebar ── */
@media (min-width: 1024px) {
    .pm-win[data-size="large"] {
        position: fixed;
        /* يكون بين chat-main وchat-side: يبدأ من يسار الـ sidebar */
        right: var(--side-w);
        top: var(--topbar-h);
        bottom: 0;
        left: auto !important;
        width: var(--side-w) !important;
        height: calc(100vh - var(--topbar-h)) !important;
        border-radius: 0;
        z-index: 200;
        animation: none;
        transition: none;
        box-shadow: -2px 0 12px rgba(0,0,0,.10);
    }
    .pm-win[data-size="normal"] {
        width: 340px;
        height: 480px;
        right: calc(var(--side-w) + 14px);
        bottom: 20px;
    }
    .pm-win[data-size="mini"] {
        bottom: 30px;
        right: calc(var(--side-w) + 14px);
    }
    /* تضييق chat-main عند فتح PM large */
    body.pm-large-open .chat-main {
        margin-right: var(--side-w);
    }
}

/* ============ القائمة الرئيسية ============ */
.menu-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 12px 20px; direction: rtl; }
.menu-body > * { display: block; width: 100%; }
.menu-body > .menu-card,
.menu-body > .menu-hero { margin-bottom: 10px; }
.menu-body > .menu-section + .menu-card { margin-top: 0; }

/* بطاقة المستخدم الرئيسية */
.menu-hero {
    background: linear-gradient(135deg, #1877f2, #4f93f7 55%, #6aa8ff);
    border-radius: 18px; padding: 14px; color: #fff;
    box-shadow: 0 8px 22px rgba(24,119,242,.28);
}
.hero-id { display: flex; align-items: center; gap: 12px; width: 100%; color: #fff; text-align: right; }
.hero-id .pc-av img { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; border: 2px solid rgba(255,255,255,.5); }
.hero-id .pc-av::after { content: ""; position: absolute; bottom: -2px; left: -2px; width: 13px; height: 13px; background: var(--green); border: 2px solid #fff; border-radius: 50%; }
.pc-av { position: relative; flex-shrink: 0; }
.pc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pc-info b { font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-txt { color: rgba(255,255,255,.85); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.online-txt::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b7f7c4; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }
.hero-arrow { font-size: 15px; color: rgba(255,255,255,.7); flex-shrink: 0; }
.hero-balance { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.22); }
.hb-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,.9); }
.hero-balance > b { font-size: 18px; font-weight: 800; }
.hb-buy { margin-right: auto; background: #fff; color: var(--blue); font-weight: 800; font-size: 13px; padding: 6px 18px; border-radius: 999px; }
.hb-buy:active { transform: scale(.95); }

/* عناوين الأقسام */
.menu-section { font-size: 12.5px; font-weight: 800; color: #9098a8; padding: 2px 6px 7px; }

.menu-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 4px rgba(20,30,60,.06); }
.menu-card.group { overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px; font-size: 14.5px; font-weight: 700; text-align: right; transition: background .12s; }
.menu-row > span.mi { flex-shrink: 0; }
.menu-row .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row:active { background: #eef3fc; }
.menu-row + .menu-row { border-top: 1px solid #f0f1f6; }
.menu-row .end { margin-right: auto; margin-left: 0; font-size: 14px; color: #c2c6d0; flex-shrink: 0; }
.menu-row.danger-row { color: var(--red); }
.mi { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; flex-shrink: 0; }
.mi.blue { background: var(--blue); }
.mi.magenta { background: #d916d9; }
.mi.red { background: var(--red); }
.mi.orange { background: var(--orange); }
.mi.gray { background: #aeb3bf; }
.mi.green { background: var(--green); }
.mi.gold { background: var(--gold); }
.mi.slate { background: #64748b; }

/* ============ اللوحات الجانبية (هاتف) ============ */
.side-panel {
    position: absolute; top: 0; bottom: 0; right: 0; width: 82%; max-width: 380px;
    background: #f0f1f6; z-index: 20; display: flex; flex-direction: column;
    box-shadow: -8px 0 24px rgba(0,0,0,.18); animation: slideIn .2s ease;
    border-bottom-left-radius: 14px; border-top-left-radius: 14px;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.close-x { color: var(--blue); font-size: 22px; }

.overlay { position: absolute; inset: 0; background: rgba(15, 20, 35, .35); z-index: 15; }

/* ============ شيت صغير للإيموجي وألوان الخط ============ */
.mini-sheet {
    position: fixed;
    bottom: 100px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -6px 28px rgba(0,0,0,.16);
    z-index: 200;
    overflow: hidden;
    animation: miniSheetUp .22s cubic-bezier(.34,1.1,.5,1);
}
@keyframes miniSheetUp { from { transform: translateY(100%); } }
.mini-sheet.hidden { display: none; }
.mini-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 6px 2px;
    border-bottom: 1px solid #eceef4;
    font-size: 16px;
    font-weight: 800;
}
.mini-sheet-head::before {
    content: none;
}
/* مقبض السحب */
.mini-sheet::before {
    content: ""; display: block; width: 38px; height: 4px; border-radius: 99px;
    background: #d4d7e0; margin: 8px auto 0;
}
.mini-close {
    width: 28px; height: 28px; border-radius: 50%; background: var(--card2);
    color: var(--muted); display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: .15s;
}
.mini-close:active { background: #d9dbe4; }
.emoji-grid {
    display: flex;
    gap: 1px;
    padding: 10px 10px 14px;
    max-height: 211px;
    overflow-y: auto;
    flex-wrap: wrap;
}
.emoji-grid button { font-size: 26px; padding: 7px 4px; border-radius: 10px; text-align: center; }
.emoji-grid button:active { background: var(--card2); }
.emoji-picker-img { width: 32px; height: 32px; object-fit: contain; display: block; }
.emoji-inline { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin: 0 1px; }
.color-grid {
    display: grid; grid-template-columns: repeat(8, 1fr);
    gap: 10px; padding: 14px 14px 18px;
    max-height: 220px; overflow-y: auto;
}
.color-grid button { width: 100%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .12s; }
.color-grid button:active { transform: scale(.88); }
.color-grid button.sel { outline: 3px solid var(--txt); outline-offset: 3px; transform: scale(1.08); }

@media (min-width: 1024px) {
    .mini-sheet {
        position: fixed;
        bottom: auto;
        top: auto;
        width: 320px; left: 12px; right: auto; bottom: 72px;
        border-radius: 18px;
        box-shadow: 0 8px 32px rgba(0,0,0,.18);
    }
    .mini-sheet::before { display: none; }
    .emoji-grid { grid-template-columns: repeat(7, 1fr); max-height: 280px; }
}

/* قائمة خيارات المستخدم — iOS action sheet */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 18px; direction: rtl; }
.sheet-card { width: 100%; max-width: 320px; background: transparent; animation: pop .16s ease; max-height: 86dvh; overflow-y: auto; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.sheet-title { text-align: center; padding: 9px 14px; color: #8a8a8e; font-size: 12px; font-weight: 600; background: #fff; border-bottom: .5px solid #e3e3e8; border-radius: 14px 14px 0 0; }
.sheet-group { background: #fff; margin: 0 0 8px; overflow: hidden; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.22); }
.sheet-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; font-size: 14px; color: #007aff; font-weight: 600; background: #fff; border: none; border-bottom: .5px solid #ededf2; cursor: pointer; text-align: right; }
.sheet-row:last-of-type { border-bottom: none; }
.sheet-row:active { background: #e5e5ea; }
.sheet-row i:first-child { font-size: 15px; color: #007aff; width: 20px; text-align: center; flex-shrink: 0; }
.sheet-row.danger { color: var(--red); }
.sheet-row.danger i:first-child { color: var(--red); }
.sheet-cancel { display: block; width: 100%; padding: 11px 14px; text-align: center; color: #007aff; font-size: 15px; font-weight: 700; background: #fff; border: none; cursor: pointer; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.sheet-cancel:active { background: #e5e5ea; }
/* تحكم الصوت داخل خيارات الغرفة */
.sheet-sound { padding: 11px 14px; border-bottom: .5px solid #ededf2; display: flex; flex-direction: column; gap: 10px; }
.ss-toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: #007aff; }
.ss-toggle i { width: 20px; text-align: center; }
.ss-toggle.off { color: #aab0bd; }
.ss-range { display: flex; align-items: center; gap: 9px; color: #9aa0ad; font-size: 13px; }
.ss-range input[type="range"] { flex: 1; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 99px; background: #d9dce6; outline: none; }
.ss-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; }
.ss-range input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--blue); cursor: pointer; }

/* المودالات: لوحة سفلية احترافية (bottom sheet) */
.modal { position: absolute; inset: 0; background: rgba(15, 20, 40, .5); z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: modalFade .22s ease; }
.modal-page { position: relative; background: var(--bg); width: 100%; max-width: 760px; margin: 0 auto; max-height: 55vh; overflow-y: auto; padding: 0 16px 22px; border-radius: 22px 22px 0 0; box-shadow: 0 -14px 50px rgba(0,0,0,.28); animation: sheetUp .3s cubic-bezier(.16, 1, .3, 1); -webkit-overflow-scrolling: touch; }
.modal-page::before { content: ""; position: sticky; top: 6px; display: block; width: 42px; height: 5px; margin: 8px auto 2px; border-radius: 99px; background: #d2d6e0; }
.modal-page.center { text-align: center; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; border-bottom: 1px solid #dfe2ea; margin-bottom: 11px; position: sticky; top: 13px; background: var(--bg); z-index: 2; }

@keyframes modalFade { from { background: rgba(15, 20, 40, 0); } }
@keyframes sheetUp { from { transform: translateY(100%); } }
.modal-head h2 { font-size: 18px; }
.note-card { background: #f3f5fb; border-radius: 13px; padding: 12px; font-size: 14px; font-weight: 600; display: flex; gap: 9px; align-items: center; box-shadow: var(--shadow); }
.note-card .coin { font-size: 21px; }
.sec-title { margin: 14px 0 7px; font-size: 15px; }
.orange-title { color: var(--orange); text-align: center; font-size: 16px; font-weight: 800; margin: 13px 0; }

.gold-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gold-card { background: #fff; border-radius: 13px; padding: 11px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--shadow); transition: transform .15s; }
.gold-card:hover { transform: translateY(-2px); }
.gold-amount { color: var(--orange); font-size: 16px; font-weight: 800; }
.gold-card .chest { font-size: 34px; }
.gold-card .chest.big { font-size: 40px; }
.gold-price { font-size: 13.5px; }
.gold-price b { color: var(--orange); }

.plans-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 11px; }
.plan-card { background: #fff; border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); border: 2px solid transparent; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.plan-card.selected { border-color: #8a8f9c; }
.plan-name { font-size: 18px; font-weight: 800; }
.plan-name.vip { color: var(--vip); }
.plan-name.premium { color: var(--premium); }
.plan-name.plus { color: var(--blue); }
.plan-ic { font-size: 28px; }
.plan-price { font-size: 14.5px; font-weight: 800; color: #444; }
.plan-card p { font-size: 12px; color: #333; line-height: 1.7; text-align: left; }

.upgrade-box { background: #fff; border-radius: 14px; margin-top: 12px; padding: 13px; display: flex; gap: 11px; align-items: center; box-shadow: var(--shadow); }
.ub-right { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.ub-right > b { font-size: 15px; border-bottom: 1px solid #e3e5ec; padding-bottom: 7px; }
.ub-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border-radius: 9px; overflow: hidden; }
.stepper button { width: 36px; height: 32px; background: var(--blue); color: #fff; font-size: 18px; }
.stepper b { width: 40px; text-align: center; background: #fff; border-top: 1px solid #dfe2ea; border-bottom: 1px solid #dfe2ea; line-height: 32px; }
.ub-plan { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ub-plan .plan-ic { font-size: 44px; background: #ece9fd; border-radius: 14px; padding: 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* تغيير الصورة */
.tabs-outline { display: flex; gap: 0; border: 1.5px solid var(--blue); border-radius: 9px; overflow: hidden; }
.ot-tab { flex: 1; padding: 9px; color: var(--blue); font-size: 14px; font-weight: 700; }
.ot-tab + .ot-tab { border-left: 1.5px solid var(--blue); }
.ot-tab.active { background: var(--blue); color: #fff; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 12px 0; }
.avatar-grid img { width: 100%; aspect-ratio: 1; border-radius: 11px; object-fit: cover; cursor: pointer; background: #fff; box-shadow: var(--shadow); }
.avatar-grid img.sel { outline: 3px solid var(--blue); }
.avatar-pick { background: #f3f5fb; border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow); }
.ap-right { flex: 1; }
.ap-right b { font-size: 16px; display: block; border-bottom: 1px solid #d9dce6; padding-bottom: 8px; }
.ap-or { display: flex; align-items: center; gap: 10px; margin-top: 11px; font-size: 15px; }
.ap-preview { width: 86px; height: 86px; border-radius: 18px; object-fit: cover; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.18); }

/* قوائم الحظر */
.block-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 9px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.block-row img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.block-row b { flex: 1; }
.block-row button { color: var(--red); font-weight: 700; }

/* ===== مودال الملف الشخصي — مركزي ===== */
.prof-overlay {
    position: fixed; inset: 0; z-index: 250;
    background: var(--bg);
    display: flex; flex-direction: column;
    overflow-y: auto;
    animation: profFadeIn .2s ease;
}
@keyframes profFadeIn { from { opacity: 0; transform: translateY(16px); } }
.prof-overlay.hidden { display: none; }

.prof-dialog {
    width: 100%; max-width: 600px;
    margin: 0 auto;
    background: var(--card);
    min-height: 100vh;
    overflow: visible;
}
@keyframes profPopIn {
    from { opacity: 0; transform: scale(.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.prof-cover {
    height: 180px;
    position: relative;
    background: linear-gradient(135deg, #1877f2 0%, #4f93f7 45%, #8b7cf6 100%);
    flex-shrink: 0;
    margin-bottom: 13px;
    border-radius: 0;
}
.prof-close-btn {
    position: absolute; top: 12px; left: 12px;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(0,0,0,.32); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: background .15s; z-index: 2;
}
.prof-close-btn:active { background: rgba(0,0,0,.55); }

/* الجسم الأبيض */
.prof-body { padding: 0 18px 22px; }

/* صف الصورة + الهوية */
.prof-av-row {
    display: flex; align-items: flex-end; gap: 14px;
    margin-top: -38px; direction: rtl;
}
.prof-av-wrap { position: relative; flex-shrink: 0; }
.prof-avatar {
    width: 76px; height: 76px; border-radius: 20px;
    object-fit: cover; background: #f0f2f8;
    border: 4px solid #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.2);
}
/* النبذة */
/* خط فاصل */
.prof-divider { height: 1px; background: #eceef4; margin: 16px 0; }

/* الإحصائيات */
.prof-stats { display: flex; gap: 8px; margin-top: 16px; direction: rtl; }
.ps-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #f5f7fb; border-radius: 14px; padding: 13px 6px;
    border: 1px solid #eceef4;
}
.ps-icon {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #fff;
}
.ps-icon.gold    { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.ps-icon.blue    { background: linear-gradient(135deg, #1877f2, #4f93f7); }
.ps-icon.pink    { background: linear-gradient(135deg, #ec4899, #f472b6); }
.ps-item b       { font-size: 14px; font-weight: 800; }
.ps-item small   { font-size: 10.5px; color: var(--muted); }

/* أزرار الإجراءات */
/* ===== فقاعة المحادثة المصغّرة (float) ===== */
.pm-bubble-float {
    position: fixed;
    bottom: 90px;
    right: 12px;
    z-index: 200;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: pmFloatIn .35s cubic-bezier(.34,1.56,.64,1);
    filter: drop-shadow(0 6px 18px rgba(24,119,242,.38));
    user-select: none;
}
@keyframes pmFloatIn {
    from { opacity: 0; transform: scale(.4) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.pm-bubble-float.hidden { display: none; }

/* حلقة نابضة */
.pmf-ring {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1877f2, #4f93f7);
    padding: 3px;
    animation: pmFloatPulse 2.4s ease-in-out infinite;
}
@keyframes pmFloatPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(24,119,242,.5); }
    50%       { box-shadow: 0 0 0 8px rgba(24,119,242,.0); }
}
.pmf-ring img {
    width: 100%; height: 100%; border-radius: 50%;
    object-fit: cover; border: 2.5px solid #fff; background: #fff;
    display: block;
}
/* نقطة اتصال */
.pmf-dot {
    position: absolute; bottom: 3px; left: 3px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--green); border: 2.5px solid #fff;
}
/* badge عدد الرسائل غير المقروءة */
.pmf-badge {
    position: absolute; top: -2px; right: -4px;
    background: var(--red); color: #fff;
    font-size: 10px; font-weight: 800; font-style: normal;
    min-width: 18px; height: 18px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
    border: 2px solid #fff;
}
/* اسم المحادثة */
.pmf-label {
    background: rgba(24,30,50,.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0px 9px;
    border-radius: 999px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
}

/* توست */
.toast {
    position: absolute; bottom: calc(var(--nav-h) + 20px); left: 50%; transform: translateX(-50%);
    background: #1c1e26; color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 14.5px;
    z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: 90%; text-align: center;
}

/* الإشارة @ وصور الدردشة */
.mention { color: var(--orange); font-weight: 800; background: rgba(14,165,233,.1); border-radius: 6px; padding: 0 4px; }
.m-img { max-width: 240px; max-height: 240px; border-radius: 12px; display: block; margin-top: 3px; cursor: zoom-in; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.m-gif { max-width: 200px; max-height: 200px; border-radius: 10px; display: block; margin-top: 3px; }

/* فقاعات المحادثة الخاصة */
.pmb { display: flex; align-items: flex-end; gap: 7px; margin: 1px 2px; direction: rtl; }
.pmb-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pmb.first { margin-top: 9px; }
.pmb.mine { flex-direction: row-reverse; }
.pm-bubble {
    position: relative; max-width: 78%; min-width: 0;
    background: #fff; color: #1c1e26; border-radius: 16px; border-bottom-right-radius: 5px;
    padding: 8px 12px 5px; box-shadow: 0 1px 2px rgba(20,30,60,.13);
    font-size: 14.5px; font-weight: 500; line-height: 1.6; word-wrap: break-word;
}
.pmb.mine .pm-bubble {
    background: linear-gradient(135deg, #1877f2, #4f93f7); color: #fff;
    border-bottom-right-radius: 16px; border-bottom-left-radius: 5px;
    box-shadow: 0 2px 6px rgba(24,119,242,.3);
}
.pmb.grouped .pm-bubble { border-radius: 16px; }
.pm-text { white-space: pre-wrap; }
.pm-text a { color: inherit; text-decoration: underline; word-break: break-all; }
.pm-text.emoji-big { font-size: 32px; line-height: 1.3; }

/* الوقت وعلامتا الصح داخل الفقاعة */
.pm-meta {
    display: flex; align-items: center; justify-content: flex-end; gap: 4px;
    direction: ltr; margin-top: 2px; font-size: 9.5px; color: #9aa1b1; user-select: none;
}
.pmb.mine .pm-meta { color: rgba(255,255,255,.78); }
.pm-ticks { font-size: 10.5px; }
.pm-ticks.seen { color: #8df1ff; }

/* فقاعة صورة */
.pm-bubble.is-img { padding: 4px; }
.pm-bubble.is-img .pm-img { width: 200px; max-width: 200px; height: 160px; object-fit: cover; border-radius: 13px; display: block; cursor: zoom-in; }
.pm-bubble.is-img .pm-meta {
    position: absolute; bottom: 9px; left: 11px; margin: 0;
    background: rgba(0,0,0,.45); color: #fff; padding: 2px 9px; border-radius: 999px;
}
.pm-bubble.is-img .pm-ticks.seen { color: #8df1ff; }

/* ============ القصص (ستوري) ============ */
.stories-wrap { position: relative; }
.stories-strip {
    display: flex; gap: 10px; overflow-x: auto; padding: 10px 12px 6px; flex-shrink: 0;
    scrollbar-width: none;
}
.stories-strip::-webkit-scrollbar { display: none; }
.stories-scroll-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.92); border: none; border-radius: 50%;
    width: 28px; height: 28px; cursor: pointer; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 6px rgba(0,0,0,.18); font-size: 11px; color: #444;
    transition: opacity .2s;
}
.stories-scroll-btn.left { right: 4px; }
.stories-scroll-btn.right { left: 4px; }
.stories-scroll-btn:hover { background: #fff; }
.story-circle { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 62px; flex-shrink: 0; cursor: pointer; }
.story-circle .ring {
    width: 56px; height: 56px; border-radius: 50%; padding: 3px; position: relative;
    background: linear-gradient(45deg, #38bdf8, #0ea5e9, #6366f1);
}
.story-circle.seen .ring { background: linear-gradient(45deg,#d4a574,#c8956a); opacity: .7; }
.story-circle.add .ring { background: #e2e4ec; }
.story-circle .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2.5px solid #f0f1f6; background: #fff; }
.story-circle .plus {
    position: absolute; bottom: -1px; right: -1px; width: 19px; height: 19px; border-radius: 50%;
    background: var(--blue); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
    border: 2px solid #f0f1f6;
}
.story-circle small { font-size: 10.5px; color: #555c6a; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }

/* عارض القصص */
.story-viewer { position: absolute; inset: 0; background: #0b0d14; z-index: 70; display: flex; flex-direction: column; }
.sv-progress { display: flex; gap: 5px; padding: 10px 12px 0; opacity: 0; transition: opacity .3s; }
#storyViewer:hover .sv-progress,
#storyViewer.progress-visible .sv-progress { opacity: 1; }
.sv-progress i { flex: 1; height: 3px; border-radius: 99px; background: rgba(255,255,255,.3); overflow: hidden; position: relative; }
.sv-progress i b { position: absolute; inset: 0; width: 0; background: #fff; border-radius: 99px; }
.sv-progress i.done b { width: 100%; }
.sv-progress i.cur b { animation: svfill 5s linear forwards; }
@keyframes svfill { from { width: 0; } to { width: 100%; } }
.sv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; }
.sv-head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.sv-meta { flex: 1; }
.sv-meta b { display: block; font-size: 15px; }
.sv-meta small { color: rgba(255,255,255,.7); font-size: 12px; }
.sv-close, .sv-del { color: #fff; font-size: 21px; }
.sv-del { color: #ff7676; font-size: 16px; }
.sv-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.sv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sv-zone { position: absolute; top: 0; bottom: 0; width: 35%; }
.sv-zone.prev { left: 0; }
.sv-zone.next { right: 0; }
.sv-actions-bar { flex-shrink: 0; padding-bottom: 8px; }

/* عارض الصور */
.lightbox { position: absolute; inset: 0; background: rgba(5,8,15,.93); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.lb-close { position: absolute; top: 14px; right: 14px; color: #fff; font-size: 24px; }

/* ============ حسابي ============ */
/* ══════════════════════════════════════════
   مودال الحساب — تصميم جديد
══════════════════════════════════════════ */
.acc-modal-card {
    max-width: 460px; width: 100%;
    display: flex; flex-direction: column;
    max-height: 92dvh; border-radius: 24px;
    overflow: hidden; position: relative;
}
/* زر الإغلاق عائم */
.acc-close-btn {
    position: absolute; top: 12px; left: 14px; z-index: 10;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,.25); color: #fff;
    border: none; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
/* غلاف الهيدر */
.acc-hero { position: relative; flex-shrink: 0; }
.acc-hero-cover {
    height: 80px;
    background: linear-gradient(135deg, var(--blue) 0%, #7c3aed 100%);
}
.acc-hero-body {
    display: flex; align-items: flex-end; gap: 14px;
    padding: 0 18px 12px; margin-top: -36px;
}
/* صورة المستخدم */
.acc-av-wrap { position: relative; flex-shrink: 0; }
.acc-av-wrap img {
    width: 72px; height: 72px; border-radius: 20px;
    object-fit: cover; border: 3px solid var(--card);
    background: var(--card2); box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.acc-av-edit {
    position: absolute; bottom: -5px; right: -5px;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--blue); color: #fff; font-size: 11px;
    border: 2px solid var(--card); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
/* الاسم والرتبة */
.acc-hero-info { flex: 1; padding-bottom: 2px; min-width: 0; }
.acc-hero-name { font-size: 18px; font-weight: 900; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-hero-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.acc-role { display: inline-block; background: var(--blue); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 800; }
.acc-hero-joined { font-size: 11px; color: var(--muted); }
/* إحصائيات (ماس + مستوى) */
.acc-hero-stats { display: flex; gap: 8px; flex-shrink: 0; }
.acc-stat {
    display: flex; flex-direction: column; align-items: center;
    background: var(--card2); border-radius: 12px; padding: 7px 12px;
    min-width: 52px; gap: 2px;
}
.acc-stat i { font-size: 15px; }
.acc-stat b { font-size: 16px; font-weight: 900; color: var(--text); }
.acc-stat span { font-size: 10px; color: var(--muted); font-weight: 700; }
/* XP بار */
.acc-xp-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 18px 12px; border-bottom: 1px solid var(--border);
}
.acc-xp-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.acc-xp-track { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.acc-xp-fill { height: 100%; background: linear-gradient(90deg, var(--blue), #7c3aed); border-radius: 99px; transition: width .4s; }

/* ── تبويبات الحساب ── */
.acc-tabs {
    display: flex; background: var(--card);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.acc-tab {
    flex: 1; padding: 13px 4px 11px; border: none; background: transparent;
    cursor: pointer; display: flex; flex-direction: column;
    align-items: center; gap: 5px; color: var(--muted);
    font-size: 11.5px; font-weight: 700;
    border-bottom: 3px solid transparent; transition: color .15s;
}
.acc-tab i { font-size: 18px; }
.acc-tab.active { color: var(--blue); border-bottom-color: var(--blue); background: var(--bg); }
.acc-tab-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); }
.acc-pane { display: block; }
.acc-pane.hidden { display: none; }

/* ── بطاقات داخل التبويبات ── */
.acc-card {
    background: var(--card); border-radius: 16px;
    padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.acc-card .mv2-sub { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.acc-card .field {
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 12px; display: flex; align-items: center;
    gap: 10px; padding: 10px 14px; margin-bottom: 8px;
    transition: border-color .15s;
}
.acc-card .field:focus-within { border-color: var(--blue); }
.acc-card .field i { color: var(--muted); font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.acc-card .field input,
.acc-card .field textarea,
.acc-card .field select {
    flex: 1; border: none; background: transparent;
    font-family: inherit; font-size: 14px; outline: none; color: var(--text);
}
.acc-card .field select option { background: var(--card); }
.acc-card .field textarea { resize: none; height: 60px; }
.bio-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.btn-primary.full { width: 100%; justify-content: center; margin-top: 4px; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.dot-color { width: 14px; height: 14px; border-radius: 50%; background: #fff; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.gender-row.slim { gap: 8px; }
.gender-row.slim span { padding: 8px 16px; font-size: 14px; }

/* ── شبكة الاختصارات (تبويب المزيد) ── */
.acc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-action-btn {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 16px 8px; background: var(--bg);
    border: 1.5px solid var(--border); border-radius: 16px;
    font-size: 13px; font-weight: 700; color: var(--text);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.acc-action-btn i { font-size: 22px; color: var(--blue); }
.acc-action-btn:active { background: var(--card2); }
.acc-action-btn.danger { color: #ef4444; }
.acc-action-btn.danger i { color: #ef4444; }

/* ── رسالة لا توجد سمايلات ── */
.emoji-empty { text-align: center; padding: 22px 10px; color: var(--muted); }
.emoji-empty i { font-size: 30px; display: block; margin-bottom: 8px; }
.emoji-empty p { font-weight: 700; font-size: 13px; margin: 0 0 4px; }
.emoji-empty small { font-size: 11px; }

.bio-field { position: relative; margin-bottom: 10px; }
.bio-field textarea {
    width: 100%; background: var(--card2); border-radius: 13px; padding: 11px 14px 22px;
    font-family: inherit; font-size: 15px; resize: none; outline: none; border: 0;
    box-shadow: inset 0 0 0 1px #e3e6ee; transition: box-shadow .15s; color: var(--txt);
}
.bio-field textarea:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.bio-count { position: absolute; bottom: 7px; left: 12px; font-size: 11px; color: var(--muted); }
.btn-ghost.sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; }
.btn-ghost.sm.danger { background: #fde5e5; color: var(--red); }

/* شريط تمرير */
.rooms-body, .messages, .panel-list, .menu-body, .modal, .pm-threads, .pm-scroll, #notifList { scrollbar-width: thin; scrollbar-color: #c3c8d6 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c3c8d6; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #a8aec0; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ شاشات أكبر ============ */
@media (min-width: 768px) {
    .emoji-grid { grid-template-columns: repeat(10, 1fr); }
    .avatar-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ============ الحاسوب — مطابق للصور ============ */
@media (min-width: 1024px) {
    .desk-only { display: inline-flex !important; }
    .chat-side.desk-only { display: flex !important; }
    .mob-only { display: none !important; }

    #app { max-width: none; height: 100vh; box-shadow: none; }
    .view { padding-bottom: 0; }
    #view-chat { padding-bottom: 0; }
    #view-pm-chat { padding-bottom: 0; }
    .bottom-nav { display: none !important; }

    /* الخاص على الحاسوب: محتوى متمركز ومريح للعين */
    .pm-scroll { padding: 18px max(10px, calc(50% - 380px)) 20px; }
    .pm-composer .comp-row { max-width: 780px; margin: 0 auto; width: 100%; }

    /* صفحة الغرف: شبكة 4 أعمدة */
    .rooms-header { padding: 12px 22px; }
    .rooms-body { padding: 0 10px 20px; }
    .search-pill { margin: 14px 14px 0; }
    .rooms-list {
        display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
        gap: 13px; padding: 12px 14px;
    }
    .room-icon { width: 72px; height: 72px; font-size: 17px; }
    .room-name { font-size: 18px; }
    .room-desc { font-size: 13px; }

    /* الدردشة */
    .messages { padding: 74px 14px 12px; }
    .m-card { padding-right: 100px; }
    .live-strip { right: calc(var(--side-w) + 14px); }
    .composer { padding: 6px 14px 10px; }
    .comp-row { max-width: none; }

    .scroll-down { right: 20px; }

    /* قائمة خيارات المستخدم: نافذة وسطية صغيرة */
    .sheet-card { max-width: 340px; }

    /* القائمة الرئيسية على الحاسوب:
       تظهر فوق عمود المستخدمين فقط (يمين الشاشة)
       دون تغطية منطقة الدردشة */
    #view-menu {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: var(--side-w);
        flex: none;
        z-index: 30;
        background: var(--bg);
        box-shadow: -6px 0 24px rgba(20,30,60,.13);
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
        animation: slideInMenu .18s ease;
    }
    #view-menu.hidden { display: none !important; }
    @keyframes slideInMenu {
        from { transform: translateX(100%); opacity: 0; }
        to   { transform: translateX(0);    opacity: 1; }
    }
    #view-menu .page-header {
        width: 100%;
        border-radius: 0;
        border-bottom: 1px solid #e8eaf0;
    }
    #view-menu .menu-body {
        width: 100%;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        flex: 1;
        overflow-y: auto;
        padding-bottom: 20px;
    }

    /* المودالات: لوحة سفلية أعرض على الشاشات الكبيرة */
    .modal { background: rgba(15, 20, 40, .45); justify-content: flex-end; padding: 0; }
    .modal-page { max-width: 860px; max-height: 50vh; padding: 0 30px 30px; }
    .modal-head { top: 13px; }

    .icon-btn:hover, .sq-btn:hover { filter: brightness(.93); }
}

@media (max-width: 380px) {
    .room-icon { width: 66px; height: 66px; font-size: 15px; }
    .room-name { font-size: 17px; }
    .gold-grid, .plans-row { grid-template-columns: repeat(2, 1fr); }
    .composer .icon-btn.round { width: 34px; height: 34px; font-size: 17px; }
    .room-pill { max-width: 105px; }
}

/* =====================================================
   مكونات جديدة — الإصدار 2
   ===================================================== */

/* ── شارة المستوى / XP ─────────────────────────────── */
.lv-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #8b7cf6, #6d5edb);
    color: #fff;
    border-radius: 6px;
    padding: 1px 5px;
    margin-right: 4px;
    vertical-align: middle;
}

/* ── شارة الحالة / المود ───────────────────────────── */
.mood-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--muted);
    background: var(--card2);
    border-radius: 8px;
    padding: 1px 6px;
    margin-right: 4px;
    vertical-align: middle;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mood-tag.sm { font-size: 10px; padding: 1px 4px; max-width: 60px; }
.mood-prof {
    display: inline-block;
    font-size: 13px;
    background: var(--card2);
    border-radius: 10px;
    padding: 3px 10px;
    color: var(--muted);
}

/* ── رسالة صوتية ─────────────────────────────────── */
.voice-msg audio {
    width: 220px;
    height: 36px;
    border-radius: 12px;
    background: var(--card2);
    outline: none;
}
.voice-msg { padding: 4px 0; }
.pm-voice audio { width: 200px; height: 34px; border-radius: 10px; }
.pm-voice { padding: 2px 0; }
#btnMic.recording { color: var(--red) !important; }
#pmMic.recording { color: var(--red) !important; }

/* ── قائمة الوسائط (+) ──────────────────────────── */

#mediaPopup {
    position: absolute;
    bottom: 50px;
    right: 50px;
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.14);
    padding: 8px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 245px;
}
.media-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: .12s;
}
.media-item:hover, .media-item:active { background: var(--card2); }
.media-item i { font-size: 18px; color: var(--blue); width: 22px; text-align: center; }

/* ── رابط فيديو (يوتيوب embed) ─────────────────── */
/* ── YouTube Thumbnail Card ── */
.yt-thumb-card {
    display: flex; align-items: center; gap: 10px;
    background: #0f0f0f; border-radius: 12px; overflow: hidden;
    max-width: 300px; margin-top: 6px; cursor: pointer;
    border: 1px solid rgba(255,255,255,.08);
    transition: transform .15s, box-shadow .15s;
}
.yt-thumb-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.yt-thumb-img { position: relative; width: 110px; flex-shrink: 0; aspect-ratio: 16/9; overflow: hidden; }
.yt-thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.3);
}
.yt-thumb-play i { font-size: 28px; color: #fff; drop-shadow: 0 2px 6px rgba(0,0,0,.6); }
.yt-thumb-info { flex: 1; padding: 8px 10px 8px 4px; min-width: 0; }
.yt-thumb-info .yt-lbl { font-size: 10px; color: #ff4444; font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; gap: 4px; }
.yt-thumb-info .yt-url { font-size: 11px; color: #aaa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── YouTube Widget (قابل للسحب) ── */
.yt-modal {
    position: fixed; z-index: 600;
    bottom: 80px; left: 16px;
    width: 320px;
    background: #0f0f0f; border-radius: 14px;
    overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.6);
    animation: mV2Up .25s cubic-bezier(.34,1.1,.5,1);
    user-select: none;
}
.yt-modal.hidden { display: none; }
.yt-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; background: #1a1a1a; cursor: grab;
}
.yt-modal-head:active { cursor: grabbing; }
.yt-modal-title { color: #eee; font-size: 12px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-modal-btns { display: flex; gap: 5px; flex-shrink: 0; margin-right: 6px; }
.yt-btn-min, .yt-btn-close {
    width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 11px;
    transition: background .15s;
}
.yt-btn-min { background: #f59e0b; color: #fff; }
.yt-btn-min:hover { background: #d97706; }
.yt-btn-close { background: #ef4444; color: #fff; }
.yt-btn-close:hover { background: #dc2626; }
.yt-modal-body { aspect-ratio: 16/9; }
.yt-modal-body iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── زر عائم PiP ── */
.yt-pip-btn {
    position: fixed; bottom: 80px; left: 16px;
    z-index: 550; display: flex; align-items: center; gap: 7px;
    background: #ff0000; color: #fff; border: none; border-radius: 24px;
    padding: 8px 14px 8px 12px; font-size: 13px; font-weight: 700;
    cursor: pointer; box-shadow: 0 4px 16px rgba(255,0,0,.4);
    animation: pop .2s ease; max-width: 180px;
    transition: background .15s, transform .15s;
}
.yt-pip-btn:hover { background: #cc0000; transform: translateY(-2px); }
.yt-pip-btn i { font-size: 17px; flex-shrink: 0; }
.yt-pip-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.yt-pip-btn.hidden { display: none; }

.video-embed {
    position: relative;
    width: 100%;
    max-width: 280px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
    margin-top: 4px;
}
.video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.vid-link { color: var(--blue); font-size: 13px; }

/* ── GIF Picker ─────────────────────────────────── */
.gif-picker {
    position: absolute;
    bottom: calc(var(--nav-h) + 56px);
    left: 8px;
    right: 8px;
    max-width: 400px;
    margin: 0 auto;
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 6px 30px rgba(0,0,0,.18);
    z-index: 60;
    overflow: hidden;
    max-height: 360px;
    display: flex;
    flex-direction: column;
}
.gif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--card2);
    font-weight: 700;
}
.gif-head button { font-size: 18px; color: var(--muted); }
.gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
}
.gif-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: .12s;
}
.gif-grid img:hover { transform: scale(1.04); }

/* ── قصة نصية - محرر ───────────────────────────── */
.text-story-editor {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 14px;
}
.tse-preview {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 9/16;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#tseText {
    width: 90%;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    resize: none;
    line-height: 1.5;
    font-family: inherit;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.tse-bgs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}
.tse-bg-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 3px solid transparent;
    transition: .12s;
}
.tse-bg-btn.sel { border-color: #fff; transform: scale(1.15); }
.tse-actions {
    display: flex;
    gap: 10px;
}
.tse-actions button {
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 700;
}
.tse-actions button:first-child { background: rgba(255,255,255,.18); color: #fff; }
.tse-pub { background: var(--blue) !important; color: #fff !important; }

/* ── نافذة إنشاء قصة ───────────────────────────── */
.story-create-sheet {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.scs-card {
    background: var(--card);
    border-radius: 22px 22px 0 0;
    padding: 18px 18px 30px;
    width: 100%;
    max-width: 500px;
}
.scs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 17px;
    font-weight: 700;
}
.scs-head button { font-size: 20px; color: var(--muted); }
.scs-btns { display: flex; gap: 12px; justify-content: center; }
.scs-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--card2);
    border-radius: 14px;
    padding: 18px 24px;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    transition: .12s;
}
.scs-btn i { font-size: 24px; color: var(--blue); }
.scs-btn:active { background: #e0e4f0; }

/* ── قصة الفيديو في المشغل ──────────────────────── */
#svVideoWrap {
    position: absolute;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#svVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── قصة نصية في المشغل ─────────────────────────── */
#svTextStage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}
#svTextBody {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
    word-break: break-word;
}

/* ── شريط التفاعلات في المشغل ──────────────────── */
#svReactions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
}
/* ===== فوتر القصة — نمط فيسبوك ===== */
.sv-footer {
    flex-shrink: 0;
    background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 100%);
    padding: 16px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sv-footer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sv-react-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.sv-react {
    background: rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 13.5px;
    color: #fff;
    backdrop-filter: blur(4px);
}
.sv-react-count {
    background: rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12.5px;
    color: rgba(255,255,255,.9);
    cursor: pointer;
}
.sv-my-react { font-size: 20px; }
.sv-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.sv-act-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 24px;
    padding: 9px 18px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    backdrop-filter: blur(4px);
}
.sv-act-btn:hover, .sv-act-btn:active { background: rgba(255,255,255,.3); }
.sv-act-btn i { font-size: 16px; }
.sv-react-picker {
    position: absolute;
    bottom: 110px;
    right: 16px;
    background: rgba(30,30,40,.9);
    border-radius: 40px;
    padding: 10px 14px;
    display: flex;
    gap: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    z-index: 10;
    backdrop-filter: blur(8px);
}
.sv-react-picker button {
    font-size: 26px;
    padding: 4px;
    transition: transform .12s;
    border-radius: 50%;
}
.sv-react-picker button:hover { transform: scale(1.35); }

/* ── لوحة تعليقات القصة ─────────────────────────── */
.sv-comments-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 65%;
    background: var(--card);
    border-radius: 18px 18px 0 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
}
.sv-cp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card2);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.sv-cp-head button { font-size: 18px; color: var(--muted); }
.sv-cp-list {
    overflow-y: auto;
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sv-comment {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.sv-comment img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.sv-comment b { font-size: 13px; display: block; }
.sv-comment p { font-size: 14px; color: var(--txt); margin-top: 2px; }
.sv-cp-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--card2);
    flex-shrink: 0;
}
.sv-cp-input input {
    flex: 1;
    background: var(--card2);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--txt);
}
.sv-cp-input button {
    width: 36px;
    height: 36px;
    background: var(--blue);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── مشغل القصص: حالة الإيقاف المؤقت ────────────── */
#storyViewer.paused .sv-progress i.cur b { animation-play-state: paused; }
#storyViewer.paused::after {
    content: '⏸';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: .8;
    pointer-events: none;
}

/* ── هدايا اجتماعية ─────────────────────────────── */
.gift-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.gift-modal-card {
    background: var(--card);
    border-radius: 22px 22px 0 0;
    padding: 18px 14px 30px;
    width: 100%;
    max-width: 480px;
}
.gift-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 700;
}
.gift-modal-head button { font-size: 20px; color: var(--muted); }
.gift-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: var(--card2);
    border-radius: 14px;
    padding: 14px 8px;
    transition: .12s;
}
.gift-item:active { background: #d0d5e8; transform: scale(.96); }
.g-emoji { font-size: 28px; }
.g-label { font-size: 13px; font-weight: 600; }
.g-price { font-size: 12px; color: var(--gold); background: rgba(242,169,0,.1); border-radius: 8px; padding: 2px 7px; }

/* هدايا في الملف الشخصي */
/* لوحة أكثر المرسلين */
.gift-lb-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gift-lb-card {
    background: var(--card);
    border-radius: 18px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.gift-lb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--card2);
    font-weight: 700;
    font-size: 15px;
}
.gift-lb-head button { font-size: 18px; color: var(--muted); }
.gift-lb-list {
    list-style: none;
    padding: 10px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gift-lb-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}
.gift-lb-list li img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.gift-lb-list li b { color: var(--muted); font-size: 12px; min-width: 20px; }
.lb-gold { margin-right: auto; color: var(--gold); font-size: 13px; font-weight: 700; }

/* ── ملف شخصي: شريط XP ──────────────────────────── */
/* شريط XP في القائمة */
.menu-xp-wrap { padding: 6px 16px 12px; }
.menu-xp-bar-bg { height: 6px; background: rgba(255,255,255,.18); border-radius: 10px; overflow: hidden; margin-top: 5px; }
.menu-xp-bar { height: 100%; background: linear-gradient(90deg, #8b7cf6, #6d5edb); border-radius: 10px; transition: width .4s; }
#menuLevelTxt { font-size: 11px; color: rgba(255,255,255,.65); }

/* ── رسائل بحالة "جاري الإرسال" (optimistic) ───── */
.msg.sending { opacity: .65; }
.msg.sending .b-time { color: var(--muted); }

/* ── لون الغلاف في الملف ────────────────────────── */
#profCover {
    transition: background .3s;
}

/* ── diamond icon in profile stats ─────────────── */
.ps-icon.diamond { background: linear-gradient(135deg, #0ea5e9, #4fc3f7); }
.lb-diamond { margin-right: auto; color: var(--diamond, #4fc3f7); font-size: 13px; font-weight: 700; }

/* ── footer hide on input focus ─────────────────── */
#bottomNav.input-focus { display: none !important; }
#view-chat.keyboard-open { padding-bottom: 0 !important; }

/* ── media popup (+ button popup) ───────────────── */
/* media-popup styles moved to end of file (item 10) */

/* ── media search modal ──────────────────────────── */
.media-modal-bg {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.media-modal-card {
    background: var(--card);
    width: 100%;
    max-width: 540px;
    border-radius: 20px 20px 0 0;
    padding: 16px 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.media-modal-head {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.mm-close {
    margin-right: auto;
    background: none; border: none; font-size: 18px;
    color: var(--muted); cursor: pointer; padding: 4px 8px;
    line-height: 1;
}
.mm-tab {
    flex: 1; padding: 8px 6px;
    font-size: 13px; font-weight: 700;
    background: none; border: none;
    border-bottom: 3px solid transparent;
    color: var(--muted); cursor: pointer;
    transition: color .15s, border-color .15s;
    border-radius: 8px 8px 0 0;
}
.mm-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(24,119,242,.06); }
.mm-search-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
}
.mm-search {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 10px; padding: 0 12px;
}
.mm-search i { color: var(--muted); font-size: 13px; }
.mm-search input {
    flex: 1; padding: 9px 0;
    border: none; background: transparent;
    font-size: 14px; color: var(--txt);
    font-family: inherit; outline: none;
}
.mm-search-btn {
    padding: 9px 14px; border-radius: 10px;
    background: var(--primary); color: #fff;
    border: none; font-size: 14px; font-weight: 700; cursor: pointer;
    flex-shrink: 0;
}
.mm-empty {
    text-align: center; padding: 40px 20px;
    color: var(--muted); font-size: 14px;
}
.mm-empty i { font-size: 36px; display: block; margin-bottom: 10px; opacity: .4; }
.mm-loading { text-align: center; padding: 30px; color: var(--muted); font-size: 24px; }
.mm-results {
    flex: 1; overflow-y: auto;
    padding: 0 16px 16px;
}
.mm-gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.mm-gif-grid img {
    width: 100%; aspect-ratio: 1;
    object-fit: cover; border-radius: 8px;
    cursor: pointer; transition: transform .15s, opacity .15s;
}
.mm-gif-grid img:hover { transform: scale(1.04); opacity: .9; }
.mm-video-list { display: flex; flex-direction: column; gap: 10px; }
.mm-video-item {
    display: flex; gap: 10px; align-items: center;
    padding: 10px; border-radius: 12px;
    background: var(--bg); cursor: pointer;
    transition: background .15s;
}
.mm-video-item:hover { background: var(--card2); }
.mm-video-thumb {
    width: 72px; height: 48px; border-radius: 8px;
    object-fit: cover; flex-shrink: 0;
    background: #222;
}
.mm-video-title {
    font-size: 13px; font-weight: 600;
    color: var(--text); line-height: 1.3;
    overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* يوتيوب شبكة نتائج */
.mm-yt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.mm-yt-card {
    border-radius: 12px; overflow: hidden;
    background: var(--bg); cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.mm-yt-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.13); }
.mm-yt-thumb { position: relative; aspect-ratio: 16/9; background: #111; }
.mm-yt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mm-yt-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.3); opacity: 0; transition: opacity .15s;
    font-size: 24px; color: #fff;
}
.mm-yt-card:hover .mm-yt-play { opacity: 1; }
.mm-yt-title {
    padding: 6px 8px 8px;
    font-size: 12px; font-weight: 600; line-height: 1.35;
    overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* إدخال مباشر (رابط يوتيوب/تيك توك) */
.mm-direct-input {
    width: 100%; padding: 9px 12px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--bg);
    font-size: 13px; font-family: inherit; color: var(--txt);
    direction: ltr; text-align: left; outline: none; margin-bottom: 8px;
    display: block;
}
.mm-direct-input:focus { border-color: var(--primary); }
.mm-send-direct {
    padding: 9px 20px; border-radius: 10px;
    background: var(--primary); color: #fff;
    font-size: 13px; font-weight: 700; border: none; cursor: pointer;
}
.mm-loading { text-align: center; padding: 30px; color: var(--muted); font-size: 15px; gap: 8px; display: flex; flex-direction: column; align-items: center; }
.mm-loading i { font-size: 28px; }
/* تيك توك - إدخال رابط + معاينة */
.mm-tt-input-wrap { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.mm-tt-hint { color: var(--muted); font-size: 13px; margin: 0; text-align: center; }
.mm-tt-hint i { color: #000; margin-left: 4px; }
.mm-tt-preview { display: flex; gap: 12px; padding: 12px; }
.mm-tt-prev-img { width: 100px; min-width: 100px; height: 150px; object-fit: cover; border-radius: 10px; }
.mm-tt-no-thumb-lg { width: 100px; min-width: 100px; height: 150px; background: #111; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 36px; color: #fff; }
.mm-tt-prev-info { display: flex; flex-direction: column; gap: 6px; }
.mm-tt-prev-info p { font-size: 12px; line-height: 1.4; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.mm-tt-author { color: var(--primary); font-size: 11px; font-weight: 700; }

/* ── voice recording modal ───────────────────────── */
.voice-modal-bg {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
}
.voice-modal-card {
    background: var(--card);
    border-radius: 24px;
    padding: 28px 24px 24px;
    width: 320px;
    max-width: 92vw;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.vm-title {
    font-size: 16px; font-weight: 800;
    margin-bottom: 20px; color: var(--text);
}
.vm-wave {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 0 16px;
}
.vm-wave span {
    width: 5px; border-radius: 4px;
    background: var(--primary);
    animation: vmBounce 0.6s ease-in-out infinite alternate;
    min-height: 6px;
}
.vm-wave span:nth-child(2) { animation-delay: .1s; }
.vm-wave span:nth-child(3) { animation-delay: .2s; }
.vm-wave span:nth-child(4) { animation-delay: .3s; }
.vm-wave span:nth-child(5) { animation-delay: .2s; }
.vm-wave span:nth-child(6) { animation-delay: .1s; }
.vm-wave span:nth-child(7) { animation-delay: .05s; }
@keyframes vmBounce {
    from { height: 8px; }
    to   { height: 48px; }
}
.vm-wave.idle span { animation: none; height: 8px; }
.vm-timer {
    font-size: 28px; font-weight: 900;
    color: var(--text); letter-spacing: 2px;
    margin-bottom: 20px; font-variant-numeric: tabular-nums;
}
.vm-actions {
    display: flex; gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}
.vm-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 11px 20px; border-radius: 50px;
    font-size: 14px; font-weight: 700;
    border: none; cursor: pointer; transition: .15s;
}
.vm-btn.rec  { background: #ef4444; color: #fff; }
.vm-btn.stop { background: #f97316; color: #fff; }
.vm-btn.send { background: var(--primary); color: #fff; }
.vm-btn.cancel { background: var(--bg); color: var(--muted); }
.vm-btn.listen { background: #8b7cf6; color: #fff; }

/* ── custom voice audio player ───────────────────── */
.voice-player {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg);
    border-radius: 24px;
    padding: 8px 14px;
    min-width: 180px;
    max-width: 260px;
}
.vp-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff;
    border: none; font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background .15s;
}
.vp-btn:hover { background: #1460cc; }
.vp-bar {
    flex: 1; height: 4px;
    background: rgba(0,0,0,.12);
    border-radius: 4px; cursor: pointer;
    position: relative;
}
.vp-progress {
    height: 100%; border-radius: 4px;
    background: var(--primary);
    width: 0%;
    transition: width .1s linear;
    pointer-events: none;
}
.vp-time {
    font-size: 11px; font-weight: 700;
    color: var(--muted); white-space: nowrap;
    min-width: 38px; text-align: left;
}

/* ── gift badge in chat ───────────────────────────── */
.chat-gift-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    color: #92400e;
    padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 800;
    margin: 4px auto; text-align: center;
}



/* ═══════════════════════════════════════════════════════
   LiveKit — لوحة الغرفة الصوتية
   ═══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════
   شريط الغرفة الصوتية (مدمج في أعلى منطقة الدردشة)
   ═══════════════════════════════════════════════════════ */
/* ══ شريط الصوت الجديد ══ */
.voice-strip {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg,#1a1f3a 0%,#0f1729 100%);
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 2px 20px rgba(0,0,0,.3);
    flex-shrink: 0;
}
.vs-waves-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0;
}
.vs-inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
}
.vs-participants {
    display: flex; gap: 8px; flex: 1;
    overflow-x: auto;
}
.vs-participants::-webkit-scrollbar { display: none; }
.vs-participant {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; cursor: default; flex-shrink: 0;
    min-width: 40px;
}
.vs-av-wrap { position: relative; }
.vs-participant.vs-speaking .vs-av {
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74,222,128,.35);
}
.vs-participant.me .vs-av { border-color: #60a5fa; }
.vs-mic {
    position: absolute; bottom: -2px; right: -2px;
    background: rgba(15,23,42,.85); color: #fff;
    width: 14px; height: 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 7px; border: 1px solid rgba(255,255,255,.15);
}
.vs-mic.muted { background: #ef4444; }
.vs-name {
    font-size: 9px; color: rgba(255,255,255,.8);
    text-align: center; max-width: 40px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: none;
}
.vs-participant.mic-open .vs-name { display: block; }
.vs-av {
    width: 34px; height: 34px; border-radius: 50%;
    object-fit: cover; border: 2px solid rgba(255,255,255,.1);
    transition: border-color .2s, filter .2s;
    filter: blur(3px) grayscale(.6) brightness(.7);
}
.vs-participant.mic-open .vs-av { filter: none; border-color: rgba(255,255,255,.25); }
.vs-controls { display: flex; gap: 6px; flex-shrink: 0; }
.vs-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1877f2;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255,255,255,.15);
    cursor: pointer;
    transition: background .15s, transform .1s, box-shadow .15s;
}
.vs-ctrl-btn:hover { background: #7daae4; }
.vs-ctrl-btn:active { transform: scale(.9); }
.vs-ctrl-btn.active { background: #22c55e; border-color: #16a34a; box-shadow: 0 0 12px rgba(34,197,94,.4); }
.vs-ctrl-btn.mute-all.active { background: #ef4444; border-color: #dc2626; box-shadow: 0 0 12px rgba(239,68,68,.4); }
/* مخفي حتى يبدأ التحدث */
#vsMic { display: none; }

/* ═══════════════════════════════════════════════════════
   شراء غرفة / إدارة الغرفة
   ═══════════════════════════════════════════════════════ */
.buy-room-hero {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg,#1877f2,#0d5bd9);
    border-radius: 16px; padding: 16px; margin-bottom: 16px; color: #fff;
}
.brh-icon { font-size: 32px; }
.brh-info b { font-size: 15px; display: block; }
.brh-info small { opacity: .8; font-size: 12px; }
.member-packages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pkg-btn {
    padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 700;
    background: var(--card2); color: var(--txt); border: 2px solid var(--border);
    cursor: pointer; transition: all .15s;
}
.pkg-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.buy-room-cost-box {
    background: var(--card2); border-radius: 14px; padding: 14px; margin: 14px 0;
}
.brc-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; padding: 4px 0;
}
.brc-row.total { font-size: 17px; font-weight: 800; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; color: var(--blue); }
.buy-room-cost {
    font-size: 15px; text-align: center;
    padding: 12px; background: var(--card2); border-radius: 12px;
    margin: 12px 0; font-weight: 700;
}
.mod-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.mod-row img { width: 36px; height: 36px; border-radius: 50%; }
.mod-row .mod-exp { flex: 1; font-size: 12px; color: var(--muted); }
.btn-sm {
    padding: 5px 12px; border-radius: 8px; font-size: 12px;
    background: var(--blue); color: #fff; cursor: pointer;
    border: none; font-family: inherit;
}
.btn-sm.danger { background: var(--red); }

/* ═══════════════════════════════════════════════════
   send-wait modal (item 16)
═══════════════════════════════════════════════════ */
.send-wait-modal {
    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
    background: rgba(30,30,40,.9); color: #fff;
    padding: 10px 20px; border-radius: 22px;
    font-size: 14px; z-index: 9999;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 18px rgba(0,0,0,.28);
    animation: swmIn .2s ease;
    transition: opacity .4s ease;
    white-space: nowrap;
    pointer-events: none;
}
.send-wait-modal.fading { opacity: 0; }
@keyframes swmIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }

/* ═══════════════════════════════════════════════════
   page loading screen (item 12)
═══════════════════════════════════════════════════ */
#pageLoader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg, #f0f4fb);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px;
    transition: opacity .4s ease;
}
#pageLoader.fade-out { opacity: 0; pointer-events: none; }
.page-loader-logo { width: 64px; height: 64px; border-radius: 18px; }
.page-loader-spinner {
    width: 36px; height: 36px;
    border: 3.5px solid rgba(24,119,242,.18);
    border-top-color: var(--blue, #1877f2);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader-text { font-size: 13px; color: var(--muted, #888); }

/* ajax loading overlay used inside modals */
.loading-overlay {
    position: absolute; inset: 0; background: rgba(255,255,255,.7);
    display: flex; align-items: center; justify-content: center;
    border-radius: inherit; z-index: 5;
    backdrop-filter: blur(2px);
}
.loading-spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(24,119,242,.2);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* ═══════════════════════════════════════════════════
   profile modal v2 (item 2 — extra fields)
═══════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════
   color picker — name + text colors (item 4)
═══════════════════════════════════════════════════ */
.color-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.color-tab-btn {
    flex: 1; padding: 6px 8px; border-radius: 10px;
    border: 1.5px solid var(--border); background: transparent;
    cursor: pointer; font-size: 12px; font-family: inherit;
    transition: .15s;
}
.color-tab-btn.active { border-color: var(--blue); color: var(--blue); font-weight: 700; }

/* ═══════════════════════════════════════════════════
   room details panel / announcement (items 5,6,8)
═══════════════════════════════════════════════════ */
.room-details-modal .rd-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; padding: 12px 0;
}
.rd-stat { background: var(--card2); border-radius: 12px; padding: 10px; text-align: center; }
.rd-stat b { display: block; font-size: 18px; }
.rd-stat small { font-size: 11px; color: var(--muted); }
.rd-top-users { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.rd-top-row { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--card2); border-radius: 12px; }
.rd-top-row img { width: 36px; height: 36px; border-radius: 50%; }
.rd-top-rank { font-size: 18px; min-width: 24px; text-align: center; }
.rd-level-hero {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 16px 0 8px;
}
.rd-level-num {
    font-size: 48px; font-weight: 900; line-height: 1;
    background: linear-gradient(135deg,var(--gold,#f59e0b),#fbbf24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.rd-level-info { text-align: right; }
.rd-level-label { font-size: 13px; color: var(--muted); }
.rd-level-desc { font-size: 14px; font-weight: 700; }

/* announcement system message */
.msg-announcement {
    text-align: center; padding: 10px 16px; margin: 6px 0;
    background: linear-gradient(135deg,rgba(245,158,11,.12),rgba(251,191,36,.08));
    border-radius: 14px; border: 1.5px solid rgba(245,158,11,.3);
    color: #92400e; font-weight: 700; font-size: 14px;
}
.msg-announcement i { color: #f59e0b; margin-left: 6px; }

/* ═══════════════════════════════════════════════════
   + media popup v2 — above input (item 10)
═══════════════════════════════════════════════════ */
.media-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    background: var(--bg);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
    padding: 12px;
    z-index: 40;
    border: 1px solid var(--border);
    animation: mpUp .2s cubic-bezier(.34,1.1,.5,1);
    min-width: 240px;
}
@keyframes mpUp { from { opacity: 0; transform: translateY(12px) scale(.94); } }
.mp-grid {
    display: grid;
    grid-template-columns: repeat(4, 55px);
    gap: 2px;
}
.mp-grid-label {
    grid-column: 1 / -1;
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: .03em;
    padding: 2px 0 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}
.media-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; aspect-ratio: 1; border-radius: 14px;
    cursor: pointer; gap: 4px;
    background: var(--card2);
    transition: .15s;
    border: 1.5px solid transparent;
    padding: 8px 4px;
}
.media-item:hover { transform: scale(1.08); border-color: var(--blue); background: var(--card3, var(--card2)); }
.media-item i { font-size: 20px; }
.media-item span { font-size: 10px; color: var(--muted); font-weight: 600; }
.media-item[data-type="youtube"] i { color: #ff0000; }
.media-item[data-type="gif"] i { color: #7c3aed; }
.media-item[data-type="photo"] i { color: #059669; }
.media-item[data-type="voice"] i { color: #0ea5e9; }
.media-item[data-type="room"] i { color: #f59e0b; }
.media-item[data-type="announce"] i { color: #dc2626; }
.media-item[data-type="gifts_top"] i { color: #e11d48; }
.media-item[data-type="likes_top"] i { color: #8b5cf6; }

/* ═══════════════════════════════════════════════════
   leaderboard modal (items 6, 7)
═══════════════════════════════════════════════════ */
.lb-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.lb-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.lb-rank { font-size: 22px; min-width: 32px; text-align: center; }
.lb-info { flex: 1; }
.lb-name { font-weight: 700; font-size: 14px; }
.lb-sub { font-size: 12px; color: var(--muted); }
.lb-val { font-weight: 800; color: var(--blue); }

/* ═══════════════════════════════════════════════════
   voice strip v2 — glassmorphism (item 14)
═══════════════════════════════════════════════════ */
.voice-strip {
    background: rgba(255,255,255,.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,.5);
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.vs-participant .vs-av img { transition: .2s; }
.vs-participant.muted .vs-av img { filter: grayscale(.5); }
.vs-name-reveal { display: none; }
.vs-participant.speaking .vs-name-reveal,
.vs-participant.mic-open .vs-name-reveal { display: block; }

/* ═══════════════════════════════════════════════════
   room level v2 — professional (item 17)
═══════════════════════════════════════════════════ */
.room-level-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px 3px 8px; border-radius: 20px;
    font-size: 11.5px; font-weight: 800;
    color: #fff; vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    border: 1.5px solid rgba(255,255,255,.25);
    line-height: 1.4;
}
.rlp-label { font-size: 10.5px; opacity: .92; }
.rlp-1 { background: linear-gradient(135deg,#475569,#94a3b8); }
.rlp-2 { background: linear-gradient(135deg,#2563eb,#60a5fa); box-shadow: 0 2px 10px rgba(37,99,235,.35); }
.rlp-3 { background: linear-gradient(135deg,#7c3aed,#a78bfa); box-shadow: 0 2px 10px rgba(124,58,237,.35); }
.rlp-4 { background: linear-gradient(135deg,#d97706,#fbbf24); box-shadow: 0 2px 10px rgba(217,119,6,.35); }
.rlp-5 { background: linear-gradient(135deg,#dc2626,#f87171); box-shadow: 0 0 12px rgba(220,38,38,.5); animation: rlp5pulse 2s infinite; }
@keyframes rlp5pulse { 0%,100% { box-shadow: 0 0 12px rgba(220,38,38,.5); } 50% { box-shadow: 0 0 20px rgba(220,38,38,.8); } }
.room-level-card {
    background: linear-gradient(135deg,var(--card2),var(--card));
    border-radius: 14px; padding: 14px 16px;
    border: 1.5px solid var(--border); margin: 8px 0;
}
.rlc-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rlc-label { font-size: 12px; color: var(--muted); }
.rlc-bar-bg { height: 6px; background: var(--border); border-radius: 3px; }
.rlc-bar { height: 6px; background: linear-gradient(90deg,var(--blue),#60a5fa); border-radius: 3px; transition: width .5s ease; }

/* ═══════════════════════════════════════════════════
   story ring — skin/beige when viewed (item 19)
═══════════════════════════════════════════════════ */
.story-av.seen { --ring: #d4a574; }
.story-av.seen .story-ring { border-color: #d4a574 !important; opacity: .65; }

/* ═══════════════════════════════════════════════════
   modal redesign v2 (item 18) — centered, card style
═══════════════════════════════════════════════════ */
.modal-v2 {
    position: fixed; inset: 0;
    background: rgba(10,12,24,.55);
    z-index: 50; display: flex;
    align-items: center; justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: mV2Fade .2s ease;
}
@keyframes mV2Fade { from { opacity: 0; } }
.modal-v2-card {
    background: var(--bg);
    border-radius: 22px;
    width: 100%; max-width: 420px;
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: mV2Up .28s cubic-bezier(.34,1.1,.5,1);
    padding: 0 0 20px;
}
@keyframes mV2Up { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.mv2-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg); z-index: 1;
}
.mv2-head h3 { font-size: 17px; font-weight: 800; margin: 0; }
.mv2-close { background: var(--card2); border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.mv2-body { padding: 14px 16px; }
.mv2-section { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 6px; }
.mv2-note { background: var(--card2); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.mv2-note i { color: var(--blue); margin-top: 2px; flex-shrink: 0; }
.mv2-sub { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 10px; }
.mv2-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ═══════════════════════════════════════════════════
   account modal v2 (item 3) — larger, centered
═══════════════════════════════════════════════════ */
#modalAccount.modal-v2 .modal-v2-card { max-width: 500px; }

/* ═══════════════════════════════════════════════════
   story controls list (item 19)
═══════════════════════════════════════════════════ */
.story-manage-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.story-manage-row img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.smr-info { flex: 1; min-width: 0; }
.smr-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smr-ago { font-size: 11px; color: var(--muted); }
.smr-btns { display: flex; gap: 6px; }
.smr-btn {
    background: var(--card2); border: none; border-radius: 8px;
    padding: 5px 9px; font-size: 12px; cursor: pointer;
    display: flex; align-items: center; gap: 4px; color: var(--muted);
    white-space: nowrap;
}
.smr-btn:hover { background: var(--border); }

/* ═══════════════════════════════════════
   الملف الشخصي v2 — مودل مركزي بتبويبات
   ═══════════════════════════════════════ */
/* ═══════════════════════════════════════
   تفاصيل الغرفة v2 — تبويبات
   ═══════════════════════════════════════ */
.rd-v2-card { max-width: 400px; padding: 0 !important; border-radius: 22px; }
.rd-v2-header {
    background: linear-gradient(135deg,#1877f2,#8b7cf6);
    color: #fff; padding: 18px 16px 14px;
    border-radius: 22px 22px 0 0;
    position: relative; text-align: center;
}
.rd-v2-title { font-size: 17px; font-weight: 800; }
.rd-v2-header .mv2-close {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0,0,0,.25); color: #fff;
    border-radius: 50%; width: 30px; height: 30px;
    font-size: 16px; font-weight: 400;
    display: flex; align-items: center; justify-content: center;
}
.rd-v2-tabs {
    display: flex; border-bottom: 1.5px solid var(--border);
    background: var(--card);
}
.rd-v2-tab {
    flex: 1; padding: 10px; font-size: 13px; font-weight: 700;
    color: var(--muted); border-bottom: 2.5px solid transparent;
    transition: .15s; margin-bottom: -1.5px;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.rd-v2-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.rd-v2-pane { padding: 16px; }
.rd-level-hero {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 16px;
    margin-bottom: 14px;
    background: linear-gradient(135deg,var(--card2),var(--card));
    border: 1.5px solid var(--border);
}
.rd-level-hero.rlp-2 { background: linear-gradient(135deg,rgba(37,99,235,.1),rgba(96,165,250,.08)); border-color: rgba(37,99,235,.3); }
.rd-level-hero.rlp-3 { background: linear-gradient(135deg,rgba(124,58,237,.1),rgba(167,139,250,.08)); border-color: rgba(124,58,237,.3); }
.rd-level-hero.rlp-4 { background: linear-gradient(135deg,rgba(217,119,6,.1),rgba(251,191,36,.08)); border-color: rgba(217,119,6,.3); }
.rd-level-hero.rlp-5 { background: linear-gradient(135deg,rgba(220,38,38,.1),rgba(248,113,113,.08)); border-color: rgba(220,38,38,.3); }
.rd-lh-icon { font-size: 32px; line-height: 1; }
.rd-lh-label { font-size: 11px; color: var(--muted); font-weight: 700; }
.rd-lh-name { font-size: 20px; font-weight: 900; }
.rd-stats {
    display: flex; gap: 8px; margin-bottom: 4px;
}
.rd-stat {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--card2); border-radius: 14px; padding: 12px 6px;
    border: 1px solid var(--border);
}
.rd-stat i { font-size: 16px; color: var(--blue); }
.rd-stat b { font-size: 16px; font-weight: 800; }
.rd-stat small { font-size: 10.5px; color: var(--muted); }
.rd-top-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.rd-top-row:last-child { border-bottom: none; }
.rd-top-rank { font-size: 20px; width: 28px; text-align: center; }
.rd-top-av { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.rd-top-info { flex: 1; }
.rd-top-name { font-size: 14px; font-weight: 700; }
.rd-top-count { font-size: 11px; color: var(--muted); }

/* ═══════════════════════════════════════
   مودال شراء الغرفة — تصميم الخطوات
═══════════════════════════════════════ */
.buy-room-card { max-width: 480px; }

/* شريط الخطوات */
.br-steps {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 24px; padding: 0 4px;
}
.br-step {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    flex-shrink: 0;
}
.br-step-num {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800;
    background: var(--card2); border: 2px solid var(--border); color: var(--muted);
    transition: all .25s;
}
.br-step-lbl {
    font-size: 10px; color: var(--muted); font-weight: 700; white-space: nowrap;
}
.br-step.active .br-step-num { background: var(--blue); border-color: var(--blue); color: #fff; }
.br-step.done .br-step-num { background: #22c55e; border-color: #22c55e; color: #fff; }
.br-step.done .br-step-num::after { content: '✓'; }
.br-step.done .br-step-num span { display: none; }
.br-step-line { flex: 1; height: 2px; background: var(--border); margin: 0 4px; margin-bottom: 16px; transition: background .25s; }

.br-page-title {
    font-size: 15px; font-weight: 800; color: var(--text); margin: 0 0 16px; text-align: center;
}

/* بطاقات النوع */
.br-type-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px;
}
.br-type-card {
    border: 2px solid var(--border); border-radius: 16px;
    padding: 20px 12px; text-align: center; cursor: pointer;
    transition: all .2s; background: var(--card2);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.br-type-card:hover { border-color: var(--blue); }
.br-type-card.active { border-color: var(--blue); background: rgba(59,130,246,.07); }
.brtc-icon {
    width: 56px; height: 56px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.brtc-icon.text-type { background: rgba(59,130,246,.12); color: var(--blue); }
.brtc-icon.voice-type { background: rgba(16,185,129,.12); color: #10b981; }
.br-type-card b { font-size: 15px; font-weight: 800; }
.br-type-card small { font-size: 11px; color: var(--muted); }

/* حقل الاسم */
.br-field { margin-bottom: 16px; }
.br-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.br-field input {
    width: 100%; box-sizing: border-box;
    padding: 11px 14px; border-radius: 12px;
    border: 1.5px solid var(--border); background: var(--card2);
    font-size: 14px; color: var(--text); outline: none;
    transition: border-color .2s;
}
.br-field input:focus { border-color: var(--blue); }

/* شبكة باقات الأعضاء */
.br-pkg-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px;
}
.br-pkg-card {
    border: 2px solid var(--border); border-radius: 14px;
    padding: 14px 6px; text-align: center; cursor: pointer;
    background: var(--card2); transition: all .2s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.br-pkg-card:hover { border-color: var(--blue); }
.br-pkg-card.active { border-color: var(--blue); background: rgba(59,130,246,.07); }
.br-pkg-card b { font-size: 17px; font-weight: 900; }
.br-pkg-card small { font-size: 10px; color: var(--muted); }

/* شبكة خيارات المدة */
.br-dur-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px;
}
.br-dur-card {
    border: 2px solid var(--border); border-radius: 14px;
    padding: 16px 10px; text-align: center; cursor: pointer;
    background: var(--card2); transition: all .2s;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.br-dur-card:hover { border-color: var(--blue); }
.br-dur-card.active { border-color: var(--blue); background: rgba(59,130,246,.07); }
.brd-icon { font-size: 22px; line-height: 1; }
.br-dur-card b { font-size: 14px; font-weight: 800; }
.br-dur-card small { font-size: 10.5px; color: var(--muted); }

/* ملخص الخطوة 4 */
.br-summary {
    background: var(--card2); border-radius: 16px;
    padding: 14px 16px; margin-bottom: 18px;
    border: 1.5px solid var(--border);
}
.br-sum-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; font-size: 14px;
}
.br-sum-row i { width: 18px; color: var(--blue); text-align: center; }
.br-sum-row span { flex: 1; color: var(--muted); font-size: 13px; }
.br-sum-row b { font-weight: 800; }
.br-sum-divider { height: 1px; background: var(--border); margin: 6px 0; }
.br-sum-row.balance b { color: #0ea5e9; }
.br-sum-row.total { background: rgba(59,130,246,.05); border-radius: 10px; padding: 10px 8px; margin-top: 4px; }
.br-sum-row.total b { color: var(--blue); font-size: 18px; }
.br-sum-row.total i { color: var(--blue); }

/* أزرار التنقل */
.br-nav {
    display: flex; gap: 10px; justify-content: flex-end;
}
.btn-buy {
    background: linear-gradient(135deg, #1877f2, #0ea5e9);
    color: #fff; border: none; border-radius: 12px;
    padding: 11px 22px; font-size: 14px; font-weight: 800;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: opacity .2s;
}
.btn-buy:hover { opacity: .9; }

/* ═══════════════════════════════════════
   إصلاحات z-index وعمومية
═══════════════════════════════════════ */
/* السمايلات دائماً فوق كل شيء بما فيه PM windowed */
#emojiPopup, #colorPopup { z-index: 300; }

/* علامة الكتم في قائمة المستخدمين */
.u-muted-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: #ef4444; color: #fff; font-size: 8px;
    margin-right: 3px; vertical-align: middle;
}
.u-mod-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%;
    background: #0ea5e9; color: #fff; font-size: 8px;
    margin-right: 3px; vertical-align: middle;
}
.u-guest-badge {
    display: inline-block; font-size: 10px; font-weight: 600;
    color: #92400e; background: #fef3c7; border: 1px solid #fcd34d;
    border-radius: 6px; padding: 1px 6px; margin-top: 2px;
}
.u-row-guest .u-name { color: #78716c !important; font-weight: 600; }
.u-row-guest .av-wrap img { opacity: .85; }
.av-muted-overlay {
    position: absolute; bottom: -3px; right: -3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #ef4444; color: #fff; font-size: 8px;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--bg);
}
.av-wrap { position: relative; }

/* تبويبات نوع اللون في colorPopup */
.color-type-tabs {
    display: flex; gap: 6px; padding: 8px 12px 4px;
}
.ctt-btn {
    flex: 1; padding: 7px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--card2);
    font-size: 12px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    color: var(--muted); transition: all .15s;
}
.ctt-btn.active { border-color: var(--blue); background: rgba(59,130,246,.08); color: var(--blue); }
.color-preview-row {
    display: flex; justify-content: space-around; padding: 6px 12px 8px;
    font-size: 12px; color: var(--muted);
}
.color-preview-row b { font-size: 14px; font-weight: 800; }

/* زر إزالة التثبيت */
#pinnedBarUnpin {
    background: rgba(239,68,68,.1); border: none; border-radius: 8px;
    color: #ef4444; padding: 4px 8px; font-size: 11px; cursor: pointer;
    margin-left: 6px; transition: background .15s;
}
#pinnedBarUnpin:hover { background: rgba(239,68,68,.2); }

/* الملف الشخصي فوق كل شيء */
#modalProfile, .modal-v2 { z-index: 350; }
#modalConfirm { z-index: 500; }
#lightbox { z-index: 400; }

/* قائمة ثلاث نقاط PM فوق المحادثة */
#pmOptsSheet { z-index: 500; }

/* عناوين المجموعات في cmdSheet */
.sheet-sub-title {
    font-size: 11px; font-weight: 700; color: var(--muted);
    padding: 6px 16px 2px; text-transform: uppercase; letter-spacing: .5px;
}
.sheet-group { margin-bottom: 4px; }
.sheet-group + .sheet-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }

/* شريط الرد — معاينة الرسالة الأصلية */
.reply-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; background: rgba(59,130,246,.06);
    border-right: 3px solid var(--blue); font-size: 13px;
}
.reply-bar-preview {
    flex: 1; overflow: hidden;
}
.reply-bar-name { font-weight: 800; color: var(--blue); font-size: 12px; display: block; }
.reply-bar-body { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* sheets فوق PM windowed */
.sheet { z-index: 600 !important; }
/* الملف الشخصي فوق كل شيء */
#modalProfile { z-index: 700 !important; }

/* ---- غرفة ممتلئة ---- */
.room-card.room-full, .p-room.room-full { opacity: .6; cursor: not-allowed; }
.room-card.room-full .room-icon, .p-room.room-full .room-icon { filter: grayscale(60%); }
.room-full-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; color: var(--red);
    background: rgba(var(--red-rgb,220,38,38),.1);
    padding: 2px 7px; border-radius: 20px; margin-right: 4px;
}

/* ---- تبويبات قائمة الأوامر ---- */
.cmd-head { padding: 12px 16px 0; background: #fff; border-radius: 14px 14px 0 0; }
.cmd-tabs {
    display: flex; gap: 4px; padding: 8px 0 0;
    border-bottom: 1.5px solid var(--border);
    margin: 0 -2px;
}
.cmd-tab {
    flex: 1; padding: 7px 4px; border: none; background: transparent;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    cursor: pointer; border-radius: 8px 8px 0 0;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
    transition: color .2s, border-color .2s;
}
.cmd-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.cmd-tab i { font-size: 13px; }
.cmd-pane { background: #fff; }
.cmd-pane:last-of-type { border-radius: 0 0 14px 14px; overflow: hidden; }
.cmd-pane .sheet-group { border-radius: 0; box-shadow: none; margin: 0; }
.cmd-pane .sheet-row:first-child { border-top: none; }
#cmdSheet .sheet-card { padding: 0; overflow: hidden; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.22); }
#cmdSheet .sheet-cancel { border-radius: 0; box-shadow: none; border-top: 1px solid var(--border); }

/* ---- مودال الإبلاغ ---- */
.report-reasons {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.report-reason-btn {
    padding: 7px 13px; border-radius: 20px; border: 1.5px solid var(--border);
    background: var(--card); color: var(--text); font-size: 13px;
    cursor: pointer; transition: all .15s; font-weight: 500;
}
.report-reason-btn:hover { border-color: var(--blue); color: var(--blue); }
.report-reason-btn.selected {
    background: var(--blue); color: #fff; border-color: var(--blue);
}
.report-textarea {
    width: 100%; padding: 10px 12px; border-radius: 12px;
    border: 1.5px solid var(--border); background: var(--input-bg, var(--card));
    color: var(--text); font-size: 14px; resize: none; outline: none;
    transition: border-color .2s; box-sizing: border-box; font-family: inherit;
}
.report-textarea:focus { border-color: var(--blue); }

/* ---- تحديثات مودال شراء الغرفة ---- */
.brd-cost {
    font-size: 12px; font-weight: 800; color: var(--blue);
    background: rgba(59,130,246,.1); padding: 2px 8px;
    border-radius: 20px; margin-top: 2px;
}
.br-dur-card.active .brd-cost { background: var(--blue); color: #fff; }
.br-sum-row.detail { opacity: .85; }
.br-sum-row.detail i { color: var(--muted); }
.br-sum-row.detail b { font-size: 13px; color: var(--text); }

/* سعر بطاقة النوع والأعضاء في مودال الشراء */
.brtc-price {
    display: block; font-size: 11px; font-weight: 800;
    color: var(--blue); margin-top: 4px;
}
.brpkg-price {
    display: block; font-size: 11px; font-weight: 700;
    color: var(--blue); margin-top: 2px;
}

/* ═══════════ أكثر المتفاعلين (Leaderboard) ═══════════ */
.lobby-leaders{display:flex;align-items:center;gap:12px;width:100%;background:linear-gradient(135deg,#fff,#f3f7ff);
  border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px;margin-bottom:12px;cursor:pointer;
  box-shadow:var(--shadow);transition:transform .15s,box-shadow .15s;text-align:right}
.lobby-leaders:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(20,30,60,.12)}
.lobby-leaders .ll-ic{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;font-size:18px;color:#fff;
  background:linear-gradient(135deg,#ff8a00,#ff5e3a);flex:none}
.lobby-leaders .ll-txt{flex:1;min-width:0;display:flex;flex-direction:column}
.lobby-leaders .ll-txt b{font-size:14px}
.lobby-leaders .ll-txt small{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lobby-leaders .ll-arrow{color:var(--muted);flex:none}

.leaders-card{max-width:460px}
.leaders-tabs{margin:6px 0 4px;flex-wrap:wrap}
.leaders-tabs .seg-tab{flex:1;min-width:60px;font-size:13px;padding:8px 4px}
.leaders-list{max-height:60vh;overflow-y:auto;padding:6px 2px;display:flex;flex-direction:column;gap:6px}
.lb-loading{text-align:center;padding:40px;color:var(--muted);font-size:22px}
.lb-row{display:flex;align-items:center;gap:11px;width:100%;background:var(--card2);border:1px solid transparent;
  border-radius:14px;padding:9px 11px;cursor:pointer;transition:background .15s,border-color .15s;text-align:right}
.lb-row:hover{background:#eef3ff;border-color:var(--border)}
.lb-row.lb-top{background:linear-gradient(135deg,#fffaf0,#fff5e6)}
.lb-rank{width:30px;text-align:center;font-size:17px;font-weight:800;color:var(--muted);flex:none}
.lb-row.lb-top .lb-rank{font-size:20px}
.lb-av{width:42px;height:42px;border-radius:50%;object-fit:cover;flex:none;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.12)}
.lb-mid{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.lb-mid b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lb-mid small{color:var(--muted);font-size:11.5px}
.lb-metric{text-align:center;flex:none;display:flex;flex-direction:column;line-height:1.1}
.lb-metric b{font-size:16px;color:var(--blue)}
.lb-metric small{font-size:10px;color:var(--muted)}
.lb-r1{color:#f5b301}.lb-r2{color:#9aa3b2}.lb-r3{color:#cd7f32}

/* ═══════════════════════════════════════════════════
   ملف شخصي — تصميم v2
═══════════════════════════════════════════════════ */
.prf2-card {
    background: var(--card); border-radius: 24px; width: 100%; max-width: 400px;
    overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.22);
    position: relative; max-height: 92vh; overflow-y: auto; scrollbar-width: thin;
}

/* ── الغلاف ── */
.prf2-hero {
    position: relative; height: 130px;
    background: linear-gradient(135deg,#1877f2,#0ea5e9); flex-none;
}
.prf2-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.45) 100%);
}
.prf2-x {
    position: absolute; top: 12px; right: 12px; z-index: 10;
    background: rgba(0,0,0,.38); backdrop-filter: blur(6px);
    border: none; width: 34px; height: 34px; border-radius: 50%;
    color: #fff; cursor: pointer; font-size: 15px;
    display: grid; place-items: center; transition: background .15s;
}
.prf2-x:hover { background: rgba(0,0,0,.62); }
.prf2-av-ring {
    position: absolute; bottom: -42px; right: 20px; z-index: 2;
}
.prf2-avatar {
    width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
    border: 4px solid var(--card); box-shadow: 0 4px 16px rgba(0,0,0,.22);
    display: block;
}
.prf2-online-dot {
    position: absolute; bottom: 8px; left: 4px;
    width: 17px; height: 17px; border-radius: 50%;
    background: #22c55e; border: 3px solid var(--card);
}

/* ── الهوية ── */
.prf2-identity { padding: 50px 18px 0; }
.prf2-name-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.prf2-name { font-size: 20px; font-weight: 900; margin: 0; }
.prf2-badge {
    font-size: 11.5px; font-weight: 700; padding: 3px 10px;
    border-radius: 20px; background: rgba(24,119,242,.12); color: var(--blue);
}
.prf2-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.prf2-status { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.prf2-dot { font-size: 8px; color: #94a3b8; }
.prf2-status.online .prf2-dot { color: #22c55e; }
.prf2-mood { background: var(--card2); border-radius: 20px; padding: 3px 11px; font-size: 12px; color: var(--muted); }

/* XP */
.prf2-xp-wrap { margin-bottom: 14px; }
.prf2-xp-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.prf2-xp-track { height: 7px; background: var(--card2); border-radius: 10px; overflow: hidden; }
.prf2-xp-fill { height: 100%; background: linear-gradient(90deg,#1877f2,#0ea5e9); border-radius: 10px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* الإحصائيات */
.prf2-stats {
    display: flex; align-items: center; justify-content: space-around;
    background: var(--card2); border-radius: 16px; padding: 12px 8px;
    margin-bottom: 14px;
}
.prf2-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.prf2-stat i { font-size: 16px; }
.prf2-stat b { font-size: 16px; font-weight: 900; line-height: 1; }
.prf2-stat span { font-size: 10px; color: var(--muted); font-weight: 600; }
.prf2-stat-sep { width: 1px; height: 32px; background: var(--border); flex: none; }

/* أزرار الإجراءات */
.prf2-actions {
    display: grid; grid-template-columns: repeat(4,1fr);
    gap: 8px; padding: 0 18px 16px;
}
.prf2-act {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 10px 6px; border-radius: 14px; border: 1.5px solid var(--border);
    background: var(--card2); cursor: pointer; font-size: 11px; color: var(--muted);
    font-family: inherit; font-weight: 700; transition: all .15s;
}
.prf2-act i { font-size: 18px; }
.prf2-act:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.prf2-act.like i { color: #f43f5e; }
.prf2-act.like.liked { background: #fff1f2; border-color: #fda4af; }
.prf2-act.like.liked i { color: #e11d48; }
.prf2-act.pm i { color: #1877f2; }
.prf2-act.gift i { color: #a855f7; }
.prf2-act.block i { color: #ef4444; }

/* التبويبات */
.prf2-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    padding: 0 18px;
}
/* إعادة استخدام .prf-tab لأنها مشتركة */
.prf-tab {
    flex: 1; padding: 11px 6px; border: none; background: none;
    color: var(--muted); font-size: 12.5px; font-weight: 700;
    cursor: pointer; border-bottom: 2.5px solid transparent;
    transition: color .2s, border-color .2s;
    display: flex; align-items: center; justify-content: center;
    gap: 5px; font-family: inherit;
}
.prf-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.prf-tab i { font-size: 12px; }
.prf-pane {}

/* body التبويبات */
.prf2-body { padding: 14px 18px 20px; }
.prf2-bio {
    font-size: 13.5px; line-height: 1.75; color: var(--txt);
    background: var(--card2); border-radius: 12px;
    padding: 10px 13px; margin-bottom: 13px;
}

/* شريط الموسيقى */
.prf2-music {
    display: flex; align-items: center; gap: 11px;
    background: linear-gradient(135deg,#0f172a,#1e293b);
    border-radius: 14px; padding: 11px 13px; margin-bottom: 13px;
}
.prf2-music-ic {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(24,119,242,.2); display: grid; place-items: center;
    color: #60a5fa; font-size: 16px; flex: none;
}
.prf2-music-info { flex: 1; min-width: 0; }
.prf2-music-title { font-size: 13px; font-weight: 700; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prf2-music-sub { font-size: 11px; color: #64748b; }
.prf2-music-play {
    width: 34px; height: 34px; border-radius: 50%;
    background: #1877f2; border: none; color: #fff;
    cursor: pointer; display: grid; place-items: center;
    font-size: 14px; flex: none; transition: background .15s;
}
.prf2-music-play:hover { background: #1558c0; }

/* قائمة المعلومات */
.prf2-info-list { display: flex; flex-direction: column; gap: 2px; }
.prf2-info-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 12px;
    transition: background .12s;
}
.prf2-info-row:hover { background: var(--card2); }
.prf2-info-ic { color: var(--muted); font-size: 14px; width: 18px; text-align: center; flex: none; }
.prf2-info-lbl { font-size: 12.5px; color: var(--muted); flex: 1; }
.prf2-info-row b { font-size: 13px; font-weight: 700; }

/* هدايا */
.prf2-gifts-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.prf-gift-item {
    background: var(--card2); border-radius: 14px; padding: 12px 14px;
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; font-size: 24px; transition: transform .12s;
}
.prf-gift-item:hover { transform: scale(1.06); }
.prf-gift-item small { font-size: 11px; color: var(--muted); font-weight: 700; }
.prf-gifts-empty { text-align: center; padding: 32px 0; color: var(--muted); }
.prf-gifts-empty i { font-size: 32px; margin-bottom: 8px; display: block; opacity: .4; }
.prf-gifts-empty p { font-size: 13px; }

/* إدارة */
.prf2-admin-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.prf2-admin-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px; border-radius: 10px; background: var(--card2);
    font-size: 12.5px;
}
.prf2-admin-row span { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.prf2-admin-row b { font-size: 12px; font-weight: 700; color: var(--txt); word-break: break-all; }
.prf2-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.prf-admin-act {
    padding: 8px 16px; border-radius: 10px; border: none;
    font-size: 13px; font-weight: 700; cursor: pointer;
    font-family: inherit; display: flex; align-items: center; gap: 6px;
}
.prf-admin-act.ban { background: #fef2f2; color: #dc2626; }
.prf-admin-act.unban { background: #f0fdf4; color: #16a34a; }

/* تبويبات مشتركة (prf-role-changer) */
.prf-role-changer { margin-top: 12px; }
.prf-role-changer label { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.prf-role-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prf-role-select {
    flex: 1; min-width: 120px;
    padding: 7px 10px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--bg);
    color: var(--text); font-size: 13px; font-family: inherit;
    cursor: pointer; outline: none;
}
.prf-role-select:focus { border-color: var(--blue); }
.prf-role-apply {
    padding: 7px 16px; border-radius: 10px; font-size: 13px;
    white-space: nowrap; flex-shrink: 0;
}

/* ── إشعار النجاح (top-notify) ── */
.top-notify {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    pointer-events: none;
    max-width: 320px;
}
.top-notify.show { transform: translateY(0); opacity: 1; }
.top-notify--success { background: linear-gradient(135deg,#22c55e,#4ade80); }
.top-notify--error   { background: linear-gradient(135deg,#ef4444,#f87171); }
.top-notify--info    { background: linear-gradient(135deg,#0ea5e9,#38bdf8); }

/* ── زر الأوامر .msg-opt-btn (دائم الظهور) ── */
.msg-opt-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 6px;
    opacity: .55;
    transition: opacity .15s;
    line-height: 1;
}
.msg-opt-btn:hover { opacity: 1; background: var(--card2); }

/* ── أيقونة الرتبة قبل الاسم ── */
.b-role-icon { margin-left: 4px; font-size: 11px; }

/* ── لون زر Plus مطابق لزر الإيموجي ── */

/* ── تصميم آيباد ── */
@media (min-width: 768px) and (max-width: 1023px) {
    .chat-layout { flex-direction: row; }
    #view-chat .side { width: 220px; min-width: 180px; flex-shrink: 0; display: flex !important; }
    #view-chat .main { flex: 1; }
    .composer { padding: 8px 10px; }
    #messages .msg { max-width: 85%; }
}
