* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

/* Prevent mobile browser auto-zoom on input focus (requires >= 16px) */
input,
select,
textarea {
  font-size: 16px;
}

body {
  font-family: Arial, sans-serif;
  background-color: #29382b;
  color: #333;
}

/* Page grid: top bar, hero, main, footer */
.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* 1. Top bar with social icons */
.top-bar {
  background-color: #8c6239;
  color: #fff;
  /* padding: 0.5rem 1.5rem; */
  min-height: 40px;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
}

.top-bar-coming-soon {
  background-color: #2b322d;
  color: #fff;
  min-height: 40px;
  display: grid;
  grid-template-rows: 2fr;
  justify-content: center;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
}

.top-bar-socials {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 40px;
  height: 40px;
}

.icon {
  color: #fff;
  width: 40px;
  height: 40px;
}

.icon-link:hover {
  background-color: #2b322d;
  width: 40px;
  height: 40px;
}

.hero {
  position: sticky;
  top: 0;
  z-index: 2200;

  background-color: #2b322d;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 4fr; /* 25% / 75% ratio */
  gap: 1.5rem;
  padding: 1.5rem;
  padding-top: 0;
  padding-bottom: 0;
  align-items: stretch;
  /* border-bottom: 1px solid #fff; */
  max-height: 200px;
}

.logo {
  font-size: 1.6rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.logo > a > img {
  width: 100%;
  max-height: 175px;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  object-fit: contain;
}

.nav {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  color: #fff;
}

.nav a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
}

.nav a:hover {
  text-decoration: underline;
}

.main-full-width {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.main-with-sidebar {
  --sidebar-width: 320px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  /* grid-template-columns: minmax(260px, 320px) 1fr; */
  /* gap: 1.5rem; */
  /* padding: 1.5rem; */
  min-height: 0;
  height: calc(100vh - 260px);
  position: relative;
}

.sidebar {
  background-color: #fafdf8;
  padding: 1rem;
  border: 1px solid #ddd;
  overflow: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.14);
}

.content {
  --map-quick-left: 23px;
  --map-quick-size: 44px;
  background-color: #ffffff;
  position: relative;
  display: flex;
  padding: 0;
  /* border-radius: 4px; */
  border: 1px solid #ddd;
  overflow: hidden;
  min-height: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.sidebar label,
.sidebar button,
.sidebar select,
.sidebar input {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
}

.sidebar input,
.sidebar select,
.sidebar button {
  padding: 0.45rem;
}

.sidebar input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin-top: 0;
  margin-right: 0.4rem;
  vertical-align: middle;
}

/* ── Sidebar accordion ─────────────────────────────────────────── */
.sidebar-accordion {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
}

.accordion-section {
  border: 1px solid #29382b;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0;
  padding: 0.7rem 0.85rem;
  background-color: #29382b;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  color: #ffffff;
}

/* Override .sidebar button { margin-top: 0.5rem } — needs 0,2,0 specificity to beat 0,1,1 */
.sidebar .accordion-header {
  display: flex;
  margin-top: 0;
}

.accordion-header:hover {
  background-color: #8c6239;
}

.accordion-chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 1.5rem;
  color: #ffffff;
}

.accordion-section.open > .accordion-header .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 0.75rem;
  margin: 0;
}

.accordion-section.open > .accordion-body {
  display: block;
}

.layer-group {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e8e8e8;
}

.layer-group h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.address-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.address-search-group.location-mode .address-search-row {
  display: none;
}

.address-search-row input {
  margin-top: 0;
}

.address-search-row button {
  margin-top: 0;
  width: auto;
  min-width: 78px;
}

.address-search-actions {
  margin-top: 0.45rem;
  display: flex;
  justify-content: flex-start;
}

.address-search-actions button {
  width: auto;
  margin-top: 0;
  padding: 0.34rem 0.48rem;
  font-size: 0.78rem;
}

.address-search-results {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.35rem;
}

.address-search-result-item {
  width: 100%;
  margin-top: 0;
  border: 1px solid #d7dfe4;
  border-radius: 6px;
  background: #f7fbff;
  padding: 0.45rem 0.5rem;
  text-align: left;
  color: #1b2c39;
  cursor: pointer;
}

.address-search-result-item:hover,
.address-search-result-item:focus-visible {
  border-color: #9db5c5;
  background: #eef6fc;
}

.address-search-result-title {
  margin: 0;
  font-size: 0.83rem;
  font-weight: 600;
}

.address-search-result-meta {
  margin: 0.12rem 0 0;
  font-size: 0.74rem;
  color: #536772;
}

.address-search-empty {
  margin: 0;
  font-size: 0.8rem;
  color: #666;
}

.user-location-popup {
  display: grid;
  gap: 0.35rem;
}

.user-location-popup-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.user-location-delete-btn {
  width: auto;
  margin-top: 0;
  border: 1px solid #c7c7c7;
  border-radius: 4px;
  background: #f7f7f7;
  color: #333;
  padding: 0.2rem 0.42rem;
  font-size: 0.76rem;
  cursor: pointer;
}

.layer-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.35rem;
  font-size: 0.84rem;
  color: #1f2a33;
}

.layer-table th,
.layer-table td {
  padding: 0.32rem 0.3rem;
  border-bottom: 1px solid #ececec;
  text-align: left;
  vertical-align: middle;
}

.layer-table th {
  font-size: 0.73rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #666;
}

.sidebar .layer-group h3,
.sidebar .layer-table th,
.sidebar .layer-table td,
.sidebar .layer-table a,
.sidebar .checkbox-label {
  color: #1f2a33;
}

.reserve-layer-table th:nth-child(2),
.reserve-layer-table td:nth-child(2),
.reserve-layer-table th:nth-child(3),
.reserve-layer-table td:nth-child(3) {
  text-align: center;
}

.reserve-layer-table td:nth-child(2) {
  width: 52px;
}

.reserve-layer-table td:nth-child(3) {
  width: 58px;
}

.area-layer-table th:nth-child(2),
.area-layer-table td:nth-child(2) {
  text-align: center;
  width: 64px;
}

.reserve-visibility-header-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.reserve-visibility-header-link:hover,
.reserve-visibility-header-link:focus-visible {
  color: #0f4c7a;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.reserve-visibility-toggle {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #232323;
  transition:
    opacity 0.14s ease,
    color 0.14s ease;
}

.reserve-visibility-toggle i {
  font-size: 1.3rem;
}

.reserve-visibility-toggle[data-visible="0"] {
  color: #949494;
  opacity: 0.55;
}

.area-layer-visibility-toggle[data-zoom-blocked="1"] {
  color: #9a6400;
  opacity: 1;
}

.area-layer-visibility-toggle:disabled {
  cursor: not-allowed;
}

.reserve-filter-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.reserve-filter-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: middle;
}

.sidebar h2 {
  margin-bottom: 0.5rem;
}

.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sidebar-mobile-header h2 {
  margin: 0;
}

.mobile-sidebar-close {
  width: auto;
  border: 1px solid #c6c6c6;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.mobile-sidebar-backdrop {
  display: none;
}

.mobile-map-fab-stack {
  position: absolute;
  left: var(--map-quick-left);
  top: 12px;
  right: auto;
  bottom: auto;
  z-index: 1215;
  display: grid;
  gap: 0.55rem;
}

.mobile-map-fab {
  position: relative;
  width: var(--map-quick-size);
  height: var(--map-quick-size);
  border-radius: 50%;
  border: 1px solid #bac9d3;
  background: rgba(255, 255, 255, 0.96);
  color: #1f3d53;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(10, 26, 36, 0.22);
}

/* ── FAB tooltip labels ───────────────────────────────────────────────────── */

@keyframes fab-label-intro {
  0% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.fab-label {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1f3d53;
  background: rgba(255, 255, 255, 0.94);
  padding: 3px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(10, 26, 36, 0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: fab-label-intro 3s ease forwards;
}

.mobile-map-fab:hover .fab-label {
  opacity: 1;
  animation: none;
}

/* Sidebar-open FAB: only needed on mobile where sidebar is hidden by default */
@media (min-width: 1501px) {
  #mobile-sidebar-open {
    display: none;
  }
}

.mobile-map-fab-icon {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  font-size: 1.1rem; /* for Font Awesome <i> icon FABs */
  line-height: 1;
}

.map-loading-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(252, 254, 255, 0.64);
  backdrop-filter: blur(1.5px);
  z-index: 1170;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    visibility 0.16s ease;
}

.map-loading-indicator.visible {
  opacity: 1;
  visibility: visible;
}

.map-loading-indicator__content {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #cfd7dc;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #18384e;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(12, 23, 34, 0.14);
}

.map-loading-indicator__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #c6d5df;
  border-top-color: #0f4c7a;
  border-radius: 50%;
  animation: map-loading-spin 0.8s linear infinite;
}

@keyframes map-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.hint {
  margin-top: 0.75rem;
  color: #555;
  font-size: 0.9rem;
}

#species-filter-clear {
  display: none;
}

.sighting-filter-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3a5240;
  margin-bottom: 0.5rem;
}

.sighting-filter-section-title i {
  color: #4a7c59;
  font-size: 0.82rem;
}

.sighting-species-filter-group {
  padding-top: 0.25rem;
}

.btn-species-filter-open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.65rem !important;
  padding: 0.55rem 0.75rem !important;
  background: #1a5c36 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  width: 100% !important;
  transition: background 0.15s ease !important;
}

.btn-species-filter-open:hover {
  background: #145029 !important;
}

.btn-species-filter-open i {
  font-size: 0.82rem;
}

.btn-species-filter-clear {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0 !important;
  padding: 0.38rem 0.6rem !important;
  background: #f9f0f0 !important;
  color: #994040 !important;
  border: 1px solid #c8dece !important;
  border-top: none !important;
  border-radius: 0 0 6px 6px !important;
  font-size: 0.82rem !important;
  cursor: pointer !important;
  width: 100% !important;
  transition:
    background 0.15s ease,
    color 0.15s ease !important;
}

.btn-species-filter-clear:hover {
  background: #f5e4e4 !important;
  color: #7a2020 !important;
}

.btn-species-filter-clear i {
  font-size: 0.78rem;
}

/* Sidebar species search (inline in sighting filters) */
.sidebar-species-search-wrapper {
  position: relative;
  margin-top: 0.4rem;
}

.sidebar-species-search-icon {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7a9a83;
  font-size: 0.78rem;
  pointer-events: none;
}

.sidebar-species-search-input {
  display: block;
  width: 100%;
  padding: 0.4rem 1.6rem 0.4rem 1.8rem !important;
  border: 1px solid #c6d9cb !important;
  border-radius: 6px !important;
  font-size: 0.82rem;
  background: #f8fdf9 !important;
  margin: 0 !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.sidebar-species-search-input:focus {
  outline: none;
  border-color: #1a5c36 !important;
  box-shadow: 0 0 0 2px rgba(26, 92, 54, 0.14);
}

.sidebar-species-search-clear-btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  padding: 0.2rem 0.3rem !important;
  margin: 0 !important;
  width: auto !important;
  cursor: pointer;
  color: #8aab93;
  font-size: 0.78rem;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.15s ease;
}

.sidebar-species-search-clear-btn:hover {
  color: #1a3a24;
}

.sidebar-species-autocomplete {
  position: fixed;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #c6d9cb;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  z-index: 9000;
}

.sidebar-species-autocomplete .species-autocomplete-item {
  font-size: 0.8rem;
  padding: 0.38rem 0.6rem;
}

.sidebar-ac-check {
  font-size: 0.82rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
  color: #b0c8b8;
}

.species-autocomplete-item.selected .sidebar-ac-check {
  color: #1a5c36;
}

.species-autocomplete-item.selected {
  background: #eef6f0;
}

.sighting-filter-subheading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5a7a63;
  margin-top: 0.65rem;
  margin-bottom: 0;
}

.sighting-filter-subheading i {
  font-size: 0.72rem;
  color: #7a9a83;
}

.species-selection-count {
  font-weight: 400;
  color: #8aab93;
}

.selected-species-list {
  max-height: 170px;
  overflow: auto;
  margin-top: 0.35rem;
  padding: 0.35rem;
  border: 1px solid #c8dece;
  border-radius: 6px 6px 0 0;
  background: #f2f8f4;
}

.date-helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.45rem;
  margin-bottom: 0.4rem;
}

.date-helper-row button {
  flex: 0 0 calc(25% - 4.5px);
  width: auto;
  margin-top: 0;
  padding: 0.35rem 0.4rem;
  font-size: 0.78rem;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

.date-helper-row button.is-active {
  border-color: #0f4c7a;
  background: #e7f1f8;
  color: #0f4c7a;
  font-weight: 700;
}

/* ── Taxonomy group quick-select row ──────────────────────────────────────── */

.group-quick-select-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.group-quick-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem !important;
  background: #1a5c36 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px 0 0 6px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  flex: 0 0 90%;
  transition: background 0.15s ease !important;
}
.group-quick-btn:hover {
  background: #145029;
}

.group-quick-dropdown-wrap {
  flex: 1;
  display: flex;
}

.group-quick-dropdown {
  flex: 1;
  width: 100%;
  padding: 0 0.5rem;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0 6px 6px 0;
  background: #1a5c36;
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
}
.group-quick-dropdown:hover {
  background: #145029;
}
.group-quick-dropdown option {
  background: #fff;
  color: #333;
}

.date-range-row {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.date-range-label {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0;
}

.date-range-label input {
  margin-top: 0.25rem;
}

.modal-overlay {
  position: fixed;
  top: var(--hero-height, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2100;
  background: rgba(18, 25, 27, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

/* In fullscreen the header is hidden; overlay must cover the full screen. */
.main-with-sidebar:fullscreen .modal-overlay {
  top: 0;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #d8d8d8;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(10, 30, 20, 0.22);
}

.species-filter-modal-card {
  width: min(720px, 100%); /* add this to override */
  height: min(
    600px,
    100%
  ); /* add this to allow shrinking on very short viewports */
  max-height: 90vh; /* add this to override */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.species-filter-modal-card > *:not(.species-modal-header) {
  padding-left: 1rem;
  padding-right: 1rem;
}

.species-filter-modal-card .species-modal-footer {
  padding-bottom: 1rem;
}

.species-filter-modal-card .species-modal-header {
  margin: 0;
  border-radius: 10px 10px 0 0;
  padding: 0.75rem 1rem;
}

.user-feedback-card {
  width: min(420px, 100%);
}

.user-feedback-message {
  margin-top: 0.45rem;
  line-height: 1.4;
}

/* ── Species Filter Modal ─────────────────────────────────────── */

.species-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #1a5c36;
  border-radius: 10px 10px 0 0;
  margin: -1rem -1rem 0.85rem;
  flex-shrink: 0;
}

.species-modal-header-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
}

.species-modal-header-title i {
  font-size: 1rem;
  opacity: 0.85;
}

.species-modal-header-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.species-modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  flex-shrink: 0;
  margin-top: 0;
  transition: background 0.15s ease;
}

.species-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.species-search-wrapper {
  position: relative;
  flex-shrink: 0;
  margin-top: 0.85rem;
}

.species-search-icon {
  position: absolute;
  left: 1.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7a9a83;
  font-size: 0.82rem;
  pointer-events: none;
}

.species-search-input {
  display: block;
  width: 100%;
  padding: 0.5rem 1.8rem 0.5rem 2rem !important;
  border: 1px solid #c6d9cb !important;
  border-radius: 6px !important;
  font-size: 16px;
  background: #f8fdf9 !important;
  margin-top: 0 !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.species-search-input:focus {
  outline: none;
  border-color: #1a5c36 !important;
  box-shadow: 0 0 0 2px rgba(26, 92, 54, 0.14);
}

.species-search-clear-btn {
  position: absolute;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.2rem 0.3rem;
  margin: 0;
  width: auto;
  cursor: pointer;
  color: #8aab93;
  font-size: 0.82rem;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.15s ease;
}

.species-search-clear-btn:hover {
  color: #1a3a24;
}

.species-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #c6d9cb;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.species-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #1a3a24;
  border-bottom: 1px solid #f0f5f1;
  transition: background 0.1s ease;
}

.species-autocomplete-item:last-child {
  border-bottom: none;
}

.species-autocomplete-item:hover,
.species-autocomplete-item.active {
  background: #eaf4ee;
}

.species-autocomplete-item i {
  color: #7a9a83;
  font-size: 0.78rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

.species-autocomplete-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.species-autocomplete-match {
  font-weight: 600;
}

.species-autocomplete-type {
  font-size: 0.72rem;
  color: #8aab93;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.species-modal-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-shrink: 0;
}

.species-modal-bulk-actions {
  display: flex;
  gap: 0.35rem;
}

.species-modal-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  margin-top: 0;
  width: auto;
  border: 1px solid #c6d9cb;
  border-radius: 5px;
  background: #f2f8f4;
  color: #2d5a3d;
  font-size: 0.76rem;
  cursor: pointer;
  transition:
    background 0.13s ease,
    border-color 0.13s ease;
}

.species-modal-bulk-btn:hover {
  background: #e2f0e7;
  border-color: #9dbfa8;
}

.species-modal-bulk-btn i {
  font-size: 0.72rem;
}

.species-selection-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  background: #e7f1f8;
  color: #0f4c7a;
  border: 1px solid #c0d8ea;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.species-selection-badge:empty {
  display: none;
}

.species-modal-footer {
  flex-shrink: 0;
  padding-top: 0.75rem;
  border-top: 1px solid #eeeeee;
  margin-top: 0.75rem;
}

.btn-modal-cancel {
  padding: 0.45rem 1rem !important;
  border: 1px solid #c6c6c6 !important;
  border-radius: 6px !important;
  background: #f5f5f5 !important;
  color: #333 !important;
  cursor: pointer !important;
  font-size: 0.88rem !important;
  transition: background 0.13s ease !important;
  width: auto !important;
  margin-top: 0 !important;
}

.btn-modal-cancel:hover {
  background: #e8e8e8 !important;
}

.btn-modal-apply {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  padding: 0.45rem 1.1rem !important;
  border: none !important;
  border-radius: 6px !important;
  background: #1a5c36 !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  width: auto !important;
  margin-top: 0 !important;
  transition: background 0.13s ease !important;
}

.btn-modal-apply:hover {
  background: #145029 !important;
}

.btn-modal-apply i {
  font-size: 0.82rem;
}

/* ---------- Layer Type modal ---------- */
.layer-type-modal-card {
  width: min(420px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.layer-type-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #4a6359 0%, #29382b 100%);
  color: #fff;
  border-radius: 10px 10px 0 0;
}

.layer-type-modal-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.layer-type-modal-header-title h3 {
  margin: 0;
  font-size: 1rem;
}

.layer-type-modal-body {
  padding: 0.75rem 1rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.layer-type-modal-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e8e8e8;
}

.species-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
  flex-shrink: 0;
}

.species-group-tab-btn {
  width: auto;
  margin-top: 0;
  padding: 0.26rem 0.6rem;
  border: 1px solid #c6d9cb;
  border-radius: 999px;
  background: #f2f8f4;
  color: #2d5a3d;
  font-size: 0.76rem;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.species-group-tab-btn:hover {
  background: #e2f0e7;
  border-color: #9dbfa8;
}

.species-group-tab-btn.is-active {
  border-color: #1a5c36;
  background: #1a5c36;
  color: #fff;
  font-weight: 700;
}

.species-group-section {
  border: 1px solid #d8e4ee;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  background: #f4f8fb;
}

.species-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 4px;
}

.species-group-section.open > .species-group-header {
  border-bottom: 1px solid #d8e4ee;
  border-radius: 4px 4px 0 0;
}

.species-group-toggle {
  border: none;
  background: transparent;
  padding: 0.2rem 0;
  text-align: left;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #0f4c7a;
}

.species-group-chevron {
  font-size: 0.7rem;
  transition: transform 0.18s ease;
}

.species-group-section.open .species-group-chevron {
  transform: rotate(90deg);
}

.species-group-panel {
  display: none;
  padding: 0.4rem 0.4rem 0.1rem 0.6rem;
}

.species-group-section.open > .species-group-panel {
  display: block;
}

.species-count-badge {
  font-size: 0.73rem;
  font-weight: 400;
  color: #555;
  background: #dce8f2;
  border-radius: 10px;
  padding: 0.08rem 0.38rem;
  margin-left: 0.1rem;
}

.species-modal-list {
  border: 1px solid #d8e8dd;
  border-radius: 6px;
  min-height: 130px;
  max-height: 420px;
  overflow: auto;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: #fafcfa;
  flex: 1 1 0;
}

.species-family-card {
  border: 1px solid #d8e8dd;
  border-radius: 6px;
  margin-bottom: 0.45rem;
  background: #fff;
  transition: border-color 0.15s ease;
}

.species-family-card:hover {
  border-color: #b0ceba;
}

.species-family-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: #f6faf7;
  border-radius: 6px 6px 0 0;
}

.species-family-card:not(.open) .species-family-header {
  border-radius: 6px;
}

.species-family-toggle {
  border: none;
  background: transparent;
  padding: 0.15rem 0;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1f3d28;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
}

.species-family-toggle:hover {
  color: #1a5c36;
}

.species-family-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.species-family-actions button {
  padding: 0.18rem 0.42rem;
  font-size: 0.74rem;
  border: 1px solid #c6d9cb;
  border-radius: 4px;
  background: #fff;
  color: #2d5a3d;
  cursor: pointer;
  transition: background 0.12s ease;
}

.species-family-actions button:hover {
  background: #e2f0e7;
  border-color: #9dbfa8;
}

.species-family-panel {
  display: none;
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid #e2ede5;
  padding: 0.5rem 0.6rem;
  background: #fafcfa;
  border-radius: 0 0 6px 6px;
}

.species-family-card.open .species-family-panel {
  display: block;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.modal-actions-start {
  justify-content: flex-start;
  align-items: center;
}

#map {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--sidebar-width);
  width: 14px;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  cursor: col-resize;
  z-index: 1230;
}

.sidebar-resize-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(24, 56, 78, 0.18);
}

.main-with-sidebar.is-resizing,
.main-with-sidebar.is-resizing * {
  user-select: none;
}

.map-fullscreen-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 1210;
  border: 1px solid #c6c6c6;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 0.35rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.main-with-sidebar:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.main-with-sidebar:fullscreen .sidebar,
.main-with-sidebar:fullscreen .content {
  border-radius: 0;
}

.main-with-sidebar:fullscreen #map {
  height: 100vh;
  min-height: 0;
}

/* Keep map UI controls under the sticky site header/navigation. */
.leaflet-top,
.leaflet-bottom,
.leaflet-control {
  z-index: 700 !important;
}

/* Zoom controls sit bottom-left, centred horizontally with the FAB stack. */
.content .leaflet-bottom.leaflet-left .leaflet-control-zoom {
  margin-left: calc(
    var(--map-quick-left) + ((var(--map-quick-size) - 30px) / 2)
  );
  margin-bottom: 12px;
}

/* Attribution sits bottom-left below the zoom controls */
.content .leaflet-bottom.leaflet-left .leaflet-control-attribution {
  margin-left: 10px;
  font-size: 0.65rem;
}

/* ── Area legend slide-out drawer (bottom-right of map) ───────────────────── */

.area-legend-drawer {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 1215;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.area-legend-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(10, 26, 36, 0.18);
  color: #1f3d53;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.area-legend-tab:hover {
  background: #fff;
}

.area-legend-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(10, 26, 36, 0.18);
  width: max-content;
  min-width: 140px;
}

.area-legend-drawer.open .area-legend-tab {
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -2px 8px rgba(10, 26, 36, 0.18);
}

.area-legend-drawer.open .area-legend-body {
  max-height: 280px;
  opacity: 1;
  padding: 8px 14px;
  overflow-y: auto;
  border-radius: 0 0 8px 8px;
}

.area-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.78rem;
  color: #1f3d53;
  line-height: 1.4;
}

.area-legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.map-scroll-zoom-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 28, 0.88);
  color: #ffffff;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  font-size: 2rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 900;
}

.map-scroll-zoom-hint.visible {
  opacity: 1;
}

.sighting-panel-filters {
  padding-bottom: 0.5rem;
}

.sightings-filter-section {
  padding-bottom: 0.5rem;
}

.sightings-filter-heading {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.feature-panel-type {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #666;
}

.feature-panel-title {
  margin: 0.15rem 0 0.65rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

.feature-panel-body {
  display: grid;
  gap: 0.6rem;
}

.feature-card {
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.feature-card-heading {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

.feature-panel-row {
  border-top: 1px solid #ececec;
  padding-top: 0.35rem;
  margin-top: 0.35rem;
}

.feature-panel-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #757575;
}

.feature-panel-value {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
  color: #1f1f1f;
  word-break: break-word;
}

.feature-panel-empty {
  margin: 0.2rem 0 0;
  color: #666;
  font-size: 0.9rem;
}

.feature-type-icon {
  color: #4a4a4a;
}

.feature-panel-icon {
  color: #7a7a7a;
  min-width: 0.9rem;
}

.feature-panel-org-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.feature-panel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: #f4f4f4;
  color: #1f1f1f;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.feature-panel-btn:hover {
  background: #e8e8e8;
  border-color: #b8b8b8;
  color: #1f1f1f;
  text-decoration: none;
}

.feature-source-badge {
  margin-left: auto;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #d3d3d3;
  background: #f2f2f2;
  color: #444;
  letter-spacing: 0.03em;
}

.feature-source-badge.source-ebird {
  background: #e8f2ff;
  border-color: #b7d4ff;
  color: #1b4e8a;
}

.feature-source-badge.source-nbn {
  background: #e9f7ef;
  border-color: #b9e2c9;
  color: #1f6b3c;
}

.sighting-leaflet-tooltip {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sighting-leaflet-tooltip::before {
  display: none !important;
}

.sighting-point-tooltip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 180px;
  max-width: 320px;
  padding: 0.45rem 0.65rem;
  background: #fff;
  border: 1px solid #c8dece;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.sighting-tooltip-sil {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.7;
}

.sighting-tooltip-text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.sighting-point-tooltip p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.25;
}

.sighting-tooltip-sci {
  color: #667;
  font-style: italic;
}

.sighting-tooltip-date {
  font-size: 0.75rem !important;
  color: #5a7a63;
}

.sighting-tooltip-date i {
  font-size: 0.68rem;
  margin-right: 0.15rem;
}

/* ── POI Details Floating Popup ─────────────────────────────── */

.poi-popup {
  position: absolute;
  z-index: 1300;
  width: 300px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96) translateY(6px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

/* Arrow tail pointing down toward the data point */
.poi-popup::before,
.poi-popup::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  width: 0;
  height: 0;
}

/* shadow triangle — slightly larger, sits behind the white one */
.poi-popup::before {
  bottom: -13px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 11px solid rgba(0, 0, 0, 0.18);
}

/* white triangle — base flush with popup bottom, tip points down */
.poi-popup::after {
  bottom: -10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #fff;
}

/* tail-up: popup is below the point, arrow points upward */
.poi-popup.tail-up::before {
  bottom: auto;
  top: -13px;
  border-top: none;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 11px solid rgba(0, 0, 0, 0.18);
}

.poi-popup.tail-up::after {
  bottom: auto;
  top: -10px;
  border-top: none;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #29382b;
}

.poi-popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.poi-popup-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: #29382b;
  color: #fff;
  flex-shrink: 0;
  border-radius: 10px 10px 0 0;
}

.poi-popup-silhouette {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: invert(1);
  opacity: 0.55;
  align-self: center;
}

.poi-popup-silhouette-placeholder {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
}

.poi-popup-silhouette-placeholder i {
  font-size: 1rem;
}

.poi-popup-header-text {
  flex: 1;
  min-width: 0;
}

.poi-popup-type {
  margin: 0 0 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.poi-popup-type .feature-type-icon {
  color: rgba(255, 255, 255, 0.72);
}

.poi-popup-type .feature-source-badge {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.poi-popup-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poi-popup-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.poi-popup-subtitle:empty {
  display: none;
}

.poi-popup-close-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: -2px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 1rem;
}

.poi-popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.poi-popup-body {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.poi-popup-body a {
  color: #29382b;
  font-weight: 600;
}

.poi-popup-body .feature-card {
  background: #f7f9f7;
}

@media (max-width: 400px) {
  .poi-popup {
    width: calc(100vw - 20px);
  }
}

/* ── Sighting Detail Bottom Pane ─────────────────────────────── */

.sighting-bottom-pane {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: #fff;
  border-top: 3px solid #4a7c4e;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.16);
  max-height: 48%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.sighting-bottom-pane.open {
  transform: translateY(0);
}

.sighting-pane-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #29382b;
  color: #fff;
  flex-shrink: 0;
}

.sighting-pane-icon {
  font-size: 0.9rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.sighting-pane-topbar .feature-panel-type {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}

.sighting-pane-title {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sighting-pane-close-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.sighting-pane-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sighting-pane-body {
  padding: 0.75rem 1rem;
  overflow-y: auto;
  flex: 1;
}

.sighting-detail-split {
  display: grid;
  grid-template-columns: 20% 80%;
  gap: 0.75rem;
}

.sighting-detail-meta {
  border-right: 1px solid #ececec;
  padding-right: 0.55rem;
}

.sighting-meta-heading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.sighting-meta-heading .feature-card-heading {
  margin: 0;
}

.sighting-detail-row {
  margin-bottom: 0.4rem;
}

.sighting-detail-row .feature-panel-value {
  font-size: 0.82rem;
}

.sighting-detail-row .feature-panel-value a {
  font-size: 0.82rem;
}

.sighting-silhouette-wrap {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.18rem;
}

.sighting-silhouette-image {
  width: 100%;
  max-width: 150px;
  max-height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.sighting-silhouette-attribution {
  margin: 0;
  font-size: 0.7rem;
  color: #666;
}

.sighting-silhouette-empty {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #666;
}

.sighting-detail-trend {
  min-width: 0;
}

.sighting-trend-loading {
  margin: 0.2rem 0;
  color: #666;
  font-size: 0.8rem;
}

.sighting-trend-table-horizontal {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  table-layout: fixed;
}

.sighting-trend-table-horizontal th,
.sighting-trend-table-horizontal td {
  padding: 0.2rem 0.28rem;
  border-bottom: 1px solid #efefef;
  text-align: center;
}

.sighting-trend-table-horizontal th:first-child,
.sighting-trend-table-horizontal td:first-child {
  text-align: left;
  width: 56px;
  white-space: nowrap;
}

.sighting-trend-count-cell {
  font-weight: 600;
}

.sighting-trend-bar-cell {
  height: 54px;
  vertical-align: bottom;
}

.sighting-trend-vbar-track {
  width: 14px;
  height: 44px;
  margin: 0 auto;
  border-radius: 999px;
  background: #ececec;
  display: flex;
  align-items: flex-end;
}

.sighting-trend-vbar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 999px;
  background: #2f8f2f;
}

@media (max-width: 768px) {
  .sighting-detail-split {
    grid-template-columns: 1fr;
  }

  .sighting-detail-meta {
    border-right: 0;
    border-bottom: 1px solid #ececec;
    padding-right: 0;
    padding-bottom: 0.4rem;
  }
}

/* Card grid inside main content */
.card-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background-color: #fafafa;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  padding: 1rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.reserves-hero-card {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1.2rem 1.3rem;
  border-radius: 12px;
  border: 1px solid #dad4ca;
  background:
    linear-gradient(110deg, rgba(43, 50, 45, 0.95), rgba(66, 105, 44, 0.86)),
    radial-gradient(
      circle at right top,
      rgba(255, 231, 188, 0.26),
      transparent 60%
    );
  color: #f4f5f2;
  box-shadow: 0 8px 24px rgba(17, 24, 20, 0.16);
}

.reserves-hero-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
}

.reserves-hero-brand:has(img[hidden]) {
  display: none;
}

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

.reserves-hero-logo {
  width: auto;
  height: auto;
  max-height: 100px;
  max-width: 110px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  padding: 0.25rem;
}

.reserves-hero-org {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ecebdc;
}

.reserves-hero-title {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}

.reserves-hero-card .hint {
  color: #ecece5;
}

.reserves-hero-tagline {
  margin-top: 0.7rem;
  font-size: 1.02rem;
  max-width: 72ch;
  line-height: 1.45;
  color: #f6f6ef;
}

.reserves-chip-row {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.reserves-chip {
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 0.26rem 0.62rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.reserves-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.reserves-left-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.reserves-story-card {
  flex: 1;
  min-height: 0;
}

.reserves-features-card {
  flex: 0 0 auto;
}

.reserves-story-card,
.reserves-wildlife-card,
.reserves-features-card,
.reserves-visit-card,
.reserves-technical-card {
  border-radius: 12px;
  border: 1px solid #ddd8ce;
  background: linear-gradient(180deg, #fdfdfb, #f7f7f2);
}

.reserves-story-card h2,
.reserves-wildlife-card h2,
.reserves-features-card h2,
.reserves-visit-card h2 {
  margin-bottom: 0.6rem;
  color: #2e3a2d;
}

/* Visit card heading accent */
.reserves-visit-heading {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #1e3621;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #b0cfa8;
  margin-bottom: 0.75rem;
}

.reserves-copy {
  margin-bottom: 0.75rem;
  line-height: 1.56;
  color: #26312b;
}

.reserves-fact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.reserves-fact-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #21401f;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reserves-fact-value {
  margin-top: 0.1rem;
  color: #252c27;
  word-break: break-word;
}

.reserves-fact-address {
  white-space: pre-line;
  line-height: 1.55;
}

.reserves-link-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.reserves-link-row a {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.7rem;
  border: 1px solid #b9c7b6;
  border-radius: 7px;
  background: #eef7eb;
  color: #21401f;
  text-decoration: none;
  font-size: 0.86rem;
}

.reserves-link-row a:hover {
  background: #dcefd6;
}

.reserves-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.reserves-pill {
  border: 1px solid #cfdcc9;
  background: #edf5e8;
  color: #2f412c;
  border-radius: 999px;
  padding: 0.2rem 0.56rem;
  font-size: 0.82rem;
}

.reserves-species-group-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f695e;
  margin: 0.6rem 0 0.25rem;
  width: 100%;
}

.reserves-pill-list .reserves-pill-list {
  width: 100%;
}

.reserves-wildlife-card h3 {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: #4a5447;
}

.reserves-feature-list {
  display: grid;
  gap: 0.6rem;
  width: 100%;
}

.reserves-feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  padding: 0.8rem 0.5rem 0.7rem;
  border: 1px solid #ddd8ce;
  border-radius: 10px;
  background: #fafaf8;
  text-align: center;
}

.reserves-feature-card--absent {
  opacity: 0.38;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a7a52;
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.reserves-feature-card--absent .feature-icon {
  color: #8a9a8a;
}

.feature-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: #2e3a2d;
  line-height: 1.25;
  word-break: break-word;
}

.feature-value {
  font-size: 0.68rem;
  color: #6b7a6b;
  line-height: 1.2;
}

.reserves-map-card {
  grid-column: 1 / -1;
}

.status-page {
  display: grid;
  gap: 1rem;
}

.status-hero-card h1 {
  margin-bottom: 0.4rem;
}

.status-card h2 {
  margin-bottom: 0.6rem;
}

.status-table th,
.status-table td {
  padding: 0.55rem 0.45rem;
}

.status-table td:first-child {
  font-weight: 600;
}

.status-health-badge {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.status-health-on-schedule {
  color: #1f5a2c;
  background: #e7f6e8;
  border-color: #8bcc94;
}

.status-health-late {
  color: #805200;
  background: #fff2dd;
  border-color: #e8b264;
}

.status-health-unknown {
  color: #4f4f4f;
  background: #efefef;
  border-color: #c9c9c9;
}

.reserves-map-hint {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
}

.reserves-map-wrap {
  position: relative;
  margin-bottom: 1rem;
}

#reserve-static-map {
  width: 100%;
  min-height: 340px;
  border: 1px solid #d9d9cf;
  border-radius: 10px;
  overflow: hidden;
}

.reserves-map-explore-link {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  z-index: 500;
  cursor: pointer;
}

.reserves-map-explore-link::after {
  content: "View on map \2197";
  position: absolute;
  bottom: 0.5rem;
  right: 0.6rem;
  background: rgba(255, 255, 255, 0.88);
  color: #1e3621;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  pointer-events: none;
}

.reserves-nearby-section {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e0dbd4;
}

.reserves-nearby-map {
  width: 100%;
  height: 200px;
  border: 1px solid #d9d9cf;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.reserves-nearby-heading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a5e48;
  margin-bottom: 0.55rem;
}

.reserves-nearby-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reserves-nearby-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.reserves-nearby-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #21401f;
  text-decoration: none;
}

.reserves-nearby-name:hover {
  text-decoration: underline;
}

.reserves-nearby-meta {
  font-size: 0.75rem;
  color: #6b7a69;
}

.reserve-map-point {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
}

.reserves-technical-card details {
  width: 100%;
}

.reserves-technical-card summary {
  cursor: pointer;
  font-weight: 600;
  color: #2f3a2d;
}

.reserve-details-table {
  margin-top: 0.9rem;
  table-layout: fixed;
}

.reserve-details-table td {
  word-break: break-word;
}

.reserve-details-table th:first-child,
.reserve-details-table td:first-child {
  width: 35%;
}

.reserves-directory-layout {
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 1rem;
}

.reserves-directory-sidebar {
  border: 1px solid #ddd8ce;
  border-radius: 12px;
  background: linear-gradient(180deg, #fdfdfb, #f7f7f2);
  padding: 0.85rem;
  align-self: start;
}

.reserves-directory-sidebar h2 {
  margin-bottom: 0.6rem;
  color: #2f3a2d;
}

.reserves-filter-label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.55rem;
  color: #4a5447;
}

.reserves-filter-label input,
.reserves-filter-label select {
  display: block;
  width: 100%;
  margin-top: 0.22rem;
  padding: 0.42rem 0.48rem;
  border: 1px solid #d4d4cf;
  border-radius: 6px;
  background: #fff;
}

.reserves-filter-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.reserves-filter-actions button {
  border: 1px solid #c6d4bf;
  border-radius: 6px;
  background: #edf6ea;
  color: #22401f;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

.reserves-directory-content {
  border: 1px solid #ddd8ce;
  border-radius: 12px;
  background: linear-gradient(180deg, #fdfdfb, #f7f7f2);
  padding: 0.85rem;
}

.reserves-directory-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.reserves-directory-card {
  border: 1px solid #dfe4da;
  border-radius: 9px;
  background: #fafcf8;
  padding: 0.62rem;
  display: grid;
  gap: 0.42rem;
}

.reserves-directory-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #26312b;
}

.reserves-directory-meta {
  font-size: 0.78rem;
  color: #5f695e;
}

.reserves-directory-address {
  font-size: 0.84rem;
  color: #3b443f;
  min-height: 2.2em;
}

.reserves-directory-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bdccb7;
  border-radius: 7px;
  padding: 0.32rem 0.55rem;
  background: #ecf5e8;
  color: #22401f;
  text-decoration: none;
  font-size: 0.82rem;
}

.reserves-directory-link:hover {
  background: #dcefd6;
}

#reserve-detail-hero[hidden],
#reserve-content[hidden],
#reserve-technical[hidden],
#reserve-directory-layout[hidden] {
  display: none !important;
}

/* Reserve gallery */
.reserves-gallery-card {
  grid-column: 1 / -1;
}

.reserves-gallery-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.reserves-gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
}

.reserves-gallery-img {
  height: 300px;
  width: auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd8ce;
  display: block;
}

.reserves-gallery-caption {
  font-size: 0.72rem;
  color: #6b6b63;
  margin-top: 0.3rem;
  line-height: 1.3;
}

.reserves-gallery-caption a {
  color: inherit;
  text-underline-offset: 2px;
}

/* Inline gallery (inside About The Reserve card) */
.reserves-inline-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.inline-gallery-thumb {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  background: #e4e4dc;
  outline-offset: 2px;
}

.inline-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease;
}

@media (hover: hover) and (pointer: fine) {
  .inline-gallery-thumb:hover img {
    transform: scale(1.06);
  }
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.gallery-lightbox.lb-open {
  opacity: 1;
  visibility: visible;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 9, 0.92);
}

.lb-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 80vh;
}

.lb-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.lb-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lb-close svg {
  width: 16px;
  height: 16px;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.lb-prev:hover,
.lb-next:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lb-prev svg,
.lb-next svg {
  width: 20px;
  height: 20px;
}

.lb-prev {
  left: 1rem;
}

.lb-next {
  right: 1rem;
}

.lb-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 1.5rem 1rem 0.85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.lb-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.lb-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.72rem;
  opacity: 0.72;
}

.lb-meta a {
  color: inherit;
  text-underline-offset: 2px;
}

.lb-counter {
  font-variant-numeric: tabular-nums;
}

/* Reserve AI summary note */
.reserves-ai-note {
  font-size: 0.75rem;
  color: #7a8c7a;
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-style: italic;
}

/* Reserve sightings */
.reserves-sightings-card {
  grid-column: 1 / -1;
}

.reserves-sightings-hint {
  margin-top: 0;
}

.reserves-sightings-wrap {
  overflow-x: auto;
}

.reserves-sightings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 520px;
}

.reserves-sightings-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b6b63;
  border-bottom: 2px solid #ddd8ce;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

.reserves-sightings-table td {
  padding: 0.42rem 0.5rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  color: #252c27;
}

.reserves-sightings-table tr:last-child td {
  border-bottom: none;
}

.reserves-sightings-table tr:hover td {
  background: rgba(0, 0, 0, 0.025);
}

.reserves-sightings-count {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.reserves-species-thumb {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #ddd8ce;
  display: block;
}

.reserves-sightings-sci {
  font-style: italic;
  font-size: 0.78rem;
  color: #5f695e;
}

.sightings-folded {
  display: none;
}

.sightings-show-more {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1px solid #8c6239;
  border-radius: 6px;
  color: #8c6239;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.sightings-show-more:hover {
  background: #8c6239;
  color: #fff;
}

/* 5. Footer */
.footer {
  background-color: #222;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 4fr; /* 25% / 75% ratio */
  gap: 1.5rem;
  padding: 1.5rem;
  padding-top: 0;
  padding-bottom: 0;
  align-items: center;
  /* border-bottom: 1px solid #fff; */
  height: 200px;
}

.footer__logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;

  margin-bottom: 0.5rem;
  align-items: flex-end;
}

.footer__logo > a > img {
  max-height: 80px;
}

.footer__info {
  font-size: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.footer-card-grid {
  width: 100%;
  justify-content: center;
  display: grid;
  grid-template-columns: 1fr 3fr;
}

.footer-card {
  display: inline-flex;
  justify-content: left;
  text-decoration: none;
  padding: 1rem;
  align-items: center;
  width: 100%;
}

.footer-card-text {
  display: inline-flex;
  justify-content: right;
  text-decoration: none;
  padding: 1rem;
  align-items: center;
  width: 100%;
}

.footer-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 60px;
  height: 60px;
}

.footer-icon-link > i {
  color: #fff;
}

.footer-icon-link > i:hover {
  color: #8c6239;
}

/* Responsive behaviour */
@media (max-width: 1500px) {
  .content {
    --map-quick-left: max(23px, env(safe-area-inset-left));
  }

  /* Let cards resize better on medium screens */
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .hero {
    grid-template-columns: auto 1fr;
    column-gap: 0.6rem;
    row-gap: 0;
    max-height: none;
    padding: 0.35rem 0.6rem;
    align-items: center;
  }

  .logo {
    width: auto;
    justify-content: flex-start;
    align-items: center;
  }

  .logo > a > img {
    width: auto;
    max-width: 170px;
    max-height: 58px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .main-with-sidebar {
    grid-template-columns: 1fr;
  }

  /* On mobile the sidebar is position:fixed (not a grid item), so the
     fullscreen rule's 2-column grid would place .content into column 1
     (320px wide), leaving a black bar on the right. Force single column. */
  .main-with-sidebar:fullscreen {
    grid-template-columns: 1fr;
  }

  .sidebar-resize-handle {
    display: none;
  }

  .content {
    min-height: 0;
    border-radius: 0;
  }

  #map {
    min-height: 0;
    height: 100%;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 100vw;
    min-width: 100dvw;
    max-width: 100vw;
    max-width: 100dvw;
    margin: 0;
    z-index: 2400;
    border-radius: 16px 16px 0 0;
    border-top: 1px solid #d6d6d6;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -12px 32px rgba(13, 27, 37, 0.24);
    transform: translateY(102%);
    transition: transform 0.18s ease;
    overflow-y: auto;
    overflow-x: hidden;
    height: min(82vh, 760px);
    max-height: min(82vh, 760px);
    min-height: 320px;
    padding-top: 0.45rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .sidebar.mobile-sheet-dragging {
    transition: none;
    overflow: hidden;
  }

  .sidebar > h2 {
    display: none;
  }

  .sidebar-mobile-header {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
    touch-action: none;
  }

  .mobile-sheet-grab-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 0.4rem;
  }

  .mobile-sheet-grab {
    width: 48px;
    height: 6px;
    border-radius: 999px;
    border: 0;
    background: #bcc6cd;
    cursor: pointer;
    touch-action: none;
  }

  .mobile-sheet-grab:focus-visible {
    outline: 2px solid #2e77aa;
    outline-offset: 3px;
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2300;
    background: rgba(18, 24, 24, 0.42);
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateY(0);
  }

  body.mobile-sidebar-open .mobile-sidebar-backdrop {
    display: block;
  }

  body.mobile-sidebar-open {
    overflow: hidden;
  }

  .map-fullscreen-btn {
    top: 12px;
  }

  body.mobile-sidebar-open .mobile-map-fab-stack,
  body.species-modal-open .mobile-map-fab-stack {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-map-fab-stack {
    left: var(--map-quick-left);
    top: 12px;
    right: auto;
    bottom: auto;
  }

  .leaflet-bottom {
    bottom: 4px !important;
  }

  .mobile-map-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #bac9d3;
    background: rgba(255, 255, 255, 0.96);
    color: #1f3d53;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(10, 26, 36, 0.22);
  }

  .mobile-map-fab-icon {
    width: 20px;
    height: 20px;
  }

  .reserves-directory-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .reserves-content-grid {
    grid-template-columns: 1fr;
  }

  .main-with-sidebar {
    grid-template-columns: 1fr; /* Stack sidebar and content */
  }

  #map {
    height: 100%;
    min-height: 0;
  }

  .footer {
    grid-template-columns: 1fr;
    height: auto;
    padding: 0.85rem;
    gap: 0.5rem;
  }

  .footer__logo {
    justify-content: flex-start;
    margin-bottom: 0;
  }

  .footer-card-grid {
    grid-template-columns: 1fr;
  }

  .footer-card,
  .footer-card-text {
    justify-content: flex-start;
    padding: 0.35rem 0;
  }

  .footer-icon-link {
    width: 44px;
    height: 44px;
  }
}

/* Mobile sidebar: square top corners so it looks the same width as the
   three slide-up panels (which have their rounded corners clipped by
   .content's overflow:hidden). The grab handle still signals "bottom sheet".
   Also drop the dvw/vw width constraints – left:0; right:0 from the existing
   inset rule is sufficient and avoids a right-side gap on Android Chrome where
   dvw can be narrower than the actual viewport. */
@media (max-width: 1500px) {
  .sidebar {
    border-radius: 0;
    border-top: 3px solid #4a7c4e;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

/* ── Account page ──────────────────────────────────────────────────────────── */

.account-container {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.account-card {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
}

.account-card--wide {
  max-width: 700px;
}

.account-card h2 {
  margin-bottom: 1.2rem;
  color: #29382b;
}

.account-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.account-error {
  background: #fde8e8;
  color: #991b1b;
  border: 1px solid #f3b3b3;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.account-success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.account-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5447;
}

.account-label .account-hint {
  font-weight: 400;
  color: #888;
}

.account-input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid #d4d4cf;
  border-radius: 6px;
  background: #fff;
  font-size: 0.92rem;
  font-family: inherit;
}

.account-input:focus {
  outline: 2px solid #4a7c4e;
  outline-offset: -1px;
}

textarea.account-input {
  resize: vertical;
  min-height: 3.5rem;
}

.account-label--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.account-label--checkbox input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #4a7c4e;
}

.account-label--social {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: 0.5rem;
  align-items: start;
}

.account-label--social i {
  grid-row: 1 / 3;
  align-self: center;
  color: #666;
  font-size: 1.1rem;
}

.account-label--social .account-input {
  grid-column: 2;
}

.account-fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.account-fieldset legend {
  font-weight: 600;
  font-size: 0.88rem;
  color: #4a5447;
  padding: 0 0.4rem;
}

.account-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: #3a6e3e;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.account-btn-primary:hover {
  background: #2e5a31;
}

.account-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid #c6d4bf;
  border-radius: 6px;
  background: #edf6ea;
  color: #22401f;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.account-btn-secondary:hover {
  background: #d6ebd2;
}

.account-form-actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.account-alt-link {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: #666;
  text-align: center;
}

.account-alt-link a {
  color: #3a6e3e;
  text-decoration: underline;
}

.account-empty {
  color: #888;
  font-size: 0.92rem;
  padding: 1.5rem 0;
  text-align: center;
}

.account-empty a {
  color: #3a6e3e;
}

/* Tabs */

.account-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 1.2rem;
}

.account-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.account-tab:hover {
  color: #4a5447;
}

.account-tab.active {
  color: #3a6e3e;
  border-bottom-color: #3a6e3e;
}

/* Avatar */

.account-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.account-avatar-placeholder {
  font-size: 2rem;
  color: #aaa;
}

.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Submissions grid */

.submissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}

.submission-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.submission-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.submission-thumb--empty {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 2rem;
}

.submission-info {
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.submission-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submission-date {
  font-size: 0.78rem;
  color: #888;
}

.submission-notes {
  font-size: 0.78rem;
  color: #991b1b;
  margin-top: 0.2rem;
}

/* Status badges */

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  width: fit-content;
}

.status-badge--pending {
  background: #fff3cd;
  color: #856404;
}

.status-badge--approved {
  background: #d4edda;
  color: #155724;
}

.status-badge--rejected {
  background: #f8d7da;
  color: #721c24;
}

/* ── Public profile page ───────────────────────────────────────────────────── */

.profile-container {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.profile-card {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 640px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar-placeholder {
  font-size: 2.5rem;
  color: #aaa;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity h1 {
  font-size: 1.5rem;
  color: #29382b;
  margin-bottom: 0.2rem;
}

.profile-meta {
  font-size: 0.85rem;
  color: #888;
}

.profile-bio {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #555;
}

.profile-details i {
  width: 1.2rem;
  text-align: center;
  color: #888;
}

.profile-details a {
  color: #3a6e3e;
  text-decoration: none;
}

.profile-details a:hover {
  text-decoration: underline;
}

.profile-social-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.profile-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #edf6ea;
  color: #3a6e3e;
  text-decoration: none;
  transition: background 0.15s;
}

.profile-social-link:hover {
  background: #d6ebd2;
}

.profile-gallery h3 {
  margin-bottom: 0.6rem;
  color: #29382b;
}

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

.profile-gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.profile-message {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}

.profile-message i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

/* ── Account / Profile responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
  .account-card {
    padding: 1.2rem;
  }

  .account-dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .submissions-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* ── Species Directory & Detail Page ──────────────────────────────────────── */

.species-hero-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--card-bg, #1a1a2e);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  align-items: center;
}

.species-hero-media {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.species-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.species-hero-silhouette {
  width: 120px;
  height: 120px;
  object-fit: contain;
  opacity: 0.5;
  filter: invert(1);
}

.species-hero-placeholder {
  font-size: 4rem;
  opacity: 0.2;
}

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

.species-hero-title {
  font-size: 1.8rem;
  margin: 0 0 0.25rem;
  color: var(--text-primary, #fff);
}

.species-hero-sci {
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.75rem;
}

.species-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.species-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

/* Detail content grid */
.species-content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.species-left-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Taxonomy table */
.species-taxonomy-table {
  width: 100%;
  border-collapse: collapse;
}

.species-taxonomy-table th,
.species-taxonomy-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}

.species-taxonomy-table th {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  width: 140px;
}

.species-taxonomy-table td {
  color: var(--text-primary, #fff);
}

/* Stats sidebar */
.species-stats-card {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.species-stats-heading {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.species-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.species-stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.species-stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin: 0.2rem 0 0;
}

.species-link-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.species-link-row a {
  color: var(--accent-color, #64b5f6);
  text-decoration: none;
  font-size: 0.9rem;
}

.species-link-row a:hover {
  text-decoration: underline;
}

/* Gallery */
.species-gallery-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.species-gallery-item {
  flex-shrink: 0;
}

.species-gallery-img {
  height: 200px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.species-gallery-attribution {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.5rem;
}

.species-gallery-attribution a {
  color: rgba(255, 255, 255, 0.6);
}

/* Reserves list */
.species-reserves-card,
.species-related-card {
  grid-column: 1 / -1;
}

.species-reserves-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.species-reserve-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary, #fff);
  transition: background 0.15s;
}

.species-reserve-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.species-reserve-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.species-reserve-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

/* Related species */
.species-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.species-related-pill {
  display: inline-flex;
  flex-direction: column;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-primary, #fff);
  transition: background 0.15s;
}

.species-related-pill:hover {
  background: rgba(255, 255, 255, 0.12);
}

.species-related-com {
  font-size: 0.85rem;
  font-weight: 500;
}

.species-related-sci {
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Species Directory Layout ─────────────────────────────────────────────── */

.species-directory-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.species-directory-sidebar {
  padding: 1rem;
  background: var(--card-bg, #1a1a2e);
  border-radius: 12px;
  align-self: start;
  position: sticky;
  top: 1rem;
}

.species-directory-sidebar h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.species-filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.75rem;
}

.species-filter-label input,
.species-filter-label select {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary, #fff);
  font-size: 0.85rem;
}

.species-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.species-filter-actions button {
  flex: 1;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #fff;
}

.species-filter-actions button:first-child {
  background: var(--accent-color, #64b5f6);
}

.species-filter-actions button:last-child {
  background: rgba(255, 255, 255, 0.12);
}

.species-directory-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.species-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #1a1a2e);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary, #fff);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.species-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.species-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}

.species-card-img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.12);
}

.species-card-body {
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.species-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.species-card-sci {
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
}

.species-card-family {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Pagination */
.species-directory-pagination {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 1.5rem;
  grid-column: 1 / -1;
}

.species-page-btn {
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary, #fff);
  cursor: pointer;
  font-size: 0.85rem;
}

.species-page-btn.active {
  background: var(--accent-color, #64b5f6);
  border-color: var(--accent-color, #64b5f6);
  cursor: default;
}

.species-page-btn:not(.active):hover {
  background: rgba(255, 255, 255, 0.08);
}

.species-page-dots {
  padding: 0.4rem 0.3rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

/* Welsh name */
.species-hero-welsh {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 0.5rem;
}

/* Conservation badges */
.species-conservation-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.species-conservation-badge,
.species-card-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

.species-badge-iucn-CR {
  background: #8b0000;
  color: #fff;
}
.species-badge-iucn-EN {
  background: #d32f2f;
  color: #fff;
}
.species-badge-iucn-VU {
  background: #e65100;
  color: #fff;
}
.species-badge-iucn-NT {
  background: #f9a825;
  color: #000;
}
.species-badge-iucn-LC {
  background: #388e3c;
  color: #fff;
}
.species-badge-iucn-DD {
  background: #757575;
  color: #fff;
}
.species-badge-iucn-EW {
  background: #4a148c;
  color: #fff;
}
.species-badge-iucn-EX {
  background: #000;
  color: #fff;
}
.species-badge-bocc-Red {
  background: #d32f2f;
  color: #fff;
}
.species-badge-bocc-Amber {
  background: #f57c00;
  color: #fff;
}
.species-badge-bocc-Green {
  background: #388e3c;
  color: #fff;
}

.species-uk-protection {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Card badges (directory) */
.species-card-badges {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.species-card-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* About / Wiki summary */
.species-wiki-summary {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.75rem;
}

.species-wiki-attribution {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.species-wiki-attribution a {
  color: rgba(255, 255, 255, 0.55);
}

/* Audio section */
.species-audio-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.species-audio-section audio {
  width: 100%;
  margin-top: 0.4rem;
}

.species-audio-attribution {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0.3rem 0 0;
}

.species-audio-attribution a {
  color: rgba(255, 255, 255, 0.55);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .species-hero-card {
    flex-direction: column;
    text-align: center;
  }

  .species-hero-media {
    width: 150px;
    height: 150px;
  }

  .species-hero-title {
    font-size: 1.4rem;
  }

  .species-chip-row {
    justify-content: center;
  }

  .species-content-grid {
    grid-template-columns: 1fr;
  }

  .species-directory-layout {
    grid-template-columns: 1fr;
  }

  .species-directory-sidebar {
    position: static;
  }

  .species-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .species-reserves-list {
    grid-template-columns: 1fr;
  }

  .species-directory-results {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
