/* Mobile-only layout fixes. Desktop rules are unchanged. */
@media (max-width: 991px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .nds-page {
        zoom: 1 !important;
        max-width: 100%;
        overflow-x: hidden;
    }

    img, video, canvas, iframe {
        max-width: 100%;
        height: auto;
    }

    .digi_wrapper,
    .nds-page .digi_wrapper {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
    }

    .announcement_bar,
    .marquee_bar {
        max-width: 100%;
        overflow: hidden;
    }

    /* Hero copy first, consultation form second */
    .nds-hero .nds-hero-pwa-layout > .nds-hero-contact-col {
        order: 2 !important;
        width: 100%;
        max-width: 100%;
        margin-top: 1.25rem;
        margin-bottom: 0;
        position: relative;
        z-index: 2;
    }

    .nds-hero .nds-hero-pwa-layout > .col-12:not(.nds-hero-contact-col) {
        order: 1 !important;
        width: 100%;
        max-width: 100%;
        position: relative;
        z-index: 3;
    }

    .nds-page .nds-hero {
        padding-top: 6.25rem !important;
        padding-bottom: 2.25rem !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .nds-page .nds-hero .hero_content_s h1,
    .nds-page .nds-hero h1 {
        margin-top: 0.35rem !important;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .nds-hero-contact-wrap,
    .enterprise-hero-form,
    .enterprise-hero-form .ehf-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .enterprise-hero-form .ehf-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .nds-page .row,
    .nds-page .col-12,
    .nds-page [class*="col-"] {
        max-width: 100%;
    }

    /* Stats: never stay 4–6 columns on a phone; section height follows content */
    .nds-page .nds-stats,
    .nds-page .nds-stats.nds-stats-hero-pwa,
    .nds-page .nds-stats.nds-stats-5,
    .nds-page .nds-stats.nds-stats-6,
    .nds-page .nds-stats.nds-stats-hero-pwa--2col {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        height: auto !important;
        min-height: 0 !important;
        max-width: 100%;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem;
        overflow: visible !important;
        position: relative;
        z-index: 1;
    }

    .nds-page .nds-stat,
    .nds-page .nds-stats .nds-stat {
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
        position: relative;
        max-width: 100%;
        box-sizing: border-box;
        padding: 1rem 0.85rem !important;
    }

    .nds-page .nds-stat::before,
    .nds-page .nds-stats .nds-stat::before,
    .nds-page .nds-stats.nds-stats-hero-pwa .nds-stat::before {
        max-width: 100%;
        box-sizing: border-box;
        pointer-events: none;
    }

    .nds-page .nds-sec,
    .nds-page section.nds-sec,
    .nds-page section {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible;
        position: relative;
    }

    .nds-page .nds-hero {
        overflow-x: hidden;
    }

    .nds-page .nds-grid-2,
    .nds-page .nds-grid-3,
    .nds-page .nds-grid-4 {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    .nds-page .nds-timeline,
    .nds-page .nds-timeline.nds-timeline-6,
    .nds-page .nds-timeline.nds-timeline-7 {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    .nds-page .nds-card,
    .nds-page .nds-svc-card,
    .nds-page .nds-industry-card,
    .nds-page .nds-model-card,
    .nds-page .nds-timeline-item {
        max-width: 100%;
        box-sizing: border-box;
        height: auto !important;
    }

    .tech_slider,
    .tech_slider_reverse,
    #slider_left,
    #slider_right,
    .nds-auto-cases-sec,
    .nds-auto-cases-stack,
    .gai-cases-rail,
    .gai-tech-constellation {
        max-width: 100%;
        overflow-x: hidden;
    }

    .wa_float {
        right: 12px;
        bottom: 12px;
        z-index: 40;
    }

    .enterprise-hero-form .select2-container,
    .enterprise-hero-form .select2-dropdown,
    .enterprise-hero-form .digi-calendar-popup {
        max-width: 100%;
    }

}

@media (max-width: 767px) {
    .nds-page .nds-sec,
    .nds-page section.nds-sec {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .nds-page .nds-stats.nds-stats-hero-pwa,
    .nds-page .nds-stats.nds-stats-6,
    .nds-page .nds-stats.nds-stats-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .nds-page .nds-title {
        font-size: clamp(1.45rem, 6.5vw, 1.9rem) !important;
        overflow-wrap: anywhere;
    }

    .nds-page .nds-subtitle {
        font-size: 0.95rem !important;
        max-width: 100% !important;
    }

    .square_box {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Image CTA: photo beside copy, readable contrast, no overlap */
    .hdd_cta_image,
    .hd-tech-cta,
    .mfg-hire-cta {
        max-width: 100%;
    }

    .hdd_cta_image .digi__color_cta,
    .hd-tech-cta .digi__color_cta,
    .nds-page .hdd_cta_image .digi__color_cta,
    .nds-page .fintech-hire-cta .digi__color_cta {
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        padding: 1.5rem 1.15rem 1.75rem !important;
    }

    .hdd_cta_image .color_cta_top,
    .hd-tech-cta .color_cta_top,
    .mfg-hire-cta .color_cta_top,
    .nds-page .fintech-hire-cta.hd-tech-cta .color_cta_top,
    .nds-page .hdd_cta_image.hd-tech-cta .color_cta_top {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.85rem;
        padding: 0 !important;
        max-width: 100%;
        box-sizing: border-box;
        color: #fff;
    }

    .hdd_cta_image .hd-tech-cta__image,
    .hd-tech-cta .hd-tech-cta__image,
    .mfg-hire-cta .hd-tech-cta__image {
        flex: 0 0 110px !important;
        width: 110px !important;
        max-width: 110px !important;
        order: 0 !important;
        align-self: center;
    }

    .hdd_cta_image .hd-tech-cta__image img,
    .hd-tech-cta .hd-tech-cta__image img,
    .hdd_cta_image .hd-tech-cta__image > a,
    .hd-tech-cta .hd-tech-cta__image > a {
        width: 100%;
        max-width: 100%;
        height: auto !important;
        max-height: 150px;
        object-fit: contain;
        display: block;
    }

    .hdd_cta_image .hd-tech-cta__content,
    .hd-tech-cta .hd-tech-cta__content,
    .mfg-hire-cta .hd-tech-cta__content {
        flex: 1 1 0;
        min-width: 0;
        width: auto !important;
        text-align: left !important;
    }

    .hdd_cta_image .hd-tech-cta__content h2-hire,
    .hdd_cta_image h2-hire,
    .hd-tech-cta .hd-tech-cta__content h2-hire,
    .hdd_cta_image .hd-tech-cta__content h2,
    .hd-tech-cta .hd-tech-cta__content h2,
    .hdd_cta_image .hd-tech-cta__content p,
    .hd-tech-cta .hd-tech-cta__content p,
    .hdd_cta_image .nds-cta-sub,
    .hd-tech-cta .nds-cta-sub,
    .hdd_cta_image .hd-tech-cta__content strong,
    .hd-tech-cta .hd-tech-cta__content strong,
    .color_cta_top p,
    .color_cta_top h2,
    .color_cta_top h2-hire,
    .color_cta_top strong {
        color: rgba(255, 255, 255, .92) !important;
        max-width: 100%;
        width: auto !important;
        text-align: left;
    }

    .hdd_cta_image .hd-tech-cta__content h2-hire,
    .hdd_cta_image h2-hire,
    .hd-tech-cta .hd-tech-cta__content h2-hire {
        font-size: clamp(1.05rem, 4.4vw, 1.45rem) !important;
        line-height: 1.3 !important;
        margin: 0;
    }

    .hdd_cta_image .hd-tech-cta__content p,
    .hd-tech-cta .hd-tech-cta__content p,
    .hdd_cta_image .nds-cta-sub,
    .hd-tech-cta .nds-cta-sub,
    .hdd_cta_image .color_cta_top p,
    .color_cta_top p {
        font-size: 0.9rem !important;
        line-height: 1.45 !important;
        margin-top: 0.35rem;
        overflow-wrap: anywhere;
    }

    .hdd_cta_image .hd-tech-cta__content .stroke_btn,
    .hd-tech-cta .hd-tech-cta__content .stroke_btn,
    .hdd_cta_image .stroke_btn,
    .hd-tech-cta .stroke_btn,
    .hdd_cta_image .black_btn,
    .hd-tech-cta .black_btn,
    .fintech-hire-cta .stroke_btn,
    .fintech-hire-cta .black_btn,
    .nds-page .fintech-hire-cta .black_btn {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 1rem 0 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Buttons: label stays inside the pill */
    .stroke_btn,
    .nds-page .stroke_btn,
    .nds-page .nds-hero .stroke_btn,
    .nds-page .nds-hero-cta-btn,
    .nds-page .nds-cta-banner .stroke_btn,
    .hero_content .stroke_btn,
    .hero_button_s .stroke_btn,
    .black_btn,
    .bg_btn {
        max-width: 100% !important;
        width: auto;
        box-sizing: border-box;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.4rem;
        white-space: normal !important;
        height: auto !important;
        line-height: 1.3 !important;
        font-size: clamp(.8rem, 3.4vw, .95rem) !important;
        padding: .65rem 1rem !important;
        overflow: visible;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .nds-page .nds-cta-banner .stroke_btn {
        width: 100%;
        max-width: 100% !important;
        padding: .65rem .85rem .65rem 1rem !important;
    }

    .nds-page .nds-hero-cta-btn {
        width: auto;
        max-width: 100% !important;
        padding: .65rem .85rem .65rem 1rem !important;
    }

    .hero_content_s .stroke_btn {
        max-width: 100% !important;
        white-space: normal !important;
    }

    .stroke_btn > span,
    .nds-page .nds-hero-cta-btn .nds-hero-cta-arrow {
        flex-shrink: 0;
    }

    .nds-page .nds-cta-banner .stroke_btn > span {
        width: 2rem;
        height: 2rem;
        margin-left: 0;
    }

    .nds-page .nds-hero-cta-btn .nds-hero-cta-text {
        font-size: inherit !important;
        min-width: 0;
    }

    /* CTA banners: never force a min-width that overflows the phone */
    .nds-page .nds-cta-banner,
    .nds-page .nds-cta-banner .nds-cta-content,
    .cs-page .cs-cta-banner,
    .cs-page .cs-cta-content {
        min-width: 0 !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Grids that stay 3-col on small tablets */
    .nds-page .nds-svc-grid,
    .nds-page .nds-ch-grid,
    .nds-page .nds-engage-grid,
    .nds-page .nds-tech-grid {
        grid-template-columns: 1fr !important;
    }

    /* Tables / FAQs / forms */
    .nds-page table,
    .nds-page .nds-hc-table,
    .nds-page .nds-compare-table {
        max-width: 100%;
    }

    .nds-page .nds-hc-table-wrap,
    .nds-page .nds-compare-table-wrap,
    .nds-page .nds-why-table-wrap {
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .faq_btn,
    .faq_accordian .accordion-button,
    .nds-page .nds-acco-btn,
    .nds-page .accordion-button {
        white-space: normal !important;
        text-align: left;
        height: auto !important;
        overflow-wrap: anywhere;
    }

    .nds-page input,
    .nds-page select,
    .nds-page textarea,
    .enterprise-hero-form input,
    .enterprise-hero-form select,
    .enterprise-hero-form textarea,
    .select2-container,
    .select2-dropdown {
        max-width: 100%;
        box-sizing: border-box;
    }

    header,
    .header_nav,
    .digi_footer,
    .hero_section,
    .hero__section {
        max-width: 100%;
        box-sizing: border-box;
    }

    .hero__section {
        min-height: 0 !important;
        height: auto !important;
        padding-top: 5.5rem;
        padding-bottom: 2.5rem;
    }

    .nds-auto-cases-sec,
    .nds-auto-cases-stack,
    .slick-list,
    .slick-track {
        max-width: 100%;
    }
}

@media (max-width: 430px) {
    .hdd_cta_image .color_cta_top,
    .hd-tech-cta .color_cta_top,
    .mfg-hire-cta .color_cta_top {
        gap: 0.7rem;
    }

    .hdd_cta_image .hd-tech-cta__image,
    .hd-tech-cta .hd-tech-cta__image {
        flex-basis: 96px !important;
        width: 96px !important;
        max-width: 96px !important;
    }

    .stroke_btn,
    .nds-page .stroke_btn,
    .nds-page .nds-hero-cta-btn,
    .nds-page .nds-cta-banner .stroke_btn {
        font-size: clamp(.78rem, 3.2vw, .9rem) !important;
        padding: .6rem .85rem !important;
    }
}

@media (max-width: 575px) {
    .nds-page .nds-hero .hero_content_s h1,
    .nds-page .nds-hero h1 {
        font-size: clamp(1.7rem, 8vw, 2.15rem) !important;
        line-height: 1.2 !important;
    }

    .nds-page .nds-hero .hero_content_s p,
    .nds-page .nds-hero p {
        font-size: 0.95rem !important;
    }

    .enterprise-hero-form .contact_submit,
    .enterprise-hero-form button[type="submit"] {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }

    /* Image CTA: stack photo above copy so the button stays inside the card */
    .hdd_cta_image .color_cta_top,
    .hd-tech-cta .color_cta_top,
    .mfg-hire-cta .color_cta_top,
    .nds-page .fintech-hire-cta.hd-tech-cta .color_cta_top,
    .nds-page .hdd_cta_image.hd-tech-cta .color_cta_top {
        flex-direction: column !important;
        flex-wrap: wrap;
        align-items: center;
        text-align: center;
        gap: 0.85rem;
    }

    .hdd_cta_image .hd-tech-cta__image,
    .hd-tech-cta .hd-tech-cta__image,
    .mfg-hire-cta .hd-tech-cta__image {
        flex: 0 0 auto !important;
        width: 42% !important;
        max-width: 150px !important;
    }

    .hdd_cta_image .hd-tech-cta__content,
    .hd-tech-cta .hd-tech-cta__content,
    .mfg-hire-cta .hd-tech-cta__content {
        width: 100% !important;
        text-align: center !important;
    }

    .hdd_cta_image .hd-tech-cta__content h2-hire,
    .hdd_cta_image h2-hire,
    .hdd_cta_image .hd-tech-cta__content p,
    .hdd_cta_image .nds-cta-sub,
    .color_cta_top p,
    .color_cta_top h2-hire,
    .color_cta_top h2 {
        text-align: center;
    }

    .hdd_cta_image .stroke_btn,
    .hdd_cta_image .black_btn,
    .hd-tech-cta .stroke_btn,
    .hd-tech-cta .black_btn {
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 0 !important;
    }

    .hero_content h1,
    .hero_content .static-text {
        font-size: clamp(1.55rem, 7.5vw, 1.9rem) !important;
        line-height: 1.25 !important;
        overflow-wrap: anywhere;
    }
}
