/* ==========================================================================
   OMEGA Barrierefrei-Navigator – Karte, Liste, Filter
   Farben des Status werden NIE allein zur Unterscheidung benutzt: jeder Status hat zusätzlich ein Zeichen (✓ ! ✕ ?) und einen Text.
   ========================================================================== */

.bf {
  --bf-y: #15803d;  --bf-y-bg: #14532d; --bf-y-fg: #bbf7d0;
  --bf-l: #b45309;  --bf-l-bg: #78350f; --bf-l-fg: #fde68a;
  --bf-n: #b91c1c;  --bf-n-bg: #7f1d1d; --bf-n-fg: #fecaca;
  --bf-u: #4b5563;  --bf-u-bg: #374151; --bf-u-fg: #e5e7eb;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 48px;
  display: flex; flex-direction: column; gap: 12px;
}

/* ---- Steuerung ------------------------------------------------------------------------------------------------ */
.bf-controls {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
}
.bf-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bf-search { display: flex; gap: 8px; flex: 1 1 300px; min-width: 0; margin: 0; }
.bf-search input {
  flex: 1; min-width: 0; min-height: 46px; padding: 10px 16px; border-radius: 999px; color: var(--text);
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line-strong);
}
.bf .btn { min-height: 46px; padding: 10px 20px; font-size: 15px; white-space: nowrap; }
.bf-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bf-results[hidden] { display: none; }
.bf-results button {
  width: 100%; min-height: 46px; text-align: left; padding: 10px 14px; border-radius: 12px; cursor: pointer;
  color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
}
.bf-results button:hover, .bf-results button:focus-visible { background: rgba(167, 139, 250, .18); border-color: var(--purple); }

.bf-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-cat {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  color: var(--text); background: rgba(255, 255, 255, .05); border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600;
}
.bf-cat[aria-pressed="true"] { background: var(--purple-2); border-color: var(--purple); color: #fff; }
.bf-cat[aria-pressed="true"]::after { content: "✓"; font-size: 12px; margin-left: 2px; }
.bf-cat:focus-visible, .bf .btn:focus-visible, .bf-item:focus-visible, .bf-tab:focus-visible, .bf-close:focus-visible, .bf-select:focus-visible {
  outline: 3px solid #fff; outline-offset: 2px;
}
.bf-cat-all { background: transparent; border-style: dashed; }

.bf-acc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bf-acc label { font-size: 14px; color: var(--muted); }
.bf-select {
  min-height: 46px; padding: 8px 14px; border-radius: 12px; color: var(--text); background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line-strong); max-width: 100%;
}

.bf-status { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--muted); }
.bf-status strong { color: var(--text); }
.bf-status .btn { min-height: 40px; padding: 6px 14px; font-size: 14px; margin-left: 6px; }
.bf-status.is-error { color: #fecaca; }

/* ---- Umschalter Karte/Liste (nur schmale Bildschirme) -------------------------------------------------------------- */
.bf-tabs { display: none; gap: 8px; }
.bf-tab {
  flex: 1; min-height: 46px; border-radius: 12px; cursor: pointer; font-weight: 700; color: var(--text);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-strong);
}
.bf-tab[aria-selected="true"] { background: var(--purple-2); border-color: var(--purple); color: #fff; }

/* ---- Karte + Liste ------------------------------------------------------------------------------------------------ */
.bf-main {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 12px;
  height: clamp(460px, 72vh, 760px);
}
.bf-map-wrap { position: relative; min-width: 0; min-height: 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line-strong); }
#bf-map { position: absolute; inset: 0; background: #e5e3df; }
.bf-list-wrap {
  min-width: 0; min-height: 0; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.bf-list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.bf-empty { padding: 18px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.bf-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 10px; align-items: center; width: 100%; text-align: left;
  padding: 10px; min-height: 64px; border-radius: 12px; cursor: pointer; color: var(--text);
  background: rgba(255, 255, 255, .05); border: 2px solid transparent;
}
.bf-item:hover { background: rgba(255, 255, 255, .09); }
.bf-item[aria-current="true"] { border-color: var(--purple); background: rgba(167, 139, 250, .16); }
.bf-ico { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: rgba(255, 255, 255, .1); }
.bf-name { font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.bf-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); }

.bf-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.bf-chip[data-w="y"], .bf-chip[data-w="d"] { background: var(--bf-y-bg); color: var(--bf-y-fg); }
.bf-chip[data-w="l"] { background: var(--bf-l-bg); color: var(--bf-l-fg); }
.bf-chip[data-w="n"] { background: var(--bf-n-bg); color: var(--bf-n-fg); }
.bf-chip[data-w="u"] { background: var(--bf-u-bg); color: var(--bf-u-fg); }

/* ---- Markierungen auf der Karte ------------------------------------------------------------------------------------ */
.bf-pin-wrap { background: none; border: 0; }
.bf-pin {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 3px solid var(--st, #4b5563); font-size: 18px; line-height: 1; color: #111;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45); transition: transform .15s;
}
.bf-pin[data-w="y"], .bf-pin[data-w="d"] { --st: var(--bf-y); }
.bf-pin[data-w="l"] { --st: var(--bf-l); }
.bf-pin[data-w="n"] { --st: var(--bf-n); }
.bf-pin[data-w="u"] { --st: var(--bf-u); }
.bf-pin .bf-badge {
  position: absolute; right: -7px; bottom: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--st); color: #fff;
  border: 2px solid #fff; font: 700 11px/14px system-ui, sans-serif; text-align: center;
}
.bf-pin-wrap:focus-visible .bf-pin, .bf-pin-wrap.is-sel .bf-pin { transform: scale(1.3); outline: 4px solid #7c3aed; outline-offset: 2px; z-index: 5; }
.bf-me { background: none; border: 0; }
.bf-me span { display: block; width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px #2563eb, 0 2px 6px rgba(0, 0, 0, .5); }
.bf-me-search span { background: #7c3aed; box-shadow: 0 0 0 2px #7c3aed, 0 2px 6px rgba(0, 0, 0, .5); }

/* ---- Karten-Hinweise ---------------------------------------------------------------------------------------------- */
.bf-maphint {
  position: absolute; z-index: 800; left: 50%; top: 10px; transform: translateX(-50%); max-width: calc(100% - 100px);
  padding: 8px 14px; border-radius: 999px; background: rgba(17, 16, 29, .92); color: #fff; font-size: 13.5px; text-align: center;
  border: 1px solid var(--line-strong); pointer-events: none;
}
.bf-maphint[hidden] { display: none; }
.bf-zoomcta { position: absolute; z-index: 800; left: 50%; bottom: 16px; transform: translateX(-50%); }
.bf-zoomcta[hidden] { display: none; }

/* ---- Detail ------------------------------------------------------------------------------------------------------- */
.bf-detail {
  position: absolute; z-index: 1100; left: 8px; bottom: 8px; width: min(430px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow: auto;
  padding: 16px 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--purple); box-shadow: var(--shadow);
}
.bf-detail[hidden] { display: none; }
.bf-detail h2 { margin: 0 44px 2px 0; font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; }
.bf-detail h2:focus { outline: none; }
.bf-kind { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.bf-close {
  position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 20px;
  color: var(--text); background: rgba(255, 255, 255, .08); border: 1px solid var(--line-strong);
}
.bf-big { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; margin: 6px 0; font-size: 15px; line-height: 1.45; }
.bf-big .g { font-size: 20px; font-weight: 800; line-height: 1.2; }
.bf-big[data-w="y"], .bf-big[data-w="d"] { background: var(--bf-y-bg); color: var(--bf-y-fg); }
.bf-big[data-w="l"] { background: var(--bf-l-bg); color: var(--bf-l-fg); }
.bf-big[data-w="n"] { background: var(--bf-n-bg); color: var(--bf-n-fg); }
.bf-big[data-w="u"] { background: var(--bf-u-bg); color: var(--bf-u-fg); }
.bf-facts { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.bf-facts li { overflow-wrap: anywhere; }
.bf-facts b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.bf-facts a { color: #c4b5fd; text-decoration: underline; text-underline-offset: 3px; }
.bf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bf-actions a { min-height: 44px; padding: 8px 16px; font-size: 14px; text-decoration: none; }
.bf-help { margin: 12px 0 0; font-size: 12.5px; color: #9b95b6; line-height: 1.5; }

/* ---- Legende, Hinweise ------------------------------------------------------------------------------------------- */
.bf-info {
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); padding: 4px 14px;
}
.bf-info > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; font-size: 14.5px; }
.bf-info[open] > summary { margin-bottom: 4px; }
.bf-legend { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; font-size: 14px; }
.bf-legend li { display: flex; gap: 8px; align-items: flex-start; }
.bf-info p { margin: 8px 0; font-size: 13.5px; line-height: 1.6; color: #b9b3d2; }
.bf-info a { color: #c4b5fd; text-decoration: underline; text-underline-offset: 3px; }
.bf noscript p { padding: 14px; border-radius: 12px; background: var(--bf-n-bg); color: var(--bf-n-fg); }

/* ---- Schmale Bildschirme: Karte ODER Liste -------------------------------------------------------------------------- */
@media (max-width: 899px) {
  .bf { width: calc(100% - 24px); }
  .bf-tabs { display: flex; }
  .bf-main { grid-template-columns: minmax(0, 1fr); height: clamp(420px, 68vh, 720px); }
  .bf-main[data-view="map"] .bf-list-wrap { display: none; }
  .bf-main[data-view="list"] .bf-map-wrap { display: none; }
  .bf-detail { left: 6px; right: 6px; bottom: 6px; width: auto; max-height: 72%; }
}

/* ---- App-Ansicht (ohne Website-Kopf und -Fuß): volle Höhe, Bedienelemente kompakt -------------------------------------- */
/* Die App-Ansicht füllt das Fenster über „position: fixed“ statt über Höhen-Einheiten (vh/dvh): Manche Android-WebViews rechnen diese
   Einheiten in der App falsch, dann hat die Karte keine Fläche. Ist das Fenster sehr niedrig, lässt sich die Ansicht scrollen. */
body.bf-app { margin: 0; overflow: hidden; background: var(--bg); }
body.bf-app::before, body.bf-app::after { display: none; }
body.bf-app .bf {
  position: fixed; inset: 0; width: auto; height: auto; margin: 0; padding: env(safe-area-inset-top, 0) 0 0; gap: 8px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
}
body.bf-app .bf-controls { border-radius: 0; border-left: 0; border-right: 0; padding: 8px 10px; gap: 8px; }
body.bf-app .bf-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
body.bf-app .bf-cat { flex: 0 0 auto; }
body.bf-app .bf-main { height: auto; flex: 1 1 auto; min-height: 240px; margin: 0 8px; }
body.bf-app .bf-info { margin: 0 8px 8px; }
body.bf-app .bf-tabs { margin: 0 8px; }
.bf-appbar { display: none; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--font-head); font-weight: 700; }
body.bf-app .bf-appbar { display: flex; }
body.bf-app .bf-appbar { padding: 8px 12px 0; }
body.bf-app .bf-status { padding: 0 12px; }
.bf-appbar small { padding: 2px 8px; border-radius: 999px; background: #0e7c86; color: #fff; font: 700 11px/1.6 var(--font); letter-spacing: .04em; }
/* Handy in der App: Suche, Standort und Anzeige-Filter in möglichst wenig Höhe, damit die Karte Platz hat */
@media (max-width: 599px) {
  body.bf-app .bf-row { flex-wrap: nowrap; gap: 8px; }
  body.bf-app .bf-search { flex: 1 1 auto; }
  body.bf-app .bf-locate { flex: 0 0 auto; width: 46px; padding: 0; font-size: 20px; }
  body.bf-app .bf-locate-t { display: none; }
  body.bf-app .bf-acc { flex-wrap: nowrap; }
  body.bf-app .bf-select { flex: 1 1 auto; min-width: 0; min-height: 44px; }
  body.bf-app .bf-main { margin: 0 8px; }
}
@media (min-width: 900px) {
  body.bf-app .bf-main { margin: 0 12px; }
  body.bf-app .bf-info { margin: 0 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .bf-pin { transition: none; }
}
@media (forced-colors: active) {
  .bf-chip, .bf-big { border: 1px solid CanvasText; }
  .bf-cat[aria-pressed="true"] { outline: 2px solid Highlight; }
}
