:root {
  --pane-width: 360px;
  --nav-height: 51px;
}
/* Placeholder in the top bar for counties not published yet. */
.nav-disabled {
  color: #8a8a8a;
  cursor: default;
}
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}
#map {
  position: absolute;
  top: var(--nav-height);
  bottom: 0;
  left: 0;
  right: var(--pane-width); /* the map ends where the pane begins */
}

/* ---------------------------------------------------------- side pane */
#sidebar {
  position: absolute;
  top: var(--nav-height);
  right: 0;
  bottom: 0;
  width: var(--pane-width);
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #ccc;
  box-sizing: border-box;
  font-size: 14px;
}
.sidebar-head {
  padding: 12px 16px 8px;
  border-bottom: 1px solid #e5e5e5;
}
.sidebar-head h1 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.3;
}
.sidebar-head p {
  margin: 0;
  color: #666;
  font-size: 12px;
}
#race-list {
  padding: 0 0 24px;
}
#race-list .group {
  margin: 0;
  padding: 14px 16px 4px;
  font-size: 11px;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #777;
}
.race {
  border-bottom: 1px solid #eee;
}
.race-name {
  display: block;
  width: 100%;
  padding: 9px 30px 9px 16px;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  position: relative;
}
.race-name::after {
  content: '▸';
  position: absolute;
  right: 14px;
  color: #999;
}
.race-name:hover {
  background: #f4f4f4;
}
.race.open .race-name {
  background: #f0f0f0;
}
.race.open .race-name::after {
  content: '▾';
}
.race-detail {
  padding: 0 16px;
}
.race.open .race-detail {
  padding: 8px 16px 12px;
}
.empty {
  padding: 16px;
  color: #666;
}

/* ---------------------------------------------------------- results rows */
.meta, .hint, .total {
  margin: 4px 0 8px;
  font-size: 12px;
  color: #666;
}
.total {
  color: #333;
}
.cand {
  margin: 6px 0;
}
.cand-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cand-name {
  flex: 1;
}
.cand-mark {
  width: 1em;
  font-weight: bold;
}
.cand-votes {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cand-pct {
  display: inline-block;
  min-width: 3.4em;
  text-align: right;
  color: #555;
}
.cand-bar {
  height: 4px;
  margin: 3px 0 0 16px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
}
.cand-bar span {
  display: block;
  height: 100%;
}
/* "Show final RCV results and map" link under ranked-choice races. */
.rcv-toggle {
  display: block;
  margin: 2px 0 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: #1a5fd0;
  text-align: left;
  cursor: pointer;
}
.rcv-toggle:hover {
  text-decoration: underline;
}
/* Candidate names in the pane open that candidate's support map. */
.cand-pick {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.cand-pick:hover {
  text-decoration: underline;
}
.cand.active .cand-pick {
  font-weight: bold;
}
.cand-clear {
  flex: none;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #d10000;
  font: bold 14px/1 Arial, sans-serif;
  cursor: pointer;
}
.cand-clear:hover {
  color: #8a0000;
}
.cand.muted,
.cand.muted .cand-pct {
  color: #c4c4c4;
}
.cand.muted .legend-key,
.cand.muted .cand-bar span {
  opacity: 0.35;
}
.support-legend {
  margin: 8px 0 4px 16px;
}
.support-ramp {
  display: block;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}
.support-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
}
.popup-support {
  margin-bottom: 4px;
}
.legend-key {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 20%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.scale {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.scale .legend-key {
  margin-right: 3px;
}

/* ---------------------------------------------------------- precinct popup */
.mapboxgl-popup-content {
  font-family: Arial, sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  min-width: 200px;
}
.popup-title {
  font-weight: bold;
  margin: 0 18px 6px 0;
}
.mapboxgl-popup-content p {
  margin: 4px 0;
}

/* ---------------------------------------------------------- phones */
/* The screen splits: map on top, pane below. The map ends where the pane
   begins, so the Mapbox logo and attribution never cover the results. */
@media (max-width: 768px) {
  #map {
    right: 0;
    bottom: 42vh;
  }
  #sidebar {
    top: auto;
    left: 0;
    width: auto;
    height: 42vh;
    border-left: 0;
    border-top: 1px solid #999;
  }
  .mapboxgl-popup-content {
    min-width: 0;
  }
}
