/* v4.6.7 compact mobile leads and status-first drawer */
.mobile-lead-more-toggle{display:none}

@media(max-width:820px){
  table.mobile-card-table.lead-table tbody{gap:7px}
  table.mobile-card-table.lead-table tr{
    min-height:62px;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    padding:9px 11px;
    border-left:4px solid #17a38a!important;
    border-radius:14px;
  }
  table.mobile-card-table.lead-table tr.has-lead-select{
    grid-template-columns:28px minmax(0,1fr) auto;
  }
  table.mobile-card-table.lead-table td{
    padding:0;
    margin:0;
    border:0;
  }
  table.mobile-card-table.lead-table td::before{display:none!important}
  table.mobile-card-table.lead-table .lead-select-column{
    position:static;
    width:28px;
    grid-column:1;
    grid-row:1;
    padding:0;
    background:transparent;
    box-shadow:none;
  }
  table.mobile-card-table.lead-table .lead-select-column input{
    width:20px;
    height:20px;
    min-height:20px;
    margin:0;
  }
  table.mobile-card-table.lead-table .lead-cell-name{
    grid-column:1;
    grid-row:1;
    min-width:0;
    padding:0;
    border:0;
  }
  table.mobile-card-table.lead-table .has-lead-select .lead-cell-name{grid-column:2}
  table.mobile-card-table.lead-table .lead-cell-name .lead-name{
    display:block;
    overflow:hidden;
    color:#153638;
    font-size:15px;
    line-height:1.25;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  table.mobile-card-table.lead-table .lead-cell-name .subtext{display:none}
  table.mobile-card-table.lead-table .lead-cell-status{
    grid-column:2;
    grid-row:1;
    justify-self:end;
    padding:0;
    text-align:right;
  }
  table.mobile-card-table.lead-table .has-lead-select .lead-cell-status{grid-column:3}
  table.mobile-card-table.lead-table .lead-cell-status .subtext{display:none}
  table.mobile-card-table.lead-table .lead-cell-status .pill{
    max-width:116px;
    padding:6px 9px;
    overflow:hidden;
    font-size:10px;
    line-height:1.15;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  table.mobile-card-table.lead-table .lead-cell-source,
  table.mobile-card-table.lead-table .lead-cell-campaign,
  table.mobile-card-table.lead-table .lead-cell-agent,
  table.mobile-card-table.lead-table .lead-cell-call,
  table.mobile-card-table.lead-table .lead-cell-followup,
  table.mobile-card-table.lead-table .lead-cell-created{display:none!important}

  body.lead-drawer-open .drawer{overflow:hidden}
  body.lead-drawer-open .drawer-body{
    min-height:0;
    padding:12px 12px calc(96px + env(safe-area-inset-bottom));
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  #detailsTab{min-width:0}
  #leadDetailsForm{
    display:flex;
    min-width:0;
    flex-direction:column;
    gap:11px;
  }
  #leadDetailsForm>.lead-status-control{
    order:-300;
    gap:7px;
    padding:14px;
    border:1px solid #9fd8ce;
    border-radius:16px;
    background:linear-gradient(145deg,#effcf9,#fff);
    box-shadow:0 7px 20px rgba(10,95,88,.08);
  }
  #leadDetailsForm>.lead-status-control>span{
    color:#0b5e57;
    font-size:15px;
    font-weight:850;
  }
  #leadDetailsForm>.lead-status-control>small{
    color:#58716e;
    font-size:11px;
    font-weight:550;
    line-height:1.35;
  }
  #detailStatus{
    width:100%;
    min-height:56px;
    padding:11px 38px 11px 13px;
    border:2px solid #49ad9e;
    border-radius:13px;
    background:#fff;
    color:#123f3b;
    font-size:16px!important;
    font-weight:850;
  }
  #leadDetailsForm>.mobile-lead-more-toggle{
    order:-290;
    width:100%;
    min-height:45px;
    display:block;
    border:1px solid #cbdedb;
    border-radius:13px;
    background:#f4f8f7;
    color:#285c57;
    font-size:12px;
    font-weight:800;
  }
  #leadDetailsForm:not(.show-mobile-details)>.mobile-secondary-lead-field{display:none}
  #leadDetailsForm.mobile-site-visit-status:not(.show-mobile-details)>[data-mobile-status-extra="site-visit"]{
    display:flex;
    order:-260;
  }
  #leadDetailsForm>#followupFields{order:-270}
  #leadDetailsForm>#siteVisitFields{order:-250}
  #leadDetailsForm>#notInterestedNotice{order:-270}
  #leadDetailsForm>.conditional-fields{
    width:100%;
    min-width:0;
    padding:13px;
    border-radius:15px;
  }
  #leadDetailsForm>.conditional-fields .form-grid.two{grid-template-columns:1fr}
  #leadDetailsForm>.conditional-fields input,
  #leadDetailsForm>.conditional-fields textarea,
  #leadDetailsForm>.conditional-fields select{width:100%;min-width:0}
  #leadDetailsForm>button[type="submit"]{
    order:500;
    width:100%;
    bottom:calc(8px + env(safe-area-inset-bottom));
  }
  #leadDetailsForm>#deleteLeadBtn{order:510}
}

@media(max-width:360px){
  table.mobile-card-table.lead-table .lead-cell-status .pill{max-width:92px}
  table.mobile-card-table.lead-table .lead-cell-name .lead-name{font-size:14px}
}
