svg { box-sizing: content-box; }
#map { 
    margin-top: 30px;
    position: relative;
    max-width: 900px;
}
#cartogram {
    overflow: visible;
    margin-top: 15px;
    margin-bottom: 30px;
    /* outline: red solid 1px; */
}
#cartogram.inprogress { opacity: .3; }
#mapFeatures path, #smallFeatures path {
    fill: none;
}
#mapFeatures path.mapFeature {
    cursor: help;
}
#mapFeatures path.mapFeature.region,
#smallFeatures path.mapFeature.region {
    fill: none;
    stroke: var(--eggshell-text);
    stroke-opacity: .3;
    stroke-width: 1;
    pointer-events: none;
}
#smallFeatures path.mapFeature.region {
    fill: var(--yellow);
    fill-opacity: 0;
    pointer-events: auto;
}
#mapFeatures path.mapFeature.urban,
#smallFeatures path.mapFeature.urban {
    fill: #A05AAD;
}
#mapFeatures path.mapFeature.rural,
#smallFeatures path.mapFeature.rural { 
    fill: var(--eggshell-muddy);
    stroke: var(--eggshell-dark-muddy);
    stroke-width: .5;
}
#mapFeatures path.urban.highlighted,
#mapFeatures path.rural.highlighted,
#smallFeatures path.urban.highlighted,
#smallFeatures path.rural.highlighted {
    fill: var(--yellow)!important;
}
#smallFeatures path.mapFeature.region.highlighted { fill-opacity: .6; }

.row .row-primary { margin-top: 25px; }

#details {
    position: absolute;
    top: 55px;
    left: 0;
}
#box-total { margin-bottom: 15px; }
#details form { margin-bottom: 20px; }
#total-value {
    font-family: 'Epilogue', sans-serif;
    font-weight: 900;
    font-size: 50px;
    color: #59513E;
    margin-bottom: 2px;
}
#total-label {
    font-family: 'Epilogue', sans-serif;
    font-weight: 400;
    font-size: 25px;
    color: #59513E;
}
#details form *:hover {
    color: var(--eggshell-text);
    cursor: pointer;
}
#details form label { padding-left: 7px; }
#areas {
    display: flex;
    gap: 3px;
}
#map svg#areas-pie { margin: 0 0 0 -7px; }
#pie-label text {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    fill: var(--eggshell-text);
}
#pie-label path {
    fill: none;
    stroke: #858171;
    stroke-width: .75;
}
#areas-legend { margin-top: 10px; }
#areas-legend .color-item {
    width: 100%;
    max-width: 130px;
    display: flex;
    gap: 7px;
    align-items: flex-start;
    margin-bottom: 10px;
}
#areas-legend .color-mark {
    width: 14px; min-width: 14px;
    height: 14px; min-height: 14px;
    margin-top: -1px;
    border-style: solid;
    border-width: 1px;
    border-radius: 10px;
}
#areas-legend .color-label .name {
    font-family: 'Epilogue', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #59513E;
    margin-bottom: 2px;
}
#areas-legend .color-label .value {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: var(--eggshell-text);
}
#areas-legend .color-label .value {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: var(--eggshell-text);
}

#tooltip {
	font-size: 14px;
	font-weight: 400;
	line-height: 16px;
	pointer-events: none; 
	background: #fff;
	color: var(--eggshell-text);
	position: absolute;
	padding: 15px 15px 20px;
	display: none;
	z-index: 1000;
	width: 100%;
	max-width: 200px;
    border: var(--eggshell-dark-muddy) 1px solid;
    border-radius: 5px;
}
#tt-header {
    background-color: #F4F4F2;
    border-bottom: var(--eggshell-dark-muddy) 1px solid;
    border-radius: 5px 5px 0 0;
    padding: 15px 15px 10px;
    margin: -15px -15px 15px;
}
#tooltip .tt-name {
    font-family: 'Epilogue', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #59513E;
    margin-bottom: 2px;
}
#tooltip .tt-category {
    margin-bottom: 7px;
}
#tooltip .tt-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 12px;
    margin-bottom: 0;
}
#tooltip .tt-urban-list {
    font-size: 12px;
    line-height: 12px;
    margin-top: 3px;
    margin-bottom: 2px;
    font-style: italic;
    color: var(--eggshell-dark-muddy);
}
#tooltip .tt-progress {
    position: relative;
    width: 100%;
    height: 10px;
}
#tooltip .tt-progress::after {
    content: "";
    position: absolute;
    width: 100%;
    top: 5px;
    background-color: #E5E4DF;
    border-bottom: solid 1px #E5E4DF;
    z-index: 1100;
}
#tooltip .tt-bar {
    position: relative;
    height: 10px;
    z-index: 1150;
}
#tooltip .urban .tt-bar { background-color: #A05AAD; }
#tooltip .rural .tt-bar { background-color: #C6C3B6; }

#regions {
    fill: none;
    stroke: black;
    pointer-events: none;
}

#credits {
    margin-top: 45px;
    border-top: 1px solid var(--eggshell-muddy);
    padding-top: 25px;
}
#credits p {
    font-size: 14px;
    font-style: italic;
    color: var(--eggshell-text);
    margin-bottom: 6px;
}

@media (max-width: 960px) {
    #map { margin-top: 0; }
    #cartogram { margin: 0; }
    #details { top: 20px; }
}
@media (max-width: 860px) {
    #details {
        position: inherit;
        display: flex;
        gap: 75px;
        flex-direction: row;
        justify-content: flex-start;
        margin-bottom: -20px;
    }
    #pie-label, .pie-mensk { display: none; }
    #map svg#areas-pie { margin-left: -15px; }
    .row {
        flex-direction: column;
        gap: 15px;
    }
}
@media (max-width: 660px) {
    #details {
        flex-direction: column; 
        gap: 0;
        margin-bottom: -60px;
    }
}
@media (max-width: 620px) {
    #total-value { font-size: 36px; }
    #total-label { font-size: 18px; }
}
@media (max-width: 520px) { #details { margin-bottom: -30px; } }