.tuscany-route-map {
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.tuscany-route-map img {
  display: block;
  height: auto;
}

.tuscany-route-map .tuscany-route-map__legend {
  position: absolute;
  inset: 74% 49% 6% 22%;
  display: grid;
  align-content: center;
  gap: 1px 6px;
  margin: 0;
  padding: 2px 6px;
  border: 1px solid #c1e8d2;
  border-radius: 6px;
  list-style: none;
  background: #e4f9ec;
  color: #141a16;
  font-size: clamp(10px, 2.1cqi, 15px);
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}

.tuscany-route-map__legend li {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tuscany-route-map__legend li::before {
  content: '';
  flex: 0 0 clamp(7px, 3cqi, 20px);
  height: 2px;
  border-radius: 2px;
  background: #ce070a;
}

.tuscany-route-map__legend li:nth-child(2)::before { background: #0078f6; }
.tuscany-route-map__legend li:nth-child(3)::before { background: #71bf36; }
.tuscany-route-map__legend li:nth-child(4)::before { background: #fa9600; }

@container (max-width: 430px) {
  .tuscany-route-map .tuscany-route-map__legend {
    inset: auto auto 2% 22%;
    width: max(31%, 104px);
    min-height: 22%;
    line-height: 1.05;
  }
}
