/* ==========================================================================
   NearMeCheck – Design-System & Layout
   Ruhige neutrale Flaeche, EIN Markenblau. Gruen/Gelb/Rot sind ausschliesslich
   der eigenen Markierung vorbehalten und werden nirgends dekorativ benutzt.
   ========================================================================== */

:root {
  --brand:        #2E6FCB;
  --brand-dark:   #245BA8;
  --brand-soft:   #EDF3FC;
  --brand-line:   #CFE0F8;

  --ink:          #1A1F26;
  --ink-2:        #39414A;
  --ink-3:        #5F6872;
  --ink-4:        #939BA4;
  --line:         #E6E9ED;
  --line-strong:  #D3D9E0;
  --bg:           #F4F6F8;
  --surface:      #FFFFFF;
  --surface-2:    #FAFBFC;

  /* Markierung – nur hierfuer */
  --m-green:      #2F8F4E;
  --m-yellow:     #C08A16;
  --m-red:        #C43D34;
  --m-rejected:   #A3231A;

  /* Kategorien: nur als zarte Tinte in Chips, nie als Markerfarbe */
  --c-hotel:      #2E6FCB;
  --c-restaurant: #7C5CD6;
  --c-realestate: #0E7C86;

  --radius:      13px;
  --radius-sm:   9px;
  --radius-pill: 999px;

  --sh-1: 0 1px 2px rgba(20,30,45,.05);
  --sh-2: 0 3px 10px rgba(20,30,45,.08);
  --sh-3: 0 14px 36px rgba(20,30,45,.16), 0 2px 8px rgba(20,30,45,.06);

  --header-h: 56px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Klassen mit display:flex wuerden das hidden-Attribut sonst aushebeln. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--brand); color: #fff; padding: 10px 16px; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ============================ Bedienelemente ============================ */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2);
  border-radius: var(--radius-sm);
  font-weight: 550; font-size: 14px; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); color: var(--ink); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(20,30,45,.055); border-color: transparent; }
.btn--quiet { background: transparent; border-color: var(--line); color: var(--ink-3); font-weight: 500; }
.btn--quiet:hover { background: var(--surface); color: var(--ink); }
.btn--sm { min-height: 31px; padding: 0 10px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; }
.btn--icon { padding: 0; width: 36px; justify-content: center; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; background: transparent;
  color: var(--ink-3); border-radius: 8px; cursor: pointer; font-size: 19px; line-height: 1;
}
.iconbtn:hover { background: rgba(20,30,45,.07); color: var(--ink); }
.iconbtn svg { width: 17px; height: 17px; }
.ico { width: 17px; height: 17px; flex: none; }

.input, .select {
  width: 100%; min-height: 36px; padding: 6px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46,111,203,.13);
}
.input--area { resize: vertical; min-height: 66px; line-height: 1.45; }

.select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%235F6872' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
}
.select--sm { min-height: 31px; font-size: 13px; padding: 3px 26px 3px 9px; width: auto; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

.blocktitle {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-4);
}

/* ============================ Kopfzeile ============================ */

.app-header {
  display: flex; align-items: center; gap: 16px;
  height: var(--header-h); padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand__name { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }

.project-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-title__input {
  width: min(340px, 100%); padding: 5px 10px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2);
}
.project-title__input:hover { background: var(--surface-2); border-color: var(--line); }
.project-title__input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46,111,203,.13); }
.project-title__hint { font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.project-title__hint.is-flash { color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 2px; flex: none; }

/* ============================ Toolbar ============================ */

.toolbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 9px 16px; }
.toolbar__row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.toolbar__row--filters {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); gap: 20px;
}

.searchfield { position: relative; display: flex; align-items: center; flex: 0 1 260px; }
.searchfield__ico { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--ink-4); pointer-events: none; }
.searchfield__input {
  width: 100%; min-height: 36px; padding: 7px 32px 7px 34px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface-2);
}
.searchfield__input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46,111,203,.13); }
.searchfield__input::-webkit-search-cancel-button { display: none; }
.searchfield__clear {
  position: absolute; right: 7px; width: 22px; height: 22px; border: 0;
  background: rgba(20,30,45,.08); color: var(--ink-3); border-radius: 50%; cursor: pointer; line-height: 1;
}

.catgroup { display: flex; gap: 5px; }
.cat {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 11px;
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 550; color: var(--ink-3); cursor: pointer;
  transition: all .14s;
}
.cat__ico { width: 15px; height: 15px; flex: none; opacity: .6; }
.cat__count { font-size: 11px; font-weight: 700; color: var(--ink-4); }
.cat:hover { border-color: var(--ink-4); color: var(--ink); }
/* Aktiv = zarte Tinte statt Volltonfarbe: ruhiger und laesst die Ampel wirken */
.cat[aria-pressed="true"] { color: var(--ink); }
.cat[aria-pressed="true"] .cat__ico { opacity: 1; }
.cat[data-category="hotel"][aria-pressed="true"]      { background: #EDF3FC; border-color: #C3D8F5; color: #1E5299; }
.cat[data-category="restaurant"][aria-pressed="true"] { background: #F2EEFC; border-color: #D6C9F3; color: #5A3EAF; }
.cat[data-category="realestate"][aria-pressed="true"] { background: #E7F4F5; border-color: #B6DEE1; color: #0A5B62; }
.cat[aria-pressed="false"] { opacity: .62; }
.cat[aria-pressed="false"] .cat__count { text-decoration: line-through; }

.btn--optimal { border-color: var(--brand-line); color: var(--brand-dark); background: var(--brand-soft); }
.btn--optimal:hover { background: #E3EDFB; border-color: var(--brand); color: var(--brand-dark); }
.btn--optimal[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.toolbar__results { margin-left: auto; color: var(--ink-3); font-weight: 500; }
.toolbar__results strong { color: var(--ink); font-weight: 700; }

.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 1px; }

.field { display: flex; flex-direction: column; gap: 2px; min-width: 168px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.field__inline { display: flex; align-items: center; gap: 10px; }
.field__inline output { font-size: 12.5px; font-weight: 600; color: var(--ink-2); min-width: 74px; text-align: right; }
.field input[type=range] { flex: 1; accent-color: var(--brand); height: 20px; cursor: pointer; }

/* ============================ Bezugspunkte ============================ */

.refbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.refbar__chips { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; min-width: 180px; }
.refbar__add { position: relative; flex: none; }
.plus { font-size: 16px; line-height: 1; margin-top: -1px; }

.refchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 9px; min-height: 32px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill); max-width: 340px;
}
.refchip__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.refchip__name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  border: 0; background: transparent; padding: 2px 3px; border-radius: 5px;
  width: 13ch; min-width: 0; max-width: 190px; flex: 0 1 auto; text-overflow: ellipsis;
}
.refchip__name:hover { background: #fff; }
.refchip__name:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--brand); }
.refchip__weight {
  font-size: 10.5px; font-weight: 700; color: var(--ink-3);
  background: rgba(20,30,45,.06); border: 0; border-radius: var(--radius-pill);
  padding: 2px 7px; cursor: pointer; white-space: nowrap;
}
.refchip__weight:hover { background: rgba(20,30,45,.12); color: var(--ink); }
.refchip__act {
  width: 24px; height: 24px; border: 0; background: transparent; color: var(--ink-4);
  border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.refchip__act:hover { background: rgba(20,30,45,.08); color: var(--ink); }
.refchip__act svg { width: 14px; height: 14px; }
.refchip__act--del:hover { background: #FCEBE9; color: var(--m-red); }
.refbar__empty { font-size: 13px; color: var(--ink-3); font-style: italic; display: flex; align-items: center; min-height: 32px; }

/* Popover */
.popover {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 700;
  width: 318px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--sh-3);
}
.popover__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.popover__note { margin: 8px 0 0; font-size: 12px; color: var(--ink-4); line-height: 1.45; }
.popover__note.is-error { color: var(--m-red); }

.tabs { display: flex; gap: 3px; padding: 3px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 11px; }
.tab { flex: 1; padding: 6px 8px; border: 0; background: transparent; border-radius: 6px; font-size: 13px; font-weight: 550; color: var(--ink-3); cursor: pointer; }
.tab.is-on { background: var(--surface); color: var(--brand-dark); box-shadow: var(--sh-1); }
.tabpane { display: none; }
.tabpane.is-on { display: block; }

.suggest {
  list-style: none; margin: 6px 0 0; padding: 4px; max-height: 208px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.suggest button { display: block; width: 100%; text-align: left; padding: 7px 9px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.suggest button:hover, .suggest button:focus { background: var(--brand-soft); outline: none; }
.suggest strong { display: block; font-weight: 600; color: var(--ink); }
.suggest span { font-size: 11.5px; color: var(--ink-4); }

/* ============================ Karte ============================ */

.mapwrap {
  position: relative;
  /* Hoehe kommt aus JS (--map-h): sie misst, wie viel Platz oberhalb wirklich
     belegt ist. Damit waechst die Karte automatisch, sobald die Suchleiste
     eingeklappt wird – in jedem Layout, ohne Magic Numbers je Breakpoint. */
  height: var(--map-h, clamp(420px, calc(100vh - 320px), 820px));
  min-height: 360px;
  background: #E9EDF0;
  border-bottom: 1px solid var(--line);
}
.map { position: absolute; inset: 0; }

.map-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 620;
  display: flex; align-items: center; gap: 12px; padding: 7px 9px 7px 15px;
  background: var(--ink); color: #fff; border-radius: var(--radius-pill);
  box-shadow: var(--sh-3); font-size: 13.5px; font-weight: 550;
}
.map-banner .btn { background: rgba(255,255,255,.16); border-color: transparent; color: #fff; }

.map-note {
  position: absolute; top: 12px; left: 12px; z-index: 620;
  display: flex; align-items: center; gap: 9px; padding: 7px 7px 7px 13px;
  background: var(--brand); color: #fff; border-radius: var(--radius-pill);
  box-shadow: var(--sh-2); font-size: 13px;
}
.map-note strong { font-weight: 700; }
.map-note span { opacity: .9; }
.map-note .iconbtn { color: #fff; }
.map-note .iconbtn:hover { background: rgba(255,255,255,.2); color: #fff; }

.map-tools { position: absolute; right: 12px; top: 12px; z-index: 610; display: flex; flex-direction: column; gap: 6px; }
.maptool {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.96); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: var(--sh-1); color: var(--ink-2); cursor: pointer;
}
.maptool:hover { color: var(--brand); border-color: var(--brand); }
.maptool[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.maptool svg { width: 17px; height: 17px; }

.map-legend {
  position: absolute; left: 12px; bottom: 22px; z-index: 610;
  background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--sh-1); padding: 8px 10px; font-size: 11.5px;
}
.map-legend__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.map-legend__list li { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.map-legend__foot { margin: 7px 0 0; padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink-4); font-size: 10.5px; max-width: 190px; }
.map-legend__foot:empty { display: none; }
.lg { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(20,30,45,.18); }
.lg--ref { background: #3B5BDB; border-radius: 3px; }
.lg--offer { background: var(--brand); }
.lg--green { background: var(--m-green); }
.lg--yellow { background: var(--m-yellow); }
.lg--red { background: var(--m-red); }
.lg--rejected {
  background: #fff; color: var(--m-rejected); border-color: var(--m-rejected);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; line-height: 1;
}

/* ---- Marker: kleiner blauer Punkt ---- */

.nm-marker { background: none !important; border: 0 !important; }

.nm-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand); border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(15,25,40,.4);
  transition: transform .12s, box-shadow .12s;
  display: flex; align-items: center; justify-content: center;
}
.nm-marker:hover .nm-dot { transform: scale(1.35); z-index: 5; }
.nm-dot--green    { background: var(--m-green); }
.nm-dot--yellow   { background: var(--m-yellow); }
.nm-dot--red      { background: var(--m-red); }
.nm-dot--rejected {
  background: #fff; border-color: var(--m-rejected);
  box-shadow: 0 1px 3px rgba(15,25,40,.25);
}
.nm-dot__x { color: var(--m-rejected); font-size: 13px; font-weight: 900; line-height: 1; margin-top: -1px; }
.nm-dot.is-selected {
  transform: scale(1.5);
  box-shadow: 0 0 0 5px rgba(46,111,203,.28), 0 2px 8px rgba(15,25,40,.45);
  z-index: 10;
}
.nm-marker:hover .nm-dot.is-selected { transform: scale(1.55); }

/* Bezugspunkt: eckiges Schild – bewusst voellig andere Form als die Punkte */
.nm-refpin {
  position: relative; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2.5px solid currentColor; border-radius: 7px;
  box-shadow: 0 3px 9px rgba(15,25,40,.3);
  font-size: 12.5px; font-weight: 800; line-height: 1; cursor: grab;
}
.nm-refpin:active { cursor: grabbing; }
.nm-refpin::after {
  content: ""; position: absolute; left: 50%; bottom: -6px;
  width: 9px; height: 9px; margin-left: -4.5px;
  background: currentColor; transform: rotate(45deg); border-radius: 2px;
}
.leaflet-tooltip.nm-reflabel {
  background: rgba(26,31,38,.86); color: #fff; border: 0; border-radius: 6px;
  padding: 2px 7px; font-size: 11.5px; font-weight: 650; box-shadow: none; white-space: nowrap;
}
.leaflet-tooltip.nm-reflabel::before { display: none; }

.nm-cluster {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; font-size: 12px; color: var(--brand-dark);
  background: rgba(255,255,255,.94); border: 2px solid var(--brand);
  box-shadow: 0 2px 7px rgba(15,25,40,.22);
}
.nm-marker:hover .nm-cluster { background: var(--brand); color: #fff; }

.leaflet-tooltip.nm-routelabel {
  background: rgba(255,255,255,.96); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 4px 9px; font-size: 11.5px; line-height: 1.4;
  color: var(--ink-2); box-shadow: var(--sh-1); text-align: center;
}
.leaflet-tooltip.nm-routelabel::before { display: none; }

/* ---- Hover-Vorschau ---- */

.leaflet-tooltip.nm-preview {
  padding: 0; border: 0; border-radius: var(--radius); background: transparent;
  box-shadow: var(--sh-3); font-family: var(--font); white-space: normal;
}
.leaflet-tooltip.nm-preview::before { display: none; }
.pv {
  width: 282px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-strong); overflow: hidden;
}
.pv__list { font-size: 12px; color: var(--ink-3); line-height: 1.5; padding: 9px 11px; }

/* ---- Mini-Uebersicht: zwei knappe Zeilen, mehr nicht ----
   Genau so viel, wie man zum Weiterklicken oder Aussortieren braucht:
   Zeile 1 Name und Preis, Zeile 2 die Eckdaten. Alles Weitere per
   "Vergroessern". Wird von Hover-Tooltip UND Klick-Bubble genutzt. */

.pv, .bub--mini { padding: 7px 9px 8px; display: grid; gap: 1px; }
.pv { padding: 8px 11px 9px; }

.mini__line1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
/* Leaflets Schliessen-Kreuz sitzt absolut oben rechts – Platz freihalten,
   sonst verschwindet die Lupe darunter. */
.bub--mini .mini__line1 { padding-right: 20px; }
.mini__dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--brand); box-shadow: 0 0 0 1px rgba(20,30,45,.12);
}
.mini__dot--green { background: var(--m-green); }
.mini__dot--yellow { background: var(--m-yellow); }
.mini__dot--red { background: var(--m-red); }
.mini__dot--rejected { background: #fff; box-shadow: 0 0 0 1.8px var(--m-rejected); }

.mini__name {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; line-height: 1.25;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini__price { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; flex: none; }
.mini__zoom {
  flex: none; width: 22px; height: 22px; margin: -3px -3px -3px 1px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ink-4);
  border-radius: 6px; cursor: pointer;
}
.mini__zoom:hover { background: var(--brand-soft); color: var(--brand-dark); }
.mini__zoom svg { width: 13px; height: 13px; }

.mini__line2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini__facts {
  flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.35; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini__facts b { color: var(--ink-2); font-weight: 700; }

/* ---- Bubble (Popup) ---- */

.leaflet-popup.nm-popup .leaflet-popup-content-wrapper {
  border-radius: var(--radius); padding: 0; box-shadow: var(--sh-3);
  border: 1px solid var(--line-strong); overflow: hidden;
}
.leaflet-popup.nm-popup .leaflet-popup-content {
  margin: 0; width: 310px !important; font-family: var(--font);
  /* Die Detailansicht darf nie hoeher werden als die Karte – sonst ragt sie
     oben heraus und kein Nachschieben rettet sie. Dann lieber scrollen. */
  max-height: min(56vh, 460px); overflow-y: auto; overscroll-behavior: contain;
}
/* Die Mini-Uebersicht ist schmaler und braucht weder Deckel noch Scrollen. */
.leaflet-popup.nm-popup--mini .leaflet-popup-content {
  width: 312px !important; max-height: none; overflow: visible;
}
.leaflet-popup.nm-popup a.leaflet-popup-close-button {
  color: var(--ink-3); top: 7px; right: 7px; width: 24px; height: 24px;
  background: rgba(255,255,255,.85); border-radius: 50%; font-size: 17px; line-height: 22px;
}
.leaflet-popup.nm-popup--mini a.leaflet-popup-close-button {
  top: 4px; right: 3px; width: 20px; height: 20px; font-size: 15px; line-height: 18px;
  background: transparent;
}
.leaflet-popup.nm-popup a.leaflet-popup-close-button:hover { background: rgba(20,30,45,.1); color: var(--ink); }

.bub { padding: 11px; display: grid; gap: 7px; }
.bub__head { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 9px; align-items: start; }
.bub__img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; display: block; }
.bub__headtext { min-width: 0; display: grid; gap: 1px; padding-right: 20px; }
.bub__name { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.bub__addr { font-size: 11.5px; color: var(--ink-3); }
.bub__block { display: grid; gap: 5px; padding-top: 7px; border-top: 1px solid var(--line); }
.bub__acts { display: grid; grid-template-columns: auto 1fr; gap: 6px; padding-top: 2px; }
.bub__acts .btn { justify-content: center; }
/* Die Bubble soll nicht die halbe Karte verdecken – Notizfeld bleibt klein
   und waechst nur, wenn der Nutzer es aufzieht. */
.bub .comment-input { min-height: 38px; }
.bub .dist__bar { margin: -1px 0 1px; }

/* ============================ Gemeinsame Bausteine ============================ */

.metaline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.metaline--tight { gap: 6px; }
.metaline .sep { color: var(--line-strong); }

.price { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.price small { font-weight: 500; color: var(--ink-4); font-size: 11px; }
.stars { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); font-weight: 600; }
.stars svg { width: 12px; height: 12px; color: #E0A63B; }
.stars .cnt { color: var(--ink-4); font-weight: 400; font-size: 11px; }

.catchip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 650; padding: 1.5px 7px; border-radius: var(--radius-pill);
}
.catchip svg { width: 11px; height: 11px; }
.catchip--hotel      { background: #EDF3FC; color: #1E5299; }
.catchip--restaurant { background: #F2EEFC; color: #5A3EAF; }
.catchip--realestate { background: #E7F4F5; color: #0A5B62; }

.srcbadge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1.5px 7px; border-radius: var(--radius-pill); white-space: nowrap;
}
.srcbadge svg { width: 10px; height: 10px; opacity: .7; }
.srcbadge--aff { color: var(--brand-dark); background: var(--brand-soft); border-color: var(--brand-line); }

.metric {
  display: inline-flex; align-items: baseline; gap: 3px;
  padding: 1.5px 8px; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid var(--brand-line);
}
.metric b { font-size: 13px; font-weight: 800; }
.metric--quiet { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }
.metric--weak { background: var(--surface-2); color: var(--ink-4); border-color: var(--line); }

/* Entfernungen */
.dists { display: grid; gap: 3px; }
.dist { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 7px; font-size: 12px; }
.dist__dot { width: 9px; height: 9px; border-radius: 50%; }
.dist__name { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist__val { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dist__val small { font-weight: 500; color: var(--ink-4); margin-left: 3px; }
.dist__bar { grid-column: 1/-1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; margin: -1px 0 2px; }
.dist__bar i { display: block; height: 100%; border-radius: 2px; }
.dists--empty { font-size: 12px; color: var(--ink-4); font-style: italic; }
.dists__note { font-size: 10.5px; color: var(--ink-4); margin-top: 2px; }

/* Markierung */
.markselect {
  width: 100%; min-height: 34px; padding: 5px 28px 5px 11px;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13.5px;
  appearance: none; border: 1.5px solid var(--line-strong); background-color: var(--surface); color: var(--ink-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%235F6872' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
}
.markselect:focus { outline: none; box-shadow: 0 0 0 3px rgba(46,111,203,.14); }
.markselect--sm { min-height: 31px; font-size: 13px; padding: 4px 26px 4px 9px; width: auto; flex: 1 1 auto; }
.markselect--green    { border-color: var(--m-green);    color: var(--m-green);    background-color: #EDF7F0; }
.markselect--yellow   { border-color: var(--m-yellow);   color: #96690E;           background-color: #FDF6E4; }
.markselect--red      { border-color: var(--m-red);      color: var(--m-red);      background-color: #FCEDEB; }
.markselect--rejected { border-color: var(--m-rejected); color: var(--m-rejected); background-color: #F7EAE9; }

.mbtns { display: inline-flex; gap: 3px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-pill); }
.mbtn {
  width: 25px; height: 25px; border: 0; border-radius: 50%; background: transparent;
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; line-height: 1; transition: transform .12s, background .12s;
}
.mbtn:hover { transform: scale(1.12); }
.mbtn i { width: 13px; height: 13px; border-radius: 50%; display: block; border: 1.5px solid currentColor; }
.mbtn--green { color: var(--m-green); }
.mbtn--yellow { color: var(--m-yellow); }
.mbtn--red { color: var(--m-red); }
.mbtn--rejected { color: var(--m-rejected); }
.mbtn[aria-pressed="true"] { background: color-mix(in srgb, currentColor 14%, transparent); }
.mbtn[aria-pressed="true"] i { background: currentColor; }

/* Winzige Variante fuer die Mini-Uebersicht */
.mbtns--xs { padding: 1px; gap: 1px; flex: none; }
.mbtns--xs .mbtn { width: 19px; height: 19px; font-size: 12px; }
.mbtns--xs .mbtn i { width: 10px; height: 10px; border-width: 1.4px; }

.comment-input {
  width: 100%; min-height: 52px; resize: vertical; padding: 6px 9px;
  font-size: 12.5px; line-height: 1.4; border: 1px dashed var(--line-strong);
  border-radius: 8px; background: var(--surface-2); color: var(--ink-2);
}
.comment-input::placeholder { color: var(--ink-4); font-style: italic; }
.comment-input:focus { outline: none; background: #fff; border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46,111,203,.13); }
.comment-meta { font-size: 11px; color: var(--ink-4); }

.empty {
  padding: 30px 20px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-3);
}
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 13.5px; }

.skeleton {
  height: 84px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface-2) 30%, #F0F3F6 50%, var(--surface-2) 70%);
  background-size: 220% 100%; animation: shimmer 1.1s infinite linear; border: 1px solid var(--line);
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

/* ============================ Treffer-Panel ============================ */

.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 650;
  width: min(390px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line-strong);
  box-shadow: -8px 0 26px rgba(20,30,45,.1);
}
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--line); flex: none; }
.drawer__title { font-size: 15px; }
.drawer__sub { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.drawer__actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px; display: grid; gap: 8px; align-content: start; }

.rcard {
  padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color .14s, box-shadow .14s;
}
.rcard:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.rcard.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46,111,203,.14); }
.rcard__main { display: grid; gap: 6px; }
.rcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rcard__name { font-size: 14px; font-weight: 650; line-height: 1.3; }
.rcard__addr { font-size: 12px; color: var(--ink-3); }
.rcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px dashed var(--line); }
.rcard[data-rating=green]    { border-left: 3px solid var(--m-green); }
.rcard[data-rating=yellow]   { border-left: 3px solid var(--m-yellow); }
.rcard[data-rating=red]      { border-left: 3px solid var(--m-red); }
.rcard[data-rating=rejected] { opacity: .58; border-left: 3px solid var(--m-rejected); }

/* ============================ Auswahlliste ============================ */

.selection { padding: 18px 16px 22px; background: var(--bg); }
.selection__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.selection__title h2 { font-size: 17px; }
.selection__title p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.selection__tools { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }

.ampel-tabs { display: flex; gap: 3px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); flex-wrap: wrap; }
.atab {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border: 0; background: transparent; border-radius: var(--radius-pill); cursor: pointer;
  font-size: 13px; font-weight: 550; color: var(--ink-3);
}
.atab span { font-size: 11px; font-weight: 700; padding: 0 5px; background: rgba(20,30,45,.07); border-radius: var(--radius-pill); }
.atab:hover { color: var(--ink); background: rgba(20,30,45,.04); }
.atab.is-on { color: #fff; background: var(--ink-2); }
.atab.is-on span { background: rgba(255,255,255,.22); }
.atab--green.is-on  { background: var(--m-green); }
.atab--yellow.is-on { background: var(--m-yellow); }
.atab--red.is-on    { background: var(--m-red); }

.selection__body { display: grid; gap: 9px; }

/* Kompakte Zeile als Standard, Details auf Klick – bei vielen markierten
   Orten zaehlt Ueberblick mehr als Vollstaendigkeit. */
.srow {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--sh-1);
  transition: box-shadow .14s, border-color .14s;
}
.srow:hover { box-shadow: var(--sh-2); }
.srow.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46,111,203,.12); }
.srow[data-rating=green]  { border-left: 4px solid var(--m-green); }
.srow[data-rating=yellow] { border-left: 4px solid var(--m-yellow); }
.srow[data-rating=red]    { border-left: 4px solid var(--m-red); }
.srow[data-rating=none]   { border-left: 4px solid var(--line-strong); }

.srow__summary {
  display: grid;
  grid-template-columns: auto minmax(0,1.4fr) minmax(150px,auto) minmax(170px,auto) 30px;
  gap: 14px; align-items: center; padding: 9px 12px;
}
.srow__mark { display: grid; gap: 3px; justify-items: center; }
.srow__marklabel { font-size: 10px; font-weight: 650; color: var(--ink-4); }
.srow:not(.is-open) .srow__marklabel { display: none; }

.srow__head {
  min-width: 0; display: grid; gap: 1px; text-align: left;
  border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit;
}
.srow__name {
  font-size: 14.5px; font-weight: 650; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srow__head:hover .srow__name { color: var(--brand); }
/* display:contents laesst die beiden Bloecke auf dem Desktop eigene
   Rasterspalten belegen; schmal werden sie zu einer Zeile zusammengefasst. */
.srow__quicks { display: contents; }
.srow__quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.noteflag { display: inline-flex; color: #B08B2E; }
.noteflag svg { width: 13px; height: 13px; }

.drange { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.drange b { font-weight: 700; font-variant-numeric: tabular-nums; }
.drange small { color: var(--ink-4); font-weight: 500; }

.srow__toggle {
  width: 30px; height: 30px; border: 0; background: transparent; color: var(--ink-4);
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .16s, background .14s, color .14s;
}
.srow__toggle:hover { background: rgba(20,30,45,.07); color: var(--ink); }
.srow__toggle svg { width: 17px; height: 17px; }
.srow.is-open .srow__toggle { transform: rotate(180deg); }

.srow__detail {
  display: grid;
  grid-template-columns: minmax(200px,1.3fr) minmax(190px,1fr) minmax(190px,1fr) auto;
  gap: 14px; align-items: start;
  padding: 11px 12px 12px; margin: 0 0 0 0;
  border-top: 1px dashed var(--line);
}
.srow__info { min-width: 0; display: grid; gap: 5px; }
.srow__desc { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.srow__contact { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }
.srow__contact a { color: var(--brand-dark); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.srow__contact a:hover { text-decoration: underline; }
.srow__contact svg { width: 12px; height: 12px; }
.srow__dists { display: grid; gap: 6px; }
.srow__comment { display: grid; gap: 4px; align-content: start; }
.srow__acts { display: flex; flex-direction: column; gap: 5px; }
.srow__acts .btn { justify-content: center; }

/* ---- Quellen-Menue ---- */

.srcmenu { position: relative; }
.srcmenu__count {
  font-size: 11px; font-weight: 700; color: var(--ink-4);
  background: rgba(20,30,45,.06); padding: 1px 6px; border-radius: var(--radius-pill);
}
.popover--sources { width: 288px; }
.popover__foot { display: flex; gap: 6px; margin-top: 10px; }
.srcgroup { margin-bottom: 10px; }
.srcgroup .blocktitle { display: block; margin-bottom: 4px; }
.srcrow {
  display: grid; grid-template-columns: 16px minmax(0,1fr) auto auto;
  align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.srcrow:hover { background: var(--surface-2); }
.srcrow input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.srcrow__name { font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.srcrow__tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--brand-dark); background: var(--brand-soft); border: 1px solid var(--brand-line);
  padding: 1px 5px; border-radius: var(--radius-pill);
}
.srcrow__tag--free { color: var(--ink-3); background: var(--surface-2); border-color: var(--line); }
.srcrow__count { font-size: 11px; font-weight: 700; color: var(--ink-4); min-width: 18px; text-align: right; }
.srcrow input:not(:checked) ~ .srcrow__name { color: var(--ink-4); }

/* ---- Mini-Bubble ---- */

.bub--mini { gap: 6px; }
.bub__minifoot {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.bub__minifoot .markselect { min-height: 31px; font-size: 12.5px; }
.bub__shrink {
  border: 0; background: transparent; color: var(--ink-4); cursor: pointer;
  font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center;
  gap: 5px; justify-self: start; padding: 2px 0;
}
.bub__shrink:hover { color: var(--ink-2); }
.bub__shrink svg { width: 12px; height: 12px; }

/* ============================ Toast / Fuss / Tabs ============================ */

.toast-stack { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1300; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: min(92vw, 520px);
  background: var(--ink); color: #fff; border-radius: var(--radius-pill); box-shadow: var(--sh-3);
  font-size: 13.5px; animation: toastin .2s ease-out; pointer-events: auto;
}
.toast input { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 6px; padding: 3px 7px; font-size: 12px; min-width: 190px; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } }

.app-footer { padding: 16px; text-align: center; color: var(--ink-4); font-size: 11.5px; }
.app-footer p { margin: 0; }

.tabbar { display: none; }

/* ============================ Leiste einklappen ============================ */

/* Mehr Karte auf Knopfdruck: Such- und Bezugspunktleiste verschwinden,
   die Karte waechst um genau deren Hoehe. */
body.is-head-collapsed .toolbar,
body.is-head-collapsed .refbar { display: none; }
.ico--chev { transition: transform .18s; }
[data-action="toggle-head"][aria-pressed="true"] .ico--chev { transform: rotate(180deg); }

/* ============================ Hilfe ============================ */

/* Muss ueber Leaflets Controls liegen – die sitzen auf z-index 1000. */
.helpwrap { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.helpwrap__backdrop { position: absolute; inset: 0; background: rgba(15,22,32,.55); backdrop-filter: blur(2px); }
.help {
  position: relative; z-index: 1;
  width: min(760px, 100%); max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--sh-3);
  animation: helpin .18s ease-out;
}
@keyframes helpin { from { opacity: 0; transform: translateY(10px); } }
.help__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); flex: none;
}
.help__head h2 { font-size: 18px; }
.help__body { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.help__lead {
  margin: 0 0 18px; padding: 12px 14px; font-size: 14px; line-height: 1.55;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm); color: var(--ink-2);
}
.help__lead em { font-style: italic; }

.help__step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; margin-bottom: 20px; }
.help__num {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.help__step h3 { font-size: 15px; margin-bottom: 5px; }
.help__step p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.help__step ul { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.help__step li { margin-bottom: 3px; }
.help__legend { list-style: none; padding: 0; display: grid; gap: 6px; }
.help__legend li { display: flex; align-items: flex-start; gap: 9px; }
.help__legend .lg { margin-top: 4px; }

.help__defs { margin: 0; font-size: 13.5px; line-height: 1.55; }
.help__defs dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
.help__defs dd { margin: 2px 0 0; color: var(--ink-2); }

.help__note {
  margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-4); line-height: 1.5;
}

.nm-maperror {
  position: absolute; inset: 0; z-index: 500;
  display: grid; place-content: center; gap: 6px; text-align: center; padding: 24px;
  background: repeating-linear-gradient(45deg, #EEF1F4, #EEF1F4 12px, #E9EDF0 12px, #E9EDF0 24px);
  color: var(--ink-3); font-size: 13.5px;
}
.leaflet-container { font-family: var(--font); background: #E9EDF0; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.8) !important; }

/* ============================ Responsiv ============================ */

@media (max-width: 1180px) {
  .srow__summary { grid-template-columns: auto minmax(0,1fr) 30px; row-gap: 6px; }
  .srow__quicks { display: flex; gap: 8px 14px; flex-wrap: wrap; grid-column: 2 / 3; }
  .srow__detail { grid-template-columns: minmax(200px,1.3fr) minmax(180px,1fr); }
  .srow__comment, .srow__acts { grid-column: 1 / -1; }
  .srow__acts { flex-direction: row; flex-wrap: wrap; }
  .srow__acts .btn { flex: 1 1 130px; }
}

@media (max-width: 900px) {
  .app-header { gap: 10px; padding: 0 12px; }
  .project-title__hint { display: none; }
  .toolbar { padding: 9px 12px; }
  .refbar { padding: 9px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
  .refbar__chips { width: 100%; }
  .refchip { max-width: 100%; }
  .refchip__name { width: auto; flex: 1 1 60px; max-width: none; }
  .refbar__add { align-self: flex-start; }
  .toolbar__results { margin-left: 0; }
  .selection { padding: 14px 12px 90px; }

  /* Hoehe steuert JS ueber --map-h; hier nur der Notnagel ohne JS. */
  .mapwrap { min-height: 380px; }
  body[data-tab="selection"] .mapwrap,
  body[data-tab="selection"] .toolbar,
  body[data-tab="selection"] .refbar { display: none; }
  body:not([data-tab="selection"]) .selection { display: none; }
  body:not([data-tab="selection"]) .app-footer { display: none; }
  .drawer { width: 100%; }

  .srow__summary { grid-template-columns: auto minmax(0,1fr) 30px; gap: 6px 10px; padding: 8px 10px; }
  .srow__detail { grid-template-columns: minmax(0,1fr); gap: 11px; padding: 10px; }
  .srow__acts { flex-direction: row; flex-wrap: wrap; }
  .srow__acts .btn { flex: 1 1 120px; }
  .srcmenu .popover { left: auto; right: 0; }

  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 800;
    display: grid; grid-template-columns: repeat(2, 1fr);
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar__btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px 9px; border: 0; background: transparent;
    color: var(--ink-4); font-size: 11px; font-weight: 600; cursor: pointer;
  }
  .tabbar__btn svg { width: 21px; height: 21px; }
  .tabbar__btn em { font-style: normal; font-weight: 800; }
  .tabbar__btn.is-on { color: var(--brand); }
  .app-footer { padding-bottom: 76px; }
  .toast-stack { bottom: 74px; }
  .helpwrap { padding: 0; align-items: stretch; }
  .help { width: 100%; max-height: 100%; border-radius: 0; }
  .popover { right: auto; left: 0; width: min(318px, calc(100vw - 24px)); }
  .map-legend { display: none; }
}

@media (max-width: 620px) {
  .searchfield { flex: 1 1 100%; }
  .cat__txt { display: none; }
  .btn--optimal span { display: none; }
  .btn--optimal { padding: 0 10px; }
  .selection__tools { width: 100%; margin-left: 0; }
  .ampel-tabs { width: 100%; }
  .atab { flex: 1; justify-content: center; padding: 6px 4px; font-size: 12px; }
  .leaflet-popup.nm-popup .leaflet-popup-content { width: min(300px, calc(100vw - 56px)) !important; }
  .pv { width: 224px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
