/* These helpers leave the desktop CRM navigation and forms in place. */
.mobile-app-controls,.mobile-login-install,.mobile-job-section{display:none}
.mobile-install-dialog{width:min(460px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid #d8e4f2;border-radius:16px;color:#0b1c3c;background:#fff;box-shadow:0 24px 80px rgba(4,18,47,.28)}
.mobile-install-dialog::backdrop{background:rgba(4,18,47,.62)}
.mobile-install-dialog h2{margin:0 0 14px;font-size:23px;line-height:1.2}
.mobile-install-dialog p,.mobile-install-dialog li{line-height:1.6}
.mobile-install-dialog ol{padding-left:23px}.mobile-install-dialog li+li{margin-top:10px}
.mobile-install-note{color:#61738d;font-size:14px}.mobile-install-dialog button{width:100%;min-height:44px}
@media(max-width:760px){
  .app-shell,.login-page{min-height:100vh;min-height:100dvh}
  .sidebar.mobile-app-ready{padding: max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left))}
  .sidebar.mobile-app-ready .brand{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0}
  .sidebar.mobile-app-ready .brand>small{display:none}
  .sidebar.mobile-app-ready .brand-logo{width:100px}
  .mobile-app-controls{display:flex;align-items:center;gap:8px}
  .mobile-menu-toggle,.mobile-install-trigger{min-height:44px;padding:10px 12px;border:1px solid #45608b;border-radius:9px;color:#fff;background:#153968;font-size:14px;font-weight:750;white-space:nowrap}
  .mobile-menu-toggle[aria-expanded="true"]{background:#214abf;border-color:#6d9bff}
  .sidebar.mobile-app-ready .nav-list{display:none}
  .sidebar.mobile-app-ready.mobile-menu-open .nav-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:14px;overflow:visible}
  .sidebar.mobile-app-ready .nav-item{min-width:0;min-height:46px;justify-content:flex-start;padding:10px;font-size:14px;white-space:normal}
  .sidebar.mobile-app-ready .nav-icon{display:block;width:18px;height:18px}
  .sidebar.mobile-app-ready .nav-count{display:inline-flex;align-items:center;justify-content:center;flex:none;margin-left:auto}
  .mobile-login-install{display:block;margin-top:20px}
  .mobile-login-install .mobile-install-trigger{width:100%;color:#1757aa;background:#edf5ff;border-color:#b7d2f1}
  .job-workspace>.mobile-job-section{display:grid;gap:8px;min-width:0;margin-bottom:16px;color:#40536e;font-size:14px;font-weight:750}
  .mobile-job-section select{width:100%;min-width:0;min-height:48px;padding:11px 12px;border:1px solid #bdcfe5;border-radius:10px;color:#0b1c3c;background:#fff}
  .job-workspace>.job-tabs.mobile-job-tabs-ready{display:none}
  body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),body select,body textarea{font-size:16px!important}
  body button,body .quick-link,body .client-card-action{min-height:44px!important}
  .search-wrap,.select-wrap{min-height:46px;height:auto;min-width:0}
  .toolbar .search-wrap{flex-basis:100%;width:100%}.search-wrap input{min-height:44px}
  .contact-actions{min-width:0;max-width:100%}
  .job-email-selector{width:100%;min-width:0;max-width:100%}
  .job-email-selector>label{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;min-width:0}
  .job-email-selector select{width:100%;min-width:0;max-width:100%}
  .form-grid{grid-template-columns:minmax(0,1fr)}
  .form-grid>label{min-width:0}
  .form-grid select,.form-grid textarea{min-width:0;max-width:100%}
  .page-heading>div:first-child,.job-workspace,.job-workspace>.panel{min-width:0}
  .page-heading h1{overflow-wrap:anywhere}
  .page-content{padding-right:max(16px,env(safe-area-inset-right));padding-bottom:calc(24px + env(safe-area-inset-bottom));padding-left:max(16px,env(safe-area-inset-left))}
  .topbar{padding-right:max(19px,env(safe-area-inset-right));padding-left:max(19px,env(safe-area-inset-left))}
  .job-dialog{top:var(--mobile-visual-top,0px);bottom:auto;height:100vh;height:var(--mobile-visual-height,100dvh);padding-top:env(safe-area-inset-top)}
  .dialog-header,.dialog-actions{flex-shrink:0}.dialog-body{min-height:0;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .dialog-actions{padding-bottom:max(17px,env(safe-area-inset-bottom))}
  .client-edit-dialog{max-height:calc(var(--mobile-visual-height,100dvh) - 24px)}
  .login-page{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
  .toast{right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));left:max(16px,env(safe-area-inset-left));max-width:none}
  .table-scroll{max-width:100%;overscroll-behavior-x:contain}
}
@media(max-width:470px){
  .app-shell .line-row.quote-line,.app-shell .line-row.quote-optional-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px}
  .quote-line input:first-child,.quote-optional-line input:first-child{grid-column:1/-1}
  .app-shell .line-row.inventory-line{grid-template-columns:minmax(0,1fr) 64px 44px}
  .inventory-line input:first-child{grid-column:1/-1}
  .line-row button{min-width:44px}.line-head{display:none}
}
