/* Avoid a fixed navigation row competing with an on-screen typing viewport. */
@media(max-width:600px){
  .app-mode.app-keyboard-open .app-bottom{display:none}
  .app-mode.app-keyboard-open .app-shell{padding-bottom:max(20px,env(safe-area-inset-bottom))}
  .app-mode :is(input,textarea,[contenteditable=true]){scroll-margin-block:24px}
  .app-mode dialog{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
  .app-mode.app-keyboard-open #toast{bottom:max(16px,env(safe-area-inset-bottom))}
}
/* A small-height window is usable even without VisualViewport support. Keep nav
   in normal flow rather than assuming an on-screen keyboard exists. */
@media(max-width:600px) and (max-height:480px){
  .app-mode.app-input-focused:not(.app-keyboard-open) .app-bottom{position:static;transform:none;width:100%;margin-top:16px}
  .app-mode.app-input-focused:not(.app-keyboard-open) .app-shell{padding-bottom:max(16px,env(safe-area-inset-bottom))}
}
