@media (max-width: 1050px) {
    .sidebar {
        display: none;
    }

    .main-content {
        width: min(100% - 30px, 790px);
        margin: 0 auto;
        padding: 30px 0 112px;
    }

    .dashboard-grid,
    .lower-grid {
        grid-template-columns: 1fr;
    }

    .summary-column {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .purchase-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .search-field {
        grid-column: 1 / -1;
    }

    .full-purchase-row {
        grid-template-columns: 46px minmax(0, 1fr) auto;
    }

    .purchase-category {
        display: none;
    }

    .purchase-actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
    }

    .mobile-nav {
        position: fixed;
        inset: auto 14px 14px;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        gap: 4px;
        padding: 8px 10px;
        border: 1px solid var(--border);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
        backdrop-filter: blur(22px);
    }

    .mobile-nav-item,
    .mobile-add-button {
        display: grid;
        place-items: center;
        justify-self: center;
        border: 0;
    }

    .mobile-nav-item {
        width: 54px;
        height: 54px;
        border-radius: 16px;
        background: transparent;
        color: var(--muted);
    }

    .mobile-nav-item.active {
        background: var(--primary-soft);
        color: var(--primary-dark);
    }

    .mobile-add-button {
        width: 64px;
        height: 64px;
        margin-top: -22px;
        border-radius: 50%;
        background: var(--primary);
        color: #ffffff;
        box-shadow: 0 14px 32px rgba(37, 99, 235, 0.33);
    }
}

@media (max-width: 700px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-button {
        width: 100%;
    }

    .coach-card {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .coach-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .spending-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .category-list {
        width: 100%;
    }

    .summary-column,
    .purchase-summary-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-wide {
        grid-column: auto;
    }

    .purchase-toolbar {
        grid-template-columns: 1fr;
    }

    .search-field {
        grid-column: auto;
    }

    .full-purchase-row {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .method-card {
        grid-template-columns: 50px minmax(0, 1fr) 20px;
        padding: 17px;
    }

    .method-icon {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 430px) {
    .main-content {
        width: calc(100% - 22px);
    }

    .page-header h1 {
        font-size: 2.05rem;
    }

    .mobile-nav {
        inset: auto 8px 8px;
        padding: 7px 8px;
    }

    .mobile-nav-item {
        width: 48px;
        height: 48px;
    }

    .mobile-add-button {
        width: 58px;
        height: 58px;
        margin-top: -19px;
    }

    .full-purchase-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .purchase-price,
    .purchase-actions {
        grid-column: 2;
        text-align: left;
    }

    .toast-container {
        right: 10px;
        bottom: 92px;
        left: 10px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 800px) {
    .goals-summary,
    .goals-grid {
        grid-template-columns: 1fr;
    }
}
