* {
	box-sizing: border-box;
}
html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	font-family: Arial, Helvetica, sans-serif;
}
body {
	overflow: hidden;
	background: #e8dfcf;
}
.topbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 74px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 22px;
	background: #A5623E;
	color: white;
	z-index: 2000;
	box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.title-area h1 {
	margin: 0;
	font-family: Georgia, serif;
	font-size: 25px;
	font-weight: normal;
}
.title-area p {
	margin: 3px 0 0;
	color: #d8c8ad;
	font-size: 13px;
}
.controls {
	display: flex;
	gap: 18px;
	align-items: center;
	font-size: 14px;
}
.controls label {
	cursor: pointer;
	user-select: none;
}
.controls input {
	margin-right: 5px;
	accent-color: #d39b45;
}
#map {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
}
.legend {
	position: absolute;
	right: 20px;
	bottom: 25px;
	width: 245px;
	padding: 16px;
	background: rgba(255,252,245,0.96);
	border: 1px solid #b8aa91;
	border-radius: 7px;
	box-shadow: 0 3px 14px rgba(0,0,0,0.3);
	z-index: 1500;
}
aside.legend {
    /* Verhindert, dass die Legende höher als 80% des Bildschirms wird */
    max-height: 80vh; 
    
    /* Aktiviert den vertikalen Scrollbalken NUR, wenn der Inhalt zu lang ist */
    overflow-y: auto; 
    
    /* Optional: Verhindert unschöne horizontale Scrollbalken durch Textumbrüche */
    overflow-x: hidden; 
    
    /* Falls im bestehenden CSS ein festes 'height: ...px' steht, lösche es dort oder überschreibe es hier: */
    height: auto !important; 
}
.legend h2 {
	margin: 0 0 12px;
	font-family: Georgia, serif;
	font-size: 19px;
	color: #3d2b1f;
}
.legend-section {
	margin-top: 13px;
}
.legend-section h3 {
	margin: 0 0 7px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #715638;
}
.legend-item {
	display: flex;
	align-items: center;
	margin: 6px 0;
	font-size: 13px;
	color: #33291f;
}
.marker {
	width: 14px;
	height: 14px;
	display: inline-block;
	margin-right: 9px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,0.45);
}
.marker.tin {
	background: #6E7B8B;
}
.marker.copper {
	background: #FF7F24;
}
.marker.city {
	width: 12px;
	height: 12px;
	background: #ff0000;
	border-radius: 2px;
	transform: rotate(45deg);
	margin-left: 1px;
	margin-right: 10px;
}
.route {
	display: inline-block;
	width: 30px;
	margin-right: 9px;
	border-top: 3px solid #FFAEB9;
}
.route-high {
	border-top-style: solid;
}
.route-medium {
	border-top-style: dashed;
}
.route-low {
	border-top-style: dotted;
}
.leaflet-popup-content {
	min-width: 220px;
	line-height: 1.45;
}
.popup-title {
	margin-bottom: 6px;
	font-family: Georgia, serif;
	font-size: 17px;
	font-weight: bold;
	color: #493522;
}
.popup-type {
	margin-bottom: 8px;
	color: #775d42;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.popup-description {
	font-size: 13px;
}
.popup-certainty {
	margin-top: 9px;
	padding-top: 7px;
	border-top: 1px solid #ddd2c2;
	font-size: 12px;
}
@media(max-width:700px) {
.topbar {
	height: auto;
	min-height: 100px;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 10px 15px;
}
.controls {
	flex-wrap: wrap;
	gap: 8px 15px;
}
.legend {
	right: 10px;
	bottom: 10px;
	width: 205px;
	font-size: 12px;
}
}
