.dkLb-overlay{
  position:fixed; inset:0; z-index:999999;
  display:none; align-items:center; justify-content:center;
  background:rgba(0,0,0,.9);
}
.dkLb-overlay.open{ display:flex; }

.dkLb-inner{ position:relative; padding:0; background:transparent; }

.dkLb-stage{
  position:relative;
  max-width:98vw; max-height:95vh;
  background:#fff; border-radius:6px; box-shadow:0 8px 40px rgba(0,0,0,.6);
  padding:10px; box-sizing:border-box;
  overflow:hidden;              /* режим "Вписать" (по умолчанию) */
}

/* Картинка в режиме "Вписать" */
.dkLb-img{
  display:block; margin:0 auto;
  width:auto; height:auto;
  max-width:calc(98vw - 20px);
  max-height:calc(95vh - 20px - 40px); /* - паддинг и нижняя панель */
  object-fit:contain;
}

/* Режим 1:1 — даём настоящие размеры и скролл контейнера */
.dkLb-overlay.zoom .dkLb-stage{ overflow:auto; width: calc(100% + 2vw);padding-top: 2vw;padding-bottom: 1vw;position: relative;}
.dkLb-overlay.zoom .dkLb-img{
  max-width:none; max-height:none;
  width:auto; height:auto;
}

/* Кнопки/панель */
.dkLb-close{
  position:absolute; top:-12px; right:-12px; z-index:3;
  background:#2b2b2b; color:#fff; border:none; border-radius:16px;
  font-size:20px; line-height:1; padding:8px 12px; cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.5);
}
.zoom .dkLb-close{
   top:3px; right:3px; 
   position: fixed;
}
.dkLb-prev,.dkLb-next{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  background:rgba(0,0,0,.6); color:#fff; border:none; border-radius:4px;
  font-size:22px; line-height:1; padding:10px 14px; cursor:pointer;
  transition: background 0.5s ease-in-out;
}
.dkLb-prev{ left:10px; } .dkLb-next{ right:10px; }
.dkLb-prev:hover, .dkLb-next:hover{ background: #393939ba; }
.zoom .dkLb-prev{ left:16px; position: fixed;} .zoom .dkLb-next{ right:16px; position: fixed;}
.dkLb-bottom{
  display:flex; align-items:center; gap:8px; justify-content:space-between; margin-top:8px;
}
.dkLb-counter{
  background:#fff; color:#333; border:1px solid #e6e6e6;
  border-radius:4px; padding:0px 10px; font-size:13px;
  margin-bottom: 24px;
}
.dkLb-autorun,.dkLb-zoom{
  background:#2b2b2b; color:#fff; border:none; border-radius:4px;
  padding:7px 10px; cursor:pointer; font-size:13px;
  margin-bottom: 22px;
  transition: background 0.5s ease-in-out;
}
.dkLb-autorun:hover,.dkLb-zoom:hover{background: #393939;}
.zoom .dkLb-autorun { right: 45%; position: absolute;}
.zoom .dkLb-zoom { right: 0px; position: absolute;}
@media (max-width:640px){
  .dkLb-stage{ max-height:92vh; }
  .dkLb-img{
    max-width:calc(98vw - 20px);
    max-height:calc(92vh - 20px - 40px);
  }
}
