/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}


/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #ddd;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #0078A8;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	}
.leaflet-bar a {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: black;
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #f4f4f4;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: #fff;
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(images/layers.png);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(images/layers-2x.png);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: #333;
	background: #fff;
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(images/marker-icon.png);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: #333;
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #777;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(255, 255, 255, 0.8);
	text-shadow: 1px 1px #fff;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #777;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #777;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: white;
	color: #333;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid #999;
	}


/* div icon */

.leaflet-div-icon {
	background: #fff;
	border: 1px solid #666;
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: #fff;
	border: 1px solid #fff;
	border-radius: 3px;
	color: #222;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: #fff;
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: #fff;
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: #fff;
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: #fff;
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}

/* Bidadari GeoViewer — workspace styles. System fonts only; no external requests. */
:root {
  --bg: #f4f6f8; --surface: #ffffff; --surface-2: #f8fafb; --surface-3: #eef1f4;
  --border: #d9dfe5; --border-strong: #c3ccd5;
  --text: #17212b; --text-2: #4a5866; --text-3: #738190;
  --accent: #0e6e8c; --accent-hover: #0b5a73; --accent-soft: #e2f1f6; --accent-text: #ffffff;
  --ok: #1a7f4b; --ok-soft: #e1f3e9; --warn: #9a6200; --warn-soft: #fbf0d9; --err: #b3261e; --err-soft: #fbe6e4;
  --shadow-1: 0 1px 2px rgba(15, 30, 45, .08); --shadow-2: 0 6px 24px rgba(15, 30, 45, .16);
  --radius: 6px; --radius-lg: 10px;
  --left-w: 300px; --right-w: 330px; --table-h: 260px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f151b; --surface: #171e26; --surface-2: #1b232c; --surface-3: #212b36;
  --border: #2a3643; --border-strong: #3a4857;
  --text: #e7edf3; --text-2: #aab6c3; --text-3: #7f8d9b;
  --accent: #38a9c9; --accent-hover: #5bbad6; --accent-soft: #14323d; --accent-text: #06222b;
  --ok: #4cc38a; --ok-soft: #12301f; --warn: #e3a93b; --warn-soft: #33270f; --err: #ff8a80; --err-soft: #3a1815;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f151b; --surface: #171e26; --surface-2: #1b232c; --surface-3: #212b36;
    --border: #2a3643; --border-strong: #3a4857;
    --text: #e7edf3; --text-2: #aab6c3; --text-3: #7f8d9b;
    --accent: #38a9c9; --accent-hover: #5bbad6; --accent-soft: #14323d; --accent-text: #06222b;
    --ok: #4cc38a; --ok-soft: #12301f; --warn: #e3a93b; --warn-soft: #33270f; --err: #ff8a80; --err-soft: #3a1815;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 6px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 var(--font); color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ico { display: inline-flex; vertical-align: middle; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- App frame ---------- */
#app { display: grid; grid-template-rows: 48px 1fr 26px; height: 100%; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 1200; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.brand-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.brand small { font-weight: 400; color: var(--text-3); margin-left: 2px; }
.topbar .spacer { flex: 1; }
.search { position: relative; width: min(380px, 36vw); }
.search input[type="search"] { width: 100%; height: 32px; padding: 0 10px 0 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.search .ico { position: absolute; left: 9px; top: 7px; color: var(--text-3); }
.search-results { position: absolute; top: 36px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-2); max-height: 50vh; overflow: auto; z-index: 1500; }
.search-results .grp { padding: 6px 10px 2px; font-size: 11px; color: var(--text-3); text-transform: none; font-weight: 600; }
.search-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; }
.search-results button:hover, .search-results button:focus-visible { background: var(--accent-soft); }

.workspace { display: grid; grid-template-columns: var(--left-w) 1fr var(--right-w); min-height: 0; position: relative; }
.workspace.left-collapsed { grid-template-columns: 0 1fr var(--right-w); }
.workspace.right-collapsed { grid-template-columns: var(--left-w) 1fr 0; }
.workspace.left-collapsed.right-collapsed { grid-template-columns: 0 1fr 0; }
.side { background: var(--surface); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; position: relative; }
#left { border-right: 1px solid var(--border); }
#right { border-left: 1px solid var(--border); }
.left-collapsed #left, .right-collapsed #right { border: 0; visibility: hidden; }
.resizer { position: absolute; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 5; }
#left .resizer { right: 0; } #right .resizer { left: 0; }
.resizer:hover, .resizer.active { background: var(--accent); opacity: .35; }
.center { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; position: relative; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #d5dde3; }
:root[data-theme="dark"] #map { background: #1b232c; }
#map.gv-blank-basemap { background: var(--surface-3); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }

.panel-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 600; background: var(--surface); }
.panel-head .grow { flex: 1; }
.panel-body { overflow: auto; min-height: 0; flex: 1; }
.section-title { padding: 10px 12px 4px; font-size: 11.5px; font-weight: 650; color: var(--text-3); }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--err); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-2); }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
input[type="text"], input[type="url"], input[type="number"], input[type="search"], input[type="password"], select, textarea { height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); width: 100%; }
textarea { height: auto; padding: 6px 8px; resize: vertical; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
label.field { display: grid; gap: 4px; margin-bottom: 10px; font-weight: 600; font-size: 12px; color: var(--text-2); }
label.field > :not(span) { font-weight: 400; color: var(--text); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- Left panel ---------- */
.explorer { padding: 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); }
.explorer .btn.primary { height: 34px; }
.explorer-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.layer-group-title { display: flex; align-items: center; gap: 6px; padding: 8px 12px 4px; font-size: 11.5px; font-weight: 650; color: var(--text-3); }
.layer-group-title .count { margin-left: auto; font-weight: 500; }
.empty { padding: 22px 16px; text-align: center; color: var(--text-3); }
.empty strong { display: block; color: var(--text-2); margin-bottom: 4px; }
.layer-item { margin: 2px 6px; padding: 6px 6px 6px 4px; border: 1px solid transparent; border-radius: var(--radius); }
.layer-item:hover { background: var(--surface-2); }
.layer-item.selected { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.layer-item.dragging { opacity: .5; }
.layer-line { display: flex; align-items: center; gap: 4px; }
.layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-weight: 550; }
.layer-src { color: var(--text-3); }
.layer-actions { display: flex; align-items: center; gap: 0; margin-top: 4px; padding-left: 28px; }
.layer-actions .icon-btn { width: 26px; height: 26px; }
.layer-opacity { display: flex; align-items: center; gap: 8px; padding: 2px 0 0 28px; }
.layer-opacity input { height: 16px; }
.layer-opacity span { width: 34px; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.layer-status { font-size: 11.5px; padding: 3px 0 0 28px; color: var(--text-3); }
.layer-status.err { color: var(--err); } .layer-status.warn { color: var(--warn); }
.spinner { width: 13px; height: 13px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } * { scroll-behavior: auto !important; } }
.children { margin: 4px 0 0 26px; border-left: 1px solid var(--border); padding-left: 6px; max-height: 220px; overflow: auto; }
.child-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.child-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; min-width: 0; }
.child-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-list { padding: 0 6px 8px; }

/* ---------- Map overlays ---------- */
.map-toolbar { position: absolute; top: 10px; left: 10px; z-index: 800; display: flex; flex-direction: column; gap: 6px; }
.tool-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 3px; display: flex; flex-direction: column; gap: 2px; }
.map-basemap { position: absolute; bottom: 30px; right: 10px; z-index: 800; }
.map-basemap select { width: auto; height: 28px; box-shadow: var(--shadow-1); }
.map-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 800; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; box-shadow: var(--shadow-1); color: var(--text-2); pointer-events: none; }
.map-empty { position: absolute; inset: 0; z-index: 700; display: grid; place-items: center; pointer-events: none; }
.map-empty .card { pointer-events: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-2); max-width: 380px; text-align: center; }
.map-empty h2 { margin: 0 0 6px; font-size: 16px; }
.map-empty p { margin: 0 0 14px; color: var(--text-2); }
.map-empty .row { justify-content: center; }
.measure-readout { position: absolute; top: 10px; left: 56px; z-index: 800; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; box-shadow: var(--shadow-1); min-width: 160px; }
.measure-readout .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.measure-tip { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow-1); }
.dragbox { border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- Table panel ---------- */
.table-panel { background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-direction: column; height: var(--table-h); min-height: 0; position: relative; }
.table-panel.collapsed { height: 34px; }
.table-panel.collapsed .table-body, .table-panel.collapsed .table-foot, .table-panel.collapsed .table-tools { display: none; }
.table-resizer { position: absolute; top: -3px; left: 0; right: 0; height: 6px; cursor: row-resize; z-index: 5; }
.table-resizer:hover, .table-resizer.active { background: var(--accent); opacity: .35; }
.table-head { display: flex; align-items: center; gap: 8px; padding: 0 8px; height: 34px; border-bottom: 1px solid var(--border); flex: none; }
.table-head select { width: auto; max-width: 260px; height: 26px; }
.table-count { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; }
.table-tools { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-note { padding: 4px 10px; font-size: 12px; color: var(--warn); background: var(--warn-soft); }
.table-body { flex: 1; overflow: auto; min-height: 0; }
table.attr { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 12.5px; }
table.attr th { min-width: 72px; position: sticky; top: 0; background: var(--surface-3); border-bottom: 1px solid var(--border-strong); border-right: 1px solid var(--border); text-align: left; padding: 0; white-space: nowrap; z-index: 2; }
.th-btn { display: flex; align-items: center; gap: 4px; width: 100%; padding: 5px 8px; border: 0; background: none; font-weight: 650; text-align: left; }
.th-btn:hover { background: var(--border); }
table.attr th.sel, table.attr td.sel { width: 30px; text-align: center; padding: 0 6px; position: sticky; left: 0; z-index: 3; background: var(--surface-3); }
table.attr td.sel { background: var(--surface); z-index: 1; }
table.attr td { padding: 4px 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--surface-3); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; cursor: default; }
table.attr tbody tr:hover td { background: var(--surface-2); }
table.attr tbody tr.selected td { background: var(--accent-soft); }
table.attr tbody tr.selected td.sel { background: var(--accent-soft); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.null { color: var(--text-3); font-style: italic; }
.colsearch th { top: 28px; background: var(--surface-2); }
.colsearch input { height: 22px; border: 0; border-radius: 0; background: transparent; padding: 0 8px; font-size: 12px; }
.table-foot { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-top: 1px solid var(--border); flex: none; }
.table-foot .grow { color: var(--text-2); }

/* ---------- Inspector ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; flex: none; }
.tab { padding: 9px 8px; border: 0; background: none; border-bottom: 2px solid transparent; color: var(--text-2); white-space: nowrap; font-weight: 550; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { padding: 10px 12px 16px; overflow: auto; flex: 1; min-height: 0; }
.kv { display: grid; grid-template-columns: minmax(80px, 36%) 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.kv > div { padding: 5px 8px; border-bottom: 1px solid var(--border); word-break: break-word; min-width: 0; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv > .k { background: var(--surface-2); color: var(--text-2); font-weight: 550; }
.kv a { color: var(--accent); }
.result-list { display: grid; gap: 4px; margin-bottom: 10px; }
.result-item { text-align: left; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.result-item:hover { background: var(--surface-2); }
.result-item.active { border-color: var(--accent); background: var(--accent-soft); }
.result-item small { display: block; color: var(--text-3); }
.pre { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; max-height: 220px; overflow: auto; }
.legend-group { margin-bottom: 10px; }
.legend-group h4 { margin: 0 0 4px; font-size: 12px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.swatch { width: 18px; height: 18px; border-radius: 3px; border: 1.5px solid; flex: none; }
.swatch.point { border-radius: 50%; }
.swatch.line { height: 0; border-width: 0 0 3px 0; border-radius: 0; align-self: center; margin-top: 1px; }
.legend-img { max-width: 100%; height: auto; }
.diag-step { display: flex; gap: 8px; padding: 5px 0; align-items: flex-start; }
.diag-step .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--text-3); flex: none; }
.diag-step.ok .dot { background: var(--ok); } .diag-step.err .dot { background: var(--err); } .diag-step.warn .dot { background: var(--warn); }

/* ---------- Messages ---------- */
.msg { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 10px; background: var(--surface-2); }
.msg.err { border-color: color-mix(in srgb, var(--err) 45%, transparent); background: var(--err-soft); }
.msg.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.msg.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.msg h4 { margin: 0 0 4px; font-size: 13px; }
.msg p { margin: 2px 0 6px; } .msg p b { font-weight: 650; }
.msg details summary { cursor: pointer; color: var(--text-2); }
.msg pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-all; font: 11.5px var(--mono); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.err { background: var(--err-soft); color: var(--err); }

/* ---------- Dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 20, 30, .5); z-index: 3000; display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-2); width: min(680px, 100%); max-height: min(780px, 92vh); display: flex; flex-direction: column; }
.dialog.narrow { width: min(460px, 100%); }
.dialog-head { display: flex; align-items: center; padding: 12px 14px 8px 18px; }
.dialog-head h2 { margin: 0; font-size: 16px; flex: 1; }
.dialog-body { padding: 4px 18px 18px; overflow: auto; flex: 1; min-height: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--border); }
.dtabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.dtab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; background: none; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 550; }
.dtab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 28px 16px; text-align: center; color: var(--text-2); background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.privacy { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; margin-top: 8px; }
.pick-list { border: 1px solid var(--border); border-radius: var(--radius); max-height: 240px; overflow: auto; margin: 6px 0 12px; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.pick-row:last-child { border-bottom: 0; }
.pick-row label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.pick-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row.group { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.samples { display: grid; gap: 8px; }
.sample { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.sample .grow b { display: block; }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress > i { display: block; height: 100%; width: 40%; background: var(--accent); animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 4px; height: 14px; margin: 8px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Status bar ---------- */
.statusbar { display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--surface); border-top: 1px solid var(--border); color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; }
.statusbar .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.statusbar .mono { font-variant-numeric: tabular-nums; }

#toasts { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 4000; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow-2); max-width: 90vw; pointer-events: auto; }
.toast-error { background: var(--err); color: #fff; } .toast-ok { background: var(--ok); color: #fff; } .toast-warn { background: var(--warn); color: #fff; }

.menu { position: absolute; z-index: 2500; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 4px; min-width: 190px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; background: none; text-align: left; border-radius: 4px; }
.menu button:hover { background: var(--accent-soft); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- Mobile / tablet ---------- */
.mobile-nav { display: none; }
@media (max-width: 1100px) {
  :root { --left-w: 260px; --right-w: 290px; }
  .brand small { display: none; }
}
@media (max-width: 820px) {
  #app { grid-template-rows: 48px 1fr 26px; }
  .search { width: auto; flex: 1; }
  .brand span.name { display: none; }
  .workspace, .workspace.left-collapsed, .workspace.right-collapsed { display: block; }
  .center { position: absolute; inset: 0; grid-template-rows: 1fr; }
  #left, #right { position: absolute; left: 0; right: 0; bottom: 52px; top: auto; height: 58%; z-index: 1100; border: 0; border-top: 1px solid var(--border); border-radius: 14px 14px 0 0; box-shadow: var(--shadow-2); visibility: hidden; transform: translateY(105%); transition: transform .2s ease; }
  #left.sheet-open, #right.sheet-open { visibility: visible; transform: none; }
  .table-panel { position: absolute; left: 0; right: 0; bottom: 52px; height: 58%; z-index: 1100; border-radius: 14px 14px 0 0; box-shadow: var(--shadow-2); transform: translateY(105%); visibility: hidden; transition: transform .2s ease; }
  .table-panel.sheet-open { transform: none; visibility: visible; }
  .table-panel.collapsed { height: 58%; }
  .resizer, .table-resizer { display: none; }
  .map-wrap { position: absolute; inset: 0 0 52px 0; }
  .mobile-nav { display: grid; grid-template-columns: repeat(3, 1fr); position: absolute; left: 0; right: 0; bottom: 0; height: 52px; background: var(--surface); border-top: 1px solid var(--border); z-index: 1200; }
  .mobile-nav button { display: grid; place-items: center; gap: 0; border: 0; background: none; color: var(--text-2); font-size: 11px; padding: 4px; }
  .mobile-nav button[aria-pressed="true"] { color: var(--accent); }
  .map-basemap { bottom: 62px; right: 8px; }
  .map-toolbar { top: 8px; left: 8px; }
  .measure-readout { left: 56px; }
  .hide-mobile, #btn-theme { display: none !important; }
  .leaflet-control-attribution { max-width: 60vw; }
  .dialog { max-height: 96vh; }
  .statusbar .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { #left, #right, .table-panel { transition: none; } }

.map-wrap.drop-target::after { content: "Drop files to open them"; position: absolute; inset: 8px; z-index: 1000; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--surface) 82%, transparent); font-weight: 650; font-size: 16px; pointer-events: none; }
