:root {
	--primary: #2563eb;
	--primary-hover: #1d4ed8;
	--primary-light: #eff6ff;
	--text: #1e293b;
	--text-muted: #64748b;
	--bg: #ffffff;
	--bg-subtle: #f8fafc;
	--border: #e2e8f0;
	--radius: 12px;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Typography */

body {
	font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--text);
	background-color: var(--bg-subtle);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
	font-family: 'Source Sans Pro', sans-serif;
	font-weight: 700;
	color: var(--text);
	letter-spacing: -0.02em;
}

h4 {
	font-family: 'Source Sans Pro', sans-serif;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 0.5rem;
}

p {
	font-family: 'Source Sans Pro', sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: var(--text-muted);
}

a {
	color: var(--primary);
	text-decoration: none;
}

a:hover {
	color: var(--primary-hover);
	text-decoration: none;
}

.error {
	border-color: #ef4444;
}

.field-validation-error {
	min-height: 1.1rem;
	margin-top: 4px;
	font-size: 0.78rem;
	line-height: 1.35;
	color: #b91c1c;
}

/* Utility */

.noma { margin: 0; }
.nopa { padding: 0; }
.xsmall-tm { margin-top: 5px; }
.small-tm { margin-top: 10px; }

/* Site header */

.site-header {
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	padding: 0.75rem 1.5rem;
	margin-bottom: 1rem;
	box-shadow: var(--shadow-sm);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.site-header h1 {
	font-family: 'Poiret One', sans-serif;
	font-size: 1.6rem;
	margin: 0;
}

.site-header h1 a {
	color: var(--text);
	text-decoration: none;
}

.site-header h1 a:hover {
	color: var(--primary);
}

.logo-image {
	animation: rotation-logo 30s infinite;
	height: 36px;
	width: 36px;
	margin-right: 10px;
	vertical-align: middle;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.site-nav a {
	color: var(--text-muted);
	font-size: 0.9rem;
	font-weight: 500;
	padding: 0.4rem 0.75rem;
	border-radius: 8px;
	transition: all 0.15s ease;
}

.site-nav a:hover {
	color: var(--primary);
	background-color: var(--primary-light);
}

/* Navbar search area */

.navbar-distansen {
	margin: 15px 0 25px 0;
	padding: 0;
}

/* Search controls */

.search-bar {
	background-color: var(--bg);
	border: 1px solid var(--border);
	border-right: none;
	width: 85%;
	height: 44px;
	padding: 5px 5px 5px 16px;
	margin: 0;
	font-size: 14px;
	border-radius: var(--radius) 0 0 var(--radius);
	float: left;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-button {
	background-color: var(--bg);
	border: 1px solid var(--border);
	border-left: none;
	height: 44px;
	padding: 5px 10px 5px 5px;
	margin: 0;
	font-size: 14px;
	border-radius: 0 var(--radius) var(--radius) 0;
	cursor: pointer;
	float: left;
	color: var(--text-muted);
	transition: color 0.15s ease;
}

.search-button:hover {
	color: var(--primary);
}

.search-button:focus {
	outline: none;
}

.head-button {
	background-color: var(--primary);
	color: white;
	height: 44px;
	line-height: 44px;
	margin: 0;
	padding-left: 16px;
	padding-right: 16px;
	font-size: 14px;
	font-weight: 500;
	border-radius: var(--radius);
	text-align: center;
	cursor: pointer;
	float: left;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.head-button:hover {
	background-color: var(--primary-hover);
	transform: translateY(-1px);
}

.copy-button {
	background-color: var(--primary);
	color: white;
	height: 40px;
	font-size: 14px;
	font-weight: 500;
	line-height: 40px;
	padding-left: 16px;
	padding-right: 16px;
	border-radius: 8px;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.copy-button:hover {
	background-color: var(--primary-hover);
}

.save-button {
	background-color: var(--primary);
	font: 500 16px 'Source Sans Pro', sans-serif;
	color: #fff;
	height: 44px;
	margin: 0;
	line-height: 44px;
	padding-left: 20px;
	padding-right: 20px;
	border-radius: 8px;
	margin-bottom: 12px;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.save-button:hover {
	background-color: var(--primary-hover);
}

.visible {
	display: block;
}

/* Map canvas and controls */

.map_canvas {
	height: 500px;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	border: 1px solid var(--border);
}

#LabelControl {
	box-shadow: var(--shadow-md);
	background-color: white;
	border: none;
	border-radius: 8px;
	cursor: default;
	text-align: left;
	margin-top: 5px;
	margin-left: 6px;
	height: 37px;
}

#LabelControlText {
	font: 600 16px 'Source Sans Pro', sans-serif;
	color: var(--text);
	padding: 8px 14px;
}

#LocationControl, #ResetControl, #UndoControl, #FlagControl {
	color: #333;
}

.map-button-icon {
	font-size: 18px;
	line-height: 29px;
}

#FlagControl.active {
	color: var(--primary);
	background-color: #eff6ff;
}

.distansen-map-actions {
	display: block;
}

.mapboxgl-ctrl-group.distansen-basemap-control {
	display: flex;
}

.mapboxgl-ctrl-group.distansen-basemap-control button {
	width: auto;
	min-width: 52px;
	height: 29px;
	padding: 0 9px;
	font: 600 13px 'Source Sans Pro', sans-serif;
	color: #333;
}

.mapboxgl-ctrl-group.distansen-basemap-control button.active {
	color: var(--primary);
	background-color: #eff6ff;
}

.distansen-map-save {
	position: absolute;
	z-index: 2;
	left: 50%;
	bottom: 28px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border: 0;
}

.distansen-map-save.is-disabled {
	color: #64748b;
	background: #e2e8f0;
	box-shadow: none;
}

.distansen-save-hint {
	position: absolute;
	z-index: 3;
	left: 50%;
	bottom: 84px;
	transform: translateX(-50%);
	width: max-content;
	max-width: calc(100% - 32px);
	padding: 9px 12px;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
	text-align: center;
	background: rgba(15, 23, 42, 0.94);
	border-radius: 9px;
	box-shadow: var(--shadow-md);
	pointer-events: none;
}

.route-marker {
	z-index: 2;
	cursor: grab;
	user-select: none;
}

.route-marker:active {
	cursor: grabbing;
}

.route-marker svg {
	display: block;
}

.kilometer-marker {
	position: absolute;
	z-index: 1;
	display: inline-block;
	width: max-content;
	min-width: 0;
	padding: 3px 8px;
	box-sizing: border-box;
	border: 1px solid #333;
	border-radius: 4px;
	background: white;
	box-shadow: var(--shadow-sm);
	font: 700 11px 'Source Sans Pro', sans-serif;
	color: #333;
	text-align: center;
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
}

.kilometer-marker::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 100%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #333;
}

.mapboxgl-popup-content {
	font-family: 'Source Sans Pro', sans-serif;
}

/* Content sections */

.content-section {
	background: var(--bg);
	border-radius: var(--radius);
	padding: 2.5rem;
	margin-bottom: 1.5rem;
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--border);
}

.content-section h4 {
	margin-top: 1.5rem;
}

.content-section h4:first-child {
	margin-top: 0;
}

/* Page content */

.page-content {
	max-width: 720px;
	margin: 2rem auto;
	padding: 0 1rem;
}

.page-content h2 {
	font-size: 2rem;
	margin-bottom: 0.5rem;
}

.page-content .lead {
	font-size: 1.15rem;
	color: var(--text-muted);
	line-height: 1.7;
	margin-bottom: 2rem;
}

.page-content h4 {
	margin-top: 2rem;
	margin-bottom: 0.5rem;
}

.page-content p {
	margin-bottom: 1rem;
}

/* Feature cards */

.feature-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.feature-card {
	display: block;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	text-decoration: none;
	color: var(--text);
	transition: box-shadow 0.15s, border-color 0.15s;
}

.feature-card:hover {
	border-color: var(--primary);
	box-shadow: var(--shadow-sm);
	text-decoration: none;
	color: var(--text);
}

.feature-card .material-icons {
	font-size: 28px;
	color: var(--primary);
	margin-bottom: 0.5rem;
}

.feature-card h4 {
	font-size: 1rem;
	margin: 0 0 0.4rem 0;
}

.feature-card p {
	font-size: 0.85rem;
	color: var(--text-muted);
	margin: 0;
	line-height: 1.4;
}

@media (max-width: 768px) {
	.feature-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.feature-cards {
		grid-template-columns: 1fr;
	}
}

/* Calculator tools */

.calculator-card {
	background: var(--primary-light);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	margin-bottom: 2rem;
}

.calculator-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.calculator-field {
	display: flex;
	flex-direction: column;
}

.calculator-field.full-width {
	grid-column: 1 / -1;
}

.calculator-field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 0.25rem;
}

.calculator-field input,
.calculator-field select {
	height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 14px;
	font-family: 'Source Sans Pro', sans-serif;
	background: var(--bg);
	color: var(--text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.calculator-field input:focus,
.calculator-field select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calculator-btn {
	display: inline-block;
	margin-top: 1rem;
	padding: 0.7rem 2rem;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	font-family: 'Source Sans Pro', sans-serif;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.calculator-btn:hover {
	background: var(--primary-hover);
	transform: translateY(-1px);
}

.calculator-result {
	margin-top: 1.5rem;
	padding: 1.5rem;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.result-value {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--primary);
	margin-bottom: 0.25rem;
}

.result-detail {
	font-size: 0.9rem;
	color: var(--text-muted);
	margin-bottom: 0;
}

.result-error {
	color: #dc2626;
	margin-bottom: 0;
}

.met-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.75rem;
	font-size: 0.9rem;
}

.met-table th {
	text-align: left;
	font-weight: 600;
	color: var(--text);
	padding: 0.5rem 0.75rem;
	border-bottom: 2px solid var(--border);
}

.met-table td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--border);
	color: var(--text-muted);
}

.met-table tr:last-child td {
	border-bottom: none;
}

/* Nav dropdown */

.nav-dropdown {
	position: relative;
	display: inline-block;
}

.nav-dropdown-toggle {
	color: var(--text-muted);
	font-size: 0.9rem;
	font-weight: 500;
	padding: 0.4rem 0.75rem;
	border-radius: 8px;
	transition: all 0.15s ease;
	cursor: pointer;
}

.nav-dropdown-toggle:hover {
	color: var(--primary);
	background-color: var(--primary-light);
}

.nav-dropdown-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	padding: 0.5rem 0;
	min-width: 220px;
	z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
	display: block;
}

.nav-dropdown-menu a {
	display: block;
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
	color: var(--text-muted);
	border-radius: 0;
}

.nav-dropdown-menu a:hover {
	background-color: var(--primary-light);
	color: var(--primary);
}

.page-content ul {
	color: var(--text-muted);
	line-height: 1.7;
	padding-left: 1.5rem;
}

.page-content li {
	margin-bottom: 0.5rem;
}

/* FAQ */

.faq-item {
	border-bottom: 1px solid var(--border);
	padding: 1.25rem 0;
}

.faq-item:last-child {
	border-bottom: none;
}

.faq-item h4 {
	margin-top: 0;
	font-size: 1.05rem;
}

.faq-item p {
	margin-bottom: 0;
}

/* Trails page */

.trails-toolbar {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.trails-toolbar .search-bar {
	flex: 1;
}

.trail-select {
	height: 40px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 14px;
	font-family: 'Source Sans Pro', sans-serif;
	background: var(--bg);
	color: var(--text);
}

.trails-layout {
	display: flex;
	gap: 1rem;
	margin-bottom: 2rem;
}

.trails-list {
	width: 340px;
	min-width: 280px;
	max-height: 600px;
	overflow-y: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
}

.trails-map-wrap {
	flex: 1;
	min-width: 0;
}

.trails-map {
	width: 100%;
	height: 600px;
	border-radius: var(--radius);
	border: 1px solid var(--border);
}

.trail-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.6rem 1rem;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
	transition: background-color 0.1s ease;
}

.trail-item:last-child {
	border-bottom: none;
}

.trail-item:hover {
	background-color: var(--primary-light);
}

.trail-item.active {
	background-color: var(--primary);
	color: white;
}

.trail-item.active .trail-km {
	color: rgba(255, 255, 255, 0.8);
}

.trail-name {
	font-size: 0.9rem;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-right: 0.5rem;
	color: inherit;
	text-decoration: none;
}

a.trail-name:hover {
	text-decoration: underline;
}

.trail-km {
	font-size: 0.8rem;
	color: var(--text-muted);
	white-space: nowrap;
	flex-shrink: 0;
}

.trails-loading,
.trails-empty {
	padding: 2rem;
	text-align: center;
	color: var(--text-muted);
	font-size: 0.9rem;
}

/* Trail detail page */

.trail-breadcrumb {
	margin: 1rem 0 0.5rem;
	font-size: 0.9rem;
}

.trail-breadcrumb a {
	color: var(--primary);
}

.trail-title {
	font-size: 1.75rem;
	margin-bottom: 0.5rem;
}

.trail-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin-bottom: 1rem;
	font-size: 0.9rem;
	color: var(--text-muted);
}

.trail-badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	background: var(--primary-light);
	border: 1px solid var(--border);
	border-radius: 20px;
	font-size: 0.85rem;
	color: var(--text);
}

.trail-badge:first-child {
	background: var(--primary);
	color: white;
	border-color: var(--primary);
	font-weight: 600;
}

a.trail-badge-link {
	text-decoration: none;
	cursor: pointer;
}
a.trail-badge-link:hover {
	background: var(--border);
}

.race-sport {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 0.2rem 0.6rem;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 600;
}
.race-sport .material-icons {
	font-size: 16px;
}
.sport-running { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.sport-cycling { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.sport-skiing { background: #eff6ff; color: #2563eb; border: 1px solid #93c5fd; }

.race-icon {
	display: inline-flex;
	align-items: center;
	margin-right: 4px;
}
.race-icon .material-icons {
	font-size: 18px;
}

.trail-detail-map {
	width: 100%;
	height: 500px;
	border-radius: var(--radius);
	border: 1px solid var(--border);
}

.map-search-error {
	margin: 0.75rem 0 0;
	color: #b91c1c;
	font-size: 0.9rem;
}

/* Footer */

.site-footer {
	border-top: 1px solid var(--border);
	padding: 2rem 0;
	margin-top: 3rem;
	background: var(--bg);
}

.site-footer p {
	font-size: 0.85rem;
	color: var(--text-muted);
	margin: 0;
}

.site-footer a {
	color: var(--text-muted);
}

.site-footer a:hover {
	color: var(--primary);
}

/* Animations */

@keyframes rotation-logo {
	0%   { transform: rotate(0deg); }
	25%  { transform: rotate(-50deg); }
	50%  { transform: rotate(10deg); }
	75%  { transform: rotate(-32deg); }
	100% { transform: rotate(0deg); }
}

/* Save route dialog */

.save-route-dialog {
	max-width: 520px;
}

.save-route-modal {
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 18px;
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.save-route-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 18px;
	border-bottom: 1px solid var(--border);
}

.save-route-eyebrow {
	display: block;
	margin-bottom: 3px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--primary);
}

.save-route-header h2 {
	margin: 0;
	font-size: 1.35rem;
	line-height: 1.2;
}

.save-route-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 0;
	color: var(--text-muted);
	background: var(--bg-subtle);
	border: 1px solid var(--border);
	border-radius: 10px;
	cursor: pointer;
}

.save-route-close:hover {
	color: var(--text);
	background: #f1f5f9;
}

.save-route-close .material-icons {
	font-size: 20px;
}

.save-route-body {
	padding: 22px 24px 24px;
}

.save-route-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	margin-bottom: 20px;
	background: var(--primary-light);
	border: 1px solid #bfdbfe;
	border-radius: 12px;
}

.save-route-summary > .material-icons {
	font-size: 24px;
	color: var(--primary);
}

.save-route-summary strong,
.save-route-summary span {
	display: block;
}

.save-route-summary strong {
	font-size: 1rem;
	line-height: 1.2;
	color: var(--text);
}

.save-route-summary span {
	margin-top: 2px;
	font-size: 0.8rem;
	color: var(--text-muted);
}

.save-route-field {
	margin-bottom: 15px;
}

.save-route-field label,
.save-route-success > label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--text);
}

.save-route-field label span {
	font-weight: 400;
	color: var(--text-muted);
}

.save-route-field input,
.save-route-field textarea,
.save-route-success > input {
	display: block;
	width: 100%;
	padding: 10px 12px;
	font: 400 0.95rem 'Source Sans Pro', sans-serif;
	line-height: 1.4;
	color: var(--text);
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.save-route-field input {
	height: 44px;
}

.save-route-field textarea {
	min-height: 82px;
	resize: vertical;
}

.save-route-field input:focus,
.save-route-field textarea:focus,
.save-route-success > input:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.save-route-field input.error {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.save-route-field-help {
	margin: 1px 0 0;
	font-size: 0.78rem;
	line-height: 1.35;
}

.save-route-error {
	padding: 9px 11px;
	margin-top: 4px;
	font-size: 0.84rem;
	line-height: 1.35;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 9px;
}

.save-route-actions,
.save-route-success-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
}

.save-route-primary,
.save-route-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 44px;
	padding: 9px 16px;
	font: 700 0.9rem 'Source Sans Pro', sans-serif;
	border-radius: 10px;
	cursor: pointer;
}

.save-route-primary {
	color: #fff;
	background: var(--primary);
	border: 1px solid var(--primary);
	box-shadow: 0 1px 2px rgba(37, 99, 235, 0.22);
}

.save-route-primary:hover {
	color: #fff;
	background: var(--primary-hover);
	border-color: var(--primary-hover);
}

.save-route-primary:disabled {
	cursor: wait;
	opacity: 0.65;
}

.save-route-secondary {
	color: var(--text);
	background: #fff;
	border: 1px solid #cbd5e1;
}

.save-route-secondary:hover {
	color: var(--primary);
	background: var(--primary-light);
	border-color: #bfdbfe;
}

.save-route-primary .material-icons,
.save-route-secondary .material-icons {
	font-size: 18px;
}

.save-route-success {
	text-align: center;
}

.save-route-success-icon {
	font-size: 48px;
	color: #16a34a;
}

.save-route-success h3 {
	margin: 8px 0 4px;
	font-size: 1.35rem;
}

.save-route-success > p {
	margin: 0 auto 18px;
	max-width: 390px;
	font-size: 0.92rem;
	line-height: 1.5;
}

.save-route-success > label {
	text-align: left;
}

.save-route-success > input {
	height: 44px;
	font-size: 0.84rem;
	background: var(--bg-subtle);
}

.save-route-success-actions {
	justify-content: center;
	margin-top: 14px;
}

.save-route-share-status {
	min-height: 21px;
	margin: 8px 0 2px !important;
	font-size: 0.82rem !important;
	color: #15803d !important;
}

.save-route-view-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	font-size: 0.88rem;
	font-weight: 700;
}

.save-route-view-link .material-icons {
	font-size: 17px;
}

/* Responsive */

@media (max-width: 768px) {
	.site-header {
		padding: 0.5rem 1rem;
	}

	.site-nav a {
		font-size: 0.8rem;
		padding: 0.3rem 0.5rem;
	}

	.map_canvas {
		height: 350px;
		border-radius: 8px;
	}

	.content-section {
		padding: 1.5rem;
	}

	.page-content {
		margin: 1rem auto;
	}

	.page-content h2 {
		font-size: 1.5rem;
	}

	.calculator-grid {
		grid-template-columns: 1fr;
	}

	.nav-dropdown-menu {
		position: fixed;
		left: 0;
		right: 0;
		top: auto;
		border-radius: 0 0 var(--radius) var(--radius);
	}

	.trails-layout {
		flex-direction: column;
	}

	.trails-list {
		width: 100%;
		max-height: 250px;
	}

	.trails-map {
		height: 400px;
	}

	.trails-toolbar {
		flex-direction: column;
	}

	#saveModal {
		padding-right: 0 !important;
	}

	.save-route-dialog {
		display: flex;
		align-items: flex-end;
		width: 100%;
		max-width: none;
		min-height: 100%;
		margin: 0;
	}

	.save-route-modal {
		width: 100%;
		max-height: calc(100dvh - 18px);
		overflow-y: auto;
		border-right: 0;
		border-bottom: 0;
		border-left: 0;
		border-radius: 18px 18px 0 0;
	}

	.save-route-header {
		padding: 18px 18px 15px;
	}

	.save-route-body {
		padding: 18px;
		padding-bottom: calc(18px + env(safe-area-inset-bottom));
	}

	.save-route-actions,
	.save-route-success-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.save-route-primary,
	.save-route-secondary {
		width: 100%;
	}
}

/* Responsive navigation */

.site-header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.site-nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	color: var(--text);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 10px;
	cursor: pointer;
}

/* Full-screen route editor */

body.map-workspace-page {
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

.map-workspace {
	--panel-width: 420px;
	position: fixed;
	inset: 0;
	overflow: hidden;
	background: #dbe3ea;
}

.map-workspace-map.map_canvas {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: var(--panel-width);
	width: calc(100% - var(--panel-width));
	height: 100%;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: left 240ms ease, width 240ms ease;
}

.map-workspace-panel {
	position: absolute;
	z-index: 30;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: var(--panel-width);
	background: rgba(255, 255, 255, 0.98);
	border-right: 1px solid var(--border);
	box-shadow: 8px 0 28px rgba(15, 23, 42, 0.12);
	transform: translateX(0);
	transition: transform 240ms ease;
}

.map-workspace.panel-closed .map-workspace-panel {
	transform: translateX(-100%);
}

.map-workspace.panel-closed .map-workspace-map {
	left: 0;
	width: 100%;
}

.map-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 68px;
	padding: 12px 16px 12px 20px;
	border-bottom: 1px solid var(--border);
}

.map-panel-brand {
	display: inline-flex;
	align-items: center;
	font: 400 1.65rem 'Poiret One', sans-serif;
	color: var(--text);
}

.map-panel-brand:hover {
	color: var(--primary);
}

.map-panel-brand .logo-image {
	width: 34px;
	height: 34px;
	margin-right: 9px;
}

.map-panel-close,
.map-panel-toggle,
.map-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	color: #333;
	background: #fff;
	border: 0;
	border-radius: 8px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.16);
	cursor: pointer;
}

.map-panel-close:hover,
.map-panel-toggle:hover,
.map-search-toggle:hover {
	color: var(--primary);
	background: var(--primary-light);
}

.map-search-toggle {
	display: none;
}

.map-panel-content {
	flex: 1;
	min-height: 0;
	padding: 24px 24px 18px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.map-panel-content > h1 {
	margin: 0 0 6px;
	font-size: 1.5rem;
	line-height: 1.2;
}

.map-panel-intro {
	margin: 0 0 20px;
	font-size: 0.98rem;
	line-height: 1.5;
}

.map-panel-search {
	display: block;
	width: 100%;
	margin: 0 0 10px;
}

.map-panel-search-label {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 7px;
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--text);
}

.map-panel-search-label .material-icons {
	font-size: 18px;
	color: var(--primary);
}

.map-panel-search-control {
	display: flex;
	align-items: center;
	width: 100%;
	height: 48px;
	padding: 4px;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	box-shadow: var(--shadow-sm);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-panel-search-control:focus-within {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.map-panel-search input {
	min-width: 0;
	flex: 1;
	height: 38px;
	padding: 0 8px 0 10px;
	font: 400 0.92rem 'Source Sans Pro', sans-serif;
	color: var(--text);
	background: transparent;
	border: 0;
}

.map-panel-search input:focus {
	outline: none;
}

.map-panel-search input::placeholder {
	color: #94a3b8;
}

.map-panel-search input::-webkit-search-cancel-button {
	display: none;
}

.map-panel-search-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	color: var(--text-muted);
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.map-panel-search-clear[hidden] {
	display: none;
}

.map-panel-search-clear:hover {
	color: var(--text);
	background: var(--bg-subtle);
}

.map-panel-search-clear .material-icons {
	font-size: 18px;
}

.map-panel-search-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	flex: 0 0 auto;
	height: 38px;
	padding: 0 13px;
	font: 700 0.88rem 'Source Sans Pro', sans-serif;
	color: #fff;
	background: var(--primary);
	border: 0;
	border-radius: 9px;
	box-shadow: 0 1px 2px rgba(37, 99, 235, 0.24);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.map-panel-search-submit:hover {
	color: #fff;
	background: var(--primary-hover);
}

.map-panel-search-submit:active {
	transform: translateY(1px);
}

.map-panel-search-submit .material-icons {
	font-size: 18px;
}

.map-panel-search-help {
	margin: 6px 2px 0;
	font-size: 0.78rem;
	line-height: 1.35;
	color: var(--text-muted);
}

.map-panel-search .map-search-error {
	margin: 8px 0 0;
	padding: 8px 10px;
	font-size: 0.82rem;
	line-height: 1.35;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
}

.map-panel-location,
.map-panel-primary-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 42px;
	padding: 8px 14px;
	font-weight: 600;
	color: var(--primary);
	background: var(--primary-light);
	border: 1px solid #bfdbfe;
	border-radius: 10px;
	cursor: pointer;
}

.map-panel-location .material-icons,
.map-panel-primary-link .material-icons {
	font-size: 19px;
}

.map-panel-location:hover,
.map-panel-primary-link:hover {
	color: #fff;
	background: var(--primary);
	border-color: var(--primary);
}

.map-panel-steps {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 0;
	margin: 24px 0 20px;
	list-style: none;
}

.map-panel-steps li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.map-panel-steps li > span {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	font-weight: 700;
	color: var(--primary);
	background: var(--primary-light);
	border-radius: 50%;
}

.map-panel-steps p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.35;
}

.map-panel-steps strong {
	display: block;
	margin-bottom: 2px;
	color: var(--text);
}

.map-panel-hint,
.map-panel-saved-route {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	margin: 0 0 18px;
	font-size: 0.84rem;
	line-height: 1.45;
	background: var(--bg-subtle);
	border: 1px solid var(--border);
	border-radius: 10px;
}

.map-panel-hint .material-icons,
.map-panel-saved-route .material-icons {
	font-size: 19px;
	color: var(--primary);
}

.map-panel-saved-route p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.45;
}

.map-panel-eyebrow {
	display: block;
	margin-bottom: 8px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--primary);
}

.map-panel-more {
	margin-top: 18px;
	font-size: 0.9rem;
	color: var(--text-muted);
}

.map-panel-more summary {
	font-weight: 600;
	color: var(--text);
	cursor: pointer;
}

.map-panel-more p {
	margin: 10px 0 0;
	font-size: 0.88rem;
	line-height: 1.55;
}

.map-panel-seo-copy {
	padding-top: 4px;
	margin-top: 22px;
	border-top: 1px solid var(--border);
}

.map-panel-seo-copy h2,
.map-panel-related h2 {
	margin: 22px 0 7px;
	font-size: 1.08rem;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.map-panel-seo-copy p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.58;
}

.map-panel-related {
	padding-top: 2px;
	margin-top: 22px;
	border-top: 1px solid var(--border);
}

.map-panel-related a {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px;
	margin-bottom: 9px;
	color: var(--text-muted);
	background: var(--bg-subtle);
	border: 1px solid var(--border);
	border-radius: 10px;
}

.map-panel-related a:hover {
	color: var(--text-muted);
	background: var(--primary-light);
	border-color: #bfdbfe;
}

.map-panel-related .material-icons {
	flex: 0 0 auto;
	margin-top: 1px;
	font-size: 21px;
	color: var(--primary);
}

.map-panel-related span {
	font-size: 0.84rem;
	line-height: 1.4;
}

.map-panel-related strong {
	display: block;
	margin-bottom: 2px;
	font-size: 0.9rem;
	color: var(--text);
}

.map-panel-meta-links {
	display: flex;
	flex-wrap: wrap;
	gap: 7px 14px;
	padding: 18px 0 8px;
}

.map-panel-meta-links a {
	font-size: 0.8rem;
	color: var(--text-muted);
}

.map-panel-meta-links a:hover {
	color: var(--primary);
}

.map-panel-nav {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-top: 1px solid var(--border);
}

.map-panel-nav a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 11px 2px 10px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--text-muted);
}

.map-panel-nav a:hover {
	color: var(--primary);
	background: var(--primary-light);
}

.map-panel-nav .material-icons {
	font-size: 20px;
}

.map-panel-toggle {
	position: absolute;
	z-index: 20;
	top: 14px;
	left: 14px;
}

.map-workspace .mapboxgl-ctrl-top-left {
	display: flex;
	align-items: flex-start;
}

.map-workspace .mapboxgl-ctrl-top-left .map-panel-toggle {
	position: static;
	flex: 0 0 auto;
	width: 37px;
	height: 37px;
	margin: 5px 0 0 6px;
	pointer-events: auto;
}

.map-workspace .mapboxgl-ctrl-top-left .map-search-toggle {
	position: static;
	flex: 0 0 auto;
	width: 37px;
	height: 37px;
	margin: 5px 0 0 6px;
	pointer-events: auto;
}

.map-workspace.panel-open .map-panel-toggle,
.map-workspace.panel-open .map-search-toggle {
	display: none;
}

.map-panel-backdrop {
	display: none;
}

.map-workspace-page .modal {
	z-index: 1050;
}

@media (min-width: 769px) and (max-width: 1050px) {
	.map-workspace {
		--panel-width: 360px;
	}
}

@media (max-width: 768px) {
	.site-header {
		display: block !important;
		align-items: stretch !important;
	}

	.site-header-row {
		width: 100%;
	}

	.site-nav-toggle {
		display: inline-flex;
	}

	.site-nav {
		display: none;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		padding-top: 10px;
	}

	.site-header.site-nav-open .site-nav {
		display: flex;
	}

	.site-nav a {
		width: 100%;
		font-size: 0.95rem;
		padding: 0.65rem 0.75rem;
	}

	.site-nav .nav-dropdown,
	.site-nav .nav-dropdown-toggle {
		width: 100%;
	}

	.site-nav .nav-dropdown-toggle {
		display: block;
	}

	.site-nav .nav-dropdown-menu {
		position: static;
		width: 100%;
		margin: 2px 0 4px;
		box-shadow: none;
		border-radius: 8px;
	}

	.map-workspace {
		--panel-width: min(88vw, 340px);
	}

	.map-workspace-map.map_canvas,
	.map-workspace.panel-closed .map-workspace-map,
	.map-workspace.panel-open .map-workspace-map {
		left: 0;
		width: 100%;
		height: 100%;
	}

	.map-workspace-panel {
		transform: translateX(-100%);
	}

	.map-workspace.panel-open .map-workspace-panel {
		transform: translateX(0);
	}

	.map-workspace.panel-open .map-panel-backdrop {
		position: absolute;
		z-index: 25;
		inset: 0;
		display: block;
		padding: 0;
		background: rgba(15, 23, 42, 0.38);
		border: 0;
	}

	.map-panel-content {
		padding: 20px 20px 16px;
	}

	.map-panel-header {
		min-height: 64px;
	}

	.map-panel-content > h1 {
		font-size: 1.35rem;
	}

	.map-workspace .mapboxgl-ctrl-top-left {
		flex-direction: column;
		align-items: flex-start;
	}

	.map-workspace .mapboxgl-ctrl-top-left .map-panel-toggle {
		order: 1;
	}

	.map-workspace .mapboxgl-ctrl-top-left .map-search-toggle {
		display: inline-flex;
		order: 3;
	}

	.map-workspace .mapboxgl-ctrl-top-left #LabelControl {
		order: 2;
	}

	.map-workspace.panel-open .map-search-toggle {
		display: none;
	}
}
