/* ==========================================================================
   Startseite, Kamera, Willkommens-Tour, Rückgängig, Tooltips (TASKS B4.5–B4.17)
   ========================================================================== */

/* ---------- Startseite: die Suche ist die Hauptaktion (B4.7) ---------- */
.search-form--home .search-field input { min-height: 52px; font-size: var(--s-text-lg); padding-left: var(--s-space-7); border-radius: var(--s-radius-lg); }
.search-form--home .search-field__icon { left: 16px; width: 20px; height: 20px; }
.search-form--home .search__submit { height: 52px; padding-inline: var(--s-space-5); border-radius: var(--s-radius-lg); }
.search-form--home .search-help__toggle { height: var(--s-touch); width: var(--s-touch); }
.search-form--home .search__submit { min-width: 52px; }
.home-actions { margin: calc(var(--s-space-2) * -1) 0 var(--s-space-4); }

.home-recent { margin: var(--s-space-2) 0 var(--s-space-5); }
.home-recent__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-space-2); }
.home-recent__item {
  display: inline-flex; align-items: center; gap: var(--s-space-2); max-width: 280px; min-height: 44px;
  padding: var(--s-space-2) var(--s-space-4); border: 1px solid var(--s-border); border-radius: var(--s-radius-pill);
  background: var(--s-surface); color: var(--s-text); text-decoration: none; font-size: var(--s-text-base);
}
.home-recent__item:hover { border-color: var(--s-border-strong); background: var(--s-raised-hover); }
.home-recent__item:focus-visible { outline: 2px solid var(--s-accent); outline-offset: 2px; }
.home-recent__item .icon { flex: none; width: 16px; height: 16px; color: var(--s-icon); }
.home-recent__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.home-list__title { margin-top: var(--s-space-2); }

/* ---------- „Foto aufnehmen“ nur auf Handy-Breite (B4.17) ---------- */
.camera-upload { display: none; }
.camera-upload__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.camera-upload__button { min-height: 44px; cursor: pointer; }
.camera-upload__button:focus-within { outline: 2px solid var(--s-accent); outline-offset: 2px; }
.camera-upload--busy .camera-upload__button { opacity: .6; pointer-events: none; }
@media (max-width: 767.98px) {
  .camera-upload { display: inline-flex; }
}

/* ---------- Willkommens-Tour (B4.6) ---------- */
.tour { width: min(440px, calc(100vw - 32px)); }
.tour__body { gap: var(--s-space-4); }
.tour__progress { font-size: var(--s-text-sm); color: var(--s-text-3); font-variant-numeric: tabular-nums; }
.tour__step { display: grid; gap: var(--s-space-2); justify-items: start; }
.tour__icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--s-radius-lg);
  background: var(--s-accent-soft); color: var(--s-accent-text);
}
.tour__heading { font-family: var(--s-font-head); font-size: var(--s-text-lg); font-weight: 700; }
.tour__text { color: var(--s-text-2); line-height: 1.55; }
.tour__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-space-2); }
.tour__actions .btn { min-height: 44px; }
.tour__spacer { flex: 1; }
@media (prefers-reduced-motion: reduce) { .tour[open] { animation: none; } }

/* ---------- Fehlermeldung mit „Erneut versuchen“ (B4.9) ---------- */
.alert__action { justify-self: start; margin-top: var(--s-space-2); }

/* ---------- Rückgängig im Hinweis nach dem Löschen (B4.8) ---------- */
.toast__undo { margin: calc(var(--s-space-1) * -1) 0; }
.toast__action {
  min-height: 32px; background: transparent; color: var(--s-toast-accent); border-color: var(--s-toast-accent-border);
  font-weight: 600;
}
.toast__action:hover { background: var(--s-toast-hover); color: var(--s-toast-accent-strong); }
.toast__action:focus-visible { outline: 2px solid var(--s-toast-accent); outline-offset: 1px; }

/* ---------- Tooltips für Knöpfe nur mit Symbol (B4.5) ----------
   Text kommt aus aria-label – derselbe Name, den Screenreader vorlesen. Erscheint bei Maus
   UND Tastatur-Fokus (title tut das nicht). Touch: kein Hover, der Name bleibt für Screenreader. */
.btn--icon[aria-label], .segmented__btn[aria-label] { position: relative; }
.btn--icon[aria-label]::after, .segmented__btn[aria-label]::after {
  content: attr(aria-label);
  position: absolute; z-index: 70; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
  padding: var(--s-space-1) var(--s-space-2); border-radius: var(--s-radius-sm); white-space: nowrap; pointer-events: none;
  background: var(--s-toast-bg); color: var(--s-toast-text); font-size: var(--s-text-xs); font-weight: 500; line-height: 1.4;
  display: none; /* nicht nur unsichtbar: sonst verbreitert es am Rand die Seite (seitliches Scrollen) */
}
.btn--icon[aria-label]:hover::after, .segmented__btn[aria-label]:hover::after,
.btn--icon[aria-label]:focus-visible::after, .segmented__btn[aria-label]:focus-visible::after {
  display: block;
}
@media (hover: none) {
  .btn--icon[aria-label]:hover::after, .segmented__btn[aria-label]:hover::after { display: none; }
}
