/* NuFlow v1.3.7
   Lead 360 mobile action spacing hotfix */

.page-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 760px) !important;
    align-items: start !important;
    gap: 24px !important;
}

.page-heading > div:first-child {
    min-width: 0 !important;
}

.page-heading .nf-lead-actions,
.page-heading > .nf-lead-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.page-heading .nf-lead-actions > a,
.page-heading .nf-lead-actions > button,
.page-heading > .nf-lead-actions > a,
.page-heading > .nf-lead-actions > button {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
}

/* Fallback in case a release renders the buttons directly in page-heading */
.page-heading > a.secondary-button,
.page-heading > a.primary-button,
.page-heading > button.secondary-button,
.page-heading > button.primary-button {
    min-width: 0 !important;
    min-height: 50px !important;
    margin: 0 !important;
    white-space: normal !important;
}

@media (max-width: 1180px) {
    .page-heading {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 520px) !important;
    }

    .page-heading .nf-lead-actions,
    .page-heading > .nf-lead-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 820px) {
    .page-heading {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .page-heading .nf-lead-actions,
    .page-heading > .nf-lead-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: none !important;
    }

    .page-heading .nf-lead-actions > a,
    .page-heading .nf-lead-actions > button,
    .page-heading > .nf-lead-actions > a,
    .page-heading > .nf-lead-actions > button {
        min-height: 58px !important;
        padding: 12px 10px !important;
        font-size: 0.95rem !important;
    }

    .page-heading .nf-lead-actions > .primary-button,
    .page-heading > .nf-lead-actions > .primary-button {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 430px) {
    .page-heading .nf-lead-actions,
    .page-heading > .nf-lead-actions {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .page-heading .nf-lead-actions > .primary-button,
    .page-heading > .nf-lead-actions > .primary-button {
        grid-column: auto !important;
    }

    .page-heading .nf-lead-actions > a,
    .page-heading .nf-lead-actions > button,
    .page-heading > .nf-lead-actions > a,
    .page-heading > .nf-lead-actions > button {
        min-height: 56px !important;
    }
}
