/* Homepage-only mobile actions. Keep the existing desktop floating quote untouched. */
.home-phone-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    white-space: nowrap;
}

.home-phone-links .home-phone-link {
    font-size: 0.72rem;
    line-height: 1.35;
    margin: 0;
    padding: 0.12rem 0.35rem;
    color: #174879 !important;
    font-weight: 600;
}

.home-phone-links .home-phone-link:hover {
    color: #007BFF !important;
}

.mobile-action-bar {
    display: none;
}

.homepage-scroll-content {
    display: contents;
}

@media (max-width: 767px) {
    html {
        height: 100%;
        overflow: hidden;
    }

    body {
        --mobile-action-height: calc(78px + env(safe-area-inset-bottom, 0px));
        --mobile-header-space: 80px;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .homepage-scroll-content {
        display: block;
        height: calc(100vh - var(--mobile-header-space) - var(--mobile-action-height));
        height: max(0px, calc(var(--mobile-visible-bottom, 100dvh) - var(--mobile-header-space) - var(--mobile-action-height)));
        overflow-y: auto;
        scroll-behavior: smooth;
        scroll-padding-top: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    /* Only font-size changes on form controls; leave CAPTCHA controls untouched. */
    #quote form input:not([type="hidden"]),
    #quote form select,
    #quote form textarea:not([name="h-captcha-response"]):not([name="g-recaptcha-response"]),
    #contact form input:not([type="hidden"]),
    #contact form select,
    #contact form textarea {
        font-size: 16px !important;
    }

    #mainNavbar .navbar-collapse {
        max-height: calc(100vh - 90px - var(--mobile-action-height));
        max-height: calc(100dvh - 90px - var(--mobile-action-height));
        overflow-y: auto;
    }

    .home-phone-links {
        padding: 0.15rem 0 0.3rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .home-phone-links .home-phone-link {
        min-height: 42px;
        padding: 0.55rem 0.5rem;
        font-size: 0.95rem;
        border-bottom: 0;
    }

    /* The mobile bar is a dedicated viewport row, not the desktop floating pill. */
    body .sticky-cta {
        display: none !important;
    }

    .mobile-action-bar {
        position: fixed;
        z-index: 1040;
        inset-inline: 0;
        bottom: var(--mobile-viewport-gap, 0px);
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        gap: 10px;
        align-items: center;
        min-height: 68px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(13, 54, 105, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        box-shadow: 0 -5px 22px rgba(10, 35, 70, 0.18);
    }

    .mobile-action-bar a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 48px;
        padding: 0.65rem 0.75rem;
        border-radius: 12px;
        font-size: 0.94rem;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
    }

    .mobile-action-bar__call {
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.72);
        background: transparent;
    }

    .mobile-action-bar__quote {
        color: #24354a;
        border: 1px solid #ffa534;
        background: #ffa534;
    }

    .mobile-action-bar a:focus-visible {
        outline: 3px solid #fff;
        outline-offset: 2px;
    }

    .mobile-action-bar[hidden] {
        display: none !important;
    }
}

@media (max-width: 374px) {
    .mobile-action-bar {
        gap: 7px;
        padding-inline: 10px;
    }

    .mobile-action-bar a {
        padding-inline: 0.45rem;
        font-size: 0.88rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .homepage-scroll-content {
        scroll-behavior: auto;
    }
}
