@media (max-width: 860px) {
    .app-shell { display: block; }
    .sidebar { display: none; }
    .content { padding: 16px 14px 96px; }
    .page-header { align-items: flex-start; }
    .page-actions,
    .filter-bar,
    .page-header .btn {
        width: 100%;
    }
    .manual-filter,
    .manual-filter label,
    .manual-filter .btn,
    .filter-panel,
    .filter-panel label {
        width: 100%;
    }
    .filter-panel,
    .manual-range {
        grid-template-columns: 1fr;
    }
    .page-actions .btn,
    .filter-chip {
        flex: 1 1 calc(50% - 8px);
    }
    .page-header h1 { font-size: 24px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .metric-card { min-height: 96px; padding: 14px; }
    .metric-card strong { font-size: 20px; }
    .split-grid, .form-grid { grid-template-columns: 1fr; }
    .overview-hero { grid-template-columns: 1fr; }
    .login-screen { grid-template-columns: 1fr; }
    .login-copy { padding: 4px; }
    .login-copy h1 { font-size: 34px; }
    .row-link, .row-link > a, .category-item, .account-card { align-items: flex-start; }
    .row-link {
        display: grid;
        grid-template-columns: 1fr;
    }
    .row-actions {
        width: 100%;
        justify-content: space-between;
    }
    .goal-card-head,
    .goal-values {
        display: grid;
        grid-template-columns: 1fr;
    }
    .goal-actions {
        width: 100%;
    }
    .goal-card-head .icon-btn,
    .goal-actions .inline-form {
        width: 100%;
    }
    .profile-photo-row {
        grid-template-columns: 1fr;
    }
    .modal-backdrop {
        align-items: end;
        padding: 10px;
    }
    .modal-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 8px 8px 0 0;
        padding: 16px;
    }
    .modal-header {
        position: sticky;
        top: -16px;
        z-index: 2;
        padding-top: 4px;
        padding-bottom: 10px;
        background: var(--card);
    }
    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        background: var(--card);
        border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-nav a {
        min-height: 48px;
        display: grid;
        place-items: center;
        color: var(--muted);
        font-size: 11px;
    }
    .fab {
        position: fixed;
        right: 18px;
        bottom: 78px;
        width: 58px;
        height: 58px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: var(--primary);
        color: #fff;
        border: 0;
        cursor: pointer;
        font-size: 32px;
        box-shadow: var(--shadow);
        z-index: 25;
    }
}

@media (min-width: 861px) {
    .bottom-nav, .fab { display: none; }
}

@media (max-width: 480px) {
    .metric-grid { grid-template-columns: 1fr; }
    .page-header { display: grid; }
}
