/* ============================================================
   publicmap.css — Styles for the Public Map page
   Extracted from src/shared/publicmap.html inline <style> block
   ============================================================ */

/* Global Overrides */
body {
  font-family: 'Inter', sans-serif;
  background-color: #0B1120;
  overflow: hidden;
}

/* Scrollbar hiding */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Map Container - Full Screen Background */
#mapContainer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: #0B1120;
}

/* UI Overlay — top padding adapts to nav height (56px on web, 0px on mobile) + status bar on mobile */
#mapUiOverlay {
  padding-top: calc(var(--ara-top-nav-height, 0px) + 20px + env(safe-area-inset-top, 0px));
}

.public-map-topbar {
  gap: 0.75rem;
}

.public-map-search {
  width: min(24rem, 100%);
}

.public-map-controls {
  z-index: 2;
}

#layerToggle {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(248px + env(safe-area-inset-bottom, 0px));
  z-index: 46;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: rgba(21, 30, 50, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#layerToggle .material-symbols-rounded,
.locate-me-btn .material-symbols-rounded {
  color: inherit;
}

#layerToggle:hover {
  background: rgba(21, 30, 50, 1);
  color: #f8fafc;
  border-color: rgba(59, 130, 246, 0.5);
}

#layerToggle:active {
  transform: scale(0.95);
}

.ara-map-news-button {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(194px + env(safe-area-inset-bottom, 0px));
  z-index: 46;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: rgba(21, 30, 50, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.34);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ara-map-news-button .material-symbols-rounded {
  color: inherit;
  font-size: 25px;
}

.ara-map-news-button:hover {
  background: rgba(21, 30, 50, 1);
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.56);
}

.ara-map-news-button:active {
  transform: scale(0.95);
}

.ara-map-news {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
  background: rgba(3, 7, 18, 0.48);
  pointer-events: auto;
}

.ara-map-news.hidden {
  display: none !important;
}

.ara-map-news__panel {
  position: relative;
  width: min(720px, calc(100vw - 40px));
  max-height: min(82vh, 720px);
  overflow: hidden;
  border-radius: 18px;
  background: rgba(21, 30, 50, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  color: #e5edf8;
}

.ara-map-news__accent {
  display: none;
}

.ara-map-news__body {
  position: relative;
  z-index: 1;
  max-height: inherit;
  overflow-y: auto;
  padding: 34px 34px 30px;
  text-align: center;
}

.ara-map-news__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ara-map-news__close:hover {
  background: rgba(21, 30, 50, 1);
  border-color: rgba(59, 130, 246, 0.5);
  color: #fff;
}

.ara-map-news__close:active {
  transform: scale(0.95);
}

.ara-map-news__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.40);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ara-map-news__kicker .material-symbols-rounded {
  font-size: 18px;
  line-height: 1;
}

.ara-map-news__title {
  margin: 18px auto 0;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.ara-map-news__lede {
  max-width: 560px;
  margin: 14px auto 0;
  color: #bfcbda;
  font-size: 0.98rem;
  line-height: 1.55;
}

.ara-map-news__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.ara-map-news__item {
  min-height: 78px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.42;
  text-align: left;
}

.ara-map-news__check {
  color: #93c5fd;
  font-size: 20px;
  line-height: 1;
}

.ara-map-news__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.ara-map-news__cta {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.26);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #dbeafe;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.26);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.ara-map-news__cta:hover {
  background: rgba(59, 130, 246, 0.36);
  border-color: rgba(147, 197, 253, 0.55);
  color: #ffffff;
}

.ara-map-news__cta:active {
  transform: translateY(1px) scale(0.99);
}

.ara-map-news__cta--secondary {
  background: rgba(15, 23, 42, 0.34);
  border-color: rgba(255, 255, 255, 0.10);
  color: #cbd5e1;
}

.ara-map-news__cta--secondary:hover {
  background: rgba(21, 30, 50, 0.88);
  border-color: rgba(147, 197, 253, 0.38);
  color: #ffffff;
}

@media (max-width: 640px) {
  .ara-map-news {
    align-items: flex-end;
    padding: calc(18px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
  }

  .ara-map-news__panel {
    width: 100%;
    max-height: min(86vh, 720px);
    border-radius: 16px;
  }

  .ara-map-news__body {
    padding: 26px 18px 20px;
  }

  .ara-map-news__close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .ara-map-news__title {
    margin-right: auto;
    font-size: 2.05rem;
  }

  .ara-map-news__lede {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .ara-map-news__list {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 18px;
  }

  .ara-map-news__item {
    min-height: auto;
    padding: 12px;
    font-size: 0.86rem;
  }

  .ara-map-news__actions {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }
}

body[data-map-news-open] #mapUiOverlay,
body[data-map-news-open] #photoLightbox {
  filter: brightness(0.42);
  pointer-events: none;
  transition: filter 160ms ease;
}

body[data-map-news-open] #sidePanel,
body[data-map-news-open] #locateMeBtn,
body[data-map-news-open] #layerToggle,
body[data-map-news-open] .ara-map-news-button {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body[data-always-explorer] .public-map-topbar {
  align-items: center;
}

body[data-always-explorer] .public-map-controls {
  position: absolute;
  pointer-events: none;
}

body[data-always-explorer] .public-map-controls #layerToggle {
  pointer-events: auto;
}

/* --- SIDE PANEL (GLASSMORPHISM) --- */
.side-panel {
  position: fixed;
  z-index: 40;
  background: rgba(21, 30, 50, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
}

.side-panel .flex-1::-webkit-scrollbar {
  display: none;
}

.side-panel .flex-1 {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.map-photo-strip {
  max-width: 100%;
  min-width: 0;
  padding-right: 1rem;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(147, 197, 253, 0.4) rgba(255, 255, 255, 0.06);
}

.map-photo-strip::-webkit-scrollbar {
  display: block;
  height: 8px;
}

.map-photo-strip::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.map-photo-strip::-webkit-scrollbar-thumb {
  background: rgba(147, 197, 253, 0.4);
  border-radius: 999px;
}

.map-photo-strip__end {
  width: max(1rem, env(safe-area-inset-right, 0px));
}

.close-panel-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.close-panel-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

body[data-always-explorer] .close-panel-btn {
  display: none;
}

.panel-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 12;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(147, 197, 253, 0.38);
  border-radius: 999px;
  background: rgba(22, 35, 59, 0.94);
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.2s ease, border-color 0.2s ease;
}

.panel-scroll-cue.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.panel-scroll-cue:hover {
  background: rgba(37, 99, 235, 0.96);
  border-color: rgba(219, 234, 254, 0.7);
  color: #fff;
}

.panel-scroll-cue:active {
  transform: translate(-50%, 2px) scale(0.96);
}

.panel-scroll-cue span {
  font-size: 30px;
  line-height: 1;
}

/* Desktop: Floating Dock Left */
@media (min-width: 768px) {
  body[data-always-explorer] #mapUiOverlay {
    padding-left: calc(420px + 1.5rem);
  }

  body[data-always-explorer] .public-map-topbar {
    width: 100%;
  }

  .side-panel {
    top: calc(var(--ara-top-nav-height, 0px) + 20px);
    bottom: 120px;
    left: 20px;
    width: 400px;
    border-radius: 1.5rem;
    transform: translateX(-120%);
  }

  .side-panel.open {
    transform: translateX(0);
  }
}

@media (min-width: 768px) and (max-width: 1080px) {
  body[data-always-explorer] #mapUiOverlay {
    padding-left: calc(420px + 0.75rem);
    padding-right: 0.75rem;
  }

  body[data-always-explorer] .public-map-search {
    width: min(100%, 22rem);
  }

  body[data-always-explorer] .public-map-controls {
    width: auto;
  }
}

/* Mobile: Bottom Sheet */
@media (max-width: 767px) {
  body.mobile-public-map .public-map-topbar {
    min-height: 48px;
    padding-right: 56px;
    padding-left: 56px;
  }

  body.mobile-public-map .public-map-search {
    width: 100%;
    max-width: none;
  }

  body.mobile-public-map .public-map-controls {
    position: static;
  }

  body.mobile-public-map #legendToggle {
    position: fixed;
    top: calc(24px + env(safe-area-inset-top, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px));
    z-index: 46;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  #layerToggle {
    top: calc(24px + env(safe-area-inset-top, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: auto;
  }

  body.mobile-public-map #layerToggle {
    position: fixed;
    display: flex;
    z-index: 46;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .ara-map-news-button {
    top: calc(76px + env(safe-area-inset-top, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: auto;
  }

  .side-panel {
    left: 0;
    right: 0;
    bottom: 0;
    height: 50vh;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    transform: translateY(110%);
    border-bottom: none;
    padding-bottom: 20px;
    z-index: 60;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), height 0.3s ease;
  }

  .side-panel.open {
    transform: translateY(0);
  }

  .side-panel.expanded {
    height: 70vh;
  }

  .panel-scroll-cue {
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .leaflet-control-zoom {
    display: none !important;
  }
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

/* Filter Checkbox (Glassmorphism) */
.filter-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.filter-checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.filter-checkbox:checked::after {
  content: 'check';
  font-family: 'Material Symbols Rounded';
  font-size: 16px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: black;
  font-weight: bold;
}

/* Stop propagation helper */
.stop-prop {
  cursor: default;
}

.public-map-explorer-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.25rem 0.25rem 0.35rem;
  color: rgba(203, 213, 225, 0.62);
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}

.public-map-explorer-legal__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.public-map-explorer-legal a {
  color: rgba(219, 234, 254, 0.78);
  text-decoration: none;
  font-weight: 700;
}

.public-map-explorer-legal a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Custom Range Slider */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.leaflet-popup-content {
  font-size: 0.95rem;
}

.leaflet-popup-content b {
  color: var(--accent-2);
}

a.leaflet-popup-close-button {
  color: var(--muted) !important;
}

.leaflet-popup-content .popup-table {
  margin-top: 8px;
  width: 100%;
  border-collapse: collapse;
}

.leaflet-popup-content .popup-table td {
  padding: 3px 5px;
  font-size: 0.85rem;
}

.leaflet-popup-content .popup-table td:first-child {
  font-weight: 600;
  color: var(--muted);
  text-align: right;
}

.popup-view-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #001528;
  border: 1px solid transparent;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.popup-view-btn:hover {
  background-color: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}

.home-btn i {
  font-size: 20px;
  line-height: 1;
}

.local-tree-marker {
  background-color: var(--accent-2);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.leaflet-control-layers {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.leaflet-control-layers-base label {
  color: var(--text);
}

/* Marker Cluster Customization for Dark Theme */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(11, 34, 53, 0.6) !important;
  border: 2px solid var(--accent);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(11, 34, 53, 0.8) !important;
  color: var(--text) !important;
  font-weight: 700;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: 0 !important;
  margin-top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  line-height: normal !important;
  border-radius: 50%;
}

.marker-cluster span {
  line-height: 0 !important;
  display: block !important;
}

.local-tree-marker-cluster .marker-cluster-small,
.local-tree-marker-cluster .marker-cluster-medium,
.local-tree-marker-cluster .marker-cluster-large {
  border-color: var(--accent-2);
}

/* User Avatar in Popup */
.avatar-tiny {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #001528;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.70rem;
  flex-shrink: 0;
}

.popup-submitter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* --- Heritage Pin Marker Style (GPU Accelerated) --- */
.custom-tree-div-icon {
  position: relative;
  background: transparent;
  border: none;
}

.marker-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  background: var(--pin-color);
  border: 2px solid white;
  position: absolute;
  transform: rotate(-45deg) translateZ(0);
  left: 50%;
  top: 50%;
  margin: -14px 0 0 -14px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  will-change: transform;
  backface-visibility: hidden;
}

.marker-pin span {
  transform: rotate(45deg);
  color: white;
  font-size: 16px;
  pointer-events: none;
}

.marker-pin.active {
  box-shadow: 0 0 20px 4px var(--pin-color), 0 0 0 4px white;
  z-index: 1000 !important;
  animation: pulse-glow 2s infinite;
  border-color: white;
}

.custom-forest-div-icon {
  position: relative;
  background: transparent;
  border: 0;
}

.forest-stand-pin {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #15803d;
  border: 2px solid rgba(255, 255, 255, 0.94);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.34),
    0 0 0 2px rgba(21, 128, 61, 0.28);
  display: grid;
  place-items: center;
  transform: translateZ(0);
}

.forest-stand-pin svg {
  width: 15px;
  height: 15px;
  color: #fff;
  fill: none;
  pointer-events: none;
}

.forest-stand-pin--conifer svg {
  width: 17px;
  height: 17px;
}

.forest-icon-fill {
  fill: currentColor;
}

.forest-icon-cut {
  fill: none;
  stroke: #15803d;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.forest-panel-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(34, 197, 94, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(22, 101, 52, 0.24), rgba(15, 23, 42, 0.28)),
    rgba(15, 23, 42, 0.48);
  padding: 14px;
}

.forest-panel-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #15803d;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), 0 0 0 4px rgba(21, 128, 61, 0.24);
}

.forest-panel-icon svg {
  width: 31px;
  height: 31px;
  color: #fff;
  fill: none;
}

.forest-panel-icon--conifer svg {
  width: 34px;
  height: 34px;
}

.forest-panel-stat {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.forest-panel-stat span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.forest-panel-stat strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7), 0 0 20px 4px var(--pin-color);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0), 0 0 30px 8px var(--pin-color);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 0 20px 4px var(--pin-color);
  }
}

/* --- Locate Me Button --- */
.locate-me-btn {
  position: fixed;
  z-index: 45;
  bottom: calc(170px + env(safe-area-inset-bottom, 0px));
  right: calc(10px + env(safe-area-inset-right, 0px));
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(21, 30, 50, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.locate-me-btn:hover {
  background: rgba(21, 30, 50, 1);
  color: #f8fafc;
  border-color: rgba(59, 130, 246, 0.5);
}

.locate-me-btn:active {
  transform: scale(0.95);
}

.locate-me-btn.active {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.locate-me-btn.locating {
  animation: locating-pulse 1.5s infinite;
}

@keyframes locating-pulse {
  0%, 100% { color: #cbd5e1; }
  50% { color: #93c5fd; }
}

@media (min-width: 768px) {
  .locate-me-btn {
    bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 767px) {
  #locateMeBtn {
    top: calc(128px + env(safe-area-inset-top, 0px)) !important;
    right: calc(10px + env(safe-area-inset-right, 0px)) !important;
    bottom: auto !important;
    left: auto !important;
  }

  #demoHelpBtn {
    top: calc(128px + env(safe-area-inset-top, 0px)) !important;
    right: calc(10px + env(safe-area-inset-right, 0px)) !important;
    bottom: auto !important;
    left: auto !important;
  }

  .side-panel.open ~ .locate-me-btn {
    opacity: 0;
    pointer-events: none;
  }
}

/* --- User Location Blue Dot --- */
.user-location-dot {
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  position: relative;
}

.user-location-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 50%;
  animation: location-ring 2s ease-out infinite;
}

@keyframes location-ring {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* --- Nearby Panel Styles --- */
.nearby-tree-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nearby-tree-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nearby-tree-row:active {
  background: rgba(255, 255, 255, 0.12);
}

.nearby-distance-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: 'Inter', monospace;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nearby-distance-badge.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.nearby-distance-badge.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.nearby-distance-badge.gray {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

/* --- Toast Notification --- */
.ara-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(21, 30, 50, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ara-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Photo Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-counter {
  margin-top: 12px;
  color: #9caac3;
  font-size: 0.9rem;
  font-weight: 600;
}

.lightbox-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.75rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10000;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-close__label {
  font-size: 0.78rem;
  font-weight: 800;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  font-size: 28px;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

@media (max-width: 520px) {
  .lightbox-close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    height: 42px;
  }

  .lightbox-close__label {
    display: none;
  }
}

/* Demo-only one-shot pulse applied to #demoSurveyFab after the welcome modal
   is dismissed, so first-time visitors notice the floating survey button.
   Runs exactly once (no `infinite`); the JS handler also removes the class
   on animationend or first click so returning visitors never see it. */
@keyframes araDemoFabPulse {
  0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.55); transform: scale(1); }
  50%  { box-shadow: 0 0 0 14px rgba(59, 130, 246, 0);   transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);      transform: scale(1); }
}
.ara-demo-fab-pulse {
  animation: araDemoFabPulse 1.1s ease-out 2;
}
