.cgm {
	--cgm-bg: var(--vt-bg-2, #f8f9fa);
	--cgm-line: var(--vt-line-2, #c8ccd1);
	--cgm-text: var(--vt-text, #202122);
	--cgm-muted: var(--vt-text-muted, #54595d);
	--cgm-accent: var(--vt-blood, #a31621);
	display: flex;
	flex-direction: column;
	margin: 1em 0 1.5em;
	border: 1px solid var(--cgm-line);
	border-radius: 6px;
	overflow: hidden;
	background: var(--cgm-bg);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.cgm-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--cgm-line);
	font-size: .9rem;
	color: var(--cgm-text);
}
.cgm-title {
	font-family: var(--vt-serif, Georgia, serif);
	font-weight: 600;
	font-size: 1.15rem;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.cgm-levels { display: flex; flex-wrap: wrap; gap: 4px; }
.cgm-level, .cgm-tool, .cgm-select {
	font: inherit;
	font-size: .82rem;
	color: var(--cgm-text);
	background: var(--vt-bg-3, #eaecf0);
	border: 1px solid var(--cgm-line);
	border-radius: 3px;
	padding: .3em .75em;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.3;
}
.cgm-level:hover, .cgm-tool:hover { border-color: var(--cgm-accent); color: var(--vt-text-strong, #000); text-decoration: none; }
.cgm-level.cgm-active { background: var(--cgm-accent); border-color: var(--cgm-accent); color: #fff; }
.cgm-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cgm-coords {
	min-width: 9em;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: .8rem;
	color: var(--cgm-muted);
	text-align: right;
}
.cgm-view {
	height: min(72vh, 680px);
	min-height: 320px;
	background: #000;
}
.cgm-view .leaflet-tile { image-rendering: pixelated; }
.cgm-view.leaflet-container { font: inherit; background: #000; outline: none; }
.cgm .leaflet-bar a {
	background: var(--vt-bg-2, #fff);
	color: var(--cgm-text);
	border-color: var(--cgm-line);
}
.cgm .leaflet-bar a:hover { background: var(--vt-bg-3, #f4f4f4); }
.cgm .leaflet-bar { border-color: var(--cgm-line); }
.cgm:fullscreen { margin: 0; border-radius: 0; border: 0; }
.cgm:fullscreen .cgm-view { height: auto; flex: 1; }
.cgm-failed::after {
	content: "Интерактивная карта сейчас недоступна";
	display: block;
	margin-top: .4em;
	color: var(--vt-text-muted, #72777d);
	font-size: .85rem;
}
@media (max-width: 720px) {
	.cgm-tools { margin-left: 0; width: 100%; justify-content: space-between; }
	.cgm-coords { text-align: left; }
	.cgm-view { height: 60vh; }
}

#cg-map-page.cgm {
	position: fixed;
	inset: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
}
#cg-map-page .cgm-view { height: auto; flex: 1; }
.cgm-back {
	font-family: var(--vt-serif, Georgia, serif);
	font-weight: 600;
	letter-spacing: .06em;
	color: var(--vt-text-muted, #54595d);
	text-decoration: none;
}
.cgm-back:hover { color: var(--vt-link-hover, #36c); }
