/* Keep dialogs within the visible screen, including keyboard panning on iOS. */
@media(max-width:900px),(hover:none) and (pointer:coarse){
 :root #sheet.folio-modal[open][data-kind]{
  --sheet-top-edge:max(12px,env(safe-area-inset-top));
  --sheet-bottom-edge:max(12px,env(safe-area-inset-bottom));
  --sheet-room:calc(var(--viewport-height,100dvh) - var(--sheet-top-edge) - var(--sheet-bottom-edge));
  position:fixed;inset:auto;
  top:calc(var(--viewport-top,0px) + var(--sheet-top-edge) + var(--sheet-room) / 2);
  left:calc(var(--viewport-left,0px) + var(--viewport-width,100vw) / 2);
  right:auto;bottom:auto;transform:translate(-50%,-50%);margin:0;
  width:min(560px,calc(var(--viewport-width,100vw) - 24px));
  max-width:calc(var(--viewport-width,100vw) - 24px);max-height:var(--sheet-room);
  height:max-content;box-sizing:border-box;overflow:visible;
 }
 :root #sheet.folio-modal[open][data-kind] .folio-jacket{
  box-sizing:border-box;max-height:var(--sheet-room);overflow-y:auto;overflow-x:hidden;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  scroll-behavior:auto;scroll-padding-block:16px 88px;overflow-anchor:none;
 }
 :root #sheet.folio-modal[open][data-kind] .folio-foot{
  position:sticky;bottom:0;z-index:5;
  background:linear-gradient(180deg,#232d48f2,#232d48 18px);
  box-shadow:0 22px 0 10px #232d48;
  border-radius:0 0 10px 10px;
 }
 :root #sheet.folio-modal[open][data-kind]>.sheet-top{z-index:8;top:-6px;right:-6px}
 :root[dir=rtl] #sheet.folio-modal[open][data-kind]>.sheet-top{left:-6px;right:auto}
 :root[data-keyboard-open=true] #sheet.folio-modal[open][data-kind]{--sheet-bottom-edge:12px}
 :root[data-keyboard-open=true] #sheet.folio-modal:before{display:none}
 /* Native-size controls prevent focus zoom; large amount fields retain their hierarchy. */
 body :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]),textarea,select){
  font-size:16px!important;max-width:100%;min-width:0;scroll-margin-block:24px;
 }
 :root #sheet .folio-amount>input{font-size:34px!important}
 :root #sheet.folio-modal[open][data-kind] .folio-field>input{min-height:46px}
 .web-cabinet .wb-tools,.web-cabinet .wb-field,form{min-width:0}
 .mini-cabinet[data-keyboard-open=true] .bottom-nav{visibility:hidden;pointer-events:none}
 .web-cabinet[data-keyboard-open=true] #navigation{max-height:var(--viewport-height,100dvh)}
}
