/* Lavender Lotus Studio 9.3.51 — mobile modal containment + native pinch zoom.
   Additive only: preserves approved project/pricing visuals. */
html, body, .app-shell, .content, main, .project-file-hub, .project-file-panel,
.modal-body, .dialog-layer {
  touch-action: pan-x pan-y pinch-zoom;
}

/* Interactive drawing/design surfaces keep their own intentional touch behavior. */
.signature-wrap canvas, .vdp-stage, .vdp-canvas-layer, .vdp-handle,
.vdp-rotate-handle, .vdp-cutout-canvas-wrap canvas { touch-action:none !important; }

@media (max-width:760px){
  /* Actual-cost and scope-change forms use the same safe mobile sheet behavior. */
  .dialog-layer:has(.financial-entry-modal),
  .dialog-layer:has(.scope-change-modal){
    place-items:end center !important;
    padding:0 !important;
    overflow:hidden !important;
  }
  .modal.financial-entry-modal,
  .modal.scope-change-modal{
    width:100% !important;
    max-width:none !important;
    height:min(88dvh,760px) !important;
    max-height:calc(100dvh - 12px) !important;
    margin:0 !important;
    border-radius:28px 28px 0 0 !important;
    overflow:hidden !important;
  }
  .financial-entry-modal>form,
  .scope-change-modal>form{
    height:100% !important;
    min-height:0 !important;
    display:flex !important;
    flex-direction:column !important;
    overflow:hidden !important;
  }
  .financial-entry-modal .modal-header,
  .scope-change-modal .modal-header{flex:0 0 auto !important}
  .financial-entry-modal .modal-body,
  .scope-change-modal .modal-body{
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    touch-action:pan-y pinch-zoom !important;
    padding-bottom:28px !important;
    scroll-padding-bottom:130px !important;
  }
  .financial-entry-modal .form-grid,
  .scope-change-modal .form-grid{grid-template-columns:1fr !important;gap:0 !important}
  .financial-entry-modal .form-grid .span-2,
  .scope-change-modal .form-grid .span-2{grid-column:auto !important}
  .financial-entry-modal textarea,
  .scope-change-modal textarea{min-height:104px !important;max-height:150px !important}
  .financial-entry-modal .modal-footer,
  .scope-change-modal .modal-footer{
    position:relative !important;
    z-index:20 !important;
    flex:0 0 auto !important;
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) !important;
    align-items:center !important;
    gap:10px !important;
    padding:12px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    background:#fffaf7 !important;
    box-shadow:0 -10px 28px rgba(40,26,34,.10) !important;
  }
  .financial-entry-modal .modal-footer-right,
  .scope-change-modal .modal-footer-right{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1.08fr) !important;
    gap:10px !important;
    margin:0 !important;
    min-width:0 !important;
  }
  .financial-entry-modal .modal-footer .button,
  .scope-change-modal .modal-footer .button{
    min-width:0 !important;
    width:100% !important;
    min-height:50px !important;
    padding:11px 12px !important;
    justify-content:center !important;
    white-space:nowrap !important;
    overflow:visible !important;
    text-overflow:clip !important;
  }
}

@media (max-width:390px){
  .financial-entry-modal .modal-footer,
  .scope-change-modal .modal-footer{padding-inline:10px !important;gap:7px !important}
  .financial-entry-modal .modal-footer-right,
  .scope-change-modal .modal-footer-right{gap:7px !important}
  .financial-entry-modal .modal-footer .button,
  .scope-change-modal .modal-footer .button{font-size:.78rem !important;padding-inline:8px !important}
}


/* 9.3.62 — Create sheet: mobile/Home Screen scroll + safe-area fix. */
@media(max-width:900px){
  body.v8-action-sheet-open .v8-mobile-dock{display:none!important}
  .v8-action-sheet{
    z-index:1400!important;
    padding:max(10px,env(safe-area-inset-top,0px)) 10px max(10px,env(safe-area-inset-bottom,0px))!important;
    overflow:hidden!important;
  }
  .v8-action-panel{
    display:flex!important;
    flex-direction:column!important;
    width:min(560px,100%)!important;
    max-height:calc(var(--lls-visual-height,100dvh) - max(20px,env(safe-area-inset-top,0px)) - max(20px,env(safe-area-inset-bottom,0px)))!important;
    overflow:hidden!important;
    padding:20px 18px 16px!important;
  }
  .v8-action-panel>header{flex:0 0 auto;padding-bottom:4px}
  .v8-action-panel h3{font-size:2rem!important;line-height:1.05!important}
  .v8-action-grid{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:4px 2px calc(10px + env(safe-area-inset-bottom,0px))!important;
    margin-top:10px!important;
  }
  .v8-action-grid button{min-height:64px!important;font-size:.68rem!important}
}
@media(max-width:430px){
  .v8-action-sheet{padding-left:8px!important;padding-right:8px!important}
  .v8-action-panel{border-radius:28px 28px 24px 24px!important}
}
