@media(max-width:760px){html body dialog.mg-mobile-input-fit[open],html.seller-mobile-ready body #editor.article-flow-editor.mg-mobile-input-fit[open],html body #editor.single-entry-active.mg-mobile-input-fit[open]{position:fixed!important;inset:auto 0 auto 0!important;top:var(--mg-input-top,0px)!important;margin:0!important;width:100vw!important;max-width:100vw!important;height:var(--mg-input-height,100dvh)!important;max-height:var(--mg-input-height,100dvh)!important;min-height:0!important;box-sizing:border-box!important;overflow-y:auto!important;overflow-x:hidden!important;border-radius:0!important;scroll-padding:18px 0 22px;overscroll-behavior:contain}dialog.mg-mobile-input-fit input,dialog.mg-mobile-input-fit textarea{font-size:16px!important;scroll-margin:18px 0 22px}}
/* Phones and touch screens: nothing may make the page wider than the screen. A wider page widens the layout viewport
   (fixed header, navigation and dialogs grow with it) and iOS keeps that width/zoom after the content is gone. */
/* 1. Login gate open (start, session expired, company switch): the whole portal behind it is laid out without page
   permissions, up to 888px wide (warehouse tables, settings). It stays hidden while the gate is open. */
@media(max-width:760px),(hover:none) and (pointer:coarse){body.company-login-open>:not(dialog){display:none!important}}
/* 2. Erfassen start page at 901-1083px (iPhone Pro Max landscape, iPad): column minimums 440px + 600px need 1084px. */
@media(min-width:901px) and (hover:none) and (pointer:coarse){html body .dashboard-command-row{grid-template-columns:minmax(0,.9fr) minmax(0,1.35fr)}}

/* Keep warehouse reference tables and API settings inside the touch viewport. */
@media(max-width:1100px) and (pointer:coarse){
  .warehouse-group-tables{min-width:0;overflow-x:auto}
  .warehouse-group-tables table{min-width:0}
  .api-settings-hub{grid-template-columns:minmax(0,1fr)}
  .api-settings-hub>*{min-width:0}
  #ebay-settings-section .ebay-policy-center>header{grid-template-columns:minmax(0,1fr);flex-wrap:wrap}
  #ebay-settings-section .ebay-policy-center>header>div,
  #ebay-settings-section .channel-shipping-calculator>header>div{display:block;min-width:0;width:auto;flex:1}
  #ebay-settings-section .ebay-policy-center>header>button{max-width:100%;white-space:normal}
}
@media(min-width:761px) and (max-width:1100px) and (pointer:coarse){
  #api-settings-section #paypal-settings-form,
  #api-settings-section #gambio-form{grid-template-columns:repeat(2,minmax(0,1fr))}
}
