html {
	--webbg: #fff;
	--text: #262626;
	--bg: #eef3f6;
	--cubes: #d5d8dd;
	--whiteorblack: #eff3f5;
	--white: #eff3f5;
	--black: #262626;
	--yes: #4c988c;
	--yes: #009667;
	--no: #c6cbd2;
	--sectioncolor: #000099;
	--sectioncolor2: #3399ff;
	--invert: none;
	--displayDark: none;
	--displayLight: block;
	--fill-tiheasustus: #d4dae0;
	--fill-linnad: #cbd2d9;
	--stroke-roads: #d1d5dc;
	--stroke-roads: #333;
	--grey: #8d96a5;
	--green: #88cc98;
	--color-mapbg: #f4f6f8;
	--color-mapground: #e4e8ed;
	--color-greet: #1754bd;
	--color-event: #00aeef;
	--color-stop: #f172ac;
	--color-markerborder: #fff;
	--rotate-start: rotate(13deg);
	--rotate-finish: rotate(-8deg);
}

html.dark-theme {
	--webbg: #141414;
	--text: #eff3f5;
	--bg: #202124;
	--cubes: #717c8e;
	--whiteorblack: #262626;
	--no: #5a6372;
	--invert: invert(0.9) hue-rotate(180deg);
	--displayDark: block;
	--displayLight: none;
	--color-mapbg: #1d1d21;
	--color-mapground: #3e4854;
	--color-markerborder: #000;
	--fill-tiheasustus: #4c5765;
	--fill-linnad: #596778;
	--stroke-roads: #cbcbcb;
}

body {
	background: var(--webbg);
	margin: auto;
	max-width: 1248px;
}
.bg {
	background: var(--bg);
}
div {
	box-sizing: content-box;
}
b {
	font-weight: 600 !important;
}
.invert {
	filter: var(--invert);
}
.dark {
	display: var(--displayDark);
}
.light {
	display: var(--displayLight);
}
.l {
	text-align: left !important;
}
.c {
	text-align: center !important;
}
.r {
	text-align: right !important;
}

.cubes {
	width: 100%;
	height: 12px;
	color: var(--cubes);
	background-image: radial-gradient(
		circle at 1px 1px,
		currentColor 1px,
		transparent 0
	);
	background-size: 4px 4px;
	background-position: center left;
}

* {
	-webkit-font-smoothing: grayscale;
	-moz-osx-font-smoothing: grayscale;
	font-family: "GT Eesti", "Arial", sans-serif;
	font-weight: 400;
	font-size: 17px;
	line-height: 1.4;
	color: var(--text);
	margin: 0;
}

.title {
	font-weight: 700;
	font-size: 28px;
	line-height: 1;
	display: flex;
	align-items: center;
	gap: 15px;
	white-space: nowrap;
}

.lead-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 9px 0 16px 0;
}

.ld {
	font-size: 16px;
}

.allikas {
	font-size: 13px;
	line-height: 15px;
	opacity: 0.4;
	text-align: center;
	margin-top: 13px;
}

.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
}

.legend .legend--item {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	line-height: 13px;
}

.legend .legend--item div {
	width: 20px;
	min-width: 20px;
	height: 20px;
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
	border-radius: 50%;
	overflow: hidden;
}

#map {
	width: 100%;
	height: 650px;
	cursor: default;
	border-radius: 5px;
	background: var(--color-mapbg);
}

#map * {
	font-weight: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	margin: inherit;
}

#map .leaflet-base-roads-pane {
	opacity: 0.12;
}


#map .custom-marker .marker-inner {
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: default;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
	/*border: 1px solid var(--color-markerborder);*/
	border-radius: 50%;
	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
}

#map .custom-marker.today .marker-inner {
	border: 1px solid var(--color-markerborder);
	box-shadow:	1px 4px 2px rgba(0, 0, 0, 0.2);
}

#map .custom-marker.today .marker-inner::before {
	content: '';
	border: 3px solid #edaf0b;
	position: absolute;
	top: -4px;
	left: -4px;
	right: -4px;
	bottom: -4px;
	border-radius: 50%;
}

#map .custom-marker.icon-start,
#map.custom-marker.icon-finish {
	pointer-events: none;
}

#map .custom-marker.icon-start .marker-inner {
	background-image: url("assets/flag-start.svg");
	background-size: contain;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transform: var(--rotate-start) !important;
	transform-origin: 50% 100%;
}

.dark-theme #map .custom-marker.icon-start .marker-inner {
	background-image: url("assets/flag-start-dark.svg");
}

#map .custom-marker.icon-finish .marker-inner {
	background-image: url("assets/flag-finish.svg");
	background-size: contain;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transform: var(--rotate-finish) !important;
	transform-origin: 50% 100%;
}

.dark-theme #map .custom-marker.icon-finish .marker-inner {
	background-image: url("assets/flag-finish-dark.svg");
}

#map .custom-marker.icon-location {
	pointer-events: none;
	z-index: 1500 !important;
}

.legend .legend--item.legend-location div,
#map .custom-marker.icon-location .marker-inner {
	background-image: url("assets/ico-location.png");
	background-size: contain;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.dark-theme #map .custom-marker.icon-location .marker-inner {
	background-image: url("assets/ico-location-dark.png");
}

.legend .legend--item.legend-location div {
	background-image: url("assets/ico-location-legend.svg");
	border-radius: 0;
}

.legend .legend--item.legend-greet div,
#map .custom-marker.icon-greet .marker-inner {
	background-image: url("assets/ico-greet.svg");
	background-color: var(--color-greet);
	background-size: 9px;
}

.legend .legend--item.legend-event div,
#map .custom-marker.icon-event .marker-inner {
	background-image: url("assets/ico-event.svg");
	background-color: var(--color-event);
	background-size: 10px;
}

.legend .legend--item.legend-stop div,
#map .custom-marker.icon-stop .marker-inner {
	background-image: url("assets/ico-stop.svg");
	transform: scale(0.57);
	background-color: var(--color-stop);
	background-size: 5px;
}

#map
	.leaflet-marker-pane.zoom-step-1
	.custom-marker:not(.icon-location):not(.icon-start):not(.icon-finish)
	.marker-inner {
	transform: scale(0.35);
	border: 2px solid var(--color-markerborder);
	background-image: none;
}

#map .leaflet-marker-pane.zoom-step-1 .custom-marker.icon-stop .marker-inner {
	transform: scale(0.25);
}

#map .leaflet-marker-pane.zoom-step-1 .custom-marker.icon-start .marker-inner {
	transform: var(--rotate-start) scale(0.7) !important;
}
#map .leaflet-marker-pane.zoom-step-1 .custom-marker.icon-finish .marker-inner {
	transform: var(--rotate-finish) scale(0.7) !important;
}

#map
	.leaflet-marker-pane.zoom-step-2
	.custom-marker:not(.icon-location):not(.icon-start):not(.icon-finish)
	.marker-inner {
	transform: scale(0.45);
	border: 2px solid var(--color-markerborder);
	background-image: none;
}

#map .leaflet-marker-pane.zoom-step-2 .custom-marker.today .marker-inner::before {
	border: 4px solid #edaf0b;
	top: -7px;
	left: -7px;
	right: -7px;
	bottom: -7px;
}

#map .leaflet-marker-pane.zoom-step-1 .custom-marker.icon-location .marker-inner,
#map .leaflet-marker-pane.zoom-step-2 .custom-marker.icon-location .marker-inner {
	transform: scale(0.85);
}

#map .leaflet-marker-pane.zoom-step-2 .custom-marker.today .marker-inner::before {
	top: -6px;
	left: -6px;
	right: -6px;
	bottom: -6px;
}

#map .leaflet-marker-pane.zoom-step-2 .custom-marker.icon-stop .marker-inner {
	transform: scale(0.35);
}

#map .leaflet-marker-pane.zoom-step-2 .custom-marker.icon-start .marker-inner {
	transform: var(--rotate-start) scale(0.9) !important;
}
#map .leaflet-marker-pane.zoom-step-2 .custom-marker.icon-finish .marker-inner {
	transform: var(--rotate-finish) scale(0.9) !important;
}

#map .leaflet-marker-pane.zoom-step-3 .custom-marker .marker-inner {
	transform: scale(0.85);
}

#map .leaflet-marker-pane.zoom-step-3 .custom-marker.icon-stop .marker-inner {
	transform: scale(0.5);
}

#map .leaflet-marker-pane.zoom-step-3 .custom-marker.icon-start .marker-inner {
	transform: var(--rotate-start) scale(0.9) !important;
}
#map .leaflet-marker-pane.zoom-step-3 .custom-marker.icon-finish .marker-inner {
	transform: var(--rotate-finish) scale(0.9) !important;
}

#map .leaflet-marker-pane.zoom-step-4 .custom-marker .marker-inner {
	transform: scale(1);
}

#map .leaflet-marker-pane.zoom-step-4 .custom-marker.icon-stop .marker-inner {
	transform: scale(0.57);
}

#map .leaflet-marker-pane.zoom-step-5 .custom-marker .marker-inner {
	transform: scale(1.3);
}

#map .leaflet-marker-pane.zoom-step-5 .custom-marker.icon-stop .marker-inner {
	transform: scale(0.7);
}

#map .leaflet-marker-pane.zoom-step-5 .custom-marker.icon-start .marker-inner {
	transform: var(--rotate-start) scale(1.2) !important;
}
#map .leaflet-marker-pane.zoom-step-5 .custom-marker.icon-finish .marker-inner {
	transform: var(--rotate-finish) scale(1.2) !important;
}

#map .leaflet-control-zoom {
	filter: var(--invert);
}

#map .leaflet-control-zoom span {
	color: var(--black);
	font-size: 20px;
}

#map img {
	image-rendering: -webkit-optimize-contrast;
	filter: blur(0);
}

#map .leaflet-tooltip {
	padding: 10px 10px;
	font-size: 14px;
	line-height: 1.35;
	color: var(--text);
	background: var(--webbg);
	border: 0;
	box-shadow: 1px 8px 8px rgba(0, 0, 0, 0.15);
	border-radius: 13px;
}

#map .leaflet-tooltip-left::before {
	border-left-color: var(--webbg);
}

#map .leaflet-tooltip-right::before {
	border-right-color: var(--webbg);
}

#map .leaflet-tooltip .tooltip-content--inner {
	max-width: 250px;
	width: max-content;
	white-space: normal;
}

#map .leaflet-tooltip .tooltip-content--inner .tooltip-header {
	display: flex;
	align-items: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--grey);
}

#map .leaflet-tooltip .tooltip-content--inner .tooltip-header span {
	display: block;
	width: 8px;
	min-width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 4px;
}

#map .leaflet-tooltip .tooltip-content--inner .tooltip-header span.event {
	background: var(--color-event);
}
#map .leaflet-tooltip .tooltip-content--inner .tooltip-header span.greet {
	background: var(--color-greet);
}
#map .leaflet-tooltip .tooltip-content--inner .tooltip-header span.stop {
	background: var(--color-stop);
}

#map .leaflet-left {
	left: 7px;
}
#map .leaflet-top {
	top: 7px;
}

#map .leaflet-interactive {
	cursor: default;
	fill-opacity: 1;
}

#map .maplayer--ground {
	fill: var(--color-mapground);
	stroke: var(--color-mapbg);
	stroke-width: 2;
	cursor: default;
	fill-opacity: 1;
}

#map .maplayer--ground:hover {
	/*filter: brightness(0.98);*/
}

#map .maplayer--tiheasustus {
	fill: var(--fill-tiheasustus);
	stroke: none;
	pointer-events: none;
}

#map .maplayer--linnad {
	fill: var(--fill-linnad);
	stroke: none;
	pointer-events: none;
}

#map .maplayer--water {
	fill: var(--color-mapbg);
	stroke: none;
	pointer-events: none;
}

#map .maplayer--roads {
	fill: none;
	stroke: var(--stroke-roads);
	stroke-width: 1px;
	pointer-events: none;
}

#map .zoom-step-1 path {
	stroke-width: 0;
}
#map .zoom-step-2 path {
	stroke-width: 1;
	opacity: .5;
}
#map .zoom-step-3 path {
	stroke-width: 1;
	opacity: .65;
}
#map .zoom-step-4 path {
	stroke-width: 1.3;
}
#map .zoom-step-5 path {
	stroke-width: 1.6;
}

#map .maplayer--route {
	fill: none;
	stroke: var(--sectioncolor);
	stroke: var(--green);
	stroke-width: 2.5;
	stroke-dasharray: 2, 4;
	opacity: 1;
	pointer-events: none;
}

#map.only-today .custom-marker:not(.today):not(.icon-location):not(.icon-start):not(.icon-finish) {
	display: none;
}

.map-wrapper {
	position: relative;
}

.map-wrapper .toggle {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--webbg);
	padding: 1px 7px;
	opacity: .9;
	z-index: 9999;
  border-radius: 3px;
}

.map-wrapper .toggle label {
	font-size: 14px;
	user-select: none;
}

@media only screen and (min-width: 1100px) {
	.header {
		display: flex;
		margin-bottom: 13px;
		justify-content: space-between;
		align-items: flex-end;
	}

	.header .col-2 {
		display: flex;
		flex-direction: column;
		margin-bottom: 5px;
		justify-content: flex-end;
	}

	.pk,
	.ld {
		text-align: left;
	}

	.legend {
		justify-content: flex-end;
		margin-bottom: 0;
	}

	.buttons {
		order: 1;
	}

	.allikas {
		text-align: right;
	}

	.allikas.allikas-top {
		display: block;
	}

	.allikas.allikas-bottom {
		display: none;
	}
}

@media only screen and (max-width: 960px) {
	.lead-wrapper {
		display: block;
	}

	.legend {
		margin-top: 19px;
	}

	.ld {
		margin-bottom: 12px;
	}
}

@media only screen and (max-width: 750px) {
	.title {
		font-size: 26px;
	}

	.lead-wrapper {
		display: block;
	}

	.ld {
		margin-bottom: 12px;
	}

	#map {
		height: 520px;
	}

	#map .leaflet-tooltip .tooltip-content--inner {
		max-width: 220px;
	}
}

@media only screen and (max-width: 580px) {
	.title {
		font-size: 26px;
	}

	.lead-wrapper {
		display: block;
	}

	.lead-wrapper span.desktop {
		display: none;
	}

	.legend {
		justify-content: flex-start;
		margin-bottom: 10px;
		margin-top: 12px;
		gap: 1px 20px;
	}

	#map {
		height: 450px;
	}

	#map .leaflet-tooltip .tooltip-content--inner {
		max-width: 200px;
	}

	.legend .legend--item div,
	#map .custom-marker .marker-inner {
		transform: scale(0.7);
		border-width: 1.5px;
	}

	.legend .legend--item.legend-stop div,
	#map .custom-marker.icon-stop .marker-inner {
		transform: scale(0.5);
	}

	.map-wrapper .toggle label {
		font-size: 13px;
	}
}
