/* V17.7.4.407 — Tablet/iPad shell repair.
   Desktop geometry is intentionally untouched; these rules apply only at 1200px and below. */
@media screen and (max-width:1200px){
  :root{
    --v17-tablet-drawer:min(360px,86vw);
    --v17-left:var(--v17-tablet-drawer);
    --v17-right:var(--v17-tablet-drawer);
    --v17-right-drawer:var(--v17-tablet-drawer);
    --side:0px;
  }

  html,body{width:100%;max-width:100%;overflow-x:hidden!important}
  body.v17-tablet-layout .app:not(.access-mode),
  body.v17-tablet-layout .shell{width:100vw!important;min-width:0!important;max-width:100vw!important}

  /* Both navigation lanes are overlays on tablet, leaving the workspace full width. */
  body.v17-sidebar-drawer .sidebar,
  body.v17-sidebar-drawer.v17-immersive .sidebar,
  body.v17-enhanced.v17-sidebar-drawer.v17-brand-in-topbar .sidebar{
    width:var(--v17-tablet-drawer)!important;
    min-width:0!important;
    max-width:var(--v17-tablet-drawer)!important;
  }
  html body.v17-left-open button.v17-edge-handle.v17-left-handle{
    left:calc(var(--v17-tablet-drawer) - var(--structune-drawer-opener-width,27px))!important;
  }
  body.v17-right-drawer-page .side-panels,
  body.v17-immersive .side-panels,
  body.v17-drawing-stage .side-panels,
  body.v17-ar-active #view-ar-view .ar-view-side-panels,
  body.v17-ar-site-setout-constrained .ar-site-setout-side{
    width:var(--v17-tablet-drawer)!important;
    min-width:0!important;
    max-width:var(--v17-tablet-drawer)!important;
  }
  html body.v17-right-open button.v17-edge-handle.v17-right-handle{
    right:var(--v17-tablet-drawer)!important;
  }

  /* Remove desktop-only 360px reserved lanes from every SPA list page. */
  body[class*="-constrained"] .content{left:0!important;right:0!important;width:100vw!important;max-width:100vw!important}
  body[class*="-constrained"] :is(
    #view-dashboard,#view-assemblies,#view-single-parts,#view-cold-rolled,
    #view-fasteners,#view-production,#view-loads,#view-reports,
    #view-support,#view-about,#view-info,#view-drawings,#view-models
  ){
    left:0!important;
    right:0!important;
    width:100vw!important;
    max-width:100vw!important;
    min-width:0!important;
  }

  .content{min-width:0!important;padding-left:18px!important;padding-right:18px!important}
  .workspace{min-width:0!important;max-width:100vw!important}
  :is(.v12-panel,.table-wrap,.assemblies-table-panel,.single-parts-table-panel,.production-table-panel){max-width:100%!important;overflow-x:auto!important}
  :is(table,.data-table){max-width:none}
  :is(.v12-toolbar,.production-filter-toolbar,.production-actions){max-width:100%!important}

  /* Keep the project header usable in both iPad orientations. */
  .topbar{width:100%!important;min-width:0!important;padding-left:14px!important;padding-right:14px!important}
  .topbar .project-line{min-width:0!important;overflow:hidden!important}
  .v17-project-name-inline{max-width:34vw!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .m01-title-line{gap:12px!important;flex-wrap:wrap!important}
  .m01-assembly-cross-nav{gap:12px!important;overflow-x:auto!important;max-width:100%!important}

  /* Touch-sized controls and safe horizontal scrolling for dense engineering tables. */
  button,select,input[type="checkbox"]{touch-action:manipulation}
  .v17-edge-handle{z-index:3001!important}
  .sidebar{z-index:3000!important}
}

@media screen and (max-width:820px){
  .content{padding-left:12px!important;padding-right:12px!important}
  .v17-project-name-inline{display:none!important}
  .m01-assembly-cross-nav{width:100%!important}
  .m01-assembly-cross-nav a{font-size:10px!important}
  .v17-bottom-copyright{max-width:calc(100vw - 24px);overflow:hidden;text-overflow:ellipsis}
}
