/* MAP autocomplete widget — drop-in CSS.
   All selectors namespaced under .map-ac-* to avoid collisions. */

.map-ac { position: relative; }

.map-ac-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") 14px center no-repeat;
  font: 500 14px/1 'Inter', -apple-system, system-ui, sans-serif;
  color: #0f172a;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.map-ac-input::placeholder { color: #94a3b8; font-weight: 400; }
.map-ac-input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}

.map-ac-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 30px -10px rgba(15,23,42,.25);
  max-height: 340px; overflow-y: auto;
  z-index: 9999;
  display: none;
}
.map-ac-dropdown.open { display: block; }

.map-ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: flex-start; gap: 10px;
}
.map-ac-item:last-child { border-bottom: none; }
.map-ac-item:hover, .map-ac-item.active {
  background: #f0fdf4;
}
.map-ac-item:hover .map-ac-name, .map-ac-item.active .map-ac-name {
  color: #047857;
}

.map-ac-pin {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  color: #059669;
}

.map-ac-content { flex: 1; min-width: 0; }
.map-ac-name {
  font: 500 14px/1.35 'Inter', sans-serif;
  color: #0f172a;
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-ac-meta {
  font: 400 12px/1.35 'Inter', sans-serif;
  color: #64748b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-ac-name mark {
  background: rgba(244, 63, 94, 0.12);
  color: inherit;
  padding: 0;
  border-radius: 2px;
}

.map-ac-footer {
  padding: 8px 14px;
  font: 400 11px/1 'Inter', sans-serif;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 0 0 10px 10px;
}
.map-ac-footer kbd {
  display: inline-block; padding: 1px 5px;
  font: 500 10px/1.6 'JetBrains Mono', ui-monospace, monospace;
  color: #475569; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 4px;
  margin: 0 2px;
}
.map-ac-footer .brand { color: #059669; font-weight: 600; }

.map-ac-empty {
  padding: 20px 14px;
  text-align: center;
  font: 400 13px/1.4 'Inter', sans-serif;
  color: #94a3b8;
}

.map-ac-loading {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  border: 2px solid #e2e8f0; border-top-color: #059669;
  border-radius: 50%;
  animation: map-ac-spin .6s linear infinite;
}
@keyframes map-ac-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Dark mode (auto) */
@media (prefers-color-scheme: dark) {
  .map-ac-input { background-color: #0f172a; border-color: #334155; color: #f8fafc; }
  .map-ac-input::placeholder { color: #64748b; }
  .map-ac-dropdown { background: #0f172a; border-color: #334155; }
  .map-ac-item { border-bottom-color: #1e293b; }
  .map-ac-item:hover, .map-ac-item.active { background: #022c22; }
  .map-ac-name { color: #f8fafc; }
  .map-ac-footer { background: #020617; border-top-color: #1e293b; color: #64748b; }
  .map-ac-footer kbd { background: #0f172a; border-color: #334155; color: #cbd5e1; }
}
