@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* ===== متغیرها ===== */
:root {
    --primary:       #00579f;
    --primary-light: #1a6fc4;
    --primary-grad:  linear-gradient(160deg, #1a6fc4 0%, #00579f 100%);
    --bubble-out:    #00579f;
    --bubble-in:     #ffffff;
    --chat-bg:       #f0f2f5;
    --header-bg:     #00579f;
    --footer-bg:     #ffffff;
    --text:          #1a1f2e;
    --text-out:      #ffffff;
    --muted:         #8e9db6;
    --border:        #e8eaed;
    --radius-lg:     24px;
    --radius-md:     14px;
    --shadow:        0 4px 24px rgba(0,0,0,.10);
    --shadow-lg:     0 8px 40px rgba(0,0,0,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== wrapper ===== */
.ft-app {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    max-width: 680px;
    margin: 20px auto;
    position: relative;
}

.ft-screen { width: 100%; }

/* ===========================
   لاگین — طراحی جدید
   کارت سفید روی پس‌زمینه خاکستری روشن
=========================== */
.ft-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    padding: 24px 16px;
    background: #eef1f5;
    border-radius: var(--radius-lg);
}
.ft-login-box {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 28px 32px;
    width: 100%;
    max-width: 400px;
}
.ft-login-logo {
    text-align: center;
    margin-bottom: 18px;
}
.ft-login-logo img {
    width: 80px; height: 80px;
    border-radius: 20px;
    object-fit: contain;
}
.ft-login-title {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.ft-login-sub {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 28px;
}

/* فیلد ورودی با label راست‌چین */
.ft-field { margin-bottom: 18px; }
.ft-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    text-align: right;
}
.ft-field input,
.ft-modal-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px 14px 13px 44px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 16px;
    outline: none;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    color: var(--text);
    direction: ltr;
    text-align: left;
}
.ft-field input:focus,
.ft-modal-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,87,159,.1);
}

/* آیکون داخل فیلد */
.ft-field { position: relative; }
.ft-field label { position: static; }
.ft-field-icon {
    position: absolute;
    left: 14px;
    bottom: 13px;
    color: var(--muted);
    pointer-events: none;
}

.ft-pass-wrap { position: relative; }
.ft-pass-wrap input { padding-right: 44px; padding-left: 44px; }
.ft-toggle-pass {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--muted);
    padding: 4px; border-radius: 6px;
}
.ft-toggle-pass:hover { color: var(--primary); }

/* دکمه ورود با گرادیانت */
.ft-btn-login {
    width: 100%;
    background: var(--primary-grad);
    color: #fff; border: none;
    border-radius: var(--radius-md);
    padding: 15px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 16px; font-weight: 700;
    cursor: pointer; margin-top: 4px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity .2s, transform .15s;
    letter-spacing: 0.5px;
}
.ft-btn-login:hover { opacity: .92; transform: translateY(-1px); }
.ft-btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.ft-alert {
    padding: 10px 14px; border-radius: 10px;
    font-size: 13px; margin-bottom: 16px;
}
.ft-alert-error { background: #fde8e8; color: #c0392b; }

/* لینک ثبت‌نام پایین */
.ft-register-note {
    margin-top: 24px; text-align: center;
    font-size: 13px; color: var(--muted);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    flex-wrap: wrap;
}
.ft-register-note a { color: var(--primary); font-weight: 700; text-decoration: none; }
.ft-register-note a:hover { text-decoration: underline; }

.ft-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================
   انتخاب گروه — طراحی جدید
   پس‌زمینه سفید، لوگو وسط بالا، کارت‌های گروه
=========================== */
.pr-groups-screen {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

/* هدر سفید با لوگو بزرگ */
.pr-groups-header {
    background: #fff;
    padding: 40px 24px 24px;
    text-align: center;
}
.pr-groups-logo {
    margin-bottom: 20px;
}
.pr-groups-logo img {
    width: 90px; height: 90px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.pr-groups-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.pr-groups-header p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 4px;
}
.pr-groups-header p strong,
.pr-groups-header p span.highlight {
    color: var(--primary);
    font-weight: 600;
}
.pr-groups-hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

/* لیست گروه‌ها */
.pr-groups-list {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.ft-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    width: 100%;
    text-align: right;
    font-family: 'Vazirmatn', sans-serif;
    transition: all .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.ft-group-item:hover,
.ft-group-item:active {
    border-color: var(--primary);
    background: #f0f6fc;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,87,159,.12);
}

.ft-group-item-right {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}
.ft-group-item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.ft-group-item-desc {
    font-size: 12px;
    color: var(--muted);
}

/* آیکون چت سمت چپ */
.ft-group-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ft-group-chat-icon {
    width: 40px; height: 40px;
    background: #eef5fc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.ft-group-arrow {
    color: var(--muted);
    flex-shrink: 0;
}

/* نگه‌داری از ft-group-icon برای سازگاری با HTML قبلی */
.ft-group-icon { font-size: 22px; }
.ft-group-name { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }

/* نوار پایین گروه‌ها */
.pr-groups-footer {
    display: flex;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    justify-content: center;
    gap: 0;
}
.ft-btn-ghost {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 40px;
    background: none;
    border: none;
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.ft-btn-ghost svg { width: 22px; height: 22px; }
.ft-btn-ghost:hover { color: var(--primary); }
.ft-btn-ghost + .ft-btn-ghost {
    border-right: 1px solid var(--border);
}

/* ===========================
   چت — طراحی جدید
=========================== */
.ft-chat-screen {
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    height: 640px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

/* --- هدر آبی شناور با margin --- */
.ft-chat-header {
    background: var(--header-bg);
    padding: 10px 14px;
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0;
    min-height: 62px;
    z-index: 20;
    margin: 10px 10px 0 10px;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(0,87,159,.25);
}
.ft-header-back {
    background: rgba(255,255,255,.18); border: none; border-radius: 50%;
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #fff; flex-shrink: 0; transition: background .2s;
    order: -1;
}
.ft-header-back svg { width: 22px; height: 22px; }
.ft-header-back:hover { background: rgba(255,255,255,.28); }

.ft-header-avatar {
    position: relative; flex-shrink: 0;
    order: 1;
}
.ft-header-avatar img {
    width: 44px; height: 44px; border-radius: 12px;
    border: none;
    object-fit: contain; background: #fff;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.ft-online-dot {
    position: absolute; bottom: -2px; left: -2px;
    width: 11px; height: 11px; background: #4cd964;
    border-radius: 50%; border: 2px solid var(--header-bg);
}
.ft-header-info { flex: 1; min-width: 0; order: 2; }
.ft-header-name { color: #fff; font-weight: 700; font-size: 15px; }
.ft-header-group { color: rgba(255,255,255,.78); font-size: 12px; margin-top: 2px; }

/* --- بدنه پیام‌ها --- */
.ft-chat-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.ft-chat-body::-webkit-scrollbar { width: 3px; }
.ft-chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 2px; }

.ft-date-sep { text-align: center; margin: 10px 0 6px; }
.ft-date-sep span {
    background: rgba(0,0,0,.18); color: #fff;
    font-size: 11px; padding: 3px 12px;
    border-radius: 12px; display: inline-block;
}

/* --- پیام‌ها --- */
.ft-msg {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 4px;
    max-width: 80%;
    animation: msgFadeIn .15s ease;
    margin-bottom: 1px;
}
@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ft-msg.out {
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-left: 0;
    margin-right: 44px;
}
.ft-msg.in {
    align-self: flex-start;
    flex-direction: row;
    margin-right: 0;
    margin-left: 44px;
}

/* دکمه reply */
.ft-msg-actions {
    display: flex; flex-direction: column; gap: 4px;
    align-self: flex-end; opacity: 0; pointer-events: none;
    transition: opacity .2s; flex-shrink: 0;
}
@media (hover: hover) {
    .ft-msg:hover .ft-msg-actions { opacity: 1; pointer-events: auto; }
}
@media (hover: none) {
    .ft-msg-actions { opacity: 1; pointer-events: auto; }
}
.ft-msg.touch-active .ft-msg-actions { opacity: 1; pointer-events: auto; }

.ft-msg-reply-btn,
.ft-msg-dl-btn {
    background: rgba(0,0,0,.08); border: none; border-radius: 50%;
    width: 28px; height: 28px; min-width: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #666; font-size: 13px; flex-shrink: 0; padding: 0;
    transition: background .15s, color .15s;
}
.ft-msg-reply-btn:hover,
.ft-msg-dl-btn:hover { background: var(--primary); color: #fff; }
.ft-msg-dl-btn svg { display: block; pointer-events: none; }

/* --- حباب‌ها --- */
.ft-bubble {
    padding: 8px 13px 5px;
    font-size: 14px; line-height: 1.6;
    word-break: break-word;
    position: relative;
}
.ft-msg.out .ft-bubble {
    background: var(--bubble-out);
    color: var(--text-out);
    border-radius: 18px 4px 18px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ft-msg.in .ft-bubble {
    background: var(--bubble-in);
    color: var(--text);
    border-radius: 4px 18px 18px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.ft-msg.out.ft-chain .ft-bubble { border-radius: 18px 18px 4px 18px; }
.ft-msg.in.ft-chain .ft-bubble  { border-radius: 18px 18px 18px 4px; }

.ft-msg-time {
    display: block; font-size: 11px; opacity: .6;
    text-align: left; margin-top: 3px; padding-bottom: 1px;
}
.ft-msg.out .ft-msg-time { color: rgba(255,255,255,.7); }
.ft-msg.in  .ft-msg-time { color: var(--muted); }

.ft-msg.emoji-only .ft-bubble {
    background: transparent !important; box-shadow: none !important;
    padding: 2px 4px; font-size: 40px; line-height: 1.2;
}

.ft-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 40px; color: var(--muted); font-size: 13px;
}
.ft-loading-spin {
    width: 24px; height: 24px;
    border: 3px solid #ddd; border-top-color: var(--primary);
    border-radius: 50%; animation: spin .8s linear infinite;
}
.ft-welcome { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.ft-welcome-emoji { font-size: 48px; margin-bottom: 10px; }

/* reply quote */
.ft-reply-quote {
    border-right: 3px solid rgba(255,255,255,.5);
    background: rgba(0,0,0,.1); border-radius: 0 6px 6px 0;
    padding: 4px 8px 4px 6px; margin-bottom: 5px; font-size: 12px;
    cursor: pointer; transition: opacity .15s;
}
.ft-reply-quote:hover { opacity: .85; }
.ft-msg.in .ft-reply-quote { border-right-color: var(--primary); background: #eef5fc; }
.ft-reply-quote-who { font-weight: 700; font-size: 11px; margin-bottom: 2px; }
.ft-reply-quote-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; opacity: .8; }

/* انواع محتوا */
.ft-img-wrap { position: relative; display: inline-block; }
.ft-msg-img { max-width: 260px; max-height: 220px; border-radius: 12px; cursor: pointer; display: block; object-fit: cover; }
.ft-video-wrap { position: relative; display: inline-block; }
.ft-msg-video { max-width: 270px; max-height: 220px; border-radius: 12px; display: block; background: #000; width: 100%; }
.ft-file-msg { display: flex; align-items: center; gap: 10px; padding: 2px 0; min-width: 180px; }
.ft-file-icon { font-size: 24px; flex-shrink: 0; }
.ft-file-info { flex: 1; min-width: 0; }
.ft-file-name { font-size: 13px; font-weight: 600; word-break: break-all; }
.ft-file-dl { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12px; text-decoration: none; font-family: 'Vazirmatn', sans-serif; }
.ft-msg.out .ft-file-dl { color: rgba(255,255,255,.8); }
.ft-msg.in  .ft-file-dl { color: var(--primary); }

/* ویس */
.ft-audio { display: flex; align-items: center; gap: 10px; padding: 4px 2px; min-width: 180px; }
.ft-audio-play { width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s; }
.ft-msg.out .ft-audio-play { background: rgba(255,255,255,.25); color: #fff; }
.ft-msg.in  .ft-audio-play { background: var(--primary); color: #fff; }
.ft-audio-play:hover { transform: scale(1.08); }
.ft-audio-play svg { width: 16px; height: 16px; }
.ft-audio-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ft-waves { display: flex; align-items: center; gap: 2px; height: 20px; }
.ft-waves span { display: block; width: 3px; border-radius: 2px; opacity: .7; transition: transform .1s; }
.ft-msg.out .ft-waves span { background: rgba(255,255,255,.8); }
.ft-msg.in  .ft-waves span { background: var(--primary); }
.ft-waves span:nth-child(1){height:5px}.ft-waves span:nth-child(2){height:13px}
.ft-waves span:nth-child(3){height:19px}.ft-waves span:nth-child(4){height:9px}
.ft-waves span:nth-child(5){height:15px}.ft-waves span:nth-child(6){height:7px}
.ft-waves span:nth-child(7){height:17px}.ft-waves span:nth-child(8){height:11px}
.ft-waves.playing span { animation: wave .5s ease-in-out infinite alternate; }
.ft-waves.playing span:nth-child(2){animation-delay:.08s}.ft-waves.playing span:nth-child(3){animation-delay:.16s}
.ft-waves.playing span:nth-child(4){animation-delay:.12s}.ft-waves.playing span:nth-child(5){animation-delay:.04s}
.ft-waves.playing span:nth-child(6){animation-delay:.2s}.ft-waves.playing span:nth-child(7){animation-delay:.09s}
@keyframes wave { from { transform: scaleY(.4); } to { transform: scaleY(1.3); } }
.ft-audio-dur { font-size: 11px; opacity: .7; }

.ft-location { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 14px; font-weight: 500; }
.ft-location:hover { text-decoration: underline; }
.ft-contact { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.ft-contact-avatar { font-size: 28px; }
.ft-contact-name { font-size: 14px; font-weight: 700; }
.ft-contact-phone { font-size: 12px; opacity: .75; direction: ltr; }

/* --- فوتر با فاصله بیشتر بین دکمه‌ها --- */
.ft-chat-footer {
    display: flex; align-items: center;
    padding: 8px 12px;
    background: var(--footer-bg);
    border-top: none;
    border-radius: 18px;
    box-shadow: 0 -2px 16px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.08);
    flex-shrink: 0; z-index: 10;
    gap: 0;
    margin: 0 10px 10px 10px;
}

/* ورودی متن */
.ft-input {
    flex: 1;
    border: none; outline: none;
    border-radius: 24px; padding: 10px 16px;
    font-size: 16px; background: #f0f2f5;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text); resize: none;
    transition: background .2s;
    margin: 0 6px;
}
.ft-input:focus { background: #e8eaed; }

/* دکمه‌های attach و mic — با padding برای فاصله بیشتر */
.ft-footer-btn {
    width: 40px; height: 40px;
    border-radius: 50%; border: none;
    background: transparent; cursor: pointer; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    transition: all .15s; flex-shrink: 0;
    /* فاصله از ورودی متن */
    margin: 0 2px;
}
.ft-footer-btn:hover { background: #eef5fc; color: var(--primary); }
.ft-footer-btn.recording { background: #d6eaf8; color: var(--primary); }

/* دکمه ارسال — آبی گرد با گرادیانت */
.ft-send-btn {
    width: 46px; height: 46px;
    border-radius: 50%; border: none;
    background: var(--primary-grad);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(0,87,159,.35);
    margin-right: 4px;
}
.ft-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(0,87,159,.45); }

/* reply bar */
.ft-reply-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; background: #eef5fc;
    border-top: 2px solid var(--primary);
    flex-shrink: 0;
}
.ft-reply-indicator { width: 3px; height: 32px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }
.ft-reply-info { flex: 1; min-width: 0; }
.ft-reply-who { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.ft-reply-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-reply-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 0 4px; flex-shrink: 0; }

/* نوار ویس */
.ft-voice-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: #fff;
    border-top: 1px solid var(--border); flex-shrink: 0;
}
.ft-voice-info { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--primary); font-size: 13px; font-weight: 500; }
.ft-voice-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }
.ft-voice-cancel, .ft-voice-send {
    padding: 6px 14px; border-radius: 20px; border: none;
    cursor: pointer; font-family: 'Vazirmatn', sans-serif; font-size: 13px; font-weight: 500;
}
.ft-voice-cancel { background: #f0f0f0; color: #666; }
.ft-voice-send { background: var(--primary); color: #fff; }

/* ===========================
   منوی Attach
=========================== */
.ft-attach-menu {
    position: fixed;
    background: #fff; border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 8px 6px; z-index: 9999;
    display: flex; flex-direction: column; gap: 2px;
    min-width: 160px; border: 1px solid #eee;
}
.ft-attach-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; background: none; border: none;
    border-radius: 10px; cursor: pointer;
    font-family: 'Vazirmatn', sans-serif; font-size: 13px;
    color: var(--text); text-align: right; direction: rtl;
    transition: background .1s;
}
.ft-attach-item:hover { background: #f5f5f5; }
.ft-attach-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #fff;
}

/* ===========================
   Modal
=========================== */
.ft-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.ft-modal-box { background: #fff; border-radius: 18px; padding: 24px 20px; width: 300px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.ft-modal-title { font-size: 15px; font-weight: 700; text-align: center; color: var(--text); }
.ft-modal-btns { display: flex; gap: 10px; }
.ft-modal-cancel, .ft-modal-ok { flex: 1; padding: 10px; border: none; border-radius: 10px; font-family: 'Vazirmatn', sans-serif; font-size: 14px; cursor: pointer; transition: all .2s; }
.ft-modal-cancel { background: #f0f0f0; color: #666; }
.ft-modal-ok { background: var(--primary); color: #fff; }

/* ===========================
   Lightbox
=========================== */
.ft-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 99999; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.ft-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; object-fit: contain; }
.ft-lightbox-close { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 24px; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ===========================
   موبایل
=========================== */
@media (max-width: 600px) {
    .ft-app { margin: 0; max-width: 100%; }

    .ft-login { border-radius: 0; min-height: 100dvh; min-height: -webkit-fill-available; background: #eef1f5; }
    .ft-login-box { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 36px 24px 28px; }

    .pr-groups-screen { border-radius: 0; min-height: 100dvh; min-height: -webkit-fill-available; }

    .ft-chat-screen { border-radius: 0; box-shadow: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%; width: 100%; }
    .ft-chat-header { margin: max(10px, env(safe-area-inset-top)) 10px 0 10px; padding-top: 10px; }
    .ft-chat-footer { margin: 0 10px max(10px, env(safe-area-inset-bottom)) 10px; }
    .ft-chat-body { padding: 8px 8px 10px; }

    .ft-msg.out { margin-right: 40px; }
    .ft-msg.in  { margin-left: 40px; }

    .ft-footer-btn { width: 44px; height: 44px; }
    .ft-send-btn   { width: 46px; height: 46px; }
    .ft-attach-icon { width: 32px; height: 32px; }
    .ft-modal-box { width: calc(100vw - 40px); }
}

@supports (padding: env(safe-area-inset-top)) {
    @media (max-width: 600px) {
        .ft-chat-header { margin-top: max(10px, env(safe-area-inset-top)); }
        .ft-chat-footer { margin-bottom: max(10px, env(safe-area-inset-bottom)); }
    }
}

/* ===========================
   Bottom Sheet دانلود
=========================== */
.ft-dl-sheet { position: fixed; inset: 0; z-index: 999999; pointer-events: none; }
.ft-dl-sheet.ft-dl-sheet-open { pointer-events: auto; }
.ft-dl-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .28s ease; }
.ft-dl-sheet-open .ft-dl-sheet-backdrop { background: rgba(0,0,0,.45); }
.ft-dl-sheet-box { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-radius: 20px 20px 0 0; padding: 10px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; transform: translateY(100%); transition: transform .28s cubic-bezier(.32,1.2,.6,1); max-width: 480px; margin: 0 auto; box-shadow: 0 -4px 32px rgba(0,0,0,.15); padding-bottom: max(20px, env(safe-area-inset-bottom)); font-family: 'Vazirmatn', sans-serif; direction: rtl; }
.ft-dl-sheet-open .ft-dl-sheet-box { transform: translateY(0); }
.ft-dl-sheet-handle { width: 36px; height: 4px; background: #ddd; border-radius: 2px; margin-bottom: 4px; flex-shrink: 0; }
.ft-dl-sheet-title { font-size: 13px; font-weight: 600; color: #555; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; padding: 0 8px; }
.ft-dl-sheet-actions { display: flex; gap: 12px; width: 100%; justify-content: center; }
.ft-dl-sheet-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; max-width: 120px; background: none; border: 1.5px solid #eee; border-radius: 14px; padding: 14px 10px; cursor: pointer; font-family: 'Vazirmatn', sans-serif; font-size: 13px; font-weight: 600; color: #333; transition: all .15s; }
.ft-dl-sheet-btn:hover, .ft-dl-sheet-btn:active { border-color: var(--primary); background: #eef5fc; color: var(--primary); }
.ft-dl-sheet-ico { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ft-dl-sheet-cancel { width: 100%; padding: 13px; border: none; border-radius: 12px; background: #f5f5f5; color: #666; font-family: 'Vazirmatn', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s; }
.ft-dl-sheet-cancel:hover, .ft-dl-sheet-cancel:active { background: #eee; }

/* ===========================
   نام پشتیبان بالای حباب
=========================== */
.ft-sender-info { display: flex; flex-direction: column; gap: 2px; margin-bottom: 5px; padding-bottom: 5px; border-bottom: 1px solid rgba(0,87,159,.08); }
.ft-sender-brand { font-size: 11px; font-weight: 700; color: var(--primary); letter-spacing: 0.2px; }
.ft-sender-name { font-size: 12px; font-weight: 500; color: #4f5a71; display: flex; align-items: center; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.ft-sender-name svg { color: #9aa5bc; flex-shrink: 0; }

/* ===========================
   منوی ریپلای/حذف
=========================== */
.ft-msg-menu { position: fixed; z-index: 999999; background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); overflow: hidden; min-width: 140px; opacity: 0; transform: scale(0.92); transition: opacity .15s, transform .15s; font-family: 'Vazirmatn', sans-serif; direction: rtl; }
.ft-msg-menu.ft-msg-menu-open { opacity: 1; transform: scale(1); }
.ft-msg-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border: none; background: none; font-family: 'Vazirmatn', sans-serif; font-size: 13px; font-weight: 500; color: #333; cursor: pointer; text-align: right; }
.ft-msg-menu-item:not(:last-child) { border-bottom: 1px solid #f0f0f0; }
.ft-msg-menu-item:hover, .ft-msg-menu-item:active { background: #eef5fc; }
.ft-msg-menu-item svg { flex-shrink: 0; }
.ft-msg-menu-danger { color: #e74c3c; }
.ft-msg-menu-danger:hover, .ft-msg-menu-danger:active { background: #fdecea; }
