/* Navigation */

/* floating "add item" button */
.fab {
    position: fixed; 
    z-index: 40; 
    right: max(18px, calc((100vw - 980px) / 2 + 18px)); 
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
    width: 58px; 
    height: 58px; 
    border-radius: 50%; 
    border: 0; 
    display: grid; 
    place-items: center;
    background: var(--accent); 
    color: var(--accent-contrast); 
    box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent);
    transition: transform .15s var(--ease);
}
.fab:hover { 
    transform: translateY(-2px) scale(1.04); 
}
.fab:active { 
    transform: scale(.94); 
}

/* bottom nav bar */
.bottomnav {
    position: fixed; 
    z-index: 45; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    height: calc(var(--nav-h) + var(--safe-b)); 
    padding-bottom: var(--safe-b);
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    background: var(--nav-bg); 
    backdrop-filter: blur(14px); 
    border-top: 1px solid var(--border);
}
.nav-btn { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    gap: 1px; 
    border: 0; 
    background: none; 
    color: var(--muted); 
    font-size: .72rem; 
    font-weight: 600; 
    position: relative; 
}
.nav-btn .ico { 
    transition: transform .2s var(--ease); 
}
.nav-btn.active { 
    color: var(--accent); 
}
.nav-btn.active .ico { 
    transform: translateY(-1px) scale(1.1); 
}
.nav-btn.active::before { 
    content: ""; 
    position: absolute; 
    top: 0; 
    width: 34px; 
    height: 3px; 
    border-radius: 0 0 4px 4px; 
    background: var(--accent); 
}

/* picture icons used by the tabs */
.nav-img { 
    width: 32px; 
    height: 32px; 
    object-fit: contain; 
    opacity: .72; 
    transition: transform .2s var(--ease), opacity .2s, filter .2s; 
}
.nav-btn.active .nav-img { 
    opacity: 1; 
    transform: translateY(-1px) scale(1.12); 
}
[data-theme="dark"] .nav-img { 
    filter: invert(1); 
}

/* wide screens: nav turns into a floating pill */
@media (min-width: 900px) {
    .bottomnav { 
        left: 50%; 
        right: auto; 
        transform: translateX(-50%); 
        width: 520px; 
        bottom: 16px; 
        border: 1px solid var(--border); 
        border-radius: 26px; 
        box-shadow: var(--shadow); 
        height: var(--nav-h); 
        padding-bottom: 0; 
    }
    .fab { bottom: 104px; }
}
