/* Sections: a left sidebar on a laptop, a bottom tab bar on a phone (same <nav>). */
#app {
    flex-direction: row;
}

.app-main {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

/* Each section fills the space under the header and scrolls on its own. */
.app-main > main {
    min-height: 0;
}

.section-nav {
    display: flex;
    width: 208px;
    flex: 0 0 208px;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px 14px;
    border-right: 1px solid var(--color-border);
    background: var(--color-surface);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 8px 18px;
}

.brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--brand-gradient);
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: .92rem;
    font-weight: 560;
    text-align: left;
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.nav-item[aria-current="page"] {
    background: var(--nav-on-bg);
    color: var(--nav-on-text);
}

.nav-item[aria-current="page"] svg {
    color: var(--nav-on-icon);
}

.nav-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding: 12px 8px 0;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 720px) {
    #app {
        flex-direction: column;
    }

    .app-main {
        order: 1;
    }

    .section-nav {
        z-index: 30;
        order: 2;
        width: auto;
        flex: 0 0 auto;
        flex-direction: row;
        padding: 6px 10px calc(6px + var(--safe-bottom));
        border-top: 1px solid var(--color-border);
        border-right: 0;
        background: var(--glass);
        backdrop-filter: blur(18px);
    }

    .nav-brand,
    .nav-greeting,
    .nav-foot {
        display: none;
    }

    .nav-items {
        display: grid;
        flex: 1;
        grid-auto-columns: 1fr;
        grid-auto-flow: column;
        gap: 4px;
    }

    .nav-item {
        min-height: var(--touch-target);
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 4px 0;
        font-size: .7rem;
        font-weight: 650;
        text-align: center;
    }

    .nav-item[aria-current="page"] {
        background: transparent;
        color: var(--nav-on-icon);
    }
}
