.tsv-route-map {
	--tsv-route-accent: var(--wp--preset--color--slate, #17666b);
	box-sizing: border-box;
	min-width: 0;
	margin: 1.5rem 0;
	padding: clamp(1rem, 3vw, 1.5rem);
	border: 1px solid var(--tsv-line, #c8d0d2);
	border-radius: 0.75rem;
	background: var(--tsv-surface, var(--wp--preset--color--white, #fff));
	color: var(--tsv-ink, var(--wp--preset--color--near-black, #252b2d));
	overflow-wrap: anywhere;
}

.tsv-route-map :where(h3, p, figure, details) { max-width: 72ch; }
.tsv-route-map h3 { margin-top: 0; color: inherit; }
.tsv-route-map__control { display: block; min-width: 0; margin: 0.75rem 0; font-weight: 650; }
.tsv-route-map__control select {
	display: block;
	box-sizing: border-box;
	width: min(100%, 42rem);
	min-width: 0;
	min-height: 44px;
	margin-top: 0.35rem;
	padding: 0.5rem 2.25rem 0.5rem 0.75rem;
	border: 1px solid var(--tsv-control-line, #68777a);
	border-radius: 0.4rem;
	background: var(--tsv-canvas, #fff);
	color: var(--tsv-ink, #252b2d);
	font: inherit;
	color-scheme: var(--tsv-color-scheme, light);
}

.tsv-route-map__canvas {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	height: clamp(18rem, 52vw, 27rem);
	margin-top: 1rem;
	border: 1px solid var(--tsv-line, #c8d0d2);
	border-radius: 0.5rem;
	background: var(--tsv-canvas, #e8eeee);
	z-index: 0;
}

.tsv-route-map__preview { margin: 1rem 0; }
.tsv-route-map__preview[hidden] { display: none; }
.tsv-route-map__preview img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 34rem;
	object-fit: contain;
	border: 1px solid var(--tsv-line, #c8d0d2);
	border-radius: 0.5rem;
	background: var(--tsv-canvas, #e8eeee);
}
.tsv-route-map__preview figcaption,
.tsv-route-map__credit,
.tsv-route-map__notes { margin-top: 0.5rem; color: var(--tsv-muted, #566466); font-size: 0.88rem; }
.tsv-route-map__status { min-height: 1.5em; margin: 0.75rem 0; }
.tsv-route-map__status.is-loading { font-weight: 650; }
.tsv-route-map__status.is-loading::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.6em;
	border: 3px solid var(--tsv-line, #c8d0d2);
	border-top-color: currentColor;
	border-radius: 50%;
	vertical-align: -0.15em;
	animation: tsv-route-loading 0.8s linear infinite;
}
@keyframes tsv-route-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.tsv-route-map__status.is-loading::before { animation: none; }
}
.tsv-route-map__retry { min-height: 44px; padding: 0.5rem 0.8rem; cursor: pointer; font: inherit; }
.tsv-route-map__retry[hidden] { display: none; }
.tsv-route-map .tsv-route-map__downloads a,
.tsv-route-map .tsv-route-map__selected-download a {
	display: inline-flex;
	box-sizing: border-box;
	min-height: 44px;
	align-items: center;
	margin: 0.25rem 0.5rem 0.25rem 0;
	padding: 0.5rem 0.8rem;
	border: 1px solid var(--tsv-route-accent);
	border-radius: 0.4rem;
	background: var(--tsv-route-accent);
	color: #fff;
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}
.tsv-route-map :where(a, button, select, summary):focus-visible {
	outline: 3px solid var(--tsv-focus, var(--tsv-route-accent));
	outline-offset: 3px;
}
.tsv-route-map__conditions { margin: 0.75rem 0; }
.tsv-route-map__conditions summary { min-height: 44px; cursor: pointer; font-weight: 650; }
.tsv-route-map__marker {
	display: grid;
	place-items: center;
	width: 30px !important;
	height: 30px !important;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #29373a;
	color: #fff;
	font-size: 0.8rem;
	font-weight: 800;
	box-shadow: 0 1px 5px #171a1c99;
}
.tsv-route-map__marker--start,
.tsv-route-map__marker--finish,
.tsv-route-map__marker--start-finish { background: var(--tsv-route-accent); }
.tsv-route-map__canvas .leaflet-control-zoom a {
	width: 44px;
	height: 44px;
	line-height: 44px;
}
.tsv-route-map__canvas .leaflet-control-attribution {
	max-width: calc(100% - 12px);
	overflow-wrap: anywhere;
	color: #1d292b;
	background: #ffffffed;
}
.tsv-route-map__canvas .leaflet-control-attribution a { color: #07545a; }

@media (max-width: 40rem) {
	.tsv-route-map { margin-inline: 0; padding: 1rem; }
	.tsv-route-map__canvas { height: 20rem; }
	.tsv-route-map__downloads a,
	.tsv-route-map__selected-download a { width: 100%; margin-right: 0; }
}

@media (max-width: 22rem) {
	.tsv-route-map { padding: 0.75rem; }
	.tsv-route-map__canvas { height: 17rem; }
}
