.ide-dm-map,
.ide-dm-globe-header {
	--ide-dm-border: #dcdcde;
	--ide-dm-muted: #646970;
	--ide-dm-surface: #fff;
	--ide-dm-primary: #283253;
	--ide-dm-accent: #c0002a;
	--ide-dm-multi-color: #d9a441;
	--ide-dm-contact-color: #c0002a;
	box-sizing: border-box;
	color: #1d2327;
	font-family: inherit;
	margin: 1.5rem 0;
	position: relative;
}

.ide-dm-map *,
.ide-dm-map *::before,
.ide-dm-map *::after,
.ide-dm-globe-header *,
.ide-dm-globe-header *::before,
.ide-dm-globe-header *::after {
	box-sizing: border-box;
}

.ide-dm-map .ide-dm-toolbar {
	margin-bottom: 1rem;
	max-width: 34rem;
	position: relative;
	z-index: 3;
}

.ide-dm-map {
	z-index: auto !important;
}

.ide-dm-map .ide-dm-modal:not([hidden]) {
	z-index: 2147483647 !important;
}

.ide-dm-map .ide-dm-placeholder-warning {
	background: #fff4ce;
	border: 1px solid #d9a441;
	border-radius: 0.35rem;
	color: #594300;
	font-weight: 700;
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
}

.ide-dm-map .ide-dm-search {
	background: var(--ide-dm-surface);
	border: 1px solid var(--ide-dm-border);
	border-radius: 0.35rem;
	font: inherit;
	min-height: 2.75rem;
	padding: 0.65rem 0.8rem;
	width: 100%;
}

.ide-dm-map .ide-dm-search:focus,
.ide-dm-map .ide-dm-contact-form input:focus,
.ide-dm-map .ide-dm-contact-form textarea:focus {
	border-color: var(--ide-dm-primary);
	box-shadow: 0 0 0 1px var(--ide-dm-primary);
	outline: none;
}

.ide-dm-map .ide-dm-search-results {
	background: var(--ide-dm-surface);
	border: 1px solid var(--ide-dm-border);
	box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 12%);
	left: 0;
	max-height: 18rem;
	overflow: auto;
	position: absolute;
	right: 0;
	top: calc(100% + 0.2rem);
}

.ide-dm-map .ide-dm-search-results button {
	background: transparent;
	border: 0;
	cursor: pointer;
	display: block;
	font: inherit;
	padding: 0.65rem 0.8rem;
	text-align: left;
	width: 100%;
}

.ide-dm-map .ide-dm-search-results button:hover,
.ide-dm-map .ide-dm-search-results button:focus {
	background: #f0f6fc;
}

.ide-dm-map .ide-dm-layout {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
}

.ide-dm-map .ide-dm-svg,
.ide-dm-globe-header .ide-dm-svg {
	align-items: center;	
	border-radius: 0.5rem;
	display: flex;
	justify-content: center;
	min-height: 20rem;
	overflow: hidden;
	padding: 1rem;
	position: relative;
}

.ide-dm-map .ide-dm-hover-tip {
	background: var(--ide-dm-primary);
	border-radius: 999px;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	opacity: 0;
	padding: 0.3rem 0.7rem;
	pointer-events: none;
	position: absolute;
	transform: translate(-50%, -100%);
	transition: opacity 120ms ease;
	white-space: nowrap;
	z-index: 4;
}

.ide-dm-map .ide-dm-hover-tip.is-visible {
	opacity: 0.92;
}

.ide-dm-map .ide-dm-svg svg,
.ide-dm-globe-header .ide-dm-svg svg {
	display: block;
	height: auto;
	max-height: 70vh;
	max-width: 100%;
	width: 100%;
}

.ide-dm-map .ide-dm-world-svg path,
.ide-dm-map .ide-dm-world-svg g,
.ide-dm-globe-header .ide-dm-world-svg path,
.ide-dm-globe-header .ide-dm-world-svg g {
	fill: #c9d3e0;
	stroke: #fff;
	stroke-width: 0.5;
	transition: fill 150ms ease;
}

.ide-dm-map .ide-dm-world-svg .is-selected-country,
.ide-dm-globe-header .ide-dm-world-svg .is-selected-country {
	fill: var(--ide-dm-accent);
}

/*
 * Pseudo-3D globe treatment: a radial "lit sphere" gradient overlay plus a
 * soft rotating highlight, applied to whichever map wraps a world SVG
 * (standalone Export module, or the combined shortcode's header). CSS-only
 * by design — the previous commercial "Miniature Earth" library used in an
 * older shortcode is discontinued/paid and is not bundled here; this is the
 * documented fallback, degrading to a plain flat map if animation is
 * disabled or unsupported.
 */
.ide-dm-map .ide-dm-world-svg,
.ide-dm-globe-header .ide-dm-world-svg {
	background: radial-gradient(circle at 32% 28%, #eef3fa 0%, #c9d3e0 45%, #97a7c2 78%, #6d7fa1 100%);
	border-radius: 50%;
	box-shadow:
		inset -1.2rem -1.2rem 2.5rem rgb(20 30 60 / 35%),
		inset 0.6rem 0.6rem 1.8rem rgb(255 255 255 / 55%),
		0 0.75rem 2rem rgb(20 30 60 / 20%);
	max-width: 30rem;
	margin: 0 auto;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	position: relative;
}

.ide-dm-map .ide-dm-world-svg::before,
.ide-dm-globe-header .ide-dm-world-svg::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, rgb(255 255 255 / 45%) 0%, rgb(255 255 255 / 0%) 32%);
	border-radius: 50%;
	pointer-events: none;
	animation: ide-dm-globe-sheen 16s linear infinite;
}

@keyframes ide-dm-globe-sheen {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.ide-dm-map .ide-dm-world-svg::before,
	.ide-dm-globe-header .ide-dm-world-svg::before {
		animation: none;
	}
}

.ide-dm-globe-header {
	margin: 0 0 1.5rem;
}

/*
 * Real rotating globe (assets/js/globe.js + assets/js/vendor/miniature-earth.js)
 * layered over the flat decorative SVG. The flat map is what actually
 * renders until/unless the vendor library successfully reports "ready" —
 * .ide-dm-world-svg only gets .is-3d-ready then, so a slow, blocked, or
 * unsupported globe silently leaves the flat map exactly as it already
 * looked before this existed.
 */
.ide-dm-map .ide-dm-world-svg .ide-dm-flat-fallback,
.ide-dm-map .ide-dm-world-svg .ide-dm-earth-canvas {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	position: absolute;
}

.ide-dm-map .ide-dm-world-svg .ide-dm-earth-canvas {
	display: none;
}

.ide-dm-map .ide-dm-world-svg.is-3d-ready .ide-dm-flat-fallback {
	display: none;
}

.ide-dm-map .ide-dm-world-svg.is-3d-ready .ide-dm-earth-canvas {
	display: block;
}

.ide-dm-map .ide-dm-world-svg .ide-dm-earth-canvas canvas {
	border-radius: 50%;
}

/*
 * Once the real globe reports "ready" (.is-3d-ready), drop the CSS
 * pseudo-sphere treatment above entirely — the gradient, inset shadows, and
 * animated sheen were only ever a stand-in for a globe that couldn't load.
 * three.js renders its own sphere onto a transparent canvas (see the
 * `transparent: true` option in globe.js), so leaving that layer underneath
 * just doubled up into a grey halo behind the real globe. Clean white
 * background instead, matching the original theme shortcode's appearance.
 */
.ide-dm-map .ide-dm-world-svg.is-3d-ready {
	background: #fff;
	box-shadow: none;
}

.ide-dm-map .ide-dm-world-svg.is-3d-ready::before {
	content: none;
}

.ide-dm-map .ide-dm-territory {
	cursor: pointer;
	fill: var(--ide-dm-color);
	fill: color-mix(in srgb, var(--ide-dm-color) 45%, white);
	outline: none;
	stroke: #fff;
	stroke-width: 2;
	transition: filter 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.ide-dm-map .ide-dm-territory:hover,
.ide-dm-map .ide-dm-territory:focus,
.ide-dm-map .ide-dm-territory.is-related {
	filter: brightness(0.9);
	opacity: 0.9;
}

.ide-dm-map .ide-dm-territory.is-active {
	filter: brightness(0.78);
	stroke: #1d2327;
	stroke-width: 3;
}

.ide-dm-map .ide-dm-svg .is-inactive {
	cursor: default;
	fill: #dcdcde;
	opacity: 0.55;
}

/*
 * Visual modes. "Colored" (France/Germany — few delegates) keeps a
 * per-delegate resting fill, just softer than a saturated political map.
 * "Soft" (Spain — many delegates) uses one calm neutral resting fill for
 * every province regardless of delegate, so the map doesn't read as a
 * multicolor political map; delegate color only appears on hover/selection.
 */
.ide-dm-map.ide-dm-mode-colored .ide-dm-territory {
	fill: color-mix(in srgb, var(--ide-dm-color) 38%, white);
}

.ide-dm-map.ide-dm-mode-colored .ide-dm-territory:hover,
.ide-dm-map.ide-dm-mode-colored .ide-dm-territory:focus,
.ide-dm-map.ide-dm-mode-colored .ide-dm-territory.is-related {
	fill: color-mix(in srgb, var(--ide-dm-color) 62%, white);
	filter: none;
	opacity: 1;
}

.ide-dm-map.ide-dm-mode-colored .ide-dm-territory.is-active {
	fill: var(--ide-dm-color);
	filter: none;
	stroke: #1d2327;
	stroke-width: 3;
}

.ide-dm-map.ide-dm-mode-soft .ide-dm-territory {
	fill: #dbe4ef;
	stroke: #aec2d9;
	stroke-width: 1;
}

.ide-dm-map.ide-dm-mode-soft .ide-dm-territory:hover,
.ide-dm-map.ide-dm-mode-soft .ide-dm-territory:focus {
	fill: color-mix(in srgb, var(--ide-dm-color) 55%, white);
	filter: none;
	opacity: 1;
	stroke: #fff;
}

.ide-dm-map.ide-dm-mode-soft .ide-dm-territory.is-related {
	fill: color-mix(in srgb, var(--ide-dm-color) 32%, white);
	filter: none;
	opacity: 1;
	stroke: #fff;
}

.ide-dm-map.ide-dm-mode-soft .ide-dm-territory.is-active {
	fill: var(--ide-dm-color);
	filter: none;
	stroke: #1d2327;
	stroke-width: 2;
}

.ide-dm-map.ide-dm-mode-soft.has-selection .ide-dm-territory:not(.is-active):not(.is-related) {
	opacity: 0.75;
}

/*
 * A selected territory with more than one delegate gets its own accent
 * (configurable in Settings > Colors) instead of a single delegate's color,
 * so it doesn't visually claim to belong to just one of them. Territories
 * merely related to it (sharing at least one of its delegates) still use
 * that shared delegate's own color, at a lower intensity.
 */
.ide-dm-map .ide-dm-territory.is-active.is-multi {
	fill: var(--ide-dm-multi-color);
	stroke: #1d2327;
	stroke-width: 3;
}

.ide-dm-map .ide-dm-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ide-dm-map .ide-dm-card,
.ide-dm-map .ide-dm-legend-wrap {
	background: var(--ide-dm-surface);
	border: 1px solid var(--ide-dm-border);
	border-radius: 0.5rem;
	padding: 1rem;
}

.ide-dm-map .ide-dm-card h3 {
	font-size: 1.2rem;
	margin: 0 0 0.15rem;
}

.ide-dm-map .ide-dm-card .ide-dm-subtitle {
	color: var(--ide-dm-muted);
	font-size: 0.85rem;
	margin: 0 0 0.5rem;
}

.ide-dm-map .ide-dm-card p {
	margin: 0.35rem 0;
}

.ide-dm-map .ide-dm-card a {
	display: block;
	margin: 0.35rem 0;
}

.ide-dm-map .ide-dm-card .ide-dm-delegate-label {
	color: var(--ide-dm-muted);
	font-size: 0.8rem;
	font-weight: 600;
	margin: 0.5rem 0 0.25rem;
	text-transform: uppercase;
}

.ide-dm-map .ide-dm-card .ide-dm-delegate-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	list-style: none;
	margin: 0 0 0.35rem;
	padding: 0;
}

.ide-dm-map .ide-dm-card .ide-dm-delegate-list li {
	border-left: 3px solid var(--ide-dm-accent);
	padding-left: 0.6rem;
}

.ide-dm-map .ide-dm-card .ide-dm-delegate-list .ide-dm-delegate-name {
	margin: 0 0 0.15rem;
}

.ide-dm-map .ide-dm-contact-button,
.ide-dm-map .ide-dm-submit {
	background: var(--ide-dm-contact-color);
	border: 0;
	border-radius: 0.3rem;
	color: #fff;
	cursor: pointer;
	font: inherit;
	margin-top: 0.8rem;
	min-height: 2.65rem;
	padding: 0.6rem 1rem;
}

.ide-dm-map .ide-dm-legend-wrap summary {
	cursor: pointer;
	font-weight: 700;
}

.ide-dm-map .ide-dm-legend {
	display: grid;
	gap: 0.4rem;
	margin-top: 0.75rem;
}

.ide-dm-map .ide-dm-legend-item {
	align-items: center;
	background: transparent;
	border: 0;
	cursor: pointer;
	display: flex;
	font: inherit;
	gap: 0.5rem;
	padding: 0.25rem;
	text-align: left;
}

.ide-dm-map .ide-dm-swatch {
	background: var(--ide-dm-color);
	border-radius: 50%;
	flex: 0 0 0.8rem;
	height: 0.8rem;
}

.ide-dm-map .ide-dm-mobile-list {
	display: none;
}

.ide-dm-map .ide-dm-country-select {
	appearance: none;
	background: var(--ide-dm-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23646970'%3E%3Cpath d='M5.5 7.5l4.5 5 4.5-5z'/%3E%3C/svg%3E") right 0.8rem center/1rem no-repeat;
	border: 1px solid var(--ide-dm-border);
	border-radius: 0.35rem;
	font: inherit;
	min-height: 2.75rem;
	padding: 0.65rem 2.4rem 0.65rem 0.8rem;
	width: 100%;
}

.ide-dm-map .ide-dm-country-select:focus {
	border-color: var(--ide-dm-primary);
	box-shadow: 0 0 0 1px var(--ide-dm-primary);
	outline: none;
}

.ide-dm-map .ide-dm-export-layout.ide-dm-no-map {
	display: block;
	max-width: 28rem;
}

.ide-dm-map .ide-dm-export-layout .ide-dm-map-column .ide-dm-svg {
	min-height: 16rem;
}

.ide-dm-map .ide-dm-modal[hidden] {
	display: none;
}

.ide-dm-map .ide-dm-modal {
	inset: 0;
	position: fixed;
	z-index: 99999999 !important;
}

.ide-dm-map .ide-dm-modal-backdrop {
	background: rgb(0 0 0 / 58%);
	inset: 0;
	position: absolute;
	z-index: 1;
}

.ide-dm-map .ide-dm-dialog {
	background: var(--ide-dm-surface);
	border-radius: 0.5rem;
	left: 50%;
	max-height: calc(100vh - 200px);
	max-width: 38rem;
	overflow-y: auto;
	padding: 1.5rem;
	position: absolute;
	top: 200px;
	transform: translate(-50%);
	width: calc(100% - 2rem);
	z-index: 2;
}

.ide-dm-map .ide-dm-modal-close {
	background: transparent;
	border: 0;
	cursor: pointer;
	font-size: 2rem;
	line-height: 1;
	position: absolute;
	right: 0.75rem;
	top: 0.5rem;
}

.ide-dm-map .ide-dm-dialog h2 {
	color: var(--ide-dm-primary);
	margin-top: 0;
}

.ide-dm-map .ide-dm-contact-form > label:not(.ide-dm-check) {
	display: grid;
	gap: 0.25rem;
	margin-bottom: 0.75rem;
}

.ide-dm-map .ide-dm-contact-form input[type="text"],
.ide-dm-map .ide-dm-contact-form input[type="email"],
.ide-dm-map .ide-dm-contact-form input[type="tel"],
.ide-dm-map .ide-dm-contact-form textarea {
	border: 1px solid var(--ide-dm-border);
	border-radius: 0.3rem;
	font: inherit;
	padding: 0.6rem;
	width: 100%;
}

.ide-dm-map .ide-dm-check {
	align-items: flex-start;
	display: flex;
	gap: 0.5rem;
	margin: 0.7rem 0;
}

.ide-dm-map .ide-dm-legal-text {
	color: var(--ide-dm-muted);
	font-size: 0.8rem;
	line-height: 1.5;
	margin: 0.7rem 0;
}

.ide-dm-map .ide-dm-legal-text p {
	margin: 0 0 0.5rem;
}

.ide-dm-map .ide-dm-legal-text a {
	color: var(--ide-dm-primary);
}

.ide-dm-map .ide-dm-honeypot {
	height: 1px;
	left: -10000px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

@media (max-width: 780px) {
	.ide-dm-map .ide-dm-layout {
		grid-template-columns: 1fr;
	}

	.ide-dm-map .ide-dm-svg {
		min-height: 15rem;
		padding: 0.5rem;
	}

	.ide-dm-map .ide-dm-mobile-list {
		display: grid;
		gap: 0.4rem;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-top: 1rem;
	}

	.ide-dm-map .ide-dm-mobile-list button {
		background: #fff;
		border: 1px solid var(--ide-dm-border);
		border-radius: 0.3rem;
		font: inherit;
		min-height: 2.75rem;
		padding: 0.5rem;
	}
}

/* Combined shortcode: globe header + tabs (see [ide_commercial_maps]). */

.ide-dm-tabs-shell {
	--ide-dm-border: #dcdcde;
	--ide-dm-muted: #646970;
	--ide-dm-primary: #283253;
	--ide-dm-accent: #c0002a;
	color: #1d2327;
	font-family: inherit;
	margin: 1.5rem 0;
}

.ide-dm-tabs-shell .ide-dm-globe-wrap {
	margin-bottom: 1.5rem;
}

.ide-dm-tabs-shell .ide-dm-globe-wrap .ide-dm-map {
	margin: 0;
}

.ide-dm-tabs-shell .ide-dm-tabs-hint {
	color: var(--ide-dm-muted);
	font-size: 0.85rem;
	margin: 0 0 0.5rem;
	text-align: center;
	display:none;
}

.ide-dm-tabs-shell .ide-dm-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-bottom: 1.5rem;
}

.ide-dm-tabs-shell .ide-dm-tab {
	background: #fff;
	border: 1px solid var(--ide-dm-border);
	border-radius: 999px;
	color: var(--ide-dm-primary);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 0.55rem 1.2rem;
	transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.ide-dm-tabs-shell .ide-dm-tab:hover,
.ide-dm-tabs-shell .ide-dm-tab:focus-visible {
	border-color: var(--ide-dm-primary);
}

.ide-dm-tabs-shell .ide-dm-tab[aria-selected="true"] {
	background: var(--ide-dm-primary);
	border-color: var(--ide-dm-primary);
	color: #fff;
}

.ide-dm-tabs-shell .ide-dm-tab-panel {
	margin: 0;
}

/*
 * Belt-and-suspenders: no regional tab is open on page load — tabs.js never
 * calls activate() until a tab is clicked, so every panel keeps its native
 * [hidden] attribute at render time. This rule exists only in case a theme
 * stylesheet resets [hidden] (some frameworks do); it changes nothing when
 * the browser default already applies.
 */
.ide-dm-tabs-shell .ide-dm-tab-panel[hidden] {
	display: none !important;
}

.ide-dm-tabs-shell .ide-dm-tab-panel .ide-dm-map {
	margin: 0;
}


.ide-dm-map .ide-dm-contact-form {
	font-size: 0.78rem;
}

.ide-dm-map .ide-dm-contact-form > label:not(.ide-dm-check) {
	gap: 0.1rem;
	margin-bottom: 0.35rem;
}

.ide-dm-map .ide-dm-contact-form input[type="text"],
.ide-dm-map .ide-dm-contact-form input[type="email"],
.ide-dm-map .ide-dm-contact-form input[type="tel"],
.ide-dm-map .ide-dm-contact-form textarea {
	font-size: 0.78rem;
	padding: 0.25rem 0.4rem;
	line-height: 1.2;
	min-height: 0;
}

/* Campos normales más bajos */
.ide-dm-map .ide-dm-contact-form input[type="text"],
.ide-dm-map .ide-dm-contact-form input[type="email"],
.ide-dm-map .ide-dm-contact-form input[type="tel"] {
	height: 32px;
}

/* Textarea bastante más compacto */
.ide-dm-map .ide-dm-contact-form textarea {
	height: 70px;
	min-height: 70px;
	resize: vertical;
}


