.vote-share-chart {
  margin: 0;
  margin-block-end: 1.5rem;
}

.vote-share-chart__total {
  margin-block-end: 1rem;
  color: #555;
  font-size: 0.9375rem;
}

.election-h-chart {
  width: 100%;
  border-collapse: collapse;
}

.election-h-chart thead th {
  padding-block: 0.375rem;
  text-align: start;
  border-bottom: 2px solid #ccc;
  font-weight: 700;
}

.election-h-chart tbody td,
.election-h-chart tbody th {
  vertical-align: middle;
  border: 0.1875rem solid #fff;
  background-color: #f5f5f5;
}

.election-h-chart__label {
  width: 12rem;
  padding-block: 0.375rem;
  padding-inline: 0.5rem;
  font-weight: 700;
}

.election-h-chart__bar-cell {
  padding: 0;
}

.election-h-chart__bar-inner {
  display: flex;
  align-items: stretch;
  height: 2.5rem;
}

.election-h-chart__bar {
  flex-shrink: 0;
}

.election-h-chart__value {
  align-self: center;
  padding-inline-start: 0.5rem;
  white-space: nowrap;
  font-size: 0.9375rem;
}

.election-h-chart__votes,
.election-h-chart__votes-col,
.election-h-chart__seats-col,
.election-h-chart__seats {
  width: 5rem;
  padding-inline: 0.75rem 0.5rem;
  text-align: end;
  white-space: nowrap;
}

.election-h-chart__name-abbr {
  display: none;
}

.election-h-chart__candidate,
.election-h-chart__party {
  display: block;
}

.election-h-chart__party {
  font-size: 0.875rem;
  font-weight: 400;
}

/* Results chart: coloured bar inside the cell, proportional to seats. */
.election-h-chart--results {
  margin-block-start: 2rem;
  margin-block-end: 1.5rem;
  font-size: 1.125rem;
}

.election-h-chart--results .election-h-chart__label {
  white-space: nowrap;
}

.election-h-chart--results .election-h-chart__bar-cell {
  background-clip: padding-box;
}

.election-h-chart tbody .election-h-chart__seats--winner {
  color: #fff;
  background-color: #6b6b6b;
  font-weight: 700;
}

@media (max-width: 40rem) {
  .election-h-chart--vote-share .election-h-chart__label,
  .election-h-chart--results .election-h-chart__label {
    width: 3.5rem;
  }

  .election-h-chart--vote-share .election-h-chart__name-full,
  .election-h-chart--results .election-h-chart__name-full {
    position: absolute;
    overflow: hidden;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    white-space: nowrap;
  }

  .election-h-chart--vote-share .election-h-chart__name-abbr,
  .election-h-chart--results .election-h-chart__name-abbr {
    display: inline;
  }

  .election-h-chart--area-vote .election-h-chart__label {
    width: auto;
    padding-inline-start: 0.5rem;
    border-inline-start: 0.375rem solid var(--party-colour);
  }

  .election-h-chart--area-vote .election-h-chart__bar {
    display: none;
  }

  .election-h-chart--area-vote .election-h-chart__bar-inner {
    height: auto;
    padding-block: 0.375rem;
    padding-inline: 0.5rem;
  }
}
