/* PrivilegeFans v32.10-RC9-MOBILE — iOS + Android shell */
:root{
  --pf-safe-top:env(safe-area-inset-top,0px);
  --pf-safe-right:env(safe-area-inset-right,0px);
  --pf-safe-bottom:env(safe-area-inset-bottom,0px);
  --pf-safe-left:env(safe-area-inset-left,0px);
  --pf-mobile-nav-h:68px;
  --pf-vh:1vh;
}
html,body{max-width:100%;overflow-x:hidden;overscroll-behavior-y:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body.pf-mobile-app{-webkit-tap-highlight-color:transparent;touch-action:manipulation;background:var(--bg,#f6f8fb)}
body.pf-mobile-app button,body.pf-mobile-app a{touch-action:manipulation}
body.pf-mobile-app img,body.pf-mobile-app video{max-width:100%}

@media(max-width:720px){
  .topbar{position:sticky!important;top:0;z-index:85;height:calc(58px + var(--pf-safe-top))!important;min-height:calc(58px + var(--pf-safe-top))!important;padding-top:var(--pf-safe-top);backdrop-filter:saturate(1.25) blur(12px)}
  .topbar-inner{min-height:58px!important;padding-left:max(10px,var(--pf-safe-left))!important;padding-right:max(10px,var(--pf-safe-right))!important}
  .brand{min-width:0!important;max-width:180px}.brand img{height:38px!important;max-width:176px!important;object-fit:contain!important;object-position:left center!important}
  .mobile-head-actions{flex:0 0 auto!important}
  .mobile-head-btn{min-width:40px!important;min-height:40px!important;border-radius:12px!important}
  .mobile-head-btn .avatar-mini{aspect-ratio:1/1!important;object-fit:cover!important;border-radius:50%!important}
  .search.mobile-search-open{top:calc(60px + var(--pf-safe-top))!important;left:max(10px,var(--pf-safe-left))!important;right:max(10px,var(--pf-safe-right))!important;height:46px!important;border-radius:14px!important}
  .main{width:100%!important;max-width:100%!important;padding-left:max(10px,var(--pf-safe-left))!important;padding-right:max(10px,var(--pf-safe-right))!important;padding-bottom:calc(var(--pf-mobile-nav-h) + var(--pf-safe-bottom) + 18px)!important}
  .mobile-nav{height:calc(var(--pf-mobile-nav-h) + var(--pf-safe-bottom))!important;padding:0 max(6px,var(--pf-safe-right)) var(--pf-safe-bottom) max(6px,var(--pf-safe-left))!important;background:rgba(255,255,255,.96)!important;backdrop-filter:saturate(1.2) blur(14px);box-shadow:0 -8px 28px rgba(15,54,84,.10)!important}
  .mobile-nav button{height:60px!important;min-height:60px!important;min-width:52px!important;font-size:10px!important;gap:4px!important;border-radius:14px!important}
  .mobile-nav i{font-size:19px!important}.mobile-nav button.active{font-weight:800}
  .btn{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:7px}
  .btn.sm{min-height:38px}.top-action,.profile-tab,.post-action{touch-action:manipulation}
  .field input,.field select,.field textarea,.chat-list-tools input,.chat-list-tools select{font-size:16px!important;min-height:46px}
  .field textarea{min-height:110px}
  .modal-backdrop{padding:max(10px,var(--pf-safe-top)) max(10px,var(--pf-safe-right)) max(10px,var(--pf-safe-bottom)) max(10px,var(--pf-safe-left))!important;align-items:end!important}
  .modal,.modal.wide{border-radius:22px 22px 14px 14px!important;max-height:calc(100dvh - var(--pf-safe-top) - 10px)!important}
  .modal-head{position:sticky;top:0;z-index:2;background:inherit}.modal-body{overflow-y:auto;-webkit-overflow-scrolling:touch}.modal-actions{position:sticky;bottom:0;background:inherit;padding-bottom:max(12px,var(--pf-safe-bottom))!important}
  .drawer{padding-top:calc(18px + var(--pf-safe-top))!important;padding-right:max(14px,var(--pf-safe-right))!important;padding-bottom:calc(22px + var(--pf-safe-bottom))!important;padding-left:max(14px,var(--pf-safe-left))!important;-webkit-overflow-scrolling:touch}
  #toast-root{bottom:calc(var(--pf-mobile-nav-h) + var(--pf-safe-bottom) + 10px)!important;left:max(10px,var(--pf-safe-left))!important;right:max(10px,var(--pf-safe-right))!important}
  .card{border-radius:16px}.post-media,.content-card img,.product img{width:100%;object-fit:cover}
  .post-actions{min-height:46px}.post-action{min-width:44px;min-height:42px}
  .profile-tabs{overflow-x:auto!important;scrollbar-width:none;-webkit-overflow-scrolling:touch}.profile-tabs::-webkit-scrollbar{display:none}.profile-tab{flex:0 0 auto;min-height:48px}
  .chat-layout{gap:10px!important}.chat-list-card{max-height:none!important}.chat-thread{min-height:calc(100dvh - 230px)}
  .live-stage{min-height:min(72dvh,680px)!important}.live-input{bottom:calc(var(--pf-mobile-nav-h) + var(--pf-safe-bottom) + 8px)!important}.live-chat{bottom:calc(var(--pf-mobile-nav-h) + var(--pf-safe-bottom) + 72px)!important}
  .reals-card{min-height:min(72dvh,650px)}.reals-actions button{width:52px!important;height:52px!important;min-width:52px!important;min-height:52px!important}
  .auth-card,.auth-panel{max-width:100%!important}.auth-shell{padding-left:max(10px,var(--pf-safe-left));padding-right:max(10px,var(--pf-safe-right))}
}

/* Small iPhones / compact Androids */
@media(max-width:390px){
  .topbar-inner{padding-left:max(8px,var(--pf-safe-left))!important;padding-right:max(8px,var(--pf-safe-right))!important;gap:2px!important}
  .brand img{height:34px!important;max-width:142px!important}.mobile-head-btn{min-width:36px!important;width:36px!important;height:36px!important}
  .mobile-nav button{font-size:9px!important;min-width:0!important}.mobile-nav i{font-size:18px!important}
  .main{padding-left:max(8px,var(--pf-safe-left))!important;padding-right:max(8px,var(--pf-safe-right))!important}
  .product-grid,.source-grid,.option-grid{gap:8px!important}
}

/* Native WebView refinements */
body.pf-native-ios{padding-top:0}body.pf-native-android{padding-top:0}
body.pf-keyboard-open .mobile-nav{transform:translateY(110%);pointer-events:none}body.pf-keyboard-open .main{padding-bottom:18px!important}
@media(display-mode:standalone){body{user-select:none}input,textarea,[contenteditable="true"]{user-select:text}}
[data-theme="dark"] .mobile-nav{background:rgba(19,33,49,.97)!important}
