/* Restored controls take their saved geometry without replaying the expansion. */
html[data-avatar-restoring] :is(#bookingDetailView, #hero-photo-viewer) *,
html[data-avatar-restoring] :is(#bookingDetailView, #hero-photo-viewer) *::before,
html[data-avatar-restoring] :is(#bookingDetailView, #hero-photo-viewer) *::after {
    transition-duration: 0s;
    animation-duration: 0s;
}

/* Keep the visible part of a long, restored booking sheet connected to the
   profile's return row. Its real content keeps the saved document offset. */
html[data-booking-sheet-arrival] body.booking-page #main-content-container {
    display:flow-root;
    margin-top:calc(-1 * var(--sm-sheet-radius))!important;
    --sm-return-clip-inset:max(0px,calc(var(--sm-navbar-bottom,66px) - var(--sm-sheet-radius) - var(--sm-arrival-rest)));
    --sm-returning-dock:var(--sm-arrival-edge);
    top:calc(var(--sm-arrival-edge) - var(--sm-arrival-rest) - var(--sm-return-clip-inset));
}
html[data-booking-sheet-arrival] body.booking-page #main-content-container > .main-content {
    margin-top:0!important;
}
html[data-booking-sheet-arrival] body.booking-page #main-content-container,
html body.booking-page #main-content-container[data-sm-return-clip] {
    clip-path:inset(var(--sm-return-clip-inset) 0 0 round var(--sm-sheet-radius) var(--sm-sheet-radius) 0 0);
}
html[data-booking-sheet-arrival] .booking-page #main-content-container [data-sm-docked],
html .booking-page #main-content-container[data-sm-return-clip] [data-sm-docked] {
    top:var(--sm-returning-dock)!important;
}
html[data-avatar-restoring] .booking-page #hero-container {
    height:var(--sm-restored-photo-height,calc(var(--sm-hero-height) + var(--sm-detail-hero-extra)));
    overflow:clip;
    background-color:var(--sm-field-fill);
    background-image:var(--sm-return-backdrop,none);
    background-position:center;
    background-size:cover;
    background-repeat:no-repeat;
}
html[data-avatar-restoring] .booking-page #hero-container :is(.hero-loading,.hero-section:not(.hero-photo-mode)),
html[data-avatar-restoring] .booking-page #hero-container .hero-photo-mode:not(:has(.photo-expand-btn,.main-photo.is-ready)) {
    visibility:hidden;
}
html[data-avatar-restoring] body.booking-page:not(.booking-detail-no-media) #main-content-container {
    display:flow-root;
    margin-top:calc(-1 * var(--sm-sheet-radius))!important;
}
html[data-avatar-restoring] body.booking-page #main-content-container > .details-booking-content {
    margin-top:0!important;
}

html[data-avatar-no-cover] body.booking-page #hero-container { display:none!important; }
html[data-avatar-restoring][data-avatar-no-cover] body.booking-page #main-content-container {
    margin-top:calc(var(--sm-navbar-bottom,66px) + 1px)!important;
}

/* Before the sticky controller mounts, keep the real return button on the
   returning arc, even when its original document position is off-screen. */
html[data-booking-dock-arrival] .details-booking-wrapper > .details-header:not([data-sm-docked]) {
    position:fixed!important;
    top:var(--sm-returning-dock)!important;
    inset-inline:0;
    margin:0!important;
}
html[data-booking-dock-arrival] .details-booking-wrapper:has(> .details-header:not([data-sm-docked])) {
    padding-top:var(--sm-return-row-height);
}
