/* MyLoanSaathi homepage mobile recovery V4 — preserve the original guided finder. */
#mls-global-header .mls-utility,
#mls-global-header .mls-utility-inner,
#mls-global-header .mls-utility-right,
#mls-global-header .mls-utility-right a { pointer-events:auto!important; }
#mls-global-header .mls-utility { position:relative!important; z-index:2147483001!important; }
#mls-global-header .mls-utility-inner,
#mls-global-header .mls-utility-right { position:relative!important; z-index:2!important; }
#mls-global-header .mls-ribbon-partner,
#mls-global-header .mls-ribbon-login { position:relative!important; z-index:3!important; pointer-events:auto!important; visibility:visible!important; opacity:1!important; }

/* The site body already reserves space for its fixed header. Do not add a second spacer. */
@media(max-width:1024px) {
  html,body { width:100%; max-width:100%; overflow-x:hidden!important; }
  body.home main { padding-top:0!important; margin-top:0!important; }
  body.home main > section:first-child,
  body.home main > .hc-hero:first-child { margin-top:0!important; scroll-margin-top:calc(var(--mls-header-h,96px) + 8px)!important; }
  #mls-global-header { top:0!important; left:0!important; right:0!important; width:100%!important; margin:0!important; }
}
@media(max-width:760px) {
  :root { --mls-header-h:96px; }
  #mls-global-header .mls-utility { display:block!important; height:30px!important; min-height:30px!important; padding:0!important; overflow:visible!important; }
  #mls-global-header .mls-utility-inner { display:flex!important; height:30px!important; min-height:30px!important; padding:0 7px!important; }
  #mls-global-header .mls-utility-left { display:none!important; }
  #mls-global-header .mls-utility-right { display:flex!important; width:100%!important; justify-content:center!important; align-items:center!important; flex-wrap:nowrap!important; gap:7px!important; }
  #mls-global-header .mls-utility-right .mls-ribbon-partner,
  #mls-global-header .mls-utility-right .mls-ribbon-login { display:inline-flex!important; align-items:center!important; justify-content:center!important; height:27px!important; min-height:27px!important; padding:0 10px!important; font-size:9px!important; line-height:1!important; white-space:nowrap!important; }
  #mls-global-header .mls-nav-row { display:flex!important; width:100%!important; min-height:66px!important; height:66px!important; box-sizing:border-box!important; padding:0 10px!important; gap:8px!important; align-items:center!important; }
  #mls-global-header .mls-brand { flex:1 1 auto!important; min-width:0!important; }
  #mls-global-header .mls-brand img { display:block!important; width:clamp(118px,38vw,150px)!important; max-width:100%!important; max-height:42px!important; object-fit:contain!important; }
  #mls-global-header .mls-menu-toggle { flex:0 0 44px!important; width:44px!important; min-width:44px!important; height:44px!important; }
  #mls-global-header .mls-nav-actions { flex:0 0 auto!important; min-width:0!important; gap:5px!important; }

  /* True phone-sized full-screen menu; original menu JS and links stay intact. */
  body > .mls-mobile-menu,
  body .mls-mobile-menu { position:fixed!important; inset:0!important; width:100vw!important; max-width:none!important; height:100dvh!important; min-height:100dvh!important; max-height:100dvh!important; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; overflow:hidden!important; z-index:2147483600!important; box-sizing:border-box!important; }
  body > .mls-mobile-menu .mv8-shell,
  body > .mls-mobile-menu .mls-mobile-scroll,
  body .mls-mobile-menu .mv8-shell,
  body .mls-mobile-menu .mls-mobile-scroll { height:100dvh!important; min-height:100dvh!important; max-height:100dvh!important; overflow-y:auto!important; overflow-x:hidden!important; overscroll-behavior:contain!important; -webkit-overflow-scrolling:touch!important; box-sizing:border-box!important; padding-top:max(16px,env(safe-area-inset-top))!important; padding-bottom:max(26px,env(safe-area-inset-bottom))!important; }
  body > .mls-mobile-menu .mls-mobile-apphead,
  body > .mls-mobile-menu .mv8-brand { margin-top:0!important; }

  /* Restore the original three-step Find My Loan guided popup — no replacement form. */
  html body .mls-finder-backdrop { position:fixed!important; inset:0!important; z-index:2147483640!important; display:flex!important; align-items:center!important; justify-content:center!important; padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom))!important; overflow:hidden!important; }
  html body .mls-finder-modal { position:relative!important; display:block!important; width:100%!important; max-width:560px!important; max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important; height:auto!important; margin:0 auto!important; overflow:hidden!important; border-radius:22px!important; transform:none!important; }
  html body .mls-finder-grid { display:block!important; width:100%!important; min-height:0!important; max-height:inherit!important; height:auto!important; overflow-y:auto!important; overflow-x:hidden!important; overscroll-behavior:contain!important; -webkit-overflow-scrolling:touch!important; }
  html body .mls-finder-story { display:block!important; padding:16px 16px 10px!important; border-right:0!important; border-bottom:1px solid rgba(255,255,255,.12)!important; }
  html body .mls-finder-story h2 { margin:5px 42px 5px 0!important; font-size:clamp(22px,6vw,27px)!important; line-height:1.08!important; }
  html body .mls-finder-story p { display:block!important; margin:6px 0 0!important; font-size:11px!important; line-height:1.45!important; }
  html body .mls-finder-journey,html body .mls-finder-proof { display:none!important; }
  html body .mls-finder-workspace { display:block!important; width:100%!important; max-height:none!important; height:auto!important; overflow:visible!important; margin:0!important; padding:13px 14px max(16px,env(safe-area-inset-bottom))!important; border-radius:0!important; box-shadow:none!important; }
  html body .mls-finder-close { position:absolute!important; top:10px!important; right:10px!important; z-index:20!important; width:38px!important; min-width:38px!important; height:38px!important; min-height:38px!important; }
  html body .mls-finder-stagebar { display:flex!important; gap:5px!important; margin:0 42px 9px 0!important; }
  html body .mls-finder-stagebar span { flex:1 1 0!important; min-width:0!important; padding:6px 2px!important; font-size:7px!important; line-height:1.1!important; text-align:center!important; white-space:nowrap!important; }
  html body .mls-finder-progress { margin:0 0 13px!important; }
  html body .mls-finder-step h3 { margin:5px 0 11px!important; font-size:clamp(19px,5.3vw,23px)!important; line-height:1.15!important; }
  html body .mls-finder-options { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:7px!important; }
  html body .mls-finder-option { min-width:0!important; min-height:57px!important; padding:9px 7px 8px 37px!important; border-radius:12px!important; font-size:10px!important; line-height:1.25!important; overflow-wrap:anywhere!important; }
  html body .mls-finder-option:before { left:7px!important; top:9px!important; width:23px!important; height:23px!important; font-size:11px!important; }
  html body .mls-finder-option span { margin-top:3px!important; font-size:8px!important; line-height:1.25!important; }
  html body .mls-finder-fields { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; width:100%!important; }
  html body .mls-finder-fields input,html body .mls-finder-fields select { width:100%!important; min-width:0!important; min-height:45px!important; padding:10px!important; border-radius:10px!important; font-size:16px!important; box-sizing:border-box!important; }
  html body .mls-finder-actions { display:flex!important; justify-content:space-between!important; gap:8px!important; margin-top:12px!important; }
  html body .mls-finder-actions button { min-width:0!important; min-height:43px!important; max-width:100%!important; padding:10px 12px!important; font-size:11px!important; touch-action:manipulation!important; }
  html body .mls-finder-note { margin-top:9px!important; font-size:9px!important; line-height:1.4!important; }
  html body .mls-finder-status { overflow-wrap:anywhere!important; }

  /* Remove the floating Quick Links / Interest Rates rail that draws a white line beside chat. */
  #mlsEdgeDesk,.mls-edge-tabs,.mls-edge-panel,.mls-side-hub,.mls-side-tabs,
  .mls-hub-mobile,.mls-mobile-hub,.mls-mobile-desk,.mls-mobile-utility,
  .mls-utility-rail,.mls-utility-tabs,.mls-mobile-sheet { display:none!important; visibility:hidden!important; pointer-events:none!important; }
  body #mlsChatBtn,body .mls-live-chat-launcher { right:12px!important; bottom:calc(12px + env(safe-area-inset-bottom))!important; width:auto!important; min-width:0!important; max-width:116px!important; height:40px!important; min-height:40px!important; padding:7px 10px!important; gap:6px!important; border-radius:13px!important; font-size:10px!important; box-shadow:0 8px 22px rgba(4,80,166,.22)!important; }
  body #mlsChatBtn:before,body #mlsChatBtn:after,body .mls-live-chat-launcher:before,body .mls-live-chat-launcher:after { display:none!important; content:none!important; }
}
@media(max-width:380px) {
  #mls-global-header .mls-brand img { width:116px!important; }
  #mls-global-header .mls-nav-row { padding-inline:7px!important; gap:5px!important; }
  html body .mls-finder-options { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  html body .mls-finder-option { padding-left:34px!important; font-size:9px!important; }
  html body .mls-finder-option span { font-size:7.5px!important; }
}


/* V5: nudge the first mobile hero below the fixed header without adding a blank spacer. */
@media(max-width:760px){
  body.home main > section:first-child.of-hero,
  body.home main > .of-hero:first-child { margin-top:10px!important; }
}

/* V5: keep Find Lender and Find My Loan as a deliberate adjacent pair on laptops. */
@media(min-width:1041px){
  #mls-global-header .mls-desktop-nav .mls-find-lender-nav { display:none!important; }
  #mls-global-header .mls-nav-actions .mls-action-find-lender { display:inline-flex!important; }
  #mls-global-header .mls-nav-actions { display:flex!important; flex-wrap:nowrap!important; align-items:center!important; gap:8px!important; white-space:nowrap!important; }
  #mls-global-header .mls-nav-actions .mls-action-find-lender,
  #mls-global-header .mls-nav-actions .mls-apply { flex:0 0 auto!important; white-space:nowrap!important; }
  #mls-global-header .mls-nav-actions .mls-action-find-lender { height:38px!important; min-height:38px!important; padding:0 12px!important; border:1px solid #b9d5f5!important; border-radius:11px!important; background:#f4f9ff!important; color:#0756a6!important; font-size:11px!important; font-weight:850!important; text-decoration:none!important; align-items:center!important; justify-content:center!important; }
}
@media(min-width:1041px) and (max-width:1280px){
  #mls-global-header .mls-track { display:none!important; }
  #mls-global-header .mls-desktop-nav { gap:clamp(8px,1vw,13px)!important; }
  #mls-global-header .mls-desktop-nav > a,
  #mls-global-header .mls-desktop-nav .mls-nav-trigger { font-size:10px!important; }
  #mls-global-header .mls-nav-actions { gap:6px!important; }
  #mls-global-header .mls-nav-actions .mls-action-find-lender { padding:0 9px!important; font-size:10px!important; }
  #mls-global-header .mls-nav-actions .mls-apply { padding:0 10px!important; font-size:10px!important; }
}
@media(max-width:1040px){ #mls-global-header .mls-nav-actions .mls-action-find-lender { display:none!important; } }
