/* LAST loaded: phone-first responsive fixes for iPhone Safari and Android Chrome.
   Does not modify JS visibility state, Appwrite auth, or server permissions. */
html{width:100%;max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{width:100%;max-width:100%;min-width:0;margin:0;overflow-x:clip}
*,*::before,*::after{box-sizing:border-box}
img,video,iframe,svg{max-width:100%;height:auto}
main,.admin-main,.store-shell,.admin-shell,.panel,.view,.auth-dialog{min-width:0;max-width:100%}
input,select,textarea,button{max-width:100%;font-size:16px} /* prevents iOS input focus zoom */
input[type="file"]{display:block;width:100%;min-width:0;max-width:100%;font-size:14px;overflow:hidden}
input[type="file"]::file-selector-button{background:#c81529;color:#fff;border:1px solid #f66b76;border-radius:8px;padding:10px 11px;margin:0 8px 0 0;font-weight:700}
.receipt-box,.payment-options,.order-info,.order-product,.bank-details{min-width:0;overflow-wrap:anywhere}
.scroll-x,.table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
@media(max-width:900px){
  body .site-header{position:relative!important;max-width:100vw!important}
  body .topbar{width:100%!important;max-width:100%!important;display:flex!important;gap:8px!important;flex-wrap:wrap!important;padding:8px 10px!important;min-height:58px!important}
  body .topnav{display:none!important}
  body .brand{min-width:0!important;max-width:min(65vw,260px)!important;padding:6px 9px!important;border-radius:13px!important}
  body .brand strong{font-size:16px!important;line-height:1.1!important}
  body .brand small{font-size:8px!important;letter-spacing:0!important}
  body .brand .crown{font-size:25px!important}
  body .top-actions{margin-left:auto!important;max-width:42vw!important}
  body .account-pill{max-width:138px!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:12px!important}
  body .store-shell,body .admin-shell{display:block!important;width:100%!important;max-width:100vw!important;padding:9px 9px 80px!important;margin:0!important}
  body .store-shell>.sidebar,body .admin-shell>.admin-sidebar{display:none!important}
  body .store-shell>.sidebar.ref-open{display:grid!important;position:relative!important;width:100%!important;max-width:none!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;margin-bottom:10px!important;min-height:0!important;max-height:none!important}
  body .admin-shell>.admin-sidebar.mobile-open,body .admin-shell.ref-menu-open>.admin-sidebar{display:block!important;position:relative!important;top:auto!important;width:100%!important;max-width:none!important;min-height:0!important;margin-bottom:10px!important}
  body .admin-main,body #main{width:100%!important;min-width:0!important;padding:0!important}
  body .quick-panels,body .two-cols,body .three-cols,body .four-cols{grid-template-columns:minmax(0,1fr)!important;gap:9px!important}
  body .stats-grid,body .design-mini-stats,body .rs-stats{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body .stat,body .design-mini-stats>.stat{min-width:0!important;min-height:64px!important;padding:9px!important;gap:3px!important}
  body .stat span,body .design-mini-stats>.stat span{font-size:11px!important;line-height:1.25!important}
  body .stat strong,body .design-mini-stats>.stat strong{font-size:clamp(13px,4vw,20px)!important;line-height:1.22!important;overflow-wrap:anywhere!important}
  body .hero{padding:13px!important;min-height:0!important;max-width:100%!important;border-radius:13px!important}
  body .hero h1{font-size:clamp(23px,6vw,31px)!important;line-height:1.15!important}
  body .hero-art{font-size:36px!important}
  body .hero-inner{min-width:0!important}
  body .panel,body .panel.pad,body .admin-panel,body .order-entry{max-width:100%!important;min-width:0!important;padding:11px!important}
  body .panel-title{padding:9px!important;gap:7px!important}
  body h1.section-heading,body h2.section-heading{font-size:clamp(19px,5vw,27px)!important}
  body .primary,body .outline,body .small-btn{min-height:42px!important}
  body .order-hero{padding:13px 10px!important}
  body .order-product{display:flex!important;gap:8px!important;flex-wrap:wrap!important}
  body .order-info .line{display:flex!important;flex-wrap:wrap!important;gap:5px!important}
  body .auth-dialog{width:calc(100vw - 24px)!important;max-width:420px!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto!important;padding:15px!important;margin:12px auto!important}
  body .mobile-bar{display:flex!important;position:fixed!important;left:0!important;right:0!important;bottom:0!important;max-width:100vw!important;z-index:25!important;padding-bottom:env(safe-area-inset-bottom,0px)!important}
  body .mobile-bar button{min-width:0!important;flex:1 1 0!important;padding:7px 2px!important;font-size:10px!important}
  body .mobile-bar button span{font-size:10px!important;line-height:1.2!important}
  body .footer{padding-bottom:22px!important}
  body .rs-two-cols,body .rs-plan-grid{grid-template-columns:1fr!important}
  body .rs-welcome{padding:13px!important}
  body .rs-welcome h1{font-size:clamp(23px,6vw,32px)!important}
}
@media(max-width:380px){
 body .brand strong{font-size:14px!important}
 body .brand small{font-size:7px!important}
 body .account-pill{max-width:110px!important}
 body .stats-grid,body .design-mini-stats{gap:5px!important}
 body .mobile-bar button span{font-size:9px!important}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
