/* The shared owner shell keeps sideways spill clipped without making body the
   non-scrolling containing block for the sticky top bar. Layout only. */
html.ns-owner-fit,
html.ns-owner-fit body {
    overflow-x: hidden;
    overflow-x: clip;
}

html.ns-owner-fit {
    --ns-owner-bar-clearance: 6.625rem;
    --ns-owner-guide-size: 3.5rem;
    --ns-owner-guide-gutter: var(--ns-space-4, 1rem);
    --ns-owner-guide-clearance: calc(
        var(--ns-owner-guide-size) + (2 * var(--ns-owner-guide-gutter)) + env(safe-area-inset-bottom, 0px)
    );
}

/* The chip remains in normal document order, with the same page gutter at
   narrow and wide sizes. Its decorative progress pips no longer shrink below
   the surrounding body copy. */
html.ns-owner-fit .ns-level-chip-wrap {
    margin-inline: var(--ns-space-4, 1rem);
}

html.ns-owner-fit .ns-level-chip .ns-level-pips {
    font-size: 1rem;
}

@media (min-width: 992px) {
    /* Sidebar v2 has legacy inline important geometry. The switched shell is
       deliberately more specific so the card begins below the complete bar. */
    html.ns-owner-fit .ns-sidebar {
        top: var(--ns-owner-bar-clearance) !important;
        height: calc(100dvh - var(--ns-owner-bar-clearance)) !important;
        overflow: hidden !important;
    }

    html.ns-owner-fit .ns-sidebar__panel {
        min-height: 0;
        overflow: hidden;
    }

    html.ns-owner-fit .ns-sidebar__body {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

@media (max-width: 991.98px) {
    /* Normal page content can scroll completely above the unchanged floating
       guide. Bottom action rows share that reserved lane while they are sticky. */
    html.ns-owner-fit body {
        padding-bottom: var(--ns-owner-guide-clearance);
    }

    html.ns-owner-fit :is(.ns-mobile-sticky-cta, .gp-chat-input-wrap, .ns-owner-stage__band) {
        bottom: var(--ns-owner-guide-clearance);
    }
}

/* Promote the dashboard's proven compact bar contract to every signed-in page.
   The existing mobile sheet carries the same groups and links when the inline
   group row no longer fits; no navigation is removed. */
html.ns-owner-fit .ns-navbar-v2__inner {
    width: 100%;
    min-width: 0;
}

html.ns-owner-fit .ns-navbar-v2__right {
    min-width: 0;
}

html.ns-owner-fit .ns-navbar-v2__user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

html.ns-owner-fit .ns-navbar-v2 :is(.ns-navbar-v2__trigger, .ns-navbar-v2__cta, .ns-navbar-v2__wordmark) {
    white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    html.ns-owner-fit .ns-navbar-v2__desktop {
        display: none !important;
    }

    html.ns-owner-fit .ns-navbar-v2__mobile-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 1199.98px) {
    html.ns-owner-fit .ns-navbar-v2__user > .d-md-inline,
    html.ns-owner-fit .ns-navbar-v2__search .ns-navbar-v2__hint {
        display: none !important;
    }

    html.ns-owner-fit .ns-navbar-v2__inner {
        gap: .5rem;
    }
}

@media (max-width: 767.98px) {
    html.ns-owner-fit .ns-navbar-v2__user > .fa-chevron-down {
        display: none;
    }
}

@media (max-width: 479.98px) {
    html.ns-owner-fit .ns-navbar-v2__cta-phone {
        font-size: 0;
    }

    html.ns-owner-fit .ns-navbar-v2__cta-phone i,
    html.ns-owner-fit .ns-navbar-v2__cta-phone::after {
        font-size: .85rem;
    }

    html.ns-owner-fit .ns-navbar-v2__cta-phone::after {
        content: "Create";
    }
}

/* Keep Bootstrap's check control visual separate from its phone-sized target.
   The label owns the generous target; the input stays a check, radio or switch. */
html.ns-owner-fit .form-check {
    min-block-size: 44px;
}

html.ns-owner-fit .form-check-input {
    inline-size: 1.25em !important;
    block-size: 1.25em !important;
    min-inline-size: 1.25em !important;
    min-block-size: 1.25em !important;
    flex: 0 0 auto;
}

html.ns-owner-fit .form-switch .form-check-input {
    inline-size: 2em !important;
}

html.ns-owner-fit .form-check-label {
    display: flex;
    align-items: center;
    min-block-size: 44px;
    padding-inline: 0.5rem;
}
