/*
 * Camp map app, the full-screen map at /map/. Builds on map.css (the map's own look) and
 * uses Atkinson Hyperlegible, the printed map's typeface, saved with the app for offline.
 *
 * Narrow screens (under 900px): the map fills the screen; Find opens the list over it and a
 * place's details slide up from the bottom.
 * Wide screens: the list sits in a column beside the map, and a place's details take the
 * list's place in that column.
 */

/* The printed map's typeface, beside this file so the page needs no inline style (its
 * Content-Security-Policy allows none). The service worker keeps these exact addresses. */
@font-face {
	font-family: "Atkinson Hyperlegible";
	font-weight: 400;
	font-display: swap;
	src: url(fonts/atkinson-hyperlegible-regular.woff2) format("woff2");
}

@font-face {
	font-family: "Atkinson Hyperlegible";
	font-weight: 700;
	font-display: swap;
	src: url(fonts/atkinson-hyperlegible-bold.woff2) format("woff2");
}

html,
body.cm-app-body {
	height: 100%;
	margin: 0;
	background: #fbfaf6;
}

body.cm-app-body {
	overscroll-behavior: none;
	-webkit-text-size-adjust: 100%;
}

.cm-app {
	--cm-green: #1a4a2e;
	--cm-blue: #1a66d6;
	--cm-ink: #1d231f;
	--cm-label: #4a5a4f;
	--cm-line: #ece8de;
	--cm-wash: #f3f1ea;
	--cm-side-w: 340px;
	--cm-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
	--cm-safe-top: env(safe-area-inset-top, 0px);
	--cm-safe-bottom: env(safe-area-inset-bottom, 0px);
	--cm-safe-left: env(safe-area-inset-left, 0px);
	--cm-safe-right: env(safe-area-inset-right, 0px);

	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	container-type: normal;
	color: var(--cm-ink);
	font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 17px;
}

.cm-app .cm-icon {
	display: block;
	flex: none;
}

.cm-app button {
	font: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.cm-app [hidden] {
	display: none !important;
}

@media (min-width: 900px) {
	.cm-app .cm-narrow-only {
		display: none !important;
	}
}

@media (max-width: 899px) {
	.cm-app .cm-wide-only {
		display: none !important;
	}
}

/* ---------- Bar ---------- */

.cm-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(8px + var(--cm-safe-top)) calc(12px + var(--cm-safe-right)) 8px calc(16px + var(--cm-safe-left));
	background: var(--cm-green);
	color: #fff;
	z-index: 3;
}

.cm-bar-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
}

.cm-bar-home {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	color: inherit;
	text-decoration: none;
}

.cm-bar-home:hover span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cm-bar-logo {
	display: block;
	flex: none;
	width: auto;
	height: 40px;
}

@media print {
	.cm-bar-logo {
		display: none;
	}
}

.cm-bar-actions {
	display: flex;
	gap: 8px;
}

.cm-bar-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 6px 16px 6px 12px;
	border: 2px solid #fff;
	border-radius: 22px;
	background: #fff;
	color: var(--cm-green);
	font-weight: 700;
}

.cm-bar-button.cm-wide-only {
	min-height: 40px;
	background: transparent;
	color: #fff;
}

.cm-bar-button.cm-wide-only:hover {
	background: rgba(255, 255, 255, 0.14);
}

.cm-app .cm-bar :focus-visible {
	outline-color: #fff;
	outline-offset: 3px;
}

/* ---------- Preview note, under the bar ---------- */

.cm-app-preview {
	position: relative;
	z-index: 2;
	padding: 8px calc(12px + var(--cm-safe-right)) 8px calc(12px + var(--cm-safe-left));
	background: #fbfaf6;
	border-bottom: 1px solid #d9d3c5;
}

.cm-app .cm-app-preview .cm-preview {
	margin: 0;
	padding: 8px 52px 8px 12px;
	font-size: 15px;
}

.cm-app-preview-close {
	position: absolute;
	top: 50%;
	right: calc(16px + var(--cm-safe-right));
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cm-ink);
	transform: translateY(-50%);
}

.cm-app-preview-close:hover {
	background: rgba(0, 0, 0, 0.06);
}

@media print {
	.cm-app-preview {
		display: none !important;
	}
}

/* ---------- Body: list column (wide) and the map ---------- */

.cm-body {
	position: relative;
	flex: 1;
	display: flex;
	min-height: 0;
}

.cm-main {
	position: relative;
	flex: 1;
	display: flex;
	min-width: 0;
}

.cm-app .cm-app-map {
	flex: 1;
	height: auto;
	border: 0;
	border-radius: 0;
}

.cm-app .leaflet-top.leaflet-right {
	margin-right: var(--cm-safe-right);
}

.cm-app .leaflet-bottom.leaflet-left {
	margin-left: var(--cm-safe-left);
	margin-bottom: var(--cm-safe-bottom);
}

.cm-app .leaflet-control-zoom {
	border: 0;
	box-shadow: var(--cm-shadow);
}

.cm-app .leaflet-control-zoom a {
	width: 48px;
	height: 48px;
	line-height: 48px;
}

/* ---------- The list of places ---------- */

.cm-side {
	display: none;
	flex-direction: column;
	background: #fff;
	color: var(--cm-ink);
}

@media (min-width: 900px) {
	.cm-side {
		display: flex;
		flex: none;
		width: calc(var(--cm-side-w) + var(--cm-safe-left));
		padding-left: var(--cm-safe-left);
		border-right: 1px solid #d9d3c5;
		z-index: 2;
	}
}

/* Narrow screens: Find opens it over everything */
@media (max-width: 899px) {
	.cm-app.cm-find-open .cm-side {
		display: flex;
		position: fixed;
		top: var(--cm-visible-top, 0px);
		right: 0;
		bottom: auto;
		left: 0;
		height: var(--cm-visible-height, 100dvh);
		overflow-y: auto;
		overscroll-behavior-y: contain;
		z-index: 2000;
		padding: var(--cm-safe-top) var(--cm-safe-right) 0 var(--cm-safe-left);
	}
}

.cm-side-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	padding: 12px 10px 0 20px;
}

.cm-side-head h2 {
	margin: 0;
	color: var(--cm-green);
	font-size: 20px;
}

.cm-side .cm-search-label {
	display: block;
	margin: 6px 20px 4px;
	font-size: 15px;
	font-weight: 700;
}

.cm-side .cm-search-input {
	width: calc(100% - 40px);
	min-height: 48px;
	margin: 0 20px;
	padding: 8px 12px;
	border: 2px solid #8b8178;
	border-radius: 8px;
	background: #fff;
	color: var(--cm-ink);
	font: inherit;
	font-size: 18px;
}

.cm-side .cm-search-input:focus-visible {
	outline: 3px solid var(--cm-green);
	outline-offset: 1px;
}

.cm-side .cm-search-none {
	min-height: 1.4em;
	margin: 4px 20px 0;
	color: #5c3d28;
	font-size: 15px;
}

/* Quick buttons for what people look for most */
.cm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px 20px 6px;
}

.cm-quick {
	min-height: 36px;
	padding: 4px 12px;
	border: 1px solid #c9c3b5;
	border-radius: 18px;
	background: #fff;
	color: var(--cm-ink);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

.cm-quick:hover {
	background: var(--cm-wash);
}

.cm-quick:focus-visible {
	outline: 3px solid var(--cm-green);
	outline-offset: 1px;
}

.cm-quick[aria-pressed="true"] {
	border-color: var(--cm-green);
	background: var(--cm-green);
	color: #fff;
}

.cm-side-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 0 12px calc(20px + var(--cm-safe-bottom));
}

.cm-side .cm-group {
	margin-top: 10px;
}

.cm-side .cm-group-title {
	margin: 0 8px 2px;
	color: var(--cm-label);
	font-family: inherit;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cm-side .cm-places {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cm-side .cm-place {
	margin: 0;
	padding: 0;
}

.cm-side .cm-show {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 8px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--cm-ink);
	font-size: 17px;
	text-align: left;
	text-decoration: none;
}

/* The same symbols as the map, so the list and the map read as one */
.cm-side .cm-show::before {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	background: #33393a;
}

.cm-side .cm-place-landmark .cm-show::before,
.cm-sheet-inside .cm-place-landmark .cm-show::before {
	border-radius: 50%;
}

/* A part of camp: a dashed outline, like an area on a paper map */
.cm-side .cm-place-region .cm-show::before {
	width: 14px;
	height: 10px;
	border: 1.5px dashed #6b5f52;
	background: #efebe4;
}

.cm-side .cm-place-campsite .cm-show::before,
.cm-sheet-inside .cm-place-campsite .cm-show::before {
	width: 14px;
	height: 12px;
	background: #2e6b3c;
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.cm-side .cm-show:hover,
.cm-side .cm-show:focus-visible,
.cm-side .cm-hot .cm-show {
	background: var(--cm-wash);
	color: var(--cm-green);
}

.cm-side .cm-show[aria-current="true"] {
	background: #e3ece5;
	color: var(--cm-green);
	font-weight: 700;
}

/* ---------- Round buttons and messages over the map ---------- */

.cm-fabs {
	position: absolute;
	right: calc(10px + var(--cm-safe-right));
	bottom: calc(40px + var(--cm-safe-bottom));
	display: flex;
	flex-direction: column;
	gap: 12px;
	z-index: 1000;
	transition: bottom 0.2s ease;
}

.cm-fab {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #33393a;
	box-shadow: var(--cm-shadow);
}

/* With a mouse, they don't need to be thumb-sized */
@media (min-width: 900px) and (pointer: fine) {
	.cm-fabs {
		bottom: calc(32px + var(--cm-safe-bottom));
		gap: 8px;
	}

	.cm-fab {
		width: 44px;
		height: 44px;
	}

	.cm-fab .cm-icon {
		width: 20px;
		height: 20px;
	}

	.cm-fab:hover {
		background: var(--cm-wash);
	}
}

.cm-fab.cm-on {
	color: var(--cm-blue);
}

.cm-fab.cm-following {
	background: var(--cm-blue);
	color: #fff;
}

.cm-toasts {
	position: absolute;
	top: 12px;
	left: calc(12px + var(--cm-safe-left));
	right: calc(76px + var(--cm-safe-right));
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	z-index: 1000;
	pointer-events: none;
}

.cm-chip,
.cm-install {
	max-width: 420px;
	margin: 0;
	padding: 8px 14px;
	border-radius: 18px;
	background: #fff;
	color: var(--cm-ink);
	box-shadow: var(--cm-shadow);
	font-size: 15px;
	line-height: 1.35;
	pointer-events: auto;
}

.cm-install {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 14px;
	border-radius: 12px;
}

.cm-install-text {
	flex: 1;
	margin: 0;
}

/* On a phone the tip's words get the whole width, with Show setup steps and Close under them. */
@media (max-width: 600px) {
	.cm-install {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
		gap: 4px;
		padding: 10px 4px 4px 14px;
	}

	.cm-install-text {
		grid-column: 1 / -1;
		padding-right: 10px;
	}

	.cm-install-go {
		justify-self: start;
	}

	.cm-install-close {
		grid-column: 2;
	}
}

/* Suggestions waiting to send, or what happened to them */
.cm-outbox {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	padding: 4px 4px 4px 14px;
	border-radius: 12px;
}

.cm-outbox-text {
	flex: 1;
	margin: 0;
	padding: 6px 0;
}

.cm-waiting-list {
	list-style: none;
	padding: 0;
}

.cm-waiting-row {
	padding: 12px 0;
	border-top: 1px solid var(--cm-line, #c3c4c7);
	overflow-wrap: anywhere;
}

.cm-waiting-row h3 {
	margin: 0;
}

.cm-waiting-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cm-waiting textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 140px;
}

.cm-waiting button:disabled {
	opacity: 0.6;
	cursor: default;
}

.cm-install-go {
	min-height: 44px;
	padding: 6px 14px;
	border: 0;
	border-radius: 22px;
	background: var(--cm-green);
	color: #fff;
	font-weight: 700;
}

.cm-install-close,
.cm-sheet-close,
.cm-side-close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #33393a;
}

/* ---------- A place's details ---------- */

/* Narrow: slides up over the bottom of the map */
.cm-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1001;
	max-height: 60%;
	overflow-y: auto;
	padding: 18px calc(20px + var(--cm-safe-right)) calc(20px + var(--cm-safe-bottom)) calc(20px + var(--cm-safe-left));
	border-radius: 16px 16px 0 0;
	background: #fff;
	color: var(--cm-ink);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
	animation: cm-up 0.2s ease-out;
}

@keyframes cm-up {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: none; opacity: 1; }
}

/* Wide: takes the list's place in the column beside the map */
@media (min-width: 900px) {
	.cm-sheet {
		top: 0;
		right: auto;
		bottom: 0;
		width: calc(var(--cm-side-w) + var(--cm-safe-left));
		max-height: none;
		padding: 12px 24px 24px calc(24px + var(--cm-safe-left));
		border-right: 1px solid #d9d3c5;
		border-radius: 0;
		box-shadow: none;
		z-index: 3;
		animation: none;
	}
}

.cm-sheet-close {
	position: absolute;
	top: 8px;
	right: calc(8px + var(--cm-safe-right));
	background: #f1efe9;
}

.cm-sheet-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 40px;
	margin: 0 0 12px -10px;
	padding: 4px 12px 4px 6px;
	border: 0;
	border-radius: 20px;
	background: none;
	color: var(--cm-green);
	font-weight: 700;
}

.cm-sheet-back:hover {
	background: var(--cm-wash);
}

/* What it is, a sentence under the name ("Campsite in Cardiac Hill"), not a label above it */
.cm-sheet-kind {
	margin: -4px 0 10px;
	color: var(--cm-label);
	font-size: 16px;
}

.cm-sheet-name {
	margin: 2px 52px 10px 0;
	color: var(--cm-green);
	font-size: 26px;
	line-height: 1.2;
}

@media (min-width: 900px) {
	.cm-sheet-name {
		margin-right: 0;
	}
}

.cm-sheet-name:focus {
	outline: none;
}

.cm-sheet-name:focus-visible {
	outline: 3px solid var(--cm-green);
}

.cm-sheet-facts {
	margin: 0;
}

.cm-fact {
	display: grid;
	grid-template-columns: 8.5em 1fr;
	gap: 8px;
	padding: 6px 0;
	border-top: 1px solid var(--cm-line);
}

.cm-fact dt {
	color: var(--cm-label);
	font-weight: 700;
}

.cm-fact dd {
	margin: 0;
}

/* A part of camp's places, in its details */
.cm-sheet-inside {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--cm-line);
}

.cm-sheet-inside-title {
	margin: 0 0 4px;
	color: var(--cm-label);
	font-size: 15px;
	font-weight: 700;
}

.cm-sheet-inside-list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 40vh;
	overflow-y: auto;
}

.cm-sheet-inside .cm-show {
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;
	min-height: 40px;
	padding: 4px 8px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--cm-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.cm-sheet-inside .cm-show::before {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	background: #33393a;
}

.cm-sheet-inside .cm-show:hover,
.cm-sheet-inside .cm-show:focus-visible {
	background: var(--cm-wash);
	color: var(--cm-green);
}

.cm-sheet-note {
	margin: 10px 0 0;
	color: #5c3d28;
	font-size: 15px;
}

.cm-sheet-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 14px 0 0;
}

.cm-sheet-share {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 6px 16px 6px 12px;
	border: 2px solid var(--cm-green);
	border-radius: 22px;
	background: #fff;
	color: var(--cm-green);
	font-weight: 700;
}

.cm-sheet-share:hover {
	background: var(--cm-wash);
}

.cm-sheet-shared {
	color: var(--cm-label);
	font-size: 15px;
	overflow-wrap: anywhere;
}

/* On a phone the round buttons ride above the panel */
@media (max-width: 899px) {
	.cm-app.cm-sheet-open .cm-fabs,
	.cm-app.cm-report-open .cm-fabs {
		bottom: calc(var(--cm-sheet-h, 260px) + 12px);
	}
}

/* ---------- Suggest a fix ---------- */

.cm-link-button {
	min-height: 44px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--cm-green);
	font-weight: 700;
	text-align: left;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cm-side-report {
	margin: 0;
	padding: 8px 20px calc(16px + var(--cm-safe-bottom));
	border-top: 1px solid var(--cm-line);
}

.cm-report-about {
	margin: -4px 0 8px;
	color: var(--cm-label);
}

.cm-report-form p {
	margin: 0 0 12px;
}

.cm-report-kinds {
	margin: 0 0 8px;
	padding: 0;
	border: 0;
}

.cm-report-kinds legend {
	margin-bottom: 4px;
	padding: 0;
	font-weight: 700;
}

.cm-choice {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 4px;
	border-radius: 6px;
	cursor: pointer;
}

.cm-choice:hover {
	background: var(--cm-wash);
}

.cm-choice input,
.cm-report-here input {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--cm-green);
}

.cm-report-here label {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
}

.cm-report-pin {
	color: var(--cm-label);
	font-size: 15px;
}

.cm-report-form label[for] {
	display: block;
	margin-bottom: 4px;
	font-weight: 700;
}

.cm-report-optional {
	color: var(--cm-label);
	font-weight: 400;
}

.cm-report-form textarea,
.cm-report-form input[type="email"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 8px 12px;
	border: 2px solid #8b8178;
	border-radius: 8px;
	background: #fff;
	color: var(--cm-ink);
	font: inherit;
	font-size: 17px;
}

.cm-report-form textarea:focus-visible,
.cm-report-form input[type="email"]:focus-visible {
	outline: 3px solid var(--cm-green);
	outline-offset: 1px;
}

/* Only bots see this field */
.cm-report-trap {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cm-report-error {
	min-height: 0;
	color: #a12a1f;
	font-weight: 700;
}

.cm-report-error:empty {
	display: none;
}

/* A field with a problem: a red border, with the error line right under it saying what's wrong. */
.cm-report-form textarea[aria-invalid="true"],
.cm-report-form input[type="email"][aria-invalid="true"] {
	border-color: #a12a1f;
}

.cm-report-kinds.cm-report-invalid {
	padding: 4px 6px;
	border: 2px solid #a12a1f;
	border-radius: 8px;
}

.cm-report-kinds.cm-report-invalid legend {
	padding: 0 4px;
}

.cm-report-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

/* Only for copying a report on browsers without the clipboard API: never seen. */
.cm-copy-box {
	position: fixed;
	top: 0;
	left: -9999px;
	opacity: 0;
}

.cm-report-send {
	min-height: 48px;
	padding: 8px 24px;
	border: 0;
	border-radius: 24px;
	background: var(--cm-green);
	color: #fff;
	font-weight: 700;
}

.cm-report-send:disabled {
	opacity: 0.6;
}

.cm-report-fine {
	color: var(--cm-label);
	font-size: 14px;
}

.cm-report-marker {
	background: none;
	border: 0;
}

.cm-report-marker svg {
	display: block;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

/* ---------- You are here ---------- */

.cm-me {
	background: none;
	border: 0;
	pointer-events: none;
}

.cm-me svg {
	display: block;
	overflow: visible;
}

.cm-me-dot {
	fill: var(--cm-blue, #1a66d6);
	stroke: #fff;
	stroke-width: 3;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.cm-me-cone {
	fill: rgba(26, 102, 214, 0.28);
}

.cm-app path.cm-me-ring {
	fill: #1a66d6;
	fill-opacity: 0.12;
	stroke: #1a66d6;
	stroke-opacity: 0.4;
}

/* Bigger names on a phone held at arm's length, once zoomed in */
.cm-app .cm-zoom-2 .leaflet-tooltip.cm-label {
	font-size: 14px;
}

.cm-app .cm-zoom-2 .leaflet-tooltip.cm-label-place {
	font-size: 13px;
}

.cm-app-missing,
.cm-app-noscript {
	max-width: 560px;
	margin: 0 auto;
	padding: 32px 20px;
	color: var(--cm-ink, #1d231f);
	font: 18px/1.5 system-ui, sans-serif;
}

.cm-app-noscript {
	position: absolute;
	top: 70px;
	left: 0;
	right: 0;
	z-index: 1002;
	background: #fff;
}

.cm-print-note {
	display: none;
}

/* ---------- Printing: the view on the screen, on a Letter page held sideways ---------- */

@page {
	size: letter landscape;
	margin: 0.4in;
}

.cm-app.cm-printing .cm-side,
.cm-app.cm-printing .cm-sheet {
	display: none !important;
}

.cm-app.cm-printing .cm-main {
	flex: none;
	width: 960px;
	height: 640px;
}

@media print {
	html,
	body.cm-app-body {
		height: auto;
		background: #fff;
	}

	.cm-app {
		position: static;
		display: block;
	}

	.cm-bar {
		padding: 0 0 8px;
		background: none;
		color: var(--cm-green);
	}

	.cm-bar-actions,
	.cm-side,
	.cm-sheet,
	.cm-fabs,
	.cm-toasts,
	.cm-app .leaflet-control-zoom {
		display: none !important;
	}

	.cm-body {
		display: block;
	}

	.cm-main {
		width: 960px;
		height: 640px;
		border: 1px solid #8b8178;
	}

	.cm-print-note {
		display: block;
		margin: 8px 0 0;
		color: #4a5a4f;
		font-size: 12px;
	}

	.cm-app .leaflet-control-attribution,
	.cm-app .leaflet-control-scale-line {
		background: #fff;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cm-sheet {
		animation: none;
	}

	.cm-fabs {
		transition: none;
	}
}

@media (forced-colors: active) {
	.cm-fab,
	.cm-chip,
	.cm-install,
	.cm-sheet {
		border: 1px solid CanvasText;
	}

	.cm-side .cm-show::before {
		forced-color-adjust: none;
	}
}

/* The sidebar swatch uses the same trail pattern as the map. */
.cm-side .cm-place-trail .cm-show::before {
	width: 20px;
	height: 0;
	border-top: 2.5px dashed #484848;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

/* While a phone shows a full hike, keep floating location buttons off the route.
 * Closing its details restores the ordinary controls. Zoom controls remain available. */
@media (max-width: 899px) {
	.cm-app.cm-trail-open .cm-fab {
		display: none;
	}
}

.cm-side .cm-place-trail .cm-show[aria-current="true"]::before,
.cm-side .cm-place-trail .cm-show:hover::before,
.cm-side .cm-place-trail .cm-show:focus-visible::before {
	border-top: 4px solid #b64216;
}

/* The key stays out of the map until requested; native dialog provides focus containment. */
.cm-map-key {
	width: min(420px, calc(100% - 32px));
	max-height: calc(100dvh - 48px);
	margin: auto;
	padding: 20px;
	overflow: auto;
	border: 1px solid var(--cm-line);
	border-radius: 12px;
	background: #fff;
	color: var(--cm-ink);
	font: inherit;
	box-shadow: var(--cm-shadow);
}

.cm-map-key::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cm-key-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.cm-key-head h2 {
	margin: 0;
	font-size: 24px;
}

.cm-key-close {
	display: grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	border: 0;
	border-radius: 50%;
	background: var(--cm-wash);
	color: var(--cm-ink);
}

.cm-key-items {
	margin: 12px 0;
}

.cm-key-items > div {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 32px;
}

.cm-key-items dt {
	display: flex;
}

.cm-key-items dd {
	margin: 0;
}

/* The line samples; the symbol samples keep their own fills. */
.cm-key-items path[class] {
	fill: none;
	stroke-linejoin: round;
}

.cm-key-hike { stroke: #484848; stroke-width: 2.5; stroke-dasharray: 7 5; }
.cm-key-selected { stroke: #b64216; stroke-width: 5.5; stroke-linecap: round; }
.cm-key-trail { stroke: #7a5a3a; stroke-width: 2; stroke-dasharray: 5 4; }
.cm-key-road { stroke: #fff; stroke-width: 4; filter: drop-shadow(0 1px #8b8178) drop-shadow(0 -1px #8b8178); }
.cm-key-track { stroke: #fff; stroke-width: 2.4; filter: drop-shadow(0 1px #8b8178) drop-shadow(0 -1px #8b8178); }
.cm-key-boundary { stroke: #4a3b2e; stroke-width: 1.6; stroke-dasharray: 10 4 2 4; }
.cm-key-river { stroke: #3f86c4; stroke-width: 4; }
.cm-key-creek { stroke: #3f86c4; stroke-width: 1.2; stroke-dasharray: 4 3; }
.cm-key-contour { stroke: #c4ad94; stroke-width: 1.1; }
.cm-key-extra { stroke: #f0a878; stroke-width: 12; stroke-linecap: round; opacity: 0.8; }

.cm-map-key p {
	margin: 12px 0 0;
	font-size: 15px;
	line-height: 1.4;
}

@media (max-width: 420px) {
	.cm-bar { gap: 6px; }
	.cm-bar-title { font-size: 18px; }
	.cm-bar-button { padding: 6px 10px; }
	.cm-bar-actions { gap: 6px; }
}

@media print {
	.cm-map-key { display: none; }
}

.cm-route-more,
.cm-route-choices {
	margin-top: 8px;
	border-top: 1px solid var(--cm-line);
}

.cm-route-more summary,
.cm-route-choices summary {
	min-height: 44px;
	padding: 10px 0;
	color: var(--cm-green);
	font-weight: 700;
	cursor: pointer;
}

.cm-route-more p,
.cm-route-choices p {
	margin: 4px 0 12px;
	line-height: 1.4;
}

.cm-route-more .cm-route-estimates,
.cm-route-choices .cm-route-estimates {
	color: var(--cm-label);
	font-size: 15px;
}

.cm-route-options {
	display: grid;
	gap: 8px;
	margin: 12px 0;
}

.cm-route-option,
.cm-route-standard {
	min-height: 48px;
	padding: 12px;
	border: 1px solid var(--cm-green);
	border-radius: 8px;
	background: #fff;
	color: var(--cm-green);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.cm-route-option strong,
.cm-route-option span {
	display: block;
}

.cm-route-option span {
	margin-top: 4px;
}

.cm-route-option[aria-pressed="true"] {
	outline: 2px solid var(--cm-green);
	outline-offset: -3px;
	background: #edf2e8;
}

.cm-route-option:hover,
.cm-route-standard:hover {
	background: #edf2e8;
}

.cm-route-option:focus-visible,
.cm-route-standard:focus-visible {
	outline: 3px solid var(--cm-green);
	outline-offset: 2px;
}

/* Offline status remains available after an install tip has been dismissed. */
.cm-bar-offline {
	position: relative;
}

/* Saved on this device: a check mark on the button, so it reads without color or a screen reader. */
.cm-offline-ready::after {
	position: absolute;
	top: 0;
	right: 0;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='8' fill='%231a4a2e'/%3E%3Cpath d='m5 9.3 2.7 2.7L13 6.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
	box-shadow: 0 0 0 1.5px #fff;
	content: "";
}

.cm-map-key .cm-offline-status {
	padding: 12px;
	border-left: 4px solid #8b8178;
	background: var(--cm-wash);
	font-size: 18px;
	font-weight: 700;
}

.cm-offline-map[data-state="saved"] .cm-offline-status {
	border-color: var(--cm-green);
	color: var(--cm-green);
}

.cm-offline-save {
	min-height: 44px;
	margin-top: 16px;
	padding: 10px 16px;
	border: 2px solid var(--cm-green);
	border-radius: 24px;
	background: #fff;
	color: var(--cm-green);
	font-weight: 700;
}

.cm-offline-save:disabled {
	color: #666;
	border-color: #bbb;
	cursor: default;
}

.cm-offline-map h3 {
	margin: 24px 0 0;
	font-size: 18px;
}

@media (max-width: 600px) {
	.cm-offline-label,
	.cm-bar-logo { display: none; }
}

@media (max-width: 360px) {
	.cm-bar-title { font-size: 16px; }
	.cm-bar-find span { display: none; }
	.cm-bar-button { min-width: 44px; padding: 6px; justify-content: center; }
}

.cm-offline-steps {
	margin: 12px 0;
	padding-left: 24px;
	font-size: 16px;
	line-height: 1.4;
}

.cm-offline-steps li + li {
	margin-top: 10px;
}

@media (max-width: 899px) {
	.cm-trail-open .cm-install { display: none; }
}

/* The preview note's "Spot something off? Tell us." when it opens Suggest a fix: a link in the sentence. */
.cm-app .cm-preview .cm-preview-suggest {
	display: inline;
	min-height: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

/* On a short visible screen, one scroll area keeps every result and the footer reachable. */
@media (max-width: 899px) {
	.cm-side-head,
	.cm-side-search,
	.cm-chips,
	.cm-side-report {
		flex-shrink: 0;
	}

	.cm-viewport-short .cm-side-list {
		flex: none;
		overflow: visible;
	}

	.cm-viewport-short .cm-side-head {
		position: sticky;
		top: 0;
		z-index: 1;
		background: #fff;
	}

	.cm-keyboard-open .cm-report {
		position: fixed;
		top: calc(var(--cm-visible-top, 0px) + var(--cm-safe-top) + 8px);
		bottom: auto;
		max-height: calc(var(--cm-visible-height, 100dvh) - var(--cm-safe-top) - 16px);
		overscroll-behavior-y: contain;
	}
}
