/* ============================================================
   FINVILLAHUB P17 V10.2 — BULK QA / ISOLATION CORRECTION
   ADDITIVE PATCH ONLY
   Target: known Community → Opportunities bleed/overlap,
   container overflow, grid sizing and stacking isolation.
   ============================================================ */

html,body{max-width:100%;overflow-x:hidden!important}
.fv-app-main,.fv-container,.fv-home-shell{min-width:0!important;max-width:100%!important}

.fv-home-shell,
.fv-market-section,
.fv-learning-cards,
.fv-command-grid,
.fv-opportunity-section,
.fv-opportunity-grid,
.fv-guidance-strip,
.fv-bottom-strip,
.fv-footer{
  min-width:0!important;
  box-sizing:border-box!important;
}

.fv-command-grid,
.fv-opportunity-grid,
.fv-guidance-strip{
  width:100%!important;
  max-width:100%!important;
}

.fv-command-grid>*,
.fv-opportunity-grid>*,
.fv-guidance-strip>*{
  min-width:0!important;
  max-width:100%!important;
}

/* Community is its own paint/layout island. */
.fv-community{
  position:relative!important;
  isolation:isolate!important;
  contain:layout paint!important;
  overflow:hidden!important;
  min-width:0!important;
  max-width:100%!important;
  z-index:1!important;
}

.fv-community-bg{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  z-index:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
}

.fv-community-content,
.fv-community-stats{
  position:relative!important;
  z-index:2!important;
  min-width:0!important;
}

.fv-community-content>*,
.fv-community-stats>*{
  max-width:100%!important;
}

/* Opportunities are a separate paint/layout island. */
.fv-opportunity-section{
  position:relative!important;
  isolation:isolate!important;
  contain:layout paint!important;
  overflow:hidden!important;
  min-width:0!important;
  max-width:100%!important;
  z-index:2!important;
}

.fv-opportunity-grid{
  position:relative!important;
  z-index:2!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch!important;
}

.fv-op-card,
.fv-contribution-card{
  position:relative!important;
  isolation:isolate!important;
  contain:layout paint!important;
  overflow:hidden!important;
  min-width:0!important;
  max-width:100%!important;
}

.fv-op-card>*,
.fv-contribution-card>*{
  position:relative;
  z-index:2;
  min-width:0;
}

/* Prevent decorative pseudo-elements/backgrounds from escaping cards. */
.fv-op-card::before,
.fv-op-card::after,
.fv-contribution-card::before,
.fv-contribution-card::after{
  pointer-events:none!important;
  max-width:100%!important;
}

.fv-learning-cards{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  align-items:stretch!important;
}

.fv-image-card{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  isolation:isolate!important;
}

.fv-image-card img,
.fv-image-card .fv-image-bg,
.fv-image-card::before,
.fv-image-card::after{
  max-width:none!important;
}

/* Premium panel is isolated from adjacent decorative layers. */
.fv-premium-command{
  position:relative!important;
  isolation:isolate!important;
  contain:layout paint!important;
  overflow:hidden!important;
  min-width:0!important;
}

/* Desktop: prevent three-column command content from forcing overflow. */
@media (min-width:1151px){
  .fv-command-grid{
    grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) minmax(0,1fr)!important;
  }
}

/* Mid desktop: retain the two-column opportunity layout without clipping. */
@media (max-width:1150px) and (min-width:851px){
  .fv-command-grid{
    grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr)!important;
  }
  .fv-opportunity-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

/* Mobile: true reflow; no hidden horizontal spill. */
@media (max-width:850px){
  .fv-home-shell{
    overflow-x:clip!important;
  }
  .fv-command-grid{
    grid-template-columns:1fr!important;
  }
  .fv-opportunity-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media (max-width:520px){
  .fv-opportunity-grid{
    grid-template-columns:1fr!important;
  }
}
