/* PWA / iOS standalone */
.ios-install-hint{
    position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0));
    z-index:9999;display:flex;align-items:center;gap:12px;padding:14px 16px;
    background:rgba(18,18,28,.96);border:1px solid rgba(0,229,255,.25);
    border-radius:16px;box-shadow:0 8px 32px rgba(0,0,0,.45);
    backdrop-filter:blur(12px);animation:iosHintIn .35s ease;
}
@keyframes iosHintIn{
    from{opacity:0;transform:translateY(16px)}
    to{opacity:1;transform:translateY(0)}
}
.ios-install-icon{
    flex-shrink:0;width:44px;height:44px;border-radius:12px;
    background:linear-gradient(135deg,#00E5FF,#A855F7);
    display:flex;align-items:center;justify-content:center;
    font-weight:800;font-size:16px;color:#fff;
}
.ios-install-body{flex:1;min-width:0}
.ios-install-body strong{display:block;font-size:14px;margin-bottom:4px}
.ios-install-body p{margin:0;font-size:12px;line-height:1.45;color:var(--text-2,#aaa)}
.ios-install-body .ios-share{
    display:inline-flex;align-items:center;gap:4px;color:#00E5FF;font-weight:600;
}
.ios-install-close{
    position:absolute;top:6px;right:8px;width:28px;height:28px;border:none;
    background:transparent;color:var(--text-2,#888);font-size:20px;cursor:pointer;
    line-height:1;padding:0;
}

.dg-push-banner{
    position:fixed;left:12px;right:12px;bottom:calc(72px + env(safe-area-inset-bottom,0));
    z-index:9998;display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:12px 14px;background:rgba(18,18,28,.96);border:1px solid rgba(0,229,255,.22);
    border-radius:14px;box-shadow:0 8px 28px rgba(0,0,0,.4);backdrop-filter:blur(12px);
    animation:iosHintIn .35s ease;
}
.dg-push-banner-body{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.dg-push-banner-body i{font-size:20px;color:#00E5FF;flex-shrink:0}
.dg-push-banner-body strong{display:block;font-size:13px;margin-bottom:2px}
.dg-push-banner-body p{margin:0;font-size:11px;line-height:1.35;color:var(--text-2,#aaa)}
.dg-push-banner-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.dg-push-banner-btn{
    border:none;border-radius:10px;padding:8px 12px;font-size:12px;font-weight:700;
    background:linear-gradient(135deg,#00E5FF,#A855F7);color:#fff;cursor:pointer;
}
.dg-push-banner-close{
    width:28px;height:28px;border:none;border-radius:50%;background:rgba(255,255,255,.08);
    color:var(--text-2,#aaa);font-size:18px;cursor:pointer;line-height:1;
}

.ios-push-steps{
    margin-bottom:12px;padding:12px 14px;border-radius:12px;
    background:rgba(0,229,255,.08);border:1px solid rgba(0,229,255,.22);
}
.ios-push-steps.hidden{display:none}
.ios-push-steps-title{font-size:13px;font-weight:700;margin:0 0 8px;display:flex;align-items:center;gap:8px}
.ios-push-steps ol{margin:0;padding-left:20px;font-size:12px;line-height:1.5;color:var(--text-2,#bbb)}
.ios-push-steps li{margin-bottom:6px}
.ios-push-steps-note{margin:10px 0 0;font-size:11px;color:var(--text-2,#999);line-height:1.4}
.ios-push-steps .ios-share{
    display:inline-flex;align-items:center;gap:4px;color:#00E5FF;font-weight:600;
}
#prof-push-enable{margin:8px 0;width:100%}
.profile-push-label.hidden{display:none!important}

/* Просмотр фото */
.img-viewer{
    position:fixed;inset:0;z-index:5000;background:rgba(0,0,0,.94);
    display:flex;align-items:center;justify-content:center;
    padding:calc(12px + env(safe-area-inset-top,0)) 8px calc(12px + env(safe-area-inset-bottom,0));
    animation:modalIn .2s ease;touch-action:none;
}
.img-viewer-stage{
    width:100%;height:100%;display:flex;align-items:center;justify-content:center;
    overflow:hidden;touch-action:none;
}
.img-viewer img{
    max-width:100%;max-height:100%;object-fit:contain;border-radius:4px;
    -webkit-user-select:none;user-select:none;transform-origin:center center;
    transition:transform .05s linear;will-change:transform;
}
.img-viewer-close{
    position:fixed;top:calc(12px + env(safe-area-inset-top,0));right:12px;
    width:48px;height:48px;border:none;border-radius:50%;
    background:rgba(255,255,255,.15);color:#fff;font-size:20px;cursor:pointer;
    display:flex;align-items:center;justify-content:center;z-index:5001;
    backdrop-filter:blur(8px);
}

/* Режим «На экран Домой» — iOS PWA использует --dg-vh (window.innerHeight) */
html.pwa-standalone,
body.pwa-standalone{
    position:fixed;inset:0;
    width:100%;
    height:var(--dg-vh,100dvh);
    max-height:var(--dg-vh,100dvh);
    margin:0;padding:0;overflow:hidden;
    background:var(--bg-app,#0A0A12);
}
html.pwa-standalone .mesh-bg,
body.pwa-standalone .mesh-bg{display:none!important}
html.pwa-standalone .dg-app,
body.pwa-standalone .dg-app{
    position:fixed;inset:0;
    width:100%;max-width:none;
    height:var(--dg-vh,100dvh);
    max-height:var(--dg-vh,100dvh);
    margin:0;padding:0;gap:0;overflow:hidden;
}
html.pwa-standalone .glass-panel,
body.pwa-standalone .glass-panel{border-radius:0}
html.pwa-standalone .dg-sidebar,
html.pwa-standalone .dg-chat,
body.pwa-standalone .dg-sidebar,
body.pwa-standalone .dg-chat{
    position:absolute;inset:0;
    height:100%;max-height:100%;
    overflow:hidden;box-sizing:border-box;
}
html.pwa-standalone .dg-sidebar,
body.pwa-standalone .dg-sidebar{display:flex;flex-direction:column}
html.pwa-standalone .dg-chat,
body.pwa-standalone .dg-chat{display:flex;flex-direction:column}

@media (display-mode: standalone), (display-mode: fullscreen) {
    html{
        width:100%;
        height:var(--dg-vh,100dvh);
        max-height:var(--dg-vh,100dvh);
        margin:0;padding:0;overflow:hidden;
        background:var(--bg-app,#0A0A12);
    }
    body{
        position:fixed;inset:0;
        width:100%;
        height:var(--dg-vh,100dvh);
        max-height:var(--dg-vh,100dvh);
        margin:0;padding:0;overflow:hidden;
        background:var(--bg-app,#0A0A12);
    }
    .mesh-bg{display:none!important}
    .dg-app{
        position:fixed;inset:0;
        width:100%;max-width:none;
        height:var(--dg-vh,100dvh);
        max-height:var(--dg-vh,100dvh);
        margin:0;padding:0;gap:0;overflow:hidden;
    }
    .glass-panel{border-radius:0}
    .dg-sidebar,.dg-chat{
        position:absolute;inset:0;
        height:100%;max-height:100%;
        overflow:hidden;box-sizing:border-box;
    }
    .dg-sidebar{display:flex;flex-direction:column}
    .dg-chat{display:flex;flex-direction:column}
}