/* Boot splash — critical CSS (внешний файл вместо inline \3c style>, CSP-friendly). */
#voltark-boot-splash.boot-stage {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    background: #040508;
    contain: strict;
    width: 100%;
    height: 100%;
    height: 100dvh;
}
#voltark-boot-splash .boot-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(280px, 86vw);
}
#voltark-boot-splash .boot-mark {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    font: 800 2rem/1 "Syne Fallback", Inter, "Inter Fallback", sans-serif;
    color: #061016;
    background: linear-gradient(135deg, #66c0f4, #8b5cf6);
}
#voltark-boot-splash .boot-title {
    margin: 0 0 18px;
    text-align: center;
    letter-spacing: -0.06em;
    font: 800 2rem/1.1 "Syne Fallback", Inter, "Inter Fallback", sans-serif;
    color: #fff;
}
#voltark-boot-splash .boot-stack {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
#voltark-boot-splash .boot-log {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: calc(1.55em * 4);
    text-align: left;
    font: 400 0.78rem/1.55 ui-monospace, Consolas, monospace;
    color: #8f98a0;
}
#voltark-boot-splash .boot-log > div {
    margin: 0;
    padding: 0;
}
#voltark-boot-splash .boot-bar {
    width: 100%;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin: 0;
}
#voltark-boot-splash .boot-bar > i {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(0.35);
    background: #66c0f4;
    border-radius: inherit;
    will-change: transform;
    animation: va-boot-bar-inline 1.6s ease-in-out infinite;
}
@keyframes va-boot-bar-inline {
    0% { transform: scaleX(0.12); }
    50% { transform: scaleX(0.78); }
    100% { transform: scaleX(0.28); }
}

/*
 * Desktop chrome from first paint (до layout.css / voltark-2026).
 * Иначе header in-flow → fixed + padding-top и fab in-flow → fixed = CLS ~0.24+.
 */
:root {
    --voltark-header-h: 44px;
    --voltark-header-pad-y: 8px;
    --voltark-chrome-h: 60px;
}
@media (min-width: 901px) {
    body:not(.mobile-layout) .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 120;
        height: 60px;
        min-height: 60px;
        max-height: 60px;
        box-sizing: border-box;
        overflow: hidden;
        flex-wrap: nowrap;
    }
    body:not(.mobile-layout) .app-container {
        padding-top: 60px;
    }
}
.friends-fab {
    position: fixed !important;
    right: 20px;
    bottom: 20px;
    /* Above page content / voice-bar (11000) so clicks always hit the FAB */
    z-index: 12050 !important;
    /* Reserve box from first paint — community.css loads deferred. */
    width: 148px;
    height: 40px !important;
    max-height: 40px !important;
    max-width: calc(100vw - 40px);
    padding: 0 14px !important;
    box-sizing: border-box;
    overflow: hidden;
    /* Hide until shell ready — appearance after splash is outside LCP window less often,
       but zero-size first paint avoids in-flow CLS (prod Desktop ~0.7). */
    visibility: hidden;
    pointer-events: none;
}
.friends-fab.is-ready {
    visibility: visible !important;
    pointer-events: auto !important;
}
.friends-fab.hidden {
    visibility: hidden !important;
    pointer-events: none !important;
}
/* Mobile: style.css hides fab — reserve zero box from first paint (CLS 0.168). */
@media (max-width: 900px) {
    .friends-fab,
    .friends-fab.is-ready {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        contain: strict;
    }
}
.app-container {
    min-height: 100vh;
    box-sizing: border-box;
}
/* Minimal body so style.css can defer without FOUC on #about. */
body {
    margin: 0;
    background-color: #07080c;
    color: #eef1f6;
    font-family: "Inter", "Inter Fallback", "Segoe UI", system-ui, sans-serif;
}
@media (max-width: 900px) {
    :root {
        --va-display: "Inter", "Inter Fallback", "Segoe UI", system-ui, sans-serif;
        --voltark-mobile-chrome-h: 56px;
    }
    /*
     * Mobile header fixed from first paint.
     * Late html.voltark-web-mode .app-header{position:fixed} used to yank header
     * out of flow → #app top 61→0 → CLS ~0.155 (PSI/LH mobile).
     */
    .app-header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 120;
        height: var(--voltark-mobile-chrome-h);
        min-height: var(--voltark-mobile-chrome-h);
        max-height: var(--voltark-mobile-chrome-h);
        box-sizing: border-box;
        overflow: hidden;
        contain: layout size;
    }
    /* Bottom dock from first paint — avoids mobile-layout toggle CLS (~0.15). */
    .bottom-navigation {
        display: flex !important;
        align-items: stretch;
        justify-content: space-around;
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10040;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        min-height: 64px;
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        contain: layout size;
    }
    .app-container {
        padding-top: var(--voltark-mobile-chrome-h);
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    #app.main-content,
    .main-content {
        min-height: 50vh;
        contain: layout;
    }
    .about-page {
        min-height: 60vh;
    }
    .about-hero {
        min-height: 140px;
        contain: layout;
    }
    .about-hero h1 {
        font-weight: 400; /* Inter 400 critical only — avoid late 700/800 swap CLS */
    }
    .about-mark {
        font-weight: 700;
        font-family: "Inter", "Inter Fallback", sans-serif;
    }
}
.main-content {
    flex: 1 1 auto;
    min-width: 0;
}
.muted { color: #8b93a7; }
.loader {
    padding: 48px 16px;
    text-align: center;
    color: #8b93a7;
}
