/* Four Yandex RTB placements, rendered only when active block IDs exist. */
.snbk-home-rtb { width:100%;max-width:100%;min-width:0;margin:14px auto 22px;overflow:visible;border-radius:12px; }
.snbk-home-rtb-top,.snbk-home-rtb-bottom {clear:both;}
/* Keep the top slot at its natural Yandex-selected creative height.
   Do not force 90/110px: that resulted in empty ad slots for this RTB block. */
.snbk-home-rtb-top,
.snbk-home-rtb-top > div {height:auto;min-height:0;}
/* Collapse unused gap only when the ad has not produced any content. */
.snbk-home-rtb-top:has(> div:empty) {margin-top:0;margin-bottom:0;}
.snbk-home-rtb-top:has(> div:not(:empty)) {margin-top:10px;margin-bottom:16px;}
.snbk-home-rtb-sidebar {margin:4px 0 20px;}
.snbk-home-rtb-middle {margin:14px 0 24px;}
.snbk-home-rtb>div {max-width:100%;overflow:visible;}
@media (max-width:650px){.snbk-home-rtb{margin:10px 0 16px;border-radius:10px;}}

/* 18/19: mobile Yandex banners need actual room for adaptive 300x250 creatives.
   Collapse on a confirmed no-fill callback; never crop a filled ad. */
@media (max-width:650px) {
  .snbk-rtb-mobile-fit > div {
    height:250px;
    min-height:250px;
    overflow:visible;
  }
  .snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    height:auto;
    min-height:250px;
  }
  .snbk-rtb-mobile-fit.snbk-rtb-empty,
  .snbk-rtb-mobile-fit.snbk-rtb-empty > div {
    height:0;
    min-height:0;
    margin-top:0;
    margin-bottom:0;
    overflow:hidden;
  }
}

/* Desktop RTB reserve: offer Yandex real 250px container geometry.
   A no-fill callback collapses empty slots without affecting other ads. */
@media (min-width:651px) {
  .snbk-rtb-desktop-fit > div {
    height:250px;
    min-height:250px;
  }
  .snbk-rtb-desktop-fit.snbk-rtb-filled > div {
    height:auto;
    min-height:0;
  }
  .snbk-rtb-desktop-fit.snbk-rtb-empty,
  .snbk-rtb-desktop-fit.snbk-rtb-empty > div {
    height:0;
    min-height:0;
    margin-top:0;
    margin-bottom:0;
    overflow:hidden;
  }
}

/* The dedicated desktop-only top/sidebar slots are not used on phones.
   Phones retain the 18/19 responsive 250px RTB slots. */
@media(max-width:650px) {
  .snbk-rtb-desktop-fit {display:none!important;}
}


/* Unfilled mobile ad positions are out of document flow.
   Yandex can still inspect a 250px sized child for ad selection.
   The surrounding section only gains space after a successful onRender. */
@media (max-width:650px) {
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit {
    position:relative;
    height:0;
    min-height:0;
    margin-top:0;
    margin-bottom:0;
  }
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit > div {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:250px;
    min-height:250px;
  }
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-filled {
    height:auto;
    min-height:250px;
    margin:10px 0 16px;
  }
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    position:relative;
    height:auto;
    min-height:250px;
  }
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-empty,
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-empty > div {
    height:0;
    min-height:0;
    margin-top:0;
    margin-bottom:0;
    overflow:hidden;
  }
}


/* Mobile RTB: 1px viewport sentinel until near scroll, then a visible 250px
   in-flow auction container. Never submit RTB from a zero-height parent. */
@media (max-width:650px) {
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit:not(.snbk-rtb-loading):not(.snbk-rtb-filled) {
    position:relative;
    height:1px;
    min-height:1px;
    margin:0;
    overflow:visible;
  }
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit:not(.snbk-rtb-loading):not(.snbk-rtb-filled) > div {
    position:absolute;
    top:0;
    left:0;
    height:1px;
    min-height:1px;
    width:100%;
    visibility:hidden;
  }
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-loading,
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-filled {
    position:relative;
    height:auto;
    min-height:250px;
    margin:10px 0 16px;
    overflow:visible;
  }
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-loading > div,
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    position:relative;
    height:auto;
    min-height:250px;
    visibility:visible;
    width:100%;
  }
}

/* SNBK natural-height RTB fix 2026-11-11:
   A compact creative may be 50-110px high. Reserve 250px ONLY during
   the auction; after onRender, match the rendered creative's natural
   height instead of leaving a large empty panel under it. */
@media (max-width:650px) {
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-filled,
  .gp-site .snbk-home-rtb.snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    height:auto;
    min-height:0;
  }
}
