/* Bottom navigation, taken from gliderincidents and trimmed to this app's views. */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: calc(0.5rem + 15px) 0 calc(1.25rem + 5px + env(safe-area-inset-bottom)) 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: calc(60px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    /* Keeps the bar put while Chrome's mobile address bar animates. */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    min-width: 0;
}

.nav-item:active {
    opacity: 0.6;
}

.nav-item.active {
    color: var(--button-color);
}

.nav-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    flex-shrink: 0;
}

.nav-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

@media (min-width: 600px) {
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        border-radius: 12px 12px 0 0;
    }
}

/* Desktop: the same bar, moved to the top. */
@media (min-width: 800px) {
    .bottom-nav {
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        max-width: none;
        transform: none;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        border-left: none;
        border-right: none;
        border-radius: 0;
        height: 60px;
        /* The bar spans the window so its background and lower border reach both
           edges, but the items line up over the 800px content column beneath
           them. Left to `space-around` across a wide window they drifted into
           the corners with nothing under them. */
        padding: 0.75rem max(1rem, calc((100% - 832px) / 2));
    }

    .nav-item {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .nav-icon {
        width: 20px;
        height: 20px;
    }

    .nav-label {
        font-size: 0.9375rem;
    }

    /* The views' own padding clears this bar; see --nav-top-h in app.css. It was
       overridden here once, which never worked — app.css loads later and sets the
       padding shorthand. */
}
