:root {
  --bg: #08111f;
  --panel: rgba(11, 19, 35, 0.92);
  --panel-2: rgba(17, 28, 51, 0.82);
  --panel-3: rgba(255, 255, 255, 0.04);
  --text: #e8eefb;
  --muted: rgba(232, 238, 251, 0.68);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --radius-sm: 12px;

  /* ნაცვლად ლურჯის — muted slate */
  --blue: #52627a;

  --popup-bg: #0f1b32;
  --popup-bg-2: #13213d;
  --popup-row-a: rgba(255, 255, 255, 0.03);
  --popup-row-b: rgba(255, 255, 255, 0.06);

  /* popup header აღარ იყოს ღია ლურჯი */
  --popup-header-a: rgba(82, 98, 122, 0.42);
  --popup-header-b: rgba(82, 98, 122, 0.18);

  --popup-border: rgba(255, 255, 255, 0.10);
}

* {
  box-sizing: border-box;
}

body,
button,
label,
span,
div,
table,
tr,
td,
th,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  -webkit-user-select: none;
  user-select: none;
  
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #0e1c34 0%, #08111f 55%);
  color: var(--text);
    -webkit-user-select: none;
  user-select: none;
}

input,
textarea {
-webkit-user-select: text;
  user-select: text;
}

.sidebar,
.sidebar * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.chip,
.btn,
.sectionToggle,
.list label,
.sidebarToggleBtn {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.filterSearch,
.filterSearch * ,
input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

body {
  overflow: hidden;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 17, 31, 0.82);
  backdrop-filter: blur(16px);
}

.sidebarToggleBtn {
  position: absolute;
  left: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 140ms ease;
}

.sidebarToggleBtn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--border-strong);
}

.topbar__inner {
  width: 100%;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar__titleWrap {
  text-align: center;
}

.topbar__title {
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 20px;
}

.topbar__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.app {
  height: calc(100% - 68px);
  display: grid;
  grid-template-columns: 380px 1fr;
  transition: grid-template-columns 220ms ease;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: blur(12px);
  transition: transform 220ms ease, opacity 220ms ease;
}

.app.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.app.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  border-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.sidebar__header {
  position: sticky;
  top: -16px;
  z-index: 5;
  background: linear-gradient(180deg, rgba(8, 17, 31, 0.98), rgba(8, 17, 31, 0.88));
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.sidebar__title {
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.sidebar__caption {
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}

.section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 28, 51, 0.82), rgba(11, 19, 35, 0.92));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.section__label {
  font-weight: 900;
  font-size: 14px;
  text-align: center;
}

.section__hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  vertical-align: middle;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.actions--sticky {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(17, 28, 51, 0), rgba(17, 28, 51, 0.92) 30%);
}

.btn {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: 140ms ease;
  font-size: 13px;
  font-weight: 700;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(180deg, rgba(82, 98, 122, 0.30), rgba(82, 98, 122, 0.18));
  border-color: rgba(82, 98, 122, 0.34);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 700;
  transition: 140ms ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

.chip input {
  display: none;
}

.chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
}

.chip--on {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.listSearchWrap {
  margin-bottom: 10px;
}

.filterSearch {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 17, 31, 0.72);
  color: var(--text);
  padding: 0 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.filterSearch::placeholder {
  color: rgba(232, 238, 251, 0.45);
}

.filterSearch:focus {
  border-color: rgba(82, 98, 122, 0.45);
  box-shadow: 0 0 0 3px rgba(82, 98, 122, 0.14);
}

.list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.list::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.list::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-size: 12px;
  line-height: 1.3;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  transition: 120ms ease;
  cursor: pointer;
}

.list label:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}

.list input {
  transform: scale(1.08);
  accent-color: var(--blue);
  cursor: pointer;
}

.mapWrap {
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: #0b1220;
}

.leaflet-control-zoom a {
  background: rgba(11, 19, 35, 0.9) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.leaflet-control-attribution {
  background: rgba(11, 19, 35, 0.78) !important;
  color: var(--muted) !important;
}

.info {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
  border-radius: 16px;
  padding: 14px;
  max-width: 420px;
  max-height: 55vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hidden {
  display: none !important;
}

.sectionToggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: var(--text);
  padding: 8px 10px;
  margin: 0 0 10px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  border-radius: 12px;
  transition: 140ms ease;
}

.sectionToggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.sectionToggle__icon {
  transition: transform 160ms ease;
  font-size: 18px;
  line-height: 1;
}

.sectionBody {
  display: block;
}

.section:not(.is-open) .sectionBody {
  display: none;
}

.section:not(.is-open) .sectionToggle__icon {
  transform: rotate(-90deg);
}

/* ---------- Protected Area Popup ---------- */
/* ---------- Protected Area Popup ---------- */

.leaflet-popup.ge-popup {
  margin-bottom: 14px;
}

.leaflet-popup.ge-popup .leaflet-popup-content-wrapper {
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(82, 98, 122, 0.18), transparent 34%),
    linear-gradient(180deg, #0d1830 0%, #0b1428 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.leaflet-popup.ge-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
  min-width: 440px;
  max-width: 760px;
}

.leaflet-popup.ge-popup .leaflet-popup-tip {
  background: #0b1428;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.leaflet-popup.ge-popup .leaflet-popup-close-button {
  top: 14px !important;
  right: 14px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 999px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  font-size: 22px !important;
  line-height: 1 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 20;
  transition: 140ms ease;
}

.leaflet-popup.ge-popup .leaflet-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  transform: scale(1.04);
}

.ge-popup__shell {
  color: var(--text);
  overflow: hidden;
  border-radius: 22px;
}

.ge-popup__hero {
  position: relative;
  padding: 18px 56px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(82, 98, 122, 0.16), rgba(82, 98, 122, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.ge-popup__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: rgba(232, 238, 251, 0.88);
}

.ge-popup__title {
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
  color: #ffffff;
  padding-right: 16px;
}

.ge-popup__sub {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(232, 238, 251, 0.72);
}

.ge-popup__body {
  max-height: 58vh;
  overflow: auto;
  padding: 16px;
}

.ge-popup__body::-webkit-scrollbar {
  width: 10px;
}

.ge-popup__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.ge-popup__fallback {
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

/* table normalize */
.ge-popup__body table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-size: 13px !important;
  color: var(--text) !important;
  background: transparent !important;
  table-layout: fixed;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
}

.ge-popup__body tbody,
.ge-popup__body tr,
.ge-popup__body td,
.ge-popup__body th {
  color: var(--text) !important;
}

.ge-popup__body td,
.ge-popup__body th {
  padding: 11px 12px !important;
  vertical-align: top !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: transparent !important;
  word-break: break-word;
}

.ge-popup__body tr>*:last-child {
  border-right: none !important;
}

.ge-popup__body table tr:last-child>td,
.ge-popup__body table tr:last-child>th {
  border-bottom: none !important;
}

/* header row from kmz */
.ge-popup__body table tr:first-child>td[colspan],
.ge-popup__body table tr:first-child>th[colspan] {
  background: linear-gradient(180deg,
      rgba(17, 28, 51, 0.95),
      rgba(11, 19, 35, 0.95)) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  text-align: center !important;
  vertical-align: middle !important;
  padding: 12px 14px !important;
  padding-right: 46px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}

/* alternating rows */

/* first column */
.ge-popup__body table tr:not(:first-child)>td:first-child,
.ge-popup__body table tr:not(:first-child)>th:first-child {
  width: 34%;
  font-weight: 800 !important;
  color: #ffffff !important;
  background: inherit !important;
}

/* nested content cleanup */
.ge-popup__body table,
.ge-popup__body table tbody,
.ge-popup__body table tr,
.ge-popup__body table td,
.ge-popup__body table th,
.ge-popup__body table div,
.ge-popup__body table span,
.ge-popup__body table p,
.ge-popup__body table font,
.ge-popup__body table b,
.ge-popup__body table strong {
  background-image: none !important;
  background: none !important;
}

.ge-popup__body table div,
.ge-popup__body table span,
.ge-popup__body table p,
.ge-popup__body table font,
.ge-popup__body table b,
.ge-popup__body table strong {
  color: inherit !important;
}

.ge-popup__body table tr:not(:first-child):hover>td,
.ge-popup__body table tr:not(:first-child):hover>th {
  background: rgba(82, 98, 122, 0.12) !important;
}

.ge-popup__empty {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 238, 251, 0.85);
  line-height: 1.5;
}

/* subtle popup appear animation */
.leaflet-fade-anim .leaflet-popup.ge-popup {
  transition: opacity 0.18s linear, transform 0.18s ease;
}

.leaflet-popup.ge-popup {
  transform: translateY(8px) scale(0.98);
}

.leaflet-popup.ge-popup.leaflet-zoom-animated,
.leaflet-popup.ge-popup.leaflet-popup-open {
  transform: translateY(0) scale(1);
}

@media (max-width: 820px) {
  .leaflet-popup.ge-popup .leaflet-popup-content {
    min-width: 280px;
    max-width: calc(100vw - 32px);
  }

  .ge-popup__hero {
    padding: 16px 52px 16px 16px;
  }

  .ge-popup__title {
    font-size: 17px;
  }

  .ge-popup__sub {
    font-size: 12px;
  }

  .ge-popup__body {
    max-height: 52vh;
    padding: 12px;
  }

  .ge-popup__body table {
    font-size: 12px !important;
  }

  .ge-popup__body td,
  .ge-popup__body th {
    padding: 8px 9px !important;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }

  .mapWrap {
    height: 65vh;
    min-height: 420px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .info {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .leaflet-popup.ge-popup .leaflet-popup-content {
    min-width: 280px;
    max-width: calc(100vw - 48px);
  }

  .ge-popup__inner {
    max-height: 60vh;
  }

  .ge-popup__inner table {
    font-size: 12px !important;
  }

  .ge-popup__inner td,
  .ge-popup__inner th {
    padding: 7px 8px !important;
  }
}

@media (max-width: 820px) {
  .sidebarToggleBtn {
    position: static;
    margin-right: 10px;
    flex: 0 0 auto;
  }

  .topbar__inner {
    justify-content: flex-start;
  }

  .topbar__titleWrap {
    flex: 1;
    text-align: center;
    margin-right: 50px;
  }

  .app {
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .app.sidebar-collapsed .sidebar {
    display: none;
  }
}