/* Umbra uses the existing right rail on wide screens and one feed slot below it. */
body.social-instagram[data-social-page="feed"] #feed-umbra-mobile {
  display: flex;
  justify-content: center;
  padding: 12px 0 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid #262626;
}

body.social-instagram[data-social-page="feed"] #feed-umbra-mobile[hidden] {
  display: none !important;
}

#feed-umbra-mobile > [data-umbra-ad] {
  width: 300px;
  max-width: 100%;
}

body.social-instagram[data-social-page="feed"] #feed-right-sidebar {
  display: none !important;
}

@media (min-width: 1200px) {
  body.social-instagram[data-social-page="feed"] .social-feed-layout {
    padding-right: 360px !important;
  }

  body.social-instagram[data-social-page="feed"] .social-feed-layout > #feed-right-sidebar {
    display: block !important;
    width: 340px;
    right: 8px;
    top: 72px;
    bottom: 16px;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  #feed-umbra-desktop {
    width: 300px;
    max-width: 100%;
    margin: 0 auto 20px;
  }

  body.social-instagram[data-social-page="feed"] #feed-umbra-mobile {
    display: none !important;
  }

  /* Keep the rail above the private chat while it is open. */
  body.social-instagram[data-social-page="feed"]:has(#fb-chat-window.open:not(.hidden)) #feed-right-sidebar {
    bottom: 471px;
  }

  body.social-instagram[data-social-page="feed"]:has(#fb-chat-window.open.chat-minimized:not(.hidden)) #feed-right-sidebar {
    bottom: 64px;
  }
}
