/* ============================================
   IN-HOUSE CALCULATOR — Form + Popup styles
   ============================================ */

.cmb-inh-wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  box-sizing: border-box;
}
.cmb-inh-wrap *,
.cmb-inh-wrap *::before,
.cmb-inh-wrap *::after {
  box-sizing: border-box;
}

/* -------- Header / intro -------- */
.cmb-inh-header {
  margin-bottom: 28px;
  padding: 24px 24px 20px;
  background: #EFF2FA;
  border-left: 5px solid #252D69;
  border-radius: 6px;
}
.cmb-inh-header h1 {
  margin: 0 0 6px;
  color: #252D69;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}
.cmb-inh-subhead {
  margin: 0 0 8px;
  color: #252D69;
  font-size: 16px;
  font-weight: 600;
  font-style: italic;
}
.cmb-inh-internal-title {
  margin: 0 0 14px !important;
  color: #555;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.cmb-inh-header p {
  margin: 0 0 10px;
  color: #212121;
  font-size: 15px;
  line-height: 1.6;
}
.cmb-inh-header p:last-child { margin-bottom: 0; }

/* -------- Form sections -------- */
#cmb-inh-form fieldset.cmb-inh-section {
  border: 1px solid #8084A7A3;
  border-radius: 6px;
  padding: 18px 22px 4px;
  margin: 0 0 22px;
  background: #ffffff;
  max-width: 100%;
}
#cmb-inh-form fieldset.cmb-inh-section legend {
  padding: 0 8px;
  color: #252D69;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#cmb-inh-form input[type="text"],
#cmb-inh-form input[type="number"],
#cmb-inh-form input[type="email"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cmb-inh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.cmb-inh-help {
  background: #EFF2FA;
  padding: 10px;
  margin-top: 6px;
  font-style: italic;
  border-left: 3px solid #252D69;
  font-size: 13px;
  line-height: 1.5;
  color: #212121;
}

/* -------- Popup container -------- */
.cmb-inh-popup-content {
  max-width: 920px;
  width: 96%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.cmb-inh-popup-content * {
  box-sizing: border-box;
}
.cmb-inh-popup-content > h4 {
  margin: 0 0 8px;
  padding-right: 30px;
  font-size: 18px;
  line-height: 1.3;
  word-wrap: break-word;
}

/* -------- Result table -------- */
.cmb-inh-result-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 14px;
}
.cmb-inh-result-table td,
.cmb-inh-result-table th {
  padding: 9px 14px;
  border-bottom: 1px solid #e0e6ed;
  vertical-align: middle;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.cmb-inh-result-table th:first-child,
.cmb-inh-result-table td:first-child {
  text-align: left;
  width: 65%;
}
.cmb-inh-result-table th:last-child,
.cmb-inh-result-table td:last-child {
  text-align: right;
  width: 35%;
  white-space: nowrap;
}

.cmb-inh-section-header th {
  background-color: #252D69 !important;
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 13px;
  padding: 10px 14px;
  text-align: left !important;
  white-space: normal !important;
  width: auto !important;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.cmb-inh-section-header th:nth-child(2) {
  text-align: right !important;
}

.cmb-inh-helper-row td {
  background: #f7f8fb !important;
  border: none;
  padding: 8px 14px;
  font-size: 12.5px;
  color: #555;
  text-align: left !important;
  white-space: normal !important;
  width: auto !important;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.cmb-inh-helper-row em {
  font-style: italic;
}

.cmb-inh-benefit-row td {
  background: #e9f7ef !important;
  border: none;
  border-left: 4px solid #2e7d32;
  padding: 10px 14px 10px 16px;
  font-size: 13px;
  font-style: normal;
  color: #1b5e20;
  line-height: 1.55;
  text-align: left !important;
  white-space: normal !important;
  word-break: normal;
  width: auto !important;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.cmb-inh-benefit-row td::before {
  content: "\2713\00a0";
  font-weight: 800;
  color: #2e7d32;
}
.cmb-inh-benefit-row b {
  color: #1b5e20;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cmb-inh-benefit-row.red td {
  background: #fdecea !important;
  border-left-color: #c0392b;
  color: #c0392b;
}
.cmb-inh-benefit-row.red td::before {
  color: #c0392b;
}
.cmb-inh-benefit-row.red b {
  color: #c0392b;
}

.cmb-inh-spacer td {
  padding: 4px 0 !important;
  border: none !important;
  background: transparent !important;
  width: auto !important;
}

.cmb-inh-subtotal-row td {
  background-color: #f2f5fb;
  font-weight: 700;
  border-top: 2px solid #8084A7A3;
  font-size: 15px;
}

.cmb-inh-total-row td {
  background-color: #e8f5e9;
  font-weight: 700;
  font-size: 17px;
  color: #2e7d32;
  border-top: 2px solid #2e7d32;
  padding: 14px;
}

.cmb-inh-result-table tr.red td {
  color: #c0392b;
}

.cmb-inh-closing {
  margin: 18px 0 6px;
  padding: 14px;
  background: #fff8e1;
  border-left: 4px solid #f0a91a;
  font-size: 14px;
  line-height: 1.6;
  color: #212121;
}

/* ============================================
   Responsive — Tablet (≤ 820px)
   ============================================ */
@media (max-width: 820px) {
  .cmb-inh-grid { grid-template-columns: 1fr; gap: 0; }

  .cmb-inh-header { padding: 20px 18px 16px; }
  .cmb-inh-header h1 { font-size: 24px; }
  .cmb-inh-subhead { font-size: 15px; }
  .cmb-inh-header p { font-size: 14px; }

  #cmb-inh-form fieldset.cmb-inh-section { padding: 14px 16px 2px; }

  .cmb-inh-popup-content {
    width: 96%;
    padding: 16px;
  }
  .cmb-inh-popup-content > h4 { font-size: 16px; }

  .cmb-inh-result-table { font-size: 13px; }
  .cmb-inh-result-table td,
  .cmb-inh-result-table th { padding: 8px 10px; }
}

/* Full-width tappable submit button on mobile */
@media (max-width: 600px) {
  #cmb-inh-form button[type="submit"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    margin-top: 4px;
  }
}

/* ============================================
   Responsive — Mobile (≤ 600px)
   ============================================ */
@media (max-width: 600px) {
  .cmb-inh-header { padding: 16px 14px 14px; margin-bottom: 18px; }
  .cmb-inh-header h1 { font-size: 20px; }
  .cmb-inh-subhead { font-size: 13.5px; }
  .cmb-inh-internal-title { font-size: 12px; }
  .cmb-inh-header p { font-size: 13.5px; line-height: 1.5; }

  #cmb-inh-form fieldset.cmb-inh-section {
    padding: 12px 12px 2px;
    margin-bottom: 16px;
  }
  #cmb-inh-form fieldset.cmb-inh-section legend {
    font-size: 13px;
  }

  .cmb-inh-help { font-size: 12px; padding: 8px; }

  .cmb-popup { padding-top: 20px; }

  .cmb-inh-popup-content {
    width: 98%;
    padding: 12px;
    max-height: 92vh;
    overflow-y: auto;
  }
  .cmb-inh-popup-content > h4 {
    font-size: 15px;
    padding-right: 26px;
  }

  .cmb-inh-result-table { font-size: 12.5px; }
  .cmb-inh-result-table td,
  .cmb-inh-result-table th {
    padding: 7px 8px;
  }
  .cmb-inh-result-table th:first-child,
  .cmb-inh-result-table td:first-child { width: 58%; }
  .cmb-inh-result-table th:last-child,
  .cmb-inh-result-table td:last-child { width: 42%; }

  .cmb-inh-section-header th { font-size: 11.5px; padding: 8px 10px; letter-spacing: 0.3px; }
  .cmb-inh-helper-row td { font-size: 11.5px; padding: 7px 10px; }
  .cmb-inh-benefit-row td { font-size: 12px; padding: 7px 10px; }

  .cmb-inh-subtotal-row td { font-size: 13.5px; }
  .cmb-inh-total-row td { font-size: 14.5px; padding: 11px 10px; }

  .cmb-inh-closing { font-size: 12.5px; padding: 11px; }
}

/* ============================================
   Responsive — Small mobile (≤ 400px)
   ============================================ */
@media (max-width: 400px) {
  .cmb-inh-header h1 { font-size: 18px; }
  .cmb-inh-popup-content { padding: 10px; }
  .cmb-inh-result-table { font-size: 11.5px; }
  .cmb-inh-result-table td,
  .cmb-inh-result-table th { padding: 6px 6px; }
  .cmb-inh-result-table th:first-child,
  .cmb-inh-result-table td:first-child { width: 55%; }
  .cmb-inh-result-table th:last-child,
  .cmb-inh-result-table td:last-child { width: 45%; }
}
