* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #111111;
  background: #f2f2f2;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.45;
}

.page {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 36px 20px 60px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #999999;
}

.masthead {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.section-nav {
  display: grid;
  gap: 1px;
}

.section-nav a {
  color: #111111;
  font-size: 0.95rem;
  text-decoration: underline;
  white-space: nowrap;
}

.disclaimer {
  flex-basis: 100%;
  width: 100%;
  max-width: none;
  margin: 0;
  color: #333333;
}

h1,
h2 {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid #bbbbbb;
  font-size: 1.35rem;
}

.calculation-section {
  margin-bottom: 0;
  padding-bottom: 42px;
}

.section-title {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 0;
  padding: 8px 0;
  border-bottom: 1px solid #bbbbbb;
  background: #f2f2f2;
}

.top-link {
  margin-left: auto;
  color: #111111;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: underline;
}

.section-title h2 {
  margin-bottom: 0;
  border-bottom: 0;
}

.section-title p {
  flex-basis: 100%;
  margin: -8px 0 8px;
  color: #333333;
}

.reset-button {
  border: 0;
  padding: 0;
  color: #111111;
  background: transparent;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
}

.page-reset-button {
  margin-left: auto;
  white-space: nowrap;
}

.fdic-lookup {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin: 0 0 24px;
}

.fdic-lookup button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #999999;
  background: #eeeeee;
  color: #111111;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
  cursor: pointer;
}

.fdic-lookup p {
  flex-basis: 100%;
  margin: 0;
  color: #333333;
}

#fdicSearch {
  width: 260px;
}

#fdicCitySearch {
  width: 150px;
}

#fdicStateSearch {
  width: 54px;
  text-transform: uppercase;
}

#fdicCertSearch {
  width: 74px;
}

.source-section {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid #999999;
}

.source-section ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.source-section li {
  margin-bottom: 10px;
}

.source-section a {
  color: #111111;
  text-decoration: underline;
}

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin: 0 0 22px;
}

.section-title + .fdic-lookup,
.section-title + .formula {
  margin-top: 18px;
}

.formula > span,
.formula > label {
  white-space: nowrap;
}

.formula > span:first-child {
  font-size: 0.84rem;
  font-weight: 700;
}

.formula > span:not(:first-child):not(.result-line) {
  font-size: 1rem;
  line-height: 1.1;
}

.compact-formula {
  gap: 5px;
}

.compact-formula input {
  width: 126px;
}

.formula-note {
  flex-basis: 100%;
  margin: -2px 0 0;
  color: #333333;
  font-size: 0.78rem;
}

sup {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: super;
}

label {
  position: relative;
  display: inline-grid;
  gap: 5px;
  color: #222222;
}

.label-title {
  white-space: nowrap;
}

input {
  width: 160px;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid #999999;
  background: #ffffff;
  color: #111111;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
}

select {
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid #999999;
  background: #ffffff;
  color: #111111;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
}

input:focus {
  outline: 2px solid #555555;
  outline-offset: 1px;
}

input[readonly] {
  background: #eeeeee;
}

select:focus {
  outline: 2px solid #555555;
  outline-offset: 1px;
}

.result-line {
  flex-basis: auto;
  display: inline-block;
  margin-left: 2px;
  white-space: nowrap;
}

.result-line strong {
  font-size: 0.92rem;
  white-space: nowrap;
}

.table-toggle,
.csv-download {
  border: 0;
  padding: 0;
  color: #111111;
  background: transparent;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
}

.table-csv-download {
  margin-top: 4px;
}

section[aria-labelledby="payment-heading"] .formula {
  gap: 6px;
}

section[aria-labelledby="payment-heading"] input,
section[aria-labelledby="payment-heading"] select {
  width: 112px;
}

.amortization-panel {
  flex-basis: 100%;
  margin: 8px 0 18px;
}

.amortization-header h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.amortization-table {
  width: 100%;
  border-collapse: collapse;
}

.amortization-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f2f2;
}

.amortization-table th,
.amortization-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #cccccc;
  text-align: right;
  white-space: nowrap;
}

.amortization-table tfoot th {
  border-top: 1px solid #999999;
  border-bottom: 0;
  font-weight: 700;
  text-align: right;
}

.amortization-table th:first-child,
.amortization-table td:first-child,
.amortization-table tfoot th:first-child {
  text-align: left;
}

.payoff-calculator {
  display: block;
}

.payoff-title {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
  font-weight: 700;
}

.payoff-main-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 6px;
  margin-left: 18px;
  padding-bottom: 2px;
}

.payoff-main-row > label {
  flex: 0 0 auto;
}

.payoff-main-row .result-line {
  flex: 0 0 auto;
}

.payoff-main-row input,
.payoff-main-row select {
  width: 104px;
}

.payoff-main-row input[type="date"] {
  width: 126px;
}

.payoff-main-row #payoffLoanAmount {
  width: 122px;
}

.payoff-main-row #payoffRate {
  width: 72px;
}

.payoff-panel {
  flex-basis: 100%;
  margin: 4px 0 18px;
}

.payoff-original-details {
  margin-top: 8px;
  margin-bottom: 14px;
  margin-left: 18px;
}

.payoff-payment-instruction {
  margin: 0 0 8px;
}

.payoff-warning {
  margin: -8px 0 8px 18px;
  color: #555555;
}

.payoff-actions {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.payoff-actions span {
  font-weight: 700;
}

.payoff-table input {
  width: 130px;
}

.payoff-table input[type="date"] {
  width: 132px;
}

.add-payoff-row {
  margin-left: 8px;
}

.payoff-table th,
.payoff-table td {
  text-align: right;
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .page {
    padding: 24px 14px 42px;
  }

  .formula {
    align-items: stretch;
    gap: 8px;
  }

  .formula > span:first-child {
    flex-basis: 100%;
    font-weight: 700;
  }

  .result-line {
    flex-basis: 100%;
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }

  label,
  input {
    width: 100%;
  }
}
