/* Scoped additions; preserve the existing REACT design and metric tabs. */
.tvfr-section { padding-top: 3.25rem; padding-bottom: 3.25rem; }
/* Match the preceding experiment section's heading gap. */
#real-world-experiments .motiv-contrib-block:last-child { margin-bottom: 0; }
#tvfr-comparison { padding-top: 1.6rem; }
.tvfr-section > .container { width: 100%; min-width: 0; max-width: 960px; }
.tvfr-cost-card, .tvfr-cost-summary { min-width: 0; }
.tvfr-subtitle { text-align: center; color: var(--text-secondary); font-size: 1.08rem; margin: -.5rem 0 1.6rem; }
.tvfr-intro { max-width: 900px; margin: 0 auto 1.6rem; line-height: 1.8; }
.tvfr-video { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border-color); }
.tvfr-caption { color: #526174; font-size: .95rem; text-align: center; margin: .85rem auto 1.1rem; line-height: 1.65; }
.tvfr-note { color: #64748b; font-size: .86rem; margin-top: 1.2rem; }
.tvfr-section .contrib-metric-panel img { display: block; width: 100%; height: auto; margin: 0 auto; cursor: zoom-in; }
.tvfr-section .motiv-inline-video { max-height: none; opacity: 1; display: block; }
.tvfr-result { margin-top: 1.5rem; }
.tvfr-result + .tvfr-result { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.tvfr-result-title { text-align: center; font-size: 1.2rem; font-weight: 600; color: #264d70; margin-bottom: 1rem; }
.tvfr-cost-card { background: white; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.55rem 1.75rem; margin: 1.3rem 0; box-shadow: var(--shadow-sm); }
.tvfr-cost-card h3 { color: #264d70; margin-bottom: .8rem; }
.tvfr-cost-card p, .tvfr-cost-summary p { line-height: 1.8; }
.tvfr-equation { overflow-x: auto; overflow-y: hidden; padding: .25rem 0; margin: .6rem 0; }
.tvfr-cost-summary { padding: 1rem 1.75rem; }

/* One spacing rule for the caption, equation and symbol explanation.
   Grid gaps avoid stacking paragraph, equation and MathJax margins. */
#metric-tvfr-transients .tvfr-metric-explanation {
  display: grid;
  gap: .35rem;
  margin: .5rem 0;
  font-size: .95rem;
  line-height: 1.65;
}
#metric-tvfr-transients .tvfr-metric-explanation > .tvfr-caption,
#metric-tvfr-transients .tvfr-metric-explanation > .tvfr-equation {
  min-width: 0;
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}
#metric-tvfr-transients .tvfr-metric-explanation mjx-container[display="true"] { margin: 0; }

@media (max-width: 768px) {
  .tvfr-section { padding: 2rem 1rem; }
  .tvfr-section .title.is-3 { font-size: 1.55rem; }
  .tvfr-section .title.is-4 { font-size: 1.2rem; }
  .tvfr-cost-card { padding: 1.1rem; }
  .tvfr-cost-summary { padding: .7rem .2rem; }
  .tvfr-section .contrib-metric-tabs { flex-wrap: wrap; }
  .tvfr-section .contrib-metric-tab { font-size: .85rem; padding: .6rem .8rem; }
  .tvfr-equation { font-size: .86rem; }
}

/* Center display formulas; retain horizontal access on narrow screens. */
#additional-costs .tvfr-equation mjx-container[display="true"] { text-align: center; width: max-content; min-width: 100%; }
