/* Mobile-first density adjustments shared across MyMeMo pages. */
@media (max-width: 767.98px) {
    :root {
        --mymemo-mobile-card-padding: 0.75rem;
        --mymemo-mobile-card-gap: 0.6rem;
        --mymemo-mobile-muted-size: 0.78rem;
        --mymemo-mobile-radius: 0.6rem;
    }

    body {
        font-size: 0.94rem;
        line-height: 1.35;
    }

    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    main.py-4,
    .container.py-4,
    .container-fluid.py-4 {
        padding-top: 0.85rem !important;
        padding-bottom: 0.85rem !important;
    }

    main.py-3,
    .container.py-3,
    .container-fluid.py-3 {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
    }

    main .p-4,
    main .p-md-4,
    .container > .p-4,
    .container-fluid > .p-4,
    .modal-body.p-4,
    .modal-header.p-4,
    .modal-footer.p-4 {
        padding: 0.9rem !important;
    }

    main .p-3,
    .container > .p-3,
    .container-fluid > .p-3,
    .modal-body.p-3,
    .modal-header.p-3,
    .modal-footer.p-3 {
        padding: var(--mymemo-mobile-card-padding) !important;
    }

    main .px-4,
    .container > .px-4,
    .container-fluid > .px-4 {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    main .py-4,
    .container > .py-4,
    .container-fluid > .py-4 {
        padding-top: 0.9rem !important;
        padding-bottom: 0.9rem !important;
    }

    main .py-3,
    .container > .py-3,
    .container-fluid > .py-3 {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
    }

    .row.g-4,
    .row.gy-4 {
        --bs-gutter-y: 0.85rem;
    }

    .row.g-3,
    .row.gy-3 {
        --bs-gutter-y: var(--mymemo-mobile-card-gap);
    }

    .row.g-2 {
        --bs-gutter-x: 0.45rem;
        --bs-gutter-y: 0.45rem;
    }

    .row.gy-2 {
        --bs-gutter-y: 0.45rem;
    }

    .d-grid.gap-2,
    .d-flex.gap-2,
    .nav.gap-2 {
        gap: 0.45rem !important;
    }

    .mb-5,
    .my-5 {
        margin-bottom: 1.25rem !important;
    }

    .mt-5,
    .my-5 {
        margin-top: 1.25rem !important;
    }

    .mb-4,
    .my-4 {
        margin-bottom: 0.9rem !important;
    }

    .mt-4,
    .my-4 {
        margin-top: 0.9rem !important;
    }

    .mb-3,
    .my-3 {
        margin-bottom: 0.65rem !important;
    }

    .mt-3,
    .my-3 {
        margin-top: 0.65rem !important;
    }

    .space--top30 {
        margin-top: 0.75rem;
    }

    .space--top60,
    .space--top120,
    .space--top160 {
        margin-top: 1rem;
    }

    .card,
    [class*="-card"],
    [class*="-panel"],
    [class*="-tile"],
    [class*="-group"],
    .list-group-item,
    .alert,
    .modal-content {
        border-radius: var(--mymemo-mobile-radius) !important;
    }

    .card-body,
    .card-header,
    .card-footer,
    .list-group-item,
    .alert,
    [class*="-panel"],
    [class*="-tile"] {
        padding: var(--mymemo-mobile-card-padding) !important;
    }

    [class*="-card"].p-4,
    [class*="-card"].p-3,
    [class*="-panel"].p-4,
    [class*="-panel"].p-3,
    [class*="-tile"].p-4,
    [class*="-tile"].p-3 {
        padding: var(--mymemo-mobile-card-padding) !important;
    }

    .shadow,
    .shadow-sm {
        box-shadow: 0 0.25rem 0.7rem rgba(15, 23, 42, 0.07) !important;
    }

    h1,
    .h1,
    .home-hero-title,
    [class*="-hero"] h1 {
        font-size: 1.45rem !important;
        line-height: 1.18;
    }

    .trip-page-hero h1 {
        font-size: var(--mymemo-mobile-muted-size) !important;
        line-height: 1.25;
    }

    h2,
    .h2 {
        font-size: 1.2rem !important;
        line-height: 1.2;
    }

    h3,
    .h3,
    .h4 {
        font-size: 1.05rem !important;
        line-height: 1.22;
    }

    .lead {
        font-size: 0.95rem !important;
        line-height: 1.35;
    }

    .hero-kicker,
    [class*="-kicker"],
    .breadcrumb-text,
    .form-text,
    small,
    .small,
    .text-muted,
    [class*="-meta"],
    [class*="-subtitle"],
    [class*="-description"] {
        font-size: var(--mymemo-mobile-muted-size) !important;
        line-height: 1.25;
    }

    .badge,
    .category-pill,
    .recurring-category-chip,
    .category-monthly-total,
    .balance-account-type {
        font-size: 0.72rem !important;
        line-height: 1.15;
        padding: 0.18rem 0.45rem !important;
    }

    .btn:not(.navbar-toggler):not(.btn-close) {
        min-height: 2.25rem;
        padding: 0.32rem 0.62rem;
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .btn-sm:not(.navbar-toggler):not(.btn-close),
    .btn-group-sm > .btn:not(.navbar-toggler):not(.btn-close) {
        min-height: 1.95rem;
        padding: 0.22rem 0.48rem;
        font-size: 0.82rem;
    }

    .btn-lg:not(.navbar-toggler):not(.btn-close) {
        min-height: 2.55rem;
        padding: 0.42rem 0.75rem;
        font-size: 0.98rem;
    }

    .form-control,
    .form-select,
    .input-group-text {
        min-height: 2.3rem;
        padding-top: 0.36rem;
        padding-bottom: 0.36rem;
        font-size: 0.94rem;
    }

    textarea.form-control {
        min-height: 4.4rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.42rem 0.5rem;
    }

    .nav-pills .nav-link,
    .nav-tabs .nav-link {
        padding: 0.35rem 0.55rem;
        font-size: 0.88rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }

    .modal-title {
        font-size: 1.05rem;
    }

    .summary-value,
    [class*="-amount"],
    [class*="-total"],
    [class*="-value"],
    .balance-account-balance {
        font-size: clamp(1rem, 4.5vw, 1.28rem) !important;
        line-height: 1.12;
        font-weight: 800;
    }

    [class*="-name"],
    [class*="-title"],
    .card-title {
        line-height: 1.2;
    }

    .navbar .nav-link {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
}
