/* উপজেলার মানচিত্র v2 (2026-10-14) */
.mx-wrap { --mx-ink: var(--ink, #1E2723); --mx-muted: var(--muted, #6B6255); --mx-line: var(--border-soft, #E3DFD3); --mx-surface: var(--surface, #fff); }

/* toolbar */
.mx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.mx-seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--mx-surface); border: 1px solid var(--mx-line); box-shadow: 0 4px 14px rgba(20,40,30,.06); }
.mx-seg button { border: 0; background: transparent; color: var(--mx-ink); font-weight: 700; font-size: .9rem; padding: .5rem 1rem; border-radius: 999px; transition: background .2s, color .2s; white-space: nowrap; }
.mx-seg button.is-on { background: #0E6E4C; color: #fff; box-shadow: 0 4px 12px rgba(14,110,76,.3); }
.mx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mx-chips[hidden] { display: none; }
.mx-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--mx-line); background: var(--mx-surface); color: var(--mx-ink); border-radius: 999px; padding: .35rem .8rem .35rem .4rem; font-size: .85rem; font-weight: 600; transition: all .18s; }
.mx-chip b { font-size: .75rem; color: var(--mx-muted); font-weight: 700; }
.mx-chip .mx-sw { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-size: .72rem; }
.mx-chip:not(.is-on) { opacity: .55; }
.mx-chip:not(.is-on) .mx-sw { background: #b9b5aa; }
.mx-chip.mx-metric { padding: .4rem .85rem; }
.mx-chip.mx-metric i { color: #256abf; }
.mx-chip.mx-metric.is-on { background: #104281; border-color: #104281; color: #fff; opacity: 1; }
.mx-chip.mx-metric.is-on i { color: #cde2fb; }

/* layout */
.mx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.mx-mapbox { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--mx-line); box-shadow: 0 18px 44px rgba(20,40,30,.14); background: #e9ede8; }
.mx-map { height: min(76vh, 680px); min-height: 460px; width: 100%; }
.mx-mapbox:fullscreen .mx-map, .mx-mapbox.is-full .mx-map { height: 100vh; }
.mx-mapbox.is-full { position: fixed; inset: 0; z-index: 2000; border-radius: 0; }
.mx-loading, .mx-fail { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mx-muted); text-align: center; gap: 8px; padding: 20px; }
.mx-map.is-compare .leaflet-tile-pane { filter: saturate(.35) brightness(1.04); }

.mx-tools { position: absolute; z-index: 500; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.mx-base { display: inline-flex; background: rgba(255,255,255,.94); border-radius: 12px; padding: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.14); backdrop-filter: blur(6px); }
.mx-base button { border: 0; background: transparent; font-size: .8rem; font-weight: 700; padding: .35rem .65rem; border-radius: 9px; color: #333; }
.mx-base button.is-on { background: #0E6E4C; color: #fff; }
.mx-tbtn { border: 0; background: rgba(255,255,255,.94); border-radius: 12px; padding: .4rem .7rem; font-size: .8rem; font-weight: 700; color: #1E2723; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.mx-tbtn:hover { background: #fff; color: #0E6E4C; }

.mx-legend { position: absolute; z-index: 500; left: 12px; bottom: 26px; background: rgba(255,255,255,.95); border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.15); font-size: .78rem; color: #1E2723; max-width: 220px; backdrop-filter: blur(6px); }
.mx-lg-t { font-weight: 700; font-size: .78rem; margin-bottom: 6px; color: #0A3D2B; }
.mx-lg-row { display: flex; align-items: center; gap: 7px; line-height: 1.2; margin: 3px 0; }
.mx-lg-row.is-off { opacity: .4; }
.mx-lg-pin { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-size: .55rem; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.mx-lg-sw { width: 20px; height: 12px; border-radius: 4px; border: 1px solid rgba(0,0,0,.08); }

/* union labels */
.mx-lbl { pointer-events: none; }
.mx-ulabel { display: inline-flex; align-items: center; gap: 5px; transform: translate(-50%, -50%); white-space: nowrap; font-family: var(--font-display, inherit); font-weight: 700; font-size: .8rem; color: #0A3D2B; background: rgba(255,255,255,.9); padding: .1rem .55rem; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.mx-ulabel b { font-size: .74rem; background: #104281; color: #fff; border-radius: 999px; padding: 0 .4rem; }
.mx-ulabel.is-on { background: #0A3D2B; color: #fff; }
.mx-map.is-far .mx-ulabel:not(.is-on):not(.has-n) { font-size: .68rem; padding: 0 .4rem; }
.mx-tip { font-family: var(--font-body, inherit); font-size: .82rem; border-radius: 10px; }

/* pins + clusters */
.mx-pin { background: none; border: 0; }
.mx-pin span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.28); }
.mx-pin span i { transform: rotate(45deg); color: #fff; font-size: .78rem; }
.mx-cluster { background: none; }
.mx-cluster span { display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: .85rem; border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 28%, transparent), 0 6px 14px rgba(0,0,0,.25); }

.mx-pop { font-family: var(--font-body, inherit); min-width: 210px; }
.mx-pop-k { display: inline-flex; gap: 5px; align-items: center; font-size: .74rem; font-weight: 700; color: #fff; background: var(--c); border-radius: 999px; padding: .1rem .55rem; margin-bottom: 5px; }
.mx-pop strong { display: block; font-family: var(--font-display, inherit); font-size: 1.02rem; color: #0A3D2B; line-height: 1.3; }
.mx-pop-a { font-size: .78rem; color: #6B6255; margin-top: 3px; }
.mx-pop-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mx-pop-act a { font-size: .78rem; font-weight: 700; text-decoration: none; padding: .25rem .6rem; border-radius: 999px; background: #EEF5F1; color: #0E6E4C; }
.mx-pop-act a:hover { background: #0E6E4C; color: #fff; }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.2); }

/* side panel */
.mx-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 96px); }
.mx-detail { background: linear-gradient(160deg, #0E6E4C, #0A3D2B); color: #fff; border-radius: 22px; padding: 16px; box-shadow: 0 12px 30px rgba(10,61,43,.25); }
.mx-d-head { display: flex; gap: 10px; align-items: flex-start; }
.mx-d-head h2 { font-size: 1.15rem; margin: 0; color: #fff; line-height: 1.3; }
.mx-d-kicker { font-size: .72rem; letter-spacing: .03em; opacity: .75; }
.mx-back { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(255,255,255,.14); color: #fff; }
.mx-back:hover { background: rgba(255,255,255,.25); }
.mx-d-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; opacity: .85; margin-top: 6px; }
.mx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.mx-stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; transition: background .15s; }
a.mx-stat:hover { background: rgba(255,255,255,.2); color: #fff; }
.mx-stat i { grid-row: span 2; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.14); font-size: .8rem; }
.mx-stat b { font-size: 1.1rem; line-height: 1; }
.mx-stat span { font-size: .72rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-hint { margin: 10px 0 0; font-size: .76rem; opacity: .75; }
.mx-vill { margin-top: 10px; font-size: .82rem; }
.mx-vill summary { cursor: pointer; font-weight: 700; opacity: .9; }
.mx-vill div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-height: 120px; overflow-y: auto; }
.mx-vill a { font-size: .74rem; background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: .1rem .5rem; text-decoration: none; }
.mx-vill a:hover { background: #fff; color: #0A3D2B; }
.mx-go { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; font-weight: 700; font-size: .85rem; color: #0A3D2B; background: #F4D88C; padding: .45rem .9rem; border-radius: 999px; text-decoration: none; }
.mx-go:hover { background: #fff; color: #0A3D2B; }

.mx-search { display: flex; align-items: center; gap: 8px; background: var(--mx-surface); border: 1px solid var(--mx-line); border-radius: 14px; padding: .5rem .8rem; }
.mx-search i { color: var(--mx-muted); }
.mx-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: .9rem; color: var(--mx-ink); }
.mx-rank-head { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; color: var(--mx-muted); padding: 0 6px; }
.mx-rank { list-style: none; margin: 0; padding: 6px; overflow-y: auto; background: var(--mx-surface); border: 1px solid var(--mx-line); border-radius: 18px; min-height: 120px; }
.mx-rank button { width: 100%; display: grid; grid-template-columns: 92px 1fr 34px; gap: 8px; align-items: center; border: 0; background: transparent; padding: .45rem .5rem; border-radius: 10px; color: var(--mx-ink); text-align: left; }
.mx-rank button:hover { background: var(--bg-soft, #F4F1E8); }
.mx-rank button.is-on { background: rgba(14,110,76,.1); }
.mx-r-name { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-r-bar { height: 8px; border-radius: 999px; background: #EFECE4; overflow: hidden; }
.mx-r-bar i { display: block; height: 100%; border-radius: 999px; }
.mx-rank b { font-size: .82rem; text-align: right; }

html[data-bs-theme="dark"] .mx-legend, html[data-bs-theme="dark"] .mx-base, html[data-bs-theme="dark"] .mx-tbtn { background: rgba(26,32,29,.94); color: #EDEAE2; }
html[data-bs-theme="dark"] .mx-base button { color: #EDEAE2; }
html[data-bs-theme="dark"] .mx-lg-t { color: #BFE6D2; }
html[data-bs-theme="dark"] .mx-r-bar { background: rgba(255,255,255,.08); }

@media (max-width: 991.98px) {
  .mx-layout { grid-template-columns: 1fr; }
  .mx-side { position: static; max-height: none; }
  .mx-rank { max-height: 360px; }
  .mx-map { height: 64vh; min-height: 380px; }
}
@media (max-width: 575px) {
  .mx-seg { width: 100%; }
  .mx-seg button { flex: 1; padding: .5rem .5rem; font-size: .82rem; }
  .mx-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; width: 100%; }
  .mx-chips::-webkit-scrollbar { display: none; }
  .mx-chip { flex: 0 0 auto; }
  .mx-legend { bottom: 22px; font-size: .72rem; padding: 8px 10px; max-width: 170px; }
  .mx-tools { left: 8px; top: 8px; }
}
.mx-d-head { flex-wrap: wrap; } .mx-d-head > .mx-d-kicker { flex-basis: 100%; margin-bottom: -6px; }
