.pm-public-map-shell {
  padding-inline: 0;
  padding-bottom: 0;
  margin-top: 0;
}

.pm-public-map-workspace {
  --pm-sidebar-width: 360px;
  position: relative;
  display: flex;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid #cfd7d2;
  border-bottom: 1px solid #cfd7d2;
  background: #eef3f0;
  height: calc(100dvh - 88px);
  min-height: calc(100dvh - 88px);
}

.pm-public-map-sidebar {
  position: relative;
  z-index: 10;
  width: var(--pm-sidebar-width);
  flex: 0 0 var(--pm-sidebar-width);
  max-width: var(--pm-sidebar-width);
  overflow: hidden;
  border-right: 1px solid #c8d1cc;
  background: #fff;
  padding: 1rem 1rem;
  box-shadow: 4px 0 10px rgba(31, 43, 42, 0.12);
  transition: width 0.2s ease-out, padding 0.2s ease-out, flex-basis 0.2s ease-out;
}

@media (min-width: 768px) {
  .pm-public-map-sidebar {
    padding: 1.25rem;
  }
}

.pm-map-main {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
}

.pm-map-main-inner {
  width: 100%;
  height: 100%;
}

.pm-map-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pm-map-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f2b2a;
}

.pm-map-subtitle {
  margin-top: 0.65rem;
  margin-bottom: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #4b5a58;
}

.pm-public-map-edge-toggle {
  position: absolute;
  left: var(--pm-sidebar-width);
  top: 50%;
  z-index: 650;
  transform: translate(0, -50%);
  width: 34px;
  height: 64px;
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  border: 0;
  background: #fff;
  color: #1f2b2a;
  box-shadow: 0 4px 12px rgba(31, 43, 42, 0.16);
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.pm-public-map-edge-toggle:hover {
  background: #f4f7f5;
}

.pm-public-map-workspace.is-sidebar-collapsed .pm-public-map-sidebar {
  width: 0;
  flex-basis: 0;
  padding-inline: 0;
  border-right: 0;
}

.pm-public-map-workspace.is-sidebar-collapsed .pm-public-map-edge-toggle {
  left: 0;
  transform: translate(0, -50%);
}

.pm-public-map-edge-toggle.is-open {
  border-radius: 0 8px 8px 0;
}

.pm-public-map-edge-toggle.is-closed {
  border-radius: 0 8px 8px 0;
}

.pm-map-panel-field {
  margin-top: 1rem;
  margin-bottom: 10px;
}

.pm-map-panel-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f4441;
}

.pm-map-panel-input {
  width: min(100%, 280px);
  border: 1px solid #cad5d0;
  border-radius: 4px;
  background: #ffffff;
  padding: 10px 10px;
  font-size: 15px;
  color: #1f2b2a;
}

.pm-map-panel-input:focus {
  outline: none;
  border-color: #9cb2ab;
  box-shadow: 0 0 0 2px rgba(156, 178, 171, 0.2);
}

.pm-map-panel-section {
  margin-top: 12px;
  border: 1px solid #d6ddd9;
  border-radius: 4px;
  background: #fbfcfb;
  padding: 10px 10px;
}

.pm-map-panel-section-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f4441;
}

.pm-map-results-list {
  margin: 0 -4px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
}

.pm-map-result-row {
  margin-bottom: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #ffffff;
  padding: 8px;
  text-align: left;
  font-size: 14px;
  color: #2f4441;
}

.pm-map-result-label {
  display: block;
  font-weight: 700;
}

.pm-map-result-secondary {
  display: block;
  font-size: 12px;
  color: #5f706b;
}

.pm-map-result-row:hover {
  border-color: #d2dbd6;
  background: #f4f8f6;
}

.pm-map-empty-message {
  padding: 8px 4px;
  font-size: 12px;
  color: #60726d;
}

.pm-map-selected-label {
  font-size: 14px;
  font-weight: 700;
  color: #1f2b2a;
}

.pm-map-selected-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #5b6d68;
}

.pm-map-result-row.is-active {
  border-color: #b38b4a;
  background: #f5f0e6;
  color: #1f2b2a;
}

.pm-map-layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15px;
  color: #2f4441;
}

.pm-map-layer-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2d4f4c;
}

.pm-map-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #4f5f5a;
}

.pm-public-map-canvas .pm-leaflet-legend-control {
  position: relative;
}

.pm-public-map-canvas .pm-leaflet-filters-control {
  position: relative;
}

.pm-public-map-canvas .pm-leaflet-filters-toggle {
  width: 52px;
  height: 52px;
  border: 1px solid #bcc9c3;
  color: #26403d;
  background: #fbfdfc;
  box-shadow: 0 4px 12px rgba(31, 43, 42, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  cursor: pointer;
}

.pm-public-map-canvas .pm-leaflet-filters-toggle:hover {
  background: #eef4f1;
  border-color: #aab9b3;
  color: #1f3431;
}

.pm-public-map-canvas .pm-leaflet-filters-toggle svg {
  width: 24px;
  height: 24px;
  color: currentColor;
  pointer-events: none;
}

.pm-public-map-canvas .pm-leaflet-filters-panel {
  position: absolute;
  top: 0;
  right: 60px;
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid #cad4cf;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 43, 42, 0.16);
  display: none;
}

.pm-public-map-canvas .pm-leaflet-filters-control.is-open .pm-leaflet-filters-panel {
  display: block;
}

.pm-public-map-canvas .pm-leaflet-filters-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f4441;
}

.pm-public-map-canvas .pm-leaflet-filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #2f4441;
}

.pm-public-map-canvas .pm-leaflet-filters-row:last-child {
  margin-bottom: 0;
}

.pm-public-map-canvas .pm-leaflet-filters-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2d4f4c;
}

.pm-public-map-canvas .pm-leaflet-legend-toggle {
  width: 52px;
  height: 52px;
  border: 1px solid #bcc9c3;
  color: #26403d;
  background: #fbfdfc;
  box-shadow: 0 4px 12px rgba(31, 43, 42, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  cursor: pointer;
}

.pm-public-map-canvas .pm-leaflet-legend-toggle:hover {
  background: #eef4f1;
  border-color: #aab9b3;
  color: #1f3431;
}

.pm-public-map-canvas .pm-leaflet-legend-toggle svg {
  width: 24px;
  height: 24px;
  color: currentColor;
  pointer-events: none;
}

.pm-public-map-canvas .pm-leaflet-legend-panel {
  position: absolute;
  top: 0;
  right: 60px;
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid #cad4cf;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 43, 42, 0.16);
  display: none;
}

.pm-public-map-canvas .pm-leaflet-legend-control.is-open .pm-leaflet-legend-panel {
  display: block;
}

.pm-public-map-canvas .pm-leaflet-legend-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f4441;
}

.pm-public-map-canvas .pm-leaflet-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #4f5f5a;
}

.pm-public-map-canvas .pm-leaflet-legend-row:last-child {
  margin-bottom: 0;
}

.pm-public-map-canvas .pm-leaflet-legend-swatch {
  display: inline-block;
  width: 18px;
  height: 9px;
  border-radius: 2px;
}

.pm-public-map-canvas .pm-leaflet-legend-swatch.pm-sections {
  border: 1px solid #4f6d67;
  background: #dbe8e2;
}

.pm-public-map-canvas .pm-leaflet-legend-swatch.pm-lots {
  border: 1px solid #516f82;
  background: #deebf4;
}

.pm-public-map-canvas .pm-leaflet-legend-swatch.pm-graves {
  border: 1px solid #5b635f;
  background: #ecefec;
}

.pm-map-clear-btn {
  margin-top: 8px;
  border: 1px solid #cad5d0;
  border-radius: 4px;
  background: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  color: #2f4441;
}

.pm-map-clear-btn:hover {
  background: #f4f8f6;
}

.pm-map-panel-meta {
  margin-top: 12px;
  font-size: 12px;
  color: #60726d;
}

.pm-public-map-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.pm-public-map-canvas.leaflet-container {
  font-family: "Vazirmatn", "Roboto Flex", "Noto Sans", sans-serif;
  background: #e8eeea;
}

.pm-public-map-canvas .leaflet-top.leaflet-right {
  margin-top: 12px;
  margin-right: 12px;
}

.pm-public-map-canvas .leaflet-control {
  margin: 0 0 10px;
}

.pm-public-map-canvas .leaflet-control-zoom a,
.pm-public-map-canvas .leaflet-control-layers-toggle {
  width: 52px;
  height: 52px;
  line-height: 1;
  border: 1px solid #bcc9c3;
  color: #26403d;
  background: #fbfdfc;
  box-shadow: 0 4px 12px rgba(31, 43, 42, 0.14);
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}

.pm-public-map-canvas .leaflet-control-zoom a:hover,
.pm-public-map-canvas .leaflet-control-layers-toggle:hover {
  background: #eef4f1;
  border-color: #aab9b3;
  color: #1f3431;
}

.pm-public-map-canvas .leaflet-control-zoom a:active,
.pm-public-map-canvas .leaflet-control-layers-toggle:active {
  background: #e4ede8;
}

.pm-public-map-canvas .leaflet-control-zoom a svg,
.pm-public-map-canvas .leaflet-control-layers-toggle svg {
  width: 24px;
  height: 24px;
  color: currentColor;
  pointer-events: none;
}

.pm-public-map-canvas .leaflet-control-layers-toggle svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.pm-public-map-canvas .leaflet-control-zoom {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.pm-public-map-canvas .leaflet-control-zoom a {
  margin-bottom: 8px;
}

.pm-public-map-canvas .leaflet-control-zoom a:last-child {
  margin-bottom: 0;
}

.pm-public-map-canvas .leaflet-control-layers {
  border: 1px solid #cad4cf;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(31, 43, 42, 0.14);
}

.pm-public-map-canvas .leaflet-control-layers:not(.leaflet-control-layers-expanded) {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.pm-public-map-canvas .leaflet-control-layers-toggle {
  background-image: none !important;
}

.pm-public-map-canvas .leaflet-control-layers-expanded {
  padding: 10px 12px;
  min-width: 160px;
  color: #2a2f2f;
}

.pm-public-map-canvas .leaflet-control-layers-expanded .leaflet-control-layers-toggle {
  display: none;
}

.pm-public-map-canvas .leaflet-control-attribution {
  margin: 0;
  border-left: 1px solid #d7dfdb;
  border-top: 1px solid #d7dfdb;
  background: rgba(255, 255, 255, 0.92);
  color: #4b5a58;
  font-size: 11px;
  padding: 3px 8px;
}

.pm-public-map-canvas .leaflet-popup-content-wrapper {
  border: 1px solid #d3d9d5;
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(31, 43, 42, 0.16);
}

.pm-public-map-canvas .leaflet-popup-content {
  margin: 10px 12px;
  color: #2a2f2f;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pm-public-map-canvas .leaflet-tooltip.pm-grave-label {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: #1f2b2a;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.pm-public-map-canvas .leaflet-tooltip.pm-grave-label::before {
  display: none;
}

.pm-public-map-canvas .leaflet-tooltip.pm-grave-label-small {
  font-size: 10px;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95);
}

.pm-public-map-canvas .leaflet-tooltip.pm-grave-label-large {
  font-size: 12px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95);
}

.pm-public-map-canvas .pm-grave-label-code {
  display: block;
  font-weight: 700;
}

.pm-public-map-canvas .pm-grave-label-name {
  display: block;
  margin-top: 1px;
  font-weight: 600;
}

.pm-public-map-canvas .leaflet-tooltip.pm-section-label {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: #1f2b2a;
  text-align: center;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.96);
  pointer-events: none;
}

.pm-public-map-canvas .leaflet-tooltip.pm-section-label::before {
  display: none;
}

@media (max-width: 768px) {
  .pm-public-map-workspace {
    --pm-sidebar-width: 280px;
    height: calc(100dvh - 88px);
    min-height: calc(100dvh - 88px);
  }

  .pm-public-map-sidebar {
    width: 0;
    flex-basis: 0;
    padding-inline: 0;
    border-right: 0;
  }

  .pm-public-map-workspace.is-sidebar-open .pm-public-map-sidebar {
    width: 280px;
    flex-basis: 280px;
    padding: 12px;
    border-right: 1px solid #d5ddd8;
  }

}

@media (max-width: 1023px) and (min-width: 769px) {
  .pm-public-map-workspace {
    --pm-sidebar-width: 320px;
  }
}

/* MapLibre migration styles */
.pm-public-map-canvas.maplibregl-map {
  font-family: "Vazirmatn", "Roboto Flex", "Noto Sans", sans-serif;
  background: #e8eeea;
}

.pm-public-map-canvas .maplibregl-ctrl-top-right {
  top: 12px;
  right: 12px;
}

.pm-public-map-canvas .maplibregl-ctrl-group,
.pm-public-map-canvas .pm-maplibre-control .pm-maplibre-btn {
  border: 1px solid #bcc9c3;
  background: #fbfdfc;
  box-shadow: 0 4px 12px rgba(31, 43, 42, 0.14);
  border-radius: 9999px;
}

.pm-public-map-canvas .maplibregl-ctrl-group button {
  width: 52px;
  height: 52px;
  color: #26403d;
  background: transparent;
}

.pm-public-map-canvas .maplibregl-ctrl-group button:hover,
.pm-public-map-canvas .maplibregl-ctrl-group button:focus {
  background: #eef4f1;
}

.pm-public-map-canvas .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  transform: scale(1.1);
}

.pm-maplibre-control {
  position: relative;
  margin-top: 10px;
}

.pm-maplibre-control .pm-maplibre-btn {
  width: 52px;
  height: 52px;
  color: #26403d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pm-maplibre-control .pm-maplibre-btn:hover,
.pm-maplibre-control .pm-maplibre-btn:focus {
  background: #eef4f1;
  border-color: #aab9b3;
  color: #1f3431;
}

.pm-maplibre-control .pm-maplibre-btn svg {
  width: 24px;
  height: 24px;
}

.pm-maplibre-control .pm-maplibre-panel {
  position: absolute;
  top: 0;
  right: 60px;
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid #cad4cf;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 43, 42, 0.16);
}

.pm-maplibre-panel-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f4441;
}

.pm-maplibre-legend-row,
.pm-maplibre-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #4f5f5a;
}

.pm-maplibre-filter-row:last-child,
.pm-maplibre-legend-row:last-child {
  margin-bottom: 0;
}

.pm-maplibre-swatch {
  display: inline-block;
  width: 18px;
  height: 9px;
  border-radius: 2px;
}

.pm-maplibre-swatch.pm-sections {
  border: 1px solid #4f6d67;
  background: #dbe8e2;
}

.pm-maplibre-swatch.pm-lots {
  border: 1px solid #516f82;
  background: #deebf4;
}

.pm-maplibre-swatch.pm-graves-available {
  border: 1px solid #2f7d4f;
  background: #dff2e6;
}

.pm-maplibre-swatch.pm-graves-other {
  border: 1px solid #5b635f;
  background: #ecefec;
}

.pm-maplibre-filter-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2d4f4c;
}

.pm-public-map-canvas .maplibregl-popup-content {
  margin: 0;
  border: 1px solid #d3d9d5;
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(31, 43, 42, 0.16);
  padding: 10px 12px;
  color: #2a2f2f;
  font-size: 0.9rem;
  line-height: 1.45;
}

.pm-public-map-canvas .maplibregl-popup-tip {
  border-top-color: #d3d9d5;
}

.pm-maplibre-popup-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.pm-maplibre-popup-layer {
  font-size: 12px;
  color: #5b6d68;
  margin-bottom: 6px;
}
