:root {
  --panel-bg: rgba(62, 62, 62, 0.78);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f3f3f3;
  --accent: #098434;
  --muted: #b7b7b7;
  --map-bg: #2f2f2f;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  --panel-surface: rgba(90, 90, 90, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #4c4c4c, #3a3a3a 65%, #2f2f2f);
}

.app {
  display: block;
  min-height: 100vh;
  position: relative;
}

.panel {
  position: absolute;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: clamp(250px, 24vw, 380px);
  background: rgba(17, 17, 17, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  overflow: auto;
  backdrop-filter: blur(12px) saturate(130%);
  z-index: 1200;
}

.panel.panel--classic-bg {
  background: rgba(17, 17, 17, 0.74);
}

.panel__header {
  margin-bottom: 12px;
}

.panel-mode {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.panel-mode__toggle {
  width: 76px;
  height: 30px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.46);
  color: #ececec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  position: relative;
  cursor: pointer;
  font: inherit;
}

.panel-mode__icon {
  font-size: 13px;
  line-height: 1;
  z-index: 1;
}

.panel-mode__icon--sun {
  color: #ffd24c;
}

.panel-mode__icon--moon {
  color: #d9deff;
}

.panel-mode__thumb {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}

.panel-mode__toggle.is-classic .panel-mode__thumb {
  transform: translateX(44px);
}

.panel-mode__toggle.is-classic .panel-mode__icon--sun {
  color: #d9deff;
}

.panel-mode__toggle.is-classic .panel-mode__icon--moon {
  color: #ffd24c;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  text-align: center;
  flex-wrap: wrap;
}

.brand__logo,
.brand__badge {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.brand__title {
  font-size: 24px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand__subtitle {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel__section {
  margin-bottom: 14px;
}

.panel__section h2 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.section-heading-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading-inline h2 {
  margin: 0;
}

.panel:not(.panel--classic-bg) .panel__section h2 {
  color: #104121;
}

.panel:not(.panel--classic-bg) .brand__logo {
  filter: brightness(0.78) saturate(0.92);
}

.section-toggle {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel-surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.section-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.section-toggle__chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.collapsible-section--expanded .section-toggle__chevron {
  transform: rotate(180deg);
}

.collapsible-section__content {
  margin-top: 9px;
}

.master-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.master-toggle__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.master-toggle__track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(25, 25, 25, 0.52);
  position: relative;
  transition: background 0.2s ease;
}

.master-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.master-toggle__input:checked + .master-toggle__track {
  background: rgba(26, 166, 74, 0.6);
}

.master-toggle__input:checked + .master-toggle__track .master-toggle__thumb {
  transform: translateX(16px);
}

.master-toggle__input:indeterminate + .master-toggle__track {
  background: rgba(172, 132, 36, 0.6);
}

.events-menu__toggle {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel-surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.events-menu__toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.events-menu__chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.events-menu--expanded .events-menu__chevron {
  transform: rotate(180deg);
}

.events-menu__content {
  margin-top: 9px;
}

.events-teaser {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(32, 32, 32, 0.48);
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease;
}

.events-teaser:hover {
  background: rgba(255, 255, 255, 0.14);
}

.events-teaser__image {
  width: 86px;
  height: 86px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.9);
}

.events-teaser__image--placeholder {
  object-fit: contain;
  padding: 8px;
}

.events-teaser__body {
  padding: 9px 10px 9px 0;
  min-width: 0;
}

.events-teaser__date {
  font-size: 11px;
  color: #d7d7d7;
  margin-bottom: 4px;
}

.events-teaser__title {
  font-size: 13px;
  line-height: 1.28;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.events-teaser__source {
  font-size: 11px;
  color: #b7b7b7;
}

.events-menu__all-link {
  display: inline-flex;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: rgba(38, 38, 38, 0.5);
  color: #e9f7ee;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.events-menu__all-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.search-block {
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(34, 34, 34, 0.18);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
}

.search-input::placeholder {
  color: #c9c9c9;
}

.search-input:focus {
  outline: 2px solid rgba(26, 166, 74, 0.6);
  outline-offset: 1px;
}

.search-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.search-result {
  width: 100%;
  text-align: left;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel-surface);
  color: var(--text);
  cursor: pointer;
  padding: 7px 9px;
}

.search-result:hover {
  background: rgba(255, 255, 255, 0.14);
}

.search-result__title {
  display: block;
  font-weight: 600;
}

.search-result__meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #d3d3d3;
}

.control-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--panel-surface);
  transition: background 0.2s ease;
}

.control-item:hover {
  background: rgba(255, 255, 255, 0.14);
}

.control-item input[type="checkbox"],
.control-item input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.control-item__text {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.control-item__title {
  font-weight: 600;
}

.control-item__meta {
  font-size: 12px;
  color: #d3d3d3;
}

.route-line {
  width: 20px;
  height: 4px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.overlay-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.overlay-icon--cities {
  background-image: url("assets/img/staedte.png");
}

.overlay-icon--official-sites {
  background-image: url("assets/img/dorf.png");
}

.overlay-icon--monuments {
  background-image: url("assets/img/denkmaeler.png");
}

.overlay-icon--drone-panoramas {
  background-image: url("assets/img/drohne.png");
}

.overlay-icon--multimedia {
  background-image: url("assets/img/video.png");
}

.overlay-icon--sights-poi {
  background-image: url("assets/img/poi.png");
}

.overlay-icon--sights-sehenswuerdigkeiten {
  background-image: url("assets/img/ort.png");
}

.overlay-icon--sights-landmarks {
  background-image: url("assets/img/hildegard29.svg");
  background-size: contain;
  background-repeat: no-repeat;
  border-radius: 0;
  box-shadow: none;
}

.map {
  background: var(--map-bg);
  position: relative;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100vh;
}

.panel__toggle {
  display: none;
  align-self: center;
  margin-top: auto;
  width: 40px;
  height: 20px;
  border: none;
  border-radius: 18px;
  background: rgba(234, 238, 241, 0.9);
  font-size: 20px;
  line-height: 1;
  color: #455056;
  cursor: pointer;
  box-shadow: inset 0 0 0 4px rgba(64, 77, 84, 0.15), 0 10px 22px rgba(0, 0, 0, 0.25);
}

.leaflet-control-attribution {
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

.leaflet-top.leaflet-left .leaflet-control {
  margin-top: 14px;
  margin-left: 14px;
}

.leaflet-top.leaflet-right .leaflet-control {
  margin-top: 14px;
  margin-right: 14px;
}

.leaflet-control-zoom.leaflet-bar {
  border: none;
  box-shadow: none;
  background: transparent;
}

.leaflet-control-zoom a,
.locate-control__btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  border: 4px solid #0b9a43 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #239b45 !important;
  background: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18) !important;
  text-decoration: none;
  position: relative;
}

.leaflet-control-zoom a {
  font-size: 0 !important;
  line-height: 0 !important;
  margin-bottom: 10px;
}

.leaflet-control-zoom a:last-child {
  margin-bottom: 0;
}

.leaflet-control-zoom-in::before,
.leaflet-control-zoom-in::after,
.leaflet-control-zoom-out::before {
  content: "";
  position: absolute;
  background: #239b45;
  border-radius: 999px;
}

.leaflet-control-zoom-in::before,
.leaflet-control-zoom-out::before {
  width: 16px;
  height: 3px;
}

.leaflet-control-zoom-in::after {
  width: 3px;
  height: 16px;
}

.locate-control.leaflet-bar {
  border: none;
  box-shadow: none;
  background: transparent;
  margin-top: 10px;
  margin-bottom: 0;
}

.locate-control__btn {
  font-size: 0 !important;
}

.locate-control__icon {
  width: 16px;
  height: 16px;
  border: 1.3px solid #239b45;
  border-radius: 999px;
  position: relative;
  display: block;
}

.locate-control__icon::before,
.locate-control__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #239b45;
  border-radius: 999px;
}

.locate-control__icon::before {
  width: 3px;
  height: 24px;
}

.locate-control__icon::after {
  width: 24px;
  height: 3px;
}

.locate-control__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #239b45;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.leaflet-control-zoom a:hover,
.locate-control__btn:hover {
  background: rgba(246, 255, 249, 0.98) !important;
}

.location-popup-shell .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.26),
    0 2px 8px rgba(0, 0, 0, 0.22);
}

.location-popup-shell .leaflet-popup-content {
  margin: 0;
}

.location-popup.location-popup--card {
  width: min(360px, 74vw);
  color: #111;
  background: #f3f3f3;
}

.location-popup__media-link {
  display: block;
  width: 100%;
  height: 188px;
  background: #ffffff;
  overflow: hidden;
  transition: box-shadow 0.22s ease;
}

.location-popup__media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.28s ease;
}

.location-popup__media-link:hover,
.location-popup__media-link:focus-visible {
  box-shadow: inset 0 -20px 24px rgba(0, 0, 0, 0.12);
}

.location-popup__media-link:hover .location-popup__media,
.location-popup__media-link:focus-visible .location-popup__media {
  transform: scale(1.03) translateY(-2px);
}

.location-popup__body {
  padding: 14px 16px 14px;
}

.location-popup__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #636363;
  font-size: 13px;
  margin-bottom: 6px;
}

.location-popup__meta-pin {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #7a7a7a;
  color: transparent;
}

.location-popup__title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.location-popup__excerpt {
  margin: 0 0 10px;
  color: #2d2d2d;
  font-size: 13px;
  line-height: 1.35;
}

.location-popup a {
  color: #1f5f95;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.location-popup a:hover {
  color: #239b45;
  text-decoration: underline;
}

.route-popup .route-description {
  display: inline-block;
  margin-top: 5px;
  color: #3b3b3b;
}

.route-popup .route-stats {
  margin-top: 9px;
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.location-popup .location-description {
  display: inline-block;
  margin-top: 4px;
  margin-bottom: 8px;
  color: #3b3b3b;
  font-size: 13px;
}

.location-popup strong {
  display: inline-block;
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .location-popup.location-popup--card {
    width: min(320px, 82vw);
  }

  .location-popup__media-link {
    height: 160px;
  }

  .location-popup__title {
    font-size: 20px;
  }
}

.city-cluster-icon,
.location-cluster-icon {
  background: transparent;
  border: none;
}

.leaflet-marker-icon.city-marker-icon {
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.96),
    0 4px 12px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
}

.leaflet-marker-icon.village-marker-icon {
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.96),
    0 4px 12px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
}

.leaflet-marker-icon.monument-marker-icon {
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.96),
    0 4px 12px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
}

.leaflet-marker-icon.drone-marker-icon {
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.96),
    0 4px 12px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
}

.leaflet-marker-icon.poi-marker-icon {
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.96),
    0 4px 12px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
}

.leaflet-marker-icon.video-marker-icon {
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.96),
    0 4px 12px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
}

.leaflet-marker-icon.places-marker-icon {
  border-radius: 0;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  image-rendering: -webkit-optimize-contrast;
}

.city-cluster,
.location-cluster {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(
    145deg,
    var(--cluster-color, rgba(27, 91, 134, 0.95)),
    var(--cluster-highlight, rgba(36, 120, 170, 0.95))
  );
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

@media (max-width: 900px) {
  .panel-mode {
    display: none;
  }

  .brand__logo,
  .brand__badge {
    width: 42px;
    height: 42px;
  }

  .app {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 48svh) 1fr;
    height: 100svh;
    min-height: 100svh;
  }

  .app.app--collapsed {
    grid-template-rows: minmax(0, 100px) 1fr;
  }

  .panel {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: auto;
    background: rgba(62, 62, 62, 0.66);
    border-right: none;
    padding: 8px 18px 4px;
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow: auto;
    gap: 8px;
  }

  .panel.panel--classic-bg {
    background: rgba(17, 17, 17, 0.2);
  }

  .panel__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    bottom: 6px;
  }

  .panel--collapsed {
    padding: 8px 18px 4px;
    gap: 2px;
    max-height: 100px;
    overflow: hidden;
  }

  .panel--collapsed .panel__toggle {
    margin-top: 12px;
    height: 20px;
  }

  .panel--collapsed .panel__section {
    display: none;
  }

  #map {
    height: 100%;
  }
}
