:root {
  --pm-green: #1a7a4c;
  --pm-green-dark: #0d3d2a;
  --pm-gold: #c9a227;
  --pm-ink: #143528;
  --pm-muted: #5f7469;
  --pm-line: #d7e6dc;
  --pm-bg: #eef6f1;
  --pm-surface: #ffffff;
  --pm-shadow: 0 10px 30px rgba(13, 61, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.public-map-page {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--pm-bg);
  color: var(--pm-ink);
}

.public-map-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}

.pm-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--pm-line);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.pm-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.pm-brand img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.pm-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  flex-wrap: wrap;
}

.pm-nav a {
  color: var(--pm-muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.pm-nav a:hover,
.pm-nav a.is-active {
  color: var(--pm-green-dark);
  border-bottom-color: var(--pm-gold);
}

.pm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pm-icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 122, 76, 0.08);
  color: var(--pm-green-dark);
  cursor: pointer;
  text-decoration: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pm-icon-btn::-webkit-details-marker {
  display: none;
}

.pm-icon-btn:hover {
  background: rgba(26, 122, 76, 0.14);
  color: var(--pm-green);
}

.pm-icon-btn .fas,
.pm-nav-toggle .fas,
.pm-mobile-nav .fas,
.pm-btn .fas {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-style: normal;
  line-height: 1;
}

.pm-lang {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  z-index: 40;
}

.pm-lang .home-lang-switch-menu {
  right: 0;
  left: auto;
  z-index: 50;
}

.pm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 0;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.pm-btn-primary {
  background: var(--pm-green);
  color: #fff;
}

.pm-btn-primary:hover {
  background: var(--pm-green-dark);
  color: #fff;
}

.pm-nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: rgba(26, 122, 76, 0.08);
  color: var(--pm-green-dark);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.pm-mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px 14px;
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-line);
}

.pm-mobile-nav[hidden] {
  display: none !important;
}

.pm-mobile-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 10px;
  color: var(--pm-ink);
  text-decoration: none;
  font-weight: 600;
}

.pm-mobile-nav a.is-active,
.pm-mobile-nav a:hover {
  background: rgba(26, 122, 76, 0.08);
  color: var(--pm-green-dark);
}

.pm-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pm-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.pm-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  padding: 10px 16px;
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-line);
  box-shadow: var(--pm-shadow);
  z-index: 20;
}

.pm-field {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 280px;
}

.pm-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--pm-muted);
}

.pm-field input,
.pm-field select,
.pm-toolbar .form-control {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--pm-line);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: var(--pm-ink);
  font: inherit;
  outline: none;
}

.pm-field input:focus,
.pm-field select:focus,
.pm-toolbar .form-control:focus {
  border-color: var(--pm-green);
  box-shadow: 0 0 0 3px rgba(26, 122, 76, 0.12);
}

.pm-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  align-self: end;
}

.pm-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding-top: 2px;
}

.pm-layers:empty {
  display: none;
}

.pm-layers label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(26, 122, 76, 0.08);
  color: var(--pm-green-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pm-layers input {
  accent-color: var(--pm-green);
}

.pm-map-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #d9ebe1;
}

#public-map.pm-map,
.pm-map {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.leaflet-container {
  font-family: inherit;
  background: #d9ebe1;
}

.leaflet-control-zoom a {
  color: var(--pm-green-dark) !important;
}

@media (max-width: 860px) {
  .pm-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions";
  }

  .pm-brand {
    grid-area: brand;
  }

  .pm-nav {
    display: none;
  }

  .pm-actions {
    grid-area: actions;
  }

  .pm-actions .pm-btn-primary {
    display: none;
  }

  .pm-nav-toggle {
    display: inline-flex;
  }

  .pm-mobile-nav:not([hidden]) {
    display: flex;
  }
}

@media (max-width: 720px) {
  .pm-field {
    max-width: none;
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }

  .pm-toolbar-actions {
    flex: 1 1 auto;
  }
}

@media (max-width: 560px) {
  .pm-field {
    flex: 1 1 100%;
  }

  .pm-toolbar-actions {
    width: 100%;
  }

  .pm-toolbar-actions .pm-btn {
    width: 100%;
  }
}

@media (max-width: 575px) {
  .pm-bar {
    padding: 8px 12px;
    min-height: 56px;
  }

  .pm-brand img {
    height: 38px;
    max-width: 130px;
  }

  .pm-toolbar {
    padding: 12px;
  }
}

html.theme-dark .public-map-page {
  --pm-ink: #e6efe9;
  --pm-muted: #9bb0a6;
  --pm-line: #2c4036;
  --pm-bg: #0f1612;
  --pm-surface: #152019;
  background: var(--pm-bg);
  color: var(--pm-ink);
}

html.theme-dark .pm-bar,
html.theme-dark .pm-toolbar,
html.theme-dark .pm-mobile-nav {
  background: rgba(21, 32, 25, 0.96);
  border-color: var(--pm-line);
}

html.theme-dark .pm-nav a {
  color: var(--pm-muted);
}

html.theme-dark .pm-nav a:hover,
html.theme-dark .pm-nav a.is-active {
  color: #7fd4a8;
}

html.theme-dark .pm-icon-btn,
html.theme-dark .pm-nav-toggle {
  background: rgba(127, 212, 168, 0.1);
  color: #dceae3;
}

html.theme-dark .pm-field input,
html.theme-dark .pm-field select,
html.theme-dark .pm-toolbar .form-control {
  background: #101814;
  border-color: var(--pm-line);
  color: var(--pm-ink);
}

html.theme-dark .pm-layers label {
  background: #163528;
  color: #dceae3;
}

html.theme-dark .pm-map-wrap,
html.theme-dark .leaflet-container {
  background: #101814;
}
