*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--primary: #0f766e;
	--primary-light: #f0fdfa;
	--primary-mid: #99f6e4;
	--dark: #111827;
	--mid: #374151;
	--muted: #6b7280;
	--faint: #9ca3af;
	--bg: #f8fafc;
	--surface: #ffffff;
	--border: #e5e7eb;
	--border-strong: #d1d5db;
	--green: #10b981;
	--green-light: #ecfdf5;
	--orange: #f59e0b;
	--orange-light: #fffbeb;
	--red: #ef4444;
	--font: "Outfit", system-ui, sans-serif;
	--mono: "JetBrains Mono", monospace;
	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 16px;
	--r-xl: 20px;
	--r-2xl: 24px;
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
	--shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
	--shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.08);
}

html,
body {
	height: 100%;
	font-family: var(--font);
	background: var(--bg);
	color: var(--dark);
	overflow: hidden;
}

#app {
	display: flex;
	height: 100vh;
	width: 100vw;
	position: relative;
}

/* MapLibre overrides */
.maplibregl-ctrl-top-right {
	top: 70px;
	right: 16px;
}
.maplibregl-ctrl-group {
	background: white !important;
	border: 1px solid var(--border) !important;
	border-radius: var(--r-md) !important;
	box-shadow: var(--shadow-md) !important;
}
.maplibregl-ctrl-group button {
	border: none !important;
}
.mapzone-share-ctrl button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	color: var(--dark, #1f2937);
}
.mapzone-share-ctrl svg {
	width: 15px;
	height: 15px;
}
.maplibregl-ctrl-group button:hover {
	background: var(--bg) !important;
}
.maplibregl-ctrl-attrib {
	display: none !important;
}
.maplibregl-popup-content {
	font-family: var(--font) !important;
	border-radius: var(--r-lg) !important;
	box-shadow: var(--shadow-xl) !important;
	padding: 14px 16px !important;
	border: 1px solid var(--border) !important;
	min-width: 200px;
}
.maplibregl-popup-close-button {
	font-size: 16px !important;
	color: var(--muted) !important;
	padding: 6px;
}

/* Sidebar */
#sidebar {
	width: 340px;
	min-width: 340px;
	height: 100vh;
	background: var(--surface);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	position: relative;
	z-index: 30;
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}

#brand {
	padding: 14px 16px 12px;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
	background: var(--surface);
}
.brand-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.brand-left {
	display: flex;
	align-items: center;
	gap: 10px;
}
.brand-name {
	font-size: 16px;
	font-weight: 700;
	color: var(--dark);
	letter-spacing: -0.3px;
}
.brand-name span {
	color: var(--primary);
}
.api-pill {
	display: none;
	align-items: center;
	gap: 5px;
	background: var(--green-light);
	color: var(--green);
	border: 1px solid #a7f3d0;
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
}
.api-pill::before {
	content: "";
	width: 6px;
	height: 6px;
	background: var(--green);
	border-radius: 50%;
	animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.6;
		transform: scale(0.8);
	}
}

#sidebar-scroll {
	flex: 1;
	overflow-y: auto;
}
#sidebar-scroll::-webkit-scrollbar {
	width: 4px;
}
#sidebar-scroll::-webkit-scrollbar-thumb {
	background: var(--border-strong);
	border-radius: 4px;
}

.section {
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
}
.section:last-child {
	border-bottom: none;
}
.section-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--faint);
	margin-bottom: 10px;
}

/* Route inputs */
.route-inputs-wrap {
	position: relative;
}
.route-input-group {
	background: var(--bg);
	border: 1.5px solid var(--border);
	border-radius: var(--r-lg);
	overflow: visible;
	position: relative;
}
.route-input-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 14px;
	position: relative;
}
.route-input-row + .route-input-row {
	border-top: 1px solid var(--border);
}
.route-input-row.attention {
	animation: rowAttention 1.3s ease 2;
}
@keyframes rowAttention {
	0%,
	100% {
		box-shadow: none;
	}
	50% {
		box-shadow: inset 0 0 0 2px var(--primary);
	}
}
.route-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
.route-dot.origin {
	/* Matches the blue origin marker / route line on the map. */
	background: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.route-dot.dest {
	background: var(--red);
	border-radius: 3px;
}
.route-input-field {
	flex: 1;
	border: none;
	background: transparent;
	outline: none;
	font-size: 13.5px;
	font-family: var(--font);
	color: var(--dark);
	font-weight: 500;
}
.route-input-field::placeholder {
	color: var(--faint);
	font-weight: 400;
}
.route-clear-btn {
	width: 22px;
	height: 22px;
	border: 1px solid var(--border);
	background: white;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--faint);
	transition: all 0.15s;
	flex-shrink: 0;
}
.route-clear-btn:hover {
	border-color: var(--red);
	color: var(--red);
}
.route-clear-btn svg {
	width: 10px;
	height: 10px;
}
.route-loc-btn {
	width: 22px;
	height: 22px;
	border: 1px solid var(--border);
	background: white;
	border-radius: 50%;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	color: var(--muted);
	transition: all 0.15s;
	flex-shrink: 0;
}
.route-input-row:hover .route-loc-btn,
.route-input-row:focus-within .route-loc-btn {
	display: flex;
}
.route-loc-btn:hover {
	border-color: var(--primary);
	color: var(--primary);
	background: rgba(15, 118, 110, 0.06);
}
.route-loc-btn svg {
	width: 12px;
	height: 12px;
}
.swap-btn {
	position: absolute;
	right: 78px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	background: white;
	border: 1.5px solid var(--border);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--muted);
	transition: all 0.2s;
	z-index: 2;
	box-shadow: var(--shadow-sm);
}
.swap-btn:hover {
	border-color: var(--primary);
	color: var(--primary);
	transform: translateY(-50%) rotate(180deg);
}
.swap-btn svg {
	width: 13px;
	height: 13px;
}

.dir-action-row {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}
.get-dir-btn-main {
	flex: 1;
	padding: 11px 16px;
	background: linear-gradient(135deg, var(--primary) 0%, #115e59 100%);
	color: white;
	border: none;
	border-radius: var(--r-lg);
	font-size: 13.5px;
	font-weight: 600;
	font-family: var(--font);
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
}
.get-dir-btn-main:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(15, 118, 110, 0.45);
}
.get-dir-btn-main:disabled {
	background: var(--border-strong);
	box-shadow: none;
	cursor: not-allowed;
	color: var(--muted);
}
.get-dir-btn-main svg {
	width: 14px;
	height: 14px;
}
.clear-btn-main {
	padding: 11px 14px;
	border: 1.5px solid var(--border);
	background: white;
	border-radius: var(--r-lg);
	font-size: 13px;
	font-weight: 500;
	font-family: var(--font);
	cursor: pointer;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 5px;
	transition: all 0.15s;
	white-space: nowrap;
}
.clear-btn-main:hover {
	border-color: var(--red);
	color: var(--red);
}
.clear-btn-main svg {
	width: 13px;
	height: 13px;
}

#search-results-origin,
#search-results-dest {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-xl);
	max-height: 240px;
	overflow-y: auto;
	z-index: 100;
	display: none;
}
#search-results-origin.show,
#search-results-dest.show {
	display: contents;
	height: 200px;
	overflow: scroll;
}
.search-result {
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid #f9fafb;
	transition: background 0.12s;
	display: flex;
	gap: 10px;
	align-items: center;
}
.search-result:last-child {
	border-bottom: none;
}
.search-result:hover {
	background: var(--primary-light);
}
.search-result-icon {
	width: 28px;
	height: 28px;
	background: var(--primary-light);
	border-radius: var(--r-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.search-result-icon svg {
	width: 13px;
	height: 13px;
	color: var(--primary);
}
.search-result-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--dark);
}
.search-result-detail {
	font-size: 11px;
	color: var(--muted);
}

/* Travel Mode chips */
.mode-chips-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.mode-chip {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	border: 1.5px solid var(--border);
	border-radius: 999px;
	background: var(--bg);
	font-size: 12px;
	font-weight: 500;
	font-family: var(--font);
	color: var(--muted);
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s;
}
.mode-chip:hover {
	border-color: var(--primary-mid);
	color: var(--primary);
	background: var(--primary-light);
}
.mode-chip.active {
	background: var(--primary);
	color: white;
	border-color: var(--primary);
	box-shadow: 0 3px 10px rgba(15, 118, 110, 0.25);
}
.mode-chip svg {
	width: 13px;
	height: 13px;
}

/* Route Summary Card */
.route-summary-card {
	background: white;
	border: 1.5px solid var(--border);
	border-radius: var(--r-xl);
	overflow: hidden;
}
.route-summary-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px 8px;
}
.route-summary-cities {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--dark);
}
.route-summary-cities svg {
	width: 14px;
	height: 14px;
	color: var(--muted);
}
.fastest-badge {
	background: var(--green-light);
	color: var(--green);
	border: 1px solid #a7f3d0;
	border-radius: 999px;
	padding: 2px 10px;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 4px;
}
.route-summary-stats {
	display: flex;
	gap: 0;
	padding: 0 14px 12px;
}
.summary-stat {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding-right: 16px;
}
.summary-stat + .summary-stat {
	border-left: 1px solid var(--border);
	padding-left: 16px;
	padding-right: 0;
}
.summary-stat-val {
	font-size: 20px;
	font-weight: 700;
	color: var(--primary);
	letter-spacing: -0.5px;
	line-height: 1.1;
}
.summary-stat-val.dark {
	color: var(--dark);
}
.summary-stat-val.muted-color {
	color: var(--muted);
}
.summary-stat-label {
	font-size: 10.5px;
	color: var(--faint);
	font-weight: 400;
}
.route-tags {
	display: flex;
	gap: 6px;
	padding: 0 14px 12px;
	flex-wrap: wrap;
}
.route-tag {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	border: 1.5px solid;
}
.route-tag.tolls {
	background: #fef3c7;
	color: #92400e;
	border-color: #fde68a;
}
.route-tag.traffic {
	background: #fffbeb;
	color: var(--orange);
	border-color: #fde68a;
}
.route-tag.recommended {
	background: var(--primary-light);
	color: var(--primary);
	border-color: var(--primary-mid);
}
.route-progress-bar {
	margin: 0 14px 14px;
	position: relative;
}
.route-progress-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--primary) 0%, var(--red) 100%);
}
.route-progress-ends {
	display: flex;
	justify-content: space-between;
	margin-top: 4px;
	font-size: 10px;
	font-weight: 600;
	color: var(--muted);
}

/* Alternatives */
.alternatives-container {
	background: white;
	border-radius: 16px;
	margin: 12px 0;
	padding: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	border: 1px solid #e5e7eb;
}
.alternatives-header {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e7eb;
	margin-bottom: 10px;
	flex-wrap: wrap;
}
.alternatives-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.alternative-card {
	background: #f9fafb;
	border-radius: 12px;
	padding: 10px 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	border: 1px solid #e5e7eb;
	border-left-width: 4px;
}
.alternative-card:hover {
	transform: translateX(4px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.alternative-card.active {
	background: #eff6ff;
}
.alt-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}
.alt-route-name {
	font-weight: 600;
	font-size: 13px;
	color: #1f2937;
}
.alt-route-time {
	font-weight: 600;
	font-size: 12px;
	color: #011a12;
}
.alt-card-details {
	display: flex;
	gap: 12px;
	font-size: 11px;
	color: #6b7280;
	flex-wrap: wrap;
	align-items: center;
}
.alt-time-diff {
	color: #ef4444;
}
.alt-time-saved {
	color: #10b981;
}
.route-badge {
	font-size: 9px;
	padding: 2px 6px;
	border-radius: 12px;
	margin-left: auto;
}
.route-badge.main {
	/* Labels the blue main route line. */
	background: #2563eb10;
	color: #2563eb;
	border: 1px solid #2563eb30;
}
.route-badge.alt {
	background: #8b5cf610;
	color: #8b5cf6;
	border: 1px dashed #8b5cf6;
}

/* Route comparison */
.route-comparison {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 16px;
	padding: 12px 16px;
	margin: 12px 0;
	color: white;
}
.comparison-stats {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.stat {
	flex: 1;
}
.stat-label {
	font-size: 10px;
	opacity: 0.8;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.stat-value {
	font-size: 13px;
	font-weight: 600;
	display: block;
}
.stat-divider {
	font-size: 12px;
	opacity: 0.6;
}
.savings-badge {
	background: rgba(255, 255, 255, 0.2);
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}
.comparison-footer {
	font-size: 10px;
	text-align: center;
	margin-top: 8px;
	padding-top: 6px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading shimmer */
.alternatives-loading {
	text-align: center;
	padding: 20px;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: loading-shimmer 1.5s infinite;
	border-radius: 12px;
	color: #666;
	font-size: 13px;
}
@keyframes loading-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Recents */
.empty-state {
	padding: 24px 16px;
	text-align: center;
	color: var(--faint);
}
.empty-state svg {
	width: 28px;
	height: 28px;
	color: var(--border-strong);
	margin-bottom: 8px;
}
.empty-state p {
	font-size: 12.5px;
}
.recent-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 8px;
	border-radius: var(--r-md);
	cursor: pointer;
	transition: background 0.15s;
	margin-bottom: 2px;
}
.recent-item:hover {
	background: var(--bg);
}
.recent-item-icon {
	width: 28px;
	height: 28px;
	background: var(--primary-light);
	border-radius: var(--r-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.recent-item-icon svg {
	width: 12px;
	height: 12px;
	color: var(--primary);
}
.recent-item-name {
	flex: 1;
	font-size: 12.5px;
	color: var(--dark);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.recent-item-actions {
	display: flex;
	gap: 3px;
	opacity: 0;
	transition: opacity 0.15s;
}
.recent-item:hover .recent-item-actions {
	opacity: 1;
}
.recent-item-actions button {
	width: 24px;
	height: 24px;
	border: 1px solid var(--border);
	background: white;
	border-radius: var(--r-sm);
	cursor: pointer;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s;
}
.recent-item-actions button:hover {
	border-color: var(--primary);
	color: var(--primary);
}
.recent-item-actions .recent-del-btn:hover {
	border-color: var(--red);
	color: var(--red);
}

/* Recent header with "Clear all" */
.recent-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.recent-clear-all {
	border: none;
	background: none;
	padding: 2px 4px;
	font-family: var(--font);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.2px;
	text-transform: none;
	color: var(--muted);
	cursor: pointer;
	border-radius: var(--r-sm);
	transition: color 0.15s;
}
.recent-clear-all:hover {
	color: var(--red);
}

/* Map area */
#map-area {
	flex: 1;
	position: relative;
	overflow: hidden;
}
#map {
	width: 100%;
	height: 100%;
}

/* #map-long-press-indicator {
  position: absolute;
  z-index: 30;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.25));
} */
/* #map-long-press-indicator svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
} */
/* #map-long-press-indicator circle {
  fill: rgba(255, 255, 255, 0.92);
  stroke-width: 3;
} */
/* #map-long-press-indicator .long-press-track {
  stroke: rgba(15, 118, 110, 0.22);
} */
/* #map-long-press-indicator .long-press-progress {
  fill: transparent;
  stroke: #0f766e;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 100.53;
  animation: map-long-press-progress 4s linear forwards;
}
#map-long-press-indicator span {
  position: relative;
  color: #1e3a8a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  user-select: none;
}
@keyframes map-long-press-progress {
  to { stroke-dashoffset: 0; }
} */

.map-brand-watermark {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 10;
	width: clamp(130px, 12vw, 190px);
	height: auto;
	transform: translateX(-50%);
	opacity: 0.2;
	filter: grayscale(1);
	pointer-events: none;
	user-select: none;
}

#map-search {
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	width: 440px;
	max-width: calc(100% - 32px);
}
.map-search-inner {
	display: flex;
	align-items: center;
	gap: 10px;
	background: white;
	border-radius: 999px;
	padding: 10px 16px 10px 14px;
	box-shadow: var(--shadow-xl);
	border: 1px solid var(--border);
	transition: box-shadow 0.2s;
}
.map-search-inner:focus-within {
	box-shadow:
		var(--shadow-xl),
		0 0 0 3px rgba(15, 118, 110, 0.12);
}
.map-search-inner svg {
	width: 15px;
	height: 15px;
	color: var(--muted);
	flex-shrink: 0;
}
#map-search-input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 13.5px;
	font-family: var(--font);
	color: var(--dark);
	background: transparent;
	font-weight: 400;
}
#map-search-input::placeholder {
	color: var(--faint);
}
.kbd {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: 2px 6px;
	font-size: 11px;
	color: var(--muted);
	font-family: var(--mono);
	flex-shrink: 0;
}

#search-area-btn {
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 6px;
	background: white;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 7px 16px;
	font-size: 12.5px;
	font-weight: 600;
	font-family: var(--font);
	color: var(--dark);
	cursor: pointer;
	box-shadow: var(--shadow-md);
	transition: all 0.15s;
	white-space: nowrap;
}
#search-area-btn:hover {
	border-color: var(--primary);
	color: var(--primary);
}
#search-area-btn svg {
	width: 13px;
	height: 13px;
}

#map-search-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-xl);
	max-height: 240px;
	overflow-y: auto;
	z-index: 100;
	display: none;
}
#map-search-results.show {
	display: block;
}
.map-search-result {
	padding: 10px 16px;
	cursor: pointer;
	border-bottom: 1px solid #f9fafb;
	transition: background 0.12s;
	display: flex;
	gap: 10px;
	align-items: center;
}
.map-search-result:last-child {
	border-bottom: none;
}
.map-search-result:hover {
	background: var(--primary-light);
}
.map-search-result-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--dark);
}
.map-search-result-detail {
	font-size: 11px;
	color: var(--muted);
	margin-top: 1px;
}

/* Analytics card */
#analytics-card {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 10;
	background: white;
	border-radius: var(--r-xl);
	padding: 14px 16px;
	box-shadow: var(--shadow-lg);
	border: 1px solid var(--border);
	min-width: 190px;
	display: none;
}
.analytics-header {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	color: var(--faint);
	margin-bottom: 10px;
}
.analytics-header svg {
	width: 11px;
	height: 11px;
	color: var(--primary);
}
.analytics-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}
.analytics-row:last-child {
	margin-bottom: 0;
}
.analytics-label {
	font-size: 11.5px;
	color: var(--muted);
}
.analytics-val {
	font-size: 12px;
	font-weight: 700;
	color: var(--dark);
	font-family: var(--mono);
}
.analytics-val.green {
	color: var(--green);
}
.analytics-val.blue {
	color: var(--primary);
}
.analytics-mini-bar {
	height: 3px;
	background: var(--border);
	border-radius: 2px;
	margin-top: 10px;
	overflow: hidden;
}
.analytics-mini-fill {
	height: 100%;
	width: 99.98%;
	background: linear-gradient(90deg, var(--green), #34d399);
	border-radius: 2px;
}

/* Layer switcher */
#layers {
	position: absolute;
	bottom: 10px;
	left: 20px;
	background: white;
	padding: 8px 13px;
	border-radius: 12px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	z-index: 10;
	display: flex;
	align-items: center;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: #7f8387;
	user-select: none;
}
#layers img {
	width: 42px;
	height: 42px;
	border-radius: 8px;
	object-fit: cover;
	border: 2px solid #dadce0;
}
#layers-menu {
	position: absolute;
	bottom: 90px;
	left: 20px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	z-index: 11;
	min-width: 80px;
	display: none;
	border: 1px solid #dadce0;
	overflow: hidden;
}
#layers-menu.show {
	display: block;
}
.layer-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 10px 12px;
	cursor: pointer;
	border-bottom: 1px solid #f1f3f4;
	transition: background 0.2s;
}
.layer-option:last-child {
	border-bottom: none;
}
.layer-option:hover {
	background: #f8f9fa;
}
.layer-preview {
	width: 42px;
	height: 42px;
	border-radius: 8px;
	object-fit: cover;
	border: 2px solid #dadce0;
	transition: border-color 0.2s;
	display: block;
}
.layer-option:hover .layer-preview,
.layer-option.active .layer-preview {
	border-color: #78b4f3;
}
.layer-label {
	font-size: 11px;
	color: #7f8387;
	transition: color 0.2s;
	text-align: center;
}
.layer-option:hover .layer-label,
.layer-option.active .layer-label {
	color: #78b4f3;
}

/* Bottom bar */
#route-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: none;
	padding: 12px 20px;
	display: flex;
	align-items: center;
	gap: 0;
}
.route-bar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}
.btn-share {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: var(--r-lg);
	font-size: 13px;
	font-weight: 600;
	font-family: var(--font);
	cursor: pointer;
	box-shadow: 0 3px 10px rgba(15, 118, 110, 0.3);
	transition: all 0.2s;
}
.btn-share:hover {
	transform: translateY(-1px);
	box-shadow: 0 5px 16px rgba(15, 118, 110, 0.4);
}
.btn-share svg {
	width: 13px;
	height: 13px;
}

.share-modal {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.share-modal.open {
	display: flex;
}
.share-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.38);
}
.share-modal-panel {
	position: relative;
	width: min(420px, 100%);
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-xl);
	padding: 18px;
}
.share-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: white;
	color: var(--muted);
	cursor: pointer;
}
.share-modal-close svg {
	width: 14px;
	height: 14px;
}
.share-modal-title {
	font-size: 15px;
	font-weight: 700;
	margin-bottom: 14px;
}
.share-modal-row {
	display: flex;
	gap: 8px;
}
.share-modal-row input {
	flex: 1;
	min-width: 0;
	height: 38px;
	border: 1px solid var(--border);
	border-radius: var(--r-sm);
	padding: 0 10px;
	color: var(--mid);
	font-family: var(--font);
	font-size: 13px;
}
.share-modal-row button {
	height: 38px;
	border: none;
	border-radius: var(--r-sm);
	background: var(--primary);
	color: white;
	padding: 0 14px;
	font-weight: 700;
	cursor: pointer;
}

/* Toast */
/* Snackbar (Google Maps style): bottom of the map area, out of the way of
   the Map Style and Share controls, never over the map center. */
#toast {
	position: fixed;
	bottom: 24px;
	/* Center over the map area, not the viewport (sidebar is 340px). */
	left: calc(50% + 170px);
	transform: translateX(-50%) translateY(8px);
	background: #1f2430;
	color: #f3f4f6;
	padding: 11px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.1px;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		visibility 0.2s;
	pointer-events: none;
	white-space: nowrap;
	/* Fixed + left:50% halves the shrink-to-fit space; size to content. */
	width: max-content;
	max-width: min(420px, calc(100vw - 400px));
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow:
		0 3px 10px rgba(0, 0, 0, 0.25),
		0 1px 3px rgba(0, 0, 0, 0.2);
}
#toast.show {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* Spinner */
.spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Popup */
.mz-popup .maplibregl-popup-content {
	padding: 14px 16px !important;
	border-radius: var(--r-lg) !important;
}
.popup-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--dark);
	margin-bottom: 3px;
}
.popup-coord {
	font-size: 11px;
	color: var(--muted);
	font-family: var(--mono);
	margin-bottom: 12px;
}
.popup-btns {
	display: flex;
	gap: 6px;
}
.popup-btn {
	flex: 1;
	padding: 8px 10px;
	border: none;
	border-radius: var(--r-md);
	font-size: 12px;
	font-weight: 600;
	font-family: var(--font);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	transition: all 0.15s;
}
.popup-btn.primary {
	background: var(--primary);
	color: white;
}
.popup-btn.primary:hover {
	background: #115e59;
}
.popup-btn.secondary {
	background: var(--bg);
	color: var(--dark);
	border: 1px solid var(--border);
}
.popup-btn.secondary:hover {
	border-color: var(--primary);
	color: var(--primary);
}

/* Turn by turn */
.dir-step {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 9px 0;
	border-bottom: 1px solid #f9fafb;
}
.dir-step:last-child {
	border-bottom: none;
}
.dir-step-icon {
	width: 30px;
	height: 30px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--r-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	flex-shrink: 0;
}
.dir-step-text {
	flex: 1;
	font-size: 12px;
	color: var(--dark);
	line-height: 1.5;
	font-weight: 500;
}
.dir-step-dist {
	color: var(--primary);
	font-size: 10.5px;
	font-weight: 600;
	font-family: var(--mono);
	margin-left: 5px;
}

/* Markers */
.origin-marker-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	transform: translateY(-6px);
	cursor: pointer;
	position: relative;
	animation: pinDrop 0.5s ease; /* ← wrapper par */
}
.origin-label {
	background: #2563eb;
	color: white;
	transition: background 0.4s ease;
	color: white;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 8px;
	margin-bottom: 6px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	animation: fadeSlide 0.4s ease;
	white-space: nowrap;
	max-width: 150px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.origin-dot {
	width: 20px;

	height: 20px;

	background: #0f766e;

	border-radius: 50%;

	border: 4px solid white;

	position: relative; /* ← YEH ADD KARO */

	box-shadow: 0 3px 10px rgba(15, 118, 110, 0.5);

	animation: pinDrop 0.5s ease;

	display: flex;

	align-items: center;

	justify-content: center;
}
.origin-inner {
	width: 6px;
	height: 6px;
	background: white;
	border-radius: 50%;
	flex-shrink: 0;
	/* position/top/left/transform ← HATAO */
}
.origin-pulse {
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: rgba(15, 118, 110, 0.35);
	animation: pulseRing 1.8s infinite;
	z-index: -1;
}
@keyframes pulseRing {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	70% {
		transform: scale(2.2);
		opacity: 0;
	}
	100% {
		opacity: 0;
	}
}

.dest-marker-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.dest-marker-wrapper::after {
	content: "";
	display: block;
	width: 4px;
	height: 4px;
	background: red;
	border-radius: 50%;
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
}

.dest-marker-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.dest-pin {
	/* Make sure pin tip is at the very bottom */
	display: flex;
	justify-content: center;
}
.dest-label {
	margin-bottom: 4px;
	background: #ef4444;
	color: white;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 8px;
	margin-bottom: 6px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	animation: fadeSlide 0.4s ease;
	white-space: nowrap;
	max-width: 150px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.dest-pin {
	width: 20px;
	height: 20px;
	background: #ef4444;
	border-radius: 50%;
	border: 4px solid white;
	box-shadow: 0 3px 10px rgba(239, 68, 68, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.35s ease,
		box-shadow 0.35s ease;
	/* animation: pinDrop ← HATAO */
}

.dest-pin .pin-inner {
	width: 6px;
	height: 6px;
	background: white;
	border-radius: 50%;
	/* position/top/left/transform HATAO — flex se center ho jayega */
}
.dest-pin .pin-inner {
	width: 6px;
	height: 6px;
	background: white;
	border-radius: 50%;
}

@keyframes pinDrop {
	0% {
		transform: translateY(-200px) scale(0.8);
		opacity: 0;
	}
	60% {
		transform: translateY(10px) scale(1.05);
		opacity: 1;
	}
	80% {
		transform: translateY(-5px);
	}
	100% {
		transform: translateY(0);
	}
}

@keyframes fadeSlide {
	0% {
		opacity: 0;
		transform: translateY(-10px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

.ripple {
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
	transform: scale(0);
	animation: ripple-animation 0.6s linear;
	pointer-events: none;
}
@keyframes ripple-animation {
	to {
		transform: scale(2.5);
		opacity: 0;
	}
}

/* Anim */
.anim-in {
	animation: slide-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.anim-in:nth-child(1) {
	animation-delay: 0.05s;
}
.anim-in:nth-child(2) {
	animation-delay: 0.1s;
}
.anim-in:nth-child(3) {
	animation-delay: 0.15s;
}
.anim-in:nth-child(4) {
	animation-delay: 0.2s;
}
@keyframes slide-in {
	from {
		opacity: 0;
		transform: translateX(-12px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Travel mode indicator */
.mode-indicator {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--primary-light);
	color: var(--primary);
	border: 1px solid var(--primary-mid);
	border-radius: 999px;
	padding: 2px 8px;
	font-size: 10px;
	font-weight: 700;
	margin-left: auto;
}

.brand-logo {
	width: 150px;
	margin-left: 40%;
}
.quick-filters {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.quick-filters button {
	background: white;
	border: 1px solid #e5e7eb;
	padding: 6px 10px;
	border-radius: 20px;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.quick-filters button:hover {
	background: #0f766e;
	color: white;
	border-color: #0f766e;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MapZone Routes
   Add these overrides at the BOTTOM of your
   existing CSS file.
═══════════════════════════════════════════ */

/* ── Shared mobile/tablet toggle button ── */
#sidebar-toggle {
	display: none;
	position: fixed;
	top: 7px;
	left: 12px;
	z-index: 200;
	width: 42px;
	height: 42px;
	background: var(--surface);
	border: 1.5px solid var(--border);
	border-radius: var(--r-md);
	box-shadow: var(--shadow-md);
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--dark);
	flex-shrink: 0;
}
#sidebar-toggle svg {
	width: 18px;
	height: 18px;
}

/* ── Sidebar overlay backdrop ── */
#sidebar-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 29;
	backdrop-filter: blur(2px);
}
#sidebar-overlay.visible {
	display: block;
}

/* ═══════════════════════════════════════════
   TABLET  (641px – 1024px)
═══════════════════════════════════════════ */
@media (max-width: 1024px) and (min-width: 641px) {
	.brand-left {
		display: flex;
		align-items: center;
		gap: 10px;
		margin-left: 30%;
	}

	#sidebar {
		width: 300px;
		min-width: 300px;
	}

	/* Keep the snackbar centered over the narrower map area. */
	#toast {
		left: calc(50% + 150px);
		max-width: min(420px, calc(100vw - 360px));
	}

	#map-search {
		width: 360px;
	}

	.route-summary-stats {
		gap: 0;
	}

	.summary-stat-val {
		font-size: 17px;
	}

	.mode-chips-wrap {
		gap: 5px;
	}

	.mode-chip {
		padding: 5px 10px;
		font-size: 11.5px;
	}

	.brand-logo {
		width: 110px;
		margin-left: 0;
	}
}

/* ═══════════════════════════════════════════
   MOBILE  (≤ 640px)
═══════════════════════════════════════════ */
@media (max-width: 640px) {
	/* Inputs under 16px trigger mobile browsers' focus auto-zoom; keep every
	   text input at 16px on phones so tapping a field never zooms the page. */
	#map-search-input,
	.route-input-field,
	input[type="text"],
	input[type="search"] {
		font-size: 16px;
	}

	.brand-left {
		display: flex;
		align-items: center;
		gap: 10px;
		margin-left: 30%;
	}

	/* App shell — stack vertically */
	#app {
		flex-direction: column;
	}

	/* Show toggle button */
	#sidebar-toggle {
		display: flex;
	}

	/* ── Sidebar becomes a drawer ── */
	#sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 88vw;
		max-width: 340px;
		min-width: 0;
		height: 100dvh;
		z-index: 100;
		transform: translateX(-110%);
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		box-shadow: var(--shadow-xl);
	}

	#sidebar.open {
		transform: translateX(0);
	}

	/* ── Map fills full screen ── */
	#map-area {
		width: 100vw;
		height: 100dvh;
		flex: none;
	}

	/* ── Floating search — full width ── */
	#map-search {
		top: 8px;
		left: 60px; /* clear the toggle button */
		right: 8px;
		width: auto;
		max-width: none;
		transform: none;
	}

	.map-search-inner {
		padding: 9px 12px;
		border-radius: var(--r-lg);
	}

	.kbd {
		display: none; /* hide keyboard hint on mobile */
	}

	#search-area-btn {
		font-size: 11.5px;
		padding: 6px 12px;
	}

	/* ── Layer switcher — smaller ── */
	#layers {
		bottom: 10px;
		left: 10px;
		padding: 6px 10px;
		font-size: 11px;
	}

	#layers img,
	#active-layer-preview {
		width: 34px;
		height: 34px;
	}

	#layers-menu {
		bottom: 90px;
		left: 10px;
	}

	.layer-preview {
		width: 34px;
		height: 34px;
	}

	/* ── Bottom share bar ── */
	#route-bar {
		padding: 10px 14px;
		/* background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border); */
	}

	.btn-share {
		font-size: 12px;
		padding: 8px 14px;
	}

	/* ── Snackbar — bottom-center above the bottom bar, safe-area aware ── */
	#toast {
		bottom: calc(72px + env(safe-area-inset-bottom, 0px));
		left: 50%;
		font-size: 12.5px;
		padding: 10px 14px;
		max-width: calc(100vw - 24px);
		white-space: normal;
		text-align: center;
		border-radius: 8px;
	}

	/* ── Brand logo ── */
	.brand-logo {
		width: 100px;
		margin-left: 0;
	}

	/* ── Mode chips — 2 per row ── */
	.mode-chips-wrap {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 5px;
	}

	.mode-chip {
		padding: 6px 4px;
		font-size: 11px;
		justify-content: center;
		flex-direction: column;
		gap: 3px;
		text-align: center;
	}

	/* ── Route summary stats — condensed ── */
	.summary-stat-val {
		font-size: 16px;
	}

	.summary-stat + .summary-stat {
		padding-left: 10px;
	}

	.summary-stat {
		padding-right: 10px;
	}

	/* ── Alt cards — tighter ── */
	.alternative-card {
		padding: 8px 10px;
	}

	.alt-route-name {
		font-size: 12px;
	}

	/* ── Popup — prevent overflow ── */
	.maplibregl-popup-content {
		max-width: 230px !important;
	}

	/* ── Dir steps ── */
	.dir-step-text {
		font-size: 11.5px;
	}

	/* ── Quick filters ── */
	.quick-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 4px;
	}

	.quick-filters::-webkit-scrollbar {
		display: none;
	}

	.quick-filters button {
		flex-shrink: 0;
	}

	/* ── MapLibre controls — offset for toggle button ── */
	.maplibregl-ctrl-top-right {
		top: 60px;
		right: 10px;
	}
}

/* ═══════════════════════════════════════════
   VERY SMALL PHONES  (≤ 380px)
═══════════════════════════════════════════ */
@media (max-width: 380px) {
	#sidebar {
		width: 94vw;
	}

	.mode-chips-wrap {
		grid-template-columns: repeat(4, 1fr);
	}

	.mode-chip {
		font-size: 10px;
	}

	.mode-chip svg {
		width: 11px;
		height: 11px;
	}

	.summary-stat-val {
		font-size: 14px;
	}

	.route-summary-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
}

/* Make route click popup look premium */
.route-click-popup .maplibregl-popup-content {
	padding: 14px 16px !important;
	border-radius: 14px !important;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.18),
		0 2px 8px rgba(0, 0, 0, 0.08) !important;
	border: 1px solid #e5e7eb !important;
	min-width: 240px;
}

/* Remove default tip/arrow on route popup */
.route-click-popup .maplibregl-popup-tip {
	border-top-color: #ffffff !important;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

/* ── Active alternative card — stronger highlight ── */
.alternative-card.active {
	background: #eff6ff !important;
	border-color: #93c5fd !important;
	box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

/* ── Route line hover cursor ── */
.maplibregl-canvas-container canvas {
	cursor: crosshair;
}

.origin-label {
	transition: background 0.35s ease;
}

.origin-dot {
	width: 20px;
	height: 20px;
	background: #2563eb;
	border-radius: 50%;
	border: 4px solid white;
	position: relative;
	box-shadow: 0 3px 10px rgba(37, 99, 235, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.35s ease,
		box-shadow 0.35s ease;
	/* animation: pinDrop ← HATAO */
}

.origin-pulse {
	transition: background 0.35s ease;
}

.dest-label {
	transition: background 0.35s ease;
}

.dest-pin {
	transition:
		background 0.35s ease,
		box-shadow 0.35s ease;
}
/* Navigation arrow marker */
.nav-arrow-wrap {
	filter: drop-shadow(0 3px 6px rgba(15, 118, 110, 0.6));
	transition: transform 0.3s ease;
}

#nav-arrow {
	transition: transform 0.4s ease;
}
