/* MISTER FAST LiveMapChat WEB — V2.5.1 Route Workspace Overflow Hotfix
   Keeps the Recovery Baseline intact. Fixes the horizontal workspace row
   overflowing into the right-side Floating Chat area when Route is opened. */

/* Every grid/flex ancestor must be allowed to shrink inside the center pane. */
body.mf-navigation-workspace-v21 .mf514-map-pane,
body.mf-navigation-workspace-v21 .mf20-workspace-panel,
body.mf-navigation-workspace-v21 .mf20-workspace-view,
body.mf-navigation-workspace-v21 .mf-route-workspace-a,
body.mf-navigation-workspace-v21 .mf-route-a-grid,
body.mf-navigation-workspace-v21 .mf-route-a-points,
body.mf-navigation-workspace-v21 .mf-route-a-tools,
body.mf-navigation-workspace-v21 .mf-route-a-summary{
  min-width:0 !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* The workspace is constrained to the real Map column, never the viewport. */
body.mf-navigation-workspace-v21 .mf20-workspace-panel{
  contain:layout paint;
  overflow-x:hidden !important;
}
body.mf-navigation-workspace-v21 .mf20-workspace-view{
  width:100% !important;
  overflow-x:hidden !important;
  container-type:inline-size;
  container-name:mf-route-workspace;
}

/* Remove fixed minimum widths that made the four-column row exceed the
   available center workspace after Sidebar and Floating Chat were reserved. */
body.mf-navigation-workspace-v21 .mf-route-a-grid{
  grid-template-columns:
    minmax(0,1.45fr)
    minmax(150px,.72fr)
    minmax(210px,1fr)
    minmax(120px,.48fr) !important;
}
body.mf-navigation-workspace-v21 .mf-route-a-point,
body.mf-navigation-workspace-v21 .mf-route-a-next,
body.mf-navigation-workspace-v21 .mf-route-a-locate{
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* Respond to the width of the Map workspace itself, not the browser width. */
@container mf-route-workspace (max-width: 1080px){
  body.mf-navigation-workspace-v21 .mf-route-a-grid{
    grid-template-columns:minmax(0,1.35fr) minmax(150px,.65fr) minmax(220px,1fr) !important;
  }
  body.mf-navigation-workspace-v21 .mf-route-a-next{
    grid-column:1/-1 !important;
    width:100% !important;
  }
}

@container mf-route-workspace (max-width: 790px){
  body.mf-navigation-workspace-v21 .mf-route-a-grid{
    grid-template-columns:1fr !important;
  }
  body.mf-navigation-workspace-v21 .mf-route-a-points{
    grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr) !important;
  }
  body.mf-navigation-workspace-v21 .mf-route-a-tools{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    align-items:center !important;
  }
}

@container mf-route-workspace (max-width: 560px){
  body.mf-navigation-workspace-v21 .mf-route-a-points,
  body.mf-navigation-workspace-v21 .mf-route-a-tools{
    grid-template-columns:1fr !important;
  }
  body.mf-navigation-workspace-v21 .mf-route-a-swap{
    width:100% !important;
    min-height:34px !important;
  }
}

/* Safe fallback for browsers without container-query support. */
@supports not (container-type:inline-size){
  body.mf-navigation-workspace-v21 .mf-route-a-grid{
    display:flex !important;
    flex-wrap:wrap !important;
  }
  body.mf-navigation-workspace-v21 .mf-route-a-points{flex:1 1 430px !important;}
  body.mf-navigation-workspace-v21 .mf-route-a-tools{flex:1 1 180px !important;}
  body.mf-navigation-workspace-v21 .mf-route-a-summary{flex:1 1 260px !important;}
  body.mf-navigation-workspace-v21 .mf-route-a-next{flex:1 1 150px !important;}
}
