.calculator-page {
  box-sizing: border-box;
  margin: 2.5rem auto 4rem;
  max-width: 76rem;
  padding: 0 1.25rem;
  font-family: Futura, Arial, sans-serif;
  font-size: 1.1rem;
  line-height: 1.55;
}

.calculator-page h1,
.calculator-page h2,
.calculator-page legend {
  font-family: BebasNeueRegular, Arial, sans-serif;
  letter-spacing: .02em;
}

.calculator-page h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1;
  margin: .25rem 0 1rem;
}

.calculator-page h2 {
  font-size: 2rem;
  line-height: 1.1;
  margin: 0 0 .75rem;
}

.back-link,
.share-links a {
  align-items: center;
  box-sizing: border-box;
  color: #005a9c;
  display: inline-flex;
  font-weight: bold;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  text-decoration: underline;
}

.back-link:focus-visible,
.share-links a:focus-visible {
  outline: .2rem solid #005a9c;
  outline-offset: .2rem;
}

.eyebrow {
  color: #005a9c;
  font-size: .8rem;
  font-weight: bold;
  letter-spacing: .12em;
  margin: 0;
  text-transform: uppercase;
}

.calculator-intro {
  max-width: 54rem;
}

.model-note {
  background: #eaf4fa;
  border-left: .35rem solid #005a9c;
  margin: 2rem 0;
  padding: 1.25rem;
}

#retirement-calculator {
  background: #fff;
  border: 1px solid #b8c5cc;
  box-shadow: 0 .4rem 1.5rem rgba(0, 0, 0, .08);
  padding: 1.25rem;
}

fieldset {
  border: 0;
  border-top: 1px solid #d2dde1;
  margin: 1.5rem 0 0;
  padding: 1.5rem 0 0;
}

fieldset:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

legend {
  font-size: 1.7rem;
  font-weight: bold;
  padding: 0;
}

.field-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-wide {
  grid-column: span 2;
}

.field label {
  display: block;
  font-weight: bold;
  margin-bottom: .35rem;
}

.field input {
  box-sizing: border-box;
  border: 1px solid #617581;
  border-radius: .2rem;
  font: inherit;
  min-height: 2.75rem;
  padding: .45rem .6rem;
  width: 100%;
}

.field input:focus-visible {
  outline: .2rem solid #005a9c;
  outline-offset: .1rem;
}

.field input[aria-invalid="true"] {
  border-color: #a4161a;
}

.input-with-unit {
  align-items: stretch;
  display: flex;
}

.input-with-unit span {
  background: #edf1f2;
  border: 1px solid #617581;
  display: grid;
  min-width: 2.3rem;
  padding: .45rem;
  place-items: center;
}

.input-with-unit span:first-child {
  border-radius: .2rem 0 0 .2rem;
  border-right: 0;
}

.input-with-unit span:last-child {
  border-left: 0;
  border-radius: 0 .2rem .2rem 0;
}

.input-with-unit input {
  border-radius: 0;
}

.input-with-unit input:first-child {
  border-radius: .2rem 0 0 .2rem;
}

.field-help {
  color: #42545f;
  font-size: .92rem;
  margin: .35rem 0 0;
}

.input-error {
  color: #8b1014;
  font-weight: bold;
  margin: .35rem 0 0;
}

.calculate-button {
  background: #005a9c;
  border: 0;
  border-radius: .25rem;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  margin-top: 1.5rem;
  min-height: 3rem;
  padding: .65rem 1.25rem;
}

.calculate-button:hover {
  background: #003f6d;
}

.calculate-button:focus-visible {
  background: #003f6d;
  outline: .2rem solid #005a9c;
  outline-offset: .2rem;
}

.calculator-results {
  background: #fff;
  border: 1px solid #b8c5cc;
  margin-top: 2rem;
  padding: 1.25rem;
}

.scenario-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin: 1rem 0;
}

.scenario-card {
  border-top: .3rem solid #005a9c;
  background: #f5f9fb;
  padding: 1rem;
}

.scenario-card h3 {
  margin-top: 0;
}

.scenario-card dl {
  margin: 0;
}

.scenario-card dt {
  font-weight: bold;
}

.scenario-card dd {
  margin: 0 0 .65rem;
}

.projection-chart,
.projection-data {
  overflow-x: auto;
}

.projection-legend {
  display: grid;
  gap: .5rem;
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.projection-legend li {
  align-items: center;
  display: flex;
  gap: .5rem;
}

.projection-legend svg {
  flex: 0 0 3rem;
  height: .75rem;
  width: 3rem;
}

.projection-chart > svg {
  display: block;
  min-width: 38rem;
  width: 100%;
}

.projection-chart text {
  fill: #24343d;
  font-family: Futura, Arial, sans-serif;
  font-size: .8rem;
}

.projection-data table {
  border-collapse: collapse;
  min-width: 42rem;
  width: 100%;
}

.projection-data caption {
  font-weight: bold;
  margin: 1rem 0 .5rem;
  text-align: left;
}

.projection-data th,
.projection-data td {
  border: 1px solid #9dabb2;
  padding: .5rem;
  text-align: left;
}

.projection-data th {
  background: #eaf4fa;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 2rem 0;
}

@media (max-width: 42rem) {
  .calculator-page {
    margin-top: 1.5rem;
    padding: 0 .85rem;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  #retirement-calculator,
  .calculator-results {
    padding: 1rem;
  }
}

.scenario-age {
  color: #005a9c;
  font-size: 2.75rem;
  font-weight: bold;
  line-height: 1.1;
  margin: .5rem 0 1rem;
}

.projection-plot {
  height: clamp(22rem, 40vw, 32rem);
  min-width: 0;
  position: relative;
  width: 100%;
}

.projection-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.projection-legend button {
  align-items: center;
  background: #fff;
  border: 1px solid #879aa6;
  border-radius: .2rem;
  color: #24343d;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  text-align: left;
}

.projection-legend button[aria-pressed="false"] {
  background: #edf1f2;
  text-decoration: line-through;
}

.projection-legend button:focus-visible,
#projection-age:focus-visible {
  outline: .2rem solid #005a9c;
  outline-offset: .2rem;
}

.chart-help {
  color: #42545f;
  font-size: .95rem;
}

#projection-age {
  display: block;
  min-height: 2.75rem;
  width: 100%;
}

.projection-inspection {
  background: #f5f9fb;
  display: block;
  font-variant-numeric: tabular-nums;
  margin: .5rem 0 1rem;
  padding: .75rem;
}
