:root {
  color-scheme: dark;
  --bg: #080914;
  --panel: #17182c;
  --panel-2: #20213a;
  --panel-3: #333652;
  --line: rgba(142, 149, 208, .18);
  --line-strong: rgba(74, 178, 255, .46);
  --text: #f7f8ff;
  --muted: #a9afd6;
  --faint: #777da8;
  --red: #7b48ff;
  --red-bright: #08a8ff;
  --teal: #30d5de;
  --gold: #7bb7ff;
  --green: #6be3c2;
  --shadow: 0 22px 60px rgba(0, 0, 0, .54);
  --inner-glow: inset 0 1px 0 rgba(255, 255, 255, .08);
  --ease-out: cubic-bezier(.2, .82, .22, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(0, 136, 255, .12), transparent 30%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 18px),
    linear-gradient(135deg, #080914 0%, #111326 52%, #070810 100%);
  color: var(--text);
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #313452 0%, #252743 100%);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--inner-glow), 0 1px 0 rgba(0, 0, 0, .45);
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s var(--ease-out), box-shadow .16s ease;
}

button:hover {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #3a3f66 0%, #2a2d4e 100%);
  color: #ffffff;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
}

.sidebar {
  position: absolute;
  inset: 14px auto 14px 14px;
  z-index: 500;
  display: flex;
  width: min(330px, calc(100vw - 28px));
  min-width: 0;
  height: auto;
  flex-direction: column;
  border: 1px solid rgba(103, 112, 175, .32);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(46, 67, 132, .34) 0%, rgba(18, 19, 38, .22) 38%, transparent 100%),
    #15162a;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .34);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-color: #60679b #15162a;
  scrollbar-width: thin;
  transform: translateX(0);
  opacity: 1;
  will-change: transform, opacity;
  transition: transform .28s var(--ease-out), opacity .2s ease, box-shadow .28s ease;
}

.sidebar::-webkit-scrollbar {
  width: 9px;
}

.sidebar::-webkit-scrollbar-track {
  background: #15162a;
}

.sidebar::-webkit-scrollbar-thumb {
  border: 2px solid #15162a;
  border-radius: 999px;
  background: #60679b;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #7982c1;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  margin: 14px 14px 8px;
  padding: 10px 12px;
  border-radius: 6px;
  border-bottom: 0;
  background:
    linear-gradient(100deg, #5138f3 0%, #057cff 52%, #0798ef 100%);
  box-shadow: 0 12px 30px rgba(0, 119, 255, .2), var(--inner-glow);
}

.brand::after {
  display: none;
}

.eyebrow {
  margin: 0 0 1px;
  color: rgba(255, 255, 255, .72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.12;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .42);
}

h2 {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.brand .icon-button {
  display: none;
}

.search-row {
  display: block;
  padding: 0 14px 10px;
}

.search-row input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(142, 149, 208, .22);
  border-radius: 6px;
  outline: none;
  background: rgba(53, 56, 88, .72);
  color: var(--text);
  padding: 0 12px;
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, .34);
}

.search-row input::placeholder {
  color: #9097c6;
}

.search-row input:focus {
  border-color: var(--red-bright);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, .34), 0 0 0 3px rgba(8, 168, 255, .14);
}

.search-row .icon-button {
  display: none;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 14px 14px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(54, 57, 90, .78);
  box-shadow: inset 0 1px 5px rgba(0, 0, 0, .26);
}

.toolbar button,
.panel-heading button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.toolbar button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #b9bee1;
}

.toolbar button:first-child {
  border-color: rgba(20, 142, 255, .64);
  background: linear-gradient(100deg, #5534ef 0%, #0479ff 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 124, 255, .23), var(--inner-glow);
}

.toolbar button:last-child {
  color: #b9bee1;
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 14px 12px;
  border: 1px solid rgba(103, 112, 175, .24);
  border-radius: 12px;
  background: rgba(30, 31, 56, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}

.regions-panel {
  flex: 0 0 auto;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 10px 8px;
  background: transparent;
}

.count {
  min-width: 52px;
  border-radius: 999px;
  background: rgba(8, 168, 255, .16);
  color: #dce9ff;
  padding: 4px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.region-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 0 10px 12px;
}

.region-button {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  overflow: hidden;
  min-height: 36px;
  padding: 0 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
  background: rgba(73, 77, 118, .86);
  color: #aeb5df;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s var(--ease-out), box-shadow .16s ease;
  animation: item-rise .22s var(--ease-out) both;
}

.region-button:hover {
  background: rgba(85, 90, 136, .94);
  transform: translateX(2px);
}

.region-button.active {
  border-color: rgba(8, 168, 255, .78);
  background: linear-gradient(100deg, #5b38f3 0%, #087fff 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 128, 255, .2), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.categories-panel {
  flex: 0 0 auto;
  overflow: visible;
}

.groups {
  height: auto;
  overflow: visible;
  padding: 0 8px 10px;
}

.group {
  border-top: 1px solid rgba(255, 255, 255, .06);
  animation: item-rise .22s var(--ease-out) both;
}

.group:first-child {
  border-top: 0;
}

.group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 2px;
  color: #f8f9ff;
}

.group-heading:hover {
  background: rgba(255, 255, 255, .035);
}

.group-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.group-dot,
.category-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .05), 0 0 14px currentColor;
}

.category-icon {
  display: block;
  width: 22px;
  height: 29px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55));
}

.category-svg-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45));
}

.category-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 0 0 10px;
}

.category-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 22px;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  border-radius: 6px;
  padding: 0 5px 0 8px;
  color: var(--muted);
  cursor: pointer;
  background: rgba(35, 37, 66, .78);
  transition: background .14s ease, color .14s ease, box-shadow .14s ease, transform .14s var(--ease-out);
}

.category-row:hover {
  background: rgba(51, 55, 92, .9);
  color: var(--text);
  transform: translateX(2px);
}

.category-row:has(input:checked) {
  background: linear-gradient(90deg, rgba(8, 168, 255, .24), rgba(39, 42, 79, .92));
  color: #ffffff;
  box-shadow: inset 2px 0 0 #21d6ff;
}

.category-row:has(input:checked):hover {
  background: linear-gradient(90deg, rgba(8, 168, 255, .32), rgba(50, 54, 97, .96));
}

.category-row input {
  grid-column: 4;
  grid-row: 1;
  display: grid;
  width: 20px;
  height: 20px;
  margin: 0;
  appearance: none;
  place-items: center;
  border: 1px solid rgba(139, 147, 203, .34);
  border-radius: 6px;
  background: rgba(63, 67, 105, .76);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .45);
}

.category-row input::before {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, #32e4ff, #087fff);
  box-shadow: 0 0 12px rgba(8, 168, 255, .58);
  content: "";
  opacity: 0;
  transform: scale(.65);
  transition: opacity .12s ease, transform .12s ease;
}

.category-row input:checked {
  border-color: rgba(50, 228, 255, .8);
  background: rgba(8, 72, 122, .78);
}

.category-row input:checked::before {
  opacity: 1;
  transform: scale(1);
}

.category-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.category-count {
  min-width: 36px;
  border-radius: 999px;
  background: rgba(10, 13, 38, .48);
  color: #ffffff;
  padding: 3px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.category-row:has(input:checked) .category-count {
  color: #ffffff;
  background: rgba(10, 13, 38, .66);
}

.map-wrap {
  position: relative;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #080706;
}

.topbar {
  position: absolute;
  top: 14px;
  left: 360px;
  z-index: 450;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: left .28s var(--ease-out);
}

.topbar .icon-button {
  display: inline-grid;
  border-color: rgba(74, 178, 255, .34);
  background:
    linear-gradient(180deg, rgba(8, 168, 255, .12), transparent),
    rgba(20, 22, 43, .88);
  box-shadow: var(--shadow), var(--inner-glow);
  backdrop-filter: blur(10px);
  font-size: 21px;
}

.topbar .icon-button:hover {
  border-color: rgba(8, 168, 255, .7);
  color: #dff4ff;
}

.active-summary {
  min-height: 40px;
  max-width: min(58vw, 520px);
  border: 1px solid rgba(74, 178, 255, .26);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(8, 168, 255, .1), transparent),
    rgba(20, 22, 43, .86);
  color: var(--text);
  padding: 11px 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 750;
  animation: soft-drop .28s var(--ease-out) both;
}

.leaflet-control-zoom a {
  background: #17182c;
  color: var(--text);
  border-color: rgba(142, 149, 208, .18);
  box-shadow: var(--inner-glow);
}

.leaflet-control-zoom a:hover {
  background: #2b2f54;
  color: #dff4ff;
}

.leaflet-bar {
  border: 1px solid rgba(0, 0, 0, .62) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .36);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border: 1px solid rgba(103, 112, 175, .3);
  background: linear-gradient(180deg, #22243f, #15162a);
  color: var(--text);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .48);
}

.leaflet-popup-content-wrapper {
  animation: popup-in .18s var(--ease-out) both;
}

.leaflet-popup-content {
  min-width: 220px;
  max-width: 320px;
  margin: 12px 14px;
}

.leaflet-popup-scrolled {
  border: 0;
  padding-right: 6px;
  margin-right: -6px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-color: #60679b #17182c;
  scrollbar-width: thin;
}

.leaflet-popup-scrolled::-webkit-scrollbar {
  width: 8px;
}

.leaflet-popup-scrolled::-webkit-scrollbar-track {
  background: #17182c;
  border-radius: 999px;
}

.leaflet-popup-scrolled::-webkit-scrollbar-thumb {
  border: 2px solid #17182c;
  border-radius: 999px;
  background: #60679b;
}

.leaflet-popup-scrolled::-webkit-scrollbar-thumb:hover {
  background: #7982c1;
}

.popup-title {
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.pill {
  border: 1px solid rgba(74, 178, 255, .2);
  border-radius: 999px;
  background: rgba(8, 168, 255, .11);
  color: #dce9ff;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.popup-description {
  color: #cfd4f6;
  font-size: 13px;
  line-height: 1.45;
}

.popup-description p {
  margin: 0;
}

.popup-description strong {
  color: #ffffff;
  font-weight: 850;
}

.popup-section-title {
  margin: 10px 0 4px;
  color: #76dfff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.popup-section-title:first-child {
  margin-top: 0;
}

.popup-spacer {
  height: 8px;
}

.popup-description ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.popup-description li + li {
  margin-top: 7px;
}

.popup-link-button {
  display: inline-flex;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(95, 210, 255, .76);
  border-radius: 6px;
  background: linear-gradient(180deg, #122b5f 0%, #081a3a 100%);
  color: #ffffff !important;
  padding: 3px 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
  box-shadow: var(--inner-glow), 0 0 0 1px rgba(0, 0, 0, .28), 0 6px 16px rgba(0, 121, 255, .22);
  overflow-wrap: anywhere;
  transition: border-color .12s ease, background .12s ease, color .12s ease, transform .12s ease;
}

.popup-link-button:hover {
  border-color: rgba(139, 232, 255, .95);
  background: linear-gradient(180deg, #17488e 0%, #0b2a63 100%);
  color: #ffffff !important;
}

.popup-link-button:active {
  transform: translateY(1px);
}

.popup-link-disabled {
  display: inline;
  color: #f7f8ff;
  font-weight: 850;
}

.leaflet-interactive.location-marker {
  transition: opacity .12s ease;
}

.sprite-marker-layer {
  pointer-events: none;
}

.region-map-label {
  width: max-content !important;
  height: auto !important;
  color: #fff6e8;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(77, 48, 35, .86),
    0 3px 8px rgba(0, 0, 0, .92),
    0 0 2px rgba(0, 0, 0, .95);
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.marker-hover-tooltip {
  border: 1px solid rgba(74, 178, 255, .36);
  border-radius: 3px;
  background: #17182c;
  color: #f7f8ff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .35);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 7px;
  animation: tooltip-in .12s ease both;
}

.marker-hover-tooltip::before {
  border-top-color: #17182c;
}

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

.sidebar-collapsed .sidebar {
  transform: translateX(calc(-100% - 18px));
  opacity: 0;
  pointer-events: none;
}

.sidebar-collapsed .topbar {
  left: 14px;
}

.sidebar-collapsed .topbar .icon-button {
  border-color: rgba(8, 168, 255, .52);
  background:
    linear-gradient(180deg, rgba(8, 168, 255, .22), transparent),
    rgba(20, 22, 43, .9);
  color: #dff4ff;
}

@keyframes item-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-drop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tooltip-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .sidebar {
    position: absolute;
    inset: 10px auto 10px 10px;
    width: min(90vw, 330px);
    transform: translateX(calc(-100% - 14px));
    transition: transform .18s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .topbar,
  .sidebar-collapsed .topbar {
    left: 14px;
  }

  .active-summary {
    max-width: calc(100vw - 74px);
  }
}
