#viewRecurModal {
    & .recur-view-body {
        display: grid;
        gap: 1rem;
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    & .recur-view-section {
        background: var(--gray-100);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 1rem;
        min-width: 0;
    }

    & .recur-view-section-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-color);
        margin-bottom: 0.875rem;
        padding-bottom: 0.625rem;
        border-bottom: 1px solid var(--border-color);
    }

    & .recur-view-details-link {
        flex-shrink: 0;
        margin-left: auto;
        font-weight: 700;
    }

    & .recur-view-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.875rem 1rem;
    }

    & .recur-view-field {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    & .recur-view-field-full {
        grid-column: 1 / -1;
    }

    & .recur-view-label {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    & .recur-view-value {
        font-size: 0.95rem;
        color: var(--text-color);
        min-height: 1.25rem;
        word-break: break-word;
        line-height: 1.45;

        &:empty::before {
            content: "—";
            color: var(--text-muted);
        }
    }

    & .recur-view-amount-due {
        font-weight: 600;
    }

    & .recur-view-amount-due-value {
        color: var(--accent);
    }

    & .recur-view-table-wrap {
        border: 1px solid var(--border-color);
        border-radius: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        width: 100%;
        max-width: 100%;
        max-height: 360px;
    }

    & .recur-payments-table {
        margin-bottom: 0;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 0.92rem;
        width: 100%;
        table-layout: fixed;

        & > :first-child > * > * {
            color: var(--text-muted);
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-top: none;
            border-bottom: 1px solid var(--border-color);
            padding: 0.7rem 0.75rem;
            white-space: nowrap;
        }

        & > :first-child > * > :nth-child(3),
        & > :first-child > * > :nth-child(4),
        & > :first-child > * > :nth-child(5) {
            text-align: right;
        }

        & > :first-child > * > :nth-child(1),
        & > :nth-child(2) > * > :nth-child(1) {
            width: 14%;
        }

        & > :first-child > * > :nth-child(2),
        & > :nth-child(2) > * > :nth-child(2) {
            width: 22%;
        }

        & > :first-child > * > :nth-child(3),
        & > :nth-child(2) > * > :nth-child(3),
        & > :first-child > * > :nth-child(4),
        & > :nth-child(2) > * > :nth-child(4),
        & > :first-child > * > :nth-child(5),
        & > :nth-child(2) > * > :nth-child(5) {
            width: 13%;
        }

        & > :first-child > * > :nth-child(6),
        & > :nth-child(2) > * > :nth-child(6) {
            width: 25%;
        }

        & > :nth-child(2) > * > * {
            padding: 0.72rem 0.75rem;
            border-top: none;
            border-bottom: 1px solid var(--border-color);
            color: var(--text-color);
            vertical-align: middle;
            overflow-wrap: anywhere;
        }

        & > :nth-child(2) > *:last-child > * {
            border-bottom: none;
        }
    }

    & .recur-payments-totals__heading {
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    & .recur-payments-row > :nth-child(3),
    & .recur-payments-row > :nth-child(4),
    & .recur-payments-row > :nth-child(5),
    & .recur-payments-totals > :nth-child(3),
    & .recur-payments-totals > :nth-child(4),
    & .recur-payments-totals > :nth-child(5) {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    & .recur-payments-row > :nth-child(1),
    & .recur-payments-totals > :nth-child(1) {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    & .recur-payments-totals > * {
        border-top: 1px solid var(--border-color);
        font-weight: 700;
        color: var(--text-color);
    }

    & .recur-payments-date-cell {
        display: inline-flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.25rem;
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    #viewRecurModal {
        & .recur-view-body {
            padding: 0.75rem;
            gap: 0.75rem;
        }

        & .recur-view-section {
            padding: 0.875rem;
        }

        & .recur-view-grid {
            grid-template-columns: 1fr;
            gap: 0.75rem;
        }

        & .recur-view-table-wrap {
            border: none;
            border-radius: 0;
            max-height: 42vh;
            padding-right: 0.125rem;
        }

        & .recur-payments-table {
            table-layout: auto;
        }

        & .recur-payments-table,
        & .recur-payments-table > *,
        & .recur-payments-table > * > *,
        & .recur-payments-table > * > * > * {
            display: block;
            width: 100%;
            max-width: 100%;
        }

        & .recur-payments-table > :nth-child(2) > * > :nth-child(1),
        & .recur-payments-table > :nth-child(2) > * > :nth-child(2),
        & .recur-payments-table > :nth-child(2) > * > :nth-child(3),
        & .recur-payments-table > :nth-child(2) > * > :nth-child(4),
        & .recur-payments-table > :nth-child(2) > * > :nth-child(5),
        & .recur-payments-table > :nth-child(2) > * > :nth-child(6) {
            width: 100%;
            max-width: 100%;
        }

        & .recur-payments-table > :first-child {
            display: none;
        }

        & .recur-payments-table > :nth-child(2) > * {
            background: var(--field-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 0.5rem 0.65rem;
            margin-bottom: 0.65rem;
        }

        & .recur-payments-table > :nth-child(2) > *:last-child {
            margin-bottom: 0;
        }

        & .recur-payments-table > :nth-child(2) > * > * {
            display: grid;
            grid-template-columns: 6.5rem minmax(0, 1fr);
            align-items: start;
            gap: 0.5rem 0.75rem;
            border: none;
            padding: 0.35rem 0;
            text-align: left;
            min-width: 0;
            overflow-wrap: break-word;
            word-break: normal;
        }

        & .recur-payments-table > :nth-child(2) > * > *::before {
            content: attr(data-label);
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.45px;
            min-width: 0;
        }

        & .recur-payments-table > :nth-child(2) > * > *[data-label='']::before {
            content: none;
        }

        & .recur-payments-row > :nth-child(3),
        & .recur-payments-row > :nth-child(4),
        & .recur-payments-row > :nth-child(5),
        & .recur-payments-totals > :nth-child(3),
        & .recur-payments-totals > :nth-child(4),
        & .recur-payments-totals > :nth-child(5) {
            text-align: left;
        }

        & .recur-payments-totals > .recur-payments-totals__heading {
            grid-template-columns: 1fr;
            font-size: 0.72rem;
            padding-bottom: 0.45rem;
            margin-bottom: 0.15rem;
            border-bottom: 1px solid var(--border-color);
        }

        & .recur-payments-totals > .recur-payments-totals__spacer,
        & .recur-payments-totals > .recur-payments-totals__method {
            display: none;
        }

        & .recur-payments-totals {
            background: var(--field-bg);
            border: 1px solid var(--border-color);
        }

        & .recur-payments-totals > * {
            border-top: none;
        }

        & .recur-payments-table--single .recur-payments-totals {
            display: none;
        }

        & .recur-payments-table .tx-method-chip {
            max-width: 100%;
            min-width: 0;
            width: -moz-fit-content;
            width: fit-content;
        }

        & .recur-payments-table .tx-method-chip__label {
            display: inline;
            min-width: 0;
        }
    }
}

