:root {
  --primary-color: #15803d;
  --primary-dark: #166534;
  --primary-light: #22c55e;
  --primary-soft: #dcfce7;
  --accent-color: #e11d48;
  --warning-color: #f59e0b;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Slim Header (42px) */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  height: 42px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2500;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 16px;
  color: var(--primary-color);
  background: var(--primary-soft);
  padding: 5px;
  border-radius: 6px;
}

.brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.sub-title {
  font-size: 12px;
  color: var(--text-muted);
  border-left: 1px solid #cbd5e1;
  padding-left: 8px;
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user-pill {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.header-user-pill:hover {
  background: #dcfce7;
}

.header-user-pill.is-admin-pill {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.apk-size-pill {
  background: #16a34a;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

.btn-burger {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.burger-btn-label {
  font-size: 12px;
  font-weight: 600;
}

.btn-burger:hover,
.btn-burger.active {
  background: var(--primary-soft);
  border-color: #86efac;
  color: var(--primary-dark);
}

.burger-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 12px;
  width: 310px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.22);
  padding: 8px;
  z-index: 2700;
  flex-direction: column;
  gap: 4px;
}

.burger-dropdown-menu.open {
  display: flex;
  animation: slideDown 0.18s ease-out;
}

.burger-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 12px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
}

.burger-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid #f1f5f9;
}

.burger-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.burger-stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

.burger-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
}

.burger-apk-status {
  font-size: 10px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 2px 6px;
  border-radius: 999px;
}

.burger-menu-item {
  width: 100%;
  background: none;
  border: none;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.burger-menu-item i {
  width: 18px;
  text-align: center;
  color: #475569;
}

.burger-menu-item:hover {
  background: #f1f5f9;
}

.burger-apk-item {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  margin-bottom: 2px;
}

.burger-apk-item:hover {
  background: #dcfce7;
}

.burger-admin-item {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.burger-admin-item i {
  color: #dc2626;
}

.burger-admin-item:hover {
  background: #fee2e2;
}

.btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  background: #f1f5f9;
}

.btn-danger {
  background: #dc2626;
  color: white;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-outline-danger {
  background: white;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.btn-outline-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
  gap: 4px;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 42px);
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 380px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 500;
  transition: width 0.25s ease;
}

.sidebar.desktop-collapsed {
  width: 0;
  border-right: none;
}

.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-section.filter-collapsed {
  padding: 12px 20px;
}

.sidebar-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-toggle-btn {
  background: none;
  border: none;
  flex: 1;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.section-toggle-btn:hover {
  background: #f1f5f9;
  color: var(--primary-dark);
}

.section-toggle-btn span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-chevron {
  font-size: 12px;
  color: #64748b;
  transition: transform 0.2s ease;
}

.section-chevron.rotated {
  transform: rotate(180deg);
}

.btn-collapse-sidebar-desktop {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: #64748b;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-collapse-sidebar-desktop:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.filter-section-content {
  margin-top: 12px;
}

.filter-section-content.collapsed {
  display: none !important;
}

.form-group {
  margin-bottom: 10px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  background-color: #ffffff;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

/* Timespan and Date Filters */
.timespan-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.form-group-half {
  flex: 1;
  min-width: 0;
}

.form-group-half label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.quick-years {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.quick-year-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-year-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.quick-year-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

.btn-clear-filters {
  background: transparent;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-clear-filters:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
}

/* Problem Rise Trend Visualizer */
.trend-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 6px;
}

.trend-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.trend-bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  min-height: 40px;
  padding-top: 4px;
}

.trend-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 2px 0;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.trend-bar-item:hover {
  background: #e2e8f0;
}

.trend-bar-item.active .trend-bar-fill {
  background: #b91c1c;
}

.trend-bar-item.active .trend-year-label {
  font-weight: 700;
  color: var(--primary-dark);
}

.trend-bar-fill {
  width: 100%;
  max-width: 24px;
  background: #22c55e;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.3s ease, background 0.2s ease;
}

.trend-count-label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
}

.trend-year-label {
  font-size: 10px;
  color: #64748b;
}

.list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.observations-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}

.obs-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  background: white;
  transition: all 0.15s ease;
}

.obs-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  background: #fdfdfd;
}

.obs-thumbnail {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
}

.obs-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.obs-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.obs-sciname {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
}

.obs-meta {
  font-size: 11px;
  color: #475569;
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.obs-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  align-self: flex-start;
}

.sidebar-footer {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

.verification-badge-box {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: #334155;
  background: #f0fdf4;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
}

.text-success {
  color: #16a34a;
  font-size: 18px;
  margin-top: 2px;
}

/* Map */
.map-container {
  flex: 1;
  height: 100%;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.map-controls-floating {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}

.map-jump-btn {
  background: white;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  color: #334155;
}
.map-jump-btn:hover {
  background: #f8fafc;
  color: var(--primary-color);
}

.map-legend {
  position: absolute;
  bottom: 25px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  z-index: 1000;
  font-size: 11px;
  overflow: hidden;
}

.legend-toggle-btn {
  background: none;
  border: none;
  width: 100%;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-transform: uppercase;
}

.legend-toggle-btn:hover {
  background: #f1f5f9;
}

.legend-chevron {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.legend-chevron.rotated {
  transform: rotate(180deg);
}

.legend-content {
  padding: 0 12px 10px 12px;
}

.legend-content.collapsed {
  display: none !important;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-extreme { background-color: #dc2626; }
.dot-high { background-color: #ea580c; }
.dot-medium { background-color: #ca8a04; }
.dot-review {
  background-color: #f59e0b;
  border: 2px solid #991b1b;
  color: #78350f;
  width: 14px;
  height: 14px;
  font-size: 9px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Custom Leaflet Marker */
.custom-bio-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
  border: 2px solid white;
  transition: transform 0.2s;
  cursor: pointer;
}

.custom-bio-marker:hover {
  transform: scale(1.25);
  z-index: 9999 !important;
}

.marker-danger-extreme { background: #dc2626; }
.marker-danger-high { background: #ea580c; }
.marker-danger-medium { background: #ca8a04; }

/* Admin Special Marker Highlight for Low Confidence or Manual Species Selection */
@keyframes adminReviewPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.85), 0 0 8px rgba(0, 0, 0, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0), 0 0 8px rgba(0, 0, 0, 0.45);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0), 0 0 8px rgba(0, 0, 0, 0.45);
  }
}

.custom-bio-marker.marker-needs-review {
  border: 3px dashed #fde047;
  outline: 2px solid #b45309;
  animation: adminReviewPulse 2s infinite;
}

.marker-review-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f59e0b;
  color: #ffffff;
  border: 2px solid #78350f;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.cluster-review-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f59e0b;
  color: #ffffff;
  border: 2px solid #78350f;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  z-index: 6;
}

.obs-card.obs-card-needs-review {
  border-color: #f59e0b;
  background: #fffbeb;
}

.obs-review-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #f59e0b;
  padding: 2px 6px;
  border-radius: 999px;
}

.obs-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Leaflet MarkerCluster Custom Styling */
.bio-cluster-wrapper {
  background: none;
  border: none;
}

.bio-cluster-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.95);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
}

.bio-cluster-icon::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  opacity: 0.35;
  z-index: -1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.bio-cluster-icon:hover {
  transform: scale(1.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.bio-cluster-icon:hover::after {
  transform: scale(1.15);
  opacity: 0.55;
}

/* Cluster color coding by highest neophyte danger level */
.bio-cluster-icon.cluster-extreme {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}
.bio-cluster-icon.cluster-extreme::after {
  background: #ef4444;
}

.bio-cluster-icon.cluster-high {
  background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
}
.bio-cluster-icon.cluster-high::after {
  background: #f97316;
}

.bio-cluster-icon.cluster-medium {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}
.bio-cluster-icon.cluster-medium::after {
  background: #22c55e;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 720px;
  max-height: 90vh;
  border-radius: 12px;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.modal-large {
  max-width: 960px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover {
  color: #0f172a;
}

/* Observation Detail Card inside Modal */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.detail-photo-box {
  display: flex;
  flex-direction: column;
}

.detail-photo {
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #000;
}

.photo-badge-bar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.attestation-chip {
  background: #dcfce7;
  color: #15803d;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.species-header h2 {
  font-size: 20px;
  color: #0f172a;
}

.species-header .sciname {
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
}

.meta-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.meta-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.meta-table td {
  padding: 6px 0;
}

.meta-table td:first-child {
  color: var(--text-muted);
  width: 40%;
  font-weight: 600;
}

.meta-table td:last-child {
  color: #0f172a;
  font-weight: 500;
}

.hazard-alert {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 10px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #991b1b;
}

.action-tip {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  padding: 10px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #166534;
}

/* Lexicon Grid */
.lexicon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.lexicon-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lexicon-card h3 {
  font-size: 15px;
  color: #0f172a;
}

.lexicon-card .sciname {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

.lexicon-card p {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

.tips-list {
  font-size: 11px;
  color: #334155;
  padding-left: 16px;
}

.loading-spinner {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Mobile Responsive Design */
.mobile-sidebar-toggle {
  display: none;
}

.mobile-sidebar-toggle.desktop-visible {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  top: 15px;
  left: 55px;
  z-index: 1000;
  background: #ffffff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.mobile-sidebar-toggle.desktop-visible:hover {
  background: #f0fdf4;
}

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

.sidebar-backdrop {
  display: none;
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  /* Header adjustments */
  .app-header {
    height: 42px;
    padding: 0 12px;
    position: relative;
    z-index: 2500;
  }

  .sub-title {
    display: none;
  }

  .brand h1 {
    font-size: 15px;
  }

  .burger-dropdown-menu {
    left: 10px;
    right: 10px;
    width: auto;
  }

  /* Main layout with collapsible drawer sidebar */
  .main-layout {
    position: relative;
    flex: 1;
    display: flex;
    height: calc(100vh - 42px);
    overflow: hidden;
  }

  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 360px;
    background: #ffffff;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid #bbf7d0;
  }

  .btn-close-sidebar {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--primary-dark);
    cursor: pointer;
    padding: 4px 8px;
  }

  .sidebar-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1999;
    display: none;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  /* Floating sidebar toggle button on map */
  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 12px;
    left: 55px;
    z-index: 1000;
    background: #ffffff;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
  }

  .mobile-sidebar-toggle:active {
    background: #f1f5f9;
  }

  /* Floating region jump buttons on mobile */
  .map-controls-floating {
    top: 12px;
    right: 12px;
    gap: 4px;
  }

  .map-jump-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Map Legend on mobile */
  .map-legend {
    bottom: 15px;
    right: 12px;
    max-width: 240px;
  }

  .btn-collapse-sidebar-desktop {
    display: none;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
