.mt-install {
    position: fixed;
    inset-inline-end: 16px;
    top: 12px;
    z-index: 9999;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity .35s ease, transform .35s ease;
}
.mt-install.show { opacity: 1; transform: translateY(0); }

@media (max-width: 480px) {
    .mt-install { top: 10px; inset-inline-end: 10px; }
}

.mt-install-main {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px 11px 14px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: linear-gradient(135deg, #5b93ee, #2563eb);
    color: #fff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 10px 26px -8px rgba(37, 99, 235, 0.75);
    transition: transform .15s ease, box-shadow .15s ease;
}
.mt-install-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(37, 99, 235, 0.9);
}
.mt-install-main:active { transform: translateY(0); }

.mt-install-arrow {
    display: inline-flex;
    animation: mtInstallBob 2s ease-in-out infinite;
}
.mt-install-arrow svg { width: 18px; height: 18px; display: block; }

@keyframes mtInstallBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(3px); }
}

/* ضغط قبل وصول اذن التثبيت: السهم يتحرك أسرع (ننتظر ثواني ثم تظهر نافذة التثبيت) */
.mt-install-main.wait .mt-install-arrow { animation: mtInstallBob 0.55s ease-in-out infinite; }
.mt-install-main.wait { cursor: progress; }

@media (prefers-reduced-motion: reduce) {
    .mt-install-arrow, .mt-install-main.wait .mt-install-arrow { animation: none; }
    .mt-install { transition: none; }
}

.mt-install-close {
    position: absolute;
    bottom: -7px;
    inset-inline-start: -7px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #1e293b;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

@media (max-width: 380px) {
    .mt-install-main { padding: 10px 14px 10px 11px; font-size: 12.5px; }
    .mt-install-arrow svg { width: 16px; height: 16px; }
}

.mt-ios-back {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease;
}
.mt-ios-back.show { opacity: 1; }

.mt-ios-sheet {
    width: 100%;
    max-width: 460px;
    background: #fff;
    color: #172033;
    border-radius: 20px 20px 0 0;
    padding: 22px 22px 26px;
    font-family: inherit;
    transform: translateY(100%);
    transition: transform .3s ease;
}
.mt-ios-back.show .mt-ios-sheet { transform: translateY(0); }

.mt-ios-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; }

/* خطوات الشرح: رقم + ايقونة + نص */
.mt-ios-steps { margin: 0 0 14px; }
.mt-ios-step { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.mt-ios-step + .mt-ios-step { border-top: 1px solid #eef0f6; }
.mt-ios-n {
    width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: #3978E8; color: #fff;
    font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.mt-ios-i {
    width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: #E8F0FD; color: #3978E8;
    display: flex; align-items: center; justify-content: center;
}
.mt-ios-i svg { width: 19px; height: 19px; }
.mt-ios-step b { flex: 1; font-size: 13.5px; font-weight: 700; line-height: 1.6; }

/*
 * سفاري على الايفون: زر المشاركة في الشريط السفلي للمتصفح (خارج الصفحة)، فنرفع الورقة قليلا
 * ونضع سهما ينبض في الفراغ تحتها يشير اليه. (الورقة هنا غير ملتصقة بالقاع عمدا.)
 */
.mt-ios-up { padding-bottom: 66px; }
.mt-ios-up .mt-ios-sheet { border-radius: 20px; max-width: min(460px, calc(100% - 24px)); }
.mt-ios-arrow {
    position: absolute; bottom: 12px; inset-inline-start: 50%; margin-inline-start: -17px;
    width: 34px; height: 44px; color: #fff; display: flex; align-items: center; justify-content: center;
    animation: mtInstallBob 1.1s ease-in-out infinite;
}
.mt-ios-arrow svg { width: 34px; height: 34px; }
@media (prefers-reduced-motion: reduce) { .mt-ios-arrow { animation: none; } }

.mt-ios-ok {
    width: 100%;
    min-height: 48px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #5b93ee, #2563eb);
    color: #fff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
}
