/* Yappy popup surface normalization v122
   Visual-only: keep popup shells from changing horizontal size between actions.
   Does not alter navigation, scrolling, keyboard, data, or app state. */

#overlay-root{
  overflow:hidden!important;
}

/* Canonical bottom sheet shell */
#overlay-root .sheet{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  left:auto!important;
  right:auto!important;
  overflow-x:hidden!important;
  scrollbar-gutter:auto!important;
}

/* Remove app-specific narrow sheet widths that make the panel jump sideways. */
#overlay-root .sheet.x56-repost-sheet{
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* Canonical centered dialog shell */
#overlay-root.center .card-modal,
#overlay-root .card-modal{
  box-sizing:border-box!important;
  width:min(360px,calc(100% - 24px))!important;
  min-width:0!important;
  max-width:min(360px,calc(100% - 24px))!important;
  margin-left:auto!important;
  margin-right:auto!important;
  overflow-x:hidden!important;
}

/* Inner form controls never influence shell width. */
#overlay-root .sheet>*,
#overlay-root .card-modal>*{
  max-width:100%;
  min-width:0;
}

#overlay-root .text-field,
#overlay-root .select-field,
#overlay-root textarea,
#overlay-root input,
#overlay-root select,
#overlay-root .settings-card,
#overlay-root .settings-item{
  max-width:100%!important;
  min-width:0!important;
}

/* Keep the overlay itself anchored to the exact phone surface. */
#overlay-root{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  left:0!important;
  right:0!important;
}


/* v2 — X action sheets must never degrade into blur-only overlays.
   X clears stale keyboard viewport state before opening actions; these rules are the
   final visual fail-safe when older iOS/A2HS layout state or another sheet style
   would otherwise leave only the scrim visible. */
html[data-social-app="x"] #overlay-root.show[data-x-overlay-live="1"]{
  z-index:1400!important;
  align-items:flex-end!important;
  justify-content:center!important;
  background:rgba(0,0,0,.34)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  overflow:hidden!important;
}

html[data-social-app="x"] #overlay-root.show[data-x-overlay-live="1"]>.sheet{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  transform:translate3d(0,0,0)!important;
  max-height:min(84%,720px)!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
}

html[data-social-app="x"] #overlay-root.show[data-x-overlay-live="1"]>.card-modal{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  transform:scale(1)!important;
}

html[data-social-app="x"] #overlay-root.show[data-x-overlay-live="1"]>.sheet.x56-repost-sheet{
  width:min(240px,calc(100% - 44px))!important;
  min-width:0!important;
  max-width:240px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  margin-bottom:max(16px,env(safe-area-inset-bottom,0px))!important;
}

html[data-social-app="x"] #overlay-root.show[data-x-overlay-live="1"]>.sheet.x56-quote-sheet{
  max-height:min(88%,760px)!important;
}

html[data-social-app="x"] #overlay-root.show[data-x-overlay-live="1"]>.x56-overlay-force-visible{
  position:relative!important;
  inset:auto!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  transform:none!important;
}
