/* ===== Inpatient limit basis: Per Person / Per Family dropdown =====
   The quote engine shows the inpatient limit basis as a dropdown. The original
   radio inputs stay in the markup as the engine's source of truth and are
   hidden here, so every existing quote rule keeps working. */
#quote-form .quote-step-cover-selection .inpatient-card>#inpatientScopeGroup>.radio-option{
  display:none!important;
}

#quote-form #inpatientScopeGroup>.scope-select{
  grid-column:1 / -1!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

/* Desktop: match the inpatient limit selector next to it. */
@media (min-width:1025px){
  /* The card is a flex row here, so the selector must take a compact fixed
     width instead of the old full-width pill row. */
  #quote-form .quote-step-cover-selection .insurer-card>#inpatientScopeGroup{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
  }
  #quote-form #inpatientScopeGroup>.scope-select{
    width:auto!important;
    min-width:160px!important;
    max-width:100%!important;
    min-height:38px!important;
    padding:.55rem .75rem!important;
    border:1.5px solid #d9e0e8!important;
    border-radius:10px!important;
    background:#fff!important;
    color:#475569!important;
    font-size:.75rem!important;
    font-weight:600!important;
  }
  #quote-form #inpatientScopeGroup>.scope-select:focus{
    outline:none!important;
    border-color:#86b596!important;
    box-shadow:0 0 0 3px rgba(22,101,52,.08)!important;
  }
  #quote-form #inpatientScopeGroup>.scope-select:disabled{
    background:#f5f7f8!important;
    color:#94a3b8!important;
    cursor:not-allowed!important;
  }
}

/* Phone: sit beside the inpatient limit selector in the same segmented row. */
@media (max-width:700px){
  #quote-form .quote-step-cover-selection .inpatient-card>#inpatientScopeGroup>.scope-select{
    grid-column:2 / -1!important;
    height:44px!important;
    min-height:44px!important;
    padding:0 10px!important;
    border:1px solid #d7e1da!important;
    border-left:0!important;
    border-radius:0 10px 10px 0!important;
    background:#fff!important;
    color:#526158!important;
    font-size:.8rem!important;
    font-weight:750!important;
  }
  #quote-form .quote-step-cover-selection .inpatient-card>#inpatientScopeGroup>.scope-select:focus{
    outline:none!important;
    border-color:#247a3b!important;
    box-shadow:0 0 0 3px rgba(36,122,59,.12)!important;
  }
}

/* ===== Outpatient limit basis: Per Person / Per Family dropdown ===== */
#quote-form #outpatientScopeGroup>.radio-option{
  display:none!important;
}
#quote-form #outpatientScopeGroup>.scope-select{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

/* Desktop: compact dropdown beside the outpatient limit selector. */
@media (min-width:1025px){
  #quote-form #outpatientScopeGroup>.scope-select{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:160px!important;
    max-width:100%!important;
    min-height:38px!important;
    padding:.55rem .75rem!important;
    border:1.5px solid #d9e0e8!important;
    border-radius:10px!important;
    background:#fff!important;
    color:#475569!important;
    font-size:.75rem!important;
    font-weight:600!important;
  }
  #quote-form #outpatientScopeGroup>.scope-select:focus{
    outline:none!important;
    border-color:#86b596!important;
    box-shadow:0 0 0 3px rgba(22,101,52,.08)!important;
  }
}

/* Tablet: fill the scope grid cell. */
@media (min-width:701px) and (max-width:1024px){
  #quote-form #outpatientScopeGroup>.scope-select{
    grid-column:1 / -1!important;
    min-height:44px!important;
    height:44px!important;
  }
}

/* Phone: sit beside the outpatient limit selector. */
@media (max-width:700px){
  #quote-form .quote-step-benefits .limit-scope-wrapper>#outpatientScopeGroup>.scope-select{
    grid-column:2 / -1!important;
    height:44px!important;
    min-height:44px!important;
    padding:0 10px!important;
    border:1px solid #d7e1da!important;
    border-left:0!important;
    border-radius:0 10px 10px 0!important;
    background:#fff!important;
    color:#526158!important;
    font-size:.8rem!important;
    font-weight:750!important;
  }
}

/* ===== Flatten the scope dropdowns on desktop: no nested wrapper box ===== */
@media (min-width:1025px){
  #quote-form #inpatientScopeGroup,
  #quote-form #outpatientScopeGroup{
    display:contents !important;
  }
  #quote-form #outpatientLimit{
    flex:1 1 auto !important;
    min-width:0 !important;
  }
  #quote-form #inpatientScopeGroup>.scope-select,
  #quote-form #outpatientScopeGroup>.scope-select{
    flex:0 0 auto !important;
    width:auto !important;
    min-width:160px !important;
  }
}
