/* Eigenstaendiger Leaflet-Geocoder. KEINE Control.Geocoder.css erforderlich. */
.leaflet-geocoder-topcenter {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1000;
}
.leaflet-geocoder-topcenter > .leaflet-control {
  float: none;
  clear: none;
  pointer-events: auto;
}
.leaflet-control-geocoder-intern {
  --gi-blue: #005b79;
  --gi-text: #203440;
  --gi-border: #d7dfe3;
  box-sizing: border-box;
  position: relative;
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  margin: 10px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--gi-text);
  background: #fff;
  border: 1px solid #cbd5da;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .20);
  pointer-events: auto;
}
.leaflet-control-geocoder-intern .gi-searchbar {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 40px;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
}
.leaflet-control-geocoder-intern .gi-searchbutton {
  display: block;
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 40px;
  border: none;
  background-color: var(--gi-blue);
  cursor: pointer;
}
/* Lupe ohne weitere Bilddatei */
.leaflet-control-geocoder-intern .gi-searchbutton::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 10px;
  height: 12px;
  width: 12px;
  border: 2px solid white;
  border-radius: 50%;
}
.leaflet-control-geocoder-intern .gi-searchbutton::after {
  content: '';
  position: absolute;
  left: 25px;
  top: 24px;
  height: 9px;
  border-left: 2px solid white;
  transform: rotate(-45deg);
  transform-origin: top;
}
.leaflet-control-geocoder-intern .gi-searchbutton:hover,
.leaflet-control-geocoder-intern .gi-searchbutton:active,
.leaflet-control-geocoder-intern .gi-searchbutton:focus,
.leaflet-control-geocoder-intern .gi-searchbutton:focus-visible {
    background-color: #AAB315 !important;
    border-color: #AAB315 !important;
}
.leaflet-control-geocoder-intern .gi-input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  box-sizing: border-box;
  background: white;
  border: none;
  border-radius: 0;
  outline: none;
  padding: 0 11px;
  height: 40px;
  font-size: 15px;
  color: #233b49;
  font-family: inherit;
}
.leaflet-control-geocoder-intern .gi-input:focus-visible { box-shadow: inset 0 0 0 2px #87b2c4; }
.leaflet-control-geocoder-intern .gi-results {
  box-sizing: border-box;
  width: 100%;
  max-height: min(400px, 50vh);
  max-height: min(400px, 50dvh);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto;
  scrollbar-color: #78919b #f1f4f6;
  border-top: 1px solid var(--gi-border);
  background: #fff;
  border-radius: 0 0 5px 5px;
}
.leaflet-control-geocoder-intern .gi-results[hidden],
.leaflet-control-geocoder-intern .gi-status[hidden] { display: none !important; }
.leaflet-control-geocoder-intern .gi-results::-webkit-scrollbar { width: 12px; }
.leaflet-control-geocoder-intern .gi-results::-webkit-scrollbar-thumb { background: #8299a4; border-radius: 5px; }
.leaflet-control-geocoder-intern .gi-results::-webkit-scrollbar-track { background: #f1f4f6; }
/* Ergebnisliste: bewusst BLOCK statt FLEX (keine dynamischen Zeilenspruenge). */
.leaflet-control-geocoder-intern .gi-results .gi-result {
  box-sizing: border-box;
  display: block !important;
  position: relative;
  float: none !important;
  clear: both;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border-bottom: 1px solid #e5e9eb;
  background: #fff;
}
.leaflet-control-geocoder-intern .gi-results .gi-result:last-child { border-bottom: none; }
.leaflet-control-geocoder-intern .gi-results .gi-result-button {
  box-sizing: border-box !important;
  /* Unbedingt Blocklayout behalten: FLEX verursachte das Umsortieren/Ueberlappen. */
  display: block !important;
  position: static !important;
  float: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  text-align: left !important;
  line-height: normal;
  white-space: normal;
  color: var(--gi-text);
  font-family: inherit;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
  cursor: pointer;
}
/* Wie Weihnachtsmarkt: graues Hover; optische Markierung aendert KEINE Masse. */
.leaflet-control-geocoder-intern .gi-results .gi-result:hover,
.leaflet-control-geocoder-intern .gi-results .gi-result:hover .gi-result-button,
.leaflet-control-geocoder-intern .gi-results .gi-result.gi-active,
.leaflet-control-geocoder-intern .gi-results .gi-result.gi-active .gi-result-button {
  background-color: #f5f5f5 !important;
}
.leaflet-control-geocoder-intern .gi-results .gi-result-button:focus-visible {
  outline: 2px solid #005b79;
  outline-offset: -2px;
}
/* Texte bleiben an ihrer Stelle; lange Namen werden wie frueher gekuerzt. */
.leaflet-control-geocoder-intern .gi-results .gi-result-type,
.leaflet-control-geocoder-intern .gi-results .gi-result-name,
.leaflet-control-geocoder-intern .gi-results .gi-result-hint {
  box-sizing: border-box !important;
  display: block !important;
  position: static !important;
  float: none !important;
  clear: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
.leaflet-control-geocoder-intern .gi-results .gi-result-type {
  color: #526c78;
  font-size: 11px;
  font-weight: 600;
  line-height: 15px !important;
  margin-bottom: 2px !important;
}
.leaflet-control-geocoder-intern .gi-results .gi-result-name {
  color: var(--gi-blue);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px !important;
}
.leaflet-control-geocoder-intern .gi-results .gi-result-hint {
  color: #536976;
  font-size: 12px;
  line-height: 16px !important;
  margin-top: 2px !important;
}
.leaflet-control-geocoder-intern .gi-status {
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 13px;
  color: #59616a;
  border-top: 1px solid var(--gi-border);
  background: #fff;
  border-radius: 0 0 5px 5px;
}
.leaflet-control-geocoder-intern.gi-loading .gi-searchbutton { opacity: .8; }
.leaflet-control-geocoder-intern.gi-collapsed { width: 40px; }
.leaflet-control-geocoder-intern.gi-collapsed .gi-input,
.leaflet-control-geocoder-intern.gi-collapsed .gi-results,
.leaflet-control-geocoder-intern.gi-collapsed .gi-status { display: none !important; }
@media (max-width: 640px) {
  .leaflet-control-geocoder-intern {
    max-width: calc(100vw - 18px);
    width: calc(100vw - 18px);
  }
  .leaflet-control-geocoder-intern .gi-input { font-size: 16px; }
  .leaflet-control-geocoder-intern .gi-results { max-height: min(360px, 50vh); max-height: min(360px, 50dvh); }
  .leaflet-control-geocoder-intern .gi-result-button { min-height: 0; padding: 9px 11px; }
}

/* Suchbutton ohne weißen Rand / unteren Leerraum */
.leaflet-control-geocoder-intern {
    padding: 0 !important;
}

.leaflet-control-geocoder-intern .gi-searchbar {
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch;
    overflow: hidden;
}

.leaflet-control-geocoder-intern .gi-searchbutton {
    box-sizing: border-box !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    appearance: none;
    background-color: #005B79 !important;
}

.leaflet-control-geocoder-intern .gi-searchbutton:hover,
.leaflet-control-geocoder-intern .gi-searchbutton:active,
.leaflet-control-geocoder-intern .gi-searchbutton:focus,
.leaflet-control-geocoder-intern .gi-searchbutton:focus-visible {
    background-color: #AAB315 !important;
}

.leaflet-control-geocoder-intern .gi-input {
    height: 40px !important;
    margin: 0 !important;
}

/* ============================================================
   Syntaxhilfe: Hover ueber der Lupe oder dauerhaft bei Klick auf
   die Lupe bzw. das leere Suchfeld; keine Aenderung der Suchleiste.
   ============================================================ */
.leaflet-control-geocoder-intern .gi-syntax-help {
  box-sizing: border-box;
  position: absolute;
  z-index: 1200;
  top: 39px;
  left: -1px;
  right: -1px;
  width: calc(100% + 2px);
  max-height: min(420px, 60vh);
  max-height: min(420px, 60dvh);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--gi-border);
  border-radius: 0 0 5px 5px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .18);
  color: var(--gi-text);
  pointer-events: auto;
  scrollbar-width: auto;
}
.leaflet-control-geocoder-intern .gi-syntax-help[hidden] {
  display: none !important;
}
.leaflet-control-geocoder-intern .gi-help-title {
  margin: 0 0 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gi-blue);
}
.leaflet-control-geocoder-intern .gi-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.leaflet-control-geocoder-intern .gi-help-entry {
  display: block;
  margin: 0;
  padding: 6px 0;
  border-top: 1px solid #edf0f2;
  font-size: 12px;
  line-height: 1.4;
}
.leaflet-control-geocoder-intern .gi-help-label,
.leaflet-control-geocoder-intern .gi-help-example {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}
.leaflet-control-geocoder-intern .gi-help-label {
  font-weight: 600;
  margin-bottom: 1px;
}
.leaflet-control-geocoder-intern .gi-help-example {
  color: #526c78;
}

/* ============================================================
   Mobilkorrektur V2: Leaflet 1.6.0 hat bereits ein natives
   topcenter als .leaflet-top.leaflet-center. Nur aeltere
   Installationen verwenden .leaflet-geocoder-topcenter.

   Die Ecke fuellt den Kartenbereich zwischen den seitlichen
   Werkzeugleisten. Die eigentliche Suchleiste bleibt mittig
   und ist auf 420px begrenzt. Keine 100vw-/Prozentrechnung
   fuer die Breite der absolut positionierten Ecke.
   ============================================================ */
.leaflet-control-container .leaflet-top.leaflet-center,
.leaflet-control-container .leaflet-geocoder-topcenter {
  left: 54px !important;
  right: 54px !important;
  top: 0;
  width: auto !important;
  max-width: none !important;
  transform: none !important;
  pointer-events: none;
}

.leaflet-control-container .leaflet-top.leaflet-center > .leaflet-control-geocoder-intern:not(.gi-collapsed),
.leaflet-control-container .leaflet-geocoder-topcenter > .leaflet-control-geocoder-intern:not(.gi-collapsed) {
  box-sizing: border-box !important;
  display: block;
  float: none;
  width: 100% !important;
  max-width: 420px !important;
  min-width: 0 !important;
  margin: 10px auto 0 !important;
  pointer-events: auto;
}

/* Auch bei der optional eingeklappten Suche die Lupe zentrieren. */
.leaflet-control-container .leaflet-top.leaflet-center > .leaflet-control-geocoder-intern.gi-collapsed,
.leaflet-control-container .leaflet-geocoder-topcenter > .leaflet-control-geocoder-intern.gi-collapsed {
  box-sizing: border-box !important;
  float: none;
  width: 40px !important;
  max-width: 40px !important;
  min-width: 40px !important;
  margin: 10px auto 0 !important;
  pointer-events: auto;
}
