:root {
  --bg: #101410;
  --panel: #1c231c;
  --accent: #4caf50;
  --text: #e8f0e8;
  --danger: #ef5350;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 16px/1.35 system-ui, sans-serif; }
#map { position: absolute; inset: 0; z-index: 0; }

#topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; gap: 8px; padding: 10px 10px calc(10px);
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(rgba(16,20,16,.92), rgba(16,20,16,0));
}
.top-btn {
  flex: 1; min-height: 48px; border: 0; border-radius: 12px;
  background: var(--panel); color: var(--text); font-size: 15px; font-weight: 600;
}
.badge { background: var(--accent); color: #08130a; border-radius: 10px; padding: 1px 7px; margin-left: 4px; font-size: 13px; }

#gps-state {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 500;
  background: rgba(28,35,28,.92); border-radius: 10px; padding: 4px 12px; font-size: 13px;
}
#gps-state.err { background: #5b1e1e; }

.fab {
  position: absolute; right: 14px; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 1000;
  width: 60px; height: 60px; border-radius: 50%; border: 0;
  background: var(--accent); color: #08130a; font-size: 34px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}

#sheet-backdrop { position: absolute; inset: 0; z-index: 2000; background: rgba(0,0,0,.45); }
#sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2100;
  background: var(--panel); border-radius: 18px 18px 0 0;
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
  max-height: 82vh; overflow-y: auto;
}
#sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-x { min-width: 48px; min-height: 48px; border: 0; background: none; color: var(--text); font-size: 26px; }
.meta { color: #9fb39f; font-size: 13px; margin: 2px 0 8px; white-space: pre-line; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  min-height: 48px; padding: 8px 14px; border-radius: 22px; border: 1px solid #4a5a4a;
  background: #263026; color: var(--text); font-size: 15px;
}
.chip.sel { background: var(--accent); color: #08130a; font-weight: 700; border-color: var(--accent); }
.chip.expected::after { content: " ★"; }

textarea#note {
  width: 100%; margin-bottom: 10px; border-radius: 10px; border: 1px solid #4a5a4a;
  background: #263026; color: var(--text); padding: 10px; font: inherit;
}
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cam-btn {
  min-height: 48px; display: inline-flex; align-items: center; padding: 0 16px;
  border-radius: 12px; background: #263026; border: 1px solid #4a5a4a; font-size: 15px;
}
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.save-btn { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: #08130a; font-size: 17px; font-weight: 700; }

#list-overlay {
  position: absolute; inset: 0; z-index: 2200; background: var(--bg);
  display: flex; flex-direction: column;
}
#list-overlay[hidden] { display: none; }
#list-overlay header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--panel); }
#obs-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
#obs-list li { background: var(--panel); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
#obs-list .o1 { display: flex; justify-content: space-between; gap: 8px; }
#obs-list .o1 button { min-width: 48px; min-height: 48px; border: 0; background: none; color: var(--danger); font-size: 15px; }
#obs-list .sub { color: #9fb39f; font-size: 13px; }
#obs-list .thumbs img { width: 40px; height: 40px; }

#toast {
  position: absolute; left: 50%; bottom: calc(60px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 3000; background: #2e3b2e; border-radius: 10px; padding: 10px 16px;
  max-width: 86vw; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.5);
}

.leaflet-container { background: #0a0d0a; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); }
.gps-dot-pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: .9; } 50% { opacity: .35; } 100% { opacity: .9; } }
