	html,
	body {
		height: 100dvh;
		margin: 0;
		padding: 0;
		overflow: hidden;
	}

	body {
		font-family: 'Inter', sans-serif;
		overscroll-behavior-y: none;
		background-image: url('../icons/background.png');
		background-size: cover;
		background-position: center center;
		background-repeat: no-repeat;
		background-attachment: fixed;
	}

	/* CSS Variables for Responsive Home Screen Height */
	:root {
		--home-header-pt: 2rem;
		/* Default equivalent to pt-8 */
		--home-header-pb: 1rem;
		/* Default equivalent to pb-4 */
		--home-content-pb: 3rem;
		/* Default equivalent to pb-12 */
		--home-item-space: 0.5rem;
		/* Default equivalent to space-y-2 */
		--home-btn-p: 1rem;
		/* Default equivalent to p-4 */
		--home-icon-size: 4rem;
		/* Default equivalent to h-16 */
		--home-feature-icon-size: 3rem;
		/* Default equivalent to w-12 h-12 */
	}

	@media (max-height: 750px) {
		:root {
			--home-header-pt: 1.25rem;
			--home-header-pb: 0.75rem;
			--home-content-pb: 2rem;
			--home-item-space: 0.35rem;
			--home-btn-p: 0.75rem;
			--home-icon-size: 3.5rem;
			--home-feature-icon-size: 2.5rem;
		}
	}

	@media (max-height: 650px) {
		:root {
			--home-header-pt: 0.75rem;
			--home-header-pb: 0.5rem;
			--home-content-pb: 1rem;
			--home-item-space: 0.25rem;
			--home-btn-p: 0.5rem;
			--home-icon-size: 3rem;
			--home-feature-icon-size: 2rem;
		}
	}

	/* Helper classes for the adaptive variables */
	.adaptive-pt {
		padding-top: var(--home-header-pt) !important;
	}

	.adaptive-pb {
		padding-bottom: var(--home-header-pb) !important;
	}

	.adaptive-content-pb {
		padding-bottom: var(--home-content-pb) !important;
	}

	.adaptive-space-y> :not([hidden])~ :not([hidden]) {
		margin-top: var(--home-item-space) !important;
	}

	.adaptive-p {
		padding: var(--home-btn-p) !important;
	}

	.adaptive-icon-size {
		height: var(--home-icon-size) !important;
		width: var(--home-icon-size) !important;
	}

	.adaptive-feature-icon {
		height: var(--home-feature-icon-size) !important;
		width: var(--home-feature-icon-size) !important;
	}

	/* Logique d'affichage des vues : seule la vue avec la classe .active est visible */
	.view {
		display: none;
		height: 100dvh;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
	}

	.view.active {
		display: flex;
		flex-direction: column;
	}

	#mapView.view,
	#leafletView.view {
		overflow: hidden;
	}

	#collectedDataView.active {
		display: flex;
		flex-direction: column;
		height: 100dvh;
		overflow: hidden;
	}

	#collectedDataView.active #collectedDataListContainer {
		flex: 1;
		overflow-y: auto;
	}

	#improveAppView.active {
		display: flex;
		flex-direction: column;
		height: 100dvh;
		overflow-y: auto;
		/* Autoriser le scroll dans cette vue */
	}

	#improveAppView.active iframe {
		flex: 1;
		height: 100%;
		/* S’adapte à la hauteur dispo */
		min-height: 400px;
		/* Sécurité */
	}

	.pr-label-google-maps {
		text-shadow:
			-1px -1px 0 #fff,
			1px -1px 0 #fff,
			-1px 1px 0 #fff,
			1px 1px 0 #fff;
	}

	@keyframes borne-slide {
		0% {
			transform: translateX(150%);
			opacity: 0;
		}

		20% {
			opacity: 1;
		}

		40% {
			transform: translateX(0);
			opacity: 1;
		}

		70% {
			transform: translateX(0);
			opacity: 1;
		}

		85% {
			transform: translateX(10%) scale(1.1);
			opacity: 1;
		}

		100% {
			transform: translateX(200%) scale(0.4);
			opacity: 0;
		}
	}

	@keyframes pin-drop {

		0%,
		39% {
			transform: translateY(-200%) translateX(-70%);
			opacity: 0;
		}

		40% {
			opacity: 1;
		}

		60%,
		70% {
			transform: translateY(-70%) translateX(-70%);
			opacity: 1;
		}

		85% {
			transform: translateY(-90%) translateX(-70%) scale(1.1);
			opacity: 1;
		}

		100% {
			transform: translateY(-200%) translateX(-70%) scale(0.5);
			opacity: 0;
		}
	}

	.animate-borne {
		animation: borne-slide 2s ease-in-out infinite;
	}

	.animate-pin {
		animation: pin-drop 2s ease-in-out infinite;
	}


	/* Style commun pour les deux conteneurs de carte (Google et Leaflet) */
	#map,
	#leafletMap {
		height: 100%;
		width: 100%;
		border-radius: 0.5rem;
		box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
		background-color: #f3f4f6;
		z-index: 1;
		/* Assure que la carte est bien positionnée */
		position: relative;
		/* Indispensable pour le positionnement du pseudo-élément */
		isolation: isolate;
		/* Crée un nouveau contexte de superposition pour éviter les conflits */
	}

	#mapView::before,
	#leafletView::before {
		content: '';
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: #f3f4f6;
		z-index: -1;
	}

	/* Style pour les Modaux/Dialogues (Protection Overflow) */
	dialog,
	.custom-modal,
	#unifiedSearchDialog,
	#dataCollectionDialog,
	#layerManagerDialog,
	#passwordDialog,
	#filterWmsDialog {
		max-height: 90vh !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
	}

	/* Style de l'indicateur de chargement (spinner) */
	.loader {
		border: 2px solid #f3f3f3;
		border-top: 2px solid #3498db;
		border-radius: 50%;
		width: 20px;
		height: 20px;
		animation: spin 1s linear infinite;
		margin: 5px auto;
	}

	@keyframes spin {
		0% {
			transform: rotate(0deg);
		}

		100% {
			transform: rotate(360deg);
		}
	}

	/* Classes utilitaires créées avec la syntaxe de Tailwind CSS */
	.btn-toggle-on {
		background-color: #ef4444;
	}

	.btn-toggle-on:hover {
		background-color: #dc2626;
	}

	.input-readonly {
		background-color: #e5e7eb;
		cursor: not-allowed;
	}



	.toggle-icon {
		width: 36px;
		height: 20px;
	}

	.toggle-icon .bg-rect {
		transition: fill 0.2s ease-in-out;
	}

	.toggle-icon .handle {
		transition: transform 0.2s ease-in-out;
	}



	#livePrMessage {
		font-size: 16px;
		line-height: 1.3;
		color: #dc2626; /* text-red-600 */
		min-height: 42px; /* Espace pour 2 lignes */
		margin-bottom: 4px;
	}

	#liveAccuracyDisplay {
		font-size: 1rem;
		line-height: 1.75rem;
		color: #4b5563;
		margin-bottom: 2rem;
	}

	/* Classe utilitaire pour forcer le masquage du logo MapTiler */
	.maptiler-logo-hidden {
		/* On utilise !important pour être sûr de gagner contre les styles du plugin */
		visibility: hidden !important;
		opacity: 0 !important;
		/* Petit effet de fondu pour la transition */
		transition: visibility 0s, opacity 0.2s linear;
	}

	.safe-padding-bottom {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		padding-bottom: calc(env(safe-area-inset-bottom, 0) + 24px);
		background-color: rgba(255, 255, 255, 0);
		z-index: 1000;
	}

	@supports not (padding-bottom:env(safe-area-inset-bottom)) {
		.safe-padding-bottom {
			padding-bottom: 24px;
		}
	}

	.gm-style-mtc {
		margin-top: 24px !important;
	}

	/* Google Maps type dropdown: above all floating buttons when open */
	.gm-style-mtc-list {
		z-index: 9999 !important;
	}

	/* Leaflet layer control: above all floating buttons when expanded */
	.leaflet-control-layers-expanded {
		z-index: 9999 !important;
		position: relative;
	}

	.extremity-pr-label {
		background-color: rgba(255, 255, 255, 0.8);
		border: none;
		border-radius: 4px;
		font-size: 15px;
		font-weight: bold;
		padding: 2px 4px;
		box-shadow: none;
		white-space: nowrap;

	}

	/* Move Google Maps Zoom Control up */
	.gm-bundled-control {
		transform: translateY(-60px) !important;
	}

	/* Move Leaflet Zoom Control up, but leave attribution alone */
	.leaflet-right .leaflet-control-zoom {
		margin-bottom: 60px !important;
	}


	/* Custom Google Maps & Leaflet Layer Control */
	#customMapLayerToggle,
	#customLeafletLayerToggle {
		position: relative !important;
		padding: 0 !important;
	}

	#mapTypePreview {
		width: 100% !important;
		height: 100% !important;
		background-color: #e5e7eb;
		/* Fallback gray */
		background-size: cover;
		background-position: center;
		display: block !important;
	}

	#customMapLayerPanel,
	#customLeafletLayerPanel {
		transition: all 0.2s ease-in-out;
		transform-origin: top left;
	}

	#customMapLayerPanel:not(.hidden),
	#customLeafletLayerPanel:not(.hidden) {
		display: block;
		animation: slideDownFade 0.2s ease-out;
	}

	@keyframes slideDownFade {
		from {
			opacity: 0;
			transform: scale(0.95) translateY(-5px);
		}

		to {
			opacity: 1;
			transform: scale(1) translateY(0);
		}
	}

	#customMapLayerToggle:active {
		transform: scale(0.95);
	}

	/* Reduce Leaflet attribution text size */
	.leaflet-control-attribution {
		font-size: 9px !important;
		line-height: 1.2 !important;
		max-width: 70vw;
	}

	/* Restore Leaflet layer control to original size and fix background */
	.leaflet-control-layers {
		background: #fff !important;
		border-radius: 5px !important;
		box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4) !important;
	}

	.leaflet-control-layers-toggle {
		width: 44px !important;
		height: 44px !important;
		background-size: 26px 26px !important;
		background-color: transparent !important;
		background-position: center center !important;
	}

	.leaflet-control-layers-expanded {
		font-size: 14px !important;
		padding: 10px 14px !important;
		min-width: 160px !important;
	}

	.leaflet-control-layers label {
		font-size: 14px !important;
		line-height: 2 !important;
	}

	.leaflet-control-layers-separator {
		margin: 6px 0 !important;
	}

	/* Unified Search Modal Styles */
	.search-tabs {
		display: grid;
		grid-template-columns: 1fr 1fr;
		background: #f1f5f9;
		padding: 4px;
		border-radius: 12px;
		margin-bottom: 1.5rem;
		border: 1px solid #e2e8f0;
	}

	.search-main-tab-btn {
		padding: 0.6rem;
		font-size: 0.85rem;
		font-weight: 700;
		color: #64748b;
		border-radius: 9px;
		transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
		display: flex;
		align-items: center;
		justify-content: center;
		border: none;
		background: transparent;
		cursor: pointer;
	}

	.search-main-tab-btn.active {
		background-color: white;
		color: #1d4ed8;
		box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
	}

	.search-sub-tabs {
		display: flex;
		gap: 0.5rem;
		margin-bottom: 1.5rem;
		overflow-x: auto;
		scrollbar-width: none;
		-ms-overflow-style: none;
		padding-bottom: 2px;
	}

	.search-sub-tabs::-webkit-scrollbar {
		display: none;
	}

	.search-sub-tab-btn {
		padding: 0.5rem 0.8rem;
		font-size: 0.75rem;
		font-weight: 600;
		color: #64748b;
		background: #f8fafc;
		border: 1px solid #e2e8f0;
		border-radius: 20px;
		white-space: nowrap;
		display: flex;
		align-items: center;
		gap: 0.4rem;
		transition: all 0.2s;
		cursor: pointer;
	}

	.search-sub-tab-btn.active {
		background: #eff6ff;
		color: #1d4ed8;
		border-color: #bfdbfe;
		box-shadow: 0 1px 2px rgba(29, 78, 216, 0.05);
	}

	.search-sub-tab-btn i {
		font-size: 0.9rem;
	}

	.search-content-section {
		animation: fadeIn 0.15s ease-out;
	}

	.hidden {
		display: none !important;
	}

	@keyframes fadeIn {
		from {
			opacity: 0;
			transform: translateY(5px);
		}

		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	/* Masquage des labels des couches externes (Optimisation) */
	.hide-external-labels .layer-leaflet-tooltip {
		display: none !important;
	}

	#leafletMap.hide-external-labels .leaflet-tooltip {
		visibility: hidden !important;
	}

	/* Export Modal Styles */
	.export-format-option input:checked+i,
	.export-format-option input:checked+i+span {
		color: #2563eb !important;
	}

	.export-format-option:has(input:checked) {
		border-color: #2563eb !important;
		background-color: #eff6ff !important;
	}

	@keyframes fadeInSimple {
		from {
			opacity: 0;
			transform: translateY(10px);
		}

		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	.animate-fade-in {
		animation: fadeInSimple 0.3s ease-out forwards;
	}

	/* Force early branding visibility */
	.mee-early-branding .mee-branding.hidden {
		display: flex !important;
	}

	.mee-early-branding img.mee-branding.hidden {
		display: block !important;
	}

	.mee-early-branding .not-mee-branding {
		display: none !important;
	}