body {
  margin: 0
}

.container {
  margin: 0 auto;
  width: 100%;
  max-width: 940px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}


.heading {
  background-color: #001A4B;
  color: #fff;
  padding: 10px 20px;
  text-align: center;
}

.header-text {
  font-size: 48px;
  text-transform: uppercase;
  color: #fff
}

.header-desc {
  font-size: 16px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.map-toolbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  width: min(420px, calc(100% - 32px));
  padding: 0 16px;
  margin: 0;
  box-sizing: border-box;
  pointer-events: none;
}


.map-toolbar .choices {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 250px;
  min-width: 0;
  margin-bottom: 0;
  pointer-events: auto;
}

.map-toolbar .choices__inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 44px;
  padding-bottom: 0;
  box-sizing: border-box;
  border: 1px solid #c5ced6;
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 20px;
  line-height: 1.25;
  color: #4E4E56;
  vertical-align: unset;
}

.map-toolbar .choices__list--single {
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
}

.map-toolbar .choices__list--single .choices__item {
  padding: 0;
  line-height: 1.25;
}

.choices__placeholder {
  opacity: 1
}

.map-toolbar .choices__inner::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23001A4B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-5.6 7-11a7 7 0 1 0-14 0c0 5.4 7 11 7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
  pointer-events: none;
}

.map-toolbar .choices.is-open .choices__inner {
  border-color: #001A4B;
}

.map-toolbar .choices[data-type*='select-one'] .choices__inner {
  padding-bottom: 0;
  padding-right: 44px;
}

.map-toolbar .choices[data-type*='select-one']::after {
  border-color: #001A4B transparent transparent transparent;
  right: 16px;
  top: 50%;
  bottom: auto;
  margin-top: -2.5px;
}

.map-toolbar .choices[data-type*='select-one'].is-open::after {
  margin-top: -7.5px;
  border-color: transparent transparent #001A4B transparent;
}

.map-toolbar .choices__list--dropdown,
.map-toolbar .choices__list[aria-expanded] {
  border: 1px solid #c5ced6;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  z-index: 30;
}

.map-toolbar .choices__list--dropdown .choices__item--selectable {
  padding: 10px 14px;
}

.map-toolbar .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: #eef3f9;
}

#map {
  position: relative;
  width: 100%;
  background: #f4f4f4;
  overflow: visible;
  border: 1px solid #d5dae0;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#map>svg {
  display: block;
  position: relative;
  z-index: 1;
}

#map .map-layer path {
  stroke: #ffffff;
  stroke-width: 0.15;
}

#map .map-layer path:hover {
  stroke: #ffffff;
  stroke-width: 0.25;
}

#map .map-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: #ffffff;
  color: #495057;
  padding: 12px 14px;
  min-width: 132px;
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

#map .map-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  transform: translateX(-50%) rotate(45deg);
}

#map .map-tooltip-rank {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  color: #a08f61;
}

#map .map-tooltip-name {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.05;
  font-weight: 700;
  color: #2f3640;
}

#map .map-tooltip-region {
  margin-top: 8px;
  font-size: 14px;
  color: #646d76;
}

.map-legend {
  position: absolute;
  right: 30px;
  bottom: 140px;
  /* sits above zoom buttons */
  z-index: 22;

  display: flex;
  flex-direction: column;
  /* vertical layout */
  align-items: center;
  /* gap: 10px; */

  width: auto;
  padding: 0;
  background: transparent;
  pointer-events: none;
  max-height: 500px;
}

.map-legend-first {
  width: 12px;
  height: 40px;
  background-color: #001A4B;
}

.map-legend-second {
  width: 12px;
  height: 40px;
  background-color: #0F254D;
}

.map-legend-third {
  width: 12px;
  height: 40px;
  background-color: #1D2F4F;
}

.map-legend-fourth {
  width: 12px;
  height: 40px;
  background-color: #2C3A51;
}

.map-legend-fifth {
  width: 12px;
  height: 40px;
  background-color: #3A4553;
}

.map-legend-sixth {
  width: 12px;
  height: 40px;
  background-color: #494F55;
}

.map-legend-seventh {
  width: 12px;
  height: 40px;
  background-color: #575A57;
}

.map-legend-eighth {
  width: 12px;
  height: 40px;
  background-color: #666559;
}

.map-legend-ninth {
  width: 12px;
  height: 40px;
  background-color: #746F5B;
}

.map-legend-tenth {
  width: 12px;
  height: 40px;
  background-color: #837A5D;
}


.map-legend-eleventh {
  width: 12px;
  height: 40px;
  background-color: #91855F
}

.map-legend-twelfth {
  width: 12px;
  height: 40px;
  background-color: #A08F61
}

.map-legend-twelfth {
  width: 12px;
  height: 40px;
  background-color: #A08F61
}


.map-legend-thirteenth {
  width: 12px;
  height: 40px;
  background-color: #AE9A63
}


.map-legend-high,
.map-legend-low {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.05em;
  padding: 10px;
}

.map-legend-bar {
  width: 14px;
  height: 180px;
  /* vertical height */
  border-radius: 4px;
  border: 1px solid rgba(0, 26, 75, 0.2);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

.map-zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 12px;
  z-index: 23;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.map-zoom-btn {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 2px solid #4E4E56;
  background: #ffffff;
  color: #4E4E56;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 26, 75, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  padding-bottom: 2px;
  pointer-events: auto;
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.map-zoom-btn:hover {
  background: #f4f7fb;
  box-shadow: 0 3px 14px rgba(0, 26, 75, 0.18);
}

.map-zoom-btn:active {
  transform: scale(0.97);
  background: #eef2f8;
}

@media (max-width: 720px) {
  .map-legend {
    bottom: 12px;
    max-width: calc(100% - 50px);
    padding: 4px 2px;
    /* gap: 8px 10px; */
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .map-legend-low,
  .map-legend-high {
    font-size: 8px;
    letter-spacing: 0.05em;
  }

  .map-legend-bar {
    flex: 1 1 auto;
    min-width: 72px;
    max-width: 160px;
    height: 12px;
  }

  .map-zoom-controls {
    bottom: 56px;
    right: 8px;
  }

  .map-zoom-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-width: 2px;
  }
}

.rank-table-wrap {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  /* Sticky header + ~10 body rows visible; scroll for remaining rows */
  max-height: min(400px, 78vh);
  -webkit-overflow-scrolling: touch;
  background: #b9b9c6;
  /* padding: 0 0 16px; */
  box-sizing: border-box;
}

.rank-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  /* border-collapse: collapse; */
  border-spacing: 0;
  background: #ffffff;
}

.rank-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #4a4b56;
  color: #ffffff;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 10px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  vertical-align: bottom;
  white-space: normal;
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
}

.rank-table-th-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 3.25rem;
}

.rank-table thead th:first-child .rank-table-th-inner,
.rank-table thead th:nth-child(2) .rank-table-th-inner {
  align-items: flex-start;
  min-height: 0;
}

.rank-table-th-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.rank-table-th-label {
  display: block;
  text-align: center;
}

.rank-table-th-sortable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.rank-table-th-sortable:hover {
  background: #5c5d68;
}

.rank-table-th-sortable:focus {
  outline: none;
}

.rank-table-th-sortable:focus-visible {
  outline: 2px solid #e8e4d4;
  outline-offset: -2px;
}

.rank-table thead th:first-child {
  width: 11%;
  text-align: left;
}

.rank-table thead th:nth-child(2) {
  width: 26%;
  text-align: left;
}

.rank-table tbody td {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  color: #2f3640;
  font-size: 12px;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

.rank-table tbody td:not(.rank-table-rank):not(.rank-table-name) {
  text-align: center;
  font-size: 11px;
}

.rank-table-cell-value {
  display: inline;
}

.rank-table-city {
  font-weight: 700;
  color: #2f3640;
}

.rank-table-region-sep,
.rank-table-region-part {
  font-weight: 400;
  color: #646d76;
}

/* Alternating row backgrounds follow visible rows when the region filter is active. */
.rank-table tbody tr.rank-table-band-b td {
  background: #f7f7f9;
}

.rank-table tbody tr.rank-table-band-a td {
  background: #ffffff;
}

.rank-table tbody tr.rank-table-first-row td.rank-table-rank,
.rank-table tbody tr.rank-table-first-row td.rank-table-rank .rank-table-cell-value {
  color: #a08f61;
}

.rank-table tbody tr.rank-table-first-row td {
  background: #ddd6bf;
}

.rank-table-rank {
  font-weight: 700;
  color: #3a3d45;
}

/* .rank-table-name {
  font-weight: 700;
} */

.rank-table-region {
  color: #646d76;
}

@media (max-width: 720px) {
  body {
    -webkit-text-size-adjust: 100%;
  }

  .container {
    box-sizing: border-box;
  }

  .heading {
    padding: 12px 8px;
  }

  .header-text {
    font-size: 18px;
    line-height: 1.1;
  }

  .header-desc {
    font-size: 12px;
    line-height: 1.45;
  }

  .header-desc br {
    display: none;
  }

  #map {
    min-height: 450px;
  }

  .map-toolbar {
    top: 10px;
    width: calc(100% - 20px);
    max-width: none;
    padding: 0 10px;
  }

  .map-toolbar .choices {
    max-width: none;
  }

  .map-toolbar .choices__inner {
    font-size: 15px;
    min-height: 42px;
    padding: 0 40px 0 40px;
  }

  .rank-table-wrap {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: none;

    max-height: min(72vh, 580px);

    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #rank-table {
    padding: 0;
    box-sizing: border-box;
    max-width: none;
    margin: 0;
  }

  .rank-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    max-width: none;
    background: #ffffff;
  }

  .rank-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
  }

  .rank-table thead th {
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.04em;
    padding: 14px 8px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: none;
    vertical-align: bottom;
  }

  .rank-table thead th:last-child {
    border-right: none;
  }

  .rank-table thead th:first-child,
  .rank-table tbody td:first-child {
    min-width: 52px;
    max-width: 64px;
    width: 52px;
    box-sizing: border-box;
  }

  .rank-table thead th:nth-child(2),
  .rank-table tbody td:nth-child(2) {
    width: 130px;
    /* min-width: 148px;
    max-width: 220px; */
    box-sizing: border-box;
  }

  .rank-table thead th:nth-child(n + 3),
  .rank-table tbody td.rank-table-metric {
    min-width: 80px;
    max-width: 100px;
    box-sizing: border-box;
  }

  .rank-table tbody {
    display: table-row-group;
  }

  .rank-table tbody tr {
    display: table-row;
  }

  .rank-table tbody td {
    display: table-cell;
    padding: 14px 10px;
    border-bottom: none;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: middle;
    font-size: 13px;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .rank-table tbody td:last-child {
    border-right: none;
  }

  .rank-table tbody td.rank-table-rank {
    font-size: 13px;
  }

  .rank-table tbody td.rank-table-rank .rank-table-cell-value {
    font-size: 13px;
  }

  .rank-table tbody td.rank-table-name {
    font-size: 13px;
  }

  .rank-table tbody td.rank-table-metric {
    text-align: center;
  }

  .rank-table tbody td.rank-table-metric .rank-table-cell-value {
    font-weight: 700;
    color: #3a3d45;
    font-size: 13px;
  }

  .map-legend-first {
    width: 40px;
    height: 12px;
    background-color: #001A4B;
  }

  .map-legend-second {
    width: 40px;
    height: 12px;
    background-color: #0F254D;
  }

  .map-legend-third {
    width: 40px;
    height: 12px;
    background-color: #1D2F4F;
  }

  .map-legend-fourth {
    width: 40px;
    height: 12px;
    background-color: #2C3A51;
  }

  .map-legend-fifth {
    width: 40px;
    height: 12px;
    background-color: #3A4553;
  }

  .map-legend-sixth {
    width: 40px;
    height: 12px;
    background-color: #494F55;
  }

  .map-legend-seventh {
    width: 40px;
    height: 12px;
    background-color: #575A57;
  }

  .map-legend-eighth {
    width: 40px;
    height: 12px;
    background-color: #666559;
  }

  .map-legend-ninth {
    width: 40px;
    height: 12px;
    background-color: #746F5B;
  }

  .map-legend-tenth {
    width: 40px;
    height: 12px;
    background-color: #837A5D;
  }


  .map-legend-eleventh {
    width: 40px;
    height: 12px;
    background-color: #91855F
  }

  .map-legend-twelfth {
    width: 40px;
    height: 12px;
    background-color: #A08F61
  }

  .map-legend-twelfth {
    width: 40px;
    height: 12px;
    background-color: #A08F61
  }

  .map-legend-thirteenth {
    width: 40px;
    height: 12px;
    background-color: #AE9A63
  }


  .map-legend-high,
  .map-legend-low {
    writing-mode: horizontal-tb;
    transform: none;
    padding: 5px;
  }

  .rank-table-th-icon {
    display: block;
    width: 15px;
    height: 15px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .main-logo {
    width: 200px;
  }

}