/* MERITIQA V5.0 — workspace-only alignment; home CSS and templates unchanged.
   Homepage content geometry: .m4-home .m2-container max-width:1400px;
   gutter clamp(18px,4.7vw,70px); header 72px desktop / 65px narrow mobile. */
body.m5-workspace-view {
 --m5-max-width:1400px;
 --m5-gutter:clamp(18px,4.7vw,70px);
 --m5-ink:var(--m2-ink,#142d23);
 --m5-line:var(--m2-stroke,#dee9df);
 --m5-background:var(--m2-ivory,#f7f9f6);
}
body.m5-workspace-view .m2-content.m5-workspace-content {
 max-width:var(--m5-max-width);
 width:100%;
 padding-inline:var(--m5-gutter);
 padding-block:clamp(28px,4vw,62px) clamp(48px,6vw,90px);
 margin-inline:auto;
 min-width:0;
}
body.m5-workspace-view .m5-workspace-article {max-width:none;width:100%;min-width:0;}
body.m5-workspace-view .m5-workspace-article > :is(div,section,article){max-width:100%;min-width:0;}
body.m5-workspace-view .m5-workspace-content :is(img,video,iframe){max-width:100%;}
body.m5-workspace-view :is(.mqlo-premium-container,.mqc-premium-page-shell,.mqcv-shell,.m3-shell) {
 box-sizing:border-box;
 max-width:var(--m5-max-width);
 width:100%;
 margin-inline:auto;
 padding-inline:var(--m5-gutter);
 min-width:0;
}
/* Application shells nested inside the standard theme container must not reapply gutters. */
body.m5-workspace-view .m5-workspace-content :is(.mqcv-shell,.mqlo-premium-container) {
 width:100%;max-width:100%;padding-inline:0;margin-inline:0;
}
body.m5-workspace-view .mqc-premium-page-shell {width:100%;}
body.m5-workspace-view .m5-studio-surface {max-width:100%;min-width:0;}
body.m5-workspace-view .m3-app {min-height:calc(100dvh - 72px);}
body.m5-workspace-view .m3-shell {max-width:var(--m5-max-width);}
body.m5-workspace-view .m3-app .m3-bar {padding-inline:var(--m5-gutter);}
body.m5-workspace-view .m5-studio-surface .m3-bar .m3-brand {
 display:none; /* Global MERITIQA brand is already in the persistent site header. */
}
body.m5-workspace-view .m5-studio-surface .m3-bar {min-height:57px;}
body.m5-workspace-view .m5-studio-surface .m3-shell {margin-inline:auto;}
body.m5-workspace-view .m5-studio-surface .m3-app {background:var(--m5-background);}
@media (max-width:800px){
 body.m5-workspace-view .m2-content.m5-workspace-content{padding-top:24px;padding-bottom:52px;}
 body.m5-workspace-view .m5-studio-surface .m3-bar{padding-inline:var(--m5-gutter);}
}
@media (max-width:650px){
 body.m5-workspace-view .m3-app{min-height:calc(100dvh - 65px);}
 body.m5-workspace-view :is(.mqc-premium-page-shell,.m3-shell){padding-inline:var(--m5-gutter);}
}
/* Preserve functional tables by scrolling within their own region instead of page overflow. */
body.m5-workspace-view .m5-workspace-content table{max-width:100%;}
body.m5-workspace-view .m5-workspace-content :is(.mqcv-card,.mqcv-grid,.mqlo-job,.mqoi13-panel){min-width:0;}


/* V5.1 — homepage content is 1400px, header is the unchanged 1450px theme header.
   Keep header/footer on their existing homepage grid; align inner workspaces only. */
body.m5-workspace-view .m2-content.m5-workspace-content {
  max-width:1400px !important;
  padding-inline:clamp(18px,4.7vw,70px)!important;
}
body.m5-workspace-view .m5-workspace-article {max-width:100%!important;}
/* Public inner sections use the homepage's 1400px CONTENT grid; header remains 1450px. */
body.m2-body:not(.home) #main-content .m2-container {max-width:1400px;}
/* Command Center is rendered via its existing premium template and not page.php. */
body.mqc-premium-page .mqc-premium-page-shell {
  box-sizing:border-box!important;max-width:1400px!important;width:100%!important;
  margin-inline:auto!important;padding-inline:clamp(18px,4.7vw,70px)!important;
}
/* Full-width Live Opportunities template retains its existing theme header. */
body.m5-workspace-view .mqlo-premium-page .mqlo-premium-container {
  box-sizing:border-box!important;max-width:1400px!important;width:100%!important;
  margin-inline:auto!important;padding-inline:clamp(18px,4.7vw,70px)!important;
}
/* Nested CV content must not be given a second set of horizontal gutters. */
body.m5-workspace-view .m5-workspace-article .mqcv-shell {
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;
  margin:0 auto 70px!important;padding-inline:0!important;
}
body.m5-workspace-view .m5-workspace-article .mqcv-shell > * {max-width:100%;min-width:0;}
body.m5-workspace-view .m5-workspace-article .mqcv-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
body.m5-workspace-view .m5-workspace-article .mqcv-hero {min-width:0;}
/* Remove accidental sideways page scrolling without clipping functional in-panel controls. */
body.m5-workspace-view .m2-content, body.m5-workspace-view .m5-workspace-article {min-width:0;}
body.m5-workspace-view :is(.mqlo-job,.mqc-premium-page-shell,.mqcv-card,.mqcv-record) {min-width:0;}
@media(max-width:850px){body.m5-workspace-view .m5-workspace-article .mqcv-grid {grid-template-columns:minmax(0,1fr);}}
@media(max-width:650px){
 body.mqc-premium-page .mqc-premium-page-shell,
 body.m5-workspace-view .mqlo-premium-page .mqlo-premium-container,
 body.m5-workspace-view .m2-content.m5-workspace-content {padding-inline:18px!important;}
}



/* MERITIQA 5.9 — Classroom shell/header alignment. Homepage remains unchanged.
   MERITIQA's shared header and home use the same 1400px / 4.7vw grid.
   The Studio plugin has separate 1530px / 3vw desktop defaults: override them
   only on the integrated Classroom page, not in standalone or other pages. */
body.m2-body.m2-studio-page.m5-workspace-view .m5-studio-surface #meritiqa-studio-root .m3-app .m3-shell {
  box-sizing:border-box;
  width:100% !important;
  max-width:1400px !important;
  margin-inline:auto !important;
  padding-inline:clamp(18px,4.7vw,70px) !important;
  min-width:0;
}
/* Keep the white contextual toolbar full-width while making its content
   start/end on the same grid line as the shared MERITIQA header. */
body.m2-body.m2-studio-page.m5-workspace-view .m5-studio-surface #meritiqa-studio-root .m3-app .m3-bar {
  box-sizing:border-box;
  width:100%;
  padding-inline:max(clamp(18px,4.7vw,70px),calc((100% - 1400px)/2 + clamp(18px,4.7vw,70px))) !important;
}
/* Keep relevant controls inside a narrow viewport; preserve the original
   Studio card geometry and application workflow. */
@media(max-width:800px){
  body.m2-body.m2-studio-page.m5-workspace-view .m5-studio-surface #meritiqa-studio-root .m3-app .m3-bar {
    gap:8px;
  }
}


/* MERITIQA 5.10 — shared CONTENT START EDGE on existing application routes.
   Maintain the homepage design unchanged. This rule ties the theme header and
   both external full-width plugin layouts to the same max-width / gutters.
   The important flags prevent plugin CSS enqueue order from reintroducing
   competing outer widths; all inner application design remains native. */
body.m2-body.m5-workspace-view .m2-header > .m2-head-inner.m2-container,
body.m2-body.m5-workspace-view #mqpr-fullpage > #mqpr-app.mqpr-app,
body.m2-body.m5-workspace-view #mqil-main.mqil-main {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1400px !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: clamp(18px, 4.7vw, 70px) !important;
  padding-right: clamp(18px, 4.7vw, 70px) !important;
}
/* The Interview shell originally uses padding: vertical 0, so preserve its
   original vertical rhythm while applying the shared horizontal alignment. */
body.m2-body.m5-workspace-view #mqil-main.mqil-main {
  padding-top: clamp(32px, 4vw, 66px) !important;
  padding-bottom: 48px !important;
}
@media (max-width: 800px) {
  body.m2-body.m5-workspace-view #mqil-main.mqil-main {
    padding-top: 26px !important;
    padding-bottom: 44px !important;
  }
}
/* Strictly no homepage selectors: its existing measured header/body baseline
   is never changed by this release. */
