/* Initial results retain their existing blue/neutral appearance. */
html.calc-results-updated .calc-result-number {
  --calc-result-red: #b42318;
  color: var(--calc-result-red) !important;
  font-weight: 850 !important;
}

/* Keep the red result readable inside the existing dark blue ceiling card. */
html.calc-results-updated .result-top .calc-result-number {
  background: #fff5f3;
  border-radius: .1em;
  padding-inline: .06em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

html.calc-results-updated .calc-result-number.calc-result-flash {
  color: var(--calc-result-before-color, #0866ff) !important;
  animation: calculator-result-flash 400ms ease-out 1;
}

html.calc-results-updated .result-top .calc-result-number.calc-result-flash {
  background: transparent;
}

/* One brief pulse; the base rule leaves the result bold red afterwards. */
@keyframes calculator-result-flash {
  0%, 100% { opacity: 1; }
  45% { opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
  html.calc-results-updated .calc-result-number.calc-result-flash {
    color: var(--calc-result-red) !important;
    animation: none !important;
    opacity: 1 !important;
  }
  html.calc-results-updated .result-top .calc-result-number.calc-result-flash {
    background: #fff5f3;
  }
}
