:root {
  color-scheme: light;
  --ink: #0f1b2d;
  --text: #26374d;
  --muted: #667891;
  --accent: #2f7de4;
  --accent-dark: #1f66c9;
  --accent-light: #5b9cf0;
  --county: #2f7de4;
  --line: #e6edf6;
  --panel: rgba(255,255,255,.94);
  --shadow: 0 14px 38px rgba(15,40,80,.18);
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body, #map { width: 100%; height: 100%; margin: 0; }
html, body { overflow: hidden; background: #eef3f9; }
body { color: var(--ink); }
#map { position: fixed; inset: 0; z-index: 0; background: #eef3f9; }

.floating-home, .map-heading, .locate-button, .map-error { position: fixed; z-index: 800; }
.floating-home {
  top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left));
  display: inline-flex; align-items: center; gap: .55rem; min-height: 46px;
  padding: .7rem 1rem; border: 1px solid rgba(255,255,255,.7); border-radius: 999px;
  color: #fff; background: linear-gradient(135deg, var(--accent-light), var(--accent-dark)); backdrop-filter: blur(14px);
  box-shadow: var(--shadow); text-decoration: none; font-size: .9rem; font-weight: 750;
}
.floating-home:hover { background: linear-gradient(135deg, var(--accent), #17509e); transform: translateY(-1px); }
.floating-home span:first-child { font-size: 1.25rem; line-height: 1; }
.home-icon { display: none; }
.map-heading {
  top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
  width: min(390px, calc(100vw - 310px)); padding: .8rem 1rem;
  border: 1px solid rgba(255,255,255,.78); border-radius: 16px;
  background: var(--panel); backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.map-heading .eyebrow { color: var(--accent); font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.map-heading h1 { margin: .16rem 0 .14rem; font-size: clamp(1.05rem, 2vw, 1.4rem); line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.map-heading p { margin: 0; color: var(--muted); font-size: .76rem; }
.locate-button {
  right: max(14px, env(safe-area-inset-right)); bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.8); border-radius: 14px;
  background: rgba(255,255,255,.94); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
  font-size: 1.55rem; font-weight: 800;
}
.map-error { left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100vw - 28px)); padding: .85rem 1rem; border-radius: 12px; color: #fff; background: #1f66c9; box-shadow: var(--shadow); }

.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; }
.leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 42px !important; font-size: 1.3rem !important; }
.leaflet-left .leaflet-control { margin-left: max(14px, env(safe-area-inset-left)); }
.leaflet-bottom .leaflet-control { margin-bottom: max(16px, env(safe-area-inset-bottom)); }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 16px 18px; width: min(360px, calc(100vw - 64px)) !important; }
.leaflet-popup-close-button { width: 38px !important; height: 38px !important; padding: 8px !important; font-size: 24px !important; }
.popup-card h2 { margin: 0 2rem .25rem 0; font-size: 1.25rem; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.popup-card .meta { margin: 0 0 .9rem; color: var(--muted); font-size: .82rem; }
.photo-count { display: flex; align-items: baseline; gap: .35rem; margin: .65rem 0 .9rem; }
.photo-count strong { color: var(--accent); font-size: 1.75rem; }
.location-popup { display: flex; flex-direction: column; align-items: center; text-align: center; padding: .25rem 0 .1rem; }
.location-popup h2 { margin: 0 2rem .25rem; }
.location-popup .meta { margin-bottom: .75rem; }
.location-popup .photo-count { justify-content: center; margin: .55rem 0 1rem; }
.location-popup .view-button { align-self: center; }
.leaflet-popup.location-leaflet-popup .leaflet-popup-content { width: min(270px, calc(100vw - 88px)) !important; }
.processing-message { margin: .75rem 0 .35rem; padding: .7rem .9rem; border-radius: 10px; color: #4b5563; background: #f1f3f5; font-size: .9rem; font-weight: 700; }
.view-button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: .65rem 1rem; border-radius: 10px; color: #fff !important; background: linear-gradient(135deg, var(--accent-light), var(--accent-dark)); text-decoration: none; font-weight: 800; }
.view-button:hover { background: linear-gradient(135deg, var(--accent), #17509e); }
.county-list { max-height: 310px; overflow: auto; overscroll-behavior: contain; margin-top: .7rem; border-top: 1px solid var(--line); }
.county-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .8rem; align-items: center; padding: .72rem 0; border-bottom: 1px solid var(--line); }
.county-row strong { display: block; font-size: .92rem; }
.county-row small { color: var(--muted); }
.county-row .view-button { min-height: 38px; padding: .48rem .7rem; font-size: .8rem; }
.public-marker { display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: linear-gradient(135deg, var(--accent-light), var(--accent-dark)); box-shadow: 0 5px 14px rgba(23,80,158,.35); transform: rotate(-45deg); }
.public-marker::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.public-marker--planned { background: linear-gradient(135deg, #aeb6c1, #68717d); box-shadow: 0 5px 14px rgba(55,65,81,.32); }
.leaflet-marker-icon:focus .public-marker { outline: 3px solid #0b1720; outline-offset: 3px; }

@media (max-width: 720px) {
  .floating-home { width: 46px; height: 46px; min-height: 46px; padding: 0; justify-content: center; border-radius: 14px; }
  .floating-home .home-arrow, .floating-home .home-label { display: none; }
  .floating-home .home-icon { display: block; }
  .map-heading { top: max(10px, env(safe-area-inset-top)); left: auto; right: max(10px, env(safe-area-inset-right)); bottom: auto; width: min(244px, calc(100vw - 78px)); padding: .62rem .78rem; }
  .map-heading h1 { font-size: .98rem; }
  .map-heading .eyebrow { display: none; }
  .map-heading p { font-size: .7rem; }
  .locate-button { bottom: max(16px, env(safe-area-inset-bottom)); width: 48px; height: 48px; }
  .leaflet-control-zoom a { width: 46px !important; height: 46px !important; line-height: 44px !important; }
  .leaflet-popup-content-wrapper { max-height: min(60vh, 460px); overflow: auto; border-radius: 18px; }
  .leaflet-popup-content { width: min(330px, calc(100vw - 76px)) !important; margin: 17px 18px; }
  .county-list { max-height: min(34vh, 260px); }
  .county-row { gap: .55rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .floating-home, .view-button, .locate-button { transition: transform .18s ease, background .18s ease; }
}

