/* Mohindera Arts — PWA install UI (top layer, isolated from page layout) */

#ma-pwa-root {
    position: fixed;
    inset: 0;
    z-index: 2147483640 !important;
    pointer-events: none;
    isolation: isolate;
}

#ma-pwa-root .ma-pwa-fab,
#ma-pwa-root .ma-pwa-banner,
#ma-pwa-root .ma-pwa-popup,
#ma-pwa-root .ma-pwa-modal,
#ma-pwa-root .ma-pwa-success {
    pointer-events: auto;
}

/* Install popup — reload or browser menu */
.ma-pwa-popup {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.75rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.ma-pwa-popup.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.ma-pwa-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ma-pwa-popup__card {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: min(90vh, 560px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.35rem 1.15rem 1.1rem;
    background: #fff;
    border-radius: 20px 20px 16px 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    transform: translateY(18px);
    transition: transform 0.26s cubic-bezier(0.23, 1, 0.32, 1);
}

.ma-pwa-popup.is-visible .ma-pwa-popup__card {
    transform: translateY(0);
}

.ma-pwa-popup__close {
    position: absolute;
    top: 0.65rem;
    right: 0.7rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: #f3f3f3;
    color: #555;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.ma-pwa-popup__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0 1.75rem 1rem 0;
    text-align: left;
}

.ma-pwa-popup__icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.ma-pwa-popup__title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.ma-pwa-popup__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #888;
}

.ma-pwa-popup__native {
    display: block;
    width: 100%;
    margin: 0 0 1rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0c040 0%, #e0a820 100%);
    color: #0b0b0b;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(240, 192, 64, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ma-pwa-popup__native:active {
    transform: scale(0.98);
}

.ma-pwa-popup__native:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ma-pwa-popup__native--ready {
    box-shadow: 0 8px 22px rgba(240, 192, 64, 0.45);
}

.ma-pwa-popup__native--guide {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    color: #f0c040;
    border: 1px solid rgba(240, 192, 64, 0.45);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.ma-pwa-popup__way--pulse {
    animation: ma-pwa-pulse 0.55s ease 2;
    border-color: rgba(240, 192, 64, 0.65) !important;
    background: #fffbeb !important;
}

@keyframes ma-pwa-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.ma-pwa-popup__lead {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
    text-align: left;
}

.ma-pwa-popup__ways {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ma-pwa-popup__way {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background: #f8f8f8;
    border: 1px solid #eee;
    text-align: left;
}

.ma-pwa-popup__way--active {
    background: #fffbeb;
    border-color: rgba(240, 192, 64, 0.45);
}

.ma-pwa-popup__way-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #333;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.ma-pwa-popup__way--active .ma-pwa-popup__way-icon {
    background: rgba(240, 192, 64, 0.15);
    border-color: rgba(240, 192, 64, 0.35);
    color: #9a7b10;
}

.ma-pwa-popup__way-body {
    flex: 1;
    min-width: 0;
}

.ma-pwa-popup__way-title {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #111;
}

.ma-pwa-popup__way-text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #666;
}

.ma-pwa-popup__way-text strong {
    color: #333;
    font-weight: 600;
}

.ma-pwa-popup__way-btn {
    margin-top: 0.55rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(240, 192, 64, 0.5);
    border-radius: 999px;
    background: #fff;
    color: #9a7b10;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ma-pwa-popup__way-btn:hover {
    background: #fffbeb;
}

.ma-pwa-popup__dismiss {
    display: block;
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.55rem;
    border: none;
    background: transparent;
    color: #999;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

.ma-pwa-popup__dismiss:hover {
    color: #666;
}

html.ma-pwa-popup-open,
html.ma-pwa-popup-open body {
    overflow: hidden !important;
}

@media (min-width: 520px) {
    .ma-pwa-popup {
        align-items: center;
        padding: 1.5rem;
    }

    .ma-pwa-popup__card {
        border-radius: 18px;
        padding: 1.5rem 1.35rem 1.2rem;
    }
}

@media (max-width: 380px) {
    .ma-pwa-popup__head {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
        margin-right: 0;
        padding-right: 1.5rem;
    }

    .ma-pwa-popup__icon {
        margin: 0 auto;
    }

    .ma-pwa-popup__head-text {
        width: 100%;
        text-align: center;
    }
}

.ma-pwa-banner,
.ma-pwa-notify {
    position: fixed;
    z-index: 1;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem 1.1rem;
    background: rgba(12, 12, 12, 0.97);
    border: 1px solid rgba(240, 192, 64, 0.3);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #f4f4f4;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.18s ease;
    pointer-events: none;
}

.ma-pwa-banner.is-visible,
.ma-pwa-notify.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ma-pwa-notify {
    bottom: 5.25rem;
}

.ma-pwa-banner__title,
.ma-pwa-notify__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.ma-pwa-banner__text,
.ma-pwa-notify__text {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.ma-pwa-banner__hint {
    font-size: 0.78rem;
    color: #c9b060;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.ma-pwa-banner__actions,
.ma-pwa-notify__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ma-pwa-btn {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.ma-pwa-btn:active {
    transform: scale(0.97);
}

.ma-pwa-btn--primary {
    background: #f0c040;
    color: #0b0b0b;
}

.ma-pwa-btn--ghost {
    background: transparent;
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ma-pwa-btn--ghost:hover {
    color: #ccc;
}

/* Fast-install floating action button */
.ma-pwa-fab {
    position: fixed;
    z-index: 3;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem 0.65rem 0.85rem;
    border: 1px solid rgba(240, 192, 64, 0.45);
    border-radius: 999px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    color: #f0c040;
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.18s ease, box-shadow 0.2s ease;
}

.ma-pwa-fab.is-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ma-pwa-fab:hover {
    box-shadow: 0 12px 32px rgba(240, 192, 64, 0.15);
}

.ma-pwa-fab__icon {
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(240, 192, 64, 0.15);
    font-size: 0.75rem;
    line-height: 1;
}

.ma-pwa-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: 380px;
    margin-left: auto;
    z-index: 4;
    padding: 0.9rem 1rem;
    background: rgba(12, 12, 12, 0.97);
    border: 1px solid rgba(240, 192, 64, 0.3);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    color: #f4f4f4;
    font-family: Inter, system-ui, sans-serif;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.18s ease;
    pointer-events: none;
    cursor: pointer;
}

.ma-pwa-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ma-pwa-toast__title {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.ma-pwa-toast__body {
    font-size: 0.78rem;
    color: #aaa;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .ma-pwa-fab {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .ma-pwa-banner,
    .ma-pwa-notify {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .ma-pwa-notify {
        bottom: 5rem;
    }

    .ma-pwa-banner.is-visible ~ .ma-pwa-notify.is-visible,
    .ma-pwa-notify.is-visible ~ .ma-pwa-banner.is-visible {
        bottom: 5.75rem;
    }
}

/* Install guide modal */
.ma-pwa-modal {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.ma-pwa-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.ma-pwa-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ma-pwa-modal__panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: min(88vh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.35rem 1.25rem 1.25rem;
    background: #111;
    border: 1px solid rgba(240, 192, 64, 0.35);
    border-radius: 20px 20px 16px 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    color: #f4f4f4;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    transform: translateY(24px);
    transition: transform 0.24s cubic-bezier(0.23, 1, 0.32, 1);
}

.ma-pwa-modal.is-visible .ma-pwa-modal__panel {
    transform: translateY(0);
}

.ma-pwa-modal__close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.ma-pwa-modal__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 2rem 0.4rem 0;
    letter-spacing: -0.02em;
}

.ma-pwa-modal__lead {
    font-size: 0.82rem;
    color: #aaa;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.ma-pwa-modal__status {
    font-size: 0.78rem;
    color: #c9b060;
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: rgba(240, 192, 64, 0.08);
    border: 1px solid rgba(240, 192, 64, 0.2);
    line-height: 1.45;
}

.ma-pwa-modal__steps {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ma-pwa-modal__steps li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #ddd;
}

.ma-pwa-modal__step-n {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(240, 192, 64, 0.18);
    color: #f0c040;
    font-size: 0.72rem;
    font-weight: 700;
}

.ma-pwa-modal__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ma-pwa-modal__note {
    font-size: 0.72rem;
    color: #777;
    margin: 0.85rem 0 0;
    line-height: 1.45;
}

html.ma-pwa-modal-open,
html.ma-pwa-modal-open body {
    overflow: hidden !important;
}

/* Post-install success pill */
.ma-pwa-success {
    position: fixed;
    z-index: 6;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%) translateY(110%);
    max-width: calc(100% - 2rem);
    padding: 0.75rem 1.1rem;
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(240, 192, 64, 0.4);
    border-radius: 999px;
    color: #f0c040;
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.18s ease;
    text-align: center;
}

.ma-pwa-success.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 520px) {
    .ma-pwa-modal {
        align-items: center;
        padding: 1.5rem;
    }

    .ma-pwa-modal__panel {
        border-radius: 18px;
    }
}

@media (display-mode: standalone) {
    .ma-pwa-banner,
    .ma-pwa-fab,
    .ma-pwa-popup {
        display: none !important;
    }
}