*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  background: #fff;
  font-size: 15px;
}

body {
  display: flex;
  flex-direction: column;
  color: #303030;
  font-family: "Gridnik", sans-serif;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* ── Page transitions ────────────────────────────────────────────────── */

body:not(.landing-page) {
  opacity: 0;
  animation: analogsFadeIn 0.25s ease forwards;
}

body:not(.landing-page).is-exiting {
  animation: analogsFadeOut 0.18s ease forwards;
}

@keyframes analogsFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes analogsFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

::selection {
  background: #ddd6cb;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  padding: 1rem 2rem 1rem 1.2rem;
  padding-right: 320px;
  background: #fff;
  color: #666;
  font-family: "Gridnik", sans-serif;
}

.top-nav-button {
  border: 1px solid #666;
  background: transparent;
  color: #666;
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: 0.08em;
  font-weight: 400;
  line-height: 1;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
}

.top-nav a {
  text-decoration: none;
  color: #666;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-align: center;
  flex: 1 1 0;
}


.catalogue {
  position: relative;
  width: 100%;
  flex: 1;
  padding: 1.25rem 7rem 3rem 0.75rem;
}

.catalogue-index {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem;
  padding-left: 4.2rem;
}

.catalogue-row {
  width: 100%;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 4.5rem;
  align-items: flex-start;
}

.row-label {
  position: sticky;
  top: 5.2rem;
  text-transform: uppercase;
  text-align: left;
  letter-spacing: 0.08em;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  color: #666;
  font-family: "Gridnik", sans-serif;
}

.row-label[data-filter-type] {
  cursor: pointer;
}

.row-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.25rem;
  row-gap: 0;
  align-items: start;
}

.project-section {
  position: relative;
  display: block;
}

.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.project-list li {
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  font-family: "Libre Baskerville";
  color: #666;
  transition: opacity 180ms ease;
}

.project-list a {
  display: block;
  width: 100%;
  color: #666;
  text-decoration: none;
}

.project-item.is-placeholder,
.project-item.is-placeholder a {
  color: #b5b5b5;
}

.project-list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.objective-block {
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, background-color 180ms ease;
}

.objective-block.is-featured {
  width: calc(100% - 8.5rem);
  min-height: var(--objective-feature-min-height, 250px);
  padding: 0.75rem 0.9rem 0.9rem;
  order: -1;
  background: #fff;
  border: none;
  position: relative;
}

.objective-block.is-featured::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, #002fff 0 16px, transparent 16px 28px) top / 28px 1px repeat-x,
    linear-gradient(90deg, #002fff 0 16px, transparent 16px 28px) bottom / 28px 1px repeat-x,
    linear-gradient(0deg, #002fff 0 16px, transparent 16px 28px) left / 1px 28px repeat-y,
    linear-gradient(0deg, #002fff 0 16px, transparent 16px 28px) right / 1px 28px repeat-y;
}

.objective-block.is-minimized {
  width: var(--objective-tile-width, 64px);
  height: var(--objective-tile-height, 64px);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 47, 255, 0.2);
}

.objective-block.is-minimized:hover {
  transform: translateY(-1px);
}

.objective-block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.objective-block .row-label {
  position: static;
  top: auto;
  text-transform: none;
  letter-spacing: 0;
  color: #000;
  font-size: 30px;
  line-height: 1.18;
  font-style: italic;
  font-family: "Source Serif 4", "Cormorant Garamond", serif;
}

.objective-block.is-featured .row-label {
  color: #002fff;
  font-family: "Gridnik", sans-serif;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}

.objective-promote-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(48, 48, 48, 0.35);
  background: rgba(255, 255, 255, 0.65);
  color: #000;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.42rem;
  cursor: pointer;
  font-family: "Gridnik", sans-serif;
}

.objective-promote-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

.objective-block-content {
  margin-top: 0.5rem;
}

.objective-block.is-minimized .objective-block-content,
.objective-block.is-minimized .objective-promote-btn {
  display: none;
}

.objective-block.is-minimized .objective-block-header {
  width: 100%;
  height: 100%;
}

.objective-block.is-minimized .row-label {
  width: 100%;
  height: 100%;
  font-size: 0;
  color: transparent;
}

body:not(.has-featured-objective) .objective-block.is-minimized {
  background: rgba(0, 47, 255, 0.2);
}

.catalogue-page .top-nav a,
.catalogue-page .row-label,
.catalogue-page .project-list li,
.catalogue-page .project-list a,
.catalogue-page .section-marker {
  color: #000;
}

body.catalogue-page.is-pinned-filter .top-nav a.is-dimmed,
body.catalogue-page.is-pinned-filter .row-label.is-dimmed,
body.catalogue-page.is-pinned-filter .section-marker.is-dimmed {
  color: #000;
}

.site-entry {
  margin-top: auto;
  padding: 1.25rem 2rem;
  background: #fafafa;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-entry label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}

.site-entry input {
  width: 260px;
  padding: 0.5rem 0.75rem;
  font-size: 14px;
  border: 1px solid #ccc;
  font-family: inherit;
}

.site-entry input:focus {
  outline: none;
  border-color: #666;
}

.site-entry-btn {
  padding: 0.5rem 1rem;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #666;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.site-entry-btn:hover:not(:disabled) {
  background: #555;
}

.site-entry-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.site-entry-hint {
  font-size: 14px;
  color: #999;
}

.section-markers {
  position: absolute;
  top: 1.2rem;
  right: 0.5rem;
  bottom: 2.4rem;
  width: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  text-align: right;
}

.section-marker {
  font-size: 14px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.2;
  font-family: "Gridnik", sans-serif;
  transition: opacity 180ms ease;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
  text-align: right;
}

.section-marker:hover:not(:disabled) {
  text-decoration: underline;
}

.section-marker:disabled {
  cursor: default;
}

.section-marker-future {
  opacity: 0.4;
}

.section-marker:not(:disabled).section-marker-future {
  opacity: 0.7;
}

.section-marker.is-active {
  font-weight: 500;
  opacity: 1;
}

.section-marker:nth-child(1) {
  color: #3a7ca5;
}

.section-marker:nth-child(2) {
  color: #5a8a4a;
}

.section-marker:nth-child(3) {
  color: #7a6a8a;
}

.section-marker:nth-child(4) {
  color: #c7954a;
}

.project-item.is-filtered-out {
  opacity: 0.25;
  pointer-events: none;
}

body.is-bioregion-filtering .project-item.is-bioregion-match {
  font-weight: 500;
  color: #303030;
}

body.is-bioregion-filtering .project-item.is-bioregion-match a {
  color: #303030;
}

.empty-state {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.top-nav a,
.row-label {
  transition: opacity 180ms ease;
}

body.is-filtering .top-nav a,
body.is-filtering .row-label,
body.is-filtering .project-item,
body.is-filtering .section-marker {
  opacity: 0.2;
}

body.is-filtering .is-highlight {
  opacity: 1;
}

/* Pinned filter: only dim non-matching projects; other parameters stay at full opacity */
body.is-pinned-filter .project-item:not(.is-highlight) {
  opacity: 0.25;
}

body.is-pinned-filter .project-item.is-highlight {
  opacity: 1;
}

/* Grey out other parameters on the same axis when one is selected */
body.is-pinned-filter .is-dimmed {
  opacity: 0.3;
}

body.is-pinned-filter .top-nav a.is-dimmed,
body.is-pinned-filter .row-label.is-dimmed,
body.is-pinned-filter .section-marker.is-dimmed {
  color: #999;
}

.index-reset-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  padding: 0.4rem 0.75rem;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #fff;
  color: #666;
  border: 1px solid #ccc;
  cursor: pointer;
  font-family: "Gridnik", sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.index-reset-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.index-reset-btn:hover {
  border-color: #666;
  color: #303030;
}

@media (max-width: 1180px) {
  .catalogue {
    padding-right: 6rem;
  }

}

@media (max-width: 920px) {
  .top-nav {
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .top-nav a {
    flex: 0 1 auto;
    text-align: left;
    font-size: 15px;
  }


  .site-entry {
    padding: 1rem;
  }

  .site-entry input {
    width: 100%;
    max-width: 220px;
  }

  .catalogue {
    padding: 1rem;
  }

  .catalogue-index {
    padding-left: 0.8rem;
  }

  .objective-block.is-featured {
    width: 100%;
  }

  .objective-block .row-label {
    font-size: 22px;
  }

  .objective-block.is-minimized {
    min-width: 48px;
    min-height: 48px;
  }

  .catalogue-row {
    grid-template-columns: 1fr;
    row-gap: 0.8rem;
  }

  .row-label {
    position: static;
  }

  .row-sections {
    grid-template-columns: 1fr;
    row-gap: 0.8rem;
    column-gap: 0;
  }

  .project-section {
    min-width: 0;
  }

  .section-markers {
    display: none;
  }
}

/* Map page */
.map-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.map-nav {
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
}

.map-nav .back-link {
  flex: 0 0 auto;
  text-decoration: none;
  color: #666;
  font-size: 14px;
}

.map-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #303030;
}

.map-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

.map-container {
  flex: 1;
  min-width: 0;
  min-height: 300px;
}

.map-sidebar {
  width: 320px;
  flex-shrink: 0;
  overflow-y: auto;
  border-left: 1px solid #e0e0e0;
  background: #fafafa;
  /* Single source of truth for the sticky-header height. The toggle
     below sets an explicit height to match this exactly so stacked
     headers meet edge-to-edge with no gap and no overlap. */
  --section-header-h: 44px;
}

.sidebar-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 1rem;
}

/* ── Collapsible sidebar sections ────────────────────────────────────── */

/* display: contents removes the .sidebar-section box from layout, so each
   nested .sidebar-section-toggle effectively becomes a direct child of
   .map-sidebar. That lets `position: sticky` on the toggles anchor to the
   whole sidebar scroll container instead of being trapped inside each
   section. The border between sections is handled by the toggle's own
   border-bottom below. */
.sidebar-section {
  display: contents;
}

/* Clear-site row — sits at the top of the map sidebar when a polygon is
   active. Not wrapped in a .sidebar-section so it doesn't pick up the
   section-toggle chevron treatment. */
.sidebar-site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  font-family: "Work Sans", sans-serif;
  font-size: 0.78rem;
  color: #666;
  background: #fafafa;
}

.sidebar-site-actions {
  display: flex;
  gap: 0.35rem;
}

.sidebar-site-clear {
  font-family: "Work Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  background: transparent;
  border: 1px solid #888;
  color: #333;
  cursor: pointer;
  border-radius: 2px;
}
.sidebar-site-clear:hover {
  background: #303030;
  border-color: #303030;
  color: #fff;
}

/* Explore-mode toggle: highlighted when the user has switched to "show all
   projects" view even though a site is delineated. */
.sidebar-site-clear.is-active {
  background: #002fff;
  border-color: #002fff;
  color: #fff;
}
.sidebar-site-clear.is-active:hover {
  background: #0024cc;
  border-color: #0024cc;
}

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--section-header-h);
  padding: 0 1.25rem;
  background: #fafafa;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  box-sizing: border-box;
  cursor: pointer;
  font-family: "Work Sans", sans-serif;
  text-align: left;
  position: sticky;
}

.sidebar-section-toggle:hover {
  background: #f0f0f0;
}

/* Stack the section toggles so every header stays visible while scrolling.
   Each subsequent header is offset by the height of the ones above it, and
   earlier headers paint above later ones so transitions look clean.
   Keyed to section IDs (not :nth-of-type) so adding non-section siblings
   to the sidebar — e.g. the sidebar-site-row — doesn't shift the stack. */
#similaritySection .sidebar-section-toggle {
  top: 0;
  z-index: 5;
}
#permitsSection .sidebar-section-toggle {
  top: var(--section-header-h);
  z-index: 4;
}
#connectednessSection .sidebar-section-toggle {
  top: calc(var(--section-header-h) * 2);
  z-index: 3;
}
#projectsSection .sidebar-section-toggle {
  top: calc(var(--section-header-h) * 3);
  z-index: 2;
}

.sidebar-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  font-weight: 500;
}

.sidebar-section-arrow {
  font-size: 10px;
  color: #999;
  transition: transform 0.2s ease;
}

.sidebar-section-toggle[aria-expanded="true"] .sidebar-section-arrow {
  transform: rotate(90deg);
}

.sidebar-section-body {
  /* No overflow:hidden here — it would create a scroll context that traps
     position:sticky children (like .project-filters) inside the body
     instead of letting them anchor to the whole sidebar. Collapsed bodies
     are hidden via the native [hidden] attribute below. */
}

.sidebar-section-body[hidden] {
  display: none;
}

.sidebar-section-body.is-open {
  padding: 0 1.25rem 1.25rem;
}

/* ── Layer toggle controls ───────────────────────────────────────── */

.layer-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.layer-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
}

.layer-toggle-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  font-family: "Work Sans", sans-serif;
}

.layer-toggle-source {
  font-size: 0.72rem;
  color: #999;
  font-family: "Work Sans", sans-serif;
}

.layer-toggle-tag {
  font-size: 0.72rem;
  color: #999;
  font-weight: 400;
  margin-left: 0.25rem;
}

/* ── Connectedness site-analysis panel ──────────────────────────── */

.analysis-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 1rem 0 0.85rem;
}

.analysis-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-family: "Work Sans", sans-serif;
}

.analysis-heading {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin: 0;
  display: flex;
  align-items: center;
}

.analysis-no-site {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #666;
}

.analysis-no-site p {
  margin: 0 0 0.4rem;
}

.analysis-cta {
  color: #002fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
}

.analysis-cta:hover {
  text-decoration: underline;
}

.analysis-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.analysis-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.analysis-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 500;
}

.analysis-select {
  font-family: "Work Sans", sans-serif;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #333;
  cursor: pointer;
}

.analysis-run {
  font-family: "Work Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  background: #002fff;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.analysis-run:hover:not(:disabled) {
  background: #0026d6;
}

.analysis-run:disabled {
  background: #aaa;
  cursor: wait;
}

.analysis-results {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(63, 163, 77, 0.08);
  border-left: 3px solid #3fa34d;
  border-radius: 2px;
}

.analysis-results .analysis-metric:last-of-type .analysis-metric-label {
  padding-right: 5.5rem;
}

.analysis-clear-overlay {
  position: absolute;
  right: 0.5rem;
  bottom: 0.4rem;
  background: transparent;
  border: none;
  padding: 0.1rem 0.25rem;
  font-family: "Work Sans", sans-serif;
  font-size: 0.68rem;
  color: #3fa34d;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.analysis-clear-overlay:hover {
  color: #2c7a37;
  text-decoration: underline;
}

/* Site polygon in-place editor ---------------------------------------- */

.site-edit-vertex {
  background: #ffffff;
  border: 2px solid #002fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: grab;
  transition: transform 0.1s;
}

.site-edit-vertex:active {
  cursor: grabbing;
  transform: scale(1.15);
}

.site-edit-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-family: "Work Sans", sans-serif;
  font-size: 0.8rem;
  color: #333;
}

.site-edit-bar-label {
  font-size: 0.75rem;
  color: #555;
  padding-right: 0.25rem;
}

.site-edit-bar button {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #ffffff;
  color: #333;
}

.site-edit-bar .site-edit-save {
  background: #002fff;
  border-color: #002fff;
  color: #ffffff;
}

.site-edit-bar .site-edit-save:hover {
  background: #0021c0;
  border-color: #0021c0;
}

.site-edit-bar .site-edit-cancel:hover {
  border-color: #888;
  color: #000;
}

.analysis-metric-value {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #222;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.analysis-metric-label {
  font-size: 0.72rem;
  color: #666;
  line-height: 1.3;
}

.analysis-status {
  font-size: 0.7rem;
  color: #999;
  font-style: italic;
  min-height: 1em;
}

.analysis-status-error {
  color: #c0392b;
  font-style: normal;
  font-weight: 500;
}

.layer-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.layer-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.layer-switch-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.layer-switch-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.layer-switch input:checked + .layer-switch-slider {
  background: #002fff;
}

.layer-switch input:checked + .layer-switch-slider::before {
  transform: translateX(16px);
}

.layer-opacity-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.layer-opacity-label {
  font-size: 0.75rem;
  color: #888;
  font-family: "Work Sans", sans-serif;
  white-space: nowrap;
}

.layer-opacity-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.layer-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #002fff;
  cursor: pointer;
}

.layer-opacity-value {
  font-size: 0.72rem;
  color: #999;
  font-family: "Work Sans", sans-serif;
  min-width: 2.2em;
  text-align: right;
}

/* ── Info-icon tooltip (reusable) ───────────────────────────────── */
/* A small ⓘ marker that reveals a dark tooltip on hover/focus. Used on
   every data-layer label in the sidebar so a user not fluent in permit
   jargon can still read what each acronym means. */

.layer-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 5px;
  color: #aaa;
  font-size: 13px;
  line-height: 1;
  cursor: help;
  position: relative;
  vertical-align: middle;
  user-select: none;
  transition: color 0.15s ease;
}

.layer-info:hover,
.layer-info:focus {
  color: #002fff;
  outline: none;
}

/* The tooltip element itself is a single shared <div> appended to <body>
   by info-tooltip.js. It uses position:fixed + viewport coords so it can
   paint over the sidebar AND the map without being clipped by either
   .map-sidebar's overflow or Leaflet's own stacking contexts. */
.layer-info-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 200px;
  max-width: 280px;
  width: max-content;
  padding: 8px 10px;
  background: rgba(25, 25, 25, 0.95);
  color: #fff;
  font-family: "Work Sans", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
  white-space: normal;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  /* Higher than any Leaflet pane (max ~700) and any sticky header. */
  z-index: 99999;
}

.layer-info-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Permits layer controls ─────────────────────────────────────── */

.permit-layer-toggles {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.permit-layer-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
  user-select: none;
}

.permit-layer-toggle:hover {
  background: #f8f8f8;
  margin: 0 -8px;
  padding: 7px 8px;
  border-radius: 3px;
}

.permit-layer-toggle input[type="checkbox"] {
  accent-color: #333;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.permit-layer-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  margin-top: 2px;
}

.permit-layer-label {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
}

.permit-layer-flag {
  font-size: 0.68rem;
  color: #999;
  font-weight: 400;
  display: block;
}

.permit-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 8px 0 12px 0;
}

/* ── Permits click-info panel ───────────────────────────────────── */

.permit-info-title {
  font-family: "Work Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 8px;
}

.permit-click-info {
  font-size: 0.8rem;
  line-height: 1.5;
}

.permit-placeholder {
  color: #999;
  font-size: 0.78rem;
  font-style: italic;
}

.permit-loading {
  color: #666;
  font-size: 0.78rem;
}

.permit-loading::after {
  content: "";
  animation: permit-dots 1.2s steps(3, end) infinite;
}

@keyframes permit-dots {
  0%   { content: ""; }
  33%  { content: "."; }
  66%  { content: ".."; }
  100% { content: "..."; }
}

.permit-click-coords {
  font-size: 0.7rem;
  color: #bbb;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.permit-no-results {
  color: #999;
  font-size: 0.78rem;
  font-style: italic;
  padding: 6px 0;
}

.permit-result-group {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.permit-result-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.permit-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.permit-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.permit-result-name {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.permit-result-attrs {
  margin-left: 18px;
}

.permit-result-attr {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 0.78rem;
}

.permit-attr-key {
  color: #999;
  min-width: 80px;
  flex-shrink: 0;
}

.permit-attr-val {
  color: #303030;
  font-weight: 500;
}

.permit-result-flag {
  display: inline-block;
  background: #002fff;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

/* ── Crosshair cursor when permits layers active ────────────────── */

#map.permits-active {
  cursor: crosshair;
}

.permit-click-pin {
  width: 12px;
  height: 12px;
  background: #002fff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ── Hatch patterns ─────────────────────────────────────────────── */

.hatch-fill-crithab {
  fill: url(#hatch-crithab) !important;
  fill-opacity: 1 !important;
}

/* ── Connectedness legend ────────────────────────────────────────── */

.connectedness-legend {
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: "Work Sans", sans-serif;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: auto;
}

.connectedness-legend-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.85);
}

.connectedness-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.connectedness-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.connectedness-legend-label {
  color: rgba(255, 255, 255, 0.9);
}

/* ── Project filter controls ──────────────────────────────────────── */

.project-filters {
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  /* Freeze the filter controls just below the 4 stacked section headers so
     only the project list itself scrolls. */
  position: sticky;
  top: calc(var(--section-header-h) * 4);
  background: #fafafa;
  z-index: 1;
}

.filter-group {
  margin-bottom: 0.75rem;
}

.filter-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-family: "Work Sans", sans-serif;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  font-family: "Work Sans", sans-serif;
  font-size: 13px;
  padding: 0.25rem 0.55rem;
  border: 1px solid #d0d0d0;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: border-color 0.15s, color 0.15s;
}

.filter-chip:has(input:checked) {
  border-color: #002fff;
  color: #002fff;
}

.filter-chip input {
  accent-color: #002fff;
  width: 13px;
  height: 13px;
}

.filter-year-range {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-year-input {
  width: 72px;
  font-family: "DM Mono", monospace;
  font-size: 13px;
  padding: 0.3rem 0.4rem;
  border: 1px solid #d0d0d0;
  color: #303030;
  background: #fff;
  outline: none;
}

.filter-year-input:focus {
  border-color: #002fff;
}

.filter-year-sep {
  color: #999;
  font-size: 13px;
}

.filter-search-input {
  width: 100%;
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d0d0;
  color: #303030;
  background: #fff;
  outline: none;
}

.filter-search-input:focus {
  border-color: #002fff;
}

.filter-count {
  font-family: "DM Mono", monospace;
  font-size: 13px;
  color: #002fff;
  margin-top: 0.25rem;
}

/* ── Map location search control ─────────────────────────────────── */

.map-search-control {
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  font-family: "Work Sans", sans-serif;
  min-width: 260px;
}

.map-search-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  font-size: 14px;
  border: none;
  outline: none;
  color: #303030;
  background: transparent;
  font-family: inherit;
}

.map-search-input::placeholder {
  color: #999;
}

.map-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #eee;
  max-height: 200px;
  overflow-y: auto;
}

.map-search-result-item {
  padding: 0.45rem 0.7rem;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  line-height: 1.35;
}

.map-search-result-item:hover {
  background: #f0f0f0;
}

.project-list-sidebar {
  list-style: none;
}

.project-list-sidebar .sidebar-project {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.project-list-sidebar .sidebar-project:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-list-sidebar .sidebar-project a {
  display: block;
  color: #303030;
  text-decoration: none;
  font-family: "Libre Baskerville", serif;
  font-size: 15px;
  line-height: 1.4;
}

.project-list-sidebar .sidebar-project a:hover {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.sidebar-location {
  display: block;
  font-size: 14px;
  color: #666;
  margin-top: 0.25rem;
}

.sidebar-empty {
  font-size: 14px;
  color: #666;
}

.map-fallback {
  padding: 2rem;
  text-align: center;
  color: #666;
}

.map-layer-toggle-btn {
  border: 1px solid #b8b8b8;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  font-family: "Gridnik", sans-serif;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.42rem 0.52rem;
  cursor: pointer;
}

.map-layer-toggle-btn:hover {
  border-color: #6f6f6f;
}

.map-canopy-status {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #000;
  padding: 7px 10px;
  font: 12px "Gridnik", sans-serif;
}

.map-canopy-ramp {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.map-canopy-ramp span {
  opacity: 0.9;
}

.map-canopy-ramp-bar {
  display: inline-block;
  width: 72px;
  height: 8px;
  background: linear-gradient(90deg, #ffffff, #2a7e37);
  border: 1px solid #d7d7d7;
}

@media (max-width: 768px) {
  .map-main {
    flex-direction: column;
  }

  .map-sidebar {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid #e0e0e0;
  }
}

/* Project landing page */
.project-page {
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.project-header {
  padding: 1rem 2rem;
  border-bottom: 1px solid #e8e8e8;
}

.project-header .back-link {
  font-size: 14px;
  color: #666;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-header .back-link:hover {
  text-decoration: underline;
}

.project-main {
  display: flex;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  align-items: flex-start;
  flex: 1;
}

.project-content {
  flex: 1;
  min-width: 0;
}

.project-meta {
  margin-bottom: 2rem;
}

.project-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: #303030;
  font-family: "Gridnik", sans-serif;
  margin-bottom: 0.5rem;
}

.project-location {
  font-size: 14px;
  color: #666;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.project-tag {
  font-size: 14px;
  font-style: italic;
  color: #555;
  line-height: 1.4;
  font-family: "Libre Baskerville", serif;
}

.project-body {
  margin-top: 0;
}

.project-description {
  font-size: 16px;
  line-height: 1.75;
  color: #333;
  font-family: "Libre Baskerville", serif;
}

.project-description p {
  margin-bottom: 1rem;
}

.project-description p:last-child {
  margin-bottom: 0;
}

.project-related {
  margin-top: 2.5rem;
}

.project-related-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-related-link {
  display: inline-block;
  font-size: 15px;
  color: #999;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  font-family: "Libre Baskerville", serif;
}

.project-related-link:hover {
  color: #666;
}

.project-historic,
.project-herbarium {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.historic-title,
.herbarium-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 1rem;
}

.historic-paintings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.historic-loading {
  font-size: 14px;
  color: #999;
}

.historic-item {
  display: block;
  text-decoration: none;
  color: inherit;
}

.historic-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
}

.historic-caption {
  display: block;
  font-size: 14px;
  color: #666;
  margin-top: 0.35rem;
  line-height: 1.3;
}

.herbarium-desc {
  font-size: 14px;
  color: #666;
  margin-bottom: 0.5rem;
}

.herbarium-link {
  font-size: 14px;
  color: #666;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.herbarium-link:hover {
  color: #303030;
}

.project-gallery {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-gallery-main {
  width: 100%;
}

.project-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.project-image-main {
  max-height: 320px;
}

.project-gallery-stack {
  position: relative;
  min-height: 180px;
}

.gallery-stack-inner {
  position: relative;
  width: 85%;
  margin: 0 auto;
  padding-bottom: 110%;
}

.project-image-stack {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: z-index 0.2s;
}

.project-image-stack:nth-child(1) {
  transform: translate(0, 0);
  z-index: 1;
}

.project-image-stack:nth-child(2) {
  transform: translate(10%, 15%) rotate(-2deg);
  z-index: 2;
}

.project-image-stack:nth-child(3) {
  transform: translate(-6%, 30%) rotate(1.5deg);
  z-index: 3;
}

.project-image-stack:nth-child(n+4) {
  transform: translate(4%, 45%) rotate(-1deg);
  z-index: 4;
}

.project-image-stack.is-active {
  z-index: 10;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 20;
}

.gallery-prev {
  left: 0;
}

.gallery-next {
  right: 0;
}

.gallery-caption {
  margin-top: 1rem;
  font-size: 15px;
  color: #666;
  font-family: "Libre Baskerville", serif;
  text-align: center;
}

/* Community Science Record */
.project-community-data {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.community-data-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.community-data-subtitle {
  font-size: 14px;
  color: #555;
  font-family: "Libre Baskerville", serif;
  line-height: 1.5;
  margin-top: -0.5rem;
}

.community-data-missing,
.community-data-error,
.community-data-empty {
  font-size: 14px;
  color: #666;
  font-family: "Libre Baskerville", serif;
}

.community-data-retry {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid #666;
  color: #666;
  cursor: pointer;
  font-family: "Gridnik", sans-serif;
}

.community-data-retry:hover {
  background: #f5f5f5;
}

.community-data-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-bar {
  height: 24px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 2px;
}

.skeleton-bar-1 { width: 60%; }
.skeleton-bar-2 { width: 85%; }
.skeleton-bar-3 { width: 45%; }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.community-data-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.community-stat-chip {
  font-size: 15px;
  padding: 0.4rem 0.85rem;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  color: #555;
  font-family: "Libre Baskerville", serif;
}

.community-data-charts {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.community-chart-wrap {
  flex: 1;
  min-width: 280px;
}

.community-chart-inner canvas {
  max-width: 100%;
}

.community-chart-note {
  font-size: 14px;
  color: #999;
  font-style: italic;
  margin-top: 0.75rem;
  max-width: 480px;
}

.community-donut-wrap {
  flex-shrink: 0;
}

.community-data-freshness {
  font-size: 14px;
  color: #999;
  font-family: "Libre Baskerville", serif;
}

.community-headline-section {
  margin-top: 0.5rem;
}

.community-headline-title {
  font-family: "Work Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
  margin-bottom: 0.75rem;
}

.species-search-wrap {
  margin-bottom: 0.75rem;
}

.species-search-input {
  width: 100%;
  max-width: 320px;
  font-family: "Work Sans", sans-serif;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d0d0;
  color: #303030;
  background: #fff;
  outline: none;
}

.species-search-input:focus {
  border-color: #002fff;
}

.species-search-input::placeholder {
  color: #999;
}

.species-search-empty {
  font-family: "Work Sans", sans-serif;
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
}

.headline-species-count {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  color: #999;
}

.headline-species-strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.headline-species-card {
  flex: 0 0 auto;
  width: 160px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.headline-species-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.headline-species-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  display: block;
  background: #eee;
  position: relative;
}

.headline-species-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: top;
}

.headline-species-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 80px;
  font-size: 1.5rem;
  color: #999;
}

.headline-species-common {
  font-size: 14px;
  font-weight: 600;
  color: #303030;
  font-family: "Libre Baskerville", serif;
  line-height: 1.3;
}

.headline-species-scientific {
  font-size: 14px;
  color: #666;
  font-style: italic;
}

/* Row-based species layout (used by community-data.js renderCharts) */
.headline-species-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.headline-species-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.headline-species-row:last-child { border-bottom: none; }
.headline-species-row:hover { background: #fafafa; }

.headline-species-row .headline-species-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.headline-species-row .headline-species-img {
  width: 48px;
  height: 48px;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
  background: #eee;
}

.headline-species-row .headline-species-photo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  display: block;
}

.headline-species-row .headline-species-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1rem;
  color: #999;
}

.headline-species-timeline-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.headline-species-timeline-wrap .headline-species-common {
  font-size: 0.78rem;
  font-weight: 500;
  color: #303030;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.headline-species-timeline-wrap .headline-species-scientific {
  font-size: 0.65rem;
  color: #666;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-caveats {
  margin-top: 1rem;
  border-top: 1px solid #e0e0e0;
  padding-top: 0.75rem;
}

.community-caveats-summary {
  padding: 0;
  font-family: "Work Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
  cursor: pointer;
  list-style: none;
}

.community-caveats-summary::-webkit-details-marker {
  display: none;
}

.community-caveats-summary::before {
  content: "›";
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.2s;
}

.community-caveats[open] .community-caveats-summary::before {
  transform: rotate(90deg);
}

.community-caveats-content {
  padding: 0.75rem 0 0;
}

.community-caveats-content p {
  font-family: "Work Sans", sans-serif;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.community-caveats-content p:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .project-main {
    flex-direction: column;
  }

  .project-gallery {
    width: 100%;
    max-width: 480px;
  }

  .project-image-stack:nth-child(n) {
    transform: none;
  }
}

/* ── Ecosystem type switcher (catalogue page) ─────────────────────── */

.ecosystem-switcher {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  height: 56px;
  background: #fff;
}

.ecosystem-switcher-link {
  font-family: "Work Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #aaa;
  transition: color 0.15s;
}

.ecosystem-switcher-link:hover {
  color: #303030;
}

.ecosystem-switcher-link.is-active {
  color: #303030;
  font-weight: 600;
}

/* ── Typology index (catalogue page) ─────────────────────────────── */

.typology-index {
  padding: 4rem 2rem 4rem 2rem;
  max-width: 420px;
}

.typology-section {
  margin-bottom: 0;
}

.typology-type-label {
  display: block;
  font-family: "Work Sans", sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #303030;
  padding: 0.6rem 0;
  border-top: 1px solid #303030;
  border-bottom: 1px solid #d0d0d0;
}

.typology-habitat-item {
  display: block;
  font-family: "Work Sans", sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: #303030;
  text-decoration: none;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-bottom: 1px solid #d0d0d0;
  transition: color 0.12s;
  cursor: pointer;
}

.typology-habitat-item:last-child {
  border-bottom: none;
}

.typology-section:last-child .typology-habitat-item:last-child {
  border-bottom: 1px solid #303030;
}

.typology-habitat-item:hover {
  color: #002fff;
}

.typology-empty {
  font-family: "Work Sans", sans-serif;
  font-size: 0.85rem;
  color: #999;
  padding: 1rem 0;
}

.typology-habitat-item.is-chart-hovered {
  color: #002fff;
}

.typology-habitat-item.is-selected {
  color: #002fff;
}

.typology-habitat-item.is-community-match::before {
  content: "→";
  color: #002fff;
  margin-right: 0.5rem;
  font-weight: 600;
}

.map-nav-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 120px;
  min-height: 48px;
  padding: 0.6rem 1.2rem;
  font-family: "Work Sans", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #fff;
  background: #303030;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.map-nav-btn.has-specimen-bg {
  background-color: rgba(0,0,0,0.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
  width: 240px;
  height: 360px;
  min-width: unset;
  min-height: unset;
  padding: 0.75rem 1rem;
  align-items: flex-end;
  justify-content: flex-end;
  background-size: contain;
  background-repeat: no-repeat;
}

.map-nav-btn.has-specimen-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  border-radius: 2px;
  pointer-events: none;
}

.map-nav-btn .map-nav-btn-text {
  position: relative;
  z-index: 1;
}

.map-nav-btn.has-specimen-bg .map-nav-btn-text {
  background: rgba(0,0,0,0.7);
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
}

.map-nav-btn:hover {
  background-color: rgba(0,47,255,0.9);
  border-color: #002fff;
}

.map-nav-btn:hover.has-specimen-bg {
  background-color: rgba(0,47,255,0.9);
}

@media (max-width: 900px) {
  .catalogue-heatmap {
    flex-direction: column;
    align-items: stretch;
  }
  .map-nav-btn {
    bottom: 1rem;
    right: 1rem;
  }
  .map-nav-btn.has-specimen-bg {
    width: 160px;
    height: 240px;
  }
}

/* ── Catalogue two-column layout ──────────────────────────────────── */

.catalogue-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 56px);
  padding: 50px 0 0 2rem;
}

.catalogue-left {
  width: 360px;
  flex-shrink: 0;
  height: calc(100vh - 106px);
  overflow-y: auto;
}

.catalogue-layout .typology-index {
  padding: 1rem 2rem 4rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* ── Heatmap panel ────────────────────────────────────────────────── */

.catalogue-heatmap {
  flex: 1;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 1rem;
  overflow: hidden;
}

.action-table-container {
  flex: 1;
  align-self: stretch;
  overflow-y: auto;
  min-width: 0;
}

/* ── Habitat scatter chart panel (legacy) ────────────────────────── */

.chart-panel {
  flex: 1;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1rem 2rem 1rem 0;
}

.chart-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.chart-axis-selectors {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 340px;
  padding-right: 1rem;
}

.axis-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.axis-tag {
  font-family: "Work Sans", sans-serif;
  font-size: 0.75rem;
  color: #aaa;
  width: 1rem;
  flex-shrink: 0;
  text-align: center;
}

.axis-options {
  display: flex;
  gap: 0.5rem;
}

.axis-opt-btn {
  font-family: "Work Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: transparent;
  border: none;
  padding: 0.2rem 0;
  color: #bbb;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}

.axis-opt-btn:hover:not(:disabled) {
  color: #555;
}

.axis-opt-btn.is-selected {
  color: #303030;
  border-bottom-color: #303030;
  cursor: default;
}

.axis-opt-btn.is-disabled {
  color: #ddd;
  cursor: not-allowed;
}

.habitat-chart {
  width: 340px;
  height: 340px;
}

.label-toggle-btn {
  align-self: flex-end;
  font-family: "Work Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: transparent;
  border: 1px solid #ccc;
  color: #aaa;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.12s, border-color 0.12s;
}

.label-toggle-btn:hover {
  color: #555;
  border-color: #555;
}

.label-toggle-btn.is-active {
  color: #303030;
  border-color: #303030;
}
