:root{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px)}
html{scroll-padding-bottom:calc(var(--bottom-tabs,0px) + var(--generate-bar-height,0px) + 20px)}
dialog{max-height:calc(var(--visible-viewport-height,100dvh) - 24px - var(--safe-top) - var(--safe-bottom));max-width:calc(100% - 24px - var(--safe-left) - var(--safe-right))}
#result-dialog{max-height:calc(var(--visible-viewport-height,100dvh) - 24px - var(--safe-top) - var(--safe-bottom))}
dialog .dialog-actions{padding-bottom:max(18px,var(--safe-bottom))}.sets-content{max-height:calc(var(--visible-viewport-height,100dvh) - 150px - var(--safe-bottom))}
@media(max-width:900px){
  .rail{height:auto;min-height:0;inset:auto 0 0;padding:0 var(--safe-right) max(8px,var(--safe-bottom)) var(--safe-left)}
  .rail nav{height:auto;min-height:64px;margin:0}.rail .nav{min-height:60px}
  .shell,.building .shell{min-height:100dvh;padding-bottom:0}
  header{height:auto;min-height:52px;padding-top:var(--safe-top);padding-left:max(16px,var(--safe-left));padding-right:max(12px,var(--safe-right))}
  .shell main,.shell:has(#stores-frame) main{padding-left:max(14px,var(--safe-left));padding-right:max(14px,var(--safe-right));padding-bottom:calc(var(--bottom-tabs,72px) + 28px)}
  .building .shell main{padding-bottom:calc(var(--bottom-tabs,72px) + var(--generate-bar-height,140px) + 28px)}
  .building .result-panel{bottom:var(--bottom-tabs,72px);padding-left:var(--safe-left);padding-right:var(--safe-right)}
  #toast,#undo-notice{bottom:calc(var(--bottom-tabs,72px) + 14px)}
  .building #toast,.building #undo-notice{bottom:calc(var(--bottom-tabs,72px) + var(--generate-bar-height,140px) + 14px)}
  #undo-notice.in-dialog{bottom:0}
  .keyboard-open .rail,.keyboard-open .building .result-panel{visibility:hidden;pointer-events:none}
  .keyboard-open .shell main,.keyboard-open .building .shell main{padding-bottom:24px}
  .keyboard-open dialog{position:fixed;top:calc(var(--visible-viewport-top,0px) + 10px);bottom:auto;margin-top:0;margin-bottom:0;max-height:calc(var(--visible-viewport-height,100dvh) - 20px)}
  .keyboard-open #toast{bottom:14px}.keyboard-open .sets-content{max-height:calc(var(--visible-viewport-height,100dvh) - 120px)}
}
