/* v234 — mobile result and estimate text normalization */
@media (max-width: 760px) {
  /* Keep every result container inside the viewport. */
  .calc-wizard-step-v226[data-step="5"],
  .calc-wizard-step-v219[data-step="4"],
  .calc-wizard-step-v226[data-step="5"] #results,
  .calc-wizard-step-v219[data-step="4"] #results,
  .calc-wizard-step-v226[data-step="5"] .result-card,
  .calc-wizard-step-v219[data-step="4"] .result-card,
  .calc-wizard-step-v226[data-step="5"] .summary-card,
  .calc-wizard-step-v219[data-step="4"] .summary-card,
  .calc-wizard-step-v226[data-step="5"] .estimate-card,
  .calc-wizard-step-v219[data-step="4"] .estimate-card,
  .calc-wizard-step-v226[data-step="5"] .estimate-box,
  .calc-wizard-step-v226[data-step="5"] .slab-estimate {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Result cards: one readable row, never a narrow text column. */
  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid),
  .calc-wizard-step-v219[data-step="4"] .result-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article {
    display: grid !important;
    grid-template-columns: 62px minmax(0, 1fr) !important;
    grid-template-areas:
      "icon label"
      "icon value"
      "icon meta" !important;
    column-gap: 14px !important;
    row-gap: 4px !important;
    align-items: center !important;
    justify-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 116px !important;
    padding: 14px !important;
    text-align: left !important;
    overflow: hidden !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article.total,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article.total {
    grid-column: auto !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article > img,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article > img {
    grid-area: icon !important;
    align-self: center !important;
    justify-self: center !important;
    width: 58px !important;
    height: 58px !important;
    min-width: 0 !important;
    max-width: 58px !important;
    margin: 0 !important;
    object-fit: contain !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article > small,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article > small {
    grid-area: label !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    overflow: visible !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article > small span,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article > small span {
    display: inline !important;
    width: auto !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article > b,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article > b {
    grid-area: value !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: clamp(22px, 6.8vw, 30px) !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article > em,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article > em {
    grid-area: meta !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    overflow: visible !important;
  }

  /* Compact summary cards also need full-width labels. */
  .calc-wizard-step-v226[data-step="5"] :is(.mini-results, .slab-stats),
  .calc-wizard-step-v219[data-step="4"] .mini-results {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.mini-results article, .slab-stats span),
  .calc-wizard-step-v219[data-step="4"] .mini-results article {
    width: 100% !important;
    min-width: 0 !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.mini-results, .slab-stats) :is(small, b, em, span),
  .calc-wizard-step-v219[data-step="4"] .mini-results :is(small, b, em, span) {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }

  /* Estimate rows: label above value prevents vertical or one-word-per-line captions. */
  .calc-wizard-step-v226[data-step="5"] :is(.estimate-card, .estimate-box, .slab-estimate) table,
  .calc-wizard-step-v219[data-step="4"] .estimate-card table,
  .calc-wizard-step-v226[data-step="5"] :is(.estimate-card, .estimate-box, .slab-estimate) tbody,
  .calc-wizard-step-v219[data-step="4"] .estimate-card tbody,
  .calc-wizard-step-v226[data-step="5"] :is(.estimate-card, .estimate-box, .slab-estimate) tr,
  .calc-wizard-step-v219[data-step="4"] .estimate-card tr {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.estimate-card, .estimate-box, .slab-estimate) td,
  .calc-wizard-step-v219[data-step="4"] .estimate-card td {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 3px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 7px 0 !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.estimate-card, .estimate-box, .slab-estimate) td::before,
  .calc-wizard-step-v219[data-step="4"] .estimate-card td::before {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 2px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }
}

@media (max-width: 380px) {
  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    column-gap: 11px !important;
    padding: 12px !important;
  }

  .calc-wizard-step-v226[data-step="5"] :is(.result-grid, .slab-result-grid) > article > img,
  .calc-wizard-step-v219[data-step="4"] .result-grid > article > img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
  }
}


/* v235 — unify all mobile result and estimate card layouts across calculator templates */
@media (max-width: 760px) {
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6){
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:10px !important;
    width:100% !important;
    min-width:0 !important;
  }

  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article{
    display:grid !important;
    grid-template-columns:58px minmax(0,1fr) !important;
    grid-template-areas:
      "icon label"
      "icon value"
      "icon meta" !important;
    align-items:center !important;
    column-gap:12px !important;
    row-gap:4px !important;
    width:100% !important;
    min-width:0 !important;
    min-height:116px !important;
    padding:14px !important;
    box-sizing:border-box !important;
    text-align:left !important;
    overflow:hidden !important;
  }

  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > img,
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > .result-icon,
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > span:first-child{
    grid-area:icon !important;
    align-self:center !important;
    justify-self:center !important;
    width:58px !important;
    max-width:58px !important;
    min-width:0 !important;
    margin:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > .result-icon img,
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > span:first-child img,
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > img{
    width:54px !important;
    height:54px !important;
    max-width:54px !important;
    margin:0 !important;
    object-fit:contain !important;
  }

  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > small{
    grid-area:label !important;
    display:block !important;
    margin:0 !important;
    min-width:0 !important;
    width:100% !important;
    text-align:left !important;
    font-size:13px !important;
    line-height:1.3 !important;
    color:#43544c !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    hyphens:none !important;
    writing-mode:horizontal-tb !important;
    text-orientation:mixed !important;
  }

  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > b{
    grid-area:value !important;
    display:block !important;
    margin:0 !important;
    min-width:0 !important;
    width:100% !important;
    text-align:left !important;
    font-size:clamp(22px,6.8vw,30px) !important;
    line-height:1.12 !important;
    color:#0f1720 !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    hyphens:none !important;
    writing-mode:horizontal-tb !important;
    text-orientation:mixed !important;
  }

  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > em{
    grid-area:meta !important;
    display:block !important;
    margin:0 !important;
    min-width:0 !important;
    width:100% !important;
    text-align:left !important;
    font-style:normal !important;
    font-size:12px !important;
    line-height:1.3 !important;
    color:#607068 !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    hyphens:none !important;
    writing-mode:horizontal-tb !important;
    text-orientation:mixed !important;
  }

  :where(.mini-results,.slab-stats,.plan-stats){
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:10px !important;
    width:100% !important;
    min-width:0 !important;
  }
  :where(.mini-results article,.slab-stats span,.plan-stats span){
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    padding:14px !important;
    box-sizing:border-box !important;
  }
  :where(.mini-results article,.slab-stats span,.plan-stats span) :is(small,b,em){
    display:block !important;
    min-width:0 !important;
    max-width:100% !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    hyphens:none !important;
    writing-mode:horizontal-tb !important;
    text-orientation:mixed !important;
  }

  :where(.estimate-card,.estimate-box,.slab-estimate){
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    overflow:hidden !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) .table-wrap,
  :where(.estimate-card,.estimate-box,.slab-estimate) .table-scroll-v173{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    overflow:visible !important;
    border:0 !important;
    border-radius:0 !important;
    margin-top:14px !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) table,
  :where(.estimate-card,.estimate-box,.slab-estimate) thead,
  :where(.estimate-card,.estimate-box,.slab-estimate) tbody,
  :where(.estimate-card,.estimate-box,.slab-estimate) tfoot,
  :where(.estimate-card,.estimate-box,.slab-estimate) tr,
  :where(.estimate-card,.estimate-box,.slab-estimate) th,
  :where(.estimate-card,.estimate-box,.slab-estimate) td{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) thead{display:none !important;}
  :where(.estimate-card,.estimate-box,.slab-estimate) tbody,
  :where(.estimate-card,.estimate-box,.slab-estimate) tfoot{
    display:grid !important;
    gap:10px !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) tr{
    box-sizing:border-box !important;
    background:#fff !important;
    border:1px solid #dfece4 !important;
    border-radius:16px !important;
    padding:12px 14px !important;
    margin:0 !important;
    box-shadow:0 8px 22px rgba(16,44,25,.045) !important;
    overflow:hidden !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) tr.estimate-section{
    background:#f5faf6 !important;
    border-color:#d5e7da !important;
    padding:10px 14px !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) tr.estimate-section td{
    display:block !important;
    padding:0 !important;
    font-size:14px !important;
    font-weight:900 !important;
    color:#193126 !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) tr.estimate-section td::before{
    display:none !important;
    content:none !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) td{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:3px !important;
    box-sizing:border-box !important;
    padding:7px 0 !important;
    border:0 !important;
    text-align:left !important;
    font-size:14px !important;
    line-height:1.34 !important;
    color:#102219 !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    hyphens:none !important;
    writing-mode:horizontal-tb !important;
    text-orientation:mixed !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) td::before{
    content:attr(data-label) !important;
    display:block !important;
    width:100% !important;
    margin:0 0 2px !important;
    color:#5c6f63 !important;
    font-size:11px !important;
    line-height:1.2 !important;
    font-weight:900 !important;
    text-transform:uppercase !important;
    letter-spacing:.045em !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
    hyphens:none !important;
  }
  :where(.estimate-card,.estimate-box,.slab-estimate) tfoot tr{
    background:#f4fcf6 !important;
    font-weight:900 !important;
  }
}

@media (max-width: 380px) {
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article{
    grid-template-columns:50px minmax(0,1fr) !important;
    column-gap:10px !important;
    padding:12px !important;
  }
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > .result-icon img,
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > span:first-child img,
  :where(.result-grid,.slab-result-grid,.result-cards,.results-v6) > article > img{
    width:48px !important;
    height:48px !important;
    max-width:48px !important;
  }
}


/* v237 — final slab and specialised estimate labels */
@media (max-width: 760px) {
  :where(.estimate-card,.estimate-box,.slab-estimate) td[data-label=""]::before,
  :where(.estimate-card,.estimate-box,.slab-estimate) td.mobile-total-title-v237::before {
    display:none !important;
    content:none !important;
  }

  :where(.estimate-card,.estimate-box,.slab-estimate) td.mobile-total-title-v237 {
    padding-bottom:2px !important;
    font-weight:900 !important;
    color:#183225 !important;
  }

  .slab-estimate tbody tr:not(.estimate-section) td,
  .slab-estimate tfoot tr td {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:3px !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
  }

  .slab-estimate tbody tr:not(.estimate-section) td::before,
  .slab-estimate tfoot tr td::before {
    display:block !important;
    width:100% !important;
    color:#556b5f !important;
    font-size:11px !important;
    line-height:1.2 !important;
    font-weight:900 !important;
    text-transform:uppercase !important;
    letter-spacing:.04em !important;
  }
}
