.financial-calculators[hidden],
.calculator-panel[hidden] {
  display: none !important;
}

.financial-calculators {
  scroll-margin-top: 18px;
  margin: 0;
  padding: 30px 0;
  border-top: 1px solid rgba(16, 40, 58, 0.12);
  border-bottom: 1px solid rgba(16, 40, 58, 0.12);
}

.financial-calculators-heading {
  position: relative;
  max-width: 560px;
  margin: 0 auto 20px;
  text-align: center;
}

body[data-page="resources"] .financial-calculators .calculator-close {
  position: absolute;
  top: -2px;
  right: 0;
  display: grid;
  place-items: center;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(184, 139, 68, 0.56) !important;
  border-radius: 50% !important;
  color: #08716d !important;
  -webkit-text-fill-color: #08716d !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 4px 11px rgba(20, 53, 74, 0.08) !important;
  cursor: pointer;
  transform: none !important;
}

.calculator-close-icon {
  display: block;
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(2px) rotate(-135deg);
}

body[data-page="resources"] .financial-calculators .calculator-close:is(:hover, :active) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #08716d !important;
  background: #08716d !important;
  box-shadow: 0 5px 12px rgba(8, 113, 109, 0.16) !important;
  transform: none !important;
}

body[data-page="resources"] .financial-calculators .calculator-close:focus-visible {
  outline: 2px solid #c59a54 !important;
  outline-offset: 2px !important;
}

.financial-calculators-heading::before {
  content: "";
  display: block;
  width: 92px;
  height: 5px;
  margin: 0 auto 15px;
  border-radius: 999px;
  background: linear-gradient(90deg, #14354a 0%, #08716d 62%, #c6a15f 100%);
}

.financial-calculators-heading :is(.eyebrow, h3, p) {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.financial-calculators-heading h3 {
  margin-top: 7px;
  color: #10283a;
  font-size: clamp(1.45rem, 4.5vw, 1.9rem);
  font-weight: 900;
  line-height: 1.12;
  text-wrap: balance;
}

.financial-calculators-heading > p:last-child {
  margin-top: 8px;
  color: #536879;
  font-size: 0.92rem;
  line-height: 1.48;
}

.calculator-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  padding: 5px;
  border: 1px solid rgba(184, 139, 68, 0.48);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 53, 74, 0.06), rgba(8, 113, 109, 0.055) 62%, rgba(198, 161, 95, 0.1)),
    rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 18px rgba(20, 53, 74, 0.05);
}

body[data-page="resources"] .financial-calculators .calculator-tabs button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent !important;
  border-radius: 5px;
  color: #17384a !important;
  -webkit-text-fill-color: #17384a !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  cursor: pointer;
  transform: none !important;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

body[data-page="resources"] .financial-calculators .calculator-tabs button[aria-selected="true"] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: rgba(198, 161, 95, 0.62) !important;
  background: linear-gradient(120deg, #14354a 0%, #08716d 78%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 6px 14px rgba(8, 113, 109, 0.2) !important;
}

body[data-page="resources"] .financial-calculators .calculator-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 28%;
  bottom: 4px;
  left: 28%;
  height: 2px;
  border-radius: 999px;
  background: #d2ac68;
}

body[data-page="resources"] .financial-calculators .calculator-tabs button:not([aria-selected="true"]):hover {
  border-color: rgba(198, 161, 95, 0.46) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 4px 10px rgba(20, 53, 74, 0.06) !important;
}

body[data-page="resources"] .financial-calculators .calculator-tabs button:is(:hover, :active) {
  transform: none !important;
}

body[data-page="resources"] .financial-calculators .calculator-tabs button:focus-visible {
  outline: 2px solid #c59a54 !important;
  outline-offset: 2px !important;
}

.calculator-panel {
  padding-top: 22px;
}

.calculator-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.calculator-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #17384a;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
}

.calculator-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(184, 139, 68, 0.34);
  border-radius: 8px;
  color: #536879;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 247, 239, 0.82)),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.calculator-input-suffix {
  grid-template-columns: minmax(0, 1fr) auto;
}

.calculator-input:focus-within {
  border-color: #08716d;
  box-shadow:
    0 0 0 3px rgba(8, 113, 109, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.calculator-input input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 7px;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #10283a;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 750;
  appearance: textfield;
  -moz-appearance: textfield;
}

.calculator-input input::-webkit-inner-spin-button,
.calculator-input input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.calculator-results {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid rgba(16, 40, 58, 0.12);
  border-bottom: 1px solid rgba(16, 40, 58, 0.12);
  background: linear-gradient(180deg, rgba(8, 113, 109, 0.035), rgba(255, 255, 255, 0) 72%);
}

.calculator-results::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #14354a 0%, #08716d 66%, #c6a15f 100%);
}

.calculator-results > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 16px;
}

.calculator-results > div + div {
  border-left: 1px solid rgba(16, 40, 58, 0.12);
}

.calculator-results span {
  color: #536879;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.3;
}

.calculator-results strong {
  color: #14354a;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.calculator-results > div:last-child strong {
  color: #08716d;
}

.calculator-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.calculator-guidance p {
  margin: 0;
  color: #617282;
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: left;
}

.calculator-guidance a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #08716d;
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.calculator-guidance a::after {
  content: "\2197";
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 1px solid rgba(184, 139, 68, 0.48);
  border-radius: 50%;
  color: #14354a;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1;
}

.calculator-guidance a:is(:hover, :focus-visible) {
  color: #075e5b;
  text-decoration: none;
}

.calculator-guidance a:is(:hover, :focus-visible)::after {
  border-color: #08716d;
  color: #ffffff;
  background: #08716d;
}

body[data-page="resources"] .calculator-bottom-close {
  display: block;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 18px auto 0 !important;
  padding: 5px 2px 4px !important;
  border: 0 !important;
  border-bottom: 2px solid rgba(8, 113, 109, 0.42) !important;
  border-radius: 0 !important;
  color: #08716d !important;
  -webkit-text-fill-color: #08716d !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0.78rem !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  cursor: pointer;
  transform: none !important;
}

body[data-page="resources"] .calculator-bottom-close:is(:hover, :active) {
  color: #14354a !important;
  -webkit-text-fill-color: #14354a !important;
  border-bottom-color: #c59a54 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

body[data-page="resources"] .calculator-bottom-close:focus-visible {
  outline: 2px solid rgba(8, 113, 109, 0.34) !important;
  outline-offset: 3px !important;
}

@media (max-width: 760px) {
  body[data-page="resources"] .financial-calculators {
    padding: 26px 2px;
  }

  body[data-page="resources"] .financial-calculators-heading {
    max-width: 360px;
    margin-bottom: 18px;
  }

  body[data-page="resources"] .calculator-tabs button {
    min-height: 48px;
    padding: 7px 5px;
    font-size: 0.75rem;
  }

  body[data-page="resources"] .calculator-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  body[data-page="resources"] .calculator-results > div {
    padding: 14px 10px;
  }

  body[data-page="resources"] .calculator-results strong {
    font-size: 1.2rem;
  }

  body[data-page="resources"] .calculator-guidance {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  body[data-page="resources"] .calculator-guidance a {
    justify-content: space-between;
    width: 100%;
    min-height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calculator-tabs button {
    transition: none !important;
  }
}
