/* ============================================
   FAKSTER — Design System
   Modern map-centric UI, mobile-first, orange accent
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  /* Orange palette */
  --f-orange-50: #FFF7ED;
  --f-orange-100: #FFEDD5;
  --f-orange-200: #FED7AA;
  --f-orange-300: #FDBA74;
  --f-orange-400: #FB923C;
  --f-orange-500: #F97316;
  --f-orange-600: #EA580C;
  --f-orange-700: #C2410C;

  /* Neutrals */
  --f-white: #FFFFFF;
  --f-gray-50: #F9FAFB;
  --f-gray-100: #F3F4F6;
  --f-gray-200: #E5E7EB;
  --f-gray-300: #D1D5DB;
  --f-gray-400: #9CA3AF;
  --f-gray-500: #6B7280;
  --f-gray-600: #4B5563;
  --f-gray-700: #374151;
  --f-gray-800: #1F2937;
  --f-gray-900: #111827;

  /* Semantic */
  --f-success: #10B981;
  --f-danger: #EF4444;
  --f-warning: #F59E0B;

  /* Shadows */
  --f-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --f-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --f-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --f-shadow-sheet: 0 -4px 24px rgba(0,0,0,0.12);
  --f-shadow-fab: 0 4px 16px rgba(249,115,22,0.35);

  /* Radius */
  --f-radius-sm: 8px;
  --f-radius-md: 12px;
  --f-radius-lg: 16px;
  --f-radius-xl: 24px;
  --f-radius-full: 9999px;

  /* Transitions */
  --f-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --f-duration: 0.3s;
  --f-duration-slow: 0.5s;

  /* Z-index */
  --f-z-map: 0;
  --f-z-controls: 10;
  --f-z-sheet: 100;
  --f-z-overlay: 200;
  --f-z-fab: 150;
  --f-z-toast: 300;

  /* Spacing */
  --f-safe-bottom: env(safe-area-inset-bottom, 0px);
  --f-safe-top: env(safe-area-inset-top, 0px);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--f-gray-800);
  background: var(--f-gray-50);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { text-decoration: none; color: inherit; }

/* ============================================
   LOADING SCREEN
   ============================================ */
.f-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--f-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.4s ease;
}
.f-loading.hidden { opacity: 0; pointer-events: none; }
.f-loading__brand {
  font-size: 32px;
  font-weight: 700;
  color: var(--f-orange-500);
  letter-spacing: -1px;
}
.f-loading__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--f-gray-200);
  border-top-color: var(--f-orange-500);
  border-radius: 50%;
  animation: f-spin 0.7s linear infinite;
}
@keyframes f-spin { to { transform: rotate(360deg); } }

/* ============================================
   MAP — Full viewport
   ============================================ */
#fakster-map {
  position: fixed;
  inset: 0;
  z-index: var(--f-z-map);
}

/* Bouton géolocalisation aligné horizontalement avec la barre de filtres.
   Les chips font ~37px, le bouton MapLibre ~30px. On ajuste le bottom pour
   aligner les centres verticaux et pas seulement les bases. */
#fakster-map .maplibregl-ctrl-bottom-left {
  z-index: calc(var(--f-z-controls) + 5);
  bottom: calc(13px + var(--f-safe-bottom));
  left: 12px;
}

/* User location dot always above place markers */
#fakster-map .maplibregl-user-location-dot.maplibregl-marker {
  z-index: 10 !important;
}

/* SunFinder toggle above other controls */
#fakster-map .toggle-sunfinder {
  z-index: var(--f-z-controls);
}

/* SunFinder curseur temporel above filters */
.curseur-temporel {
  z-index: var(--f-z-overlay);
}

/* ============================================
   MARKERS
   ============================================ */
.f-marker-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.f-marker {
  width: 44px;
  height: 44px;
  border-radius: var(--f-radius-full);
  border: 3px solid var(--f-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--f-white);
  transition: transform 0.15s, box-shadow 0.15s;
}
.f-marker-wrapper:hover .f-marker {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.f-marker-wrapper.active .f-marker {
  transform: scale(1.25);
  box-shadow: 0 4px 14px rgba(249,115,22,0.4);
  border-color: var(--f-orange-400);
}
.f-marker--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.f-marker--emoji {
  font-size: 20px;
  background: var(--f-orange-50);
}
.f-marker-pin {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--f-white);
  margin-top: -1px;
}

.f-marker-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--f-gray-700);
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}

/* ============================================
   FLOATING SEARCH BAR
   ============================================ */
.f-search-bar {
  position: fixed;
  top: calc(12px + var(--f-safe-top));
  left: 12px;
  right: 12px;
  z-index: var(--f-z-controls);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--f-radius-full);
  box-shadow: var(--f-shadow-md);
  transition: box-shadow var(--f-duration) var(--f-ease);
}

.f-search-bar:focus-within {
  box-shadow: var(--f-shadow-lg), 0 0 0 2px var(--f-orange-200);
}

.f-search-bar__icon { font-size: 18px; flex-shrink: 0; }

.f-search-bar__input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  color: var(--f-gray-800);
}
.f-search-bar__input::placeholder { color: var(--f-gray-400); }

.f-search-bar__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--f-radius-full);
  background: var(--f-orange-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.f-search-bar__avatar:active { transform: scale(0.92); }

/* ============================================
   SEARCH RESULTS OVERLAY
   ============================================ */
.f-search-results {
  position: fixed;
  top: calc(68px + var(--f-safe-top));
  left: 12px;
  right: 12px;
  z-index: var(--f-z-overlay);
  background: var(--f-white);
  border-radius: var(--f-radius-lg);
  box-shadow: var(--f-shadow-lg);
  max-height: 60vh;
  overflow-y: auto;
  display: none;
  animation: f-fade-in 0.2s var(--f-ease);
}
.f-search-results.active { display: block; }

.f-search-results__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--f-gray-100);
  transition: background 0.15s;
}
.f-search-results__item:last-child { border-bottom: none; }
.f-search-results__item:active { background: var(--f-orange-50); }

.f-search-results__item-icon { font-size: 20px; }
.f-search-results__item-name { font-weight: 500; color: var(--f-gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-search-results__item-address { font-size: 13px; color: var(--f-gray-400); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.f-search-results__item--google { border-left: 3px solid var(--f-orange-400); }
.f-search-results__badge--mine { font-size: 11px; color: var(--f-gray-400); flex-shrink: 0; }
.f-search-results__badge--google { font-size: 11px; font-weight: 600; color: var(--f-orange-500); flex-shrink: 0; white-space: nowrap; }

.f-search-results__footer {
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--f-gray-500);
  border-top: 1px solid var(--f-gray-100);
  cursor: pointer;
  transition: background 0.15s;
}
.f-search-results__footer:active { background: var(--f-orange-50); }
.f-search-results__footer strong { color: var(--f-orange-500); }

/* ============================================
   BOTTOM SHEET
   ============================================ */
.f-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--f-z-sheet);
  background: var(--f-white);
  border-radius: var(--f-radius-lg) var(--f-radius-lg) 0 0;
  box-shadow: var(--f-shadow-sheet);
  transform: translateY(100%);
  transition: transform 0.4s var(--f-ease);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 90vh;
}

.f-sheet.peek  { transform: translateY(calc(90vh - 330px)); }
.f-sheet.half  { transform: translateY(calc(90vh - 70vh)); }
.f-sheet.full  { transform: translateY(0); }
.f-sheet--closing { transform: translateY(100%) !important; transition: transform 0.3s cubic-bezier(0.4, 0, 1, 1) !important; }

.f-sheet__handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
}
.f-sheet__handle::after {
  content: '';
  width: 36px;
  height: 4px;
  background: var(--f-gray-300);
  border-radius: var(--f-radius-full);
}

.f-sheet__content { padding: 0 16px calc(16px + var(--f-safe-bottom)); overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.f-sheet__content.no-scroll { overflow-y: hidden; }

.f-sheet-close {
  position: sticky;
  top: 0;
  float: right;
  width: 32px;
  height: 32px;
  border-radius: var(--f-radius-full);
  background: var(--f-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--f-gray-600);
  z-index: 2;
}

/* ============================================
   PLACE PEEK (bottom sheet peek state)
   ============================================ */
.f-place-peek { padding: 0 16px 0; }

.f-place-peek__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.f-place-peek__name {
  font-size: 17px;
  font-weight: 600;
  color: var(--f-gray-900);
}

.f-place-peek__rating {
  font-size: 13px;
  color: var(--f-orange-500);
  font-weight: 500;
}

.f-place-peek__photos {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.f-place-peek__photos::-webkit-scrollbar { display: none; }

.f-place-peek__photo {
  flex: 0 0 120px;
  width: 120px;
  min-width: 120px;
  height: 90px;
  border-radius: var(--f-radius-sm);
  object-fit: cover;
  scroll-snap-align: start;
  background: var(--f-gray-100);
}

.f-place-peek__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
  background: var(--f-white);
  padding: 10px 0;
}

.f-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--f-radius-full);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.f-btn:active { transform: scale(0.96); }
.f-btn { text-decoration: none; }

.f-btn--primary {
  background: var(--f-orange-500);
  color: var(--f-white);
}
.f-btn--primary:active { background: var(--f-orange-600); }

.f-btn--secondary {
  background: var(--f-gray-100);
  color: var(--f-gray-700);
}
.f-btn--secondary:active { background: var(--f-gray-200); }

/* ============================================
   FILTER CHIPS
   ============================================ */
.f-filters {
  position: fixed;
  bottom: calc(16px + var(--f-safe-bottom));
  left: 0;
  right: 0;
  z-index: calc(var(--f-z-controls) - 1);
  display: flex;
  gap: 8px;
  /* Padding-left = 12px + ~40px (bouton géoloc) + 12px (espace) */
  padding: 0 12px 0 64px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity var(--f-duration), transform var(--f-duration);
}
.f-filters::-webkit-scrollbar { display: none; }
.f-filters.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }

.f-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--f-radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--f-gray-700);
  box-shadow: var(--f-shadow-sm);
  border: 1px solid var(--f-gray-200);
  transition: all 0.15s;
}
.f-chip:active { transform: scale(0.95); }
.f-chip.active {
  background: var(--f-orange-500);
  color: var(--f-white);
  border-color: var(--f-orange-500);
}

/* ============================================
   AGENT BUBBLE (FAB)
   ============================================ */
.f-agent-fab {
  position: fixed;
  bottom: calc(81px + var(--f-safe-bottom));
  right: 16px;
  z-index: var(--f-z-fab);
  width: 52px;
  height: 52px;
  border-radius: var(--f-radius-full);
  background: var(--f-orange-500);
  color: var(--f-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--f-shadow-fab);
  transition: transform 0.2s var(--f-ease), box-shadow 0.2s;
}
.f-agent-fab:active { transform: scale(0.9); }
.f-agent-fab.hidden { transform: scale(0) rotate(90deg); pointer-events: none; }

/* ============================================
   AGENT CHAT OVERLAY
   ============================================ */
.f-agent-chat {
  position: fixed;
  left: 0; right: 0; bottom: 0; top: 0;
  z-index: var(--f-z-overlay);
  background: var(--f-white);
  transform: translateY(100%);
  transition: transform var(--f-duration-slow) var(--f-ease);
  display: flex;
  flex-direction: column;
}
.f-agent-chat.open { transform: translateY(0); }

.f-agent-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + var(--f-safe-top));
  border-bottom: 1px solid var(--f-gray-100);
}
.f-agent-chat__title { font-weight: 600; font-size: 16px; }
.f-agent-chat__model { font-size: 11px; color: var(--f-gray-400); font-weight: 400; }
.f-agent-chat__close { font-size: 20px; padding: 8px; }

.f-agent-chat__messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.f-agent-chat__input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--f-safe-bottom));
  border-top: 1px solid var(--f-gray-100);
}

.f-agent-chat__input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--f-gray-200);
  border-radius: var(--f-radius-full);
  outline: none;
  resize: none;
  font-size: 16px;
  min-height: 40px;
  max-height: 100px;
}
.f-agent-chat__input:focus { border-color: var(--f-orange-300); }

.f-agent-chat__send {
  width: 40px;
  height: 40px;
  border-radius: var(--f-radius-full);
  background: var(--f-orange-500);
  color: var(--f-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* Chat messages */
.f-msg { max-width: 85%; padding: 10px 14px; border-radius: var(--f-radius-md); font-size: 14px; line-height: 1.4; }
.f-msg--user { align-self: flex-end; background: var(--f-orange-500); color: var(--f-white); border-bottom-right-radius: 4px; }
.f-msg--agent { align-self: flex-start; background: var(--f-gray-100); color: var(--f-gray-800); border-bottom-left-radius: 4px; }
.f-msg--loading { padding: 12px 18px; }
.f-msg__text { white-space: pre-wrap; }
.f-msg__text p { margin: 0 0 4px; }
.f-msg__text p:last-child { margin-bottom: 0; }
.f-msg__text .f-msg__card { margin: 6px 0; display: flex !important; align-items: center !important; }
.f-msg__text p:has(.f-msg__card) { display: contents; }
.f-msg__text strong { font-weight: 600; }
.f-msg__text ol, .f-msg__text ul { margin: 2px 0 4px 18px; padding: 0; }
.f-msg__text li { margin-bottom: 2px; }
.f-msg__text li:last-child { margin-bottom: 0; }
.f-msg__text li p { margin: 0; }

/* Typing indicator */
.f-msg__typing { display: flex; gap: 4px; align-items: center; height: 20px; }
.f-msg__typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--f-gray-400);
  animation: f-bounce 1.4s infinite ease-in-out both;
}
.f-msg__typing span:nth-child(1) { animation-delay: -0.32s; }
.f-msg__typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes f-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* Place cards */
.f-msg__places { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.f-msg__card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; background: var(--f-white); border-radius: var(--f-radius-md);
  border: 1px solid var(--f-gray-200); cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.f-msg__card:active { transform: scale(0.98); box-shadow: var(--f-shadow-sm); }
.f-msg__card-img {
  width: 56px; height: 56px; border-radius: var(--f-radius-sm); overflow: hidden; flex-shrink: 0;
}
.f-msg__card-img img { width: 100%; height: 100%; object-fit: cover; }
.f-msg__card-img--empty {
  background: var(--f-orange-50); display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.f-msg__card-body { flex: 1; min-width: 0; }
.f-msg__card-name { font-weight: 600; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-msg__card-addr { font-size: 11px; color: var(--f-gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-msg__card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.f-msg__card-rating { font-size: 11px; font-weight: 500; }
.f-msg__card-tag { font-size: 10px; padding: 1px 7px; border-radius: var(--f-radius-full); background: var(--f-orange-100); color: var(--f-orange-700); }
.f-msg__card-arrow { font-size: 20px; color: var(--f-gray-300); flex-shrink: 0; font-weight: 300; }
.f-msg--agent .f-msg__text:empty + .f-msg__places:empty { display: none; }
.f-msg[streaming] .f-msg__text { color: var(--f-gray-400); font-style: italic; }
.f-msg__text--status { color: var(--f-gray-400); font-style: italic; }

/* ============================================
   QUICK ADD SHEET
   ============================================ */
.f-quick-add { padding: 0 16px 24px; }
.f-quick-add__title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.f-quick-add__address { font-size: 13px; color: var(--f-gray-400); margin-bottom: 16px; }

.f-form-group { margin-bottom: 14px; }
.f-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--f-gray-600);
  margin-bottom: 6px;
}

.f-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--f-gray-200);
  border-radius: var(--f-radius-sm);
  outline: none;
  transition: border-color 0.15s;
}
.f-input:focus { border-color: var(--f-orange-400); }

.f-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--f-gray-200);
  border-radius: var(--f-radius-sm);
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
}
.f-textarea:focus { border-color: var(--f-orange-400); }

.f-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--f-gray-200);
  border-radius: var(--f-radius-sm);
  outline: none;
  background: var(--f-white);
  font-size: 14px;
  color: var(--f-gray-800);
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.f-select:focus { border-color: var(--f-orange-400); }

.f-place-edit { padding: 0 16px 24px; }
.f-place-edit__title { font-size: 18px; font-weight: 600; }

.f-btn--danger {
  background: var(--f-danger);
  color: white;
  border: 1px solid var(--f-danger);
}
.f-btn--danger:active { opacity: 0.8; }

/* Tags input */
.f-tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--f-gray-200);
  border-radius: var(--f-radius-sm);
  min-height: 42px;
  align-items: center;
  transition: border-color 0.15s;
}
.f-tags-input:focus-within { border-color: var(--f-orange-400); }

.f-tags-input__field {
  border: none;
  outline: none;
  flex: 1;
  min-width: 80px;
  font-size: 14px;
}

.f-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--f-orange-100);
  color: var(--f-orange-700);
  border-radius: var(--f-radius-full);
  font-size: 12px;
  font-weight: 500;
}
.f-tag__remove {
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}
.f-tag__remove:hover { opacity: 1; }

.f-tag-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--f-white);
  border: 1px solid var(--f-gray-200);
  border-radius: var(--f-radius-sm);
  box-shadow: var(--f-shadow-lg);
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
}
.f-tag-suggestions__item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.f-tag-suggestions__item:active { background: var(--f-orange-50); }

/* ============================================
   AVATAR MENU
   ============================================ */
.f-menu {
  position: fixed;
  top: calc(68px + var(--f-safe-top));
  right: 12px;
  z-index: var(--f-z-overlay);
  background: var(--f-white);
  border-radius: var(--f-radius-md);
  box-shadow: var(--f-shadow-lg);
  min-width: 180px;
  padding: 6px 0;
  display: none;
  animation: f-fade-in 0.15s var(--f-ease);
}
.f-menu.open { display: block; }

.f-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--f-gray-700);
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}
.f-menu__item:active { background: var(--f-gray-50); }
.f-menu__divider { height: 1px; background: var(--f-gray-100); margin: 4px 0; }

/* ============================================
   TOAST
   ============================================ */
.f-toast {
  position: fixed;
  top: calc(72px + var(--f-safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: var(--f-z-toast);
  background: var(--f-gray-900);
  color: var(--f-white);
  padding: 10px 20px;
  border-radius: var(--f-radius-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--f-shadow-lg);
  opacity: 0;
  transition: all 0.3s var(--f-ease);
  pointer-events: none;
}
.f-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes f-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes f-spin { to { transform: rotate(360deg); } }

/* ============================================
   CLUSTER MARKERS
   ============================================ */

/* Hover + active handled via MapLibre feature-state would require
   more plumbing — the CSS layer below handles DOM markers only */

/* Pop-in animation when an individual marker emerges from a cluster.
   Applied programmatically in syncMarkerVisibility(). */
@keyframes f-marker-pop {
  0%   { opacity: 0; transform: scale(0.4) translateY(6px); }
  65%  { transform: scale(1.1) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.f-marker-enter {
  animation: f-marker-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Cursor feedback for cluster layer (canvas-level, set in JS) */
.maplibregl-canvas { cursor: auto; }

.f-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: f-spin 0.6s linear infinite;
  vertical-align: middle;
}

/* Link button */
.f-link { background: none; border: none; color: var(--f-orange-500); font-weight: 500; font-size: inherit; cursor: pointer; padding: 0; }

/* Lightbox */
.f-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: f-fade-in 0.2s;
}
.f-lightbox__close {
  position: absolute;
  top: calc(12px + var(--f-safe-top));
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: var(--f-radius-full);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.f-lightbox__img {
  max-width: 90vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--f-radius-sm);
  transition: opacity 0.15s ease;
}
.f-lightbox__actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}
.f-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--f-radius-full);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.f-lightbox__nav--prev { left: 12px; }
.f-lightbox__nav--next { right: 12px; }

/* ============================================
   PLACE LIST (in bottom sheet half/full)
   ============================================ */
.f-place-list { list-style: none; }

.f-place-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--f-gray-100);
}
.f-place-item:last-child { border-bottom: none; }

.f-place-item__icon { font-size: 24px; }
.f-place-item__info { flex: 1; min-width: 0; }
.f-place-item__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-place-item__tags { font-size: 12px; color: var(--f-gray-400); margin-top: 2px; }

/* ============================================
   PLACE DETAIL (full sheet)
   ============================================ */
.f-place-detail { padding: 0 16px 24px; }

.f-place-detail__photos {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -16px 16px;
  padding: 0 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.f-place-detail__photos::-webkit-scrollbar { display: none; }

.f-place-detail__photo {
  flex: 0 0 260px;
  width: 260px;
  height: 180px;
  min-width: 260px;
  border-radius: var(--f-radius-sm);
  object-fit: cover;
  scroll-snap-align: start;
  background: var(--f-gray-100);
}

.f-place-detail__name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.f-place-detail__address { font-size: 13px; color: var(--f-gray-400); margin-bottom: 8px; }
.f-place-detail__description { font-size: 14px; color: var(--f-gray-600); margin-bottom: 12px; line-height: 1.6; padding: 12px; background: var(--f-orange-50); border-left: 3px solid var(--f-orange-300); border-radius: 0 var(--f-radius-sm) var(--f-radius-sm) 0; }

.f-place-detail__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.f-place-detail__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--f-gray-500);
  margin-bottom: 4px;
}

.f-place-detail__actions { display: flex; gap: 8px; }

.f-place-detail__section { margin-top: 20px; padding: 16px; background: var(--f-gray-50); border-radius: var(--f-radius-md); }

.f-info-list { display: flex; flex-direction: column; gap: 14px; }
.f-info-item { display: flex; gap: 10px; align-items: flex-start; }
.f-info-icon { font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.f-info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--f-gray-400); margin-bottom: 2px; font-weight: 500; }
.f-info-value { font-size: 14px; color: var(--f-gray-700); }

/* Section title */
.f-section-title { font-size: 14px; font-weight: 600; color: var(--f-gray-800); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* Actions row */
.f-place-detail__actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--f-gray-200); }

@media (prefers-reduced-motion: reduce) {
  .f-place-peek, .f-lightbox { animation: none; }
}