How to calculate camera position on different layer based on window/screen size?

I have 2 layers
1st base layer where you see blue background black text and yellow icons in upper right
2nd layer is zoomed out with that white rectangle
Now what i need to do is somehow dynamically change camera position on 2nd layer so that rectangle always be in lower right corner
No matter what is the screen size
I was trying CameraBorderRight() - some value
CameraWidth() - some value
WindowWidth() - some value
SceneWidnwoWidth() - some value
Yet it always result in camera not moving proportional (meaning white rectangle does not stick to lower right camera border)
So any idea for expreasion to calculate that would help me

I was trying to solve this problem for Mause
BUT he wrote everything i encounter as a problem
If that would be object then it would be as simple as changing that object X to camera border right - object width
Yet it does not work for camera position and IDK why

And so i modified his project a little so its easier for any1 to test

I print some values to text to help see what is going on there
While Variable X you see as last value is to what camera X position on Map layer (2nd layer which is NOT base layer) is set to
And also i made text input object
And that variable is set to that text input object
So whatever you will write in text input object
Will affect X position of camera on Map layer
That white rectangle is 10 000 width and height starting from x0 Y0
So if you type into text input for example - 10000
You will see that camera moved
So it is easier to make equation with expressions and see what happens

Yet for some reason it does not accept expressions like CameraBorderRight()