:root :is(button[data-popup-close], .profile-media-reader-back) {
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  isolation: isolate;
  display: grid;
  place-items: center;
  align-self: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: none;
  max-height: none;
  padding: 0 !important;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--ink, CanvasText);
}
:root :is(button[data-popup-close], .profile-media-reader-back)::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  border: 1px solid var(--popup-close-line, var(--line, #dedbe1));
  border-radius: 50%;
  background: var(--popup-close-bg, var(--surface, Canvas));
  pointer-events: none;
  z-index: -1;
}
:root :is(button[data-popup-close], .profile-media-reader-back):hover::before {
  filter: brightness(0.94);
}
:root :is(button[data-popup-close], .profile-media-reader-back) > svg {
  display: block !important;
  position: relative;
  flex: none;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px;
  max-height: 16px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible;
  pointer-events: none;
}
:root :is(button[data-popup-close], .profile-media-reader-back) > svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
:root button[data-popup-close='with-label'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  padding: 0 12px !important;
  border-radius: 999px;
}
:root button[data-popup-close='with-label']::before {
  width: calc(100% - 8px);
  border-radius: 999px;
}
:root button[data-popup-close] > span {
  line-height: 1.4;
  pointer-events: none;
}
/* Pointer/autofocus never draws a ring; deliberate keyboard focus stays visible in a neutral color. */
:root button[data-popup-close] {
  outline: none !important;
}
:root button[data-popup-close][data-popup-keyboard]:focus-visible {
  outline: 2px solid var(--popup-close-focus, var(--ink, CanvasText)) !important;
  outline-offset: 1px;
}
:root #dialog.community-viewer-dialog #dialog-close,
:root .message-photo-viewer .message-photo-close,
:root .profile-media-reader-header .profile-media-reader-back {
  --popup-close-bg: #000b;
  --popup-close-line: transparent;
  color: #fff;
}

:root #dialog.community-viewer-dialog #dialog-close,
:root .message-photo-viewer .message-photo-close {
  --popup-close-focus: #fff;
}
