.regression-comparison,
.regression-observations {
  display: grid;
  gap: 20px;
  align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.regression-chart {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px;
}

.regression-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: .875rem;
}

.regression-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.regression-observed { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.regression-fit { width: 24px; border-top: 3px solid var(--deep-teal, #005e58); }
.regression-chart svg { display: block; width: 100%; height: auto; }
.regression-chart svg path { fill: none; }
.regression-grid { stroke: #ddd3be; }
.regression-axis, .regression-ticks { stroke: var(--ink); stroke-width: 2; }
.regression-line { stroke: #005e58; stroke-width: 4; stroke-linecap: round; }
.regression-guide { stroke: #005e58; stroke-dasharray: 5 4; stroke-width: 1.5; }
.regression-error { stroke: #99364b; stroke-width: 3; stroke-dasharray: 4 2; }
.regression-dots { fill: var(--ink); }
.regression-estimate { fill: #ffdf63; stroke: #005e58; stroke-width: 2; }
.regression-labels, .regression-axis-name { fill: var(--ink); text-anchor: end; font-size: 17px; font-weight: 650; }
.regression-x-labels { text-anchor: middle; }
.regression-guide-value { fill: #005e58; }
.regression-estimate-label { font-size: 18px; font-weight: 700; }
.regression-residual-labels { fill: #99364b; font-size: 17px; font-weight: 650; }
.regression-chart p { margin: 4px 0 0; text-align: center; }
.regression-squares h4 { margin: 0 0 9px; font-size: 1.15rem; }
.regression-score { padding: 10px 0; border-top: 1px solid var(--line); }
.regression-score span { margin-left: .5em; font-size: .875rem; font-weight: 500; }
.regression-score p { margin: 5px 0 0; font-variant-numeric: tabular-nums; }
.regression-score strong { margin-left: .25em; }
.regression-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding: 8px;
  border-left: 4px solid #005e58;
  background: #fceba2;
}
.regression-result img, .regression-cause img { width: 64px; height: auto; object-fit: contain; }

.regression-observations { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.regression-observations table { width: 100%; border-collapse: collapse; text-align: center; }
.regression-observations caption { text-align: left; font-weight: 700; padding-bottom: .55em; }
.regression-observations :is(th,td) { padding: .55em .35em; border: 1px solid #b9b09d; }
.regression-observations thead { background: #efd9a2; }
.regression-observations tbody th { background: #dcebe0; }
.regression-cause { text-align: center; }
.regression-cause-source { display: flex; width: max-content; margin: 0 auto; align-items: center; gap: 8px; position: relative; }
.regression-cause-source::after { content: ""; position: absolute; top: 100%; left: 50%; height: 11px; border-left: 2px solid #005e58; }
.regression-cause-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
  position: relative;
}
.regression-cause-branches::before { content: ""; position: absolute; inset: 0 25% auto; border-top: 2px solid #005e58; }
.regression-cause-branches div {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 .2em .4em;
}
.regression-cause-branches span { font-size: .875rem; }
.regression-cause-branches i { width: 26px; height: 24px; align-self: center; }
.regression-cause p { margin-bottom: 0; }
@media (max-width: 720px) {
  .regression-comparison, .regression-observations { grid-template-columns: 1fr; }
}
