/* Long reference URLs must wrap within their column, including tablet layouts. */
a,
.link {
  overflow-wrap: anywhere;
}

/* Keep wide calculation tables scrollable locally, without clipping results. */
.table-responsive {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

/* Stack calculator pages through tablet widths; keep the directory menu first
   on the financial-calculator landing page, which has no form. */
@media (max-width: 991px) {
  .toppading > .row:has(form) > .col-md-4 {
    width: 100%;
    order: 2;
    margin-top: 2rem;
  }

  .toppading > .row:has(form) > .col-md-8 {
    width: 100%;
    order: 1;
    padding-top: 0;
    padding-right: 12px;
  }

  .toppading > .row:has(form) .leftTable .link {
    width: 100%;
  }

  .caption {
    display: block;
    padding: 0.5rem 0 1rem;
  }

  .tableOuter {
    margin-top: 0;
  }

  .tab-pane .col-md-6 {
    width: 100%;
  }

  form .row > [class*="col-sm-"] {
    width: 100% !important; /* Overrides legacy inline label widths. */
  }

  form .row > .col-sm-1 {
    margin-top: 0.5rem;
  }

  .form-control,
  .form-select {
    min-height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 737px) {
  .result {
    padding-left: 0;
  }

  .result li {
    max-width: 100%;
    margin-left: 0;
    overflow-wrap: anywhere;
  }
}
