/**
 * HENGDE durable layout system.
 *
 * Geometry only. See docs/HENGDE-LAYOUT-CONTRACT.md.
 * Geometry rules avoid priority flags. A bounded article-hero compatibility block
 * at the end must override the retired legacy bundle until that bundle is removed.
 */

:root {
  --hd-layout-max: 1480px;
  --hd-gutter: clamp(14px, 2vw, 32px);
  --hd-section-space: clamp(64px, 7vw, 112px);
  --hd-section-space-major: clamp(56px, 6vw, 96px);
  --hd-section-space-minor: clamp(32px, 4vw, 60px);
  --hd-layout-gap: clamp(24px, 4vw, 64px);
  --hd-radius: 14px;
  --hd-z-content: 0;
  --hd-z-sticky: 20;
  --hd-z-float: 50;
  --hd-z-header: 60;
  --hd-z-dropdown: 70;
  --hd-z-consent: 80;
  --hd-z-mobile-nav: 90;
}

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

html {
  scroll-padding-top: 92px;
}

body {
  min-width: 320px;
}

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

img,
video {
  height: auto;
}

.site-main,
.site-main > *,
.v8-home,
.v8-home > *,
.hd-container,
.shell,
.container {
  min-width: 0;
}

.hd-container,
.shell,
.container {
  width: min(calc(100% - (2 * var(--hd-gutter))), var(--hd-layout-max));
  margin-inline: auto;
}

.hd-section,
.content-section {
  padding-block: var(--hd-section-space);
}

/* Role-based rhythm: shared sections breathe without enlarging every module.
 * Keep tables, forms, the paid landing templates and card media in their own flow. */
body.hd-polish-system main :is(.clarity-section,.content-section.hd-section,.hd-section:not(.hd-final-cta)):not(.hd-content-brief) {
  padding-block: var(--hd-section-space-major);
}
body.hd-polish-system .ls-main .ls-section:not(.hd-section):has(img,video,iframe,table,form,[data-video-id]) {
  padding-top: var(--hd-section-space-minor);
}
body.hd-polish-system main :is(.clarity-section-heading,.inner-section-heading) {
  margin-bottom: clamp(24px,3vw,42px);
}

/* Visible horizontal-scroll affordance for long chapter navigation. */
body.hd-polish-system .inner-section-nav {
  scrollbar-width: thin;
  scrollbar-color: #9db2c4 #eef3f8;
  scroll-padding-inline: 20px;
}
body.hd-polish-system .inner-section-nav::-webkit-scrollbar { display: block; height: 4px; }
body.hd-polish-system .inner-section-nav::-webkit-scrollbar-thumb { background: #9db2c4; border-radius: 4px; }
body.hd-polish-system .inner-section-nav::-webkit-scrollbar-track { background: #eef3f8; }

html:has(> body.hd-polish-system) { scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
body.hd-polish-system .hd31-hero-controls { scroll-margin-block-end: calc(80px + env(safe-area-inset-bottom, 0px)); }
@media (max-width:767px) {
  body.hd-polish-system:has(.hd31-hero-controls:focus-within) :is(.hd-wa-cta-root,.hd-wa-cta-mobile,.hd-wa-cta-desktop) {
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
@media (max-width:380px) {
  body.hd-polish-system .hd31-hero-controls { display: grid; grid-template-columns: 48px 44px minmax(132px,1fr) 44px; gap: 4px; }
  body.hd-polish-system .hd31-hero-controls .hd31-hero-rotation { width: 48px; padding-inline: 4px; }
  body.hd-polish-system .hd31-hero-controls .hd31-hero-dots { margin: 0; gap: 0; justify-content: center; }
}
@media (min-width:981px) {
  body.hd-polish-system .ls-commercial-hero__facts:has(>div:nth-child(5):last-child) { grid-template-columns: repeat(6,minmax(0,1fr)); }
  body.hd-polish-system .ls-commercial-hero__facts:has(>div:nth-child(5):last-child) > div { grid-column: span 2; }
  body.hd-polish-system .ls-commercial-hero__facts:has(>div:nth-child(5):last-child) > div:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width:980px) {
  body.hd-polish-system .ls-commercial-hero__facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Compact, equally sized consent choices; copy and preference handlers unchanged. */
.ls-capacity-selection-table { table-layout: fixed; min-width: 760px; }
.ls-capacity-selection-table th { white-space: normal; vertical-align: top; }
.ls-capacity-selection-table th:first-child { width: 22%; }
.ls-capacity-selection-table td { padding: 16px 12px; line-height: 1.5; overflow-wrap: anywhere; }
section[aria-labelledby="capacity-selection-title"] .ls-variant-card p + p { margin-top: 12px; }
section[aria-labelledby="capacity-selection-title"] .ls-table-wrap:focus-visible { outline: 3px solid #1878c9; outline-offset: 3px; }

@media (max-width:640px) {
  body.hd-polish-system .hd-consent-banner { padding: 12px; gap: 10px; max-height: calc(80svh - 24px); }
  body.hd-polish-system .hd-consent-actions { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  body.hd-polish-system .hd-consent-button { min-height: 44px; padding: 8px 5px; }
  body.hd-polish-system .hd-consent-button[data-hd-consent-action='customize'],
  body.hd-polish-system .hd-consent-button[data-hd-consent-action='save-custom'] { grid-column: auto; }
}

.hd-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 28px);
  min-width: 0;
}

.hd-split,
.home-hero-grid,
.hero-grid,
.inner-hero-grid,
.wpkg-hero-grid,
.v5-product-hero-grid,
.v6-article-hero-grid,
.complete-line-grid,
.form-layout,
.contact-layout,
.contact-stage-grid,
.home-company-grid,
.spotlight-grid,
.process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: var(--hd-layout-gap);
  min-width: 0;
}

.hd-split > *,
.home-hero-grid > *,
.hero-grid > *,
.inner-hero-grid > *,
.wpkg-hero-grid > *,
.v5-product-hero-grid > *,
.v6-article-hero-grid > *,
.complete-line-grid > *,
.form-layout > *,
.contact-layout > *,
.contact-stage-grid > *,
.home-company-grid > *,
.spotlight-grid > *,
.process-grid > * {
  min-width: 0;
}

.hd-grid,
.content-card-grid,
.content-card-grid.dense,
.wpkg-card-grid,
.wpkg-equipment-grid,
.wpkg-feature-grid,
.v7-detail-grid,
.v7-module-grid,
.v5-cutting-grid,
.solution-grid,
.equipment-grid,
.project-grid,
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: clamp(16px, 2vw, 28px);
  min-width: 0;
}

#verified-projects .content-card-grid,
#wall-panel-visual-guide .content-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hd-grid > *,
.content-card-grid > *,
.wpkg-card-grid > *,
.wpkg-equipment-grid > *,
.wpkg-feature-grid > *,
.v7-detail-grid > *,
.v7-module-grid > *,
.v5-cutting-grid > *,
.solution-grid > *,
.equipment-grid > *,
.project-grid > *,
.news-grid > * {
  min-width: 0;
}

.hd-card,
.family-card,
.hengde-card,
.content-card,
.wpkg-card,
.equipment-card,
.project-card,
.news-card {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  min-width: 0;
}

.content-card {
  overflow: visible;
}

.hd-media,
.family-media,
.hengde-card__media,
.equipment-thumb,
.project-card__media,
.news-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  min-width: 0;
  overflow: clip;
  background: #e9f0f4;
}

.hd-media > img,
.family-media > img,
.hengde-card__media > img,
.equipment-thumb > img,
.project-card__media > img,
.news-card__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card > .equipment-thumb {
  width: 100%;
  height: auto;
  margin: 0;
}

.hd-media--drawing > img,
.drawing-thumb > img,
.engineering-layout img,
.complete-line-visual img,
.inner-engineering-panel img,
.hero-line-layout-card {
  object-fit: contain;
}

.hd-carousel,
.hengde-carousel {
  min-width: 0;
  max-width: 100%;
}

.hd-carousel__viewport,
.hengde-carousel__viewport,
.swiper {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.swiper-wrapper,
.swiper-slide {
  min-width: 0;
}

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--hd-z-header);
}

.header-inner {
  min-height: 76px;
  gap: clamp(14px, 2vw, 26px);
}

.header-inner .brand {
  flex: 0 1 auto;
  min-width: 190px;
}

.desktop-nav {
  min-width: 0;
  gap: clamp(8px, 1.1vw, 16px);
}

.desktop-nav .nav-group > a {
  white-space: nowrap;
}

.site-search {
  position: relative;
  flex: 0 0 auto;
}

.site-search > summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  list-style: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
}

.site-search > summary::-webkit-details-marker {
  display: none;
}

.site-search[open] > summary,
.site-search > summary:hover,
.site-search > summary:focus-visible {
  color: #1476d4;
  outline: 2px solid transparent;
}

.site-search-form {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: var(--hd-z-dropdown);
  width: min(440px, calc(100vw - (2 * var(--hd-gutter))));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e0e8;
  background: #fff;
  box-shadow: 0 18px 44px rgba(20, 38, 58, .18);
}

.site-search-form .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-search-form input,
.mobile-site-search input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #aebdcc;
  border-radius: 4px;
  background: #fff;
  color: #14263a;
  font: inherit;
}

.site-search-form button,
.mobile-site-search button {
  min-height: 44px;
  padding: 10px 15px;
  border: 0;
  border-radius: 4px;
  background: #1476d4;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.mobile-site-search {
  display: grid;
  gap: 8px;
  padding: 12px 10px;
}

.mobile-site-search label {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

.mobile-site-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0;
}

.nav-dropdown {
  z-index: var(--hd-z-dropdown);
}

.mobile-menu {
  z-index: var(--hd-z-mobile-nav);
}

.mobile-menu nav {
  z-index: var(--hd-z-mobile-nav);
}

/* Home hero: copy and evidence are peers in normal flow. */
.home-hero {
  position: relative;
  display: block;
  min-height: 0;
  overflow: clip;
  isolation: isolate;
}

.home-hero-bg,
.home-hero-shade {
  position: absolute;
  inset: 0;
}

.home-hero .home-hero-grid {
  position: relative;
  z-index: 3;
  width: min(calc(100% - (2 * var(--hd-gutter))), var(--hd-layout-max));
  padding-block: clamp(64px, 7vw, 112px);
  grid-template-columns: minmax(0, 1.03fr) minmax(440px, .97fr);
}

.home-hero .hero-copy {
  align-self: center;
  padding: 0;
}

.home-hero h1,
.inner-hero h1,
.wpkg-hero h1,
.v5-product-hero h1,
.v6-article-hero h1 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.home-hero h1 {
  max-width: 820px;
  font-size: clamp(56px, 3.45vw, 66px);
  line-height: 1.02;
  overflow-wrap: normal;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual-proof {
  position: relative;
  display: block;
  align-self: center;
  min-height: 0;
}

.hero-evidence-carousel {
  width: 100%;
  color: #fff;
}

.hero-evidence-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(139, 216, 251, .5);
  border-radius: 4px;
  background: rgba(4, 35, 59, .82);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .34);
  backdrop-filter: blur(12px);
}

.hero-evidence-carousel:not(.is-ready):not(.is-initializing) {
  --hengde-fallback-gap: 0px;
  --hengde-fallback-slide-width: 100%;
}

.hero-evidence-carousel .hengde-carousel__viewport {
  width: 100%;
  overflow: hidden;
}

.hero-evidence-slide {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  height: auto;
  background: #08253b;
  color: #fff;
  text-decoration: none;
}

.hero-evidence-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e9f0f4;
}

.hero-evidence-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.hero-evidence-slide--layout .hero-evidence-media {
  background: #f7f9fb;
}

.hero-evidence-slide--layout .hero-evidence-media img {
  object-fit: contain;
}

.hero-evidence-caption {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 16px 20px;
  border-top: 1px solid rgba(139, 216, 251, .28);
  background: linear-gradient(135deg, rgba(4, 35, 59, .98), rgba(10, 73, 105, .92));
}

.hero-evidence-caption b {
  color: #72d8ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.hero-evidence-caption strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
}

.hero-evidence-caption small {
  color: #c4dcea;
  font-size: 11px;
  line-height: 1.4;
}

.hero-evidence-carousel .hengde-carousel__controls {
  position: absolute;
  z-index: 5;
  top: calc((100% - 104px) / 2 - 21px);
  right: 12px;
  left: 12px;
  justify-content: space-between;
  gap: 0;
  margin: 0;
  pointer-events: none;
}

.hero-evidence-carousel .hengde-carousel__button {
  width: 42px;
  height: 42px;
  border-color: rgba(255, 255, 255, .48);
  background: rgba(255, 255, 255, .94);
  color: #08253b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
  pointer-events: auto;
}

.hero-evidence-carousel .hengde-carousel__button:hover,
.hero-evidence-carousel .hengde-carousel__button:focus-visible {
  border-color: #d95100;
  background: #d95100;
  color: #fff;
}

.hero-evidence-slide:hover .hero-evidence-media img {
  transform: scale(1.018);
}

.hero-evidence-slide--layout:hover .hero-evidence-media img {
  transform: none;
}

.hero-evidence-instruction {
  margin: 10px 2px 0;
  color: #bfd0dc;
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.engineering-panel,
.entrance-card {
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  min-width: 0;
  overflow: clip;
  clip-path: none;
  aspect-ratio: auto;
}

.engineering-panel {
  display: grid;
  grid-template-rows: auto minmax(230px, 1fr) auto;
  padding: 18px;
}

.engineering-panel-head,
.engineering-panel-foot {
  position: relative;
  inset: auto;
  z-index: 3;
}

.engineering-panel-head {
  align-items: start;
  padding-bottom: 12px;
}

.engineering-panel-foot {
  padding-top: 12px;
}

.hero-line-layout-card {
  position: relative;
  inset: auto;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 230px;
  background: rgba(245, 249, 252, .97);
}

.entrance-card {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  background: #08253b;
}

.entrance-card.entrance-card--hengde img {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.entrance-card::after {
  content: none;
}

.entrance-card span {
  position: relative;
  inset: auto;
  z-index: 1;
  padding: 14px 16px;
}

/* Inner page heroes */
.inner-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(380px, .86fr);
}

.inner-engineering-panel {
  min-height: 0;
  aspect-ratio: 16 / 11;
}

.inner-engineering-panel img,
.wpkg-hero-media img,
.v5-product-hero-media img,
.v6-article-hero-media img {
  width: 100%;
  height: 100%;
}

.feature-media,
.section-context-media {
  position: relative;
  min-width: 0;
  margin-inline: 0;
  overflow: clip;
  background: #e9f0f4;
}

.feature-media img,
.section-context-media img {
  width: 100%;
  height: auto;
  max-height: min(70svh, 760px);
  object-fit: cover;
}

.drawing-context img {
  object-fit: contain;
}

/* Home sections */
.section-heading,
.split-heading,
.home-inquiry-heading {
  min-width: 0;
}

.split-heading,
.home-inquiry-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
}

.family-card {
  min-height: 0;
}

.family-copy,
.hengde-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.family-copy .text-link,
.hengde-card__body .hengde-card__link {
  margin-top: auto;
}

.home-complete-line {
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: clamp(48px, 6vw, 80px);
  border-top: 1px solid rgba(6, 30, 51, .14);
}

.home-product-output-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(28px, 4vw, 48px);
}

.home-product-output,
.home-why-grid > article {
  gap: 14px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid rgba(6, 30, 51, .13);
  background: #fff;
  box-shadow: 0 14px 38px rgba(6, 30, 51, .06);
}

.home-product-output h3,
.home-why-grid h3,
.home-product-output p,
.home-why-grid p {
  margin: 0;
}

.home-why-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(28px, 4vw, 48px);
}

.home-why-grid > article > span {
  color: var(--orange, #ef6c1a);
  font-weight: 900;
  letter-spacing: .08em;
}

.proof-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: none;
  align-items: start;
  gap: clamp(20px, 1.5vw, 24px);
}

/* Evidence is an intentional dark trust surface. This selector resolves the
   existing tinted-section specificity without an override escalation. */
.content-section.home-company {
  background: var(--navy, #061e33);
  color: #fff;
}

.content-section.home-company h2,
.content-section.home-company h3,
.content-section.home-company p {
  color: inherit;
}

.content-section.home-company p {
  color: #b9cbd9;
}

.content-section.home-company .proof-gallery figure {
  min-width: 0;
  min-height: 0;
  height: auto;
  aspect-ratio: 4 / 3;
}

.content-section.home-company .proof-gallery img,
.content-section.home-company .proof-gallery .v8-media-fill {
  position: static;
  inset: auto;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.proof-gallery figure.large,
.proof-gallery figure:nth-child(2) {
  grid-column: auto;
  grid-row: auto;
}

.proof-gallery figure:nth-child(3) {
  grid-column: auto;
  grid-row: auto;
}

.complete-line-grid {
  grid-template-columns: minmax(0, .82fr) minmax(460px, 1.18fr);
}

.complete-line-visual {
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto;
  min-height: 0;
  clip-path: none;
}

.complete-line-visual > a {
  display: grid;
  min-height: 320px;
}

.complete-line-visual img {
  width: 100%;
  height: 100%;
  padding: clamp(16px, 3vw, 34px);
}

.complete-line-visual figcaption {
  position: relative;
  inset: auto;
  margin: 0;
}

.delivery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delivery-grid article {
  min-height: 0;
}

/* Forms and contact */
.form-layout,
.contact-layout,
.contact-stage-grid {
  align-items: start;
}

.form-layout form,
.home-inquiry-section form,
.contact-stage form {
  min-width: 0;
}

.form-layout input,
.form-layout select,
.form-layout textarea,
.home-inquiry-section input,
.home-inquiry-section select,
.home-inquiry-section textarea,
.contact-stage input,
.contact-stage select,
.contact-stage textarea {
  max-width: 100%;
}

/* Tables own their horizontal scroll. */
.v14-table-wrap,
.configuration-table-wrap,
.table-wrap,
.ls-table-wrap,
.wpkg-table-wrap,
.spec-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.v14-table-wrap table,
.configuration-table-wrap table,
.table-wrap table,
.ls-table-wrap table,
.wpkg-table-wrap table,
.spec-table-wrap table {
  width: max(100%, 720px);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: var(--hd-z-content);
}

.footer-grid {
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(170px, 1fr));
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
}

.footer-grid > *,
.footer-contacts,
.footer-contacts > * {
  min-width: 0;
}

.footer-grid a,
.footer-grid address,
.footer-grid strong {
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

/* The long-term CTA sits below consent/nav in the scale and yields to content. */
.hd-wa-cta-root,
.hd-wa-cta-desktop,
.hd-wa-cta-mobile {
  z-index: var(--hd-z-float);
}

body.hd-wa-form-visible .hd-wa-cta-root,
body.hd-wa-menu-open .hd-wa-cta-root,
body.hd-wa-footer-visible .hd-wa-cta-root,
body.hd-wa-consent-visible .hd-wa-cta-root {
  pointer-events: none;
}

.hd-consent-banner .button-outline {
  border-color: #fff;
  background: #fff;
  color: #061e33;
}

@media (max-width: 1179px) {
  #verified-projects .content-card-grid,
  #wall-panel-visual-guide .content-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .desktop-nav,
  .header-cta,
  .site-search {
    display: none;
  }

  .mobile-menu {
    display: block;
    margin-left: auto;
  }

  .mobile-menu nav {
    position: fixed;
    top: 76px;
    right: var(--hd-gutter);
    width: min(420px, calc(100vw - (2 * var(--hd-gutter))));
    max-height: calc(100svh - 92px);
  }

  .home-hero .home-hero-grid,
  .hd-split,
  .hero-grid,
  .inner-hero-grid,
  .wpkg-hero-grid,
  .v5-product-hero-grid,
  .v6-article-hero-grid,
  .complete-line-grid,
  .form-layout,
  .contact-layout,
  .contact-stage-grid,
  .home-company-grid,
  .spotlight-grid,
  .process-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero .home-hero-grid {
    max-width: 900px;
  }

  .contact-card {
    position: static;
    inset: auto;
  }

  .hero-visual-proof {
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
  }

  .delivery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-why-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .proof-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  #verified-projects .content-card-grid,
  #wall-panel-visual-guide .content-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  :root {
    --hd-section-space: clamp(48px, 13vw, 72px);
    --hd-layout-gap: 28px;
  }

  html {
    scroll-padding-top: 78px;
  }

  .header-inner {
    min-height: 68px;
  }

  .header-inner .brand {
    min-width: 0;
  }

  .header-inner .brand small {
    display: none;
  }

  .mobile-menu nav {
    top: 68px;
    right: var(--hd-gutter);
    left: var(--hd-gutter);
    width: auto;
    max-height: calc(100svh - 82px);
  }

  .home-hero .home-hero-grid {
    width: min(calc(100% - (2 * var(--hd-gutter))), var(--hd-layout-max));
    padding-block: clamp(48px, 12vw, 72px);
  }

  .home-hero .hero-copy > p {
    font-size: clamp(16px, 4.4vw, 18px);
  }

  .home-hero h1 {
    font-size: clamp(38px, 9vw, 48px);
    line-height: 1.04;
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .hero-actions .button {
    justify-content: center;
  }

  .hero-proof-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-visual-proof {
    grid-template-columns: minmax(0, 1fr);
  }

  .engineering-panel {
    grid-template-rows: auto minmax(190px, 1fr) auto;
    padding: 14px;
  }

  .engineering-panel-head {
    display: grid;
    gap: 4px;
  }

  .hero-line-layout-card {
    min-height: 190px;
  }

  .entrance-card,
  .entrance-card.entrance-card--hengde img {
    min-height: 0;
  }

  .entrance-card.entrance-card--hengde img {
    aspect-ratio: 16 / 10;
  }

  .split-heading,
  .home-inquiry-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .proof-gallery {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .proof-gallery figure,
  .proof-gallery figure.large {
    grid-column: auto;
    grid-row: auto;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .delivery-grid,
  .home-product-output-grid,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .delivery-grid article {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 22px 18px;
  }

  .complete-line-visual,
  .complete-line-visual > a {
    min-height: 0;
  }

  .complete-line-visual > a {
    aspect-ratio: 16 / 11;
  }

  .home-inquiry-section .form-grid,
  .contact-stage .form-grid,
  .form-layout .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
  }

  body.hd-wa-cta-mobile-enabled {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 389px) {
  :root {
    --hd-gutter: 14px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .header-inner .brand strong {
    font-size: 18px;
  }

  .engineering-panel-foot {
    grid-template-columns: minmax(0, 1fr);
  }

  .engineering-panel-foot span {
    padding-top: 6px;
  }
}

/* LEGACY_CASCADE_COMPAT_BEGIN
 * Long-form news titles need more text width than product-detail heroes. These
 * declarations override legacy main.css rules that also use !important.
 */
@media (min-width: 1200px) {
  body.single-post .v6-article-hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr) !important;
    gap: 40px !important;
  }

  body.single-post .v6-article-hero h1 {
    max-width: none !important;
    font-size: clamp(2.5rem, 3.2vw, 3rem) !important;
    line-height: 1.02 !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  body.single-post .v6-article-hero h1 {
    max-width: none !important;
    font-size: clamp(2.3rem, 4.5vw, 3rem) !important;
    line-height: 1.03 !important;
  }
}

@media (max-width: 767px) {
  body.single-post .v6-article-hero h1 {
    max-width: none !important;
    font-size: clamp(2rem, 9vw, 2.55rem) !important;
    line-height: 1.04 !important;
  }
}
/* LEGACY_CASCADE_COMPAT_END */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
  }

  [data-hengde-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Reviewed English news-pack media and conversion modules. */
.hd-news-gallery,
.hd-news-related-links,
.hd-news-cta {
  margin-block: clamp(30px, 4vw, 48px);
}

.hd-news-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.hd-news-gallery > *,
.hd-news-related-links > *,
.hd-news-cta > * {
  min-width: 0;
}

.hd-news-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(7, 45, 74, 0.12);
  border-radius: 16px;
  background: #eaf0f4;
}

.hd-news-gallery picture,
.hd-news-gallery img {
  display: block;
  width: 100%;
  max-width: 100%;
}

.hd-news-gallery img {
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hd-news-related-links {
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid rgba(7, 45, 74, 0.12);
  border-radius: 18px;
  background: #fff;
}

.hd-news-related-links h2 {
  margin-top: 0;
}

.hd-news-related-links ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.15em;
}

.hd-news-related-links a {
  overflow-wrap: anywhere;
}

.hd-news-cta {
  padding: clamp(26px, 4vw, 40px);
  border-radius: 20px;
  background: linear-gradient(135deg, #072d4a, #0a4f75);
  color: #fff;
}

.hd-news-cta p {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.88);
}

.hd-news-cta .v5-btn {
  margin-top: 4px;
  background: #fff;
  color: #072d4a;
}

@media (max-width: 640px) {
  .hd-news-gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* LIST / ARCHIVE CONSISTENCY CONTRACT — 2026-08-24. */
.news-grid > .news-card > article {
  display: flex;
  flex-direction: column;
}

.news-grid .news-card h3,
.news-grid .news-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.news-grid .news-card h3 {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.news-grid .news-card p {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.news-grid .news-card .card-read-more {
  margin-top: auto;
}

@media (min-width: 1600px) {
  .news-grid,
  #verified-projects .content-card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) and (max-width: 1599px) {
  #verified-projects .content-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 901px) and (max-width: 1179px) {
  #verified-projects .content-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  #verified-projects .content-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body:has(.inner-hero-factory-videos) #section-1 .content-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#resource-categories .content-card-grid,
#technical-guides .content-card-grid,
#resource-videos .content-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  body:has(.inner-hero-factory-videos) #section-1 .content-card-grid,
  #resource-categories .content-card-grid,
  #technical-guides .content-card-grid,
  #resource-videos .content-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #verified-projects .content-card-grid,
  body:has(.inner-hero-factory-videos) #section-1 .content-card-grid,
  #resource-categories .content-card-grid,
  #technical-guides .content-card-grid,
  #resource-videos .content-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compact, photo-led Mongolia case. Scoped to this template only. */
body.page-id-411 .ls-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
body.page-id-411 .ls-hero-actions > a { display: inline-flex; max-width: 100%; }
body.page-id-411 .hd-ytm-section { padding: 32px 24px; border-radius: 14px; }
body.page-id-411 .hd-ytm-copy > a { display: inline-block; margin-top: 10px; font-weight: 700; }
.hd-project-story { color: #102033; background: #fff; }
.hd-project-story .shell { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }
.hd-project-story-breadcrumb { display: flex; flex-wrap: wrap; gap: 10px; padding: 22px 0; font-size: 14px; color: #52677c; }
.hd-project-story-hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 36px; padding: 14px 0 28px; }
.hd-project-story h1 { font-size: clamp(30px, 3.1vw, 44px); line-height: 1.12; margin: 12px 0 18px; overflow-wrap: normal; }
.hd-project-story h2 { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.2; margin: 10px 0 14px; }
.hd-project-story h3 { font-size: 24px; line-height: 1.25; margin: 8px 0 12px; }
.hd-project-story p { line-height: 1.65; }
.hd-project-story .section-kicker { margin: 0; color: #0070de; font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.hd-project-story-lead { font-size: 17px; color: #455d73; margin: 0 0 24px; }
.hd-project-story figure { margin: 0; }
.hd-project-story-hero figure { border-radius: 16px; overflow: hidden; border: 1px solid #d9e4ef; background: #f4f8fc; }
.hd-project-story-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.hd-project-story figcaption { padding: 12px 16px; font-size: 14px; line-height: 1.5; color: #455d73; }
.hd-project-story-video-link { display: block; width: fit-content; margin-top: 16px; font-weight: 700; }
.hd-project-story-facts { display: grid; grid-template-columns: .65fr 1.2fr 1fr; gap: 20px; margin: 0; padding: 22px 26px; background: #f1f7fc; border: 1px solid #d9e4ef; border-radius: 12px; }
.hd-project-story-facts dt { color: #52677c; font-size: 13px; line-height: 1.5; }
.hd-project-story-facts dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.hd-project-story-equipment { padding: 46px 0 0; }
.hd-project-story-intro { max-width: 850px; margin: 0 0 24px; color: #455d73; font-size: 17px; }
.hd-project-story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.hd-project-story-card { border: 1px solid #d9e4ef; border-radius: 14px; overflow: hidden; background: #fff; }
.hd-project-story-card > a { position: relative; display: block; }
.hd-project-story-enlarge { position: absolute; bottom: 14px; left: 14px; padding: 7px 12px; border-radius: 20px; background: #102d41; color: #fff; font-size: 12px; font-weight: 700; }
.hd-project-story-card-copy { padding: 24px; }
.hd-project-story-card-copy > p:last-child { color: #455d73; font-size: 16px; margin: 0; }
.hd-project-story-video { margin-top: 40px; scroll-margin-top: 110px; }
.hd-project-story .hd-ytm-section { margin: 0; padding: 28px; border-radius: 14px; background: #f1f7fc; }
.hd-project-story .hd-ytm-inner { width: 100%; max-width: none; padding: 0; }
.hd-project-story .hd-ytm-main { gap: 28px; }
.hd-project-story .hd-ytm-copy h3 { font-size: 23px; }
.hd-project-story .hd-ytm-more { margin-top: 24px; }
.hd-project-story .hd-ytm-more-head { margin-bottom: 12px; }
.hd-project-story .hd-ytm-controls:has(button:disabled + button:disabled) { display: none; }
.hd-project-story-contact { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding: 36px 0 24px; }
.hd-project-story-contact p:not(.section-kicker) { max-width: 780px; margin: 0; color: #455d73; }
.hd-project-story-related { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 18px; font-weight: 700; font-size: 15px; }
.hd-project-story-back { display: inline-block; margin-bottom: 36px; font-size: 14px; }
@media (max-width: 767px) {
  body.page-id-411 .ls-hero-actions { flex-direction: column; align-items: flex-start; }
  .hd-project-story .shell { width: calc(100% - 32px); }
  .hd-project-story-hero, .hd-project-story-grid, .hd-project-story-contact { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .hd-project-story-hero { padding-top: 4px; }
  .hd-project-story-facts { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px; }
  .hd-project-story-equipment { padding-top: 32px; }
  .hd-project-story-card-copy { padding: 20px; }
  .hd-project-story-video { margin-top: 28px; }
  .hd-project-story .hd-ytm-section { padding: 20px 16px; }
  .hd-project-story .hd-ytm-main { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hd-project-story .hd-ytm-copy h3 { font-size: 20px; }
  .hd-project-story-contact > .button { justify-self: start; }
}

/* Content density: short notes use note-sized spacing, not hero-sized panels.
   No content, forms, technical tables or evidence media are hidden. */
.v8-content-page > .inner-content-section.hd-content-brief {
  padding-block: 32px;
}
.v8-content-page > .inner-content-section.hd-content-brief > .shell {
  min-height: 0;
}
.v8-content-page > .text-only-section.hd-content-brief > .shell {
  padding: 24px 28px;
  box-shadow: none;
}
.v8-content-page .hd-content-brief .inner-section-heading {
  margin-bottom: 20px;
  gap: 16px;
}
.v8-content-page .text-only-section.hd-content-brief .inner-section-heading {
  margin-bottom: 0;
}
.v8-content-page .hd-content-brief .inner-section-heading h2 {
  font-size: clamp(23px, 2.2vw, 30px);
  line-height: 1.25;
  margin-block: 6px 12px;
}
.v8-content-page .hd-content-brief .inner-section-heading p { margin-bottom: 0; max-width: 980px; }
.v8-content-page .hd-content-brief .content-card { min-height: 0; padding: 22px; }
.v8-content-page > .closing-cta.hd-final-cta { padding-block: 36px; }
.v8-content-page > .closing-cta.hd-final-cta .closing-grid { min-height: 0; gap: 24px; }
.v8-content-page > .closing-cta.hd-final-cta h2 { font-size: clamp(26px, 2.7vw, 36px); }

/* Existing project facts, photos and videos form one evidence-led journey. */
.hd-project-detail .hd-project-facts { padding-block: 20px; }
.hd-project-detail .hd-project-facts .project-fact-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hd-project-detail .hd-project-facts dd { font-size: 15px; line-height: 1.5; }
.hd-project-detail > .content-section:not(.hd-content-brief) { padding-block: 44px; }
.hd-project-detail .section-heading { margin-bottom: 24px; }
.hd-project-detail .content-card-grid:has(.content-card-media) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hd-project-detail .content-card-media .equipment-thumb { aspect-ratio: 16 / 10; height: auto; min-height: 0; }
.hd-project-detail .hd-project-photo-link { display: block; width: 100%; height: 100%; }
.hd-project-detail .hd-project-photo-link:focus-visible { outline: 4px solid #ff7814; outline-offset: -4px; }
.hd-project-detail .project-related .section-heading h2,
.hd-project-detail .project-timeline .section-heading h2 { font-size: clamp(24px, 2.5vw, 30px); }
.hd-project-detail .project-related-grid > a { min-height: 0; padding: 16px; }
.hd-project-detail .project-inquiry-callout h2 { font-size: clamp(24px, 2.5vw, 32px); }
.hd-project-detail .hd-ytm-section { padding: 36px 24px; }
.hd-project-detail .hd-ytm-inner { max-width: 1280px; }
.hd-project-detail .hd-ytm-section h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 22px; }
.hd-project-detail .hd-ytm-main { gap: 28px; align-items: center; }

/* Non-media production notes stay readable without an empty full-screen band. */
main .ls-section:not(:has(img, video, iframe, table, form, [data-video-id])) { padding-block: 32px; }
main .ls-section:not(:has(img, video, iframe, table, form, [data-video-id])) > h2 { margin-bottom: 20px; }
main .ls-process { gap: 12px; margin-top: 22px; }
main .ls-process li { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-content: start; padding: 18px; min-height: 0; }
main .ls-process li > span { grid-column: 1; grid-row: 1 / 3; width: 32px; height: 32px; }
main .ls-process li > h3 { grid-column: 2; font-size: 18px; line-height: 1.3; margin: 3px 0 8px; }
main .ls-process li > p { grid-column: 2; margin: 0; font-size: 16px; line-height: 1.5; }
main .ls-card:not(:has(img, video, picture)) { min-height: 0; padding: 20px; }
main .ls-card:not(:has(img, video, picture)) h3 { font-size: 21px; margin-block: 10px; }
main .ls-card:not(:has(img, video, picture)) p { margin-bottom: 12px; }
main .ls-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* News bodies keep their real media; supporting links and final CTA are compact. */
.hd-news-editorial .hd-news-section { margin-block: 30px; }
.hd-news-editorial .hd-news-related,
.hd-news-editorial .hd-news-related-links { margin-block: 28px; }
.hd-news-editorial .hd-news-related h2,
.hd-news-editorial .hd-news-related-links h2 { font-size: 25px; margin-bottom: 18px; }
.hd-news-editorial .hd-news-link-card { padding: 16px; }
.hd-news-editorial .hd-news-cta { padding: 26px; margin-block: 30px; }
.hd-news-editorial .hd-news-cta h2 { font-size: 26px; margin-block: 10px 14px; }
@media (max-width: 1023px) {
  .hd-project-detail .hd-project-facts .project-fact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .v8-content-page > .inner-content-section.hd-content-brief { padding-block: 22px; }
  .v8-content-page > .text-only-section.hd-content-brief > .shell { padding: 20px; }
  .v8-content-page .hd-content-brief .inner-section-heading { grid-template-columns: 1fr; gap: 8px; }
  .hd-project-detail .hd-project-facts .project-fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-project-detail .hd-project-facts .project-fact-grid > div { padding: 13px; }
  .hd-project-detail .hd-project-facts dd { font-size: 14px; }
  .hd-project-detail .content-card-grid:has(.content-card-media) { grid-template-columns: minmax(0, 1fr); }
  .hd-project-detail > .content-section:not(.hd-content-brief) { padding-block: 30px; }
  .hd-project-detail .hd-ytm-section { padding: 28px 20px; }
  .hd-project-detail .hd-ytm-main { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hd-project-detail .project-inquiry-callout { align-items: flex-start; flex-direction: column; }
  .hd-project-detail .project-inquiry-callout .button { white-space: normal; max-width: 100%; }
  main .ls-hero-actions { flex-direction: column; align-items: flex-start; }
  main .ls-process li { padding: 16px; }
}

/* Mobile visitor reading order: product, lead time, proposal, real equipment.
 * Keep all existing content/links and carousel semantics in the DOM.
 */
@media (max-width: 600px) {
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide { gap: 12px; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-hero-copy { display: contents; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-hero-copy > * { order: 6; margin-block: 0; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-hero-copy > .clarity-kicker { order: 1; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-hero-copy > :is(h1,h2) { order: 2; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-hero-copy > .hd-commercial-delivery { order: 3; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-hero-copy > .clarity-actions { order: 4; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide > .clarity-hero-media { order: 5; margin-block: 0; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-hero-copy > .clarity-location { order: 7; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-actions { display: flex; align-items: center; gap: 12px; }
  body.hd-polish-system .hd-clarity-home .hd31-hero-slide .clarity-actions > .clarity-text-link { display: none; }
}

/* Preserve the exact Consent settings button and handler; place its mobile
 * re-open entry in document flow below the footer, not over photographs/forms.
 */
@media (max-width: 767px) {
  body.hd-polish-system .hd-consent-settings-launcher:not([hidden]) {
    position: static;
    display: block;
    width: max-content;
    max-width: calc(100% - 32px);
    min-height: 44px;
    margin: 16px auto calc(96px + env(safe-area-inset-bottom, 0px));
    /* The existing observer hides a FIXED launcher near the footer. This
     * launcher is now in normal flow, so that fixed-overlap class is moot. */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}
