/* Perfectly centered close icons (CSS-drawn X) for typographic × buttons */

:where(
  .modal-close,
  .shadow-feedback-close,
  .ss-app-download-promo__close,
  .ss-app-beta-promo__close,
  .world-cup-video-popup__close,
  .comments-modal__close,
  .safety-modal__close,
  .share-modal__close,
  .feed-stats-dropdown__close,
  .settings-icon-action,
  .ss-quick-dm-dropdown__close,
  .coop-support-widget__close,
  .messages-quickchat__close,
  .ss-dlb-card__close,
  .hint-toast__close,
  .source-canvas-editor__close,
  .shadow-cast-source-fullscreen__close,
  .ss-maint-modal__close,
  .studio-live-stats-overlay__close,
  .music-library-modal__close,
  .upload-mobile-hub-header__close,
  .ss-mobile-quick-sheet__close
):not(:has(svg)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 0;
  font-size: 0;
  letter-spacing: 0;
  text-align: center;
  overflow: hidden;
  vertical-align: middle;
}

:where(
  .modal-close,
  .shadow-feedback-close,
  .ss-app-download-promo__close,
  .ss-app-beta-promo__close,
  .world-cup-video-popup__close,
  .comments-modal__close,
  .safety-modal__close,
  .share-modal__close,
  .feed-stats-dropdown__close,
  .settings-icon-action,
  .ss-quick-dm-dropdown__close,
  .coop-support-widget__close,
  .messages-quickchat__close,
  .ss-dlb-card__close,
  .hint-toast__close,
  .source-canvas-editor__close,
  .shadow-cast-source-fullscreen__close,
  .ss-maint-modal__close,
  .studio-live-stats-overlay__close,
  .music-library-modal__close,
  .upload-mobile-hub-header__close,
  .ss-mobile-quick-sheet__close
):not(:has(svg)) > span {
  display: none !important;
}

:where(
  .modal-close,
  .shadow-feedback-close,
  .ss-app-download-promo__close,
  .ss-app-beta-promo__close,
  .world-cup-video-popup__close,
  .comments-modal__close,
  .safety-modal__close,
  .share-modal__close,
  .feed-stats-dropdown__close,
  .settings-icon-action,
  .ss-quick-dm-dropdown__close,
  .coop-support-widget__close,
  .messages-quickchat__close,
  .ss-dlb-card__close,
  .hint-toast__close,
  .source-canvas-editor__close,
  .shadow-cast-source-fullscreen__close,
  .ss-maint-modal__close,
  .studio-live-stats-overlay__close,
  .music-library-modal__close,
  .upload-mobile-hub-header__close,
  .ss-mobile-quick-sheet__close
):not(:has(svg))::before,
:where(
  .modal-close,
  .shadow-feedback-close,
  .ss-app-download-promo__close,
  .ss-app-beta-promo__close,
  .world-cup-video-popup__close,
  .comments-modal__close,
  .safety-modal__close,
  .share-modal__close,
  .feed-stats-dropdown__close,
  .settings-icon-action,
  .ss-quick-dm-dropdown__close,
  .coop-support-widget__close,
  .messages-quickchat__close,
  .ss-dlb-card__close,
  .hint-toast__close,
  .source-canvas-editor__close,
  .shadow-cast-source-fullscreen__close,
  .ss-maint-modal__close,
  .studio-live-stats-overlay__close,
  .music-library-modal__close,
  .upload-mobile-hub-header__close,
  .ss-mobile-quick-sheet__close
):not(:has(svg))::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(14px, 40%);
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  pointer-events: none;
}

:where(
  .modal-close,
  .shadow-feedback-close,
  .ss-app-download-promo__close,
  .ss-app-beta-promo__close,
  .world-cup-video-popup__close,
  .comments-modal__close,
  .safety-modal__close,
  .share-modal__close,
  .feed-stats-dropdown__close,
  .settings-icon-action,
  .ss-quick-dm-dropdown__close,
  .coop-support-widget__close,
  .messages-quickchat__close,
  .ss-dlb-card__close,
  .hint-toast__close,
  .source-canvas-editor__close,
  .shadow-cast-source-fullscreen__close,
  .ss-maint-modal__close,
  .studio-live-stats-overlay__close,
  .music-library-modal__close,
  .upload-mobile-hub-header__close,
  .ss-mobile-quick-sheet__close
):not(:has(svg))::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

:where(
  .modal-close,
  .shadow-feedback-close,
  .ss-app-download-promo__close,
  .ss-app-beta-promo__close,
  .world-cup-video-popup__close,
  .comments-modal__close,
  .safety-modal__close,
  .share-modal__close,
  .feed-stats-dropdown__close,
  .settings-icon-action,
  .ss-quick-dm-dropdown__close,
  .coop-support-widget__close,
  .messages-quickchat__close,
  .ss-dlb-card__close,
  .hint-toast__close,
  .source-canvas-editor__close,
  .shadow-cast-source-fullscreen__close,
  .ss-maint-modal__close,
  .studio-live-stats-overlay__close,
  .music-library-modal__close,
  .upload-mobile-hub-header__close,
  .ss-mobile-quick-sheet__close
):not(:has(svg))::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Compact text-only closes without explicit size */
:where(.comments-modal__close, .feed-stats-dropdown__close, .safety-modal__close, .share-modal__close):not(:has(svg)) {
  min-width: 36px;
  min-height: 36px;
}

/* Static-flow close buttons need a positioning context for the drawn X */
:where(
  .shadow-feedback-close,
  .comments-modal__close,
  .safety-modal__close,
  .share-modal__close,
  .feed-stats-dropdown__close,
  .settings-icon-action,
  .ss-quick-dm-dropdown__close,
  .coop-support-widget__close,
  .messages-quickchat__close,
  .ss-dlb-card__close,
  .hint-toast__close,
  .source-canvas-editor__close,
  .studio-live-stats-overlay__close,
  .music-library-modal__close,
  .upload-mobile-hub-header__close,
  .ss-mobile-quick-sheet__close
):not(:has(svg)) {
  position: relative;
}
