/* Live conservation map ([lo2cb_conservation_map]) and the certificate
   scanner dialog. Matches the Home page: Cinzel headings, Spectral text,
   Fira Code labels, cream / gold on deep forest green. */

.lo2cb-live {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 360px;
	overflow: hidden;
	border: 1px solid #3F4A33;
	border-radius: 5px;
	background: #16200f;
	isolation: isolate;
}

.lo2cb-live__map {
	position: absolute;
	inset: 0;
	background: #16200f;
}

.lo2cb-live .leaflet-container {
	font-family: Spectral, Georgia, serif;
	background: #16200f;
}

.lo2cb-live .leaflet-control-attribution {
	background: rgba(12, 17, 11, 0.65);
	color: #7C8A6C;
	font-size: 10px;
}

.lo2cb-live .leaflet-control-attribution a {
	color: #A99C82;
}

.lo2cb-live .leaflet-control-scale-line {
	background: rgba(12, 17, 11, 0.55);
	border-color: #A99C82;
	color: #F5E6D3;
}

.lo2cb-live .leaflet-bar a {
	background: rgba(15, 23, 16, 0.9);
	color: #F5E6D3;
	border-bottom-color: #3F4A33;
}

.lo2cb-live .leaflet-bar a:hover {
	background: #1C2617;
	color: #E3C46A;
}

.lo2cb-live .leaflet-popup-content-wrapper,
.lo2cb-live .leaflet-popup-tip {
	background: #1C2617;
	color: #F5E6D3;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lo2cb-live .leaflet-popup-content {
	font-size: 14px;
	line-height: 1.5;
}

.lo2cb-live .leaflet-popup-content strong {
	font-family: Cinzel, Georgia, serif;
	color: #E3C46A;
}

.lo2cb-live .leaflet-container a.leaflet-popup-close-button {
	color: #A99C82;
}

/* Overlays */
.lo2cb-live__stats {
	position: absolute;
	left: 16px;
	bottom: 16px;
	z-index: 500;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	max-width: calc(100% - 32px);
	padding: 10px 16px;
	border: 1px solid rgba(245, 230, 211, 0.12);
	border-radius: 4px;
	background: rgba(12, 17, 11, 0.78);
	color: #A99C82;
	font-family: "Fira Code", Menlo, monospace;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	backdrop-filter: blur(6px);
}

.lo2cb-live__stats strong {
	font-family: Cinzel, Georgia, serif;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #F5E6D3;
}

.lo2cb-live__sep {
	color: #5C6B4A;
}

.lo2cb-live__pulse {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #6FBF73;
	box-shadow: 0 0 0 0 rgba(111, 191, 115, 0.6);
	animation: lo2cb-pulse 2s ease-out infinite;
}

@keyframes lo2cb-pulse {
	70% {
		box-shadow: 0 0 0 8px rgba(111, 191, 115, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(111, 191, 115, 0);
	}
}

.lo2cb-live__scan {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 500;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	border: 1px solid #DAA520;
	border-radius: 3px;
	background: #CA8A04;
	color: #0F1710;
	font-family: Cinzel, Georgia, serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 8px 28px rgba(202, 138, 4, 0.35);
	transition: background-color 160ms ease, transform 160ms ease;
}

.lo2cb-live__scan:hover {
	background: #B8780A;
}

.lo2cb-live__scan:focus-visible {
	outline: 2px solid #F5E6D3;
	outline-offset: 3px;
}

.lo2cb-live__hint {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 400;
	margin: 0;
	padding: 8px 14px;
	transform: translate(-50%, -50%);
	border-radius: 999px;
	background: rgba(12, 17, 11, 0.7);
	color: #F5E6D3;
	font-family: "Fira Code", Menlo, monospace;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	pointer-events: none;
}

.lo2cb-live__pin span {
	display: block;
	width: 18px;
	height: 18px;
	border: 2px solid #0F1710;
	border-radius: 50%;
	background: #FFD978;
	box-shadow: 0 0 0 6px rgba(255, 217, 120, 0.35);
}

.lo2cb-live--offline .lo2cb-live__stats {
	display: none;
}

@media (max-width: 640px) {
	.lo2cb-live {
		aspect-ratio: 4 / 5;
	}

	/* Leaves the zoom buttons (top-left) uncovered. */
	.lo2cb-live__scan {
		top: 12px;
		right: 12px;
		max-width: calc(100% - 76px);
		padding: 11px 16px;
		font-size: 12px;
	}

	.lo2cb-live__stats {
		left: 12px;
		bottom: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lo2cb-live__pulse {
		animation: none;
	}
}

/* Scanner dialog */
.lo2cb-scan {
	width: min(520px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	padding: 0;
	border: 0;
	background: transparent;
	color: #F5E6D3;
	overflow: visible;
}

.lo2cb-scan::backdrop {
	background: rgba(6, 10, 7, 0.9);
	backdrop-filter: blur(4px);
}

.lo2cb-scan__panel {
	position: relative;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 32px 28px 28px;
	border: 1px solid rgba(245, 230, 211, 0.12);
	border-top: 2px solid #6FBF73;
	border-radius: 14px;
	background: linear-gradient(160deg, rgba(26, 35, 21, 0.99), rgba(15, 23, 16, 0.99));
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
	font-family: Spectral, Georgia, serif;
}

.lo2cb-scan__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	border: 1px solid #3F4A33;
	border-radius: 6px;
	background: rgba(12, 17, 11, 0.6);
	color: #A99C82;
	font-size: 14px;
	cursor: pointer;
}

.lo2cb-scan__close:hover {
	border-color: #CA8A04;
	color: #F5E6D3;
}

.lo2cb-scan__eyebrow {
	display: block;
	font-family: "Fira Code", Menlo, monospace;
	font-size: 11px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: #6FBF73;
}

.lo2cb-scan__title {
	margin: 8px 40px 8px 0;
	font-family: Cinzel, Georgia, serif;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.15;
	color: #F5E6D3;
}

.lo2cb-scan__lead {
	margin: 0 0 16px;
	color: #A99C82;
	font-size: 16px;
	line-height: 1.55;
}

.lo2cb-scan__viewport {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border: 1px solid #3F4A33;
	border-radius: 10px;
	background: #0c110b;
}

.lo2cb-scan__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lo2cb-scan__frame {
	position: absolute;
	inset: 18%;
	border: 2px solid rgba(227, 196, 106, 0.9);
	border-radius: 12px;
	box-shadow: 0 0 0 999px rgba(6, 10, 7, 0.35);
	pointer-events: none;
}

.lo2cb-scan__camera-msg {
	position: absolute;
	inset: auto 12px 12px;
	margin: 0;
	padding: 12px 14px;
	border-radius: 6px;
	background: rgba(12, 17, 11, 0.9);
	color: #F5E6D3;
	font-size: 14px;
	line-height: 1.5;
}

.lo2cb-scan__alt {
	display: grid;
	gap: 14px;
	margin-top: 16px;
}

.lo2cb-scan__upload {
	position: relative;
	display: block;
	padding: 12px;
	border: 1px dashed #5C6B4A;
	border-radius: 6px;
	color: #E3C46A;
	font-family: Cinzel, Georgia, serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
}

.lo2cb-scan__upload:hover {
	border-color: #CA8A04;
}

.lo2cb-scan__upload input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.lo2cb-scan__upload:focus-within {
	outline: 2px solid #CA8A04;
	outline-offset: 2px;
}

.lo2cb-scan__manual label {
	display: block;
	margin-bottom: 6px;
	font-family: "Fira Code", Menlo, monospace;
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #7C8A6C;
}

.lo2cb-scan__manual div {
	display: flex;
	gap: 8px;
}

.lo2cb-scan__manual input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid #3F4A33;
	border-radius: 4px;
	background: rgba(12, 17, 11, 0.8);
	color: #F5E6D3;
	font-family: "Fira Code", Menlo, monospace;
	font-size: 13px;
}

.lo2cb-scan__manual input:focus {
	border-color: #CA8A04;
	outline: none;
}

.lo2cb-scan__manual button,
.lo2cb-scan__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 20px;
	border: 1px solid #5C6B4A;
	border-radius: 3px;
	background: transparent;
	color: #F5E6D3;
	font-family: Cinzel, Georgia, serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
}

.lo2cb-scan__manual button:hover,
.lo2cb-scan__btn:hover {
	border-color: #CA8A04;
	color: #E3C46A;
}

.lo2cb-scan__btn--primary {
	border-color: #DAA520;
	background: #CA8A04;
	color: #0F1710;
}

.lo2cb-scan__btn--primary:hover {
	background: #B8780A;
	color: #0F1710;
}

/* Result */
.lo2cb-scan__result {
	margin: 12px 0 20px;
	text-align: center;
}

.lo2cb-scan__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(111, 191, 115, 0.15);
	color: #6FBF73;
	font-size: 26px;
	font-weight: 700;
}

.lo2cb-scan__badge--ended {
	background: rgba(245, 230, 211, 0.08);
	color: #A99C82;
}

.lo2cb-scan__badge--bad {
	background: rgba(224, 104, 74, 0.15);
	color: #E0684A;
}

.lo2cb-scan__status {
	display: block;
	margin-top: 12px;
	font-family: "Fira Code", Menlo, monospace;
	font-size: 11px;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: #6FBF73;
}

.lo2cb-scan__name {
	margin: 8px 0 4px;
	font-family: Cinzel, Georgia, serif;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	color: #F5E6D3;
	overflow-wrap: anywhere;
}

.lo2cb-scan__meta {
	margin: 0;
	color: #A99C82;
	font-size: 16px;
}

.lo2cb-scan__facts {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1px;
	margin: 18px 0 0;
	overflow: hidden;
	border: 1px solid rgba(245, 230, 211, 0.12);
	border-radius: 8px;
	background: rgba(245, 230, 211, 0.12);
}

.lo2cb-scan__facts div {
	padding: 12px 8px;
	background: rgba(12, 17, 11, 0.9);
}

.lo2cb-scan__facts dt {
	font-family: "Fira Code", Menlo, monospace;
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #7C8A6C;
}

.lo2cb-scan__facts dd {
	margin: 4px 0 0;
	font-family: Cinzel, Georgia, serif;
	font-size: 16px;
	font-weight: 600;
	color: #F5E6D3;
}

.lo2cb-scan__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.lo2cb-scan__actions > * {
	flex: 1 1 180px;
}
