Create a responsive, production-ready single-page application (HTML, Tailwind CSS via CDN, vanilla JavaScript) that acts as an interactive "NYC Neighborhood Pulse" dashboard powered directly by the NYC Open Data Socrata API (SODA).
Architecture & Functional Requirements:
1. No Backend Required: Query NYC Open Data endpoints directly from the browser using `fetch` with Socrata query parameters.
- Primary Dataset (311 Service Requests): `https://data.cityofnewyork.us/resource/erm2-nwe9.json`
- Secondary Dataset (DOHMH Restaurant Inspections): `https://data.cityofnewyork.us/resource/43nn-pn8j.json`
2. Core User Experience & Layout:
- Header: Dark-mode sleek navigation bar with a live data sync status indicator, a ZIP code / Neighborhood search input, and a "Locate Me" button (`navigator.geolocation`).
- Map View: An interactive Leaflet.js or MapLibre map centered on NYC (default: Lower Manhattan / 40.7128, -74.0060) featuring custom styled SVG pins for complaints (color-coded by type: Noise = purple, Sanitation/Illegal Dumping = amber, Heat/Hot Water = cyan).
- Sidebar / Sliding Drawer:
- Real-time KPI cards: Total complaints in current view, dominant complaint category, and rodent/health inspection risk score.
- Collapsible complaint feed featuring real-time filter chips (e.g., "Noise", "Sanitation", "Blocked Driveway").
- Search-as-you-type inspection inspector: lets users type a restaurant name to pull up historical sanitary violation scores and letter grades.
3. Interactivity & Micro-Features:
- Dynamic API Querying: When the map is dragged or zoomed, debounce bounds updates to recalculate the `$where=latitude > ... AND latitude < ...` parameters (capped at `$limit=150`).
- Visual Feedback: Include subtle pulse animations for fresh complaints (< 2 hours old), skeleton loaders during fetch states, and clean empty-state cards if a query returns 0 hits.
- Offline / Fallback Handling: Gracefully notify the user if API rate limits (HTTP 429) occur or if geolocation permission is denied, falling back cleanly to a default set of pre-queried coordinates.
Deliver the code in a single, well-structured `index.html` file that can be immediately run in any modern browser without a build step.