/* XY STUDIO V15 — Release 4.2.9
   Mobile/layout QA fixes from user QA document.
   Loaded last. Fixes structural causes; no page-specific hacks.
*/

/* 1. Nested service containers: keep one real grid instead of shrinking the inner container. */
.container .container{
  width:auto !important;
  max-width:none !important;
  margin-inline:0 !important;
}

/* 2. Prevent layout primitives from forcing horizontal overflow. */
.grid,.grid2,.grid3,.grid4,.grid5,
.section-head,.seo-grid,.editorial,.path,
.v15-workflow,.service-path-workflow,
.leadbox,.rx20-scoreboard,.rx20-finding,
.rx20-matrix-grid,.rx20-preview-grid,
.rx20-price-card,.rx20-out{
  min-width:0;
}

.grid > *, .grid2 > *, .grid3 > *, .grid4 > *, .grid5 > *,
.section-head > *, .seo-grid > *, .editorial > *, .path > *,
.v15-workflow > *, .service-path-workflow > *,
.leadbox > *, .rx20-scoreboard > *, .rx20-finding > *,
.rx20-matrix-grid > *, .rx20-preview-grid > *,
.rx20-price-card > *, .rx20-out > *{
  min-width:0;
  
}

/* 3. System-wide service/workflow vertical dividers must not survive mobile collapse. */
@media (max-width:700px){
  .home-work .step + .step{
    border-left:0 !important;
  }
  .service-workflow-section .service-path-workflow .step + .step{
    border-left:0 !important;
  }
}

/* 4. Revenue X-Ray: later desktop rules in the legacy component stack were
      overriding the earlier mobile rules. Re-assert the intended mobile stack. */
@media (max-width:700px){
  .rx20-scoreboard{
    grid-template-columns:1fr !important;
    padding:22px !important;
    border-radius:22px;
  }
  .rx20-score-main{
    min-width:0;
    border-right:0 !important;
    border-bottom:1px solid var(--line) !important;
    padding:0 0 28px !important;
  }
  .rx20-risk-summary{
    min-width:0;
    padding:4px 0 0 !important;
  }
  .rx20-risk-head{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }
  .rx20-risk-item{
    min-width:0;
  }

  .rx20-funnel{
    grid-template-columns:1fr !important;
  }
  .rx20-node{
    border-right:0 !important;
  }

  .rx20-leakage-workflow,
  .rx20-how .rx20-workflow{
    grid-template-columns:1fr !important;
  }

  .rx20-out{
    grid-template-columns:1fr !important;
    gap:10px;
    margin-top:28px !important;
  }

  .rx20-price-card{
    grid-template-columns:1fr !important;
    gap:30px;
  }
  .rx20-price-side{
    border-left:0 !important;
    border-top:1px solid #363633 !important;
    padding:28px 0 0 !important;
  }
}

/* 5. The black "НЕ ВХОДИТ" block is a normal section element, not an
      attached child. Give it the same vertical rhythm on desktop and mobile. */
.rx20-out{
  margin-top:15px !important;
  background: #fff;
  border: 1px solid var(--v14-line);
}

@media (max-width:700px){
  .rx20-out{margin-top:28px !important;}
}

/* 6. Final media safety. */
@media (max-width:700px){
  img,svg,video,canvas,iframe{max-width:100%;}
  input,select,textarea{max-width:100%;}
  .actions,.case-actions-inline,.leadbox-right{min-width:0;}
  .actions .btn,.case-actions-inline .btn,.leadbox .btn{max-width:100%;}
}

@media (max-width:380px){
  .rx20-scoreboard{padding:18px !important;}
}
