/* StroyKalk v838 — production hardening.
   Final containment after semantic/data-loop rollout. No calculation or SEO text changes. */

/* Semantic UX must remain a bounded user-facing component, not an ad host. */
:is([data-semantic-ux],[data-semantic-tail],[data-semantic-help-v834],[data-functional-ux],
    [data-pto-semantic-ux-v835],[data-semantic-secondary-v836],[data-intent-guard],
    [data-semantic-surface],[data-semantic-cluster]){
  box-sizing:border-box;max-width:100%;min-width:0;overflow-wrap:anywhere;
}
:is([data-semantic-ux],[data-semantic-tail],[data-semantic-help-v834],[data-functional-ux],
    [data-pto-semantic-ux-v835],[data-semantic-secondary-v836],[data-intent-guard],
    [data-semantic-surface],[data-semantic-cluster]) :is(img,svg,canvas){max-width:100%;}

/* v838: v129 deliberately detached the calculator rail from grid flow so ads
   cannot manufacture page height. v753 paint containment loaded later and
   accidentally changed that rail back to position:relative. Restore the
   detached geometry while retaining clipping/paint isolation. */
@media (min-width:1200px){
  html.calc-ad-layout-v112 .calc-ad-shell-v112{position:relative!important;}
  html.calc-ad-layout-v112 .calc-ad-shell-v112 > .calc-ad-rail-v112{
    position:absolute!important;
    inset:0 auto auto 0!important;
    width:var(--calc-rail-width,clamp(245px,16vw,300px))!important;
    min-width:0!important;
    max-width:var(--calc-rail-width,clamp(245px,16vw,300px))!important;
    margin:0!important;
    align-self:auto!important;
    overflow:clip!important;
    contain:layout paint!important;
    isolation:isolate!important;
  }
}

/* At tablet/mobile widths the rail is never allowed to reserve hidden space. */
@media (max-width:1199px){
  html.calc-ad-layout-v112 .calc-ad-shell-v112 > .calc-ad-rail-v112{
    display:none!important;position:static!important;width:auto!important;max-width:none!important;
    height:0!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important;
  }
}

/* Interactive SEO/UX helpers and ads are not document output. */
@media print{
  .site-ad-v259,.calc-ad-rail-v112,[data-ad-rail],
  [data-semantic-ux],[data-semantic-tail],[data-semantic-help-v834],[data-functional-ux],
  [data-pto-semantic-ux-v835],[data-semantic-secondary-v836],[data-intent-guard],
  [data-semantic-surface],[data-semantic-cluster]{display:none!important;}
}
