:root {
	--accent: #0d9488;
	--accent-strong: #0f766e;
	--accent-soft: #ccfbf1;
	--ink: #1c1917;
	--ink-2: #57534e;
	--ink-3: #a8a29e;
	--bg: #ffffff;
	--line: #e7e5e4;
	--danger: #dc2626;
	--ok: #16a34a;
	--radius: 16px;
	--shadow: 0 10px 40px rgba(28, 25, 23, .14), 0 2px 8px rgba(28, 25, 23, .08);
	font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	height: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
	color: var(--ink);
	background: var(--line);
	-webkit-font-smoothing: antialiased;
}

#map { position: fixed; inset: 0; background: #dfe6df; }
.leaflet-container { font: inherit; }
.leaflet-control-zoom { border: none !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { border: none !important; color: var(--ink) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; }
.leaflet-control-attribution { font-size: 10px !important; border-radius: 8px 0 0 0; }

/* ---------- Panneau ---------- */

#panel {
	position: fixed;
	z-index: 1000;
	top: 12px;
	left: 12px;
	bottom: 12px;
	width: min(380px, calc(100vw - 24px));
	display: flex;
	flex-direction: column;
	background: var(--bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.panel-head { padding: 18px 20px 12px; }

.panel-head h1 {
	margin: 0;
	font-size: 21px;
	letter-spacing: -.02em;
	font-weight: 800;
}
.panel-head h1 em {
	font-style: normal;
	color: var(--accent);
}

.tagline {
	margin: 4px 0 0;
	font-size: 12.5px;
	color: var(--ink-2);
	line-height: 1.45;
}

#banner {
	margin: 0 20px 10px;
	padding: 8px 12px;
	border-radius: 10px;
	background: #fef3c7;
	color: #92400e;
	font-size: 12px;
	line-height: 1.4;
}

/* ---------- Recherche ---------- */

.searchbar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 16px;
	padding: 0 6px 0 14px;
	height: 46px;
	background: #fafaf9;
	border: 1px solid var(--line);
	border-radius: 13px;
	transition: border-color .15s, box-shadow .15s;
}
.searchbar:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(13, 148, 136, .14);
	background: #fff;
}

.searchbar .ico { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.searchbar input {
	flex: 1;
	min-width: 0;
	border: none;
	outline: none;
	background: transparent;
	font: inherit;
	font-size: 15px;
	color: var(--ink);
}
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; }

#locate {
	flex: none;
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: none;
	border-radius: 10px;
	background: transparent;
	color: var(--ink-2);
	cursor: pointer;
	transition: background .15s, color .15s;
}
#locate:hover { background: var(--accent-soft); color: var(--accent-strong); }
#locate.active { background: var(--accent); color: #fff; }
#locate .ico { width: 19px; height: 19px; }

.meta {
	margin: 10px 22px 6px;
	font-size: 12px;
	color: var(--ink-3);
}
.meta strong { color: var(--ink-2); font-weight: 650; }

/* ---------- Liste ---------- */

#list {
	flex: 1;
	margin: 0;
	padding: 2px 8px 12px;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--line) transparent;
}

#list li button {
	width: 100%;
	display: block;
	text-align: left;
	padding: 10px 12px;
	border: none;
	border-radius: 11px;
	background: transparent;
	font: inherit;
	cursor: pointer;
}
#list li button:hover { background: #f5f5f4; }
#list li + li button { margin-top: 1px; }

.row-top { display: flex; align-items: baseline; gap: 8px; }
.row-name {
	flex: 1;
	font-size: 14px;
	font-weight: 570;
	line-height: 1.35;
	overflow-wrap: anywhere;
}
.row-dist {
	flex: none;
	font-size: 11.5px;
	font-weight: 650;
	color: var(--accent-strong);
	background: var(--accent-soft);
	padding: 2px 7px;
	border-radius: 99px;
	white-space: nowrap;
}
.row-sub {
	margin-top: 2px;
	font-size: 11.5px;
	color: var(--ink-3);
	line-height: 1.4;
}
.row-more { padding: 8px 14px; text-align: center; font-size: 12px; color: var(--ink-3); }
.list-empty { padding: 26px 20px; text-align: center; font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* ---------- Pied de panneau ---------- */

.panel-foot {
	padding: 10px 20px 14px;
	border-top: 1px solid var(--line);
	font-size: 10.5px;
	color: var(--ink-3);
	line-height: 1.5;
}
.panel-foot span { display: block; }

/* ---------- Poignée mobile (bottom sheet) ---------- */

#sheet-handle { display: none; }

/* ---------- Marqueurs ---------- */

.pin-wrap { background: none; border: none; }
.pin {
	display: block;
	width: 18px;
	height: 18px;
	background: var(--accent);
	border: 2.5px solid #fff;
	border-radius: 50% 50% 50% 4px;
	transform: rotate(-45deg);
	box-shadow: 0 2px 6px rgba(28, 25, 23, .35);
}
.pin::after {
	content: "";
	position: absolute;
	inset: 4px;
	background: #fff;
	border-radius: 50%;
}

.user-dot { background: none; border: none; }
.user-dot i {
	display: block;
	width: 14px;
	height: 14px;
	background: #2563eb;
	border: 3px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, .35), 0 2px 8px rgba(28, 25, 23, .3);
}

.cluster { background: none; border: none; }
.cluster span {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	color: #fff;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	background: rgba(13, 148, 136, .88);
	box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .28), 0 3px 10px rgba(28, 25, 23, .3);
}
.cluster.c-sm span { width: 38px; height: 38px; font-size: 12px; }
.cluster.c-md span { width: 46px; height: 46px; font-size: 13.5px; }
.cluster.c-lg span { width: 54px; height: 54px; font-size: 15px; background: rgba(15, 118, 110, .92); }

/* ---------- Popup ---------- */

.gym-popup { min-width: 230px; max-width: 260px; }
.gym-popup img {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 10px;
	margin-bottom: 10px;
	background: var(--line);
}
.gym-popup h3 { margin: 0 0 2px; font-size: 14.5px; line-height: 1.3; letter-spacing: -.01em; }
.gym-alt {
	margin: 2px 0 0;
	font-size: 11.5px;
	color: var(--ink-2);
	line-height: 1.45;
}
.gym-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0 0; }
.chip {
	font-size: 10.5px;
	font-weight: 600;
	color: var(--accent-strong);
	background: var(--accent-soft);
	padding: 2.5px 8px;
	border-radius: 99px;
	white-space: nowrap;
}
.chip.more { background: #f5f5f4; color: var(--ink-3); }

.gym-hours {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin-top: 10px;
	padding-top: 9px;
	border-top: 1px solid var(--line);
	font-size: 12px;
	color: var(--ink-2);
	line-height: 1.45;
}
.hours-dot {
	flex: none;
	width: 7px; height: 7px;
	border-radius: 50%;
	align-self: center;
	background: var(--ink-3);
}
.hours-dot.open { background: var(--ok); }
.hours-dot.closed { background: var(--danger); }

.gym-links { display: flex; gap: 8px; margin-top: 12px; }
.gym-links a {
	flex: 1;
	text-align: center;
	padding: 7px 4px;
	border-radius: 9px;
	font-size: 12px;
	font-weight: 650;
	text-decoration: none;
	white-space: nowrap;
}
.gym-links a.primary { background: var(--accent); color: #fff; }
.gym-links a.primary:hover { background: var(--accent-strong); }
.gym-links a.secondary { background: #f5f5f4; color: var(--ink); }
.gym-links a.secondary:hover { background: #e7e5e4; }

/* ---------- Toast / loader / noscript ---------- */

#toast {
	position: fixed;
	z-index: 2000;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	max-width: min(420px, calc(100vw - 32px));
	padding: 11px 18px;
	border-radius: 12px;
	background: var(--ink);
	color: #fff;
	font-size: 13px;
	line-height: 1.45;
	box-shadow: var(--shadow);
}

.noscript {
	position: fixed;
	inset: 0;
	z-index: 3000;
	display: grid;
	place-items: center;
	background: var(--bg);
	font-size: 15px;
}

#loader {
	position: fixed;
	z-index: 1500;
	inset: 0;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 14px;
	background: rgba(250, 250, 249, .82);
	backdrop-filter: blur(4px);
	font-size: 14px;
	color: var(--ink-2);
	transition: opacity .3s;
}
#loader.done { opacity: 0; pointer-events: none; }
.spinner {
	width: 30px; height: 30px;
	border-radius: 50%;
	border: 3px solid var(--line);
	border-top-color: var(--accent);
	animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mobile : bottom sheet ---------- */

@media (max-width: 720px) {
	#panel {
		top: auto;
		left: 8px;
		right: 8px;
		bottom: 8px;
		width: auto;
		max-height: 62vh;
		transform: translateY(calc(100% - 138px));
		transition: transform .3s cubic-bezier(.32, .72, .28, 1);
	}
	body.sheet-open #panel { transform: translateY(0); }
	#sheet-handle {
		display: block;
		width: 100%;
		padding: 9px 0 3px;
		border: none;
		background: transparent;
		cursor: grab;
		touch-action: none;
	}
	.handle-bar {
		display: block;
		width: 42px; height: 4.5px;
		margin: 0 auto;
		border-radius: 99px;
		background: var(--ink-3);
	}
	#loader { bottom: 146px; top: auto; place-content: start center; padding-top: 30vh; }
	.leaflet-control-zoom { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}
