.top-nav a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.retirement-form-grid[hidden],
.retirement-required-result[hidden],
.retirement-results[hidden] {
  display: none !important;
}

.retirement-shell {
  display: grid;
  gap: 20px;
}

.retirement-intro {
  display: grid;
  gap: 0;
  border: 1px solid #1d4a40;
  border-radius: 10px;
  background: #12382f;
  padding: clamp(26px, 4vw, 42px);
  box-shadow: var(--shadow);
  color: #fff;
}

.retirement-page-label {
  margin: 0 0 12px;
  color: #a9e0d4;
  font-size: 14px;
  font-weight: 900;
}

.retirement-intro h1 {
  max-width: 850px;
  color: #fff;
  font-size: clamp(32px, 4.5vw, 56px);
  letter-spacing: -0.025em;
}

.retirement-intro-copy {
  max-width: 780px;
  margin: 16px 0 0;
  color: #e2efeb;
  font-size: 17px;
}

.retirement-reinvest-copy {
  max-width: 780px;
  margin: 8px 0 0;
  color: #b8d4ce;
  font-size: 14px;
}

.retirement-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: start;
}

.retirement-form,
.retirement-results,
.retirement-timeline-section,
.retirement-rounds-section,
.retirement-assumptions {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.retirement-form {
  padding: clamp(20px, 3vw, 30px);
}

.retirement-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.retirement-form-heading h2 {
  font-size: 22px;
}

.retirement-form-heading .reset-button {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

.retirement-mode-switch {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #eef4f1;
  padding: 5px;
}

.retirement-mode-switch button {
  display: grid;
  min-height: 70px;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.retirement-mode-switch button:hover,
.retirement-mode-switch button:focus-visible {
  border-color: #8db8ae;
  color: var(--ink);
}

.retirement-mode-switch button[aria-selected="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 5px 14px rgb(35 121 106 / 18%);
}

.retirement-mode-switch .mode-index {
  color: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.retirement-mode-switch strong {
  color: inherit;
  font-size: 15px;
}

.retirement-mode-switch small {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0.85;
}

.retirement-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 13px;
}

.retirement-form-grid label {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.retirement-field-label {
  color: var(--ink);
  line-height: 1.35;
}

.retirement-input-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
  padding: 0 11px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

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

.retirement-input-wrap:focus-within {
  border-color: var(--green);
  outline: 3px solid rgb(35 121 106 / 12%);
  background: #fff;
}

.retirement-input-wrap b {
  color: var(--muted);
  font-size: 13px;
}

.retirement-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 9px 7px;
  font-size: 21px;
  font-weight: 900;
}

.retirement-field-help {
  min-height: 19px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.retirement-cycle-note {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.retirement-form .form-error {
  min-height: 22px;
  margin: 2px 0 0;
}

.retirement-results {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.retirement-primary-result {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  overflow: hidden;
  border: 1px solid #1d685b;
  border-radius: 9px;
}

.retirement-primary-result > div,
.retirement-required-result {
  padding: clamp(22px, 3vw, 32px);
}

.retirement-monthly-result {
  background: #23796a;
  color: #fff;
}

.retirement-annual-result {
  background: #edf3ff;
  color: #193b77;
}

.retirement-primary-result p,
.retirement-primary-result span,
.retirement-required-result p {
  margin: 0;
  font-weight: 800;
}

.retirement-primary-result p,
.retirement-primary-result span {
  opacity: 0.86;
}

.retirement-primary-result strong {
  display: block;
  margin: 7px 0 6px;
  font-size: clamp(32px, 4.1vw, 56px);
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.retirement-annual-result strong {
  font-size: clamp(28px, 3.5vw, 43px);
}

.retirement-primary-result span {
  font-size: 12px;
}

.retirement-required-result {
  display: grid;
  gap: 5px;
  border: 1px solid #b6d9d0;
  border-radius: 9px;
  background: #eaf6f2;
  color: var(--ink);
}

.retirement-required-result p {
  color: var(--green);
  font-size: 15px;
}

.retirement-required-result span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.retirement-required-result strong {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.retirement-results[data-mode="reverse"] .retirement-primary-result {
  grid-template-columns: 1fr;
}

.retirement-results[data-mode="reverse"] .retirement-monthly-result {
  display: none;
}

.retirement-assumption-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.retirement-assumption-strip > div {
  display: grid;
  gap: 3px;
  padding: 12px 11px;
}

.retirement-assumption-strip > div + div {
  border-left: 1px solid var(--line);
}

.retirement-assumption-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.retirement-assumption-strip strong {
  color: var(--ink);
  font-size: 14px;
}

.retirement-monthly-note {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.retirement-explanation {
  display: grid;
  gap: 15px;
  border: 1px solid #c9dfe0;
  border-radius: 9px;
  background: #f0f8fa;
  padding: 18px;
}

.retirement-explanation > p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.retirement-equation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.retirement-equation > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.retirement-equation > div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.retirement-equation > div strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(18px, 2.4vw, 25px);
}

.retirement-equation-total {
  border-left: 1px solid var(--green);
  padding-left: 12px;
}

.retirement-equation-total strong {
  color: var(--green) !important;
}

.retirement-equation-sign {
  color: var(--green);
  font-size: 24px;
  font-weight: 900;
}

.retirement-timeline-section,
.retirement-rounds-section,
.retirement-assumptions {
  padding: clamp(20px, 3vw, 30px);
}

.retirement-timeline-section .section-heading,
.retirement-rounds-section .section-heading {
  margin-bottom: 18px;
}

.retirement-timeline-section .section-heading p,
.retirement-rounds-section .section-heading p {
  max-width: 800px;
  margin: 8px 0 0;
  color: var(--muted);
}

.retirement-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 39px;
}

.retirement-timeline::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 14px;
  width: 2px;
  background: #b8d8d0;
  content: "";
}

.retirement-timeline-step {
  position: relative;
  border: 1px solid #cbded8;
  border-radius: 9px;
  background: #f6faf8;
  padding: 17px 18px;
}

.retirement-timeline-marker {
  position: absolute;
  top: 18px;
  left: -39px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 3px solid #f6faf8;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 0 0 1px #75aa9d;
}

.retirement-timeline-step h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
}

.retirement-timeline-step ul {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.retirement-timeline-step li::marker {
  color: var(--green);
}

.retirement-round-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 0 0 18px;
}

.retirement-round-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #cbdad4;
  border-radius: 9px;
  background: #f4f9f7;
  padding: 18px;
}

.retirement-round-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.retirement-round-card-header span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.retirement-round-card-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.retirement-round-card > strong {
  color: var(--ink);
  font-size: 23px;
  line-height: 1.2;
}

.retirement-round-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  border-top: 1px solid #d6e2dd;
  padding-top: 12px;
}

.retirement-round-card-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.retirement-round-card-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.retirement-round-card-grid b {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
}

.retirement-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.retirement-details-count {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.retirement-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
}

.retirement-details summary::after {
  content: "＋";
  font-size: 17px;
  line-height: 1;
}

.retirement-details[open] summary::after {
  content: "－";
}

.retirement-details .table-shell {
  margin-top: 14px;
}

.retirement-table {
  min-width: 980px;
}

.retirement-table th,
.retirement-table td {
  white-space: nowrap;
}

.retirement-payout-cell {
  color: var(--green);
  font-weight: 900;
}

.retirement-assumptions {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  gap: 24px;
  border-left: 1px solid var(--green);
}

.retirement-assumptions h2 {
  font-size: 22px;
}

.retirement-assumptions .assumption-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}

.retirement-assumptions .assumption-grid p {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

.retirement-assumptions .assumption-grid p:last-child {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 1040px) {
  .retirement-workspace {
    grid-template-columns: 1fr;
  }

  .retirement-form {
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
    gap: 18px;
  }

  .retirement-form-heading {
    align-self: start;
    margin: 0;
  }

  .retirement-mode-switch {
    align-self: start;
    margin: 0;
  }

  .retirement-form-grid,
  .retirement-cycle-note,
  .retirement-form .form-error {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1041px) {
  .retirement-intro {
    padding-top: 25px;
    padding-bottom: 25px;
  }

  .retirement-intro h1 {
    max-width: none;
    font-size: clamp(32px, 3.4vw, 48px);
  }
}

@media (max-width: 760px) {
  .retirement-form {
    display: block;
  }

  .retirement-form-heading {
    margin-bottom: 18px;
  }

  .retirement-mode-switch {
    margin-bottom: 20px;
  }

  .retirement-primary-result,
  .retirement-assumption-strip,
  .retirement-equation,
  .retirement-assumptions {
    grid-template-columns: 1fr;
  }

  .retirement-assumption-strip > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .retirement-equation {
    gap: 8px;
  }

  .retirement-equation-sign {
    justify-self: start;
    line-height: 1;
  }

  .retirement-equation-total {
    border-top: 1px solid #9bc9c0;
    border-left: 0;
    padding-top: 11px;
    padding-left: 0;
  }

  .retirement-round-visuals,
  .retirement-assumptions .assumption-grid {
    grid-template-columns: 1fr;
  }

  .retirement-assumptions .assumption-grid p:last-child {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .retirement-intro {
    padding: 24px 20px;
  }

  .retirement-intro h1 {
    font-size: 34px;
  }

  .retirement-form,
  .retirement-results,
  .retirement-timeline-section,
  .retirement-rounds-section,
  .retirement-assumptions {
    padding: 17px;
  }

  .retirement-form-grid {
    grid-template-columns: 1fr;
  }

  .retirement-form-heading {
    gap: 10px;
  }

  .retirement-form-heading h2 {
    font-size: 20px;
  }

  .retirement-form-heading .reset-button {
    padding: 7px 9px;
    font-size: 12px;
  }

  .retirement-primary-result > div,
  .retirement-required-result {
    padding: 20px;
  }

  .retirement-primary-result strong,
  .retirement-required-result strong {
    font-size: 34px;
  }

  .retirement-round-card-grid {
    grid-template-columns: 1fr;
  }

  .retirement-round-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .retirement-round-card-header small {
    text-align: left;
  }
}
