/* Match the pipeline's ID specificity: its fixed 430px panel otherwise wins
   over the shared mobile .m3dBody rule and collapses the model preview. */
@media (max-width: 860px) {
  .mobilebar {
    height: 50px;
    min-height: 50px;
    gap: 8px;
    padding-left: calc(10px + env(safe-area-inset-left));
    padding-right: calc(10px + env(safe-area-inset-right));
  }

  .mobilebar strong {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
  }

  .mobilebar .hdrtoggle {
    width: auto;
    min-width: 78px;
    max-width: 44vw;
    padding: 0 9px;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .main {
    height: calc(100vh - 50px);
    height: calc(100dvh - 50px);
  }

  .top { padding: 6px 10px; }
  .toolbar { padding: 7px 10px; gap: 6px; }
  .tbleft { gap: 6px; }
  #search { height: 38px; min-height: 38px; }
  .typechips .chip { min-height: 32px; padding: 5px 10px; }
  .tbright { gap: 6px; padding-bottom: 0; }
  .tbright .tbbtn, .tbright .tbsel { min-height: 36px; padding: 6px 10px; }

  #m3dOverlay .m3dBody {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #m3dOverlay .m3dBody > * {
    min-width: 0;
    max-width: 100%;
  }

  #m3dOverlay .m3dStage {
    min-height: 40vh;
    min-height: 40dvh;
  }

  #m3dOverlay .m3dSteps {
    overflow: visible;
    overflow-wrap: anywhere;
  }
}
