/* Keep the ordinary layout until someone edits a field on a phone or touch device. */
@media (max-width:760px), (pointer:coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]),
  textarea, select, [contenteditable="true"], [contenteditable="plaintext-only"] {
    font-size:max(16px,1em)!important;
    scroll-margin-block:24px;
  }
  dialog.lk-input-dialog[open] {
    position:fixed!important;
    top:calc(var(--lk-input-top,0px) + 10px)!important;
    bottom:auto!important;
    margin-block:0!important;
    max-height:calc(var(--lk-input-height,100vh) - 20px)!important;
    overscroll-behavior-y:contain;
    scroll-behavior:auto!important;
    overflow-anchor:none;
    transform:none!important;
  }
  /* The header stays in place; only the auth body scrolls while a field is edited. */
  dialog.lk-input-dialog[open]:has(#auth-form,#entry-form) {
    display:flex;flex-direction:column;
    height:calc(var(--lk-input-height,100vh) - 20px)!important;
    overflow:hidden!important;
  }
  dialog.lk-input-dialog:has(#auth-form,#entry-form) > .modal-header {flex:none;padding-block:10px 8px}
  dialog.lk-input-dialog:has(#auth-form,#entry-form) > .modal-body {
    flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
    scroll-behavior:auto!important;overflow-anchor:none;
  }
  dialog.lk-input-dialog:has(#auth-form,#entry-form) > .modal-body::after {
    content:'';display:block;height:64px;flex:none;
  }
  .lk-mobile-editing textarea:focus {
    min-height:0!important;
    max-height:max(48px,calc(var(--lk-input-height,100vh) - 112px))!important;
  }
}
#lk-keyboard-space { width:1px; min-height:0; flex:none; pointer-events:none; }
