/* ===================================================================
   BSC Biendorf — Suche (Ebene über der Seite, suche.js)
   Desktop: Fenster oben mittig wie eine Befehlspalette.
   Handy: ganzer Bildschirm, Eingabe oben, Tastatur-Hinweise ausgeblendet.
   =================================================================== */

.such-offen, .such-offen body { overflow: hidden; }

.such-ebene {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(16px, 10vh, 110px) 16px 16px;
  background: rgba(4, 38, 15, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .16s ease;
}
.such-ebene.an { opacity: 1; }
.such-ebene[hidden] { display: none; }

.such-fenster {
  width: min(680px, 100%);
  max-height: min(640px, calc(100dvh - 2 * clamp(16px, 10vh, 110px)));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 0, 0, .06);
  overflow: hidden;
  transform: translateY(-8px) scale(.985);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.such-ebene.an .such-fenster { transform: none; }

/* ---------- Eingabe ---------- */

.such-kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid #EEEEEA;
}
.such-kopf > svg { width: 22px; height: 22px; flex: none; color: var(--gruen-hell); }
.such-feld {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.12rem;
  color: var(--text);
  padding: 6px 0;
}
.such-feld::placeholder { color: #9AA59E; }
.such-feld::-webkit-search-cancel-button { display: none; }

.such-zu {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: var(--sand);
  color: var(--grau);
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}
.such-zu svg { display: none; width: 18px; height: 18px; }
.such-zu:hover { background: #E8E8E3; color: var(--text); }
.such-esc { font-weight: 700; letter-spacing: .03em; }

/* ---------- Ergebnisse ---------- */

.such-inhalt {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 10px 12px;
}

.such-gruppe + .such-gruppe { margin-top: 6px; }
.such-gruppe-titel {
  margin: 10px 10px 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8A968E;
}

.st-treffer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  scroll-margin: 8px;
}
.st-treffer.aktiv { background: #EEF6F1; }

.st-zeichen {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #E8F3EC;
  color: var(--gruen);
}
.st-zeichen svg { width: 20px; height: 20px; }
.st-treffer.aktiv .st-zeichen { background: var(--gruen); color: #fff; }

.st-bild {
  flex: none;
  width: 38px; height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f3f1;
}
.st-bild img { width: 100%; height: 100%; object-fit: cover; }

.st-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.st-text b {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-text small {
  margin-top: 2px;
  color: var(--grau);
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-treffer mark {
  background: transparent;
  color: var(--gruen);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #9FD3B1;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.st-text small mark { font-weight: 700; }

.st-meta { flex: none; color: #8A968E; font-size: .76rem; }
.st-los { flex: none; color: #B4C2B9; opacity: 0; transition: opacity .12s ease; }
.st-los svg { width: 16px; height: 16px; display: block; }
.st-treffer.aktiv .st-los { opacity: 1; color: var(--gruen); }

/* ---------- Sofort-Antwort ---------- */

.such-antwort {
  margin: 6px 4px 10px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--menue-oben, #0a3d22), var(--menue-unten, #04260f));
  color: #fff;
}
.sa-oben {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--akzent, #8ee0ad);
}
.sa-oben svg { width: 16px; height: 16px; }
.sa-haupt { margin: 8px 0 2px; font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.sa-unter { margin: 0; color: rgba(255, 255, 255, .75); font-size: .9rem; }
.sa-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.such-antwort .sa-knopf {
  display: inline-flex;
  padding: 7px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
}
.such-antwort .sa-knopf.erst { background: #fff; color: var(--gruen); }
.such-antwort .sa-knopf.aktiv { box-shadow: 0 0 0 2px var(--akzent, #8ee0ad); }
.sa-liste { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.such-antwort .sa-zeile {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 9px;
  color: #fff;
  font-size: .9rem;
}
.such-antwort .sa-zeile span { color: rgba(255, 255, 255, .75); font-variant-numeric: tabular-nums; text-align: right; }
.such-antwort .sa-zeile.aktiv { background: rgba(255, 255, 255, .12); }

/* ---------- Start, leer, nichts gefunden ---------- */

.such-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 10px 6px; }
.such-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid #E2E8E4;
  border-radius: 99px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.such-chip svg { width: 14px; height: 14px; color: #9AA59E; }
.such-chip:hover { background: #EEF6F1; border-color: #CFE3D6; color: var(--gruen); }

.such-leer, .such-nichts { margin: 0; padding: 18px 12px 8px; color: var(--grau); }
.such-nichts p { margin: 0 0 8px; }
.such-meintest { margin-left: 4px; color: var(--gruen); font-weight: 700; }

/* ---------- Fußzeile mit Tastenhinweisen ---------- */

.such-fuss {
  display: flex;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid #EEEEEA;
  background: #FAFAF8;
  color: #8A968E;
  font-size: .76rem;
}
.such-fuss kbd {
  display: inline-block;
  min-width: 20px;
  margin-right: 3px;
  padding: 1px 5px;
  border: 1px solid #DCDCD6;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font: inherit;
  font-size: .72rem;
  text-align: center;
}

/* ---------- Handy: ganzer Bildschirm ---------- */

@media (max-width: 640px) {
  .such-ebene { padding: 0; background: #fff; backdrop-filter: none; }
  .such-fenster {
    width: 100%;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    padding-top: env(safe-area-inset-top);
  }
  .such-kopf { padding: 10px 10px 10px 16px; }
  .such-feld { font-size: 1.05rem; }   /* ≥16px: iOS zoomt sonst beim Antippen */
  .such-esc { display: none; }
  .such-zu { background: transparent; }
  .such-zu svg { display: block; width: 22px; height: 22px; }
  .such-fuss { display: none; }
  .st-treffer { padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .such-ebene, .such-fenster { transition: none; }
}

/* ---------- Einstieg im „Mehr"-Blatt der App-Leiste ---------- */

.am-suche {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid #E2E8E4;
  border-radius: 14px;
  background: var(--sand);
  color: #7D8A82;
  font: inherit;
  font-size: .95rem;
  text-align: left;
  cursor: pointer;
}
.am-suche svg { width: 19px; height: 19px; color: var(--gruen-hell); flex: none; }
.am-suche:active { background: #EEF6F1; }
