/* VSK PRODUCTION AUTHORITY
   Loaded last on every indexed public page.
   Purpose: one final responsive authority after all legacy V16 layers. */

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

/* Keep full-width structural sections full-width even when older shell rules conflict. */
body.v8.v13.v14 .site-header,
body.v8.v13.v14 .subpage-main,
body.v8.v13.v14 .site-footer,
body.v8.v13.v14[data-page="machines"] .archive-hero,
body.v8.v13.v14[data-page="machines"] .archive-browser,
body.v8.v13.v14[data-page="machines"] .archive-note{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* Final single-result desktop/tablet authority. */
@media(min-width:761px){
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result{
    width:min(calc(100% - 64px),1180px)!important;
    max-width:1180px!important;
    margin-inline:auto!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:16px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-sticky-preview{
    position:relative!important;
    top:auto!important;
    display:grid!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    box-sizing:border-box!important;
    grid-template-columns:minmax(280px,.92fr) minmax(280px,1.08fr)!important;
    grid-template-rows:auto auto minmax(64px,1fr) auto!important;
    column-gap:26px!important;
    padding:16px!important;
    overflow:hidden!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-preview-media{
    grid-column:1!important;
    grid-row:1/5!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:auto!important;
    aspect-ratio:16/10!important;
    margin:0!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-sticky-preview>span,
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-sticky-preview>h2,
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-sticky-preview>p,
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-sticky-preview>button{
    grid-column:2!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-sticky-preview>h2{
    font-size:clamp(28px,2.35vw,38px)!important;
    line-height:1.04!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result [data-archive-preview-open]{
    width:auto!important;
    min-width:220px!important;
    max-width:100%!important;
    justify-self:start!important;
  }
}

/* Phone/tablet-small authority. */
@media(max-width:760px){
  html,body{
    width:100%!important;
    max-width:100%!important;
    overflow-x:clip!important;
  }
  body.v8.v13.v14{
    width:100%!important;
    max-width:100%!important;
    overflow-x:clip!important;
  }
  body.v8.v13.v14 .site-header{
    width:100%!important;
    max-width:100vw!important;
    left:0!important;
    right:0!important;
  }
  body.v8.v13.v14 .mobile-sticky-cta{
    display:none!important;
  }

  /* Home selected engineering: no cropped moving rail on phones. */
  body.v8.v13.v14[data-page="home"] .selected-projects-strip{
    width:100%!important;
    max-width:100%!important;
    padding:28px 16px 48px!important;
    overflow:hidden!important;
  }
  body.v8.v13.v14[data-page="home"] .selected-projects-strip .project-collection-head{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 0 18px!important;
    padding:0!important;
  }
  body.v8.v13.v14[data-page="home"] .vsk-selected-rail{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }
  body.v8.v13.v14[data-page="home"] .vsk-selected-track{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    transform:none!important;
    animation:none!important;
    will-change:auto!important;
  }
  body.v8.v13.v14[data-page="home"] .vsk-selected-group{
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
  }
  body.v8.v13.v14[data-page="home"] .vsk-selected-group+.vsk-selected-group{
    display:none!important;
  }
  body.v8.v13.v14[data-page="home"] .v16-selected-card{
    box-sizing:border-box!important;
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body.v8.v13.v14[data-page="home"] .v16-selected-card figure{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:16/9!important;
    overflow:hidden!important;
  }
  body.v8.v13.v14[data-page="home"] .v16-selected-card figure img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
  }
  body.v8.v13.v14[data-page="home"] .v16-selected-card-copy{
    box-sizing:border-box!important;
    display:block!important;
    width:100%!important;
    min-width:0!important;
    padding:16px!important;
  }
  body.v8.v13.v14[data-page="home"] .v16-selected-card h3{
    font-size:24px!important;
    line-height:1.08!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  body.v8.v13.v14[data-page="home"] .v16-selected-card p{
    font-size:13px!important;
    line-height:1.5!important;
  }

  /* Experience page: every control and result is bound to the real viewport. */
  body.v8.v13.v14[data-page="machines"] .archive-hero .shell,
  body.v8.v13.v14[data-page="machines"] .archive-browser .shell,
  body.v8.v13.v14[data-page="machines"] .archive-note .shell,
  body.v8.v13.v14[data-page="machines"] .site-footer .shell{
    box-sizing:border-box!important;
    width:calc(100% - 32px)!important;
    max-width:calc(100% - 32px)!important;
    min-width:0!important;
    margin-left:16px!important;
    margin-right:16px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-hero-grid{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-hero-number{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-hero-facts{
    box-sizing:border-box!important;
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    overflow:visible!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-hero-facts>span{
    box-sizing:border-box!important;
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:62px!important;
    padding:11px 12px!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    gap:5px!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    font-size:9px!important;
    line-height:1.3!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-hero-facts>span:last-child{
    grid-column:1/-1!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-hero-facts strong{
    font-size:26px!important;
    line-height:1!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-toolbar{
    box-sizing:border-box!important;
    width:calc(100% - 32px)!important;
    max-width:calc(100% - 32px)!important;
    min-width:0!important;
    margin-left:16px!important;
    margin-right:16px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 88px!important;
    gap:10px!important;
    align-items:end!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-types{
    box-sizing:border-box!important;
    grid-column:1/-1!important;
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    grid-template-columns:minmax(0,.68fr) minmax(0,1.18fr) minmax(0,1.18fr)!important;
    overflow:visible!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-types button{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:58px!important;
    padding:8px 4px!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
    font-size:9.5px!important;
    line-height:1.25!important;
    letter-spacing:0!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-types button b{
    display:block!important;
    margin-top:4px!important;
    font-size:12px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-search{
    grid-column:1!important;
    width:100%!important;
    min-width:0!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-search input{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:52px!important;
    font-size:16px!important;
  }
  body.v8.v13.v14[data-page="machines"] .filter-toggle{
    grid-column:2!important;
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    height:52px!important;
    min-height:52px!important;
    padding:0 8px!important;
    font-size:9.5px!important;
  }
  body.v8.v13.v14[data-page="machines"] .filter-panel{
    box-sizing:border-box!important;
    width:calc(100% - 32px)!important;
    max-width:calc(100% - 32px)!important;
    min-width:0!important;
    margin-inline:16px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-status{
    box-sizing:border-box!important;
    width:calc(100% - 32px)!important;
    max-width:calc(100% - 32px)!important;
    min-width:0!important;
    margin:18px 16px 14px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-status a{
    max-width:100%!important;
    justify-self:start!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout,
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result,
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.has-multiple-results{
    box-sizing:border-box!important;
    width:calc(100% - 32px)!important;
    max-width:calc(100% - 32px)!important;
    min-width:0!important;
    margin-inline:16px!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index,
  body.v8.v13.v14[data-page="machines"] .archive-row{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  /* One result: show one polished preview, not duplicate row + preview. */
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-index{
    display:none!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.is-single-result .archive-sticky-preview{
    display:block!important;
  }
  /* Multiple results: list first, no giant preview competing for mobile space. */
  body.v8.v13.v14[data-page="machines"] .archive-index-layout.has-multiple-results .archive-sticky-preview{
    display:none!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-index-layout .archive-sticky-preview{
    box-sizing:border-box!important;
    position:relative!important;
    top:auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    padding:14px!important;
    overflow:hidden!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-preview-media{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    aspect-ratio:16/10!important;
    margin:0 0 14px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-preview-media img{
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    object-fit:cover!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-sticky-preview>h2{
    margin:10px 0!important;
    font-size:clamp(25px,7vw,31px)!important;
    line-height:1.1!important;
    letter-spacing:-.03em!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-sticky-preview>p{
    margin:0 0 14px!important;
    font-size:14px!important;
    line-height:1.5!important;
  }
  body.v8.v13.v14[data-page="machines"] [data-archive-preview-open]{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:48px!important;
    padding:12px 16px!important;
    white-space:normal!important;
    font-size:12px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-note{
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-note-grid{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:18px!important;
  }
  body.v8.v13.v14[data-page="machines"] .archive-note h2{
    font-size:clamp(38px,11vw,50px)!important;
    line-height:.98!important;
    overflow-wrap:break-word!important;
  }
  body.v8.v13.v14[data-page="machines"] .site-footer{
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }

  /* Gallery: ensure category controls and media never widen the document. */
  body.v8.v13.v14[data-page="gallery"] .gallery-browser,
  body.v8.v13.v14[data-page="gallery"] .gallery-controls,
  body.v8.v13.v14[data-page="gallery"] [data-gallery-filter-list],
  body.v8.v13.v14[data-page="gallery"] .gallery-project-media,
  body.v8.v13.v14[data-page="gallery"] .gallery-tile{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
  }
}


/* Specificity hardening for legacy mobile rules that intentionally used html + body + !important. */
@media(max-width:760px){
  html body.v8.v13.v14[data-page="home"] .mobile-sticky-cta{
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  html body.v8.v13.v14[data-page="home"] .selected-projects-strip .vsk-selected-rail{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:visible!important;
    scroll-snap-type:none!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip .vsk-selected-track{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    transform:none!important;
    animation:none!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .vsk-selected-group{
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    padding:0!important;
    margin:0!important;
    gap:10px!important;
    grid-template-columns:minmax(0,1fr)!important;
    flex:none!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .vsk-selected-group+.vsk-selected-group{
    display:none!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .vsk-selected-group>.v16-selected-card{
    box-sizing:border-box!important;
    position:relative!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    flex:none!important;
    flex-basis:auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:180px!important;
    min-height:180px!important;
    max-height:180px!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:clamp(110px,34vw,180px) minmax(0,1fr)!important;
    grid-template-rows:180px!important;
    scroll-snap-align:none!important;
    overflow:hidden!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .vsk-selected-group>.v16-selected-card figure{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:180px!important;
    min-height:180px!important;
    max-height:180px!important;
    aspect-ratio:auto!important;
    border-right:1px solid #cbd7df!important;
    border-bottom:0!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .vsk-selected-group>.v16-selected-card .v16-selected-card-copy{
    grid-column:2!important;
    grid-row:1!important;
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    height:180px!important;
    min-height:180px!important;
    max-height:180px!important;
    padding:13px 14px!important;
    overflow:hidden!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .v16-selected-card h3{
    margin:8px 0 5px!important;
    font-size:clamp(17px,5.2vw,22px)!important;
    line-height:1.08!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .v16-selected-card p{
    margin:0 0 9px!important;
    font-size:11.5px!important;
    line-height:1.35!important;
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
  }
  html body.v8.v13.v14[data-page="home"] .selected-projects-strip [data-home-projects] .v16-selected-card b{
    font-size:8.5px!important;
    line-height:1.25!important;
  }
}
