/* Each table row keeps one attribute and the two original evidence cells. */
.comparison-three .comparison-main { container-type: inline-size; }
.comparison-three .comparison-matrix { padding: 0; border: 0; background: transparent; box-shadow: none; }
.comparison-three .matrix-scroll { overflow: visible; }
.comparison-three :is(.matrix, .matrix thead, .matrix tbody) { display: block; }
.comparison-three .matrix colgroup { display: none; }
.comparison-three .matrix tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .5rem; align-items: start; }
.comparison-three .matrix tr > :first-child:not([colspan]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; }
.comparison-three .matrix tr > :nth-child(2) { grid-column: 1; }
.comparison-three .matrix tr > :nth-child(3) { grid-column: 2; }
.comparison-three .matrix tr > td { min-width: 0; border-radius: .55rem; background: var(--surface); padding: .65rem; }
.comparison-three .matrix tr > td[colspan] { grid-column: 1 / -1; }
.comparison-three .matrix .matrix-group > th { position: static; width: auto; height: auto; clip-path: none; grid-column: auto; padding: .48rem .65rem; border: 0; border-radius: .4rem; }
.comparison-three .matrix .matrix-group h3 { font: 700 .96rem var(--ui); margin: 0; line-height: 1.35; }
.comparison-three .matrix-side-label { display: block; font-size: .9rem; font-weight: 700; line-height: 1.35; margin-bottom: .32rem; }
.comparison-three .matrix .measurement-summary { font-size: .82rem; line-height: 1.45; margin: .18rem 0 .3rem; }
.comparison-three .measurement-value > strong { font-size: clamp(1.05rem, 1.4vw, 1.4rem); line-height: 1.2; }
.comparison-three .measurement-value details { font-size: .8rem; line-height: 1.45; }
.comparison-three .measurement-value dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
.comparison-three .measurement-value dd { margin: 0 0 .35rem; }
.comparison-three .matrix details[open] { overflow-wrap: anywhere; }
.comparison-three .measurement-rows { margin-bottom: .9rem; }
.comparison-three .matrix thead { position: static; }
@media (min-width: 1100px) {
  .comparison-three .matrix tr { grid-template-columns: minmax(0, 1fr) calc(var(--ancestry-width) + 2rem) minmax(0, 1fr); }
  .comparison-three .matrix tr > :nth-child(3) { grid-column: 3; }
  .comparison-three .matrix .matrix-group > th:first-child { grid-column: 1; }
  .comparison-three .matrix .matrix-group > th:last-child { grid-column: 3; }
  .comparison-three .matrix tr > td[colspan] { grid-column: 1; }
}
/* Two ordered metrics per species when each card has room to stay readable. */
@container (min-width: 75rem) {
  .comparison-three .matrix .measurement-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) calc(var(--ancestry-width) + 1rem) repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: .5rem; align-items: start; }
  .comparison-three .measurement-rows > tr { display: contents; }
  .comparison-three .measurement-rows > .matrix-group > th:first-child { grid-column: 1 / span 2; }
  .comparison-three .measurement-rows > .matrix-group > th:last-child { grid-column: 4 / span 2; }
  .comparison-three .measurement-rows > tr:nth-child(even) > td:nth-of-type(1) { grid-column: 1; }
  .comparison-three .measurement-rows > tr:nth-child(odd) > td:nth-of-type(1) { grid-column: 2; }
  .comparison-three .measurement-rows > tr:nth-child(even) > td:nth-of-type(2) { grid-column: 4; }
  .comparison-three .measurement-rows > tr:nth-child(odd) > td:nth-of-type(2) { grid-column: 5; }
  .comparison-three .measurement-rows > tr > td[colspan] { grid-column: 1 / span 2; }
}
@media (max-width: 430px) {
  .comparison-three .matrix tr > td { padding: .55rem .45rem; }
  .comparison-three .matrix .matrix-group > th { padding: .45rem; }
  .comparison-three .matrix { font-size: .93rem; }
}
