.gpsusza-wrapper {
	position: relative;
	width: 100%;
	height: 600px;
	min-height: 320px;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
}
.gpsusza-wrapper * {
	box-sizing: border-box;
}
.gpsusza-map {
	position: absolute;
	inset: 0;
	background: #dce6f0;
}

.gpsusza-panel {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1000;
	width: 300px;
	max-width: calc(100% - 20px);
	max-height: calc(100% - 20px);
	overflow-y: auto;
	background: rgba(255, 255, 255, 0.97);
	border-radius: 6px;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
	padding: 12px 14px;
}
.gpsusza-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
}
.gpsusza-panel-header h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #222;
}
.gpsusza-collapse-btn {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	color: #666;
	padding: 3px 7px;
	border-radius: 3px;
}
.gpsusza-collapse-btn:hover {
	background: #f0f0f0;
	color: #222;
}
.gpsusza-search {
	position: relative;
	margin-bottom: 10px;
}
.gpsusza-search input {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 13px;
}
.gpsusza-search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #ccc;
	border-top: none;
	border-radius: 0 0 4px 4px;
	max-height: 180px;
	overflow-y: auto;
	z-index: 1100;
	display: none;
}
.gpsusza-search-results div {
	padding: 6px 10px;
	cursor: pointer;
	font-size: 13px;
}
.gpsusza-search-results div:hover {
	background: #f0f4f8;
}

.gpsusza-category-head {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #999;
	margin: 14px 0 2px;
	padding-top: 8px;
	border-top: 1px solid #ddd;
}
.gpsusza-category-head:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.gpsusza-layer-item {
	border-top: 1px solid #eee;
	padding: 8px 0;
}
.gpsusza-category-head + .gpsusza-layer-item {
	border-top: none;
}
.gpsusza-layer-head {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
}
.gpsusza-layer-head input[type="checkbox"] {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	cursor: pointer;
}
.gpsusza-swatch {
	width: 12px;
	height: 12px;
	border-radius: 2px;
	flex-shrink: 0;
	border: 1px solid rgba(0, 0, 0, 0.15);
}
.gpsusza-layer-label {
	font-weight: 600;
	font-size: 13.5px;
	flex: 1;
}
.gpsusza-layer-body {
	margin-top: 8px;
	padding-left: 24px;
	display: none;
}
.gpsusza-layer-item.active .gpsusza-layer-body {
	display: block;
}
.gpsusza-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
	font-size: 12.5px;
	color: #444;
}
.gpsusza-row select {
	flex: 1;
	min-width: 0;
	padding: 3px 4px;
	font-size: 12.5px;
	border: 1px solid #ccc;
	border-radius: 3px;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}
.gpsusza-row-indicator span:first-child {
	flex-shrink: 0;
}
.gpsusza-row input[type="range"] {
	flex: 1;
}
.gpsusza-hint {
	font-size: 11.5px;
	color: #888;
	margin-top: 2px;
}

.gpsusza-legend {
	margin-top: 10px;
	border-top: 1px solid #eee;
	padding-top: 10px;
}
.gpsusza-legend-title {
	font-weight: 600;
	font-size: 12.5px;
	margin-bottom: 4px;
	color: #333;
}
.gpsusza-legend-layer-title {
	font-weight: 600;
	font-size: 12px;
	margin: 8px 0 2px;
	color: #333;
	line-height: 1.3;
}
.gpsusza-legend-layer-title:first-child {
	margin-top: 0;
}
.gpsusza-legend-row {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	margin-bottom: 2px;
	color: #444;
}
.gpsusza-legend-row .gpsusza-swatch {
	width: 14px;
	height: 14px;
}

.gpsusza-toggle-btn {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1001;
	display: none;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: none;
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	padding: 8px 12px;
	font-size: 13px;
	cursor: pointer;
}
.gpsusza-toggle-btn:hover {
	background: #f7f7f7;
}
/* Domyślnie (bez jawnego wyboru użytkownika): panel widoczny na szerokich
   ekranach, schowany na wąskich — czysto przez media query, bez JS, żeby
   uniknąć migotania/wyścigu przy pierwszym renderze. */
@media (max-width: 640px) {
	.gpsusza-toggle-btn {
		display: flex;
	}
	.gpsusza-panel {
		display: none;
	}
}

/* Jawny wybór użytkownika (kliknięcie „Warstwy” / „✕”) zawsze wygrywa,
   niezależnie od szerokości ekranu — stąd wyższa specyficzność selektora. */
.gpsusza-wrapper.gpsusza-panel-collapsed .gpsusza-toggle-btn {
	display: flex;
}
.gpsusza-wrapper.gpsusza-panel-collapsed .gpsusza-panel {
	display: none;
}
.gpsusza-wrapper.gpsusza-panel-expanded .gpsusza-toggle-btn {
	display: none;
}
.gpsusza-wrapper.gpsusza-panel-expanded .gpsusza-panel {
	display: block;
}

.gpsusza-info-popup h4 {
	margin: 0 0 6px;
	font-size: 14px;
}
.gpsusza-info-popup table {
	border-collapse: collapse;
	width: 100%;
}
.gpsusza-info-popup td {
	padding: 2px 6px 2px 0;
	font-size: 12.5px;
	vertical-align: top;
}
.gpsusza-info-popup td.gpsusza-cls {
	font-weight: 600;
	white-space: nowrap;
}
