/* MMW-COMPANY · Responsive layout normalization
   Shared corrections for desktop, tablet and smartphone widths.
   Page-specific visual identity remains defined by each page stylesheet. */
:where(*, *::before, *::after){box-sizing:border-box}
html{max-width:100%;overflow-x:clip}
body{max-width:100%;overflow-x:clip}
:where(main,header,footer,section,article,aside,nav,form,fieldset){min-width:0}
:where(h1,h2,h3,h4,p,a,button,label,small,strong,li,td,th){overflow-wrap:anywhere}
:where(img,picture,video,canvas,iframe){max-width:100%}
img,picture,video,canvas{height:auto}
:where(input,select,textarea,button){max-width:100%;min-width:0}
:where(textarea){resize:vertical}
:where(pre,code){max-width:100%;overflow-x:auto;white-space:pre}
:where(table){max-width:100%;border-collapse:collapse}
:where(th,td){overflow-wrap:anywhere}
:where(.wrap,.container,.shell,.content,.page,.panel,.card,.box,.heroGrid>*,
       .sectionHead>* ,.finalGrid>* ,.layout>* ,.flow>* ,.scan>* ,.matrix>*,
       .catalog>* ,.projects>* ,.roles>* ,.steps>* ,.choiceGrid>* ,.riskRail>*){min-width:0}
:where(.wrap,.container,.shell,.content,.page){max-width:100%}
:where(.heroGrid,.finalGrid,.flow,.ladder,.matrix,.scan,.layout,.introGrid,
       .vacancyPanel,.process,.twoCol,.two-column,.contentGrid,.content-grid){min-width:0}
:where(.actions,.formActions,.form-actions,.heroMeta,.tags,.roles,.filters,
       .legal-links,.footer,.footer .wrap){min-width:0}
:where(.btn,.cta,.mailBtn,.mini,.filter,.tag){max-width:100%;white-space:normal;text-align:center}
:where(.field input,.field textarea,.field select,.formgrid input,.formgrid textarea,
       .formgrid select){width:100%;min-width:0}
:where(.drawer,.modal,.agroModal,.box){max-width:100vw}
:where(.drawer .box,.modal .box){overflow-x:hidden}
:where(.project,.card,.choice,.step,.role,.panel,.fact,.doc){overflow-wrap:anywhere}

@media (max-width:1100px){
  .projects{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .choiceGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .riskRail{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .heroGrid,.finalGrid,.sectionHead,.sh{gap:28px}
}
@media (max-width:900px){
  .heroGrid,.finalGrid,.flow,.ladder,.matrix,.scan,.layout,.introGrid,
  .vacancyPanel,.process,.twoCol,.two-column,.contentGrid,.content-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .hero{min-height:0!important}
  .heroGrid{gap:28px!important}
  .projects{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .steps,.stages{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .stages .stage.main{grid-column:1/-1}
  .sectionHead,.sh{align-items:flex-start!important}
  .sectionHead p,.sh p{max-width:100%}
  .footer .wrap{flex-wrap:wrap}
  .catalog-tools{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:700px){
  .wrap{max-width:100%}
  .catalog,.roles,.principles,.facts,.meta,.choices{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .projects{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .riskRail{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .section,.final{padding-top:clamp(38px,8vw,64px)!important;padding-bottom:clamp(38px,8vw,64px)!important}
  .hero{padding-top:clamp(34px,7vw,54px)!important;padding-bottom:clamp(30px,6vw,48px)!important}
  .sectionHead,.sh{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:12px!important}
  .sectionHead h2,.sh h2{max-width:100%}
  .footer .wrap{flex-direction:column;align-items:flex-start}
  .catalog-tools{grid-template-columns:minmax(0,1fr)!important}
  .catalog-search,.catalog-results{grid-column:auto!important}
}
@media (max-width:520px){
  .catalog,.projects,.roles,.principles,.facts,.meta,.choices,.riskRail,
  .steps,.stages,.choiceGrid,.formgrid,.calc,.catalog-tools{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .stages .stage.main{grid-column:auto}
  .actions,.formActions,.form-actions{display:flex;flex-direction:column;align-items:stretch}
  .actions>* ,.formActions>* ,.form-actions>*{width:100%;max-width:100%}
  .row{min-width:0}
  .panel,.box,.result,.engine{max-width:100%;padding:clamp(15px,4vw,22px)}
  .hero h1,h1{font-size:clamp(34px,11vw,56px)}
  .lead{font-size:clamp(14px,4vw,16px)}
  .fieldMap{height:min(76vw,310px)!important;min-height:230px}
  .orbit{max-width:100%;overflow:hidden}
  .orbitNode{max-width:68px;max-height:68px;font-size:8px}
  .core{width:94px;height:94px}
  .drawer .box,.agroModalCard{width:100%;max-width:100%;border-radius:22px 22px 0 0}
  :where(table){display:block;width:100%;overflow-x:auto}
  .nav{max-width:100%}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}


/* MMW-COMPANY responsive system v2 — shared page families */
:root{
  --mmw-page-gutter:clamp(14px,3.2vw,36px);
  --mmw-content-width:1240px;
}
html{-webkit-text-size-adjust:100%;scroll-padding-top:clamp(64px,8vw,88px)}
body{min-width:0}
:where(.grid,.grid2,.grid3,.grid4,.grid-2,.grid-3,.grid-4,
  .riskgrid,.riskGrid,.formatGrid,.scenarioGrid,.processGrid,
  .site-analytics-cards,.detail-grid,.formGrid,.formgrid,
  .form-grid,.statsGrid,.stats-grid,.dashboardGrid,.dashboard-grid,
  .adminGrid,.admin-grid,.cardsGrid,.cards-grid,.featureGrid,.feature-grid){
  min-width:0;
}
:where(.grid,.grid2,.grid3,.grid4,.grid-2,.grid-3,.grid-4,
  .riskgrid,.riskGrid,.formatGrid,.scenarioGrid,.processGrid,
  .site-analytics-cards,.detail-grid,.formGrid,.formgrid,
  .form-grid,.statsGrid,.stats-grid,.dashboardGrid,.dashboard-grid,
  .adminGrid,.admin-grid,.cardsGrid,.cards-grid,.featureGrid,.feature-grid)>*{
  min-width:0;max-width:100%;
}
:where(.wrap,.container,.shell,.content,.inner,.page,.pageWrap,.page-wrap){
  width:min(calc(100% - 2*var(--mmw-page-gutter)),var(--mmw-content-width));
  max-width:100%;
  margin-left:auto;margin-right:auto;
}
:where(.table-scroll,.table-wrap,.table-responsive,.admin-table-wrap,
  .analytics-table-wrap,.history-table-wrap,.tableContainer,.table-container){
  width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;
}
:where(.modal,.drawer,.sheet,.dialog,.popup,.overlay-panel){
  max-width:100vw;max-width:100dvw;
}
:where(.modal-content,.drawer-content,.dialog-content,.popup-content,
  .sheet-content,.contactCard,.formCard,.adminCard){
  min-width:0;max-width:100%;
}
:where(.form,.formGrid,.formgrid,.form-grid,.field,.formField,.contactField){
  min-width:0;
}
:where(.form input,.form select,.form textarea,.formGrid input,.formGrid select,
  .formGrid textarea,.formgrid input,.formgrid select,.formgrid textarea,
  .form-grid input,.form-grid select,.form-grid textarea){
  width:100%;min-width:0;max-width:100%;
}
:where(button,a[role="button"],input[type="button"],input[type="submit"]){
  touch-action:manipulation;
}
@media (min-width:1025px){
  :where(.wrap,.container,.shell,.content,.inner,.page,.pageWrap,.page-wrap){
    max-width:var(--mmw-content-width);
  }
}
@media (min-width:701px) and (max-width:1024px){
  :where(.grid,.grid2,.grid3,.grid4,.grid-2,.grid-3,.grid-4,
    .catalog,.projects,.steps,.riskgrid,.riskGrid,.choiceGrid,
    .formatGrid,.scenarioGrid,.processGrid,.introGrid,
    .site-analytics-cards,.detail-grid,.formGrid,.formgrid,.form-grid,
    .statsGrid,.stats-grid,.dashboardGrid,.dashboard-grid,
    .adminGrid,.admin-grid,.cardsGrid,.cards-grid,.featureGrid,.feature-grid){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  :where(.heroGrid,.layout,.formLayout,.finalGrid,.ctaGrid,
    .twoCol,.two-column,.contentGrid,.content-grid){
    grid-template-columns:minmax(0,1fr)!important;
  }
  :where(.nav,.header-row,.headerRow,.toolbar,.topbar){
    min-width:0;max-width:100%;
  }
  :where(.section,.section-inner,.hero,.page-section){
    min-width:0;
  }
}
@media (max-width:700px){
  :root{--mmw-page-gutter:16px}
  :where(.wrap,.container,.shell,.content,.inner,.page,.pageWrap,.page-wrap){
    width:calc(100% - 2*var(--mmw-page-gutter));
  }
  :where(.grid,.grid2,.grid3,.grid4,.grid-2,.grid-3,.grid-4,
    .riskgrid,.riskGrid,.formatGrid,.scenarioGrid,.processGrid,
    .site-analytics-cards,.detail-grid,.formGrid,.formgrid,.form-grid,
    .statsGrid,.stats-grid,.dashboardGrid,.dashboard-grid,
    .adminGrid,.admin-grid,.cardsGrid,.cards-grid,.featureGrid,.feature-grid){
    grid-template-columns:minmax(0,1fr)!important;
  }
  :where(.sectionHead,.section-head,.sh,.sectionTitle,.section-title){
    min-width:0;max-width:100%;align-items:flex-start;
  }
  :where(.actions,.contactActions,.formActions,.form-actions,.button-row,.buttonRow){
    min-width:0;max-width:100%;flex-wrap:wrap;
  }
  :where(.actions>*,.contactActions>*,.formActions>*,.form-actions>*){
    max-width:100%;
  }
  :where(input,select,textarea){font-size:16px}
  :where(button,a[role="button"],input[type="button"],input[type="submit"]){
    min-height:42px;
  }
}
@media (max-width:520px){
  :where(.catalog,.projects,.roles,.principles,.facts,.meta,.choices,
    .steps,.stages,.choiceGrid,.calc,.catalog-tools){
    grid-template-columns:minmax(0,1fr)!important;
  }
  :where(.nav,.header-row,.headerRow,.toolbar,.topbar){
    flex-wrap:wrap;min-width:0;
  }
  :where(.footer .wrap){width:calc(100% - 28px)}
  :where(.modal,.drawer,.sheet,.dialog,.popup,.overlay-panel){
    padding-left:max(10px,env(safe-area-inset-left));
    padding-right:max(10px,env(safe-area-inset-right));
  }
  :where(table){display:block;width:100%;overflow-x:auto}
  :where(th,td){max-width:72vw}
}
@media (orientation:landscape) and (max-height:520px) and (max-width:950px){
  :where(.modal,.drawer,.sheet,.dialog,.popup,.overlay-panel){
    max-height:100dvh;overflow-y:auto;
  }
  :where(.hero){min-height:0}
}


/* Project detail overlays must remain above the sticky shared header and menu. */
body.mmw-project-page .drawer.open,body.mmw-project-page .formatModal.open,body.mmw-project-page .agroModal.open,body.mmw-project-page .logModal.open,body.mmw-project-page .modal.open,body.mmw-project-page [role="dialog"].open{z-index:1400!important}
