* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

.app { display: flex; height: 100vh; }
.sidebar { width: 380px; background: #1a1d29; color: #e8eaed; overflow-y: auto; box-shadow: 2px 0 8px rgba(0,0,0,0.3); z-index: 1000; }
#map { flex: 1; }

.header { padding: 20px; background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); border-bottom: 1px solid rgba(255,255,255,0.1); }
.header .logo { display: flex; align-items: center; gap: 10px; }
.header .logo img { width: 36px; height: 36px; border-radius: 8px; }
.header h1 { font-size: 24px; margin-bottom: 4px; }
.header .tag { font-size: 13px; color: rgba(255,255,255,0.8); }

.card { margin: 16px; padding: 20px; background: #252836; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.card h2 { font-size: 18px; margin-bottom: 16px; color: #e8eaed; }

.input-group { margin-bottom: 16px; }
.input-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #9ca3af; font-weight: 500; }
.input-group input { width: 100%; padding: 10px 12px; background: #1a1d29; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #e8eaed; font-size: 14px; }
.input-group input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.suggestions { position: relative; }
.suggestions-list { position: absolute; top: 100%; left: 0; right: 0; background: #1a1d29; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; margin-top: 4px; max-height: 300px; overflow-y: auto; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.suggestion-item { padding: 12px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.2s; }
.suggestion-item:hover { background: rgba(37,99,235,0.2); }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-label { font-size: 14px; font-weight: 500; color: #e8eaed; margin-bottom: 2px; }
.suggestion-tags { font-size: 12px; color: #9ca3af; }
.suggestion-coords { font-size: 11px; color: #6b7280; margin-top: 2px; }

.actions { display: flex; gap: 8px; margin-top: 16px; }
.btn { flex: 1; padding: 12px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #374151; color: #e8eaed; }
.btn-secondary:hover { background: #4b5563; }
.btn-tertiary { background: #1f2937; color: #e8eaed; }
.btn-tertiary:hover { background: #374151; }

.toggle-list { display: grid; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #e8eaed; }
.toggle input { width: 16px; height: 16px; accent-color: #2563eb; }
.toggle small { color: #9ca3af; }

.result { margin-top: 16px; padding: 12px; background: #1a1d29; border-radius: 8px; border-left: 3px solid #2563eb; }
.result-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #e8eaed; }
.result-stats { font-size: 13px; color: #9ca3af; line-height: 1.6; }
.result-stats strong { color: #e8eaed; }

.error { background: #3f1a1a; border-left-color: #dc2626; color: #fca5a5; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 1s linear infinite; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .sidebar { width: 100%; max-width: 380px; position: absolute; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { position: fixed; top: 16px; left: 16px; z-index: 1001; background: white; border: none; padding: 12px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); cursor: pointer; }
}

/* Maplibre popup styling */
.maplibregl-popup-content { background: #252836; color: #e8eaed; border-radius: 8px; padding: 12px; }
.maplibregl-popup-tip { border-top-color: #252836; }
.maplibregl-popup-close-button { color: #e8eaed; }
