XML 67 R60.htm IDEA: XBRL DOCUMENT
v3.25.3

Business Acquisitions - Additional Information (Details) - USD ($) $ in Thousands | 3 Months Ended | 9 Months Ended |  |  |  |
--- | --- | --- | --- | --- | --- | ---
Sep. 30, 2025 | Sep. 30, 2024 | Sep. 30, 2025 | Sep. 30, 2024 | Jul. 31, 2024 | May 31, 2024 | Feb. 28, 2024 | Jan. 31, 2024
Business Acquisition [Line Items] |  |  |  |  |  |  |  |  |
Transaction costs related to business combinations | [1] | $ 754 | $ 2,764 | $ 1,790 | $ 6,371 |  |  |  |
Acquisitions measurement period adjustments |  |  |  | 1,236 |  |  |  |  |
EPIC |  |  |  |  |  |  |  |  |
Business Acquisition [Line Items] |  |  |  |  |  |  |  |  |
Percentage of interests acquired |  |  |  |  |  |  |  |  | 100.00%
2DOT |  |  |  |  |  |  |  |  |
Business Acquisition [Line Items] |  |  |  |  |  |  |  |  |
Percentage of interests acquired |  |  |  |  |  |  |  | 100.00% |
Paragon |  |  |  |  |  |  |  |  |
Business Acquisition [Line Items] |  |  |  |  |  |  |  |  |
Percentage of interests acquired |  |  |  |  |  |  | 100.00% |  |
Spirit |  |  |  |  |  |  |  |  |
Business Acquisition [Line Items] |  |  |  |  |  |  |  |  |
Percentage of interests acquired |  |  |  |  |  | 100.00% |  |  |
EPIC, 2DOT, ETA, Paragon, Spirit and Origins |  |  |  |  |  |  |  |  |
Business Acquisition [Line Items] |  |  |  |  |  |  |  |  |
Revenue |  |  | 15,000 |  | 26,600 |  |  |  |
Pre-tax income (loss) |  |  | $ 3,000 |  | $ 5,400 |  |  |  |
EnvStd and IAG | 2026 Earn Out |  |  |  |  |  |  |  |  |
Business Acquisition [Line Items] |  |  |  |  |  |  |  |  |
Payment through cash or common stock |  |  |  | 10,200 |  |  |  |  |
Common Stock |  |  |  | 2,800 |  |  |  |  |
Business combination, earn-out payment, maximum |  | $ 23,400 |  | 23,400 |  |  |  |  |
Business combination, paid in cash |  |  |  | $ 10,400 |  |  |  |  |
[1] | Includes financial and tax diligence, consulting, legal, valuation, accounting, travel and acquisition-related incentives related to our acquisition and integration activity.

X
- Definition Business combination payment through cash or common stock. + References No definition available. + Details
Name: | meg_BusinessCombinationPaymentThroughCashOrCommonStock
Namespace Prefix: | meg_
Data Type: | xbrli:monetaryItemType
Balance Type: | credit
Period Type: | duration

X
- Definition Line items represent financial concepts included in a table. These concepts are used to disclose reportable information associated with domain members defined in one or many axes to the table. + References Reference 1: http://www.xbrl.org/2003/role/disclosureRef -Topic 350 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 4 -Subparagraph (a) -Publisher FASB -URI https://asc.fasb.org/1943274/2147482573/350-20-50-4 Reference 2: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 8 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-8 Reference 3: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 47 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-47 Reference 4: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 5 -Subparagraph (a) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-5 Reference 5: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (f)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 6: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (d)(1)(i) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 7: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (d)(1)(ii) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 8: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(3) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 9: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 10: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (d) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 11: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (d) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 12: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (a) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 13: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-2 Reference 14: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (c) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 15: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-2 Reference 16: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (a) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 17: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (f)(2) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 18: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (e)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 19: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 3 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-3 Reference 20: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 4A -Subparagraph (c) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-4A Reference 21: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 4 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-4 Reference 22: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 23: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 24: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(3) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 25: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 4A -Subparagraph (b) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-4A Reference 26: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (a)(3) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 27: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (a)(2) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 28: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 4A -Subparagraph (a) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-4A Reference 29: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 4 -Subparagraph (b) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-4 Reference 30: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(4) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 31: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(2) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 32: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 33: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (e)(2) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 34: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (c) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 35: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(2) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 36: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (a)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-1 Reference 37: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (g) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 38: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (g)(4) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 39: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (g)(3) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 40: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (g)(2) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 41: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (g)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 Reference 42: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (b) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 + Details
Name: | us-gaap_BusinessAcquisitionLineItems
Namespace Prefix: | us-gaap_
Data Type: | xbrli:stringItemType
Balance Type: | na
Period Type: | duration

X
- Definition Percentage of voting equity interest acquired in business combination. + References Reference 1: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 8 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-8 Reference 2: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 38 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-38 Reference 3: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (c) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 + Details
Name: | us-gaap_BusinessAcquisitionPercentageOfVotingInterestsAcquired
Namespace Prefix: | us-gaap_
Data Type: | dtr-types:percentItemType
Balance Type: | na
Period Type: | instant

X
- Definition Amount of expense for acquisition-related cost incurred to effect business combination. Includes, but is not limited to, finder's fee; advisory, legal, accounting, valuation, and other professional and consulting fees; and general administrative cost, including cost of maintaining internal acquisition department. + References Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 7 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-7 Reference 2: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 25 -Paragraph 23 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479405/805-10-25-23 + Details
Name: | us-gaap_BusinessCombinationAcquisitionRelatedCosts
Namespace Prefix: | us-gaap_
Data Type: | xbrli:monetaryItemType
Balance Type: | debit
Period Type: | duration

X
- Definition Amount of equity interests of the acquirer, including instruments or interests issued or issuable in consideration for the business combination. + References Reference 1: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 8 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-8 Reference 2: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 41 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-41 Reference 3: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-2 Reference 4: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(4) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 5: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 42 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-42 + Details
Name: | us-gaap_BusinessCombinationConsiderationTransferredEquityInterestsIssuedAndIssuable
Namespace Prefix: | us-gaap_
Data Type: | xbrli:monetaryItemType
Balance Type: | credit
Period Type: | duration

X
- Definition Maximum amount of estimate for undiscounted range of outcomes in contingent consideration arrangement in business combination. + References Reference 1: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 8 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-8 Reference 2: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 43 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-43 Reference 3: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-2 Reference 4: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (c)(3) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 + Details
Name: | us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh
Namespace Prefix: | us-gaap_
Data Type: | xbrli:monetaryItemType
Balance Type: | credit
Period Type: | instant

X
- Definition Amount of acquiree's earnings (loss) since acquisition date of business combination included in consolidated statement of income. + References Reference 1: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 8 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-8 Reference 2: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 49 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-49 Reference 3: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 3 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-3 Reference 4: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (h)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 + Details
Name: | us-gaap_BusinessCombinationProFormaInformationEarningsOrLossOfAcquireeSinceAcquisitionDateActual
Namespace Prefix: | us-gaap_
Data Type: | xbrli:monetaryItemType
Balance Type: | credit
Period Type: | duration

X
- Definition Amount of acquiree's revenue since acquisition date of business combination included in consolidated statement of income. + References Reference 1: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 8 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-8 Reference 2: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 49 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-49 Reference 3: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 3 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-3 Reference 4: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (h)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-2 + Details
Name: | us-gaap_BusinessCombinationProFormaInformationRevenueOfAcquireeSinceAcquisitionDateActual
Namespace Prefix: | us-gaap_
Data Type: | xbrli:monetaryItemType
Balance Type: | credit
Period Type: | duration

X
- Definition Amount of increase (decrease) from foreign currency translation and measurement period adjustments of asset representing future economic benefit arising from other asset acquired in business combination or from joint venture formation or both, that is not individually identified and separately recognized. + References Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 350 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Publisher FASB -URI https://asc.fasb.org/1943274/2147482573/350-20-50-1 Reference 2: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 4 -Subparagraph (b) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-4 Reference 3: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 20 -Name Accounting Standards Codification -Section 50 -Paragraph 4A -Subparagraph (c) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479907/805-20-50-4A Reference 4: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 5 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-5 Reference 5: http://www.xbrl.org/2009/role/commonPracticeRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 25 -Paragraph 16 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479405/805-10-25-16 + Details
Name: | us-gaap_GoodwillTranslationAndPurchaseAccountingAdjustments
Namespace Prefix: | us-gaap_
Data Type: | xbrli:monetaryItemType
Balance Type: | debit
Period Type: | duration

X
- Definition The cash outflow associated with the acquisition of business during the period. The cash portion only of the acquisition price. + References Reference 1: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 8 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479328/805-10-50-8 Reference 2: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 10 -Name Accounting Standards Codification -Section 55 -Paragraph 41 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479303/805-10-55-41 Reference 3: http://www.xbrl.org/2003/role/exampleRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-2 Reference 4: http://www.xbrl.org/2003/role/disclosureRef -Topic 805 -SubTopic 30 -Name Accounting Standards Codification -Section 50 -Paragraph 1 -Subparagraph (b)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147479581/805-30-50-1 Reference 5: http://fasb.org/us-gaap/role/ref/legacyRef -Name Accounting Standards Codification -Topic 230 -SubTopic 10 -Section 45 -Paragraph 13 -Subparagraph (b) -Publisher FASB -URI https://asc.fasb.org/1943274/2147482740/230-10-45-13 + Details
Name: | us-gaap_PaymentsToAcquireBusinessesGross
Namespace Prefix: | us-gaap_
Data Type: | xbrli:monetaryItemType
Balance Type: | credit
Period Type: | duration

X
- Details
Name: | us-gaap_BusinessAcquisitionAxis=meg_EpicEnvironmentalPtyLTDMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | us-gaap_BusinessAcquisitionAxis=meg_TwoDotConsultingLlcMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | us-gaap_BusinessAcquisitionAxis=meg_ParagonSoilAndEnvironmentalConsultingIncMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | us-gaap_BusinessAcquisitionAxis=meg_SpiritEnvironmentalLlcMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | us-gaap_BusinessAcquisitionAxis=meg_EpicEnvironmentalPtyLTDTwoDotConsultingLLCEngineeringTechnicalAssociatesIncParagonSoilAndEnvironmentalConsultingIncSpiritEnvironmentalLLCAndOriginsLaboratoryIncMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | us-gaap_BusinessAcquisitionAxis=meg_EnvironmentalStandardsIncAndIndustrialAutomationGroupIncMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | us-gaap_ContingentConsiderationByTypeAxis=meg_TwoThousandAndTwentySixEarnOutsMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |