.result-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem 1rem;
}
.result-section-heading h2 { margin: 0; }
:root {
  --finance-income: #4fb84e;
  --finance-orange: #f58345;
  --finance-expense: color-mix(in srgb, var(--finance-orange) 75%, #596981);
  --finance-loss: #a63030;
  --finance-income-text: color-mix(in srgb, var(--finance-income) 55%, #142b48);
  --finance-expense-text: color-mix(in srgb, var(--finance-orange) 55%, #142b48);
}
.result-overview .metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.result-overview .metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .25rem;
  padding: .85rem 1rem;
  min-width: 0;
  container-type: inline-size;
}
.result-overview .metric strong {
  font-size: clamp(1rem, 11cqi, 1.55rem);
  overflow-wrap: anywhere;
}
.result-overview .result-income strong { color: var(--finance-income-text); }
.result-overview .result-expense strong { color: var(--finance-expense-text); }
.result-overview .result-loss { background: var(--finance-loss); border-color: var(--finance-loss); }
.result-overview .result-loss small { color: #ffdee2; }
.result-overview > p:last-child, .result-section > p:last-child {
  margin: .75rem 0 0;
  font-size: .84rem;
}
.result-section [data-column-layout="financial-results"] :is(th,td) {
  vertical-align: middle;
  padding: .58rem .7rem;
}
.result-section [data-column-layout="financial-results"] :is(th,td):not([scope="row"]) {
  min-width: 6.8rem;
  text-align: end;
}
.result-section [data-column-layout="financial-results"] :is(th[scope="row"], th:first-child) {
  min-width: 12rem;
  max-width: 17rem;
  text-align: start;
}
.result-section tbody th[scope="row"] {
  font-weight: 500;
  background: #fff;
  color: var(--ink);
}
.result-section tbody tr:nth-child(even) > :is(th,td) { background: #f7f9fd; }
.result-section tbody tr:has(.result-total-label) > :is(th,td) {
  background: #ecf2fc;
  border-top: 1px solid #d6e1f4;
}
.result-section .trace-value {
  color: #183f8d;
  min-height: 1.7rem;
  padding: .13rem .16rem;
  text-align: end;
}
.result-section .trace-value.result-zero { color: #646464; }
.result-average {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .35rem 1rem;
  margin-block-start: .75rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line-soft);
  border-radius: .55rem;
  background: #ecf2fc;
}
.result-section-heading .model-picker { margin: 0; }
@media (max-width: 600px) {
  .result-overview .metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr)); }
  .result-overview .metric { padding: .65rem; }
  .result-section [data-column-layout="financial-results"] :is(th[scope="row"], th:first-child) {
    min-width: 8.5rem;
    max-width: 11rem;
  }
}
