.bd-app__sheet h2 {
	font-family: var(--bd-font-display);
	font-weight: 400;
	color: var(--bd-accent);
	letter-spacing: 0.01em;
}

.bd-app__credit {
	position: absolute;
	left: 12px;
	bottom: calc(12px + var(--bd-safe-bottom, 0px));
	margin: 0;
	max-width: min(48vw, 180px);
	pointer-events: auto;
	opacity: 0.8;
}

.bd-app__credit .bd-credit {
	margin: 0;
	font-size: 0.68rem;
	line-height: 1.3;
	color: var(--bd-muted);
	background: color-mix(in srgb, #fff 88%, transparent);
	backdrop-filter: blur(8px);
	padding: 4px 8px;
	border-radius: 8px;
}

.bd-app__credit .bd-credit a { color: inherit; }

.bd-app {
	--bd-bg: #fafafa;
	--bd-surface: #ffffff;
	--bd-text: #1a1a1a;
	--bd-muted: #5c5c5c;
	--bd-line: #ebebeb;
	--bd-accent: #0a7c6e;
	--bd-accent-ink: #ffffff;
	--bd-blue: #ff6b35;
	--bd-yellow: #f59e0b;
	--bd-ok: #0a7c6e;
	--bd-warn: #f59e0b;
	--bd-danger: #dc2626;
	--bd-unknown: #0a7c6e;
	--bd-proposal: #ff6b35;
	--bd-shadow: 0 10px 28px rgba(10, 124, 110, 0.12);
	--bd-radius: 18px;
	--bd-safe-bottom: env(safe-area-inset-bottom, 0px);
	--bd-safe-top: env(safe-area-inset-top, 0px);
	position: relative;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	min-height: 480px;
	overflow: hidden;
	background: #fafafa;
	color: var(--bd-text);
	--bd-font: "ABeeZee", system-ui, -apple-system, sans-serif;
	--bd-font-display: "Bricolage Grotesque", system-ui, sans-serif;
	font-family: var(--bd-font);
	color-scheme: light;
	isolation: isolate;
}

.bd-app *,
.bd-app *::before,
.bd-app *::after {
	box-sizing: border-box;
}

.wp-block-post-content > .bd-app,
.entry-content > .bd-app {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.bd-app.is-fullscreen {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147483000 !important;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	height: 100dvh !important;
	margin: 0 !important;
	transform: none !important;
}

/* Nasconde chrome del tema sulla mappa fullscreen (desktop incluso) */
body.bd-map-open,
body:has(.bd-app.is-fullscreen) {
	overflow: hidden !important;
	overscroll-behavior: none;
}

body.bd-map-open header.wp-block-template-part,
body.bd-map-open footer.wp-block-template-part,
body.bd-map-open .wp-site-blocks > header,
body.bd-map-open .wp-site-blocks > footer,
body.bd-map-open .bd-chrome,
body:has(.bd-app.is-fullscreen) header.wp-block-template-part,
body:has(.bd-app.is-fullscreen) footer.wp-block-template-part,
body:has(.bd-app.is-fullscreen) .wp-site-blocks > header,
body:has(.bd-app.is-fullscreen) .wp-site-blocks > footer,
body:has(.bd-app.is-fullscreen) .bd-chrome {
	display: none !important;
}

.bd-app [hidden] {
	display: none !important;
}

.bd-app .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.bd-app :focus-visible {
	outline: 3px solid var(--bd-yellow);
	outline-offset: 2px;
}

.bd-app__map {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: #dbe4f0;
}

/* Overlay UI sopra Leaflet (fix Android / GPU transform) */
.bd-app__ui {
	position: absolute;
	inset: 0;
	z-index: 5000;
	pointer-events: none;
}

.bd-app__ui > * {
	pointer-events: auto;
}

.bd-app__bar {
	position: absolute;
	top: max(12px, var(--bd-safe-top));
	left: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid var(--bd-line);
	border-radius: var(--bd-radius);
	box-shadow: var(--bd-shadow);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.bd-app__counts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--bd-muted);
	font-size: 0.86rem;
}

.bd-app__count {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
}

.bd-app__count::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: 0 0 auto;
	align-self: center;
	box-shadow: 0 0 0 2px #fff;
}

.bd-app__count--playground::before { background: #0a7c6e; }
.bd-app__count--report::before { background: #f59e0b; }
.bd-app__count--proposal::before { background: #ff6b35; }

.bd-app__count--playground strong { color: #086257; }
.bd-app__count--report strong { color: #b45309; }
.bd-app__count--proposal strong { color: #ff6b35; }

.bd-app__counts strong {
	font-size: 1.02rem;
}

.bd-app__tools {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.bd-app__tool-locate,
.bd-app__tool-add {
	appearance: none !important;
	-webkit-appearance: none !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.bd-app__tool-locate {
	min-height: 40px !important;
	padding: 8px 12px !important;
	border-radius: 999px !important;
	border: 1px solid var(--bd-line) !important;
	background: #fff !important;
	color: var(--bd-accent) !important;
	font: inherit !important;
	font-size: 0.82rem !important;
	font-weight: 700 !important;
	box-shadow: none !important;
	white-space: nowrap;
}

.bd-app__tool-add {
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	min-height: 42px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	border: 2px solid #fff !important;
	background: var(--bd-accent) !important;
	color: #fff !important;
	font-size: 1.55rem !important;
	line-height: 1 !important;
	font-weight: 700 !important;
	box-shadow: 0 6px 14px rgba(10, 124, 110, 0.28) !important;
}

.bd-app__form input:not([type="checkbox"]):not([type="radio"]),
.bd-app__form select,
.bd-app__form textarea {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 2px solid var(--bd-line);
	border-radius: 16px;
	background: var(--bd-surface);
	color: var(--bd-text);
	font: inherit;
}

.bd-app button {
	min-height: 36px;
	padding: 7px 12px;
	border: 0;
	border-radius: 999px;
	background: var(--bd-accent);
	color: var(--bd-accent-ink);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 6px 14px rgba(10, 124, 110, 0.22);
}

.bd-app__actions a {
	min-height: 36px !important;
	padding: 7px 12px !important;
	font-size: 0.88rem !important;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.bd-app button.bd-app__chip,
.bd-app button.bd-app__locate,
.bd-app__menu button,
.bd-app__form .bd-secondary {
	background: var(--bd-surface) !important;
	color: var(--bd-accent) !important;
	border: 1px solid var(--bd-line) !important;
	box-shadow: none !important;
}

.bd-app__share {
	flex: 0 0 auto;
	white-space: nowrap;
}

.bd-app__locate {
	position: absolute;
	left: 12px;
	bottom: calc(20px + var(--bd-safe-bottom));
	z-index: 2;
	appearance: none !important;
	-webkit-appearance: none !important;
	min-height: 48px !important;
	padding: 12px 16px !important;
	font-weight: 700 !important;
	touch-action: manipulation;
}

.bd-app__add-wrap {
	position: absolute;
	right: 12px;
	bottom: calc(20px + var(--bd-safe-bottom));
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	pointer-events: none;
}

.bd-app__add-wrap > * {
	pointer-events: auto;
}

.bd-app__add {
	position: relative;
	right: auto;
	bottom: auto;
	width: 60px !important;
	height: 60px !important;
	min-width: 60px !important;
	min-height: 60px !important;
	border-radius: 50% !important;
	font-size: 2rem !important;
	line-height: 1 !important;
	padding: 0 !important;
	background: var(--bd-accent) !important;
	color: #fff !important;
	border: 3px solid #fff !important;
	box-shadow: 0 10px 22px rgba(10, 124, 110, 0.4) !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	touch-action: manipulation;
}

.bd-app__tip {
	position: relative;
	max-width: min(220px, 70vw);
	padding: 12px 36px 12px 14px;
	border-radius: 16px;
	background: #fff;
	color: var(--bd-text);
	border: 1px solid var(--bd-line);
	box-shadow: 0 12px 28px rgba(10, 124, 110, 0.22);
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.35;
}

.bd-app__tip p {
	margin: 0;
}

.bd-app__tip::after {
	content: "";
	position: absolute;
	right: 22px;
	bottom: -8px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-right: 1px solid var(--bd-line);
	border-bottom: 1px solid var(--bd-line);
	transform: rotate(45deg);
}

.bd-app__tip-close {
	position: absolute !important;
	top: 4px !important;
	right: 4px !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 32px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: var(--bd-muted) !important;
	font-size: 1.35rem !important;
	line-height: 1 !important;
	box-shadow: none !important;
	cursor: pointer;
}

.bd-app__menu {
	position: absolute;
	right: 12px;
	bottom: calc(96px + var(--bd-safe-bottom));
	display: grid;
	gap: 8px;
	width: min(280px, calc(100% - 24px));
	z-index: 4;
}

/* Mobile: + e Dove sono sia in alto sia in basso */
@media (max-width: 799px) {
	.bd-app__share {
		display: none !important;
	}

	.bd-app__credit {
		display: none;
	}

	.bd-app__counts {
		font-size: 0.78rem;
		gap: 4px 8px;
	}

	.bd-app__tool-label {
		display: none;
	}

	.bd-app__tool-locate {
		width: 42px !important;
		min-width: 42px !important;
		padding: 0 !important;
		border-radius: 12px !important;
	}

	.bd-app__tool-locate::before {
		content: "◎";
		font-size: 1.1rem;
		line-height: 1;
	}
}

@media (min-width: 800px) {
	.bd-app__tool-locate,
	.bd-app__tool-add {
		display: none !important;
	}
}

.bd-app__menu button {
	text-align: left;
	background: var(--bd-surface);
	color: var(--bd-blue);
	box-shadow: var(--bd-shadow);
}

.bd-app__sheet,
.bd-app__form {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	max-height: 78%;
	max-width: 100%;
	overflow: auto;
	overflow-x: hidden;
	padding: 8px 16px 24px;
	background: var(--bd-surface);
	color: var(--bd-text);
	border-radius: 24px 24px 0 0;
	box-shadow: var(--bd-shadow);
	z-index: 1000;
	border-top: 4px solid var(--bd-accent);
}

.bd-app__sheet h2,
.bd-app__form h2 {
	margin: 8px 0;
	font-size: 1.35rem;
	color: var(--bd-blue);
}

.bd-app__handle {
	width: 42px;
	height: 4px;
	margin: 8px auto 4px;
	border-radius: 99px;
	background: var(--bd-line);
}

.bd-app__chips,
.bd-app__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0;
}

.bd-app__chips span,
.bd-app__detail {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 3px 9px;
	border-radius: 999px;
	background: #e6f4f2;
	border: 1px solid #c5e4df;
	color: var(--bd-accent);
	font-size: 0.82rem;
}

.bd-app__chips--compact {
	gap: 6px;
	margin: 6px 0 10px;
}

.bd-app__place-link {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-height: 36px !important;
	padding: 7px 14px !important;
	border-radius: 999px;
	background: var(--bd-accent) !important;
	color: #fff !important;
	font-weight: 700;
	font-size: 0.88rem !important;
	text-decoration: none !important;
	width: auto;
	flex: 1 1 auto;
}

.bd-app__actions {
	gap: 6px !important;
}

.bd-app__detail-list {
	display: grid;
	gap: 6px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.bd-app__sheet-address {
	margin: 0 0 8px;
	font-weight: 600;
}

.bd-app__summary-size,
.bd-app__summary-report {
	margin: 0 0 10px;
	color: var(--bd-muted);
}

.bd-app__summary-label {
	margin: 10px 0 4px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bd-blue);
}

.bd-app__thanks {
	display: grid;
	gap: 12px;
	margin: 0 0 8px;
}

.bd-app__thanks p {
	margin: 0;
	line-height: 1.45;
	color: var(--bd-text);
}

.bd-app__photos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.bd-app__photos img {
	width: 100%;
	height: 96px;
	object-fit: cover;
	border-radius: 14px;
	border: 1px solid var(--bd-line);
}

.bd-app__live {
	position: absolute;
	left: 12px;
	right: 84px;
	bottom: 76px;
	margin: 0;
	min-height: 0;
	padding: 8px 12px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--bd-surface) 92%, transparent);
	border: 1px solid var(--bd-line);
}

.bd-app__live:empty {
	display: none;
	padding: 0;
	border: 0;
}

.bd-app__progress {
	height: 8px;
	margin: 8px 0 12px;
	border-radius: 99px;
	background: #e8f5ea;
	overflow: hidden;
}

.bd-app__progress span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, #ff6b35, #0a7c6e);
}

.bd-app__field {
	display: grid;
	gap: 6px;
	margin: 0 0 12px;
	min-width: 0;
	max-width: 100%;
}

.bd-app__uploads {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bd-app__uploads div {
	display: grid;
	gap: 4px;
	width: 96px;
}

.bd-app__uploads img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 16px;
	border: 1px solid var(--bd-line);
}

.bd-app__help,
.bd-app__error,
.bd-app__muted {
	margin: 0;
	color: var(--bd-muted);
	font-size: 0.92rem;
}

.bd-app__error {
	color: var(--bd-danger);
}

.bd-app__notice {
	margin: 0 0 12px;
	padding: 12px 14px;
	border-radius: 16px;
	background: #e6f4f2;
	border: 1px solid #cfe8d3;
	color: var(--bd-text);
	font-size: 0.95rem;
}

.bd-app__checks {
	display: grid;
	gap: 8px;
	min-width: 0;
	max-width: 100%;
}

label.bd-app__checks,
.bd-app__consent,
.bd-app__rating,
.bd-app__checks > label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-height: 44px;
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.bd-app__consent {
	padding: 12px;
	border-radius: 16px;
	background: #e6f4f2;
	border: 1px solid #cfe8d3;
}

.bd-app input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 28px;
	width: 28px;
	min-width: 28px;
	max-width: 28px;
	height: 28px;
	margin: 2px 0 0;
	border: 2px solid #9ca3af;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	position: relative;
	accent-color: #0a7c6e;
	transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.bd-app input[type="checkbox"]::before {
	content: none;
}

.bd-app input[type="checkbox"]::after {
	content: "";
	position: absolute;
	left: 8px;
	top: 4px;
	width: 7px;
	height: 12px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(40deg) scale(0);
	opacity: 0;
	transition: transform 0.12s ease, opacity 0.12s ease;
}

.bd-app input[type="checkbox"]:checked {
	border-color: #0a7c6e;
	background: #0a7c6e;
	box-shadow: 0 4px 10px rgba(10, 124, 110, 0.28);
}

.bd-app input[type="checkbox"]:checked::after {
	transform: rotate(40deg) scale(1);
	opacity: 1;
}

.bd-app input[type="checkbox"]:hover {
	border-color: #0a7c6e;
	background: #f3faf4;
}

.bd-app input[type="checkbox"]:checked:hover {
	background: #0a7c6e;
}

.bd-app input[type="checkbox"]:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 2px;
}

.bd-app input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 22px;
	width: 22px;
	min-width: 22px;
	max-width: 22px;
	height: 22px;
	margin: 2px 0 0;
	border: 2px solid #9ca3af;
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
}

.bd-app input[type="radio"]:checked {
	border-color: #0a7c6e;
	background: radial-gradient(circle at center, #0a7c6e 0 45%, #fff 48% 100%);
}

.bd-app__hp {
	position: absolute;
	left: -9999px;
}

.bd-app.is-picking .bd-app__form {
	max-height: 180px;
}

.bd-app .bd-pin {
	background: transparent !important;
	border: 0 !important;
	width: 28px !important;
	height: 36px !important;
	margin: 0 !important;
	box-shadow: none !important;
}

.bd-app .bd-pin__svg {
	width: 28px;
	height: 36px;
	display: block;
	overflow: visible;
	filter: drop-shadow(0 3px 8px rgba(10, 124, 110, 0.28));
}

.bd-app .bd-pin__body {
	fill: var(--bd-ok);
	stroke: #fff;
	stroke-width: 1.6;
}

.bd-app .bd-pin__dot {
	fill: #fff;
}

.bd-app .bd-pin--green .bd-pin__body { fill: #0a7c6e; }
.bd-app .bd-pin--orange .bd-pin__body { fill: #f59e0b; }
.bd-app .bd-pin--red .bd-pin__body { fill: #dc2626; }
.bd-app .bd-pin--grey .bd-pin__body { fill: #0a7c6e; }
.bd-app .bd-pin--proposal .bd-pin__body { fill: #ff6b35; }

@media (min-width: 800px) {
	.bd-app .bd-pin {
		width: 34px !important;
		height: 44px !important;
	}

	.bd-app .bd-pin__svg {
		width: 34px;
		height: 44px;
		filter: drop-shadow(0 4px 10px rgba(10, 124, 110, 0.26));
	}
}

.bd-app input[type="checkbox"],
.bd-app input[type="radio"] {
	color-scheme: light;
}

@media (min-width: 800px) {
	.bd-app__bar {
		right: auto;
		width: min(420px, calc(100% - 24px));
	}

	.bd-app__credit {
		max-width: min(70vw, 280px);
		bottom: calc(12px + var(--bd-safe-bottom, 0px));
	}

	.bd-app__sheet,
	.bd-app__form {
		top: 16px;
		right: 16px;
		bottom: 16px;
		left: auto;
		width: min(420px, calc(100% - 32px));
		max-height: none;
		border-radius: var(--bd-radius);
		border: 1px solid var(--bd-line);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bd-app * {
		scroll-behavior: auto;
	}
}
