/* GlassQuote v277 — shared iPhone viewport, estimator alignment and PDF action fixes. */
:root{
  --gq-app-height:100dvh;
  --gq-visible-height:100dvh;
}

html.gq-estimator-active{
  width:100%;
  height:100%;
  overflow:hidden!important;
  overscroll-behavior:none;
}

body.gqt-open,
body.estimator-mode:not(.site-browse-mode){
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:var(--gq-app-height)!important;
  min-height:var(--gq-app-height)!important;
  max-height:var(--gq-app-height)!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}

body.gqt-open .quote-zone,
body.estimator-mode:not(.site-browse-mode) .quote-zone,
body.gqt-open .quote-zone>.wrap,
body.estimator-mode:not(.site-browse-mode) .quote-zone>.wrap,
body.gqt-open .quote-shell,
body.estimator-mode:not(.site-browse-mode) .quote-shell,
body.gqt-open .quote-body,
body.estimator-mode:not(.site-browse-mode) .quote-body{
  width:100%!important;
  height:var(--gq-app-height)!important;
  min-height:var(--gq-app-height)!important;
  max-height:var(--gq-app-height)!important;
  overflow:hidden!important;
}

body.gqt-open .gqt-step,
body.estimator-mode:not(.site-browse-mode) .calc-contact-card,
body.estimator-mode:not(.site-browse-mode) .fallback-card,
body.estimator-mode:not(.site-browse-mode) .postal-start-step,
body.estimator-mode:not(.site-browse-mode) .quote-summary-card,
body.estimator-mode:not(.site-browse-mode) .step-view,
body.estimator-mode:not(.site-browse-mode) .loading,
body.estimator-mode:not(.site-browse-mode) .result-priority{
  width:100%!important;
  height:var(--gq-app-height)!important;
  min-height:var(--gq-app-height)!important;
  max-height:var(--gq-app-height)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  scroll-behavior:auto!important;
  scroll-padding-top:calc(104px + env(safe-area-inset-top,0px))!important;
}

body.gqt-open .gqt-step,
body.estimator-mode:not(.site-browse-mode) .calc-contact-card,
body.estimator-mode:not(.site-browse-mode) .fallback-card,
body.estimator-mode:not(.site-browse-mode) .postal-start-step,
body.estimator-mode:not(.site-browse-mode) .quote-summary-card,
body.estimator-mode:not(.site-browse-mode) .step-view{
  padding-top:calc(104px + env(safe-area-inset-top,0px))!important;
}

/* Keep the whole result beginning below the fixed estimator header after iOS closes the keyboard. */
body.gqt-open .gqt-result,
body.estimator-mode:not(.site-browse-mode) .result-priority{
  padding-top:calc(112px + env(safe-area-inset-top,0px))!important;
  align-items:stretch!important;
}

body.gqt-open .gqt-result>*{
  width:100%;
  max-width:720px;
  margin-left:auto!important;
  margin-right:auto!important;
}

body.gqt-open .gqt-result-card{
  width:100%!important;
  max-width:720px!important;
  margin:16px auto 0!important;
  padding-left:clamp(14px,4vw,22px)!important;
  padding-right:clamp(14px,4vw,22px)!important;
}

body.gqt-open .gqt-result-grid,
body.gqt-open .gqt-result-actions{
  width:100%;
  align-items:stretch;
}

body.gqt-open .gqt-result-stat,
body.gqt-open .gqt-result-actions>*{
  min-width:0;
  width:100%;
}

body.gqt-open .gqt-result-stat b{
  overflow-wrap:anywhere;
}

/* iOS must not zoom text inputs or pan the outer page. */
body.gqt-open .gqt-field input,
body.estimator-mode:not(.site-browse-mode) input,
body.estimator-mode:not(.site-browse-mode) textarea,
body.estimator-mode:not(.site-browse-mode) select{
  font-size:16px!important;
  transform:none!important;
}

body.gqt-open .gqt-contact,
body.estimator-mode:not(.site-browse-mode) .calc-contact-card,
body.estimator-mode:not(.site-browse-mode) .postal-start-step{
  justify-content:flex-start!important;
  overflow-anchor:none!important;
}

/* Fixed bottom controls stay on the visible viewport instead of the document's old keyboard offset. */
body.gqt-open .gqt-bottom,
body.estimator-mode:not(.site-browse-mode) .step-actions{
  bottom:0!important;
  transform:translate3d(0,0,0)!important;
  will-change:transform;
}

/* Download action shared by the full estimator and every duration page. */
.gq-download-pdf{
  width:100%!important;
  min-height:54px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  padding:12px 16px!important;
  border:1px solid #cbdce8!important;
  border-radius:16px!important;
  background:#fff!important;
  color:#174f78!important;
  font:900 .86rem/1.1 Inter,system-ui,sans-serif!important;
  text-align:center!important;
  text-decoration:none!important;
  box-shadow:0 6px 18px rgba(7,29,53,.05)!important;
  cursor:pointer!important;
}
.gq-download-pdf::before{
  content:"↓";
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:7px;
  background:#e9f4fb;
  color:#0b5c9e;
  font-size:.95rem;
  font-weight:950;
}
.gq-download-pdf:active{transform:scale(.985)!important}
.gq-download-pdf[disabled]{opacity:.58;cursor:wait!important}

body.estimator-mode:not(.site-browse-mode) .result-app-card.priority-panel>.gq-download-pdf{
  max-width:620px!important;
  margin:10px auto 0!important;
}

@media(max-width:520px){
  body.gqt-open .gqt-result-grid,
  body.gqt-open .gqt-result-actions{
    grid-template-columns:1fr!important;
  }
  body.gqt-open .gqt-result-actions .gqt-primary{
    grid-column:auto!important;
  }
  body.gqt-open .gqt-result-card{
    border-radius:19px!important;
  }
}

@media(max-height:700px){
  body.gqt-open .gqt-step,
  body.estimator-mode:not(.site-browse-mode) .calc-contact-card,
  body.estimator-mode:not(.site-browse-mode) .fallback-card,
  body.estimator-mode:not(.site-browse-mode) .postal-start-step,
  body.estimator-mode:not(.site-browse-mode) .quote-summary-card,
  body.estimator-mode:not(.site-browse-mode) .step-view{
    padding-top:calc(96px + env(safe-area-inset-top,0px))!important;
  }
  body.gqt-open .gqt-result,
  body.estimator-mode:not(.site-browse-mode) .result-priority{
    padding-top:calc(104px + env(safe-area-inset-top,0px))!important;
  }
}
