html[data-gx-telegram=true]{
 --gx-app-top:calc(max(env(safe-area-inset-top,0px),var(--gx-system-top,0px)) + var(--gx-content-top,0px) + 12px);
 --gx-app-bottom:calc(max(env(safe-area-inset-bottom,0px),var(--gx-system-bottom,0px)) + var(--gx-content-bottom,0px));
 touch-action:pan-x pan-y;
 -webkit-text-size-adjust:100%;
}
html[data-gx-telegram=true] body{touch-action:pan-x pan-y}
html[data-gx-telegram=true] .production-workspace .phone,
html[data-gx-telegram=true] .workspace .phone{padding-top:var(--gx-app-top)}
html[data-gx-telegram=true] .app-header>button{min-width:44px;min-height:44px}
html[data-gx-telegram=true] :is(input,textarea,select){font-size:16px}
html[data-gx-telegram=true] :is(.phone .bottom-nav,body .guide-product-nav){height:calc(60px + var(--gx-app-bottom));padding-bottom:calc(6px + var(--gx-app-bottom))}
html[data-gx-telegram=true] .product-footer{padding-bottom:calc(120px + var(--gx-app-bottom))}
html[data-gx-telegram=true] body:has(.guide-product-nav){padding-top:var(--gx-app-top)}

/* Keep the scrollable page inside Telegram's safe area, at every scroll depth. */
html[data-gx-telegram=true] body:has(.production-workspace){height:100dvh;overflow:hidden;overscroll-behavior:none}
html[data-gx-telegram=true] .production-workspace{height:var(--gx-viewport-height,100dvh);min-height:0}
html[data-gx-telegram=true] .production-workspace .phone{
 position:fixed;top:0;left:50%;transform:translateX(-50%);width:min(100%,460px);
 display:flex;flex-direction:column;height:var(--gx-viewport-height,100dvh);min-height:0;
 padding-bottom:calc(86px + var(--gx-app-bottom));overflow:hidden;
}
html[data-gx-telegram=true] .production-workspace .app-header{flex-shrink:0;background:#101010;position:relative;z-index:2}
html[data-gx-telegram=true] .production-workspace .phone>main{
 flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;
 -webkit-overflow-scrolling:touch;scroll-padding-block:20px;animation:none;
}
html[data-gx-telegram=true] .production-workspace .product-footer{padding:32px 0 24px}
html[data-gx-telegram=true] .production-workspace .bottom-nav{position:absolute;left:0;right:0;transform:none;width:100%}
