/* Shared advertisement hosts. Each network owns its creative dimensions. */
.apkupx-ad-slot {
  display: block;
  position: relative;
  clear: both;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: min(100%, 970px, calc(100vw - 32px));
  margin: 1rem auto;
  text-align: center;
  flex: 0 1 auto;
  align-self: center;
}
.apkupx-ad-slot__inner {
  display: block;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  text-align: center;
}
/* Normal-flow fixed blocks from any network, including plain iframe embeds.
   Keep the full-width measuring parent: flex/grid shrink-to-fit can break an
   empty responsive host before its network initializes it. */
.apkupx-ad-slot__inner > :not(script):not(style):not(link) {
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Residual external frame offsets use only the theme's own horizontal margins.
   No transform, new containing block, width/height or clipping is introduced. */
.apkupx-ad-slot__inner[data-apkup-ad-offset] {
  margin-left: var(--apkup-ad-offset) !important;
  margin-right: calc(-1 * var(--apkup-ad-offset)) !important;
}
.apkupx-ad-slot__inner ins.adsbygoogle {
  margin-left: auto;
  margin-right: auto;
  text-align: center !important;
}
/* Center the outer Google host even when its inline layout is block.
   Only margins/alignment change; the iframe and its dimensions stay untouched. */
.apkupx-ad-slot__inner ins.adsbygoogle div[id^="aswift_"][id$="_host"] {
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Download ads align with the 42rem main card, outside its internal padding. */
.apkupx-ad-slot--download_top,
.apkupx-ad-slot--download_bottom {
  max-width: min(100%, 42rem, calc(100vw - 32px));
}
/* Restore the download buttons' original card gutters without narrowing ads. */
.apkup-download-actions {
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 42rem;
  min-width: 0;
  padding-inline: 2rem;
  border-inline: 1px solid transparent;
}
@media (min-width: 640px) {
  .apkup-download-actions {
    padding-inline: 2.5rem;
  }
}
/* Entry content uses 8px gutters; give its standalone ad the same 16px
   screen gutters as the homepage and download page. */
@media (max-width: 639px) {
  #download-section > .apkupx-ad-slot--single_bottom {
    width: calc(100% - 16px);
  }
}
.apkupx-ad-slot:empty,
.apkupx-ad-slot:has(.apkupx-ad-slot__inner:empty) {
  display: none;
  margin: 0;
}
/* One empty response must not hide a filled sibling or custom fallback. */
.apkupx-ad-slot__inner > ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none;
}

/* Align additional external layers around a known Google host.
   No display, width, height, clipping, transforms or iframe content are changed. */
.apkupx-ad-slot__inner div:has(ins.adsbygoogle),.apkupx-ad-slot__inner ins.adsbygoogle div:has(div[id^="aswift_"][id$="_host"]) {margin-left:auto!important;margin-right:auto!important;text-align:center!important;justify-content:center}
