/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}


/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #ddd;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #0078A8;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	}
.leaflet-bar a {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: black;
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #f4f4f4;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: #fff;
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: #333;
	background: #fff;
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: #333;
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #777;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(255, 255, 255, 0.8);
	text-shadow: 1px 1px #fff;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #777;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #777;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: white;
	color: #333;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid #999;
	}


/* div icon */

.leaflet-div-icon {
	background: #fff;
	border: 1px solid #666;
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: #fff;
	border: 1px solid #fff;
	border-radius: 3px;
	color: #222;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: #fff;
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: #fff;
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: #fff;
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: #fff;
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  --bg: #0b1220;
  --panel: #111827;
  --surface: rgba(15, 23, 42, 0.94);
  --border: #1f2937;
  --border-strong: #31415a;
  --accent: #f3ac54;
  --accent-hover: #f7bd75;
  --accent-ink: #0b1220;
  --danger: #f87171;
  --muted: #94a3b8;
  --text: #e5e7eb;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

  --control-h: 40px;        /* every header control lines up on this height */
  --map-gutter: 16px;       /* inset between the map edge and its own frame */
  --map-inset: 12px;        /* inset between the map edge and floating controls */
  --dock-h: 0px;            /* mobile only: height reserved for the tool dock */
  --sheet-peek-h: 56px;     /* mobile only: the info panel's collapsed bar */
  --sheet-gap: 8px;         /* mobile only: between that bar and the dock */
  --sheet-peek: 0px;        /* mobile only: room the bar takes, 0 while hidden */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   App shell

   The map screen has to fill the viewport exactly: header, then map, with no
   page scroll and no dead strip underneath. Content pages (help, gallery,
   landing) share the same shell but grow past it and scroll normally, so the
   shell sets a *minimum* height and the map claims the leftover with flex
   rather than guessing at `calc(100vh - <header>)`.

   100dvh, not 100vh: on mobile 100vh is the viewport at its tallest, which is
   what pushed the bottom of the map behind the browser chrome.
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 10% 20%, rgba(243, 172, 84, 0.14), transparent 25%),
              radial-gradient(circle at 90% 10%, rgba(243, 172, 84, 0.12), transparent 20%),
              var(--bg);
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;   /* lets the map shrink to fit instead of overflowing */
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;   /* above every Leaflet control, below the save modal */
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* The map screen runs edge to edge, so its header does too: the logo lines
   up with the panel below it instead of floating in a centred column. */
.site-header--app .header-inner {
  max-width: none;
  padding-inline: calc(var(--map-gutter) + 4px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
}

.brand-mark {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.saved-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.brand-mark--icon {
  height: 36px;
  border-radius: 9px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* One recipe for every header control, so they all line up and share states. */
.hbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hbtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  color: #fff;
}

.hbtn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hbtn--icon {
  width: var(--control-h);
  padding: 0;
}

/* The page links: present, but quieter than the search beside them. */
.hbtn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.hbtn--quiet:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
}

.hbtn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-strong);
}

/* Place search ------------------------------------------------------------ */

.place-search {
  position: relative;
  flex: 1;
  max-width: 520px;
  min-width: 0;
  margin: 0 auto;
}

.place-search-input {
  width: 100%;
  height: var(--control-h);
  padding: 0 40px 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* anything smaller makes iOS zoom the page on focus */
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.place-search-input::placeholder {
  color: var(--muted);
}

.place-search-input:hover {
  border-color: var(--border-strong);
}

.place-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(243, 172, 84, 0.15);
}

.place-search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  display: grid;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.place-search-icon svg {
  width: 18px;
  height: 18px;
}

.place-search-clear {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
}

.place-search-clear:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.place-search-clear svg {
  width: 16px;
  height: 16px;
}

.place-search-spinner {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(243, 172, 84, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.place-search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(360px, 60vh);
  overflow-y: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.12s ease-out;
}

.place-search-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.place-search-panel li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.place-search-panel li.is-highlighted {
  background: rgba(255, 255, 255, 0.07);
}

.place-search-panel li svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  color: var(--accent);
}

.place-search-panel li span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.place-search-panel li strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.place-search-panel li small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.place-search-state {
  margin: 0;
  padding: 12px 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* The name of a searched place, over its pin. */
.leaflet-tooltip.place-tooltip {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.leaflet-tooltip.place-tooltip::before {
  border-top-color: var(--panel);
}

/* Header overflow menu (mobile) ------------------------------------------- */

.header-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(2, 6, 15, 0.45);
}

.header-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  width: min(260px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--control-h) - 40px);
  overflow-y: auto;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.16s ease-out;
}

.header-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.header-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}

/* ==========================================================================
   Map
   ========================================================================== */

/* The map and, on desktop, the info panel side by side. The panel is a real
   column rather than a card floated over the map, so it never hides part of
   the map or collides with Leaflet's own controls. */
.map-shell {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  gap: var(--map-gutter);
  padding: var(--map-gutter);
}

/* Everything that floats over the map is positioned against this box. It is
   also a size container, so the floating pieces can react to the map's own
   width -- which the panel beside it changes -- rather than the window's. */
.map-stage {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  container-type: inline-size;
}

/* A narrow map on a desktop layout (small laptop, tablet, or the panel open):
   centred, the hint would run into the tool rail. Pin it between the rail
   and the zoom buttons instead. Phones are left alone: their tools sit in the
   bottom dock, so the top is clear. */
@media (min-width: 769px) {
  @container (max-width: 760px) {
    /* `.map-stage` prefix: the base rule comes later in this file. */
    .map-stage .map-hint {
      left: 162px;   /* tool rail (~142px from the map edge) plus a gap */
      right: 64px;   /* zoom column (40px) plus its inset and a gap */
      width: auto;
      max-width: none;
      transform: none;
    }
  }
}

/* The map stretches to the shell rather than taking `height: 100%`: the
   shell's own height comes from flex, which a percentage can't resolve
   against, and Leaflet clips everything inside a zero-height container. */
.leaflet-container {
  flex: 1;
  min-width: 0;
  background: #0f172a;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: 1px solid transparent;
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.button:hover {
  background: var(--accent-hover);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 12px;
  background: var(--accent);
  border: 1px solid transparent;
  color: #0b1220;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 8px 24px rgba(243, 172, 84, 0.4);
}

.cta-button:hover {
  box-shadow: 0 12px 32px rgba(243, 172, 84, 0.5);
  background: #e89c3a;
  color: #0b1220;
}

.cta-button svg {
  transition: none;
}

.link-quiet {
  color: var(--muted);
}

.link-quiet:hover {
  color: #fff;
}

.link-inline {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  transition: text-decoration-color 0.2s ease;
}

.link-inline:hover {
  text-decoration-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

/* ==========================================================================
   Leaflet chrome

   Everything Leaflet or one of the measure plugins renders inside the map:
   the corner stacks, zoom/locate, and the attribution.
   ========================================================================== */

/* The measurement tools live in the React dock (.map-toolbar) instead of this
   corner, so that they can carry labels and sit within thumb reach on a phone.
   The plugin controls stay mounted and keep their own state — they are just
   not the thing the user clicks. Nothing else is added to the top-left corner. */
.leaflet-top.leaflet-left {
  display: none;
}

.leaflet-top,
.leaflet-bottom {
  z-index: 600;
}

.leaflet-top.leaflet-right {
  top: var(--map-inset);
  right: var(--map-inset);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.leaflet-top.leaflet-right .leaflet-control {
  margin: 0;
}

.leaflet-control {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* Zoom + locate ------------------------------------------------------------ */

/* Matching `.leaflet-touch .leaflet-bar a`, which would otherwise pin every
   control back to its 30px touch default. */
.leaflet-container .leaflet-bar a,
.leaflet-container .leaflet-bar a:hover {
  width: 40px;
  height: 40px;
  line-height: 40px;
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.leaflet-container .leaflet-bar a:last-child {
  border-bottom: none;
}

.leaflet-container .leaflet-bar a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.leaflet-control-zoom a {
  font-size: 1.35rem;
  font-weight: 400;
}

.leaflet-control-locate a {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Ccircle cx='12' cy='12' r='2.5' fill='%23e5e7eb' stroke='none'/%3E%3Cline x1='12' y1='1.5' x2='12' y2='5'/%3E%3Cline x1='12' y1='19' x2='12' y2='22.5'/%3E%3Cline x1='1.5' y1='12' x2='5' y2='12'/%3E%3Cline x1='19' y1='12' x2='22.5' y2='12'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
}

/* The plugin draws its own icon with ::before/::after. */
.leaflet-control-locate a::before,
.leaflet-control-locate a::after {
  display: none !important;
  content: none !important;
}

.leaflet-control-locate a.active {
  background-color: rgba(243, 172, 84, 0.2) !important;
}

/* Attribution -------------------------------------------------------------- */

.leaflet-container .leaflet-control-attribution {
  margin: 0;
  padding: 3px 8px;
  border: none;
  border-radius: 8px 0 0 0;
  background: rgba(11, 18, 32, 0.8);
  color: var(--muted);
  font-size: 0.68rem;
  box-shadow: none;
  backdrop-filter: none;
}

.leaflet-container .leaflet-control-attribution a {
  color: var(--muted);
  text-decoration: underline;
}

/* ==========================================================================
   Measurement tool dock

   Replaces the four unlabeled icon buttons the plugins used to stack in the
   map's top-left corner. Desktop gets a labeled rail; phones get a dock along
   the bottom edge, where a thumb actually reaches.
   ========================================================================== */

.map-toolbar {
  position: absolute;
  z-index: 700;
  top: var(--map-inset);
  left: var(--map-inset);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.map-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px 0 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.map-tool:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.map-tool svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.map-tool.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* What to do with the tool that was just picked. It sits at the top: the
   bottom of the map belongs to the dock, the zoom column and the attribution. */
.map-hint {
  position: absolute;
  z-index: 690;
  top: var(--map-inset);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(460px, calc(100% - 2 * var(--map-inset)));
  margin: 0;
  padding: 10px 16px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  animation: fadeIn 0.25s ease-out;
}

.map-hint strong {
  color: var(--text);
  font-weight: 600;
}

/* ==========================================================================
   Measurement info panel

   Desktop: a column to the left of the map that folds to a slim rail. Phones:
   a bottom sheet above the tool dock (see the responsive section). It holds
   everything done with the measurements -- save, export, import, units,
   clear -- so the header and the map stay free of it. Map labels keep only
   the headline number; the breakdown lives here.
   ========================================================================== */

.mpanel {
  --mpanel-w: clamp(320px, 27vw, 380px);
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  color: var(--text);
  overflow: hidden;
  container-type: inline-size;
}

/* `contain: size` stops a long list from adding to the page's height: the
   shell only has a *minimum* height, so otherwise the panel would push the
   whole map screen past the viewport and make the page scroll. The panel
   takes the map's height from the flex row and scrolls inside instead. */
.mpanel--side,
.mpanel--rail {
  contain: size;
}

.mpanel--side {
  width: var(--mpanel-w);
  animation: mpanel-in 0.2s ease-out;
}

/* It slides in from the left edge it is anchored to. */
@keyframes mpanel-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

.mpanel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* Folded: a slim rail that keeps the count in sight. */
.mpanel--rail {
  width: 56px;
}

.mpanel-rail-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex: 1;
  padding: 16px 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.mpanel-rail-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.mpanel-rail-button > svg {
  width: 22px;
  height: 22px;
}

.mpanel-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.mpanel-rail-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Heading ---------------------------------------------------------------- */

.mpanel-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 10px 0 18px;
}

.mpanel-heading {
  flex: 1;
  min-width: 0;
}

.mpanel-kicker {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
}

.mpanel-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.mpanel-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.mpanel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mpanel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mpanel-chip:hover {
  border-color: var(--accent);
  background: rgba(243, 172, 84, 0.1);
}

.mpanel-chip svg {
  width: 14px;
  height: 14px;
}

.mpanel-chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.mpanel-chip--danger {
  color: var(--muted);
}

.mpanel-chip--danger:hover:not(:disabled),
.mpanel-chip--danger.is-confirming {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.mpanel-dirty,
.mpanel-error {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.mpanel-dirty {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-weight: 600;
}

.mpanel-dirty::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.mpanel-error {
  color: var(--danger);
}

.mpanel-icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mpanel-icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.mpanel-icon-button svg {
  width: 20px;
  height: 20px;
}

/* Renaming in place --------------------------------------------------------
   Used by the map's title and every card's. The pencil waits beside the name
   until the pointer is over it (or it has keyboard focus); touch screens have
   no hover, so there it always shows. */

.inline-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.inline-title-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inline-title-edit {
  position: relative;
  z-index: 2;   /* above a card's show-on-map button */
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.inline-title-edit svg {
  width: 14px;
  height: 14px;
}

.inline-title:hover .inline-title-edit,
.inline-title:focus-within .inline-title-edit,
.mcard-head:hover .inline-title-edit {
  opacity: 1;
}

.inline-title-edit:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

@media (hover: none) {
  .inline-title-edit {
    opacity: 0.75;
  }
}

.inline-title-input {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* anything smaller makes iOS zoom the page on focus */
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(243, 172, 84, 0.15);
}

.inline-title-input:focus {
  outline: none;
}

.inline-title-input.mpanel-title {
  font-size: 1.05rem;
  font-weight: 700;
}

/* Save / Export / Import --------------------------------------------------- */

.mpanel-actions {
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--border);
}

.mpanel-actions-row {
  display: flex;
  gap: 6px;
}

.mpanel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  gap: 7px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.mpanel-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mpanel-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: #46597a;
}

.mpanel-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--muted);
}

.mpanel-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.mpanel-btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.mpanel-btn--primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

/* Unsaved changes on a saved map. */
.mpanel-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-ink);
}

/* Nothing to save yet: a plain outline, not a faded orange. */
.mpanel-btn--primary:disabled {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text);
}

.mpanel-export {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  animation: fadeIn 0.15s ease-out;
}

.mpanel-format {
  flex: 1 1 auto;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mpanel-format:hover {
  border-color: var(--accent);
  background: rgba(243, 172, 84, 0.1);
}

/* Totals ---------------------------------------------------------------- */

.mpanel-totals {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin: 12px 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.mpanel-totals > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
}

.mpanel-totals > div + div {
  border-left: 1px solid var(--border);
}

.mpanel-totals span {
  color: var(--muted);
  font-size: 0.74rem;
}

.mpanel-totals strong {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty / loading / error ------------------------------------------------ */

.mpanel-state {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 18px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.mpanel-state strong {
  color: var(--text);
  font-size: 0.95rem;
}

.mpanel-state p {
  margin: 0;
}

.mpanel-state--error strong {
  color: var(--danger);
}

.mpanel-skeleton {
  height: 86px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: mpanel-shimmer 1.4s linear infinite;
}

@keyframes mpanel-shimmer {
  to { background-position: -200% 0; }
}

/* A blank map invites the first measurement: the four tools, then a file. */
.mpanel-empty {
  padding: 20px 14px 24px 18px;
}

.mpanel-empty-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.mpanel-empty-text {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.mpanel-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mpanel-tool {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mpanel-tool svg {
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.mpanel-tool strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.mpanel-tool small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mpanel-tool:hover {
  border-color: rgba(243, 172, 84, 0.55);
  background: rgba(243, 172, 84, 0.07);
}

.mpanel-tool.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.mpanel-tool.is-active svg,
.mpanel-tool.is-active small {
  color: var(--accent-ink);
}

.mpanel-import {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mpanel-import svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.mpanel-import span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mpanel-import strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.mpanel-import small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.mpanel-import:hover {
  border-color: var(--accent);
  background: rgba(243, 172, 84, 0.06);
}

.mpanel-import:hover svg {
  color: var(--accent);
}

/* Units and Clear all ----------------------------------------------------- */

.mpanel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.4);
}

.unit-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.unit-switch button {
  height: 28px;
  padding: 0 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.unit-switch button:hover {
  color: var(--text);
}

.unit-switch button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.mpanel-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mpanel-clear svg {
  width: 15px;
  height: 15px;
}

.mpanel-clear:hover:not(:disabled),
.mpanel-clear.is-confirming {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.mpanel-clear:disabled {
  opacity: 0.4;
  cursor: default;
}

/* The panel at its narrowest still fits units and Clear all on one row. */
@container (max-width: 350px) {
  .unit-switch button {
    padding: 0 7px;
  }

  .mpanel-clear {
    padding: 0 8px;
  }
}

/* Cards ------------------------------------------------------------------ */

.mpanel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 12px 12px 16px;
  list-style: none;
}

.mcard {
  position: relative;
  padding: 4px 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.15s ease, background 0.15s ease;
}

/* A colour someone picked shows as a stripe, so a card and its shape match. */
.mcard.has-color::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--mcard-color);
}

.mcard:hover {
  border-color: rgba(243, 172, 84, 0.45);
  background: rgba(243, 172, 84, 0.04);
}

.mcard.is-drawing {
  border-style: dashed;
  border-color: rgba(243, 172, 84, 0.55);
}

/* Icon, name and number. The whole row shows the measurement on the map
   through one button laid over it; the rename pencil sits above that. */
.mcard-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.mcard-hit {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.mcard-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--mcard-color, var(--accent));
}

.mcard-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: var(--mcard-color, var(--accent));
  opacity: 0.16;
}

.mcard-icon svg {
  width: 18px;
  height: 18px;
}

.mcard-title {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.mcard-title .inline-title {
  gap: 6px;
}

.mcard-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0 12px 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.mcard-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(243, 172, 84, 0.16);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}

.mcard-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.mcard-value strong {
  color: var(--mcard-color, var(--accent));
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* An elevation reading still on its way, or not available there. */
.mcard-value strong.is-pending {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.mcard-value small {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

/* Elevation gauge ---------------------------------------------------------
   A line down the side of an elevation card's content, from the top of the
   icon to the last fact and stopping short of the actions row. Its bottom is
   the lowest dry land on Earth and its top the highest summit; a tick across
   it sits where this point falls between them. --level and --sea are 0 to 1.
   The body keeps its title and value clear of it with a little padding; much
   more and "Elevation 1" no longer fits on one line in the narrowest panel. */

/* The card's content above the actions row. flow-root keeps the facts' bottom
   margin inside, so the gauge ends where the facts do. */
.mcard-body {
  position: relative;
  display: flow-root;
}

.mcard--point .mcard-body {
  padding-right: 12px;
}

.mgauge {
  position: absolute;
  top: 8px;
  right: 2px;
  bottom: 10px;
  width: 10px;
  color: var(--mcard-color, var(--accent));
  cursor: help;
}

.mgauge-track,
.mgauge-fill {
  position: absolute;
  bottom: 0;
  left: calc(50% - 1.5px);
  width: 3px;
  border-radius: 2px;
}

.mgauge-track {
  top: 0;
  background: var(--border-strong);
}

.mgauge-fill {
  height: calc(var(--level) * 100%);
  background: currentColor;
  opacity: 0.5;
}

/* Sea level, for reference: where the ground is above it or below it. */
.mgauge-sea {
  position: absolute;
  bottom: calc(var(--sea) * 100%);
  left: 0;
  width: 10px;
  height: 1px;
  background: var(--muted);
  opacity: 0.8;
}

/* This point: a bar across the line, kept on the line at either extreme. */
.mgauge-tick {
  position: absolute;
  bottom: clamp(0px, calc(var(--level) * 100% - 1.5px), calc(100% - 3px));
  left: -1px;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

/* Elevation profile -------------------------------------------------------
   The terrain along a line, in the line's own colour. Pointing at it reads
   out the height and distance there, and marks the spot on the map. */

.mprofile {
  margin: 2px 12px 12px;
  color: var(--mcard-color, var(--accent));
}

.mprofile-chart {
  position: relative;
  height: 64px;
  border-bottom: 1px solid var(--border-strong);
  cursor: crosshair;
  touch-action: pan-y;
}

.mprofile-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mprofile-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.mprofile-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(229, 231, 235, 0.5);
  pointer-events: none;
}

.mprofile-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: currentColor;
  pointer-events: none;
}

.mprofile-readout {
  position: absolute;
  z-index: 3;
  top: 0;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.mprofile-readout strong {
  color: var(--text);
  font-weight: 700;
}

.mprofile figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.mprofile-climb {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.mprofile-climb .is-down {
  margin-left: 8px;
}

.mprofile .is-up {
  color: #fb923c;
}

.mprofile .is-down {
  color: #38bdf8;
}

.mcard-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 2px 12px 10px;
}

.mcard-facts dt {
  color: var(--muted);
  font-size: 0.74rem;
}

.mcard-facts dd {
  margin: 2px 0 0;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* "37.94406, -122.54811" reads best on one line, in fixed-width digits. */
.mcard-facts .is-coordinate {
  grid-column: 1 / -1;
}

.mcard-facts .is-coordinate dd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.mcard-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.mcard-actions-spacer {
  flex: 1;
}

.mcard-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mcard-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mcard-action:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.mcard-action--icon {
  padding: 0;
}

.mcard-action.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.mcard-edit {
  display: grid;
  gap: 12px;
  margin: 8px 8px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.mcard-field {
  display: grid;
  gap: 6px;
}

.mcard-field > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.mcard-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* anything smaller makes iOS zoom the page on focus */
  line-height: 1.4;
  resize: vertical;
}

.mcard-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 172, 84, 0.15);
}

.mcard-field textarea::placeholder {
  color: var(--muted);
}

.mcard-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mcard-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--panel);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.mcard-swatch:hover {
  transform: scale(1.12);
}

.mcard-swatch.is-selected {
  border-color: var(--text);
}

.mcard-done {
  justify-self: end;
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.mcard-done:hover {
  background: var(--accent-hover);
}

.mcard-action--danger:hover,
.mcard-action--danger.is-confirming {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.mcard-segments {
  max-height: 260px;
  margin: 8px 8px 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.mcard-segments table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.mcard-segments th {
  position: sticky;
  top: 0;
  padding: 7px 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.mcard-segments td {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.mcard-segments th:first-child,
.mcard-segments td:first-child {
  color: var(--muted);
  text-align: left;
}

.mcard-segments tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.mcard-segments .is-up {
  color: #fb923c;
}

.mcard-segments .is-down {
  color: #38bdf8;
}

/* Phone bottom sheet: the peek bar is its handle. */
.mpanel-peek {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  width: 100%;
  height: var(--sheet-peek-h);
  padding: 6px 14px 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mpanel-grip {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 999px;
  background: var(--border-strong);
}

.mpanel-peek-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(243, 172, 84, 0.14);
  color: var(--accent);
}

.mpanel-peek-icon svg {
  width: 18px;
  height: 18px;
}

.mpanel-peek-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.mpanel-peek-text strong,
.mpanel-peek-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpanel-peek-text strong {
  font-size: 0.9rem;
}

.mpanel-peek-text span {
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.mpanel-peek-chevron {
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.mpanel-peek-chevron svg {
  width: 20px;
  height: 20px;
}

.mpanel--sheet.is-open .mpanel-peek-chevron {
  transform: rotate(180deg);
}

.mpanel-sheet-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border-top: 1px solid var(--border);
}

/* Elevation point dot, enlarged while its card in the panel is hovered. */
.elevation-point-marker > div {
  transition: transform 0.15s ease;
}

.elevation-point-marker.is-highlighted > div {
  transform: scale(1.8);
}

/* Elevation popup */
.elevation-point-popup .leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: #e5e7eb;
  padding: 0;
}

.elevation-point-popup .leaflet-popup-content {
  margin: 10px 14px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.elevation-point-popup .leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: none;
  border-left: none;
}

.elevation-point-popup .leaflet-popup-close-button {
  color: #94a3b8 !important;
  font-size: 18px;
  top: 4px !important;
  right: 6px !important;
}

.elevation-point-popup .leaflet-popup-close-button:hover {
  color: #fff !important;
}

.elevation-popup-content {
  text-align: center;
}

.elevation-popup-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f3ac54;
  line-height: 1.3;
}

.elevation-popup-coords {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
  font-family: monospace;
}

.elevation-popup-loading {
  color: #94a3b8;
  font-size: 0.85rem;
}

.elevation-popup-error {
  color: #ef4444;
  font-size: 0.85rem;
}

/* The × hides the reading; this removes the point. Quiet until wanted. */
.elevation-popup-remove {
  display: block;
  margin: 6px auto 0;
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.elevation-popup-remove:hover {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

/* A dot whose reading is closed still opens it with a click. */
.elevation-point-marker {
  cursor: pointer;
}

/* Orange active state for area measurement when active */
.leaflet-container.leaflet-measure-map .leaflet-control-measure .leaflet-measure-toggle,
.leaflet-container.leaflet-measure-map .leaflet-control-measure .leaflet-control-measure-toggle {
  background-color: #f3ac54 !important;
  border-color: #f3ac54 !important;
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* `width` because this sits in a flex column, where auto side margins shrink
   an item to its content: the gallery grid collapsed to a single column. */
.page-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  color: var(--text);
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 4px 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.info-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.info-card h2,
.info-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.info-card p {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.info-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.faq-item.open {
  border-color: rgba(255, 255, 255, 0.2);
}

.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.faq-question:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.faq-question span:first-child {
  flex: 1;
}

.faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.faq-item.open .faq-icon {
  background: rgba(255, 255, 255, 0.15);
}

.faq-answer {
  padding: 0 20px 20px 20px;
  color: var(--muted);
  line-height: 1.6;
  animation: fadeIn 0.2s ease;
}

.faq-answer p {
  margin: 0;
  margin-bottom: 12px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.faq-answer li {
  margin-bottom: 6px;
}

.measurement-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Save modal styles */
.save-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 20px;
}

.save-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.save-modal h2 {
  margin: 0 0 12px;
  font-size: 1.4rem;
  color: var(--text);
}

.save-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.save-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.save-modal-close svg {
  width: 18px;
  height: 18px;
}

.save-modal-description {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 20px;
}

.save-modal-field {
  margin-bottom: 20px;
}

.save-modal-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.save-modal-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.save-modal-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 172, 84, 0.15);
}

.save-modal-field input::placeholder {
  color: var(--muted);
}

.save-modal-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.save-modal-button {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0b1220;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.save-modal-button:hover:not(:disabled) {
  background: #e89c3a;
  box-shadow: 0 8px 24px rgba(243, 172, 84, 0.4);
}

.save-modal-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.save-modal-link-container {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.save-modal-link-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.9rem;
  font-family: monospace;
}

.save-modal-link-input:focus {
  outline: none;
  border-color: var(--accent);
}

.save-modal-copy-button {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.save-modal-copy-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.save-modal-done-button {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.save-modal-done-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.save-modal-done-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sits under the primary button on the "save changes" screen. */
.save-modal-secondary {
  margin-top: 10px;
}

.save-modal-error {
  color: #ef4444;
  line-height: 1.5;
  margin: 0 0 20px;
}

.save-modal-checkbox {
  margin-bottom: 20px;
}

.save-modal-checkbox label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}

.save-modal-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.save-modal-checkbox-hint {
  margin: 6px 0 0 28px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Saved page styles */
.saved-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--muted);
}

.saved-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.saved-error p {
  margin-bottom: 16px;
}

.saved-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.saved-empty h3 {
  margin: 20px 0 8px;
  color: var(--text);
}

.saved-empty p {
  margin: 0;
  max-width: 300px;
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.saved-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-card:hover {
  border-color: rgba(243, 172, 84, 0.4);
  background: rgba(15, 23, 42, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.saved-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.saved-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-card-time {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.saved-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.saved-card-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.saved-card-stat svg {
  color: var(--accent);
  opacity: 0.8;
}

.saved-card-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.saved-card-total {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* Gallery pagination ------------------------------------------------------ */

.gallery-range {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-pages button,
.pagination-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pagination-pages button:hover,
.pagination-step:hover:not(:disabled) {
  border-color: rgba(243, 172, 84, 0.5);
  background: rgba(243, 172, 84, 0.08);
}

.pagination-pages button.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: default;
}

.pagination-step svg {
  width: 18px;
  height: 18px;
}

.pagination-step:disabled {
  opacity: 0.4;
  cursor: default;
}

.pagination-gap {
  min-width: 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 768px) {
  .saved-grid {
    grid-template-columns: 1fr;
  }

  /* Page numbers win the space; the arrows keep their icons. Sized so the
     longest row (1 … 4 5 6 … 10 plus both arrows) fits a 320px screen. */
  .pagination {
    flex-wrap: wrap;
    gap: 4px;
  }

  .pagination-pages {
    gap: 2px;
  }

  .pagination-step span {
    display: none;
  }

  .pagination-pages button,
  .pagination-step {
    min-width: 34px;
    height: 38px;
    padding: 0 8px;
  }

  .pagination-gap {
    min-width: 14px;
  }

  .saved-card-header {
    flex-direction: column;
    gap: 4px;
  }

  .saved-card-title {
    white-space: normal;
  }
}

/* Map loading overlay */
.map-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 18, 32, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
  border-radius: var(--radius-lg);
  color: var(--text);
  font-weight: 500;
}

.map-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(243, 172, 84, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Responsive

   Below 768px the app becomes a single full-height screen: a compact header,
   an edge-to-edge map, and the measurement tools docked along the bottom.
   ========================================================================== */

.only-mobile,
.only-mobile-block {
  display: none;
}

@media (min-width: 769px) {
  .header-menu,
  .header-menu-backdrop {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --control-h: 44px;
    --map-gutter: 0px;
    --map-inset: 10px;
    --dock-h: 76px;
  }

  .only-desktop,
  .only-desktop-block {
    display: none !important;
  }

  .only-mobile {
    display: inline-flex;
  }

  .only-mobile-block {
    display: block;
  }

  /* Header --------------------------------------------------------------- */

  .header-inner,
  .site-header--app .header-inner {
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-mark {
    height: 34px;
  }

  .brand-mark--icon {
    height: 40px;
  }

  .place-search {
    max-width: none;
  }

  .saved-name {
    display: none;
  }

  /* Map ------------------------------------------------------------------ */

  .map-shell {
    padding: 0;
  }

  .leaflet-container,
  .map-loading-overlay {
    border-radius: 0;
    box-shadow: none;
  }

  /* Tools dock along the bottom edge, within thumb reach. */
  .map-toolbar {
    top: auto;
    left: var(--map-inset);
    right: var(--map-inset);
    bottom: calc(var(--map-inset) + var(--safe-bottom));
    /* Centred and capped, so the dock does not stretch across a tablet. */
    max-width: 520px;
    margin-inline: auto;
    height: var(--dock-h);
    flex-direction: row;
    gap: 0;
    padding: 6px;
  }

  .map-tool {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 0 2px;
    height: 100%;
    font-size: 0.7rem;
    font-weight: 600;
  }

  .map-tool span {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Zoom, locate and the attribution stack above the dock and the info
     panel's peek bar, which is always there: it is how a phone reaches
     save, export, import and units. */
  .map-shell {
    --sheet-peek: calc(var(--sheet-peek-h) + var(--sheet-gap));
  }

  .leaflet-top.leaflet-right {
    top: auto;
    bottom: calc(var(--dock-h) + var(--map-inset) * 2 + var(--safe-bottom) + var(--sheet-peek));
  }

  .leaflet-bottom.leaflet-right {
    left: var(--map-inset);
    right: auto;
    bottom: calc(var(--dock-h) + var(--map-inset) * 2 + var(--safe-bottom) + var(--sheet-peek));
  }

  /* Info panel: a bottom sheet riding on top of the dock. It overlays the
     map (z-index above Leaflet's controls, below the search results) and
     opens upward, stopping short of the search bar. */
  .mpanel--sheet {
    position: absolute;
    z-index: 760;
    left: var(--map-inset);
    right: var(--map-inset);
    bottom: calc(var(--dock-h) + var(--map-inset) + var(--sheet-gap) + var(--safe-bottom));
    max-width: 520px;
    margin-inline: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.2s ease-out;
  }

  .mpanel--sheet.is-open {
    max-height: calc(100% - var(--dock-h) - var(--map-inset) * 2 - var(--sheet-gap) - var(--safe-bottom) - 70px);
    box-shadow: var(--shadow-lg);
  }

  .mpanel--sheet .mpanel-head {
    padding: 14px 10px 0 16px;
  }

  .mpanel--sheet .mpanel-actions {
    padding: 12px 12px 12px 16px;
  }

  .mpanel--sheet .mpanel-list {
    padding: 10px 10px 14px;
  }

  .mpanel-btn {
    height: 42px;
  }

  .leaflet-container .leaflet-control-attribution {
    border-radius: 8px;
  }

  /* Content pages -------------------------------------------------------- */

  .page-container {
    padding: 24px 16px 32px;
  }

  .page-header {
    flex-direction: column;
    gap: 16px;
  }

  .page-header h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .page-header p {
    font-size: 0.95rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .info-card {
    padding: 16px;
  }

  .info-card h2 {
    font-size: 1.25rem;
  }

  .info-card h3 {
    font-size: 1.1rem;
  }

  .measurement-examples-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .measurement-examples-grid img {
    max-width: 100%;
    height: auto;
  }

  .cta-button {
    padding: 14px 24px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
  }

  .faq-question {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 0 16px 16px 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {
  .brand-mark {
    height: 30px;
  }

  .map-tool {
    font-size: 0.65rem;
  }

  .map-tool svg {
    width: 18px;
    height: 18px;
  }

  .page-container {
    padding: 20px 12px 24px;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .info-card {
    padding: 14px;
  }

  .cta-button {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
}

/* Short screens (landscape phones): trim the dock so the map keeps its room. */
@media (max-width: 768px) and (max-height: 520px) {
  :root {
    --dock-h: 52px;
  }

  .map-tool {
    flex-direction: row;
    gap: 6px;
  }

  .map-tool span {
    display: none;
  }
}


/* ==========================================================================
   Importing files
   ========================================================================== */

.map-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 1200; /* above Leaflet's panes and controls */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 3px dashed var(--accent);
  border-radius: inherit;
  background: rgba(11, 18, 32, 0.78);
  color: var(--text);
  text-align: center;
  pointer-events: none;
}

.map-drop-overlay strong {
  font-size: 1.15rem;
}

.map-drop-overlay span {
  color: var(--muted);
  font-size: 0.9rem;
}

.mpanel-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 12px 0;
  padding: 12px 8px 12px 14px;
  border: 1px solid var(--border-strong);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  line-height: 1.45;
}

.mpanel-notice--success { border-left-color: #34d399; }
.mpanel-notice--warning { border-left-color: var(--accent); }
.mpanel-notice--error { border-left-color: var(--danger); }

.mpanel-notice-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mpanel-notice ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

/* The plugin's own control buttons are replaced by the React toolbar
   (.map-toolbar) and hidden with the rest of the top-left corner, so only
   the on-map pieces are styled here. */
.leaflet-measure-contents {
    padding: 10px;
    display: none;
}
.leaflet-control-measure h3 {
    margin: 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}
.leaflet-measure-actions {
    margin: 0;
    padding: 5px 0 0;
    text-align: right;
    list-style: none;
    list-style-image: none;
}
.leaflet-control-measure a.start {
    display: block;
    width: auto;
    padding: 0 5px 0 25px;
    border: 0;
    text-align: left;
    background-image: url('data:image/svg+xml;utf8,<svg t="1599647825038" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8356" width="16" height="16"><path d="M113.777778 682.666667H0v227.555555c0 62.577778 51.2 113.777778 113.777778 113.777778h227.555555v-113.777778H113.777778v-227.555555zM113.777778 113.777778h227.555555V0H113.777778C51.2 0 0 51.2 0 113.777778v227.555555h113.777778V113.777778z m796.444444-113.777778h-227.555555v113.777778h227.555555v227.555555h113.777778V113.777778c0-62.577778-51.2-113.777778-113.777778-113.777778z m0 910.222222h-227.555555v113.777778h227.555555c62.577778 0 113.777778-51.2 113.777778-113.777778v-227.555555h-113.777778v227.555555zM512 284.444444C386.275556 284.444444 284.444444 386.275556 284.444444 512s101.831111 227.555556 227.555556 227.555556 227.555556-101.831111 227.555556-227.555556-101.831111-227.555556-227.555556-227.555556z m0 341.333334c-62.577778 0-113.777778-51.2-113.777778-113.777778s51.2-113.777778 113.777778-113.777778 113.777778 51.2 113.777778 113.777778-51.2 113.777778-113.777778 113.777778z" p-id="8357"></path></svg>');
    background-repeat: no-repeat;
    background-position: 5px 50%;
    background-size: 14px 14px;
    background-color: transparent;
    text-decoration: none;
}
.leaflet-control-measure a.start:hover {
    opacity: .5;
    background-color: transparent;
}
.leaflet-measure-expanded .leaflet-measure-contents {
  display: block;
}
.leaflet-measure-map {
  cursor: crosshair !important;
}
/* Area and radius readings, matching the elevation popup and the distance
   tooltips so every number the app reports looks like the same system. */
.leaflet-measure-lable {
    padding: 5px 9px;
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    color: #e5e7eb;
    font-family: inherit;
    font-size: 0.78rem;
    white-space: nowrap;
    display: inline-block;
    position: absolute;
}
.leaflet-measure-lable .content {
    width: auto;
    display: inline-block;
    color: #f3ac54;
    font-weight: 700;
}

.leaflet-measure-lable .close {
    width: 15px;
    height: 15px;
    position: relative !important;
    top: 0px !important;
    left: 5px !important;
    cursor: pointer;
}

.leaflet-measure-lable .close .icon {
    width: 15px;
    height: 15px;
    cursor: pointer;
    top: 2px;
    position: relative;
}

/* The cross is drawn with an inline stroke colour, so only !important wins. */
.leaflet-measure-lable .close .icon path {
    stroke: #94a3b8 !important;
}

.leaflet-measure-lable .close:hover .icon path {
    stroke: #f87171 !important;
}

/* Unreadable at world zoom; leaflet.measure.js toggles this one class. */
.leaflet-measure-zoomed-out .leaflet-measure-lable {
    display: none;
}

.measure-elevation-info {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 500;
}

/*********************************************************
**                                                      **
**       Leaflet Plugin "Leaflet.PolylineMeasure"       **
**       File "Leaflet.PolylineMeasure.css"             **
**       Date: 2023-05-26                               **
**                                                      **
*********************************************************/


a.polyline-measure-controlOnBgColor, a.polyline-measure-controlOnBgColor:hover {
  background-color: #f3ac54;
}

.polyline-measure-unicode-icon {
  font-size: 19px;
  font-weight: bold;
}

a.polyline-measure-clearControl:active {
  background-color: #f88;
}

.polyline-measure-unicode-icon, .polyline-measure-clearControl, #unitControlId
{
  cursor: pointer;
}

/* Readings are the app's output, so they follow the app's own surfaces
   rather than the plugin's default 10px yellow sticky note.

   Every point of a line gets one of these. They stay deliberately small --
   just the running total -- because a long route has dozens of them; the
   per-segment detail lives in the info panel. */
.polyline-measure-tooltip {
  font-family: inherit;
  font-size: 0.68rem;
  line-height: 1.3;
  background-color: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  margin: 0;
  padding: 2px 6px;
  width: auto !important;
  height: auto !important;
  white-space: nowrap;
  text-align: right;
  transition: opacity 0.15s ease;
}

/* A line's first point would only read "0", so it is left empty. */
.polyline-measure-tooltip:empty {
  display: none;
}

/* Would overlap a label already shown (see _declutterTooltips). */
.polyline-measure-tooltip--hidden {
  visibility: hidden;
  opacity: 0;
}

/* The line's total: the one number most people came for. */
.polyline-measure-tooltip-end {
  font-size: 0.78rem;
  padding: 3px 8px;
  background-color: rgba(15, 23, 42, 0.97);
  border-color: rgba(243, 172, 84, 0.55);
}

/* Follows the cursor while drawing, so it shows the segment and sits on top.
   Leaflet writes each marker's z-index inline from its screen y, hence the
   !important and a value above any pixel row. */
.polyline-measure-tooltip--live {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-color: rgba(243, 172, 84, 0.55);
  z-index: 100000 !important;
}

.polyline-measure-tooltip-total {
  color: #f3ac54;
  font-weight: 700;
}

.polyline-measure-tooltip-difference {
  display: none;
  color: #cbd5e1;
  font-weight: 500;
}

.polyline-measure-tooltip--live .polyline-measure-tooltip-difference {
  display: block;
}

.polyline-measure-popupTooltip {
  font: 11px Arial, Helvetica, sans-serif;
  line-height: 11px;
}

