/* Consistent dialog proportions, with scrolling when the keyboard reduces space. */
:root{--form-vh:100dvh}
#inquiry-dialog,#water-test-dialog{width:min(650px,calc(100vw - 24px),calc(var(--form-vh) - 24px));height:min(650px,calc(100vw - 24px),calc(var(--form-vh) - 24px));max-height:calc(var(--form-vh) - 24px);max-width:650px;padding:0;border-radius:24px;overflow:hidden}
#inquiry-dialog[open],#water-test-dialog[open]{display:flex;flex-direction:column}
#inquiry-dialog .test-topline,#water-test-dialog .test-topline{flex:none;min-height:68px;padding:12px 24px}
#inquiry-dialog .inquiry-brand img,#water-test-dialog .test-brand img{width:220px;height:44px}
#inquiry-dialog .dialog-close,#water-test-dialog .dialog-close{top:12px;right:12px;width:40px;height:40px;font-size:28px}
#inquiry-dialog .test-progress,#water-test-dialog .test-progress{flex:none;margin:0 24px;padding:0;height:3px}
#inquiry-form,#water-test-form{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;padding:22px 26px 26px;overscroll-behavior:contain}
#inquiry-dialog .dialog-heading,#inquiry-form .dialog-heading{padding:0;flex:none}
#inquiry-dialog .dialog-heading h2,.test-step h2{font-size:28px;line-height:1.15;margin:0 0 10px;letter-spacing:-.6px}
#inquiry-dialog .dialog-heading p,.test-description{font-size:13px;line-height:1.5;margin:0 0 20px}
#inquiry-form .test-back,#water-test-form .test-back{flex:none;width:32px;height:32px;margin:0 0 12px;padding:6px}
/* Keep each step's heading anchored when Back first becomes available. */
#inquiry-form .test-back[hidden],#water-test-form .test-back[hidden]{display:block!important;visibility:hidden;pointer-events:none}
.inquiry-step{flex:1;min-height:min-content}
.inquiry-property-options{height:100%;min-height:200px;align-items:stretch}
.inquiry-property-options .inquiry-option{min-height:180px;padding:20px 12px}
#inquiry-service-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(110px,1fr));height:100%;gap:10px}
#inquiry-service-options .inquiry-option{min-height:110px;padding:16px 10px;gap:8px;border-radius:14px}
#inquiry-service-options .inquiry-option strong{font-size:14px;line-height:1.3}
#inquiry-service-options .inquiry-option span{font-size:12px;line-height:1.4}
#inquiry-form .inquiry-selection{padding:8px 10px;font-size:12px;margin:0 0 14px}
#inquiry-form .form-grid{gap:12px;grid-template-columns:1fr 1fr}
#inquiry-form label,#question-form label{font-size:12px;gap:6px}
#inquiry-form input,#inquiry-form select,#question-form input,.test-field input{min-height:42px;height:42px;padding:9px 11px;font-size:16px}
#inquiry-form textarea,#question-form textarea{height:100px;min-height:0;padding:10px;font-size:16px;resize:none}
#question-form textarea{min-height:100px;overflow:hidden}
#inquiry-form .inquiry-submit,#water-test-form .test-next,#question-form .primary{margin-top:16px;min-height:44px;padding:10px 16px;font-size:14px}
.test-stage{display:flex;flex:1;min-height:min-content}
.test-step{flex:1;display:flex;flex-direction:column;min-width:0}
.test-choices,.test-source-options{flex:1;gap:12px;grid-template-rows:repeat(2,minmax(100px,1fr));margin:0}
.test-choice,.test-source-options label{min-width:0;display:flex}
.test-choice-body,.test-source-options label>span{width:100%;height:100%;min-height:100px;padding:16px 12px}
.test-option-icon,.test-source-options svg{width:32px;height:32px;margin-bottom:10px}
.test-choice-body strong,.test-source-options label>span{font-size:14px}
.test-choice-body>span:not(.choice-check){font-size:12px}
.test-details-grid{grid-template-columns:1fr;gap:14px}
.test-step[data-test-step="2"]>.test-field{margin-top:14px}
#water-test-form .test-navigation{flex:none;padding:0;border:0;margin-top:18px}
#water-test-form .test-next{margin:0}
.test-error{flex:none;font-size:12px;line-height:1.4;margin:10px 0 0}
#inquiry-result,.test-success{flex:1;min-height:0;overflow:auto;padding:30px 26px}
#inquiry-summary,#question-draft{display:none}
#inquiry-result .success-mark{width:44px;height:44px;margin:0 auto 16px;font-size:24px}
#inquiry-result h3{font-size:26px;margin:12px 0}
#inquiry-result p,.test-success p{font-size:14px;line-height:1.6}
.test-success-icon{width:64px;height:64px;margin:0 auto 20px}
.test-success h2{font-size:30px}
@media(max-width:600px){
 #inquiry-dialog,#water-test-dialog{width:min(420px,calc(100vw - 24px));height:min(560px,calc((100vw - 24px) * 4 / 3));max-height:calc(var(--form-vh) - 24px);border-radius:22px}
 #inquiry-dialog .test-topline,#water-test-dialog .test-topline{min-height:58px;padding:8px 18px}
 #inquiry-dialog .inquiry-brand img,#water-test-dialog .test-brand img{width:190px;height:40px}
 #inquiry-dialog .dialog-close,#water-test-dialog .dialog-close{top:8px;right:8px}
 #inquiry-dialog .test-progress,#water-test-dialog .test-progress{margin-inline:18px}
 #inquiry-form,#water-test-form{padding:16px 18px 20px}
 #inquiry-form .form-grid{grid-template-columns:1fr}
 #inquiry-dialog .dialog-heading h2,.test-step h2{font-size:24px}
 #inquiry-dialog .dialog-heading p,.test-description{font-size:12px;margin-bottom:14px}
 #inquiry-form .test-back,#water-test-form .test-back{margin-bottom:10px}
 .inquiry-property-options{min-height:180px}
 .inquiry-property-options .inquiry-option{min-height:150px;padding:16px 10px}
 #inquiry-service-options{gap:8px;grid-template-rows:repeat(2,minmax(105px,1fr))}
 #inquiry-service-options .inquiry-option{padding:12px 6px;min-height:105px}
 #inquiry-service-options .inquiry-option strong{font-size:12px}
 #inquiry-service-options .inquiry-option span{display:none}
 .test-choices,.test-source-options{gap:8px;grid-template-rows:repeat(2,minmax(96px,1fr))}
 .test-choice-body,.test-source-options label>span{min-height:96px;padding:12px 8px;font-size:13px}
 .test-choice-body strong{font-size:13px}.test-choice-body>span:not(.choice-check){font-size:11px}
 .test-option-icon,.test-source-options svg{width:28px;height:28px;margin-bottom:8px}
 .test-details-grid{gap:10px}.test-step[data-test-step="2"]>.test-field{margin-top:10px}
}
/* The separate product-question dialog retains its compact layout. */
#question-dialog{width:min(560px,calc(100vw - 24px));max-height:calc(var(--form-vh) - 24px);padding:22px 24px;border-radius:22px;overflow:auto}
.question-logo{width:190px;margin:0 0 12px}#question-dialog h2{font-size:27px;margin:0 0 8px}#question-product{margin:0 0 16px;font-size:13px}#question-form{gap:12px}.question-fields{grid-template-columns:1fr 1fr;gap:12px}#question-form .primary{margin:0}.bag-preview-note{font-size:11px}
.fit-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;min-height:40px}
.fit-pager button{border:1px solid #d6e5ed;background:#eff8fc;border-radius:10px;padding:9px 14px;font:500 13px/1.3 'DM Sans',Arial,sans-serif;color:#126180;min-height:40px;cursor:pointer}
.fit-pager span{margin-inline:auto;font-size:11px;color:#687d8b}.fit-pager .fit-continue{background:var(--brand-blue);color:white;border-color:var(--brand-blue)}
@media(max-width:400px){.question-fields{grid-template-columns:1fr}}
html[data-form-size=tiny] #question-dialog{padding:12px 16px}html[data-form-size=tiny] .question-logo,html[data-form-size=tiny] #question-product,html[data-form-size=tiny] #question-form .bag-preview-note{display:none}

/* Requested water-test refinements: isolated from the inquiry form. */
#water-test-form .test-back{box-sizing:border-box;width:33.6px;height:33.6px;min-width:33.6px;min-height:33.6px;padding:0;border-radius:50%;display:grid;place-items:center;line-height:1}
#water-test-form .test-back svg{display:block;width:21px;height:21px;flex:none}
#water-test-dialog .test-progress,#water-test-dialog .test-progress>span{height:3.45px}
#water-test-dialog .test-progress>span{border-radius:999px}
#water-test-form [data-test-step="1"] .test-field-label{margin-top:10px}

/* Square Home / Business choices in a dialog that fits its content. */
#inquiry-dialog:has(#inquiry-form:not([hidden]) [data-inquiry-step="0"]:not([hidden])){height:fit-content}
#inquiry-dialog:has(#inquiry-form:not([hidden]) [data-inquiry-step="0"]:not([hidden])) #inquiry-form{flex:0 1 auto}
#inquiry-form [data-inquiry-step="0"]{flex:none}
.inquiry-property-options{height:auto;min-height:0}
.inquiry-property-options .inquiry-option{height:auto;min-height:0;aspect-ratio:1}

