.pilsko-routes {
	min-width: 0;
	margin-block: clamp(3.5rem, 8vw, 6.5rem);
	scroll-margin-top: calc(var(--bjorn-anchor-offset, 6rem) + 1rem);
}

.pilsko-routes__heading {
	max-width: 52rem;
}

.pilsko-routes__heading h2 {
	margin-top: 0.25rem;
}

.pilsko-routes__cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: 2rem;
	gap: 1rem;
}

.pilsko-route-card {
	min-width: 0;
	padding: clamp(1.15rem, 2.6vw, 1.65rem);
	border: 0.0625rem solid var(--line);
	border-top: 0.3rem solid var(--route-color);
	background: var(--white);
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pilsko-route-card.is-active {
	border-color: var(--route-color);
	box-shadow: 0 0.75rem 2rem rgb(25 11 39 / 12%);
	transform: translateY(-0.15rem);
}

.pilsko-route-card.has-error {
	border-style: dashed;
}

.pilsko-route-card__heading {
	display: flex;
	align-items: flex-start;
	gap: 0.7rem;
}

.pilsko-route-card__heading h3 {
	margin: 0;
	font-size: clamp(1.25rem, 2vw, 1.55rem) !important;
}

.pilsko-route-card__swatch {
	width: 1.7rem;
	height: 0.32rem;
	flex: 0 0 auto;
	margin-top: 0.65rem;
	border-radius: 999px;
	background: var(--route-color);
}

.pilsko-route-card__stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 1.4rem 0 0;
	border-top: 0.0625rem solid var(--line);
	border-left: 0.0625rem solid var(--line);
}

.pilsko-route-card__stats div {
	min-width: 0;
	padding: 0.7rem;
	border-right: 0.0625rem solid var(--line);
	border-bottom: 0.0625rem solid var(--line);
}

.pilsko-route-card__stats dt {
	color: var(--ink-soft);
	font-family: var(--font-body);
	font-size: 0.75rem;
	letter-spacing: 0.035em;
	line-height: 1.3;
	text-transform: uppercase;
}

.pilsko-route-card__stats dd {
	margin: 0.18rem 0 0;
	font-family: var(--font-display);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.25;
}

.pilsko-route-card__visibility {
	margin-top: 1rem;
}

.pilsko-route-card__visibility label {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	gap: 0.55rem;
	cursor: pointer;
	font-family: var(--font-body);
	font-size: 0.9rem;
	font-weight: 700;
}

.pilsko-route-card__visibility input {
	width: 1.1rem;
	height: 1.1rem;
	margin: 0;
	accent-color: var(--route-color);
}

.pilsko-route-card__actions {
	display: flex;
	flex-wrap: wrap;
	margin-top: 0.8rem;
	gap: 0.55rem;
}

.pilsko-route-card__actions .button {
	min-height: 2.8rem;
	padding: 0.65rem 0.9rem;
	font-size: 0.78rem;
}

.pilsko-route-card__actions [data-route-select] {
	border-color: var(--purple);
	background: var(--purple);
	color: var(--white);
}

.pilsko-route-card__actions a.button {
	border-color: var(--purple);
	background: transparent;
	color: var(--purple);
	text-decoration: none;
}

.pilsko-route-card__actions a.button:hover,
.pilsko-route-card__actions a.button:focus-visible {
	background: var(--purple);
	color: var(--white);
}

.pilsko-route-card__actions [data-route-select][aria-pressed="true"] {
	border-color: var(--route-color);
	background: var(--route-color);
	color: var(--white);
}

.pilsko-route-card__error {
	margin: 0.85rem 0 0;
	color: #8b1d32;
	font-size: 0.86rem !important;
	line-height: 1.45 !important;
}

.pilsko-routes__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 1.25rem;
	gap: 1rem;
}

.pilsko-routes__toolbar .button {
	flex: 0 0 auto;
}

.pilsko-routes__status {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.88rem !important;
	line-height: 1.45 !important;
	text-align: right;
}

.pilsko-routes__status[data-state="error"],
.pilsko-routes__status[data-state="warning"] {
	color: #71182a;
}

.pilsko-routes__map-shell {
	position: relative;
	width: 100%;
	min-height: 25rem;
	margin-top: 1rem;
	overflow: hidden;
	border: 0.0625rem solid var(--line);
	background: var(--surface-light);
	aspect-ratio: 16 / 9;
}

.pilsko-routes__map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	touch-action: pan-y;
}

.pilsko-routes__map-shell.is-interactive .pilsko-routes__map {
	touch-action: none;
}

.pilsko-routes__activate {
	position: absolute;
	left: 50%;
	bottom: 1rem;
	z-index: 800;
	display: none;
	min-height: 3rem;
	padding: 0.7rem 1rem;
	transform: translateX(-50%);
	border: 0.125rem solid var(--white);
	background: var(--purple);
	box-shadow: 0 0.35rem 1rem rgb(0 0 0 / 25%);
	color: var(--white);
	font-family: var(--font-body);
	font-size: 0.86rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
}

.pilsko-routes__activate[hidden] {
	display: none !important;
}

.pilsko-routes__assist {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.pilsko-routes :where(button, a, input):focus-visible,
.pilsko-routes__map:focus-visible {
	outline: 0.2rem solid var(--purple);
	outline-offset: 0.2rem;
}

.pilsko-routes__profile {
	margin-top: 1rem;
	padding: clamp(1rem, 3vw, 1.5rem);
	border: 0.0625rem solid var(--line);
	background: var(--white);
}

.pilsko-routes__profile[hidden] {
	display: none;
}

.pilsko-routes__profile-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.pilsko-routes__profile-heading h3,
.pilsko-routes__profile-heading p {
	margin: 0;
}

.pilsko-routes__profile-heading p {
	color: var(--ink-soft);
	font-size: 0.86rem !important;
	line-height: 1.4 !important;
	text-align: right;
}

.pilsko-routes__profile svg {
	display: block;
	width: 100%;
	height: auto;
	margin-top: 0.8rem;
	overflow: visible;
}

.pilsko-profile__grid {
	stroke: #d8d4dc;
	stroke-width: 1;
}

.pilsko-profile__axis {
	fill: #5c5762;
	font-family: var(--font-body);
	font-size: 12px;
}

.pilsko-profile__area {
	opacity: 0.13;
}

.pilsko-profile__line {
	fill: none;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pilsko-routes__safety,
.pilsko-routes__notice {
	margin: 1rem 0 0;
	padding: 1rem 1.1rem;
	border-left: 0.3rem solid var(--purple);
	background: var(--surface-light);
	font-size: 0.93rem !important;
	line-height: 1.55 !important;
}

.pilsko-routes .leaflet-container {
	background: var(--surface-light);
	font-family: var(--font-body);
}

.pilsko-routes .leaflet-control-attribution {
	max-width: calc(100% - 0.5rem);
	font-size: 0.64rem;
	line-height: 1.25;
}

.pilsko-routes .leaflet-control-zoom a {
	color: var(--ink);
	text-decoration: none;
}

@media (hover: none), (pointer: coarse) {
	.pilsko-routes__activate {
		display: block;
	}
}

@media (max-width: 47.99rem) {
	.pilsko-routes__cards {
		grid-template-columns: 1fr;
	}

	.pilsko-routes__toolbar,
	.pilsko-routes__profile-heading {
		align-items: flex-start;
		flex-direction: column;
	}

	.pilsko-routes__status,
	.pilsko-routes__profile-heading p {
		text-align: left;
	}

	.pilsko-routes__map-shell {
		min-height: 25rem;
		max-height: 32rem;
		aspect-ratio: 4 / 5;
	}

	.pilsko-route-card__actions .button {
		flex: 1 1 10rem;
		justify-content: center;
	}

	.pilsko-routes .leaflet-control-attribution {
		max-width: 88%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pilsko-route-card {
		transition: none;
	}
}
