/* Prevent automatic focus magnification without disabling user zoom. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
input,textarea,select,[contenteditable=true]{font-size:16px!important;line-height:1.5;max-width:100%;scroll-margin-block:90px}
input:focus,textarea:focus,select:focus,[contenteditable=true]:focus{font-size:16px!important}
@media(max-width:700px){.login-card{width:100%;max-width:460px;box-sizing:border-box}.login-body main{min-width:0}.password-field{min-width:0}.password-field input{min-width:0}}

/* No rectangular focus halo around editable text; a quiet underline keeps focus visible. */
input:focus,textarea:focus,[contenteditable=true]:focus{outline:none!important;box-shadow:none!important}
input:focus-visible,textarea:focus-visible,[contenteditable=true]:focus-visible{outline:none!important;box-shadow:inset 0 -2px 0 #777785!important}

/* Keep dialogs inside the visible phone area when the software keyboard opens. */
@media(max-width:760px){
  dialog[open]{box-sizing:border-box;min-width:0;max-width:100%!important;max-height:calc(var(--visible-page-height,100dvh) - 24px)!important;overflow-y:auto;overscroll-behavior:contain}
  dialog.menu-dialog[open]{width:min(94vw,480px);height:var(--visible-page-height,100dvh);max-height:var(--visible-page-height,100dvh)!important}
  dialog header,form,fieldset{min-width:0}
  dialog h1,dialog h2,dialog p,dialog button,dialog a{overflow-wrap:anywhere}
  input,textarea,select,[contenteditable=true],[contenteditable=""],[contenteditable="plaintext-only"]{box-sizing:border-box;min-width:0;font-size:16px!important;transform:none!important}
}

/* Moving between fields is a movement, not a jump. The browser scrolls a
   tapped field into view itself, and it does that instantly unless the box
   being scrolled asks otherwise. The margin it keeps above the field is small
   inside a dialog, which has no header to clear: a large one drags the whole
   form up the screen for a field that was only just below the fold. */
dialog{scroll-behavior:smooth}
dialog input,dialog textarea,dialog select,dialog [contenteditable=true]{scroll-margin-block:16px}
@media(prefers-reduced-motion:reduce){dialog{scroll-behavior:auto}}
