/* Suffah - Phase 100: perceived-speed helpers (progress bar, skeletons, virtual feed). */
[data-pwa-install][hidden] { display: none !important; }

/* top progress bar while the next page loads */
.sx-bar { position: fixed; z-index: 5000; top: 0; left: 0; height: 3px; width: 0; background: var(--color-accent); box-shadow: 0 0 8px var(--color-accent); opacity: 0; pointer-events: none; transition: width .35s ease, opacity .2s ease; }
.sx-bar.is-on { opacity: 1; }
html.sx-nav:not(.sx-vt) .main-content, html.sx-nav:not(.sx-vt) .basic-shell { opacity: .72; transition: opacity .15s ease; }

/* skeleton cards (feed loading and page-change placeholder) */
.sk-list { display: none; flex-direction: column; }
.sk-card { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); }
.sk-av { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.sk-body { flex: 1; min-width: 0; }
.sk-line { height: 12px; border-radius: 6px; margin: 6px 0 10px; }
.sk-line--s { width: 38%; }
.sk-line--m { width: 82%; }
.sk-line--l { width: 94%; }
.sk-media { height: 160px; border-radius: 16px; margin: 8px 0 6px; }
.sk-av, .sk-line, .sk-media { background: linear-gradient(90deg, var(--bg-tertiary, rgba(127,127,127,.14)) 25%, var(--bg-hover, rgba(127,127,127,.22)) 37%, var(--bg-tertiary, rgba(127,127,127,.14)) 63%); background-size: 400% 100%; animation: sk-shimmer 1.3s ease infinite; }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-av, .sk-line, .sk-media { animation: none; } }
html[data-reduce-motion] .sk-av, html[data-reduce-motion] .sk-line, html[data-reduce-motion] .sk-media { animation: none; }

.sx-skel { position: fixed; z-index: 45; top: 0; bottom: var(--mobile-nav-height, 56px); left: var(--dk-x1, 0px); width: var(--dk-center, 100%); background: var(--bg-primary); overflow: hidden; }
.sx-skel .sk-list { display: flex; }
.sx-skel__head { height: 53px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; }
.sx-skel__head .sk-line { width: 120px; margin: 0; }
.sx-skel--rows .sk-card { align-items: center; padding: 18px 16px; }
.sx-skel--rows .sk-av { width: 28px; height: 28px; border-radius: 8px; }
@media (min-width: 700px) { .sx-skel { bottom: 0; } }

/* feed virtualization: far-away posts are emptied, their space is kept */
.is-detached { overflow: hidden; contain: strict; }

/* Phase 139: smooth page changes. Browsers that support it cross-fade only the page content; the side menu,
 * bottom bar and top bar stay where they are, so moving around feels like an app, not a reload. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    .sidebar-left { view-transition-name: sf-side-left; }
    .sidebar-right { view-transition-name: sf-side-right; }
    .mobile-nav { view-transition-name: sf-bottom-nav; }
    .mobile-topbar { view-transition-name: sf-top-bar; }
    ::view-transition-group(root) { animation-duration: .18s; }
    ::view-transition-old(root) { animation: sf-vt-out .12s ease both; }
    ::view-transition-new(root) { animation: sf-vt-in .18s ease both; }
    ::view-transition-group(sf-side-left), ::view-transition-group(sf-side-right), ::view-transition-group(sf-bottom-nav), ::view-transition-group(sf-top-bar) { animation-duration: 0s; }
    @keyframes sf-vt-out { to { opacity: 0; } }
    @keyframes sf-vt-in { from { opacity: 0; } }
}

/* offline banner */
.sf-offline { position: fixed; z-index: 5001; left: 50%; bottom: calc(var(--mobile-nav-height, 56px) + 12px); transform: translateX(-50%); max-width: calc(100vw - 24px); padding: 9px 16px; border-radius: 999px; background: #0f1419; color: #fff; font-size: .9rem; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.sf-offline[hidden] { display: none; }
@media (min-width: 700px) { .sf-offline { bottom: 20px; } }
