/* CRM booking modal and popover styles only. */
/* Modal selects are moved to body while open so no scroll container,
   inline calendar or sticky footer can paint over their options. */
html body .crm-modal-menu-portal.crm-control-popover{
  position:fixed!important;
  z-index:2147482955!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  box-sizing:border-box!important;
  isolation:isolate!important;
  background:#fff!important;
  border:1px solid #cbdce9!important;
  border-radius:12px!important;
  box-shadow:0 20px 54px rgba(11,37,67,.28)!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}
html body .crm-modal-menu-portal .crm-select-option{
  min-height:39px!important;
  color:#223a53!important;
}
@media(max-width:760px){
  /* In the new-appointment dialog use the consistent custom select instead
     of mixing a native drop-down with a hidden custom one. The custom list
     is rendered in the top-level layer above when opened. */
  html body #appointmentModal #apptServiceField select#apptService.crm-native-source{
    display:none!important;
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    min-height:0!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  html body #appointmentModal #apptServiceField .crm-select-control[data-crm-select-for="apptService"]{
    display:block!important;
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    overflow:visible!important;
  }
  html body #appointmentModal #apptServiceField .crm-select-control[data-crm-select-for="apptService"] .crm-select-trigger{
    display:flex!important;
    width:100%!important;
    min-height:46px!important;
    align-items:center!important;
    justify-content:space-between!important;
    box-sizing:border-box!important;
  }
  html body .crm-modal-menu-portal .crm-select-option{
    min-height:44px!important;
    padding:10px 12px!important;
  }

  /* The footer is one quiet secondary menu plus one prominent save action.
     Desktop/tablet keep the same action priority without a scrolling strip. */
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar.modal-actions.split{
    display:flex!important;
    flex-flow:row nowrap!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:10px!important;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom))!important;
    margin:0!important;
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    overflow:visible!important;
  }
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar .appointment-danger-group,
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar .appointment-primary-group{
    display:flex!important;
    flex-flow:row nowrap!important;
    align-items:center!important;
    min-width:0!important;
    width:auto!important;
    margin:0!important;
  }
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar .appointment-danger-group{
    flex:0 0 auto!important;
  }
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar .appointment-primary-group{
    flex:1 1 auto!important;
    justify-content:flex-end!important;
  }
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar button.btn:not([hidden]){
    display:inline-flex!important;
    flex:0 1 auto!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:0!important;
    min-height:44px!important;
    height:44px!important;
    margin:0!important;
    padding:0 12px!important;
    box-sizing:border-box!important;
    font-size:12px!important;
    line-height:1.25!important;
    white-space:nowrap!important;
  }
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar #saveEditAppointmentBtn{
    flex:1 1 auto!important;
    width:100%!important;
    min-width:0!important;
    font-size:13px!important;
  }

}
/* Very narrow phones: preserve the same two-column structure. */
@media(max-width:360px){
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar.modal-actions.split{
    gap:7px!important;
    padding:9px!important;
  }
  html body #editAppointmentModal.appointment-detail-modal .appointment-actionbar button.btn{
    font-size:10px!important;
    padding:8px 3px!important;
  }
}


