.statistics-section .section-heading h2,
.evidence-chart-panel h3 {
  text-wrap: balance;
}

.statistics-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.66fr) minmax(0, 1.74fr);
  align-items: stretch;
  gap: 24px;
}

.statistics-taxonomy {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
}

.statistics-taxonomy__button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--tc-slate-200);
  border-radius: 999px;
  color: var(--tc-slate-500);
  background: var(--tc-white);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.16s ease-out,
    border-color 0.16s ease-out,
    color 0.16s ease-out;
}

.statistics-taxonomy__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  font-size: 14px;
}

.statistics-taxonomy__button:hover:not(:disabled),
.statistics-taxonomy__button.is-selected {
  border-color: #93c5fd;
  color: var(--tc-blue);
  background: var(--tc-blue-mist);
}

.statistics-taxonomy__button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.statistics-taxonomy__button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.statistics-summary {
  position: relative;
  display: grid;
  grid-template-rows: repeat(2, minmax(150px, 1fr));
  overflow: hidden;
  border: 1px solid #dce6f2;
  border-radius: 16px;
  background: var(--tc-white);
  box-shadow: 0 20px 44px -34px rgba(37, 99, 235, 0.34), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.statistics-summary::before {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 26px;
  width: 64px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  content: "";
  background: var(--tc-blue);
}

.statistics-summary-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  overflow: hidden;
  padding: 24px 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.statistics-summary-card > div {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.statistics-summary-card__eyebrow {
  margin: 0 0 10px;
  color: var(--tc-slate-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.statistics-summary-card__number {
  margin: 0;
  color: var(--tc-slate-900);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 0.95;
}

.statistics-summary-card__label {
  margin: 9px 0 0;
  color: var(--tc-slate-600);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.statistics-summary-card > i {
  position: absolute;
  right: 22px;
  bottom: 20px;
  color: rgba(37, 99, 235, 0.24);
  font-size: 36px;
  line-height: 1;
}

.statistics-summary-card--total {
  background: linear-gradient(145deg, #edf5ff 0%, #f8fbff 64%, #ffffff 100%);
}

.statistics-summary-card--total .statistics-summary-card__eyebrow {
  color: var(--tc-blue);
}

.statistics-summary-card--total .statistics-summary-card__number {
  color: #174ea6;
}

.statistics-summary-card--total .statistics-summary-card__label {
  color: var(--tc-slate-600);
}

.statistics-summary-card--total > i {
  color: rgba(37, 99, 235, 0.2);
}

.statistics-summary-card--ms {
  border-top: 1px solid #e6edf5;
}

.statistics-summary-card--ms .statistics-summary-card__number {
  color: var(--tc-slate-900);
}

.statistics-summary-card--signals {
  border-top: 1px solid #e6edf5;
}

.statistics-summary-card--signals .statistics-summary-card__number {
  color: var(--tc-slate-900);
}

.statistics-summary-card--signals > i {
  color: rgba(37, 99, 235, 0.28);
}

.statistics-summary-card__help {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--tc-blue);
  background: var(--tc-blue-mist);
  cursor: pointer;
  transition: color 220ms cubic-bezier(0.22, 1, 0.36, 1), background-color 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.statistics-summary-card__help:hover,
.statistics-summary-card__help:focus-visible {
  color: var(--tc-blue-dark);
  background: var(--tc-blue-soft);
  transform: translateY(-1px);
}

.evidence-chart-panel {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(90px, 1fr) auto;
  overflow: hidden;
  padding: 20px 26px;
  border: 1px solid #dce6f2;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 24%);
  box-shadow: 0 20px 44px -34px rgba(37, 99, 235, 0.34), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.evidence-chart-panel::before {
  position: absolute;
  top: 0;
  left: 26px;
  width: 64px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  content: "";
  background: var(--tc-blue);
}

.evidence-chart-panel__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 5px;
  padding: 2px 0 10px;
  border-bottom: 1px solid #e8eef6;
}

.evidence-chart-panel__eyebrow {
  margin: 0 0 5px;
  color: var(--tc-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.evidence-chart-panel h3 {
  margin: 0;
  color: var(--tc-slate-900);
  font-size: 20px;
  font-weight: 700;
  line-height: 26px;
}

.evidence-chart-panel__meta {
  flex: 0 0 auto;
  margin: 4px 0 0;
  color: var(--tc-slate-500);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 18px;
}

.evidence-chart__canvas-wrap {
  min-width: 0;
  min-height: 120px;
}

.evidence-chart {
  width: 100%;
  height: 100%;
  min-height: 120px;
}

.evidence-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  padding: 10px 0 0;
  border-top: 1px solid #e8eef6;
  list-style: none;
}

.evidence-chart__legend li {
  min-width: 0;
}

.evidence-chart__legend button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #e3ebf4;
  border-radius: 8px;
  color: var(--tc-slate-600);
  background: #f8fbff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: border-color 220ms cubic-bezier(0.22, 1, 0.36, 1), background-color 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.evidence-chart__legend button::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  content: "";
  background: #3479be;
}

.evidence-chart__legend span {
  font-weight: 700;
}

.evidence-chart__legend strong {
  color: var(--tc-slate-900);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.evidence-chart__legend [data-evidence="ms"]::before {
  background: #c77a2b;
}

.evidence-chart__legend [data-evidence="rpp"]::before {
  background: #367f79;
}

.evidence-chart__legend [data-evidence="seqcomp"]::before,
.evidence-chart__legend [data-evidence="peptide"]::before {
  background: #326fb4;
}

.evidence-chart__legend [data-evidence="ires"]::before {
  background: #7695bc;
}

.evidence-chart__legend [data-evidence="m6a"]::before {
  background: #ad705d;
}

.evidence-chart__legend [data-evidence="tis"]::before {
  background: #648f88;
}

.evidence-chart__legend [data-evidence="orf"]::before {
  background: #3b5873;
}

@media (hover: hover) {
  .evidence-chart__legend button:hover {
    border-color: #bfd4ef;
    background: #ffffff;
    box-shadow: 0 8px 18px -14px rgba(37, 99, 235, 0.55);
    transform: translateY(-1px);
  }
}

.statistics-summary-card__help:active,
.evidence-chart__legend button:active {
  transform: scale(0.98);
}

.statistics-summary-card__help:focus-visible,
.evidence-chart__legend button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .statistics-workbench.is-evidence-ready [data-stat-card],
  .statistics-workbench.is-evidence-ready .evidence-chart-panel {
    opacity: 0;
    transform: translateY(14px);
  }

  .statistics-workbench.is-evidence-ready.is-evidence-visible [data-stat-card],
  .statistics-workbench.is-evidence-ready.is-evidence-visible .evidence-chart-panel {
    animation: evidence-overview-enter 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .statistics-workbench.is-evidence-ready.is-evidence-visible [data-stat-card]:nth-child(2) {
    animation-delay: 80ms;
  }

  .statistics-workbench.is-evidence-ready.is-evidence-visible [data-stat-card]:nth-child(3) {
    animation-delay: 160ms;
  }

  .statistics-workbench.is-evidence-ready.is-evidence-visible .evidence-chart-panel {
    animation-delay: 120ms;
  }
}

@keyframes evidence-overview-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1023px) {
  .statistics-workbench {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .statistics-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: minmax(144px, 1fr);
  }

  .statistics-summary-card {
    min-height: 144px;
    padding: 22px;
  }

  .statistics-summary-card--ms,
  .statistics-summary-card--signals {
    border-top: 0;
    border-left: 1px solid #e6edf5;
  }
}

@media (max-width: 639px) {
  .statistics-workbench {
    gap: 14px;
  }

  .statistics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(132px, auto) minmax(112px, auto);
    border-radius: 14px;
  }

  .statistics-summary-card {
    min-height: 112px;
    padding: 20px 18px;
  }

  .statistics-summary-card--total {
    min-height: 132px;
    grid-column: 1 / -1;
  }

  .statistics-summary-card--ms {
    border-top: 1px solid #e6edf5;
    border-left: 0;
  }

  .statistics-summary-card--signals {
    border-top: 1px solid #e6edf5;
    border-left: 1px solid #e6edf5;
  }

  .statistics-summary-card__number {
    font-size: 30px;
  }

  .statistics-summary-card--total .statistics-summary-card__number {
    font-size: 40px;
  }

  .statistics-summary-card__label {
    max-width: 15ch;
    font-size: 12px;
    line-height: 17px;
  }

  .statistics-summary-card > i {
    right: 18px;
    bottom: 17px;
    font-size: 30px;
  }

  .statistics-summary-card__help {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
  }

  .evidence-chart-panel {
    grid-template-rows: auto minmax(286px, 1fr) auto;
    padding: 20px 16px 16px;
    border-radius: 14px;
  }

  .evidence-chart-panel::before {
    left: 16px;
    width: 52px;
  }

  .evidence-chart-panel__header {
    padding-bottom: 10px;
  }

  .evidence-chart-panel h3 {
    font-size: 17px;
    line-height: 23px;
  }

  .evidence-chart__canvas-wrap,
  .evidence-chart {
    min-height: 126px;
  }

  .evidence-chart__legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-top: 10px;
  }

  .evidence-chart__legend button {
    width: 100%;
    justify-content: space-between;
    padding: 0 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .statistics-workbench.is-evidence-ready [data-stat-card],
  .statistics-workbench.is-evidence-ready .evidence-chart-panel {
    opacity: 1;
    transform: none;
  }
}
