/* =====================================================================
   FlowMapper modern theme
   ---------------------------------------------------------------------
   A purely visual override layer, loaded LAST in index.html.
   It does not change markup, element IDs, classes or JavaScript.
   To revert to the classic look, remove the <link> to this file.
   ===================================================================== */

:root {
	--fm-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--fm-bg: #ffffff;
	--fm-surface: #f5f6f8;
	--fm-surface-hover: #eceef2;
	--fm-border: #e4e6eb;
	--fm-border-strong: #cfd3da;
	--fm-text: #1c1d21;
	--fm-text-muted: #6b6f7a;
	--fm-accent: #2f6bff;
	--fm-accent-hover: #1e56e6;
	--fm-accent-press: #1847c2;
	--fm-accent-soft: rgba(47, 107, 255, 0.14);
	--fm-radius-sm: 6px;
	--fm-radius: 8px;
	--fm-radius-lg: 14px;
	--fm-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
	--fm-shadow: 0 2px 6px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
	--fm-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
	--fm-control-h: 30px;
}

body {
	font-family: var(--fm-font);
	color: var(--fm-text);
	background: var(--fm-bg);
	-webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */
nav.navbar.navigation-clean,
nav.navbar.navigation-clean.navbar-dark.bg-dark {
	background: var(--fm-bg) !important;
	color: var(--fm-text);
	border-bottom: 1px solid var(--fm-border);
	box-shadow: var(--fm-shadow-sm);
	padding-top: 0;
	padding-bottom: 0;
	align-items: center;
	z-index: 5 !important;   /* keep menus above the panel handle and legend */
}

nav.navbar.navigation-clean .navbar-brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--fm-text) !important;
	font-weight: 700;
	font-size: 17px;
	letter-spacing: -0.02em;
}

/* FlowMapper mark (three-node flow network) in front of the brand name */
nav.navbar.navigation-clean .navbar-brand::before {
	content: "";
	width: 26px;
	height: 26px;
	flex: none;
	background: url("../img/logo/flowmapper-mark.svg") center / contain no-repeat;
}

nav.navbar.navigation-clean.navbar-dark .navbar-nav .nav-link {
	color: var(--fm-text-muted);
	font-size: 14px;
	font-weight: 500;
	padding: 4px 12px;
	margin: 0 1px;
	border-radius: var(--fm-radius);
	line-height: 24px;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}

nav.navbar.navigation-clean.navbar-dark .navbar-nav .nav-link:hover,
nav.navbar.navigation-clean.navbar-dark .navbar-nav .nav-link:focus-visible,
nav.navbar.navigation-clean.navbar-dark .navbar-nav .show > .nav-link {
	color: var(--fm-text);
	background-color: var(--fm-surface);
}

nav.navbar.navigation-clean .navbar-toggler {
	border-color: var(--fm-border);
}

nav.navbar.navigation-clean .navbar-toggler-icon {
	filter: invert(1);
}

/* The Geo-Social logo has white lettering; invert it for the light bar
   while keeping the hue of the colored dots. */
#GeosocialLogo-Img {
	filter: invert(1) hue-rotate(180deg);
	height: 1.7em;
	opacity: .9;
}

/* ---------------------------------------------------------------------
   Menus (File / View / Tools / Help)
   --------------------------------------------------------------------- */
nav.navbar.navigation-clean .dropdown-menu,
nav.navbar.navigation-clean.navbar-dark .navbar-nav > li > .dropdown-menu,
.secondary-dropdown-menu {
	background-color: var(--fm-bg) !important;
	border: 1px solid var(--fm-border);
	border-radius: 10px;
	box-shadow: var(--fm-shadow-lg);
	padding: 5px !important;
	min-width: 11rem !important;
	text-align: left !important;
	font-size: 14px;
	line-height: 1.6;
}

nav.navbar.navigation-clean .dropdown-menu .dropdown-item,
nav.navbar.navigation-clean.navbar-dark .dropdown-menu .dropdown-item {
	color: var(--fm-text) !important;
	background: transparent;
	border-radius: var(--fm-radius-sm);
	padding: 5px 10px;
	text-align: left !important;
	font-size: 14px;
	line-height: 1.6;
	border: 0;
}

nav.navbar.navigation-clean .dropdown-menu .dropdown-item:hover,
nav.navbar.navigation-clean .dropdown-menu .dropdown-item:focus,
nav.navbar.navigation-clean.navbar-dark .dropdown-menu .dropdown-item:hover,
.btn-group.dropright.dropdown-item.show {
	background-color: var(--fm-surface) !important;
	color: var(--fm-text) !important;
}

/* "Project", "Export", "Drawing order" sub-menu triggers */
nav.navbar.navigation-clean .dropdown-item > .dropdown-toggle {
	color: var(--fm-text) !important;
	text-align: left !important;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: none !important;
}

nav.navbar.navigation-clean .dropright .dropdown-toggle::after {
	border-left-color: var(--fm-text-muted);
	margin-left: 8px;
}

/* items inside the sub-menus (Load/Save project, SVG, PNG ...) */
.secondary-dropdown-menu li {
	text-align: left !important;
}

.secondary-dropdown-menu .btn,
.secondary-dropdown-menu .btn:focus {
	color: var(--fm-text) !important;
	width: 100%;
	text-align: left;
	font-size: 14px;
	padding: 4px 10px;
	border-radius: var(--fm-radius-sm);
	box-shadow: none !important;
}

.secondary-dropdown-menu .btn:hover {
	background-color: var(--fm-surface) !important;
}

/* check mark for the selected option (View > Drawing order) */
.secondary-dropdown-menu .btn.Is-Checked {
	font-weight: 600;
}

/* legend visibility (LegendControl.js)
   visibility (not display:none): legends are sized with getBBox(), which
   returns 0 inside display:none, so a legend redrawn while hidden would come
   back as an empty 40x30 box. */
#Legend.Hide-regions #svg_CPMLegend,
#Legend.Hide-nodes #svg_PointLegend,
#Legend.Hide-flows #svg_FlowLegend {
	visibility: hidden !important;
	position: absolute !important;
	width: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
}

#Legend.Legend-Empty {
	visibility: hidden !important;
	pointer-events: none;
}

#FlowsOnTop-Btn,
#NodesOnTop-Btn,
.LegendToggle-Btn {
	padding-left: 28px !important;
	position: relative;
}

.secondary-dropdown-menu .btn.Is-Checked::before {
	content: "";
	position: absolute;
	left: 9px;
	top: 50%;
	width: 12px;
	height: 12px;
	margin-top: -6px;
	background-color: var(--fm-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------------------------------------------------------------------
   Left settings panel
   --------------------------------------------------------------------- */
#SideBar-Div {
	background: var(--fm-bg);
	/* NOTE: no border here. PageControl.js reopens the panel only when its
	   computed width is exactly "0px"; a border would make it "1px". */
	box-shadow: 1px 0 0 var(--fm-border), 2px 0 12px rgba(16, 24, 40, 0.06);
	height: calc(100% - 47px);
	font-family: var(--fm-font);
	color: var(--fm-text);
	transition: width .3s ease, min-width .3s ease;
	scrollbar-width: thin;
	scrollbar-color: var(--fm-border-strong) transparent;
}

/* Smooth collapse: the panel content keeps its laid-out width while the
   panel slides closed, so controls are clipped instead of re-wrapping
   line by line during the animation; it also fades out. */
#SideBar-Div {
	overflow-x: hidden;
}

#SideBar-Div > .tab-content {
	min-width: 245px;
}

#SideBar-Div > .nav-tabs {
	min-width: 221px;
}

#SideBar-Div > .tab-content,
#SideBar-Div > .nav-tabs {
	transition: opacity .2s ease;
}

body.SideBar-Collapsed #SideBar-Div > .tab-content,
body.SideBar-Collapsed #SideBar-Div > .nav-tabs {
	opacity: 0;
}

#SideBar-Div::-webkit-scrollbar { width: 8px; }
#SideBar-Div::-webkit-scrollbar-thumb {
	background: var(--fm-border-strong);
	border-radius: 8px;
	border: 2px solid var(--fm-bg);
}

/* Tabs -> segmented control */
#SideBar-Div .nav-tabs {
	display: flex;
	flex-wrap: nowrap;
	gap: 2px;
	margin: 12px 12px 4px;
	padding: 3px;
	background: var(--fm-surface);
	border: 0;
	border-radius: 10px;
	position: sticky;
	top: 12px;
	z-index: 2;
	box-shadow: 0 0 0 12px var(--fm-bg);
}

#SideBar-Div .nav-tabs .Tabs {
	flex: 1 1 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	font-size: 12.5px;
	margin: 0;
}

#SideBar-Div .nav-tabs .nav-link,
#SideBar-Div .nav-tabs .Tabs-A {
	display: block;
	width: 100%;
	text-align: center;
	color: var(--fm-text-muted);
	font-weight: 500;
	padding: 5px 2px;
	border: 0;
	border-radius: 7px;
	white-space: nowrap;
	transition: background-color .15s, color .15s, box-shadow .15s;
}

#SideBar-Div .nav-tabs .nav-link:hover {
	color: var(--fm-text);
}

#SideBar-Div .nav-tabs .nav-link.active {
	background: var(--fm-bg);
	color: var(--fm-text) !important;
	box-shadow: var(--fm-shadow);
}

#SideBar-Div .container {
	padding: 6px 14px 16px;
}

.TabListItems {
	font-family: var(--fm-font);
	font-size: 13px;
	color: var(--fm-text);
}

.TabListItems input {
	font-family: var(--fm-font);
}

#SideBar-Div .table {
	margin-bottom: 0;
	color: var(--fm-text);
}

#SideBar-Div .table td,
#SideBar-Div .table th {
	padding: 2px 2px;
	font-size: 13px;
	line-height: 1.4;
}

#SideBar-Div label {
	margin-bottom: 0;
	color: var(--fm-text);
}

.BlankRow,
.BlankRow td {
	font-size: 4px !important;
	line-height: 4px;
}

#SideBar-Div a:not(.nav-link) {
	color: var(--fm-accent);
}

/* ---------------------------------------------------------------------
   Form controls
   --------------------------------------------------------------------- */
#SideBar-Div select,
#SideBar-Div input[type=number],
#SideBar-Div input[type=text],
.white-popup select,
.white-popup input[type=number],
.white-popup input[type=text] {
	height: var(--fm-control-h);
	padding: 0 8px;
	font-family: var(--fm-font);
	font-size: 13px;
	color: var(--fm-text);
	background-color: var(--fm-bg);
	border: 1px solid var(--fm-border-strong);
	border-radius: var(--fm-radius-sm);
	box-shadow: var(--fm-shadow-sm);
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	vertical-align: middle;
}

#SideBar-Div select,
.white-popup select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 26px;
	text-overflow: ellipsis;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b6f7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 9px center;
	background-size: 10px 6px;
}

#SideBar-Div select:hover,
#SideBar-Div input[type=number]:hover,
#SideBar-Div input[type=text]:hover {
	border-color: #b4bac4;
}

#SideBar-Div select:focus,
#SideBar-Div input[type=number]:focus,
#SideBar-Div input[type=text]:focus,
.white-popup select:focus,
.white-popup input:focus {
	border-color: var(--fm-accent);
	box-shadow: 0 0 0 3px var(--fm-accent-soft);
}

#SideBar-Div select:disabled,
#SideBar-Div input:disabled {
	background-color: var(--fm-surface);
	color: var(--fm-text-muted);
	cursor: not-allowed;
}

#SideBar-Div input[type=color] {
	height: var(--fm-control-h);
	padding: 3px;
	background: var(--fm-bg);
	border: 1px solid var(--fm-border-strong);
	border-radius: var(--fm-radius-sm);
	cursor: pointer;
	vertical-align: middle;
}

#SideBar-Div input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
#SideBar-Div input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
#SideBar-Div input[type=color]::-moz-color-swatch { border: 0; border-radius: 4px; }

/* file pickers */
#SideBar-Div input[type=file],
.white-popup input[type=file] {
	height: auto;
	width: 100%;
	max-width: 100%;
	font-family: var(--fm-font);
	font-size: 12px;
	color: var(--fm-text-muted);
	padding: 4px;
	border: 1px dashed var(--fm-border-strong);
	border-radius: var(--fm-radius);
	background: var(--fm-surface);
	cursor: pointer;
}

.white-popup input[type=file] {
	width: auto;
	max-width: 360px;
	margin: 6px 0;
}

#SideBar-Div input[type=file]:hover,
.white-popup input[type=file]:hover {
	border-color: var(--fm-accent);
	background: #eef3ff;
}

input[type=file]::file-selector-button {
	font-family: var(--fm-font);
	font-size: 12px;
	font-weight: 600;
	color: var(--fm-text);
	background: var(--fm-bg);
	border: 1px solid var(--fm-border-strong);
	border-radius: var(--fm-radius-sm);
	padding: 4px 10px;
	margin-right: 8px;
	cursor: pointer;
	transition: background-color .15s;
}

input[type=file]::file-selector-button:hover {
	background: var(--fm-surface-hover);
}

/* checkboxes & radios */
#SideBar-Div input[type=checkbox],
#SideBar-Div input[type=radio],
.white-popup input[type=radio],
.white-popup input[type=checkbox] {
	accent-color: var(--fm-accent);
	cursor: pointer;
}

#SideBar-Div .form-check-label {
	cursor: pointer;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn-primary {
	background-color: var(--fm-accent);
	border-color: var(--fm-accent);
	font-weight: 600;
	border-radius: var(--fm-radius);
}

.btn-primary:hover,
.btn-primary:focus-visible {
	background-color: var(--fm-accent-hover);
	border-color: var(--fm-accent-hover);
}

/* Map / Clean action buttons at the bottom of each tab */
#SideBar-Div .btn.btn-primary:not(.Help-Btn) {
	background-color: var(--fm-accent) !important;
	border: 1px solid var(--fm-accent) !important;
	color: #fff;
	font-family: var(--fm-font);
	font-size: 13px !important;
	font-weight: 600;
	padding: 6px 14px;
	margin: 10px 2px 0;
	border-radius: var(--fm-radius);
	box-shadow: var(--fm-shadow-sm);
	transition: background-color .15s, box-shadow .15s;
}

#SideBar-Div .btn.btn-primary:not(.Help-Btn):hover {
	background-color: var(--fm-accent-hover) !important;
	border-color: var(--fm-accent-hover) !important;
}

/* secondary style for the "Clean ..." buttons */
#SideBar-Div .btn.btn-primary[id^="Clean"] {
	background-color: var(--fm-bg) !important;
	border: 1px solid var(--fm-border-strong) !important;
	color: var(--fm-text);
}

#SideBar-Div .btn.btn-primary[id^="Clean"]:hover {
	background-color: var(--fm-surface) !important;
	border-color: var(--fm-border-strong) !important;
}

/* "?" help buttons */
.Help-Btn,
#SideBar-Div .Help-Btn,
#SideBar-Div button.Help-Btn {
	width: 15px;
	height: 15px;
	line-height: 15px;
	padding: 0;
	font-size: 9.5px;
	font-weight: 700;
	font-family: var(--fm-font);
	color: var(--fm-text-muted);
	background-color: var(--fm-surface-hover) !important;
	border: 0 !important;
	border-radius: 50%;
	vertical-align: 1px;
	box-shadow: none;
	transition: background-color .15s, color .15s;
}

.Help-Btn:hover,
#SideBar-Div .Help-Btn:hover,
#SideBar-Div button.Help-Btn:hover {
	color: #fff;
	background-color: var(--fm-accent) !important;
}

/* ---------------------------------------------------------------------
   Panel collapse / expand handle
   The container's width follows the panel (set by PageControl.js), so the
   handle rides along the panel's right edge, level with the tab bar.
   Expanded: a small chevron button. Collapsed: a "Settings" pill.
   --------------------------------------------------------------------- */
#SideBarBtnContainer-Div {
	position: fixed;
	top: 59px;
	left: 0;
	height: 0;
	z-index: 2;
	transition: width .3s ease, min-width .3s ease;
}

#SideBarBtn-Div.ol-control {
	position: absolute;
	top: 0;
	left: 100%;
	right: auto;
	margin-left: 10px;
	background: transparent;
	padding: 0;
	overflow: visible;
}

#SideBar-Btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: auto !important;
	min-width: 32px;
	height: 32px !important;
	margin: 0;
	padding: 0 8px;
	color: var(--fm-text-muted);
	background: var(--fm-bg);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	box-shadow: var(--fm-shadow);
	font-family: var(--fm-font);
	font-size: 0;            /* hides the "<" / ">" text set by the script */
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	touch-action: manipulation;
	transition: background-color .15s, color .15s, box-shadow .15s;
}

/* chevron icon (points left = collapse) */
#SideBar-Btn::before {
	content: "";
	width: 14px;
	height: 14px;
	flex: none;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10 3L5 8l5 5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10 3L5 8l5 5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform .3s ease;
}

#SideBar-Btn::after {
	content: "Settings";
	display: none;
	font-size: 13px;
	font-weight: 600;
}

#SideBar-Btn:hover,
#SideBar-Btn:focus-visible {
	color: var(--fm-text);
	background: var(--fm-surface);
}

#SideBar-Btn:focus {
	outline: none;
}

/* collapsed state */
body.SideBar-Collapsed #SideBarBtn-Div.ol-control {
	margin-left: 12px;
}

body.SideBar-Collapsed #SideBar-Btn {
	padding: 0 12px 0 8px;
	color: var(--fm-text);
}

body.SideBar-Collapsed #SideBar-Btn::before {
	transform: rotate(180deg);
}

body.SideBar-Collapsed #SideBar-Btn::after {
	display: inline;
}

/* ---------------------------------------------------------------------
   Map controls (OpenLayers)
   --------------------------------------------------------------------- */
#map .ol-control {
	background: transparent;
	padding: 0;
	border-radius: var(--fm-radius);
}

#map .ol-control button {
	width: 32px;
	height: 32px;
	margin: 0 0 6px 0;
	color: var(--fm-text);
	background: var(--fm-bg);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	box-shadow: var(--fm-shadow);
	font-family: var(--fm-font);
	font-size: 16px;
	font-weight: 500;
	transition: background-color .15s;
}

#map .ol-control button:hover,
#map .ol-control button:focus-visible {
	background: var(--fm-surface);
	color: var(--fm-text);
	outline: none;
}

/* "Zoom to data extent": an expand icon instead of the letter "E" */
#map .ol-zoom-extent button {
	font-size: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

#map .ol-zoom-extent button::before {
	content: "";
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='8' r='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='8' r='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* zoom in/out as one grouped control */
#map .ol-zoom {
	box-shadow: var(--fm-shadow);
	border-radius: var(--fm-radius);
}

#map .ol-zoom button {
	margin: 0;
	box-shadow: none;
}

#map .ol-zoom .ol-zoom-in {
	border-radius: var(--fm-radius) var(--fm-radius) 0 0;
	border-bottom: 0;
}

#map .ol-zoom .ol-zoom-out {
	border-radius: 0 0 var(--fm-radius) var(--fm-radius);
}

.ol-scale-line {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius-sm);
	box-shadow: var(--fm-shadow-sm);
	padding: 3px 6px;
}

.ol-scale-line-inner {
	color: var(--fm-text);
	border-color: var(--fm-text);
	font-family: var(--fm-font);
	font-size: 10px;
	font-weight: 500;
}

#map .ol-attribution {
	font-family: var(--fm-font);
	font-size: 11px;
}

/* ---------------------------------------------------------------------
   Legend & hover cards
   --------------------------------------------------------------------- */
#Legend {
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid var(--fm-border);
	border-radius: 12px;
	box-shadow: var(--fm-shadow-lg);
	margin: 14px;
}

#AttributeBox-Block,
#TabHelper-Block {
	font-family: var(--fm-font);
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--fm-text);
	background: var(--fm-bg);
	border: 1px solid var(--fm-border);
	border-radius: 10px;
	box-shadow: var(--fm-shadow-lg);
	padding: 8px 12px;
	text-align: left;
}

#TabHelper-Block {
	max-width: 260px;
	z-index: 5;
}

/* ---------------------------------------------------------------------
   Dialogs (Magnific Popup)
   --------------------------------------------------------------------- */
.mfp-bg {
	background: #0f1117;
	opacity: 0.45;
}

.mfp-ready.mfp-bg,
.mfp-zoom-in.mfp-ready.mfp-bg {
	opacity: 0.45;
}

.white-popup {
	background: var(--fm-bg);
	border-radius: var(--fm-radius-lg);
	box-shadow: var(--fm-shadow-lg);
	padding: 24px 28px 22px;
	color: var(--fm-text);
}

.InfoBoxes {
	font-family: var(--fm-font);
	font-size: 14.5px;
	line-height: 1.6;
}

.InfoBoxes h1,
.white-popup h1 {
	font-family: var(--fm-font);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--fm-text);
	height: auto;
	padding: 0 40px 12px 0;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--fm-border);
}

.InfoBoxes p {
	margin-left: 0;
	margin-bottom: 0.6em;
	color: #3a3d45;
}

.white-popup a {
	color: var(--fm-accent);
}

/* close "X" -> quiet icon button */
.white-popup .mfp-close,
.white-popup .btn.btn-primary.mfp-close {
	width: 32px;
	height: 32px;
	line-height: 32px;
	top: 16px;
	right: 16px;
	padding: 0;
	font-family: var(--fm-font);
	font-size: 14px;
	font-weight: 600;
	color: var(--fm-text-muted) !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: var(--fm-radius);
	opacity: 1;
	box-shadow: none !important;
	text-align: center;
}

.white-popup .mfp-close:hover,
.white-popup .btn.btn-primary.mfp-close:hover {
	background: var(--fm-surface) !important;
	color: var(--fm-text) !important;
}

/* dialog action buttons (Submit etc.) */
.white-popup .btn-primary:not(.mfp-close) {
	font-size: 14px;
	padding: 6px 16px;
	box-shadow: var(--fm-shadow-sm);
}

/* tooltip-style instruction popup opened by the "?" buttons */
#Instructions-Block h1 {
	font-size: 17px;
	padding-right: 0;
}

/* Welcome splash
   The dialog keeps the background image's 16:9 shape, so the text drawn in
   the image and the buttons stay aligned at any screen size. The buttons are
   sized in container units (cqw = 1% of the dialog width) and placed either
   side of the image's text column (centred at ~78% of the width), so they
   scale with the dialog and can never overlap. */
#Welcome-Block {
	width: 65vw !important;
	/* never taller than the screen: cap the width by the viewport height */
	max-width: min(1200px, calc((100vh - 40px) * 1.777));
	max-height: none;
	height: auto !important;
	aspect-ratio: 5697 / 3206;
	padding: 0;
	overflow: hidden;
	background: #111;
	container-type: inline-size;
}

#WelcomeBackground-Img {
	display: block;
}

#GetStarted-Btn,
#SkipTutorial-Btn {
	position: absolute;
	top: 65%;
	font-family: var(--fm-font);
	font-size: 1vw;          /* fallback for browsers without container units */
	font-size: 1.45cqw;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	border-radius: 999px;
	padding: .55em 1.1em;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	touch-action: manipulation;
}

#GetStarted-Btn {
	right: calc(22% + 0.6cqw);
	left: auto;
}

#SkipTutorial-Btn {
	left: calc(78% + 0.6cqw);
	right: auto;
}

#SkipTutorial-Btn {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.55);
	color: #fff;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

#SkipTutorial-Btn:hover {
	background: rgba(255, 255, 255, 0.26);
	border-color: #fff;
}

/* =====================================================================
   Responsive layout (laptop first, also iPad / tablets)
   ===================================================================== */

/* The brand + menu container has an inline width of 37%, which is too
   narrow on tablets and small laptops; let it size to its content. */
nav.navbar.navigation-clean > .container {
	width: auto !important;
	max-width: none;
	flex: 0 1 auto;
	padding-left: 12px;
	padding-right: 8px;
}

nav.navbar.navigation-clean .navbar-nav {
	flex-wrap: nowrap;
}

#GeosocialLogo-A {
	padding-right: 14px;
	flex: none;
}

button,
.btn,
a,
input,
select {
	-webkit-tap-highlight-color: transparent;
}

.btn,
#map .ol-control button,
.Tabs-A {
	touch-action: manipulation;   /* no double-tap zoom delay on iPad */
}

/* ---- dialogs never get too narrow or too wide ---- */
.white-popup {
	max-width: 960px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

/* ---- small laptops & iPad landscape (â‰¤ 1366px) ---- */
@media (max-width: 1366px) {
	#Welcome-Block {
		width: 78vw !important;
	}
}

/* ---- iPad landscape & below (â‰¤ 1180px) ---- */
@media (max-width: 1180px) {
	.white-popup:not(#Welcome-Block) {
		width: 80% !important;
	}

	nav.navbar.navigation-clean.navbar-dark .navbar-nav .nav-link {
		padding: 4px 9px;
	}
}

/* ---- iPad portrait (â‰¤ 900px) ---- */
@media (max-width: 900px) {
	.white-popup:not(#Welcome-Block) {
		width: 90% !important;
		padding: 20px 20px 18px;
	}

	#Welcome-Block {
		width: 92vw !important;
	}

	nav.navbar.navigation-clean.navbar-dark .navbar-nav .nav-link {
		padding: 4px 7px;
		font-size: 13.5px;
	}

	#Legend {
		max-width: calc(100vw - 259px - 40px);
		overflow: auto;
	}
}

/* ---- narrow (split-screen iPad, phones): menu collapses to a toggle ---- */
@media (max-width: 767.98px) {
	nav.navbar.navigation-clean .navbar-collapse {
		position: absolute;
		top: 46px;
		left: 8px;
		right: 8px;
		background: var(--fm-bg);
		border: 1px solid var(--fm-border);
		border-radius: 12px;
		box-shadow: var(--fm-shadow-lg);
		padding: 6px;
		z-index: 10;
	}

	nav.navbar.navigation-clean .navbar-nav {
		flex-wrap: wrap;
	}

	nav.navbar.navigation-clean .navbar-nav > li {
		height: auto !important;
	}

	nav.navbar.navigation-clean > .container {
		flex: 1 1 auto;
		justify-content: space-between;
	}
}

/* ---- touch screens (iPad etc.): larger tap targets ---- */
@media (pointer: coarse) {
	:root {
		--fm-control-h: 36px;
	}

	nav.navbar.navigation-clean.navbar-dark .navbar-nav .nav-link {
		line-height: 30px;
	}

	nav.navbar.navigation-clean .dropdown-menu .dropdown-item,
	.secondary-dropdown-menu .btn {
		padding-top: 8px;
		padding-bottom: 8px;
	}

	#SideBar-Div .nav-tabs .nav-link,
	#SideBar-Div .nav-tabs .Tabs-A {
		padding: 8px 2px;
	}

	#SideBar-Div .table td,
	#SideBar-Div .table th {
		padding-top: 3px;
		padding-bottom: 3px;
	}

	.Help-Btn,
	#SideBar-Div .Help-Btn,
	#SideBar-Div button.Help-Btn {
		width: 22px;
		height: 22px;
		line-height: 22px;
		font-size: 11px;
		vertical-align: middle;
	}

	#SideBar-Div input[type=checkbox],
	#SideBar-Div input[type=radio] {
		transform: scale(1.25);
	}

	#SideBar-Div .btn.btn-primary:not(.Help-Btn) {
		padding: 9px 16px;
	}

	#map .ol-control button {
		width: 40px;
		height: 40px;
		font-size: 18px;
	}

	#SideBar-Btn {
		min-width: 40px;
		height: 40px !important;
	}

	#SideBar-Btn::after {
		font-size: 14px;
	}

	.white-popup .mfp-close,
	.white-popup .btn.btn-primary.mfp-close {
		width: 40px;
		height: 40px;
		line-height: 40px;
	}
}

/* Tab hover hints are mouse-only; on touch they would stick after a tap. */
@media (hover: none) {
	#TabHelper-Block {
		display: none;
	}
}

/* =====================================================================
   Interaction states: press and focus
   - A mouse click or tap gives brief "pressed" feedback and leaves
     nothing highlighted afterwards (no sticky grey/blue glow).
   - Keyboard users get one consistent focus ring (:focus-visible).
   ===================================================================== */

/* no grey flash on iPad / touch screens */
button, a, label, select, input, .btn, .nav-link, .dropdown-item {
	-webkit-tap-highlight-color: transparent;
}

/* Bootstrap's blue glow after clicking a button */
.btn:focus,
.btn.focus,
.btn:not(:disabled):not(.disabled):active:focus,
.btn:not(:disabled):not(.disabled).active:focus,
.show > .btn.dropdown-toggle:focus {
	box-shadow: none;
}

/* pressed feedback */
.btn:not(:disabled):active,
#SideBar-Btn:active,
#map .ol-control button:active {
	transform: translateY(1px);
}

#SideBar-Div .btn.btn-primary:not(.Help-Btn):not([id^="Clean"]):active,
.white-popup .btn.btn-primary:not(.mfp-close):active,
.btn-primary:not(:disabled):not(.disabled):active {
	background-color: var(--fm-accent-press) !important;
	border-color: var(--fm-accent-press) !important;
}

#SideBar-Div .btn.btn-primary[id^="Clean"]:active,
#SideBar-Btn:active,
#map .ol-control button:active {
	background-color: var(--fm-surface-hover) !important;
}

.Help-Btn:active,
#SideBar-Div .Help-Btn:active {
	color: #fff;
	background-color: var(--fm-accent-press) !important;
}

nav.navbar.navigation-clean .dropdown-menu .dropdown-item:active,
.secondary-dropdown-menu .btn.btn-primary:not(:disabled):not(.disabled):active {
	background-color: var(--fm-surface-hover) !important;
	color: var(--fm-text) !important;
}

#SideBar-Div .nav-tabs .nav-link:not(.active):active {
	background: rgba(255, 255, 255, 0.6);
}

/* keyboard focus ring */
button:focus-visible,
a:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
[role="button"]:focus-visible,
input[type=checkbox]:focus-visible,
input[type=radio]:focus-visible,
input[type=file]:focus-visible,
input[type=color]:focus-visible {
	outline: 2px solid var(--fm-accent) !important;
	outline-offset: 2px;
}

/* =====================================================================
   2026-11 additions: notices, file status, tool dialogs, map scale box,
   View menu toggles
   ===================================================================== */

/* View > Auto-update map (a toggle with a check mark) */
#View-Menu .ViewToggle-Btn {
	position: relative;
	width: 100%;
	text-align: left !important;
	padding-left: 28px !important;
	color: var(--fm-text) !important;
	background: transparent !important;
	border: 0 !important;
	font-size: 14px;
	box-shadow: none !important;
}

#View-Menu .ViewToggle-Btn:hover {
	background-color: var(--fm-surface) !important;
}

#View-Menu .ViewToggle-Btn.Is-Checked::before {
	content: "";
	position: absolute;
	left: 9px;
	top: 50%;
	width: 12px;
	height: 12px;
	margin-top: -6px;
	background-color: var(--fm-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* small explanatory text under a control */
.Field-Note {
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--fm-text-muted);
	margin-top: 3px;
	white-space: normal;
}

/* "Using data from the project file" under a file picker */
.File-Status {
	font-size: 11.5px;
	line-height: 1.35;
	color: #0f6b3a;
	background: #e9f7ef;
	border-radius: var(--fm-radius-sm);
	padding: 3px 6px;
	margin-top: 4px;
	white-space: normal;
}

.Radio-Line {
	display: block;
	margin: 2px 0;
	cursor: pointer;
	font-weight: 400;
}

.Radio-Line input {
	margin-right: 5px;
	accent-color: var(--fm-accent);
}

.Radio-Line input:disabled + * ,
.Radio-Line:has(input:disabled) {
	color: var(--fm-text-muted);
	cursor: not-allowed;
}

/* non-blocking notices (ExceptionHandling.js showNotice) */
#Notice-Block {
	position: fixed;
	right: 16px;
	top: 60px;
	z-index: 1050;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: min(380px, calc(100vw - 32px));
	font-family: var(--fm-font);
}

.Notice-Item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	background: var(--fm-bg);
	border: 1px solid var(--fm-border);
	border-left: 4px solid var(--fm-accent);
	border-radius: 10px;
	box-shadow: var(--fm-shadow-lg);
	padding: 10px 10px 10px 12px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--fm-text);
}

.Notice-warning {
	border-left-color: #e8a10c;
}

.Notice-Text {
	flex: 1;
}

.Notice-Close {
	border: 0;
	background: transparent;
	color: var(--fm-text-muted);
	font-size: 18px;
	line-height: 1;
	padding: 0 2px;
	cursor: pointer;
}

/* tool dialogs */
.Tool-Figure {
	width: 100%;
	max-width: 760px;
	height: auto;
	border: 1px solid var(--fm-border);
	border-radius: 10px;
	background: #fff;
	padding: 8px;
}

.Tool-Table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 6px 6px;
	font-size: 13px;
	margin-bottom: 6px;
}

.Tool-Table td:nth-child(odd) {
	color: var(--fm-text-muted);
	white-space: nowrap;
	text-align: right;
}

.Tool-Table select {
	width: 100%;
}

.Tool-Summary {
	background: var(--fm-surface);
	border-radius: var(--fm-radius);
	padding: 8px 10px;
	font-size: 13px;
}

.Tool-Summary:empty {
	display: none;
}

.Tool-Error {
	color: #b42318;
	font-weight: 600;
}

/* exact map scale box, next to the scale bar */
#MapScale-Box {
	position: absolute;
	bottom: 36px;
	left: 269px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 2px 4px 2px 7px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius-sm);
	box-shadow: var(--fm-shadow-sm);
	font-family: var(--fm-font);
	font-size: 11px;
	font-weight: 500;
	color: var(--fm-text-muted);
	z-index: 1;
	transition: left .3s ease;
}

body.SideBar-Collapsed #MapScale-Box {
	left: 10px;
}

#MapScale-Input {
	width: 92px;
	height: 20px !important;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	font: inherit;
	font-variant-numeric: tabular-nums;
	color: var(--fm-text);
	padding: 0 4px;
}

#MapScale-Input:hover,
#MapScale-Input:focus {
	border-color: var(--fm-border-strong);
	background: #fff;
	outline: none;
}

/* =====================================================================
   Image-based color-ramp picker (ColorSchemes.js)
   ===================================================================== */
select.Ramp-Native {
	display: none !important;
}

#SideBar-Div .Ramp-Button,
.Ramp-Button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: var(--fm-control-h);
	padding: 0 24px 0 6px;
	position: relative;
	vertical-align: middle;
	background: var(--fm-bg) !important;
	border: 1px solid var(--fm-border-strong) !important;
	border-radius: var(--fm-radius-sm);
	box-shadow: var(--fm-shadow-sm);
	color: var(--fm-text) !important;
	font-family: var(--fm-font);
	font-size: 12.5px;
	text-align: left;
	cursor: pointer;
	overflow: hidden;
}

#CPM_ColorScheme-Select + .Ramp-Button,
#Point_ColorScheme-Select + .Ramp-Button {
	width: calc(100% - 62px);
}

#Flow_ColorScheme-Select + .Ramp-Button {
	width: calc(100% - 110px);
}


#SideBar-Div .Ramp-Button:hover {
	border-color: #b4bac4 !important;
}

#SideBar-Div .Ramp-Button[aria-expanded="true"] {
	border-color: var(--fm-accent) !important;
	box-shadow: 0 0 0 3px var(--fm-accent-soft);
}

.Ramp-Button:disabled {
	opacity: .6;
	cursor: not-allowed;
}

.Ramp-Button .Ramp-Name {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.Ramp-Caret {
	position: absolute;
	right: 9px;
	top: 50%;
	width: 10px;
	height: 6px;
	margin-top: -3px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b6f7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.Ramp-Swatch {
	display: inline-flex;
	flex: none;
	width: 58px;
	height: 14px;
	border-radius: 3px;
	overflow: hidden;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.Ramp-Swatch span {
	flex: 1;
}

#RampPicker-Pop {
	position: fixed;
	z-index: 1060;
	display: none;
	max-height: min(420px, calc(100vh - 24px));
	overflow-y: auto;
	padding: 6px;
	background: var(--fm-bg);
	border: 1px solid var(--fm-border);
	border-radius: 10px;
	box-shadow: var(--fm-shadow-lg);
	font-family: var(--fm-font);
	font-size: 13px;
}

#RampPicker-Pop .Ramp-Group {
	padding: 8px 8px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--fm-text-muted);
}

#RampPicker-Pop .Ramp-Item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 8px;
	border-radius: var(--fm-radius-sm);
	cursor: pointer;
	color: var(--fm-text);
	white-space: nowrap;
}

#RampPicker-Pop .Ramp-Item .Ramp-Swatch {
	width: 96px;
	height: 16px;
}

#RampPicker-Pop .Ramp-Item:hover,
#RampPicker-Pop .Ramp-Item.Is-Active {
	background: var(--fm-surface);
}

#RampPicker-Pop .Ramp-Item.Is-Selected {
	font-weight: 600;
	box-shadow: inset 3px 0 0 var(--fm-accent);
}

@media (pointer: coarse) {
	#RampPicker-Pop .Ramp-Item {
		padding: 9px 8px;
	}
}

/* Community Detection tool */
.Tool-Badge {
	display: inline-block;
	vertical-align: middle;
	margin-left: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	background: #fff4e5;
	color: #b25e09;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .02em;
}

.Tool-Hint {
	color: var(--fm-text-muted);
	font-size: 12px;
	text-align: left !important;
	white-space: normal !important;
}

.Tool-Table input[type=number] {
	width: 90px;
}

.Leiden-Files td:first-child {
	text-align: left !important;
	white-space: nowrap;
}

.Leiden-Files td:last-child {
	color: var(--fm-text);
	white-space: normal !important;
	text-align: left !important;
	font-size: 12.5px;
}

/* =====================================================================
   Map controls: basemap gallery, undo/redo (MapControls.js), icons
   ===================================================================== */
#map .fm-map-control {
	position: absolute;
	right: .5em;
	background: transparent;
	padding: 0;
}

#BasemapGallery-Ctl { top: 112px; }

#Undo-Ctl {
	top: 152px;
	display: flex;
	flex-direction: column;
	box-shadow: var(--fm-shadow);
	border-radius: var(--fm-radius);
}

#Undo-Ctl button { margin: 0; box-shadow: none; }
#Undo-Ctl button:first-child { border-radius: var(--fm-radius) var(--fm-radius) 0 0; border-bottom: 0; }
#Undo-Ctl button:last-child { border-radius: 0 0 var(--fm-radius) var(--fm-radius); }
#map .fm-map-control button:disabled { opacity: .45; cursor: default; }

#map .fm-map-control button {
	display: flex;
	align-items: center;
	justify-content: center;
}

.fm-icon {
	display: inline-block;
	width: 16px;
	height: 16px;
	flex: none;
	background-color: currentColor;
	-webkit-mask: var(--fm-icon) center / contain no-repeat;
	mask: var(--fm-icon) center / contain no-repeat;
}

.fm-icon-layers { --fm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M8 2l6 3-6 3-6-3z'/%3E%3Cpath d='M2 8l6 3 6-3'/%3E%3Cpath d='M2 11l6 3 6-3'/%3E%3C/svg%3E"); }
.fm-icon-undo { --fm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3L2 6l3 3'/%3E%3Cpath d='M2 6h7a4 4 0 010 8H6'/%3E%3C/svg%3E"); }
.fm-icon-redo { --fm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 3l3 3-3 3'/%3E%3Cpath d='M14 6H7a4 4 0 000 8h3'/%3E%3C/svg%3E"); }

#BasemapGallery-Panel {
	display: none;
	position: absolute;
	right: 40px;
	top: 0;
	width: 296px;
	padding: 10px;
	background: var(--fm-bg);
	border: 1px solid var(--fm-border);
	border-radius: 12px;
	box-shadow: var(--fm-shadow-lg);
	font-family: var(--fm-font);
	font-size: 12.5px;
	color: var(--fm-text);
	text-align: left;
	z-index: 5;
}

#BasemapGallery-Panel.Is-Open { display: block; }

#BasemapGallery-Panel .Gallery-Title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--fm-text-muted);
	margin: 2px 0 6px;
}

#BasemapGallery-Panel .Gallery-Grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	margin-bottom: 10px;
}

#map #BasemapGallery-Panel .Gallery-Item {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	width: auto;
	height: auto;
	margin: 0;
	padding: 3px;
	gap: 3px;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius-sm);
	background: var(--fm-bg);
	box-shadow: none;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--fm-text);
	cursor: pointer;
}

#BasemapGallery-Panel .Gallery-Item img {
	width: 100%;
	height: 52px;
	object-fit: cover;
	border-radius: 4px;
	background: var(--fm-surface);
}

#BasemapGallery-Panel .Gallery-Item span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#map #BasemapGallery-Panel .Gallery-Item.Is-Selected {
	border-color: var(--fm-accent);
	box-shadow: 0 0 0 2px var(--fm-accent-soft);
}

#BasemapGallery-Panel select {
	width: 100%;
	height: var(--fm-control-h);
	border: 1px solid var(--fm-border-strong);
	border-radius: var(--fm-radius-sm);
	padding: 0 6px;
	font: inherit;
	margin-bottom: 8px;
}

#BasemapGallery-Panel .Gallery-Check { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
#BasemapGallery-Panel .Gallery-Opacity { display: flex; gap: 8px; align-items: center; }
#BasemapGallery-Panel .Gallery-Opacity input { flex: 1; accent-color: var(--fm-accent); }

/* icons + text on the Map / Clean buttons (T-03 item 4) */
#SideBar-Div .btn.btn-primary:not(.Help-Btn)::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin: 0 6px -2px 0;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M1.5 3.5l4-1.5 5 2 4-1.5v10l-4 1.5-5-2-4 1.5z'/%3E%3Cpath d='M5.5 2v10M10.5 4v10'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M1.5 3.5l4-1.5 5 2 4-1.5v10l-4 1.5-5-2-4 1.5z'/%3E%3Cpath d='M5.5 2v10M10.5 4v10'/%3E%3C/svg%3E") center / contain no-repeat;
}

#SideBar-Div .btn.btn-primary[id^="Clean"]::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5h11M6 4.5V3h4v1.5M4 4.5l.7 9h6.6l.7-9'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5h11M6 4.5V3h4v1.5M4 4.5l.7 9h6.6l.7-9'/%3E%3C/svg%3E");
}

/* icons in the Tools menu */
#Tools-Menu a[href]::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin: 0 8px -2px 0;
	background-color: var(--fm-text-muted);
	-webkit-mask: var(--fm-tool-icon, none) center / contain no-repeat;
	mask: var(--fm-tool-icon, none) center / contain no-repeat;
}

#Tools-Menu a[href="#NodeMeasures-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Ccircle cx='8' cy='8' r='2.5'/%3E%3Cpath d='M8 1v3.5M8 11.5V15M1 8h3.5M11.5 8H15'/%3E%3C/svg%3E"); }
#Tools-Menu a[href="#Regionalization-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4'%3E%3Ccircle cx='4' cy='5' r='2'/%3E%3Ccircle cx='4' cy='11.5' r='2'/%3E%3Ccircle cx='12' cy='8' r='2.5'/%3E%3Cpath d='M5.8 5.8l3.9 1.4M5.8 10.7l3.9-1.6M4 7v2.5'/%3E%3C/svg%3E"); }
#Tools-Menu a[href="#FlowCoordsToNodes-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M2 12l5-7 7 4'/%3E%3Ccircle cx='2' cy='12' r='1.5' fill='black'/%3E%3Ccircle cx='7' cy='5' r='1.5' fill='black'/%3E%3Ccircle cx='14' cy='9' r='1.5' fill='black'/%3E%3C/svg%3E"); }
#Tools-Menu a[href="#FlowMatrixToFlowList-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4'%3E%3Crect x='1.5' y='1.5' width='13' height='13' rx='1.5'/%3E%3Cpath d='M1.5 6h13M1.5 10.5h13M6 1.5v13M10.5 1.5v13'/%3E%3C/svg%3E"); }
#Tools-Menu a[href="#NormalizeFlows-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M2 14V9M6 14V4M10 14V7M14 14V2'/%3E%3C/svg%3E"); }
#Tools-Menu a[href="#PolygonsToPoints-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'%3E%3Cpath d='M2 4l6-2.5L14 5l-1 8-7 1.5L2 11z'/%3E%3Ccircle cx='8' cy='8' r='1.6' fill='black'/%3E%3C/svg%3E"); }
#Tools-Menu a[href="#VideoTutorial-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Crect x='1.5' y='3' width='13' height='10' rx='2'/%3E%3Cpath d='M6.5 5.8v4.4L10.2 8z' fill='black'/%3E%3C/svg%3E"); }
#Tools-Menu a[href="#TutorialData-Block"] { --fm-tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M3 1.5h6.5L13 5v9.5H3z'/%3E%3Cpath d='M9.5 1.5V5H13'/%3E%3C/svg%3E"); }

.Help-Figure {
	display: block;
	width: 100%;
	max-width: 620px;
	height: auto;
	margin: 10px auto 0;
	border: 1px solid var(--fm-border);
	border-radius: 10px;
	background: #fff;
	padding: 6px;
}

#SideBar-Div select.Region-Library {
	margin-top: 6px;
	font-size: 12.5px;
	color: var(--fm-text-muted);
}

/* ---------- Customize flow symbology (Flows tab) ---------- */
#SideBar-Div button.Disclosure-Btn {
	background: var(--fm-surface) !important;
	color: var(--fm-text) !important;
	border: 1px solid var(--fm-border) !important;
	font-size: 12.5px !important;
	padding: 3px 10px 3px 8px !important;
	height: auto !important;
	width: auto !important;
}
#SideBar-Div button.Disclosure-Btn::before {
	content: "\25B8"; display: inline-block; margin-right: 6px; transition: transform .15s ease;
}
#SideBar-Div button.Disclosure-Btn.Is-Open::before { transform: rotate(90deg); }
#SideBar-Div button.Disclosure-Btn:hover { background: var(--fm-surface-hover) !important; }
.Symbology-Box {
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	background: var(--fm-surface);
	padding: 8px 10px;
	margin: 4px 0 2px;
}
.Symbology-Box .Sym-Row {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas: "lab out" "inp inp";
	align-items: center;
	gap: 0 6px;
	margin: 4px 0;
	font-size: 12.5px;
	color: var(--fm-text);
	cursor: default;
}
.Symbology-Box .Sym-Row > span { grid-area: lab; }
.Symbology-Box .Sym-Row > output { grid-area: out; }
.Symbology-Box .Sym-Row input[type=range] { grid-area: inp; width: 100%; accent-color: var(--fm-accent); margin: 0; }
.Symbology-Box output { font-variant-numeric: tabular-nums; color: var(--fm-text-muted); text-align: right; font-size: 12px; }
.Symbology-Box .Is-Disabled { opacity: .42; }
.Symbology-Box .Sym-Section { border-top: 1px solid var(--fm-border); margin-top: 6px; padding-top: 6px; }
.Symbology-Box .Sym-Check { font-size: 12.5px; margin: 0 0 2px; display: flex; gap: 6px; align-items: center; color: var(--fm-text); }
.Symbology-Note { font-size: 11.5px; color: var(--fm-text-muted); margin: 0 0 4px; }
#SideBar-Div #FlowSym_Reset-Btn { font-size: 12px !important; padding: 2px 10px !important; height: auto !important; width: auto !important; }

/* ---------- Regionalization: confirm box ---------- */
.Confirm-Box {
	border: 1px solid var(--fm-accent);
	background: var(--fm-accent-soft);
	border-radius: var(--fm-radius);
	padding: 10px 12px;
	margin: 6px 0 10px;
	text-align: left;
}
.Confirm-Box p { margin: 0 0 6px; }
.Confirm-Box .btn { margin: 2px 3px; }

/* ---------- Contact window ---------- */
#Contact-Block { max-width: 760px; }
#Contact-Block .Contact-Email { font-weight: 600; }
.Contact-Grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.Contact-Card { border: 1px solid var(--fm-border); border-radius: var(--fm-radius); background: var(--fm-surface); padding: 10px 12px; text-align: left; }
.Contact-Card h2, .Contact-Sub { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: var(--fm-text); }
.Contact-Sub { margin-top: 12px; }
.Contact-Card p { font-size: 13px; color: var(--fm-text-muted); margin: 0; line-height: 1.45; }
.Contact-Links { padding-left: 18px; margin: 4px 0 0; font-size: 13.5px; }
.Contact-Links li { margin: 2px 0; }

/* ---------- Dark mode (View > Dark mode) ---------- */
:root[data-theme="dark"] {
	--fm-bg: #16181d;
	--fm-surface: #1f2229;
	--fm-surface-hover: #292d36;
	--fm-border: #343944;
	--fm-border-strong: #4a505d;
	--fm-text: #e8eaee;
	--fm-text-muted: #a3a9b5;
	--fm-accent: #5b8cff;
	--fm-accent-hover: #7aa2ff;
	--fm-accent-press: #3f74f0;
	--fm-accent-soft: rgba(91, 140, 255, 0.18);
	color-scheme: dark;
}
:root[data-theme="dark"] body { background: var(--fm-bg); color: var(--fm-text); }
:root[data-theme="dark"] #SideBar-Div,
:root[data-theme="dark"] #SideBar-Div .tab-content,
:root[data-theme="dark"] #SideBar-Div table,
:root[data-theme="dark"] .white-popup,
:root[data-theme="dark"] .dropdown-menu,
:root[data-theme="dark"] #Legend,
:root[data-theme="dark"] #Legend > svg,
:root[data-theme="dark"] #MapScale-Box {
	background-color: var(--fm-bg) !important;
	color: var(--fm-text) !important;
	border-color: var(--fm-border) !important;
}
:root[data-theme="dark"] #SideBar-Div td,
:root[data-theme="dark"] #SideBar-Div label,
:root[data-theme="dark"] #SideBar-Div p,
:root[data-theme="dark"] .white-popup h1,
:root[data-theme="dark"] .white-popup p,
:root[data-theme="dark"] .white-popup td,
:root[data-theme="dark"] .white-popup label,
:root[data-theme="dark"] .white-popup li { color: var(--fm-text) !important; }
:root[data-theme="dark"] #SideBar-Div input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
:root[data-theme="dark"] #SideBar-Div select,
:root[data-theme="dark"] #SideBar-Div textarea,
:root[data-theme="dark"] .white-popup input:not([type=checkbox]):not([type=radio]):not([type=file]),
:root[data-theme="dark"] .white-popup select {
	background-color: var(--fm-surface) !important;
	color: var(--fm-text) !important;
	border-color: var(--fm-border-strong) !important;
}
:root[data-theme="dark"] .white-popup a,
:root[data-theme="dark"] #SideBar-Div a { color: var(--fm-accent-hover); }
:root[data-theme="dark"] #Legend text { fill: var(--fm-text) !important; }
:root[data-theme="dark"] .Tool-Figure,
:root[data-theme="dark"] .Help-Figure { background: #ffffff; border-radius: 8px; }
:root[data-theme="dark"] #MapScale-Box input { background: transparent !important; color: var(--fm-text) !important; }
:root[data-theme="dark"] #GeosocialLogo-Img { filter: invert(1) hue-rotate(180deg); }
:root[data-theme="dark"] .ol-scale-line, :root[data-theme="dark"] #MapScale-Box .ol-scale-line-inner { background: var(--fm-bg) !important; color: var(--fm-text) !important; border-color: var(--fm-text) !important; }
#Contact-Block .Contact-Email { white-space: nowrap; }

/* number box value corrected to its allowed range (InputGuards.js) */
#SideBar-Div input.Input-Adjusted, .white-popup input.Input-Adjusted {
	box-shadow: 0 0 0 2px rgba(232, 89, 12, 0.55) !important;
	transition: box-shadow .2s ease;
}
/* settings that do not apply to the current choices (SettingRules.js) */
#SideBar-Div .Setting-NA { opacity: .45; }
#SideBar-Div .Setting-NA input, #SideBar-Div .Setting-NA select, #SideBar-Div .Setting-NA button:not(.Help-Btn) { pointer-events: none; }

/* ---------- Menu windows: About, Tutorial data, Video, Help, messages ---------- */
.Menu-Window { max-width: 720px; }
.Menu-Window h1 { font-size: 20px !important; font-weight: 700 !important; margin: 0 0 6px !important; height: auto !important; color: var(--fm-text); }
.Menu-Window .Menu-Section { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fm-text-muted); margin: 18px 0 8px; text-align: left; }
.Menu-Window .Menu-Muted { color: var(--fm-text-muted); font-size: 13px; }
.Menu-Window .Menu-Footer { font-size: 12.5px; color: var(--fm-text-muted); border-top: 1px solid var(--fm-border); padding-top: 10px; margin: 16px 0 0; text-align: left; }
.Menu-Window .Menu-Kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fm-accent); margin: 0 0 2px; text-align: left; }
.Menu-Hero { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.Menu-Hero-Logo { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.Menu-Hero h1 { font-size: 24px !important; margin: 0 !important; }
.Menu-Hero-Sub { margin: 2px 0 0; color: var(--fm-text-muted); font-size: 13.5px; text-align: left; }
.Menu-Meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; padding-bottom: 12px; border-bottom: 1px solid var(--fm-border); }
.Menu-Pill { background: var(--fm-accent-soft); color: var(--fm-accent); font-weight: 700; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.Menu-Link { font-weight: 600; }
.Menu-Team { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; text-align: left; }
.Menu-Team dt { font-weight: 600; color: var(--fm-text); }
.Menu-Team dd { margin: 0; color: var(--fm-text-muted); }
.Menu-Cite { border: 1px solid var(--fm-border); background: var(--fm-surface); border-radius: var(--fm-radius); padding: 10px 12px; text-align: left; }
.Menu-Cite p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: var(--fm-text); }
.Menu-Cite a { word-break: break-all; }
.Menu-Window .Menu-Copy-Btn, .Menu-Window .Menu-Close-Btn, .Menu-Window .Menu-Btn { font-size: 12.5px !important; padding: 4px 14px !important; height: auto !important; width: auto !important; }
.Menu-Steps { text-align: left; padding-left: 20px; margin: 0; font-size: 13.5px; line-height: 1.5; }
.Menu-Steps li { margin: 3px 0; }
.Menu-Video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--fm-radius); overflow: hidden; background: #000; margin-top: 8px; }
.Menu-Video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.Help-Window #Instructions-P { font-size: 13.5px; line-height: 1.55; }
.Message-Head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.Message-Head h1 { margin: 0 !important; }
.Message-Icon { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; background: #d9480f; }
.Message-Window p, .Message-Window li { font-size: 13.5px; }
.Message-Tips { margin-top: 6px; }
.Message-Actions { margin: 12px 0 0 !important; }
.Join-Stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.Join-Stats > div { border: 1px solid var(--fm-border); border-radius: var(--fm-radius); padding: 8px; text-align: center; background: var(--fm-surface); font-size: 12px; color: var(--fm-text-muted); display: flex; flex-direction: column; }
.Join-Stats .Join-Num { font-size: 22px; font-weight: 700; color: var(--fm-text); font-variant-numeric: tabular-nums; }
.Join-Stats .Is-Good .Join-Num { color: #0f9d58; }
.Join-Stats .Is-Warn .Join-Num { color: #d9480f; }
@media (max-width: 900px) { .Menu-Window { width: 92% !important; } }
:root[data-theme="dark"] .Menu-Hero-Logo { box-shadow: 0 0 0 1px var(--fm-border); }
.Menu-Window a.Menu-Btn, .Menu-Window a.Menu-Btn:hover, .Menu-Window a.Menu-Btn:visited { color: #fff !important; text-decoration: none !important; display: inline-block; }
