/* 1440MM v2.99Z GLOBAL LAYOUT / BOX STABILITY
   Scope: sections, shells, cards, sideboxes, grids and CTA blocks.
   Does not control header/preheader/chrome state or scroll behavior. */

:root{
  --layout-gap-xs:clamp(8px,1vw,12px);
  --layout-gap-sm:clamp(12px,1.35vw,16px);
  --layout-gap-md:clamp(16px,2vw,24px);
  --layout-gap-lg:clamp(24px,3vw,36px);
  --layout-gap-xl:clamp(32px,4vw,52px);
  --section-pad-y:clamp(58px,7vw,94px);
  --section-pad-y-compact:clamp(38px,5vw,66px);
  --card-pad:clamp(18px,2.2vw,28px);
  --card-pad-lg:clamp(22px,2.8vw,34px);
  --card-radius:24px;
  --shell-safe-x:clamp(18px,4vw,34px);
  --layout-shell-max:var(--shell,1180px);
}

*,
*::before,
*::after{
  box-sizing:border-box;
}

html,
body{
  max-width:100%;
  overflow-x:clip;
}

main,
section,
article,
aside,
nav,
div{
  min-width:0;
}

img,
svg,
video,
canvas{
  max-width:100%;
}

main > .section,
.section{
  padding-top:var(--section-pad-y);
  padding-bottom:var(--section-pad-y);
}

.section + .section{
  margin-top:0;
}

.shell{
  width:min(var(--layout-shell-max), calc(100% - (var(--shell-safe-x) * 2)));
  max-width:var(--layout-shell-max);
  margin-left:auto;
  margin-right:auto;
  min-width:0;
}

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:var(--layout-gap-lg);
  margin-bottom:var(--layout-gap-lg);
  min-width:0;
}

.section-head > *,
.two-col > *,
.hero-grid > *,
.card-grid > *,
.hero-signals > *,
.risk-stack > *,
.footer-std-cta > *,
.pwa-inline-card > *,
.precision-pwa-card > *,
.qr-premium-card > *{
  min-width:0;
}

.two-col,
.hero-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,.82fr);
  gap:var(--layout-gap-xl);
  align-items:start;
}

.card-grid,
.grid,
.cards-grid,
.link-grid,
.service-grid,
.benefit-grid,
.feature-grid,
.scenario-grid,
.reference-grid,
.price-grid,
.qr-premium-grid{
  display:grid;
  gap:var(--layout-gap-md);
  min-width:0;
}

.card-grid{
  grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));
}

.hero-signals,
.risk-stack,
.link-stack,
.info-stack,
.process-stack,
.pwa-benefits,
.footer-std-cta-actions{
  gap:var(--layout-gap-sm);
  min-width:0;
}

.hero-signals{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));
}

.risk-stack,
.link-stack,
.info-stack,
.process-stack{
  display:grid;
}

.card,
.info-card,
.risk-card,
.signal-card,
.link-card,
.sidebar-card,
.prikaz-panel,
.pwa-inline-card,
.precision-pwa-card,
.qr-premium-card,
.process-card,
.scenario,
.feature-card,
.benefit-card,
.price-card,
.reference-card,
.rail-card,
.contact-card,
.service-card,
.scope-edu-card{
  box-sizing:border-box;
  min-width:0;
  overflow-wrap:anywhere;
  word-break:normal;
}

.card,
.info-card,
.risk-card,
.link-card,
.sidebar-card,
.process-card,
.scenario,
.feature-card,
.benefit-card,
.price-card,
.reference-card,
.rail-card,
.contact-card,
.service-card{
  padding:var(--card-pad);
  border-radius:var(--card-radius);
}

.signal-card{
  padding:clamp(14px,1.7vw,20px);
  border-radius:18px;
}

.prikaz-panel,
.pwa-inline-card,
.precision-pwa-card,
.qr-premium-card,
.scope-edu-card{
  padding:var(--card-pad-lg);
  border-radius:clamp(22px,2vw,30px);
}

.prikaz-panel{
  width:min(100%, 430px);
  max-width:100%;
}

.prikaz-panel img,
.sidebar-card img,
.info-card img,
.card img,
.qr-frame img{
  display:block;
  max-width:100%;
  height:auto;
}

.footer-std-cta{
  width:min(var(--layout-shell-max), calc(100% - (var(--shell-safe-x) * 2)))!important;
  max-width:var(--layout-shell-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto;
  gap:var(--layout-gap-md)!important;
  align-items:center;
  box-sizing:border-box;
}

.footer-std-cta-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.footer-std-cta-actions a,
.footer-std-cta-actions button,
.hero-actions a,
.hero-actions button,
.btn{
  min-width:0;
  max-width:100%;
}

.content-flow > * + *,
.info-panel > * + *,
.sidebar-card > * + *,
.prikaz-panel > * + *,
.card > * + *,
.info-card > * + *,
.risk-card > * + *,
.link-card > * + *,
.process-card > * + *,
.scenario > * + *{
  margin-top:var(--layout-gap-sm);
}

.content-flow > :first-child,
.info-panel > :first-child,
.sidebar-card > :first-child,
.prikaz-panel > :first-child,
.card > :first-child,
.info-card > :first-child,
.risk-card > :first-child,
.link-card > :first-child,
.process-card > :first-child,
.scenario > :first-child{
  margin-top:0;
}

.hero-actions,
.cta-actions,
.card-actions,
.reference-actions,
.footer-actions{
  display:flex;
  flex-wrap:wrap;
  gap:var(--layout-gap-sm);
  min-width:0;
}

@media(max-width:1280px){
  :root{
    --layout-gap-xl:clamp(26px,3.2vw,42px);
    --section-pad-y:clamp(52px,6vw,82px);
  }
  .two-col,
  .hero-grid{
    gap:var(--layout-gap-lg);
  }
}

@media(max-width:980px){
  .section-head{
    display:grid;
    align-items:start;
    gap:var(--layout-gap-sm);
  }
  .two-col,
  .hero-grid,
  .footer-std-cta{
    grid-template-columns:1fr!important;
  }
  .prikaz-panel{
    justify-self:stretch!important;
    width:100%;
  }
  .footer-std-cta-actions{
    justify-content:flex-start!important;
  }
}

@media(max-width:760px){
  :root{
    --shell-safe-x:18px;
    --section-pad-y:clamp(42px,9vw,62px);
    --section-pad-y-compact:clamp(30px,7vw,48px);
    --card-pad:18px;
    --card-pad-lg:20px;
    --card-radius:20px;
  }
  .shell{
    width:calc(100% - (var(--shell-safe-x) * 2));
  }
  .section-head,
  .two-col,
  .hero-grid,
  .card-grid,
  .hero-signals,
  .risk-stack,
  .qr-premium-grid{
    gap:var(--layout-gap-md);
  }
  .hero-actions,
  .cta-actions,
  .card-actions,
  .reference-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .hero-actions .btn,
  .cta-actions .btn,
  .card-actions .btn,
  .reference-actions .btn,
  .footer-std-cta-actions a{
    width:100%;
    justify-content:center;
  }
  .footer-std-cta{
    padding:18px!important;
    border-radius:22px!important;
  }
}

@media(max-width:390px){
  :root{
    --shell-safe-x:14px;
    --layout-gap-sm:10px;
    --layout-gap-md:14px;
    --card-pad:16px;
    --card-pad-lg:18px;
  }
  .footer-std-cta-actions{
    display:grid;
    grid-template-columns:1fr;
  }
}
