/* Layout contract: stable controls, explicit scroll regions and intrinsic widths. */
@media screen {
  html{scrollbar-gutter:stable}
  main,.view,.top>div,.easy-grid>*{min-width:0}
  .view button,.project-center button,dialog button{transform:none!important;transition:background-color .15s,color .15s,border-color .15s!important;white-space:normal;overflow-wrap:anywhere;line-height:1.35}
  .view button:hover,.view button:active,.project-center button:hover,.project-center button:active,dialog button:hover,dialog button:active{transform:none!important}
  .easy-card,.mobile-sale-card{transform:none!important}
  .easy-row>span:first-child{min-width:0;flex:1}.easy-row>span:last-child{flex:0 0 auto}
  .easy-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));align-items:stretch}
  .easy-actions button{width:100%;min-width:0;min-height:48px;margin:0}
  .easy-more-actions{min-width:0;max-width:100%;grid-column:1/-1}
  .easy-more-actions summary{min-height:44px;box-sizing:border-box;cursor:pointer}
  .easy-more-actions[open]{display:grid;grid-template-columns:1fr;gap:8px}
  .easy-more-actions button{display:block;width:100%;min-width:0;margin:0!important;min-height:44px!important;padding:10px 12px!important;font-size:14px!important}
  .mobile-sale-card>footer{display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:start}
  .mobile-sale-card>footer>button{width:100%;min-height:48px!important;font-size:14px!important}
  .row-actions{min-width:150px;align-items:start}.row-actions>button{width:100%;min-height:44px}
  .tablebox{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
  .project-center-card{min-width:0;min-height:0;display:flex;flex-direction:column}
  .project-center-card>header{position:static!important;flex:0 0 auto;min-width:0;align-items:flex-start!important}
  .project-center-card>header>div{min-width:0;flex:1}
  .project-center-card h2{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;max-width:100%!important;overflow-wrap:anywhere}
  .project-center-card .sheet-close{flex:0 0 44px;width:44px;height:44px;align-self:flex-start}
  #easyProjectTabs{flex:0 0 auto;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;padding:10px 16px;margin:0;background:#f7f5ef;border-bottom:1px solid #ded5c8;overflow:visible;min-width:0}
  #easyProjectTabs button{width:100%;min-width:0;min-height:44px;padding:8px 4px;font-size:13px;border:1px solid #d5c9bc}
  .project-center-body{display:block!important;flex:1 1 0!important;min-height:0!important;min-width:0;overflow-y:auto!important;overflow-x:hidden;padding:16px!important;overscroll-behavior:contain;scrollbar-gutter:stable}
  .project-center-body [role=tabpanel]{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
  .project-center-body .easy-grid{margin-top:12px}.project-center-body .project-module{margin:0;min-width:0}
  .project-center-body input,.project-center-body select,.project-center-body textarea{min-width:0;max-width:100%;box-sizing:border-box}
  .project-center-body .project-finance-grid>div{min-width:0}.project-finance-grid strong{overflow-wrap:anywhere}
  .project-module-actions{display:flex;gap:8px;flex-wrap:wrap;min-width:0}
  #quoteEditor,.erp-form-dialog,#finEditor{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(var(--erp-visible-height,100dvh) - 24px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}
  #quoteEditor header>h2{min-width:0;overflow-wrap:anywhere}#quoteEditor header>button{flex:0 0 44px;min-height:44px;padding:0}
  #quoteEditor footer,.erp-form-dialog footer{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));align-items:stretch}
  #quoteEditor footer button,.erp-form-dialog footer button{min-width:0;width:100%;min-height:48px;margin:0}
  #easySync{min-height:2.8em;overflow-wrap:anywhere}
}
@media screen and (max-width:700px){
  #easyProjectTabs{grid-template-columns:repeat(4,minmax(0,1fr));padding:8px;gap:5px}
  #easyProjectTabs button{font-size:12px;min-height:42px}
  .project-center-body{padding:12px 12px calc(24px + env(safe-area-inset-bottom,0px))!important}
  .easy-actions{grid-template-columns:1fr 1fr}.easy-actions button{min-width:0!important;font-size:14px}
  #quoteEditor footer,.erp-form-dialog footer{grid-template-columns:1fr}
  .project-module-actions{display:grid;grid-template-columns:1fr;width:100%}
  .project-files-list{grid-template-columns:minmax(0,1fr)!important}
  .project-file-meta{overflow-wrap:anywhere}.project-file-actions{flex-wrap:wrap;gap:8px}
  #rentabilidad .fin-heading{flex-wrap:wrap;min-width:0}#rentabilidad .fin-version{white-space:normal}
  .top>button{width:100%;min-height:48px;margin-top:12px}
}
@media screen and (max-width:360px){.easy-actions{grid-template-columns:1fr}.project-finance-grid{grid-template-columns:minmax(0,1fr)!important}}
@media screen {
  html.platform-phone body.project-center-open .project-center-card{top:var(--erp-visible-top,0px)!important;bottom:auto!important;left:0!important;right:0!important;width:100%!important;height:var(--erp-visible-height,100dvh)!important;max-height:var(--erp-visible-height,100dvh)!important}
  html.platform-phone .project-center-card>header{padding:calc(8px + env(safe-area-inset-top,0px)) 12px 8px!important}
  html.platform-phone body .mobile-bottom-nav{align-items:stretch!important;grid-template-rows:60px}
  html.platform-phone .mobile-nav-item{display:flex!important;flex-direction:column;justify-content:center;align-items:center;gap:5px;transform:none!important;min-width:0}
  html.platform-phone .mobile-nav-item .easy-nav-symbol{height:26px;line-height:26px}
  html.platform-phone main{padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))!important}
  html.platform-phone[data-active-view="venta"] main{padding-bottom:24px!important}
}
@media screen{button.nav,button.nav:hover,.side-actions button,.side-actions button:hover{transform:none!important;transition:background-color .15s,color .15s!important}.project-center-card>header{max-height:32%;overflow-y:auto;overscroll-behavior:contain}}
