/* ===== MOBILE TABLE SCROLLING ===== */
@media screen and (max-width: 768px) {
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 8px !important;
    }
    
    table thead,
    table tbody,
    table tr {
        display: table !important;
        width: 100% !important;
    }
    
    table th,
    table td {
        white-space: normal !important;
        min-width: 120px !important;
        display: table-cell !important;
    }
    
    table::after {
        content: '← Swipe to see more →' !important;
        display: block !important;
        text-align: center !important;
        padding: 0.5rem !important;
        font-size: 0.75rem !important;
        color: rgba(255, 255, 255, 0.4) !important;
        font-style: italic !important;
    }
}

@media screen and (max-width: 768px) {
    
    /* ===== CORE SPACING FIXES ===== */
    
    main > section,
    .division-hero {
        padding: 0.75rem !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .division-hero {
        padding: 0 !important;
        margin-left: 2.15rem !important;
        margin-right: 2.15rem !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        width: calc(100% - 4.3rem) !important;
    }

    header {
        padding-bottom: 0.5rem !important;
    }

    .header-brand {
        padding: 1rem 0.75rem 0.75rem 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }

    header + hr {
        margin: 0.5rem 0 !important;
    }
    
    .header-tagline {
        font-size: 1.25rem !important;
        line-height: 1.35 !important;
        margin-top: 0 !important;
        margin-bottom: 0.5rem !important;
        padding-top: 2rem !important;
        padding-bottom: 0.5rem !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .header-brand > p {
        font-size: 0.9rem !important;
        text-align: center !important;
        margin: 1.50rem 0.5rem 2.75rem 0.5rem !important;
    }
    
    main h2 {
        font-size: 1.3rem !important;
        margin-top: 0.3rem !important;
        margin-bottom: 1.5rem !important;
        padding: 0 0.25rem !important;
    }

    main h3 {
        font-size: 1.1rem !important;
        margin-top: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }

    h2::before,
    h3::before {
        content: none !important;
        display: none !important;
    }
    h2, h3 { padding-left: 0 !important; }
    
    main p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* ===== SUMMARY BOX IMPROVEMENTS ===== */
    
    .summary-box {
        background: rgba(60, 63, 68, 0.25) !important;
        border-left: 2px solid rgba(188, 163, 59, 0.4) !important;
        border-radius: 6px !important;
        padding: 0.75rem !important;
        margin: 0.75rem 0 !important;
    }
    
    .summary-box h3 {
        font-size: 1.05rem !important;
        margin-top: 0 !important;
        margin-bottom: 0.5rem !important;
        color: #f5f5f0 !important;
    }
    
    .summary-box ul {
        padding-left: 1rem !important;
        margin: 0 !important;
    }
    
    .summary-box li {
        margin-bottom: 0.5rem !important;
        line-height: 1.4 !important;
        font-size: 0.85rem !important;
    }
    
    .summary-box li:last-child {
        margin-bottom: 0 !important;
    }
    
    /* ===== CARD SPACING IMPROVEMENTS ===== */
    
    .division-cards {
        gap: 1rem !important;
        padding: 0.5rem !important;
        margin-top: 0.75rem !important;
        background: rgba(0, 0, 0, 0.02) !important;
    }
    
    .division-card {
        min-height: 280px !important;
    }
    
    .card-image {
        height: 140px !important;
    }
    
    .card-content {
        padding: 0.75rem !important;
    }

    .card-content h3 {
        font-size: 1.15rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .card-content p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .comparison-cards {
        gap: 1rem !important;
        padding: 0.5rem !important;
    }
    
    .comparison-card {
        padding: 0.75rem !important;
    }

    .comparison-card h3 {
        font-size: 1.15rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    /* ===== BUTTON SPACING ===== */
    
    .cta-button {
        font-size: 0.8rem !important;
        padding: 10px 16px !important;
        margin: 8px auto !important;
        min-height: 36px !important;
    }
    
    .card-content .cta-button {
        margin-top: auto !important;
        margin-bottom: 0 !important;
    }
    
    /* ===== LIST IMPROVEMENTS ===== */
    
    ul, ol {
        margin-bottom: 0.75rem !important;
    }

    p + .summary-box,
    ul + .summary-box,
    ol + .summary-box,
    h2 + .summary-box,
    h3 + .summary-box {
        margin-top: 0 !important;
    }

    p + .division-cards,
    p + .comparison-cards,
    p + .contact-grid,
    p + .cta-section,
    p + .industry-grid {
        margin-top: 0 !important;
    }

    p:has(+ .summary-box),
    p:has(+ .division-cards),
    p:has(+ .comparison-cards),
    p:has(+ .contact-grid),
    p:has(+ .cta-section),
    p:has(+ .industry-grid) {
        margin-bottom: 2.75rem !important;
    }

    .summary-box + h3 { margin-top: 1.5rem !important; }
    h3 + .industry-grid { margin-top: 0.75rem !important; }
    
    li {
        margin-bottom: 0.6rem !important;
        line-height: 1.4 !important;
        font-size: 0.9rem !important;
    }
    
    .industry-card {
        margin-bottom: 0.4rem !important;
        padding: 0.2rem 0 !important;
    }
    
    .industry-card p {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    
    /* ===== HR DIVIDERS ===== */
    
    hr {
        margin: 1rem 0 !important;
        opacity: 0.3 !important;
    }
    
    /* ===== CONTACT SECTION ===== */
    
    .contact-box {
        padding: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .cta-section {
        padding: 1.5rem 1rem !important;
    }

    .cta-section h2 {
        margin-bottom: 0.5rem !important;
    }
    
    /* ===== TABLE ADJUSTMENTS ===== */
    
    table td, table th {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
    }
    
    /* ===== FOOTER SPACING ===== */
    
    footer {
        padding: 1.5rem 1rem !important;
    }
    
    footer p {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* ===== FLOATING CONTACT BUTTON FIX ===== */
    
    .floating-cta,
    .contact-float {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin: 1rem auto !important;
        display: block !important;
        width: fit-content !important;
    }
    
    /* ===== ENSURE BOTTOM NAV HAS SPACE ===== */
    
    body {
        padding-bottom: 60px !important;
    }
    
    /* ===== PAGE-SPECIFIC ADJUSTMENTS ===== */
    
    .team-member,
    .bio-section {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    .case-study-card {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    .contact-form input,
    .contact-form textarea {
        padding: 0.5rem !important;
        margin-bottom: 0.75rem !important;
        font-size: 0.9rem !important;
    }
    
    .service-item {
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .industry-grid { margin-bottom: 0.5rem !important; }
    p:has(.cta-button) { margin: 0.5rem 0 !important; }
    .cta-button { margin: 0.5rem auto !important; }
    p:has(.cta-button) + p:has(.cta-button) { margin-top: 0.5rem !important; }
}
