.hiqe-root{max-width:900px;margin:20px auto;padding:18px;border-radius:12px;background:#fff;border:1px solid rgba(0,0,0,0.06);box-shadow:0 6px 18px rgba(0,0,0,0.04);font-family:Poppins,Arial,Helvetica,sans-serif}
.hiqe-topbar{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.hiqe-form-title{font-weight:700;color:#000;font-size:16px;text-align:left}
.hiqe-progress{width:100%;background:#e9f6ee;border-radius:8px;height:20px;overflow:hidden;position:relative}
.hiqe-progress-bar{height:100%;background:#1AA84F;width:0%;transition:width .35s ease}
.hiqe-progress-text{position:absolute;left:8px;top:0;height:100%;line-height:20px;font-size:12px;font-weight:700;color:#000;z-index:3;pointer-events:none}
.hiqe-header{display:flex;align-items:center;gap:12px;margin-bottom:6px}
.hiqe-logo{height:auto;max-width:126px;max-height:61px;object-fit:contain;display:block}
.hiqe-modal-logo{height:auto;max-width:140px;max-height:70px;object-fit:contain;display:block;margin:0 auto 8px}
.hiqe-question-number{font-weight:700;color:#000;margin-bottom:6px;font-size:13px}
.hiqe-step-title{color:#000;font-size:18px;font-weight:700;margin:0 0 6px 0}
.hiqe-step-sub{color:#000;margin-bottom:8px}
.hiqe-helper{font-style:italic;color:#000;margin:6px 0}
.hiqe-helper b{font-weight:700;font-style:normal}
.hiqe-cards{display:flex;flex-wrap:wrap;gap:12px}
.hiqe-card{flex:1 1 22%;min-width:120px;box-sizing:border-box;padding:10px;border-radius:10px;border:1px solid transparent;text-align:center;cursor:pointer;background:#f8fbff;transition:all .12s ease}
.hiqe-card:hover{transform:translateY(-3px)}
.hiqe-card img{max-width:100%;height:auto;object-fit:contain;margin-bottom:6px;display:block}
.hiqe-card.selected{border:2px solid #1A849E;box-shadow:0 6px 18px rgba(26,132,158,0.08)}
.hiqe-actions{display:flex;justify-content:space-between;align-items:center;margin-top:14px;gap:12px}
.hiqe-actions .hiqe-left{display:flex;gap:8px;align-items:center}
.hiqe-actions .hiqe-left .hiqe-btn{border-radius:9px}
.hiqe-actions .hiqe-right{display:flex;gap:8px;align-items:center}
.hiqe-actions .hiqe-btn{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:10px 12px;border-radius:9px;border:none;background:#1D7BE4;color:#fff;cursor:pointer;min-height:44px;box-sizing:border-box}
.hiqe-actions .hiqe-btn.secondary{background:#e04b4b}
.hiqe-actions .hiqe-btn:hover{background:#E92227;color:#fff}
.hiqe-input{width:100%;padding:10px;border:1px solid #ddd;border-radius:8px;box-sizing:border-box}
.hiqe-grid-6 .hiqe-card{flex-basis:16%}
.hiqe-grid-5 .hiqe-card{flex-basis:18%}
.hiqe-grid-4 .hiqe-card{flex-basis:22%}
.hiqe-grid-3 .hiqe-card{flex-basis:30%}
.hiqe-grid-2 .hiqe-card{flex-basis:48%}
.hiqe-card-label{white-space:normal;word-wrap:break-word;overflow-wrap:anywhere;font-size:14px;color:#111}

.hiqe-card.empty{background:transparent;border:none;box-shadow:none;cursor:default;padding:10px}

@media(max-width:800px){
  .hiqe-card{flex-basis:48%}
  .hiqe-card img{height:auto}
  .hiqe-actions{flex-direction:column-reverse;gap:8px}
  .hiqe-actions .hiqe-left{width:100%;justify-content:space-between}
  .hiqe-actions .hiqe-btn{width:100%}
}

@media(max-width:420px){
  .hiqe-card{flex-basis:100%}
  .hiqe-header{flex-direction:row;align-items:center}
  .hiqe-header .hiqe-logo{height:28px}
  .hiqe-step-title{font-size:16px}
  .hiqe-question-number{font-size:13px}
}

/* Modal - constrained + scroll */
.hiqe-modal{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;z-index:9999;padding:12px;box-sizing:border-box}
.hiqe-modal .box{background:#fff;padding:18px;border-radius:10px;max-width:760px;width:100%;text-align:center;box-sizing:border-box;max-height:calc(100vh - 60px);overflow:auto}
.hiqe-modal .box .hiqe-modal-logo{height:auto;max-width:140px;max-height:70px;object-fit:contain;display:block;margin:0 auto 8px}
.hiqe-modal .box h3{margin:8px 0;font-weight:700;color:#000}
.hiqe-modal .box h4{margin:6px 0;font-weight:600}
.hiqe-result-img{max-width:300px;max-height:300px;width:100%;height:auto;display:block;margin:12px auto}
.hiqe-modal .box img{max-width:300px;max-height:300px;width:100%;height:auto}

/* ensure tables inside the modal and the printable quote render left aligned */
.hiqe-modal .box table, .hiqe-estimate table, #hiqe-quote-print table { text-align: left; }
.hiqe-modal .box table th, .hiqe-modal .box table td, .hiqe-estimate table th, .hiqe-estimate table td { text-align: left; padding:8px; border-bottom:1px solid #eee }

/* print helper (when printing intentionally from quote modal script) */
@media print {
  body * { visibility: hidden; }
  .hiqe-printable, .hiqe-printable * { visibility: visible; }
  .hiqe-printable { position: absolute; left: 0; top: 0; width: 100%; }
}

/* small visual tweaks */
label{font-size:13px;color:#333;margin-bottom:6px;display:block}

/* Scoped fixes: force 4-column grid only for the two specified steps (system_type and square_footage).
   This does not change global .hiqe-grid-4 behavior — other steps remain using their existing gridClass rules. */

.hiqe-step[data-slug="system_type"] .hiqe-cards{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  align-items:start;
}
.hiqe-step[data-slug="system_type"] .hiqe-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  box-sizing:border-box;
  min-height:86px;
}
.hiqe-step[data-slug="system_type"] .hiqe-card img{max-height:86px;object-fit:contain}
.hiqe-step[data-slug="system_type"] .hiqe-card .hiqe-card-label{word-break:break-word;white-space:normal}

/* hide empty placeholder visuals while preserving grid slot spacing when JS injects placeholders */
.hiqe-step[data-slug="system_type"] .hiqe-card.empty{visibility:hidden;height:0;padding:0;margin:0;border:0;min-height:0}

/* square_footage uses 4-column grid so 5th & 6th items naturally fall into row 2 columns 1 & 2 */
.hiqe-step[data-slug="square_footage"] .hiqe-cards{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  align-items:start;
}
.hiqe-step[data-slug="square_footage"] .hiqe-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  box-sizing:border-box;
  min-height:120px;
}
.hiqe-step[data-slug="square_footage"] .hiqe-card img{max-height:120px;object-fit:contain}
.hiqe-step[data-slug="square_footage"] .hiqe-card .hiqe-card-label{word-break:break-word;white-space:normal}

/* responsive adjustments for the two scoped areas */
@media(max-width:980px){
  .hiqe-step[data-slug="system_type"] .hiqe-cards{grid-template-columns:repeat(2,1fr)}
  .hiqe-step[data-slug="system_type"] .hiqe-card{min-height:86px}
  .hiqe-step[data-slug="square_footage"] .hiqe-cards{grid-template-columns:repeat(2,1fr)}
  .hiqe-step[data-slug="square_footage"] .hiqe-card{min-height:100px}
}
@media(max-width:420px){
  .hiqe-step[data-slug="system_type"] .hiqe-cards{grid-template-columns:repeat(1,1fr)}
  .hiqe-step[data-slug="square_footage"] .hiqe-cards{grid-template-columns:repeat(1,1fr)}
  .hiqe-step[data-slug="system_type"] .hiqe-card img{max-height:80px}
  .hiqe-step[data-slug="square_footage"] .hiqe-card img{max-height:80px}
}
#hiqe-redirect-banner{position:fixed;left:0;top:0;right:0;background:#1d7be4;color:#fff;padding:12px;text-align:center;z-index:100000;font-weight:700}
