.evidence-lab {
  --ev-paper: #f4f4ed;
  --ev-ink: #163c31;
  --ev-muted: #4b6257;
  --ev-rule: #bbc6b9;
  color: var(--ev-ink);
  background: #e7ece1;
  border-block: 1px solid var(--ev-rule);
}

.evidence-wrap {
  padding-block: clamp(3rem, 7vw, 6.6rem);
}

.evidence-heading {
  display: grid;
  align-items: end;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 26px 4.8vw;
  margin-bottom: clamp(1.7rem, 4vw, 3.25rem);
}

.evidence-heading h2 {
  max-width: 19ch;
  margin: 0.8rem 0 0;
  font-size: clamp(2.4rem, 5vw, 5.25rem);
  line-height: 0.99;
  letter-spacing: -0.058em;
  font-weight: 500;
}

.evidence-heading > p {
  max-width: 26rem;
  color: var(--ev-muted);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.5;
  margin: 0;
}

.evidence-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--ev-rule);
  background: var(--ev-rule);
  margin-bottom: 1px;
}

.evidence-steps[hidden],
.evidence-result[hidden] {
  display: none;
}

.evidence-steps button {
  min-height: 48px;
  text-align: center;
  padding: 0.75rem 0.3rem;
  font-size: clamp(0.79rem, 1.2vw, 1rem);
  background: var(--ev-paper);
  border: 0;
  color: var(--ev-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.evidence-steps button:hover {
  background: #d6e6d0;
}
.evidence-steps button[aria-pressed='true'] {
  background: var(--ev-ink);
  color: #f4f7ee;
}
.evidence-steps button:focus-visible {
  outline: 2px solid #5f823d;
  outline-offset: -4px;
}

.evidence-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(26px, 5vw, 80px) minmax(0, 1fr);
  align-items: start;
  padding: clamp(1rem, 3vw, 2.35rem);
  background: #dce5d8;
  border: 1px solid var(--ev-rule);
}

.evidence-label {
  display: flex;
  justify-content: space-between;
  gap: 0.45em;
  margin: 0 0 0.7rem;
  font: 0.73rem/1.4 var(--mono, monospace);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.evidence-label span {
  letter-spacing: 0.04em;
  color: var(--ev-muted);
}

.evidence-paper,
.evidence-result {
  margin: 0;
  min-width: 0;
  padding: clamp(1rem, 2.3vw, 2rem);
  background: var(--ev-paper);
  border: 1px solid var(--ev-rule);
}

.evidence-result {
  background: #f8f9f2;
}
.evidence-result + .evidence-result:not([hidden]) {
  margin-top: 1px;
}
.evidence-paper h3,
.evidence-result h3 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.evidence-paper p,
.evidence-result p {
  color: var(--ev-muted);
  margin: 0 0 1.2rem;
  line-height: 1.4;
}
.evidence-paper p {
  font-size: 0.88rem;
}

.evidence-statement,
.evidence-typed {
  border-collapse: collapse;
  width: 100%;
  font-size: clamp(0.8rem, 1.1vw, 0.96rem);
}

.evidence-statement :is(th, td),
.evidence-typed :is(th, td) {
  padding: 0.56rem 0;
  border-top: 1px solid #ccd5c8;
  text-align: left;
  font-weight: 500;
}

.evidence-statement thead th,
.evidence-typed thead th {
  border-top: 0;
  font-weight: 700;
}

.evidence-statement tr > :last-child,
.evidence-typed tr > :last-child,
.evidence-calculation dd {
  padding-inline-start: 0.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.evidence-statement small {
  display: inline-block;
  margin-right: 0.3rem;
  color: var(--ev-muted);
}

.evidence-source-total :is(th, td) {
  border-top-color: #7b9987;
  font-weight: 700;
}

.evidence-calculation {
  margin: 0;
}
.evidence-calculation div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.5rem 0;
  border-top: 1px solid #ccd5c8;
}
.evidence-calculation div:last-child {
  font-weight: 700;
  border-top-color: #7b9987;
}
.evidence-calculation dd {
  margin: 0;
}
.evidence-result .text-link {
  margin-top: 0.9rem;
}

.evidence-connector {
  position: relative;
  margin-top: 8.65rem;
  width: 100%;
  height: 1px;
  background: #658471;
}

.evidence-connector i {
  position: absolute;
  inset: -1px 0 auto;
  height: 3px;
  background: #63875b;
  transform-origin: left center;
}

.evidence-connector span {
  position: absolute;
  z-index: 1;
  top: -3px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-top: 1px solid #3b6045;
  border-right: 1px solid #3b6045;
  transform: rotate(45deg);
}

@media (max-width: 720px) {
  .evidence-heading,
  .evidence-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .evidence-heading {
    gap: 0.9rem;
  }
  .evidence-connector {
    width: 30px;
    margin: 15px auto;
    transform: rotate(90deg);
  }
}
