/* Chemical-Mandi V28 mobile/tablet application shell */
:root{--cm-touch:44px;--cm-page-pad:clamp(12px,3vw,28px)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
body{overflow-x:hidden;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
img,svg,video,canvas{max-width:100%;height:auto}
button,a,input,select,textarea{touch-action:manipulation}
button,.primary-btn,.secondary-btn,.row-btn,input[type=button],input[type=submit]{min-height:var(--cm-touch)}
input,select,textarea{max-width:100%;font-size:16px}
.table-wrap,.table-scroll,.catalogue-table-wrap,.rfq-table-wrap,.dashboard-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
table{max-width:100%}
.cm-modal,.modal,.modal-card,.dialog-card,[role=dialog]{max-width:min(94vw,1100px);max-height:calc(100dvh - 24px)}
.modal-body,.cm-modal-body,.dialog-body{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
@media(max-width:1024px){
  body{padding-top:70px!important}
  .cm-v2-header{height:auto;min-height:70px;grid-template-columns:minmax(0,1fr) auto;padding:10px 14px;gap:8px}
  .cm-v2-nav{grid-column:1/-1;order:3;width:100%;justify-content:flex-start;overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:2px;scrollbar-width:none}
  .cm-v2-nav::-webkit-scrollbar{display:none}
  .cm-v2-nav a{flex:0 0 auto;min-height:40px;display:flex;align-items:center}
  .cm-v2-account{grid-column:2;grid-row:1}
  .cm-v2-brand-copy small{display:none}
  main,.main,.page-shell,.content-shell,.dashboard-shell,.rfq-shell,.supplier-shell{max-width:100%!important;padding-left:var(--cm-page-pad)!important;padding-right:var(--cm-page-pad)!important}
  .form-grid,.fresh-grid,.profile-grid,.supplier-master-grid,.rfq-form-grid,.modal-data-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .card-grid,.dashboard-grid,.tile-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  table{min-width:720px}
  .cm-auth-footer{position:static;padding-bottom:calc(8px + env(safe-area-inset-bottom))}
}
@media(max-width:700px){
  body{padding-top:64px!important;font-size:15px}
  .cm-v2-header{min-height:64px;padding:8px 10px}
  .cm-v2-mark{width:38px;height:38px;border-radius:10px}
  .cm-v2-profile-name{display:none}
  .cm-v2-nav{gap:5px}
  .cm-v2-nav a{font-size:.76rem;padding:8px 9px}
  h1{font-size:clamp(1.45rem,7vw,2rem)!important;line-height:1.15}
  h2{font-size:clamp(1.2rem,5.4vw,1.6rem)!important}
  .form-grid,.fresh-grid,.profile-grid,.supplier-master-grid,.rfq-form-grid,.modal-data-grid,.card-grid,.dashboard-grid,.tile-grid{grid-template-columns:1fr!important}
  form,.form-card,.section-card,.panel,.card,fieldset{min-width:0;max-width:100%}
  fieldset{padding:14px!important;border-radius:16px!important}
  label{min-width:0}
  input,select,textarea{width:100%!important;min-height:44px!important}
  textarea{min-height:110px!important}
  .button-row,.form-actions,.modal-actions,.actions,.toolbar,.seller-action-buttons{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
  .button-row>*,.form-actions>*,.modal-actions>*,.actions>*{flex:1 1 140px}
  .modal,.cm-modal,.dialog-overlay{padding:8px!important;align-items:flex-start!important;padding-top:max(8px,env(safe-area-inset-top))!important}
  .modal-card,.cm-modal-card,.dialog-card,[role=dialog]{width:100%!important;max-width:100%!important;max-height:calc(100dvh - 16px)!important;border-radius:18px!important}
  .modal-body,.cm-modal-body,.dialog-body{max-height:calc(100dvh - 150px)!important;overflow:auto!important}
  table{min-width:650px}
  th,td{padding:10px 9px!important;font-size:.86rem!important}
  .supplier-listing-bar,.listing-master-bar{align-items:flex-start!important;gap:10px!important;flex-wrap:wrap!important}
  .supplier-listing-bar .actions,.listing-master-bar .actions{width:100%}
  .fresh-auth-main{height:auto;min-height:calc(100dvh - 90px);padding:10px}
  .fresh-auth-shell{height:auto;min-height:0;width:100%;grid-template-columns:1fr;border-radius:18px}
  .fresh-auth-art{display:none}
  .fresh-auth-panel{padding:22px 18px;overflow:visible}
}
@media(max-width:430px){
  :root{--cm-page-pad:10px}
  .cm-v2-brand-copy strong{font-size:.9rem}
  .cm-v2-avatar{width:34px;height:34px}
  .primary-btn,.secondary-btn,.row-btn,button{padding-left:12px!important;padding-right:12px!important}
  table{min-width:600px}
}
@media(hover:none) and (pointer:coarse){
  a,button,.row-btn,.primary-btn,.secondary-btn{min-height:44px}
  input[type=checkbox],input[type=radio]{min-width:22px;min-height:22px}
}
