/* NiceSlides.ru V431 — generation modal, tablet balance, sticky desktop side. */

/* Freeze only the page behind the generation overlay. The dialog itself can scroll. */
html.ns-gen-modal-open-v431,
body.ns-gen-modal-open-v431{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}

/* ---- Stable modal geometry ---- */
html body > #genModal.gen-modal.public-generation-modal-v137.generation-modal-v228{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100dvh!important;
  min-height:100dvh!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:12px!important;
  overflow:hidden!important;
  touch-action:pan-y!important;
}
html body > #genModal.gen-modal.public-generation-modal-v137.generation-modal-v228[hidden]{
  display:none!important;
}
html body > #genModal.generation-modal-v228 > .gen-dialog.gen-dialog-v228{
  position:relative!important;
  flex:0 1 auto!important;
  width:min(540px,calc(100vw - 24px))!important;
  max-width:540px!important;
  height:auto!important;
  min-height:0!important;
  max-height:calc(100dvh - 24px)!important;
  margin:auto!important;
  padding:52px 17px 16px!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
  border-radius:20px!important;
}
html body > #genModal .gen-orbit.gen-orbit-v228{
  top:0!important;
  width:82px!important;
  height:50px!important;
}
html body > #genModal .gen-orbit.gen-orbit-v228 img{
  width:76px!important;
  height:56px!important;
}
html body > #genModal .gen-dialog-v228 > #genTitle{
  font-size:23px!important;
  line-height:1.05!important;
  margin:0 0 4px!important;
}
html body > #genModal .gen-dialog-v228 > #genStatus{
  font-size:10.8px!important;
  line-height:1.3!important;
  margin:0 0 9px!important;
}
html body > #genModal .gen-dialog-v228 > .progress{
  height:7px!important;
  margin:0 0 12px!important;
}
html body > #genModal .stage-list.stage-list-v228{
  gap:3px!important;
}
html body > #genModal .stage-list-v228::before{
  top:20px!important;
}
html body > #genModal .stage-list-v228 .stage-icon{
  width:40px!important;
  height:40px!important;
  padding:3px!important;
  border-radius:11px!important;
}
html body > #genModal .stage-list-v228 .stage-icon img{
  width:32px!important;
  height:32px!important;
}
html body > #genModal .stage-list-v228 em{
  min-height:0!important;
  font-size:7.7px!important;
  line-height:1.08!important;
}
html body > #genModal .stage-list-v228 > span.done::after{
  right:calc(50% - 21px)!important;
  width:14px!important;
  height:14px!important;
  font-size:7px!important;
}

/* Mobile: centered when it fits, internally scrollable when the viewport is short. */
@media(max-width:760px){
  html body > #genModal.gen-modal.public-generation-modal-v137.generation-modal-v228{
    align-items:center!important;
    justify-content:center!important;
    padding:8px!important;
    overflow:hidden!important;
  }
  html body > #genModal.generation-modal-v228 > .gen-dialog.gen-dialog-v228{
    width:min(390px,calc(100vw - 16px))!important;
    max-width:390px!important;
    max-height:calc(100dvh - 16px)!important;
    margin:auto!important;
    padding:46px 8px 11px!important;
    overflow-y:auto!important;
    touch-action:pan-y!important;
  }
  html body > #genModal .modal-x.modal-x-v228{
    top:7px!important;
    right:7px!important;
    width:31px!important;
    height:31px!important;
    min-width:31px!important;
  }
  html body > #genModal .gen-orbit.gen-orbit-v228{
    width:70px!important;
    height:44px!important;
  }
  html body > #genModal .gen-orbit.gen-orbit-v228 img{
    width:65px!important;
    height:48px!important;
  }
  html body > #genModal .gen-dialog-v228 > #genTitle{
    font-size:18px!important;
  }
  html body > #genModal .gen-dialog-v228 > #genStatus{
    font-size:9.5px!important;
    margin-bottom:7px!important;
  }
  html body > #genModal .gen-dialog-v228 > .progress{
    height:6px!important;
    margin-bottom:9px!important;
  }
  html body > #genModal .stage-list.stage-list-v228{
    gap:1px!important;
  }
  html body > #genModal .stage-list-v228::before{
    top:17px!important;
  }
  html body > #genModal .stage-list-v228 .stage-icon{
    width:34px!important;
    height:34px!important;
    padding:2px!important;
    border-radius:9px!important;
  }
  html body > #genModal .stage-list-v228 .stage-icon img{
    width:28px!important;
    height:28px!important;
  }
  html body > #genModal .stage-list-v228 em{
    font-size:6.5px!important;
    line-height:1.05!important;
  }
  html body > #genModal .stage-list-v228 > span.done::after{
    right:calc(50% - 18px)!important;
    width:12px!important;
    height:12px!important;
    font-size:6px!important;
  }
}

/* ---- Tablet paid-balance card: never let button overlap the text. ---- */
@media(min-width:581px) and (max-width:1180px){
  html body.cabinet-body-v410 .cabinet-summary-v61 article.cab-summary-balance-v228{
    display:grid!important;
    grid-template-columns:44px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    align-items:center!important;
    column-gap:10px!important;
    row-gap:9px!important;
    min-width:0!important;
  }
  html body.cabinet-body-v410 .cabinet-summary-v61 .cab-summary-balance-v228 > img{
    grid-column:1!important;
    grid-row:1!important;
    width:40px!important;
    height:40px!important;
  }
  html body.cabinet-body-v410 .cabinet-summary-v61 .cab-summary-balance-v228 > div{
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
    width:100%!important;
  }
  html body.cabinet-body-v410 .cabinet-summary-v61 .cab-summary-balance-v228 .cab-balance-topup-v228{
    grid-column:1 / -1!important;
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
    min-height:40px!important;
    margin:0!important;
    padding:0 12px!important;
  }
}

/* ---- Desktop right sidebar follows the user while works list scrolls. ---- */
@media(min-width:1181px){
  html body.cabinet-body-v410 .cabinet-grid-v61{
    align-items:start!important;
    overflow:visible!important;
  }
  html body.cabinet-body-v410 #cabinet-side.cabinet-side-v61{
    position:sticky!important;
    top:68px!important;
    align-self:start!important;
    height:max-content!important;
    max-height:calc(100dvh - 82px)!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-width:thin!important;
    padding-bottom:4px!important;
  }
}
