/* CommercialOS V7.2 — mobile UX normalization */
@media (max-width: 768px){
  html,body{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;}
  body{padding-bottom:calc(70px + env(safe-area-inset-bottom));}
  .app,.app-body,.content{min-width:0;max-width:100%;}
  .content{padding:14px 12px 20px!important;box-sizing:border-box;}
  .page-header,.page-actions,.settings-section-title,.settings-actions{gap:10px;}
  .page-header>div,.settings-section-title>div{min-width:0;max-width:100%;}
  .page-title,.page-subtitle,h1,h2,h3,p,small,strong,span,label{overflow-wrap:anywhere;}
  .btn,.button,button,input,select,textarea{touch-action:manipulation;}
  .btn{min-height:44px;}
  .table-container,.table-scroll,.responsive-table{max-width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch;}
  table.table,table{min-width:640px;}
  .modal,.modal-content,.modal-conteudo{box-sizing:border-box;}
  .modal-content,.modal-conteudo{max-width:100vw!important;}
  .settings-nav{position:sticky!important;top:62px!important;z-index:40;padding:7px!important;border-radius:12px!important;}
  .settings-nav-item{flex:0 0 auto;min-height:42px;padding:10px 12px!important;}
  .settings-main{width:100%;min-width:0;}
  .setting-row{align-items:flex-start!important;gap:12px;}
  .setting-row>button,.setting-row>a{flex:0 0 auto;}
  .settings-form-grid,.form-row,.integration-grid{grid-template-columns:1fr!important;}
  .settings-panel{padding:16px!important;}
  .settings-push-quick-card{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:12px!important;align-items:start!important;}
  .settings-push-quick-card .btn{grid-column:1/-1;width:100%;}
  .settings-push-quick-copy{min-width:0;}
  .cos-mobile-nav{height:64px!important;padding-bottom:env(safe-area-inset-bottom)!important;}
  .cos-mobile-nav a,.cos-mobile-nav button{font-size:9px!important;min-height:44px;}
  .cos-mobile-nav svg{width:18px!important;height:18px!important;}
  .cos-quick-bar{top:62px!important;}
  .notification-panel{max-width:calc(100vw - 20px)!important;}
  .cos-legacy-drawer{max-width:calc(100vw - 24px)!important;}
  .cos-legacy-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .cos-legacy-grid a{min-height:52px;}
  /* WhatsApp: one screen at a time on mobile */
  .wpp-container{height:calc(100dvh - 62px - 64px)!important;min-height:0!important;border-radius:0!important;}
  .wpp-sidebar{height:100%!important;min-height:0!important;overflow:hidden!important;}
  .wpp-main{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;}
  .wpp-messages{min-height:0!important;flex:1 1 auto!important;overflow-y:auto!important;}
  .wpp-footer{flex:0 0 auto!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important;}
  .wpp-composer{gap:5px!important;}
  .wpp-composer .wpp-tool-button{width:40px!important;min-width:40px!important;flex-basis:40px!important;}
  .wpp-composer .wpp-send-button{min-width:58px!important;padding:0 10px!important;font-size:12px!important;}
  .wpp-contact-header{min-height:58px!important;flex:0 0 58px!important;}
  .wpp-header-right{max-width:92px;overflow:hidden;}
  .wpp-header-right span:first-child{display:none;}
  .wpp-profile-panel{width:min(100vw,420px)!important;max-width:100vw!important;}
  .wpp-access-panel{width:calc(100vw - 20px)!important;max-height:88dvh!important;overflow:hidden;}
  .wpp-access-body{overflow:auto;max-height:calc(88dvh - 75px)!important;}
  .wpp-access-body section{padding:12px!important;}
  .wpp-ops-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .wpp-ops-card{min-height:58px!important;}
}
@media (max-width:480px){
  .content{padding-left:10px!important;padding-right:10px!important;}
  .page-title{font-size:22px!important;}
  .page-subtitle{font-size:12px!important;line-height:1.45;}
  .card{border-radius:12px!important;}
  .btn{font-size:12px!important;}
  .settings-nav{top:60px!important;}
  .settings-nav-item{font-size:11px!important;padding:9px 11px!important;}
  .settings-panel{padding:14px!important;}
  .wpp-bubble{max-width:88%!important;}
  .wpp-chat-search input{font-size:16px!important;}
  .wpp-sidebar-header{flex-wrap:wrap!important;}
  .wpp-meta-connect-button{width:100%!important;min-height:42px!important;}
  .wpp-ops-card small{font-size:9px!important;}
  .wpp-ops-card b{font-size:14px!important;}
}

/* Web Push diagnostics: always readable on mobile */
#pushNotificationStatus[data-status="attention"]{display:block;color:#b45309!important;background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:9px 11px;margin-top:7px;line-height:1.45}
#pushNotificationStatus[data-status="ready"]{display:block;color:#166534!important;line-height:1.45}
@media(max-width:650px){
  .settings-push-quick-card{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:12px!important;align-items:start!important}
  .settings-push-quick-card .btn{grid-column:1/-1!important;width:100%!important}
  .push-settings-row{display:grid!important;gap:14px!important}
  .push-actions{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .push-actions .btn{width:100%!important}
}

/* V7.3 — ação rápida mobile */
.cos-floating-quick{display:none}
@media(max-width:800px){
  .cos-floating-quick{display:flex!important;position:fixed;right:16px;bottom:calc(78px + env(safe-area-inset-bottom));z-index:99990;width:58px;height:58px;border:0;border-radius:50%;background:#2563eb;color:#fff;box-shadow:0 10px 28px rgba(0,0,0,.28);align-items:center;justify-content:center;cursor:pointer}
  .cos-floating-quick span{font-size:30px;line-height:1;font-weight:300}
  .cos-floating-quick small{position:absolute;bottom:-16px;font-size:9px;color:#64748b;white-space:nowrap}
  .cos-mobile-nav{grid-template-columns:repeat(5,1fr)!important}
  .cos-mobile-nav a,.cos-mobile-nav button{min-width:0!important}
}
