/* TPM Map Tailoring 0.3.0 — small button on the left above the map, panel full width under it, layer over the map.
   Colours follow the site (brand red #b85450, slate #23445d). */

/* ---------- compact button above the map ---------- */
.tpm-mt-bar {
	position: relative;
	z-index: 60;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin: 0 0 6px;
	font-family: "Roboto Condensed", Roboto, Arial, sans-serif;
}

.tpm-mt-bar .tpm-mt-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 4px 10px;
	border: 1px solid #c5d2dc;
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
	color: #23445d;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.3;
	text-transform: none;
	cursor: pointer;
}

.tpm-mt-bar .tpm-mt-toggle:hover,
.tpm-mt-bar.is-open .tpm-mt-toggle {
	border-color: #b85450;
}

/* Some steps are switched off — the button says so in brand red. */
.tpm-mt-bar .tpm-mt-toggle.is-filtering {
	border-color: #b85450;
	background: #b85450;
	color: #fff;
}

.tpm-mt-bar .tpm-mt-toggle.is-off {
	color: #5d7f99;
}

.tpm-mt-caret {
	width: 0;
	height: 0;
	border-top: 5px solid currentColor;
	border-right: 4px solid transparent;
	border-left: 4px solid transparent;
}

.tpm-mt-bar.is-open .tpm-mt-caret {
	transform: rotate(180deg);
}

.tpm-mt-bar .tpm-mt-toggle:focus-visible {
	outline: 2px solid #5d7f99;
	outline-offset: 2px;
}

/* ---------- the panel, full width under the button (like the panel on the guide page) ---------- */
.tpm-mt-drop {
	align-self: stretch;
	width: 100%;
}

.tpm-mt-panel {
	box-sizing: border-box;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid #d5dee6;
	border-radius: 10px;
	background: #f6f9fb;
	color: #23445d;
	font-family: "Roboto Condensed", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

/* The theme styles every button and select; the panel keeps its own look. */
.tpm-mt-panel button,
.tpm-mt-panel select {
	height: auto;
	min-height: 0;
	margin: 0;
	box-shadow: none;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.3;
}

.tpm-mt-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.tpm-mt-title {
	font-size: 15px;
}

.tpm-mt-panel .tpm-mt-switch {
	padding: 3px 12px;
	border: 1px solid #b85450;
	border-radius: 999px;
	background: #fff;
	color: #b85450;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.tpm-mt-panel .tpm-mt-switch.is-on {
	background: #b85450;
	color: #fff;
}

.tpm-mt-count,
.tpm-mt-source {
	color: #5d7f99;
	font-size: 13px;
}

.tpm-mt-hint {
	margin: 6px 0 8px;
	color: #5d7f99;
	font-size: 13px;
}

.tpm-mt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tpm-mt-panel .tpm-mt-chip,
.tpm-mt-panel .tpm-mt-reset {
	padding: 5px 12px;
	border: 1px solid #c5d2dc;
	border-radius: 999px;
	background: #fff;
	color: #23445d;
	font-size: 13px;
	cursor: pointer;
}

.tpm-mt-panel .tpm-mt-chip:hover,
.tpm-mt-panel .tpm-mt-reset:hover {
	border-color: #b85450;
}

.tpm-mt-panel .tpm-mt-chip.is-on {
	border-color: #b85450;
	background: #b85450;
	color: #fff;
}

.tpm-mt-panel .tpm-mt-reset {
	border-style: dashed;
	color: #5d7f99;
}

.tpm-mt-more {
	margin-top: 8px;
}

.tpm-mt-more summary {
	color: #5d7f99;
	font-size: 13px;
	cursor: pointer;
}

.tpm-mt-dials {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 8px 14px;
	margin-top: 8px;
}

.tpm-mt-dial {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 12px;
}

.tpm-mt-dial select {
	max-width: 100%;
	padding: 4px 6px;
	border: 1px solid #c5d2dc;
	border-radius: 6px;
	background: #fff;
	color: #23445d;
	font-size: 13px;
}

.tpm-mt-panel button:focus-visible,
.tpm-mt-panel select:focus-visible,
.tpm-mt-panel summary:focus-visible {
	outline: 2px solid #5d7f99;
	outline-offset: 2px;
}

/* ---------- layer over the map (inside the Image Map Pro zoom box, so it zooms with the map) ---------- */

.tpm-mt-layer {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.tpm-mt-mask {
	position: absolute;
	box-sizing: border-box;
	border: 1px dashed rgba(255, 255, 255, 0.55);
	border-radius: 4px;
	background: rgba(54, 78, 99, 0.78);
	pointer-events: auto;
	cursor: not-allowed;
}

.tpm-mt-mask--hide {
	border-color: transparent;
	background: rgba(78, 104, 126, 0.96);
}

.imp-shape.tpm-mt-off {
	pointer-events: none !important;
}

.tpm-mt-arrows {
	position: absolute;
	inset: 0;
	overflow: visible;
}

.tpm-mt-edge {
	fill: none;
	stroke: #5d6368;
	stroke-width: 2px;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ?tpm-arrows=check: the plugin arrows in pink over the painted ones */
.tpm-mt-arrows.is-check .tpm-mt-edge {
	opacity: 0.85;
}

.tpm-mt-edge.is-loop {
	stroke-dasharray: 6 5;
}

.tpm-mt-caption {
	position: absolute;
	padding: 0 4px;
	border-radius: 2px;
	background: #5d6368;
	color: #fff;
	font-family: Roboto, Arial, sans-serif;
	font-size: clamp(7px, 0.62vw, 11px);
	line-height: 1.35;
	white-space: nowrap;
	transform: translate(-50%, -50%);
}

/* Caption on a vertical line reads bottom to top, along the line (as on the painted map). */
.tpm-mt-caption.is-vertical {
	transform: translate(-50%, -50%) rotate(-90deg);
}

/* left step list on project pages */
.tpm-mt-hidden {
	display: none !important;
}

@media (max-width: 600px) {
	.tpm-mt-panel {
		padding: 8px 10px;
	}

	.tpm-mt-dials {
		grid-template-columns: 1fr;
	}
}
