.bahno-map {
  position: relative;
  width: 100%;
  min-height: 650px;
  height: 75vh;
  background: #f3f3f3;
  border: 1px solid #d6d6d6;
}

.bahno-map *,
.bahno-map *::before,
.bahno-map *::after {
  box-sizing: border-box;
}

.bahno-map .leaflet-bar {
  border: 1px solid rgba(185, 39, 43, 0.26);
  border-radius: 4px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

.bahno-map .leaflet-bar a,
.bahno-map .leaflet-bar button {
  appearance: none;
  width: 34px;
  height: 34px;
  border-color: rgba(185, 39, 43, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  font-family: 'degular', Arial, Helvetica, sans-serif;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.bahno-map .leaflet-bar a:hover,
.bahno-map .leaflet-bar a:focus,
.bahno-map .leaflet-bar button:hover,
.bahno-map .leaflet-bar button:focus {
  background: #f8e8e8;
  color: #b9272b;
  box-shadow: inset 0 0 0 1px rgba(185, 39, 43, 0.12);
}

.bahno-map__panel-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-family: 'degular', Arial, Helvetica, sans-serif;
}

.bahno-map__panel-toggle {
  appearance: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(185, 39, 43, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #8d1d20 !important;
  font: 700 22px/1 'degular', Arial, Helvetica, sans-serif;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
}

.bahno-map__panel-toggle:hover,
.bahno-map__panel-toggle:focus {
  border-color: rgba(185, 39, 43, 0.42);
  background: #fff5f5 !important;
  color: #b9272b !important;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(185, 39, 43, 0.12), 0 3px 12px rgba(0, 0, 0, 0.14);
}

.bahno-map__panel-toggle:active {
  background: #f8e8e8 !important;
  color: #8d1d20 !important;
}

.bahno-map__panel-toggle span {
  display: block;
  transform: translateY(-1px);
}

.bahno-map__panel-wrap.is-collapsed .bahno-map__panel {
  display: none;
}

.bahno-map__panel {
  width: min(320px, calc(100vw - 88px));
  max-height: min(520px, calc(100vh - 96px));
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(185, 39, 43, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  color: #202020;
  font-family: 'degular', Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.bahno-map__panel-group + .bahno-map__panel-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(185, 39, 43, 0.18);
}

.bahno-map__panel-label {
  display: block;
  margin: 0 0 7px;
  color: #8d1d20;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bahno-map__base-select {
  width: 100%;
  min-height: 36px;
  padding: 5px 34px 5px 10px;
  border: 1px solid rgba(185, 39, 43, 0.3);
  border-radius: 4px;
  background-color: #fff;
  color: #202020;
  font: inherit;
  cursor: pointer;
}

.bahno-map__base-select:focus {
  outline: 2px solid rgba(185, 39, 43, 0.24);
  outline-offset: 1px;
}

.bahno-map__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.bahno-map__search-input {
  min-width: 0;
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid rgba(185, 39, 43, 0.3);
  border-radius: 4px;
  background: #fff;
  color: #202020;
  font: inherit;
}

.bahno-map__search-input:focus {
  outline: 2px solid rgba(185, 39, 43, 0.24);
  outline-offset: 1px;
}

.bahno-map__search-button {
  min-height: 36px;
  padding: 5px 11px;
  border: 1px solid #b9272b;
  border-radius: 4px;
  background: #b9272b;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bahno-map__search-button:hover,
.bahno-map__search-button:focus {
  background: #9f2024;
}

.bahno-map__search-status {
  min-height: 16px;
  margin-top: 5px;
  color: #555;
  font-size: 12px;
  line-height: 1.3;
}

.bahno-map__search-source {
  margin-top: 2px;
  color: #777;
  font-size: 11px;
  line-height: 1.25;
}

.bahno-map__layer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.bahno-map__layer-header .bahno-map__panel-label {
  margin-bottom: 0;
}

.bahno-map__layer-list {
  display: grid;
  gap: 2px;
}

.bahno-map__layer-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 0;
  padding: 4px 5px;
  border-radius: 4px;
  cursor: pointer;
}

.bahno-map__layer-row:hover {
  background: rgba(185, 39, 43, 0.08);
}

.bahno-map__layer-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #b9272b;
}

.bahno-map__layer-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bahno-map__layer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f8e8e8;
  color: #8d1d20;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.bahno-map:fullscreen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
}

.bahno-map.is-css-fullscreen {
  position: fixed;
  z-index: 999999;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
}

.bahno-map__fullscreen-control {
  margin-top: 8px;
}

.bahno-map__fullscreen-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.bahno-map__fullscreen-icon {
  display: block;
  width: 18px;
  height: 18px;
  background:
    linear-gradient(currentColor, currentColor) left top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 8px no-repeat;
}

.bahno-map__fullscreen-button.is-active .bahno-map__fullscreen-icon::before,
.bahno-map__fullscreen-button.is-active .bahno-map__fullscreen-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
}

.bahno-map__fullscreen-button.is-active .bahno-map__fullscreen-icon {
  position: relative;
  background: none;
}

.bahno-map__fullscreen-button.is-active .bahno-map__fullscreen-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.bahno-map__fullscreen-button.is-active .bahno-map__fullscreen-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.bahno-popup {
  width: 300px;
  max-width: 300px;
  color: #202020;
  font-size: 14px;
  line-height: 1.45;
}

.bahno-popup h3 {
  margin: 0 0 8px;
  color: #b9272b;
  font-size: 18px;
  line-height: 1.25;
}

.bahno-popup__image {
  display: block;
  width: 100%;
  max-width: 280px;
  min-height: 180px;
  max-height: 220px;
  margin: 0 0 10px;
  border: 0;
  object-fit: cover;
  object-position: center;
  background: #f1f1f1;
}

.bahno-popup__description {
  margin: 0 0 10px;
}

.bahno-popup__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.bahno-popup__links a {
  color: #b9272b;
  text-decoration: underline;
}

.bahno-map__notice {
  position: absolute;
  z-index: 500;
  right: 12px;
  bottom: 12px;
  max-width: min(360px, calc(100% - 24px));
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  color: #202020;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.bahno-map__wheel-hint {
  position: absolute;
  z-index: 650;
  left: 50%;
  bottom: 18px;
  max-width: min(360px, calc(100% - 28px));
  padding: 8px 11px;
  background: rgba(32, 32, 32, 0.88);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.bahno-map__wheel-hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 767px) {
  .bahno-map {
    min-height: 520px;
    height: 70vh;
  }

  .bahno-map__panel {
    width: min(290px, calc(100vw - 82px));
    max-height: min(440px, calc(100vh - 88px));
    padding: 10px;
    font-size: 13px;
  }

  .bahno-map__layer-row {
    min-height: 28px;
    gap: 7px;
  }

  .bahno-popup {
    width: 260px;
    max-width: 260px;
  }

  .bahno-popup__image {
    min-height: 180px;
    max-height: 210px;
  }
}
