/* Hendese adaptive result layout — v19.18.0
 * Compact results live beside the form from the very top.
 * Wide / long / document-like results automatically expand below the form.
 */
@media (min-width:901px){
  .ht-wrap .ht-layout{
    display:grid!important;
    grid-template-columns:minmax(0,1.72fr) minmax(280px,.58fr)!important;
    grid-template-areas:"calculator result"!important;
    gap:18px!important;
    align-items:start!important;
  }
  .ht-wrap .ht-layout>.ht-calculator{
    grid-area:calculator!important;
    min-width:0!important;
    align-self:start!important;
  }
  .ht-wrap .ht-layout>.ht-result{
    grid-area:result!important;
    align-self:start!important;
    justify-self:stretch!important;
    margin-top:0!important;
    top:88px!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    position:sticky!important;
  }

  /* A wide result changes the layout instead of forcing long content into a narrow rail. */
  .ht-wrap.ht-result-layout-wide .ht-layout{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"calculator" "result"!important;
    gap:20px!important;
  }
  .ht-wrap.ht-result-layout-wide .ht-layout>.ht-result{
    position:relative!important;
    top:auto!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    text-align:right!important;
  }
  .ht-wrap.ht-result-layout-wide .ht-result-value{
    max-width:100%!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  .ht-wrap.ht-result-layout-wide .ht-result-note,
  .ht-wrap.ht-result-layout-wide .ht-result-details,
  .ht-wrap.ht-result-layout-wide .ht-rich-text{
    text-align:right!important;
  }
  .ht-wrap.ht-result-layout-wide .ht-result-note table,
  .ht-wrap.ht-result-layout-wide .ht-result-details table,
  .ht-wrap.ht-result-layout-wide .ht-rich-text table{
    width:100%!important;
    max-width:100%!important;
  }

  /* The rental tool previously forced a one-column layout. Let the adaptive engine decide. */
  .ht-wrap[data-tool="rental_contract_builder"]:not(.ht-result-layout-wide) .ht-layout{
    grid-template-columns:minmax(0,1.72fr) minmax(280px,.58fr)!important;
    grid-template-areas:"calculator result"!important;
  }
  .ht-wrap[data-tool="rental_contract_builder"]:not(.ht-result-layout-wide) .ht-result{
    position:sticky!important;
    top:88px!important;
  }
}

/* Medium and small screens always prioritize readable full-width results. */
@media (max-width:900px){
  .ht-wrap .ht-layout,
  .ht-wrap.ht-result-layout-wide .ht-layout{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"calculator" "result"!important;
    gap:16px!important;
  }
  .ht-wrap .ht-layout>.ht-calculator{grid-area:calculator!important;min-width:0!important}
  .ht-wrap .ht-layout>.ht-result{
    grid-area:result!important;
    position:relative!important;
    top:auto!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
  }
}
