/* BASSE keyboard-safe + safe-area layer (loaded last on every page). Mobile only; desktop is untouched. */
:root{--kb:0px;--vvh:100dvh;--vvt:0px}
@media(max-width:820px){
  /* 16px fields stop iOS from zooming the page and shifting the layout when focused */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),select,textarea{font-size:16px!important}
  input,select,textarea{scroll-margin:96px 0 140px}
  /* normal pages: extra room so the last field can scroll above the keyboard */
  html.kb-open body:not(.basse-modal-open){padding-bottom:calc(var(--kb) + 28px)!important}
  /* popups track the VISIBLE area exactly (iOS keeps the layout viewport tall when the keyboard opens) */
  html body .modal.modal.show{top:var(--vvt,0px)!important;bottom:auto!important;height:var(--vvh,100dvh)!important;box-sizing:border-box!important;overflow:hidden!important;
    padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)!important}
  html.kb-open body .modal.modal.show{padding-bottom:0!important}
  html body .modal.modal.show :is(.account-sheet,.form-sheet,.messenger-home-sheet,.chat-sheet,.checkout-sheet,.product-sheet-modern,.stores-sheet,.return-sheet){height:100%!important;max-height:100%!important;margin-top:0!important;min-height:0}
  html body .modal.modal.show .sheet{max-height:100%!important;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:max(24px,env(safe-area-inset-bottom))}
  html.kb-open body .modal.modal.show .sheet{padding-bottom:24px}
  /* the round back/close button scrolls with the form instead of floating over fields */
  html body .modal.modal.show .sheet{position:relative}
  html.kb-open body .modal.modal.show .sheet>.close{position:absolute!important;top:10px!important;right:12px!important;left:auto!important;float:none!important}
  html.kb-open .chat-compose{padding-bottom:8px!important}
  /* ticket purchase dialog (tickets page) */
  .ticket-form{top:var(--vvt,0px)!important;bottom:auto!important;height:var(--vvh,100dvh)!important;box-sizing:border-box;overflow:hidden;
    padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))!important}
  html.kb-open .ticket-form{padding-bottom:12px!important}
  .ticket-form .panel{max-height:100%;overflow-y:auto;overscroll-behavior:contain}
}
/* safe areas: notch, home indicator, landscape sides */
body::before{content:"";position:fixed;top:0;left:0;right:0;height:env(safe-area-inset-top,0px);background:#fff;z-index:200;pointer-events:none}
header.top,.top{top:env(safe-area-inset-top,0px)!important}
.bottom{padding-bottom:calc(8px + env(safe-area-inset-bottom))!important;padding-left:max(6px,env(safe-area-inset-left))!important;padding-right:max(6px,env(safe-area-inset-right))!important}
.toast{bottom:calc(90px + env(safe-area-inset-bottom))!important}
@media(orientation:landscape){body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}}
