/* Critical, render-blocking on purpose: everything here is either needed to
   avoid a flash of unstyled content on first paint (dark body background,
   the mobile tab bar's layout/backdrop) or is a couple of bytes not worth a
   second request. Anything that only matters after the page has already
   painted (page-transition animations, the nav progress bar, novel/note
   prose styles, offline-mode overrides) lives in global-deferred.css
   instead, loaded non-blocking — see the <link media="print" ...> trick
   in index.php's <head>. */
body {
    background-color: #08080a;
    color: #fff;
}

a {
    text-decoration: none;
}

.page-h1-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile bottom tab bar (phones only) — visually prominent on first paint
   for phone-width viewports, so this stays blocking rather than risking a
   flash of an unstyled <nav> full of raw links. */
#mobile-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    height: var(--mobile-tabbar-h, 4rem);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(17, 17, 19, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#mobile-tabbar .tab-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 6px 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color .15s ease;
    -webkit-tap-highlight-color: transparent;
}

#mobile-tabbar .tab-item:active {
    color: rgba(255, 255, 255, 0.85);
}

#mobile-tabbar .tab-item.is-active {
    color: #a78bfa;
}

#mobile-tabbar .tab-item > svg {
    width: 22px;
    height: 22px;
}

/* Profile avatar + zmio decoration overlay (mirrors the top bar). */
#mobile-tabbar .tab-avatar {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
}

#mobile-tabbar .tab-avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
}

#mobile-tabbar .tab-avatar-deco {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    max-width: none;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#mobile-tabbar .tab-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mobile-tabbar .tab-badge {
    position: absolute;
    top: 3px;
    left: calc(50% + 3px);
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 9999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    pointer-events: none;
}

/* Phones only — and publish the height so fixed bottom bars on
   other pages can dock above the tab bar. Kept last so it wins
   over the base `display:none` above. */
@media (max-width: 767.98px) {
    :root {
        --mobile-tabbar-h: calc(4rem + env(safe-area-inset-bottom, 0px));
    }

    body {
        padding-bottom: var(--mobile-tabbar-h, 0px);
    }

    #mobile-tabbar {
        display: flex;
    }
}
