/* Screen-sized layout for mobile Safari and the installed web app. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;width:100%;overflow-x:hidden;overflow-x:clip}
body{width:100%;min-width:0;min-height:100svh;overflow-x:hidden;overflow-x:clip}
.app{min-width:0;max-width:100%;min-height:100svh}
img,video,iframe{max-width:100%}
main,main>section,.card,.field,.control,.sheet,.profile-content,.category-group,.profile-row,.protocol-favorite-wrap,.entry{min-width:0}
h1,h2,h3,p,.catalog-copy,.protocol-favorite-copy,.detail-block{overflow-wrap:anywhere}
@media (hover:none) and (pointer:coarse){
  html,body{touch-action:pan-x pan-y}
  button,a,input,select,textarea{touch-action:manipulation}
  /* Avoid input-focus zoom from undersized form text. */
  input:not([type=checkbox]):not([type=radio]),select,textarea,.control input,.control select,.control textarea,.favorite-portfolio-browser>.control input,.favorite-custom-name input{font-size:16px!important}
  input,select,textarea{max-width:100%;scroll-margin-block:90px}
  .dialog{padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));height:100dvh;max-height:var(--app-visible-height,100dvh)}
  .dialog .sheet{max-height:calc(var(--app-visible-height,100dvh) - 28px);-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .translation-help-dialog{max-height:calc(var(--app-visible-height,100dvh) - 28px);-webkit-overflow-scrolling:touch}
  .app{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
  nav{max-width:100%;padding-left:max(7px,env(safe-area-inset-left));padding-right:max(7px,env(safe-area-inset-right));padding-bottom:max(10px,env(safe-area-inset-bottom))}
  main{padding-bottom:calc(120px + env(safe-area-inset-bottom))}
  .keyboard-open nav,.keyboard-open .floating-contact{visibility:hidden;pointer-events:none}
}
@media(max-width:360px){
  main{padding-left:12px;padding-right:12px}
  .card,.protocol-favorites{padding-left:14px;padding-right:14px}
  .grid{grid-template-columns:minmax(0,1fr)}
  .field.full{grid-column:1}
  .profile-content{padding-left:16px;padding-right:16px}
  .profile-hero{padding-left:16px;padding-right:16px}
  .quick-grid{grid-template-columns:minmax(0,1fr)}
  .favorite-actions button{min-width:0;white-space:normal;overflow-wrap:anywhere}
}
