/* Keep the form in normal flow instead of squeezing its fields behind a footer. */
@media(max-width:760px),(max-height:640px){
 html.kauth-document,html.kauth-document body{height:auto!important;min-height:100%;overflow:auto!important}
 .kauth-root{height:auto!important;min-height:100svh;overflow:visible!important}
 .kauth-root .kauth-frame{height:auto;min-height:100svh;overflow:visible;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(20px,env(safe-area-inset-bottom))}
 .kauth-root .kauth-layout{flex:0 0 auto;justify-content:flex-start}
 .kauth-root .kauth-card{max-height:none;overflow:visible;flex-shrink:0}
 .kauth-root .kauth-form,.kauth-root .kauth-form-body{height:auto;max-height:none;overflow:visible;flex:0 0 auto}
 .kauth-root .kauth-form-foot,.kauth-root .kauth-bottom{position:static;flex-shrink:0;transform:none}
 .kauth-root .kauth-primary{min-height:48px!important}
}
 html.k-keyboard-open{scroll-padding-top:24px;scroll-padding-bottom:24px}
 html.k-keyboard-open :is(input,textarea,[contenteditable=true]){scroll-margin-block:24px;font-size:16px}
 html.k-keyboard-open :is(.m-sticky,.kisa-cookie-notice,.ksa-fab,.ma-tabbar){display:none!important}
/* The visual viewport may already start below the Telegram controls. */
html.k-keyboard-open{
 --k-safe-viewport-top:max(var(--k-viewport-top,0px),env(safe-area-inset-top,0px),var(--kisa-safe-top,0px));
 --k-safe-height:max(0px,calc(var(--k-viewport-top,0px) + var(--k-viewport-height,100dvh) - var(--k-safe-viewport-top)));
 --k-dialog-height:max(0px,calc(var(--k-safe-height) - 16px))
}
html.k-keyboard-open :is(#commerce-root .co-overlay,.co-overlay,.kb-dialog-layer,.ksa-root:not(.ksa-study):not(.ksa-page)){
 top:var(--k-safe-viewport-top)!important;bottom:auto!important;height:var(--k-safe-height)!important;
 padding-block:8px!important;box-sizing:border-box
}
html.k-keyboard-open body :is(dialog.ks-dialog,.ksa-root:not(.ksa-study):not(.ksa-page) .ksa-dialog){
 transform:none!important;bottom:auto!important;margin:0 auto!important;max-height:var(--k-dialog-height)!important;overflow:auto!important;box-sizing:border-box
}
html.k-keyboard-open body dialog.ks-dialog{
 top:calc(var(--k-safe-viewport-top) + 8px)!important
}
html.k-keyboard-open body.is-miniapp .ksa-root:not(.ksa-study):not(.ksa-page) .ksa-dialog{padding-top:8px!important}
html.k-keyboard-open :is(.kb-dialog,.co-panel){max-height:var(--k-dialog-height)!important;min-height:0!important;overflow:auto}
/* One coordinate system throughout keyboard opening, typing and dismissal.
   Desktop centers the card. Phones reserve its position before the keyboard appears. */
html body dialog.kp-dialog{
 --kp-offset:var(--k-viewport-visible-top,var(--k-viewport-top,0px));
 --kp-start:max(var(--kp-offset),env(safe-area-inset-top,0px),var(--kisa-safe-top,0px));
 --kp-end:calc(var(--kp-offset) + var(--k-viewport-height,100dvh) - var(--kp-bottom));
 --kp-bottom:max(0px,calc(max(env(safe-area-inset-bottom,0px),var(--kisa-safe-bottom,0px)) - var(--k-viewport-covered,0px)));
 --kp-room:max(0px,calc(var(--kp-end) - var(--kp-start) - 16px));
 top:calc(var(--kp-start) + 8px)!important;bottom:calc(100dvh - var(--kp-end) + 8px)!important;
 margin:auto!important;height:fit-content;max-height:var(--kp-room)!important;overflow:hidden;
 transform:none!important;transition:none;animation:none
}
/* Keep keyboard geometry synchronous. Only the surface and backdrop ease in. */
@media(prefers-reduced-motion:no-preference){
 html body dialog.kp-dialog[open]{
  opacity:1;scale:1;
  transition:opacity 145ms ease-out,scale 210ms cubic-bezier(.2,.8,.2,1)
 }
 html body dialog.kp-dialog[open]::backdrop{transition:background-color 155ms ease-out}
 html body dialog.kp-dialog[open].kp-closing{
  opacity:0;scale:.985;transition-duration:105ms;transition-timing-function:ease-in;
  pointer-events:none
 }
 html body dialog.kp-dialog[open].kp-closing::backdrop{background-color:transparent;transition-duration:105ms}
 .kp-dialog :is(.kp-close,.kp-submit){transition:scale 130ms ease-out}
 .kp-dialog :is(.kp-close,.kp-submit):active{scale:.97;transition-duration:65ms}
 .kp-dialog .kp-success:not([hidden]){animation:kp-confirm-in 170ms ease-out}
 @starting-style{
  html body dialog.kp-dialog[open]{opacity:0;scale:.97}
  html body dialog.kp-dialog[open]::backdrop{background-color:transparent}
 }
}
@media(max-width:760px),(pointer:coarse){
 html body dialog.kp-dialog{
  bottom:auto!important;margin:0 auto!important;transform-origin:top center
 }
}
html body dialog.kp-dialog .kp-form #kp-code,
html body dialog.kp-dialog .kp-form #kp-code:focus-visible{
 -webkit-appearance:none;appearance:none;border:0!important;outline:none!important;
 box-shadow:none!important;background:#f3f3f6!important;caret-color:#c9255f
}
html body dialog.kp-dialog .kp-form:has(#kp-code:focus-visible) label{
 color:#ac164d;font-weight:800
}
@media(forced-colors:active){
 html body dialog.kp-dialog .kp-form #kp-code:focus-visible{outline:2px solid Highlight!important}
}
@media(max-width:375px){
 html body dialog.kp-dialog:has(.kp-form:not([hidden])) #kp-caption,
 html body dialog.kp-dialog:has(.kp-form[aria-busy="false"]) .kp-status:not(.kp-status-error){display:none}
}
/* On narrow phones both controls must fit above a tall keyboard from the first frame. */
@media(max-width:350px){
 html body dialog.kp-dialog .kp-card:has(.kp-form:not([hidden])){padding:14px 12px;gap:12px}
 html body dialog.kp-dialog .kp-card h2{font-size:17px;line-height:24px}
 html body dialog.kp-dialog .kp-close{top:7px;right:8px}
 html body dialog.kp-dialog .kp-form{grid-template-columns:minmax(0,1fr) 108px;gap:6px;margin:0}
 html body dialog.kp-dialog .kp-form label{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
 html body dialog.kp-dialog .kp-form .kp-submit{font-size:13px;line-height:16px;padding:6px}
 html body dialog.kp-dialog .kp-form #kp-code:focus-visible{background:#ffedf3!important}
}
@keyframes kp-confirm-in{from{opacity:0;transform:translateY(3px)}}
html body .kp-dialog .kp-card{
 max-height:var(--kp-room);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch
}
.kp-dialog .kp-card>*{flex-shrink:0}
.kp-dialog .kp-form,.kp-dialog .kp-form input{min-width:0}
@media(max-width:760px),(max-height:640px){
 html body .kp-dialog .kp-card{padding:16px;gap:7px}
 html body .kp-dialog .kp-card :is(.kp-bow,.kp-kicker,.kp-status:empty){display:none}
 html body .kp-dialog .kp-card h2{font-size:22px;line-height:1.15;padding-right:36px}
 html body .kp-dialog .kp-card h2 br{display:none}
 html body .kp-dialog .kp-form input{font-size:16px}
 html body dialog.kp-dialog::backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}
}
/* The keyboard belongs to the modal. Keep the underlying Mini App stationary. */
html.k-promo-stable body.is-miniapp #cabinet-app{
 --k-viewport-height:var(--k-promo-height,100dvh);--k-viewport-top:0px;
 height:var(--k-viewport-height)!important
}
 html.k-keyboard-open .is-miniapp #cabinet-app{height:var(--k-viewport-height,100dvh)!important;min-height:0!important}
 html.k-keyboard-open .ma-main{max-height:var(--k-viewport-height,100dvh);padding-bottom:20px;overflow:auto}
@media(max-width:760px){
 .cm-form-mobile .cm-form-window{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}
 .cm-form-mobile .cm-form-stage{flex:0 0 auto;min-height:max-content;padding-bottom:16px;box-sizing:border-box}
}
/* Lock the layout viewport as well as touch scrolling. overflow:hidden alone is not an iOS body lock. */
html.k-modal-open{overflow:hidden!important;overscroll-behavior:none;scroll-behavior:auto!important}
html.k-modal-open body{position:fixed!important;top:var(--k-page-top,0px)!important;left:var(--k-page-left,0px)!important;width:100%!important;overflow:hidden!important;overscroll-behavior:none;padding-right:var(--k-scrollbar,0px)}
#commerce-root .co-overlay{position:fixed!important;inset:auto!important;top:var(--k-viewport-top,0px)!important;left:var(--k-viewport-left,0px)!important;width:var(--k-viewport-width,100vw)!important;height:var(--k-viewport-height,100dvh)!important;box-sizing:border-box;overscroll-behavior:none}
html.k-modal-open :is(.kisa-cookie-notice,.co-offer-notice,.m-sticky,.ksa-launcher,.ksa-say){display:none!important}
