.investment-tools {
  --tools-navy: #102333;
  --tools-text: #1b2a37;
  --tools-muted: #4c5b65;
  --tools-border: #dbe2e7;
  --tools-gold: #ffc94f;
  --tools-blue: #a6c3d5;
}

.investment-tools-head p {
  max-width: 40rem;
  margin: 0;
  color: var(--tools-muted);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.5;
}

.investment-tools-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .5rem;
  margin: clamp(18px, 3.5vw, 28px) 0 clamp(16px, 2.5vw, 24px);
}

.investment-tools-tab {
  min-width: 0;
  min-height: 46px;
  padding: .55rem .6rem;
  border: 1px solid #cbd4da;
  border-radius: 8px;
  background: #fff;
  color: var(--tools-text);
  font-size: clamp(14px, 1.65vw, 16px);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.investment-tools-tab:hover {
  border-color: #a87c22;
  background: #fff9e9;
}

.investment-tools-tab[aria-selected="true"] {
  border-color: #a97b18;
  background: #fff2c9;
  box-shadow: inset 0 -2px #d59f2d;
  color: #4b340b;
}

.investment-tools :is(button, a, input, select, summary):focus-visible {
  outline: 2px solid #9c6700;
  outline-offset: 3px;
}

.investment-tools-panel[hidden],
.investment-tools [hidden] {
  display: none;
}

.investment-tools-panel > h3,
.investment-tool-growth-heading h3,
.investment-tool-inputs h3,
.investment-tool-feature h3 {
  margin: 0 0 .45rem;
  font-size: clamp(21px, 2.8vw, 29px);
}

.investment-tools-panel > p:not(.note) {
  margin: 0;
  color: var(--tools-muted);
  line-height: 1.5;
}

.investment-tool-growth-heading p {
  margin: 0;
  color: var(--tools-muted);
  font-size: .94rem;
  line-height: 1.5;
}

.investment-tools .growth-card {
  margin-top: clamp(12px, 2vw, 20px);
  overflow: visible;
}

.investment-tools-purchasing {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
  margin: .75rem 0 0;
  padding: .7rem .9rem;
  border: 1px solid var(--tools-border);
  border-radius: 8px;
  background: #fff;
  color: var(--tools-muted);
  font-size: .87rem;
  line-height: 1.35;
}

.investment-tools-purchasing > div {
  min-width: 0;
}

.investment-tools-purchasing p {
  margin: .17rem 0 0;
  line-height: 1.35;
}

.investment-tools-purchasing output {
  min-width: 0;
  color: var(--tools-text);
  font-size: 1.04rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.investment-tool-calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  border: 1px solid var(--tools-border);
  border-radius: 16px;
  background: #fff;
}

.investment-tool-inputs,
.investment-tool-output {
  min-width: 0;
  padding: clamp(16px, 3vw, 32px);
}

.investment-tool-inputs p:not(.investment-tool-error),
.investment-tool-feature p {
  max-width: 42rem;
  margin: 0;
  color: var(--tools-muted);
  font-size: .94rem;
  line-height: 1.5;
}

.investment-tool-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem .7rem;
  margin: 1.2rem 0 1rem;
}

.investment-tool-fields label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-end;
  gap: .35rem;
  color: var(--tools-text);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.investment-tool-fields input:not([type="checkbox"]) {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: .55rem .65rem;
  border: 1px solid #bac6ce;
  border-radius: 8px;
  background: #f8fafb;
  color: #142432;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.investment-tools .growth-fields input[type="text"] {
  min-width: 0;
  min-height: 44px;
  margin-top: .25rem;
  padding: .55rem .7rem;
  border: 1px solid #c0c9cd;
  border-radius: 8px;
  background: #f8f9fa;
  color: #101d27;
  font-size: 1rem;
  font-weight: 600;
}

.investment-tool-fields input[aria-invalid="true"],
.investment-tools .growth-fields input[aria-invalid="true"] {
  border-color: #9b3023;
}

.investment-tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1rem;
}

.investment-tools .btn,
.investment-tool-reset {
  min-height: 44px;
  line-height: 1.25;
  text-align: center;
}

.investment-tools .btn {
  max-width: 100%;
  padding: .75rem 1.05rem;
  border-radius: 8px;
  font-size: .875rem;
  text-transform: none;
  overflow-wrap: anywhere;
}

.investment-tool-reset {
  padding: .45rem 0;
  border: 0;
  background: transparent;
  color: #485a66;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

.investment-tool-error {
  margin: .7rem 0 0;
  color: #992c21;
  font-size: .875rem;
}

.investment-tool-error:empty {
  display: none;
}

.investment-tool-output {
  align-self: stretch;
  border-radius: 0 15px 15px 0;
  background: var(--tools-navy);
  color: #fff;
}

.investment-tool-output > :is(h3, h4) {
  margin: 0 0 .7rem;
  color: #fff;
  font-size: 1rem;
}

.investment-tool-result-main {
  margin: 0;
  color: var(--tools-gold);
  font-size: clamp(1.65rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.investment-tool-result-label {
  margin: .42rem 0 0;
  color: #e0e9ef;
  font-size: .93rem;
  line-height: 1.4;
}

.investment-tool-results {
  margin: 1rem 0 0;
}

.investment-tool-results div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: baseline;
  gap: .45rem .8rem;
  padding: .55rem 0;
  border-top: 1px solid #ffffff28;
  line-height: 1.36;
}

.investment-tool-results dt,
.investment-tool-results dd {
  min-width: 0;
  margin: 0;
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.investment-tool-results dt {
  color: #dbe6ed;
}

.investment-tool-results dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.investment-tool-note {
  margin: .55rem 0 0;
  color: var(--tools-muted);
  font-size: .84rem;
  line-height: 1.45;
}

.investment-tool-output .investment-tool-note {
  color: #dbe6ed;
}

.investment-tool-chart {
  min-width: 0;
  margin: 1rem 0 0;
  padding: .7rem 0 0;
  border-top: 1px solid #ffffff28;
  color: #dbe6ed;
  font-size: .8rem;
  line-height: 1.4;
}

.investment-tool-chart figcaption {
  margin: 0 0 .35rem;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
}

.investment-tool-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.investment-tool-chart figure { margin: 0; }

.investment-tool-chart svg text { fill: #d6e0e8; font-size: 16px; }
.investment-tool-chart svg line { stroke: #ffffff30; }

.investment-tool-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .85rem;
  margin: .35rem 0 0;
}

.investment-tool-legend span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.investment-tool-legend span::before {
  width: 14px;
  border-top: 2px solid var(--tools-gold);
  content: '';
}

.investment-tool-legend span + span::before {
  border-color: var(--tools-blue);
  border-top-style: dashed;
}

.investment-tool-consult {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  margin: 1rem 0 0;
  padding: clamp(14px, 2.6vw, 24px);
  border: 1px solid #e7d5a5;
  border-radius: 12px;
  background: #fffaea;
}

.investment-tool-consult > div {
  flex: 1 1 18rem;
  min-width: 0;
}

.investment-tool-consult h4 {
  margin: 0 0 .25rem;
  font-size: clamp(1.02rem, 2vw, 1.25rem);
  line-height: 1.3;
}

.investment-tool-consult p {
  margin: 0;
  color: #4a4435;
  font-size: .9rem;
  line-height: 1.45;
}

.investment-tool-feature {
  padding: clamp(16px, 3.5vw, 36px);
  border: 1px solid var(--tools-border);
  border-radius: 16px;
  background: #fff;
}

.investment-tool-facts {
  display: grid;
  gap: .3rem;
  margin: .9rem 0 1.1rem;
  padding-left: 1.2rem;
  color: var(--tools-text);
  font-size: .9rem;
  line-height: 1.4;
}

.investment-tool-facts li::marker { color: #a37119; }

.footer-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.2rem;
}

.footer .footer-navigation a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #e8eef2;
  text-decoration: underline;
  text-underline-offset: .22em;
}

@media (max-width: 840px) {
  .investment-tools-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 690px) {
  .investment-tool-calculator { grid-template-columns: minmax(0, 1fr); }
  .investment-tool-output { border-radius: 0 0 15px 15px; }
}

@media (min-width: 360px) and (max-width: 760px) {
  .investment-tools .growth-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .investment-tools .growth-fields > label { display: flex; flex-direction: column; justify-content: flex-end; }
  .investment-tools .growth-fields > .calc-slider-field { grid-column: 1 / -1; }
}

@media (max-width: 500px) {
  .investment-tools .investment-tools-inner { padding-inline: 14px; }
  .investment-tools-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .investment-tool-chart svg text { font-size: 18px; }
  .investment-tool-consult .btn,
  .investment-tool-feature .btn { width: 100%; }
}

@media print {
  #calculator .investment-tools-panel[data-tool-panel="compound"]:not([hidden]) { display: block !important; }
  #calculator .investment-tools-panel[data-tool-panel="compound"] > :not(.plan-preview) { display: none !important; }
}
