/* Disclosures follow the first viewport in normal page flow. */
html:has(> body.app-shared-shell > #appBusinessRegion) {
    height:auto !important; min-height:100dvh; overflow-y:auto !important; overflow-x:hidden !important;
    overscroll-behavior-y:auto !important;
}
html body.app-shared-shell:has(> #appBusinessRegion) {
    height:auto !important; min-height:100dvh; overflow:visible !important; overscroll-behavior-y:auto !important;
}
/* Clip the frame without creating empty scroll owners between the page and root. */
html body.app-shared-shell:has(> #appBusinessRegion) > #appMainFrame,
html body.app-shared-shell:has(> #appBusinessRegion) > #appMainFrame > #appViewportRegion {
    overflow:clip !important;
}
/* Bounded page/home columns hand their remaining gesture to the disclosure. */
html body.app-shared-shell:has(> #appBusinessRegion) :is(#appMainFrame,#appViewportRegion,#appContentRegion,#dashboardSection,#infoCardsSection,.dash-col-main,.dash-col-calendar,.settings-main) {
    overscroll-behavior-y:auto !important;
}
/* Page surfaces keep their footer; a child modal retains its background lock. */
html.app-footer-dialog-open:has(> body.app-shared-shell > #appMainFrame):has(> body > #appBusinessRegion) {
    overflow-y:hidden !important;
}
html body.app-shared-shell > #appBusinessRegion { position:relative; width:100%; }
html body.app-shared-shell > #appMainFrame { flex-shrink:0; }
#appBusinessRegion { grid-area:business; min-width:0; background:var(--color-surface,#fff); border-top:1px solid var(--color-border,#dce3ed); }
#appBusinessRegion > .service-footer,
body:not(.app-shared-shell) > .service-footer {
    display:block !important; width:100%; max-width:none !important; box-sizing:border-box;
    margin:0 !important; padding:4px 10px !important; border:0 !important;
    background:var(--color-surface,#fff); color:var(--color-text-secondary,#374151);
    font-size:12px !important; line-height:1.4 !important; text-align:center;
}
#appBusinessRegion .service-footer-main,
body > .service-footer .service-footer-main { display:inline; margin:0; }
#appBusinessRegion .service-footer-main > *,
body > .service-footer .service-footer-main > * { margin-right:8px; overflow-wrap:anywhere; }
#appBusinessRegion .service-footer-identity > strong,
body > .service-footer .service-footer-identity > strong { display:none; }
#appBusinessRegion .service-footer-links,
body > .service-footer .service-footer-links { display:flex; flex-wrap:wrap; justify-content:center; gap:2px 12px; margin:2px 0 0 !important; }
#appBusinessRegion .service-footer a,
body > .service-footer a { color:var(--action-primary-bg,#245dab); text-decoration:underline; }
#appBusinessRegion .service-footer-note,
body > .service-footer .service-footer-note { margin:2px auto 0 !important; max-width:none; color:inherit; font-size:12px; line-height:1.3; }
html[data-theme="dark"] #appBusinessRegion,
html[data-theme="dark"] body > .service-footer { background:#14171b; color:#c5ceda; }
html[data-theme="dark"] #appBusinessRegion .service-footer :is(.service-footer-main,.service-footer-note),
html[data-theme="dark"] body > .service-footer :is(.service-footer-main,.service-footer-note) { color:#c5ceda; }
html[data-theme="dark"] #appBusinessRegion .service-footer a,
html[data-theme="dark"] body > .service-footer a { color:#a6caff; }
@media(max-width:767px) {
    #appBusinessRegion > .service-footer { padding:3px 8px calc(3px + env(safe-area-inset-bottom,0px)) !important; font-size:11px !important; line-height:14px !important; }
    #appBusinessRegion .service-footer-main > * { margin-right:5px; }
    #appBusinessRegion .service-footer-links > a { min-height:44px; display:inline-flex; align-items:center; }
    #appBusinessRegion .service-footer-note { font-size:12px; line-height:14px; }
}
body:not(.app-shared-shell):has(> .service-footer) { padding-bottom:0 !important; }
body:not(.app-shared-shell) > .service-footer { position:relative; border-top:1px solid #dce3ed !important; padding-bottom:calc(4px + env(safe-area-inset-bottom,0px)) !important; }

/* #450-104: keep every disclosure visible on small phones without empty link rows. */
@media (max-width:480px) {
    #appBusinessRegion > .service-footer,
    body:not(.app-shared-shell) > .service-footer {
        padding:2px 6px calc(2px + env(safe-area-inset-bottom,0px)) !important;
        font-size:11px !important; line-height:14px !important;
    }
    #appBusinessRegion .service-footer :is(.service-footer-main,.service-footer-links,.service-footer-note),
    body > .service-footer :is(.service-footer-main,.service-footer-links,.service-footer-note) {
        margin:0 !important; padding:0 !important;
        font-size:11px !important; line-height:14px !important;
    }
    #appBusinessRegion .service-footer-main > *,
    body > .service-footer .service-footer-main > * { margin-right:3px; }
    #appBusinessRegion .service-footer a,
    body > .service-footer a {
        min-width:0 !important; min-height:0 !important; height:auto !important;
        padding:0 !important; font-size:11px !important; line-height:14px !important;
        vertical-align:baseline;
    }
    #appBusinessRegion .service-footer-links,
    body > .service-footer .service-footer-links {
        display:inline-flex !important; flex-wrap:nowrap; gap:0 8px;
        white-space:nowrap; vertical-align:baseline;
    }
    #appBusinessRegion .service-footer-note,
    body > .service-footer .service-footer-note { display:inline !important; }
}
