.fm-wrapper {
	margin: 1em 0;
	font-size: 15px;
}

.fm-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.fm-btn {
	background: #1d6fb8;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 8px 14px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.2;
}

.fm-btn:hover {
	background: #155a96;
}

.fm-share-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	user-select: none;
}

.fm-share-toggle input {
	width: 16px;
	height: 16px;
}

.fm-login-hint {
	color: #555;
	font-size: 13px;
}

.fm-status {
	color: #1d6fb8;
	font-size: 13px;
	min-height: 1em;
}

.fm-map {
	width: 100%;
	min-height: 300px;
	border-radius: 8px;
	overflow: hidden;
	z-index: 0;
}

/* Markør for andre brukere */
.fm-other-icon .fm-dot {
	display: block;
	width: 16px;
	height: 16px;
	background: #e8462c;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.25 );
}

/* Tegnforklaring for spor */
.fm-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 8px;
	font-size: 13px;
	color: #333;
}
.fm-legend:empty { display: none; }
.fm-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.fm-legend-item i {
	width: 18px;
	height: 4px;
	border-radius: 2px;
	display: inline-block;
}

/* GPX-knapp inne i popup */
.fm-gpx-other {
	margin-top: 6px;
	background: #1d6fb8;
	color: #fff;
	border: 0;
	border-radius: 5px;
	padding: 5px 9px;
	cursor: pointer;
	font-size: 12px;
}
.fm-gpx-other:hover { background: #155a96; }

.fm-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Rom-/gjestekontroller */
.fm-room-controls {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}
.fm-room-as {
	font-size: 13px;
	color: #333;
}
.leaflet-tooltip.leaflet-tooltip-top {
	font-size: 12px;
	font-weight: 600;
}

/* Frontend-adminpanel */
.fm-admin-panel { margin-top: 14px; }
.fm-admin-inner {
	border: 1px solid #d6dde3;
	border-radius: 8px;
	padding: 14px 16px;
	background: #f7fafc;
}
.fm-admin-inner h4 { margin: 0 0 8px; font-size: 15px; }
.fm-a-badge { color: #1d6fb8; font-weight: normal; font-size: 13px; }
.fm-a-hint { margin: 0 0 12px; font-size: 13px; color: #555; }
.fm-a-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fm-a-table th, .fm-a-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e3e8ec; vertical-align: middle; }
.fm-a-link { width: 230px; max-width: 40vw; font-size: 12px; padding: 3px 6px; }
.fm-a-addrow, .fm-a-roomrow { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fm-a-pnavn, .fm-a-navn { padding: 6px 8px; border: 1px solid #c4ccd3; border-radius: 5px; font-size: 14px; }
.fm-a-del { background: #b3261e; }
.fm-a-del:hover { background: #8f1d17; }
.fm-admin-inner .fm-btn { padding: 5px 10px; font-size: 13px; }

/* Klikkbar tegnforklaring (sentrer til person) */
.fm-legend-item { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.fm-legend-item:hover { text-decoration: underline; }
/* Sentrer-knapp i popup */
.fm-center {
	margin-top: 6px; background: #3a3f44; color: #fff; border: 0;
	border-radius: 5px; padding: 5px 9px; cursor: pointer; font-size: 12px;
}
.fm-center:hover { background: #25282b; }

/* Fullskjerm-kontroll */
.fm-fs-control a {
	display: flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; color: #333; background: #fff;
}
.fm-fs-control a:hover { background: #f4f4f4; }
.fm-fs-control svg { display: block; }

/* Fullskjerm-visning (ekte API + CSS-fallback for iOS) */
.fm-map.fm-pseudo-fs {
	position: fixed; top: 0; left: 0; right: 0; bottom: 0;
	width: 100% !important; height: 100% !important;
	z-index: 100000; border-radius: 0;
}
.fm-map:-webkit-full-screen { width: 100% !important; height: 100% !important; border-radius: 0; }
.fm-map:fullscreen { width: 100% !important; height: 100% !important; border-radius: 0; }

/* Gesture-handling overlay-tekst – litt penere ramme */
.leaflet-gesture-handling:before { border-radius: 8px; }

/* Ikonknapper (admin + navigasjon) */
.fm-iconbtn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; padding: 0; line-height: 0;
}
.fm-iconbtn svg { display: block; }
.fm-admin-inner .fm-iconbtn { width: 30px; height: 30px; }
.fm-admin-inner .fm-a-add { display: inline-flex; align-items: center; gap: 6px; }
.fm-admin-inner .fm-a-add svg { display: block; }
.fm-a-del.fm-iconbtn { background: #b3261e; }
.fm-a-del.fm-iconbtn:hover { background: #8f1d17; }
.fm-a-copy.fm-copied { background: #1f9e57; }
.fm-a-gpx.fm-empty { opacity: .6; }
/* litt luft mellom handlingsknappene i admin-tabellen */
.fm-a-table td .fm-iconbtn { margin: 0 1px; vertical-align: middle; }

/* Markørnåler + fargevelger i adminpanel */
.fm-pin-icon { background: none; border: 0; }
.fm-pin-icon svg { display: block; filter: drop-shadow( 0 1px 1px rgba(0,0,0,0.35) ); }
.fm-a-color { width: 38px; height: 26px; padding: 0; border: 1px solid #ccc; border-radius: 4px; background: none; cursor: pointer; vertical-align: middle; }
.fm-a-table td .fm-a-color { display: inline-block; }

/* Naviger-kontroll inne i kartet (Sentrer på meg / Vis alle) */
.fm-nav-control a {
	display: flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; color: #333; background: #fff;
}
.fm-nav-control a:hover { background: #f4f4f4; }
.fm-nav-control svg { display: block; }

/* Adminpanel: topplinje + innhold, med overlay/dokket-modus */
.fm-admin-bar {
	display: flex; align-items: center; gap: 6px; padding: 6px 8px;
	background: #1f2a37; color: #fff; border-radius: 8px 8px 0 0;
	-webkit-user-select: none; user-select: none;
}
.fm-admin-grip { display: inline-flex; opacity: .85; }
.fm-admin--overlay .fm-admin-bar { cursor: move; touch-action: none; }
.fm-admin-title { font-weight: 600; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-admin-bar-actions { display: flex; gap: 2px; }
.fm-admin-bar button {
	background: transparent; border: 0; color: #fff; cursor: pointer;
	padding: 3px; display: inline-flex; align-items: center; border-radius: 4px; line-height: 0;
}
.fm-admin-bar button:hover { background: rgba( 255, 255, 255, .18 ); }
.fm-admin--collapsed .fm-admin-body { display: none; }
.fm-admin--collapsed .fm-admin-bar { border-radius: 8px; }
.fm-admin-panel .fm-admin-inner { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }

/* Overlay: flytende panel inne i kartet (synlig i fullskjerm) */
.fm-admin--overlay {
	position: absolute; z-index: 1100; left: 8px; bottom: 8px;
	width: min( 440px, calc( 100% - 16px ) );
	margin: 0; border-radius: 8px; overflow: hidden;
	box-shadow: 0 8px 28px rgba( 0, 0, 0, .35 );
}
.fm-admin--overlay .fm-admin-bar { border-radius: 8px 8px 0 0; }
.fm-admin--overlay.fm-admin--collapsed .fm-admin-bar { border-radius: 8px; }
.fm-admin--overlay .fm-admin-body { max-height: 46vh; overflow: auto; background: #f7fafc; }
.fm-admin--overlay .fm-admin-inner { border: 0; border-radius: 0; }
.fm-pseudo-fs .fm-admin--overlay .fm-admin-body { max-height: 60vh; }

.fm-admin-panel.fm-fs-active .fm-admin-dock { display: none; }

/* Overlay: midtstilt nederst som standard, og maksimert-modus */
.fm-admin--overlay.fm-admin--center { left: 50%; right: auto; bottom: 8px; top: auto; transform: translateX( -50% ); }
.fm-admin--overlay.fm-admin--max {
	left: 8px; right: 8px; top: 8px; bottom: 8px; width: auto; transform: none;
	display: flex; flex-direction: column;
}
.fm-admin--overlay.fm-admin--max .fm-admin-body { flex: 1; max-height: none; overflow: auto; }

/* Statusikoner for deltakere (med tooltip) */
.fm-status-badge { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.fm-status-badge svg { display: block; }
.fm-status-invitert { color: #1d6fb8; }   /* blå – invitert */
.fm-status-aktiv { color: #1f9e57; }       /* grønn – aktiv */
.fm-status-deaktivert { color: #b3261e; }  /* rød – tilbaketrukket */

/* Deltakere som kort over to linjer (mobilvennlig, tydelig skille) */
.fm-admin-inner h4 { letter-spacing: .2px; }
.fm-a-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.fm-a-card {
	background: #fff;
	border: 1px solid #e4e9ee;
	border-radius: 12px;
	padding: 11px 13px;
	box-shadow: 0 1px 2px rgba( 16, 24, 40, .05 );
}
.fm-a-line1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fm-a-name {
	font-weight: 600; font-size: 14px; color: #1f2a37;
	min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fm-a-name em { font-style: normal; font-weight: 400; font-size: 12px; color: #7a8794; margin-left: 2px; }
.fm-a-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.fm-a-seen { font-size: 12px; color: #7a8794; white-space: nowrap; }
.fm-a-line2 {
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
	margin-top: 11px; padding-top: 10px; border-top: 1px solid #eef2f5;
}
.fm-a-line2 .fm-iconbtn { width: 40px; height: 40px; }
.fm-a-line2 .fm-a-color { width: 40px; height: 40px; }
.fm-a-empty { font-size: 13px; color: #7a8794; margin: 6px 0; }
.fm-status-badge svg { width: 20px; height: 20px; }

/* Fargevelger som tydelig, rund knapp i admindelen */
.fm-a-color {
	width: 38px; height: 38px; padding: 0;
	border: 2px solid #fff; border-radius: 50%;
	box-shadow: 0 0 0 1px #cbd5e1, 0 1px 2px rgba( 16, 24, 40, .15 );
	background: none; cursor: pointer; vertical-align: middle; overflow: hidden;
	-webkit-appearance: none; appearance: none;
}
.fm-a-line2 .fm-a-color { width: 38px; height: 38px; }
.fm-a-color::-webkit-color-swatch-wrapper { padding: 0; }
.fm-a-color::-webkit-color-swatch { border: none; border-radius: 50%; }
.fm-a-color::-moz-color-swatch { border: none; border-radius: 50%; }

/* Fargesymbol i admin: stor, rund fargeknapp i stedet for tynn strek */
.fm-a-color {
	-webkit-appearance: none; -moz-appearance: none; appearance: none;
	width: 40px; height: 40px; padding: 0;
	border: none; border-radius: 50%;
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c8d2dc;
	cursor: pointer; background: none;
}
.fm-a-color::-webkit-color-swatch-wrapper { padding: 0; }
.fm-a-color::-webkit-color-swatch { border: none; border-radius: 50%; }
.fm-a-color::-moz-color-swatch { border: none; border-radius: 50%; }
.fm-a-line2 .fm-a-color { width: 40px; height: 40px; }

/* Skjul/vis-knapp i adminkort */
.fm-a-hide { opacity: .85; }
.fm-a-hide.fm-a-hidden { opacity: .4; }
