:root {
  --paper: #f4efe4;
  --card: #fffdf7;
  --ink: #22302a;
  --muted: #6d776d;
  --pine: #1f6b50;
  --pine-dark: #16533d;
  --pine-soft: #e3efe7;
  --clay: #c1552d;
  --clay-dark: #a34422;
  --clay-soft: #f8e7de;
  --amber: #a97b1f;
  --amber-soft: #f6ecd4;
  --gray: #8f938c;
  --gray-soft: #ecebe5;
  --line: #e3dbc9;
  --line-strong: #d2c7b0;
  --shadow: 0 12px 32px rgba(42, 54, 44, 0.14);
  --radius: 18px;
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  color: var(--ink);
}

::selection {
  background: rgba(31, 107, 80, 0.22);
}

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--pine);
  color: var(--card);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(31, 107, 80, 0.3);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.btn-ghost,
.btn-solid {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--pine);
  color: var(--pine-dark);
  background: var(--pine-soft);
}

.btn-ghost.small {
  padding: 5px 11px;
  font-size: 12px;
}

.btn-solid {
  background: var(--pine);
  color: var(--card);
  border: 1px solid var(--pine);
}

.btn-solid:hover {
  background: var(--pine-dark);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--pine-soft);
  color: var(--pine-dark);
  border: 1px solid rgba(31, 107, 80, 0.2);
}

.user-chip .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pine);
  color: var(--card);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Layout ---------- */

.app {
  position: fixed;
  inset: var(--header-h) 0 0 0;
}

#map {
  position: absolute;
  inset: 0;
  background: #e9e3d4;
  z-index: 1;
}

/* ---------- Panel ---------- */

.panel {
  position: absolute;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: 356px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(224, 216, 198, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.28s ease;
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 6px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f2ede0;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 10px;
  height: 38px;
  color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-box:focus-within {
  border-color: var(--pine);
  background: #fff;
}

.search-box svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #9aa294;
}

.panel-toggle {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: none;
  place-items: center;
  color: var(--muted);
  background: #f2ede0;
  flex: none;
}

.panel-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.panel-tabs {
  display: flex;
  gap: 2px;
  padding: 4px 14px 0;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  padding: 9px 12px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.tab.active {
  color: var(--pine-dark);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--pine);
}

.tab-count {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--gray-soft);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 2px;
}

.tab.active .tab-count {
  background: var(--pine-soft);
  color: var(--pine-dark);
}

.stats-line {
  padding: 8px 16px 2px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.filter-area {
  padding: 8px 14px 4px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-row + .chip-row {
  margin-top: 6px;
}

.chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.14s ease;
}

.chip:hover {
  border-color: var(--pine);
  color: var(--pine-dark);
}

.chip.active {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--card);
}

.species-row {
  max-height: 72px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.species-row .chip {
  padding: 3px 10px;
  font-size: 11.5px;
}

.species-row .chip.active {
  background: var(--pine-soft);
  border-color: rgba(31, 107, 80, 0.55);
  color: var(--pine-dark);
}

.scope-row {
  margin-top: 8px;
}

.clear-filters {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--clay);
  padding: 2px 0;
}

.clear-filters:hover {
  text-decoration: underline;
}

.list-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 6px;
}

.list {
  padding: 8px 10px 4px;
}

.list-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
}

.list-empty strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.list-empty .btn-ghost {
  margin-top: 10px;
}

.spot-card {
  width: 100%;
  text-align: left;
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.spot-card:hover {
  background: #f6f1e4;
  border-color: var(--line);
}

.spot-card + .spot-card {
  margin-top: 2px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-top h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.4;
}

.status-tag {
  flex: none;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.status-tag.open {
  background: var(--pine-soft);
  color: var(--pine-dark);
}

.status-tag.restricted {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-tag.forbidden {
  background: var(--gray-soft);
  color: var(--gray);
}

.card-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.card-species {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.species-tag {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1ece0;
  color: #5c6659;
}

.card-species .more {
  background: transparent;
  color: var(--muted);
}

.catch-card {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.catch-card:hover {
  background: #f6f1e4;
  border-color: var(--line);
}

.catch-card + .catch-card {
  margin-top: 2px;
}

.catch-thumb {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--gray-soft);
  border: 1px solid var(--line);
}

.catch-info {
  min-width: 0;
}

.catch-info h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
}

.catch-info h3 .user {
  font-size: 11px;
  font-weight: 500;
  color: var(--clay);
  margin-left: 5px;
}

.catch-info p {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-footer {
  padding: 10px 18px 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 10.5px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

.dot.open {
  background: var(--pine);
}

.dot.restricted {
  background: var(--amber);
}

.dot.forbidden {
  background: var(--gray);
}

.dot.catch {
  background: var(--clay);
}

.data-note {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.8;
  color: #98a091;
}

/* ---------- Map UI ---------- */

.map-ui {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.layer-switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(42, 54, 44, 0.12);
}

.layer-switch button {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  transition: all 0.14s ease;
}

.layer-switch button.active {
  background: var(--pine);
  color: var(--card);
}

.zoom-ctrl {
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(42, 54, 44, 0.12);
  overflow: hidden;
}

.zoom-ctrl button {
  width: 34px;
  height: 32px;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}

.zoom-ctrl button + button {
  border-top: 1px solid var(--line);
}

.zoom-ctrl button:hover {
  background: var(--pine-soft);
}

.fab {
  position: absolute;
  right: 16px;
  bottom: 32px;
  z-index: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 22px rgba(163, 68, 34, 0.38);
  transition: background 0.15s ease, transform 0.15s ease;
}

.fab:hover {
  background: var(--clay-dark);
  transform: translateY(-1px);
}

.fab svg {
  width: 20px;
  height: 20px;
}

.toast {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 3000;
  background: var(--ink);
  color: var(--card);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(20, 30, 24, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(90vw, 480px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pick-banner {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  background: var(--pine);
  color: var(--card);
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(22, 83, 61, 0.35);
}

.map-picking {
  cursor: crosshair !important;
}

.map-picking .leaflet-interactive {
  cursor: crosshair !important;
}

/* ---------- Markers ---------- */

.spot-pin {
  --pin: var(--pine);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pin);
  border: 2px solid #fffdf7;
  box-shadow: 0 3px 8px rgba(20, 30, 24, 0.35);
  display: grid;
  place-items: center;
  color: #fffdf7;
  position: relative;
}

.spot-pin::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: -1px;
  border: 6px solid transparent;
  border-top-color: var(--pin);
}

.spot-pin.restricted {
  --pin: #a97b1f;
}

.spot-pin.forbidden {
  --pin: #8f938c;
}

.spot-pin svg {
  width: 17px;
  height: 17px;
}

.catch-pin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid var(--clay);
  box-shadow: 0 0 0 2px #fffdf7, 0 4px 10px rgba(20, 30, 24, 0.35);
  overflow: hidden;
  background: var(--gray-soft);
  transition: transform 0.15s ease;
}

.catch-pin:hover {
  transform: scale(1.08);
}

.catch-pin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Popups ---------- */

.leaflet-container {
  font-family: inherit;
  background: #e9e3d4;
}

.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(28, 39, 31, 0.24);
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
  width: 274px !important;
  line-height: 1.55;
}

.leaflet-popup-tip {
  background: var(--card);
}

.leaflet-popup-close-button {
  top: 6px !important;
  right: 8px !important;
  color: #9aa294 !important;
  font-size: 20px !important;
  width: 22px !important;
  height: 22px !important;
}

.leaflet-control-attribution {
  background: rgba(255, 253, 247, 0.86) !important;
  font-size: 10px !important;
  border-radius: 6px 0 0 0;
  color: #7c857a;
}

.popup {
  padding: 15px 16px 14px;
}

.popup-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.popup h3 {
  margin: 5px 0 0;
  font-size: 15.5px;
  line-height: 1.4;
  padding-right: 14px;
}

.popup-desc {
  margin: 7px 0 0;
  font-size: 12px;
  color: #4c584c;
  line-height: 1.65;
}

.popup-species {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.popup-tip {
  margin: 9px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  background: #f6f2e7;
  border-radius: 8px;
  padding: 7px 9px;
}

.popup-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.popup-meta {
  font-size: 10.5px;
  color: var(--muted);
}

.popup .btn-mini {
  flex: none;
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--pine);
  color: var(--card);
  transition: background 0.14s ease;
}

.popup .btn-mini:hover {
  background: var(--pine-dark);
}

.popup .btn-mini.clay {
  background: var(--clay);
}

.popup .btn-mini.clay:hover {
  background: var(--clay-dark);
}

.popup-photo {
  width: 100%;
  height: 172px;
  object-fit: cover;
  display: block;
  border-radius: 14px 14px 0 0;
  cursor: zoom-in;
  background: var(--gray-soft);
}

.popup-catch-body {
  padding: 12px 14px 14px;
}

.popup-catch-body h3 {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.popup-catch-body h3 .species {
  font-size: 16px;
}

.popup-catch-meta {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.popup-catch-meta .user {
  color: var(--clay);
  font-weight: 600;
}

.popup-note {
  margin: 7px 0 0;
  font-size: 12px;
  color: #4c584c;
  line-height: 1.6;
  word-break: break-word;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.delete-link {
  font-size: 11px;
  color: var(--clay);
  padding: 3px 0;
}

.delete-link:hover {
  text-decoration: underline;
}

/* ---------- Modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 32, 27, 0.46);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(400px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(18, 26, 21, 0.35);
  animation: riseIn 0.22s ease;
}

.catch-modal {
  width: min(460px, 100%);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background 0.14s ease;
}

.modal-close:hover {
  background: var(--gray-soft);
}

.modal-head {
  text-align: center;
  padding: 2px 0 6px;
}

.modal-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: var(--pine);
  color: var(--card);
  display: grid;
  place-items: center;
}

.modal-mark svg {
  width: 28px;
  height: 28px;
}

.modal-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.04em;
}

.modal-head p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  margin: 14px 0 4px;
  padding: 3px;
  border-radius: 10px;
  background: #f1ecdf;
}

.auth-tabs button {
  flex: 1;
  padding: 7px 0;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.15s ease;
}

.auth-tabs button.active {
  background: var(--card);
  color: var(--pine-dark);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(42, 54, 44, 0.12);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #53604f;
  font-weight: 500;
}

.field input,
.field select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffdf8;
  font-size: 13.5px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.field input:focus,
.field select:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(31, 107, 80, 0.12);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%236d776d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

.field-label {
  font-size: 12.5px;
  color: #53604f;
  font-weight: 500;
}

.location-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

#pickedText.picked {
  color: var(--pine-dark);
  font-weight: 600;
}

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

.quick-species .chip {
  padding: 3px 9px;
  font-size: 11.5px;
}

.form-error {
  margin: 12px 0 0;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--clay-soft);
  color: var(--clay-dark);
  font-size: 12px;
  line-height: 1.5;
}

.btn-primary {
  width: 100%;
  margin-top: 16px;
  height: 42px;
  border-radius: 11px;
  background: var(--pine);
  color: var(--card);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: background 0.15s ease, opacity 0.15s ease;
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.modal-foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 10.5px;
  color: #98a091;
  line-height: 1.7;
}

.photo-drop {
  position: relative;
  height: 148px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: #faf6ec;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.photo-drop:hover,
.photo-drop:focus-visible,
.photo-drop.dragover {
  border-color: var(--pine);
  background: #f3f7f0;
  outline: none;
}

.photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.photo-empty svg {
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
  color: var(--pine);
}

.photo-empty strong {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
}

.photo-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--clay);
  padding: 2px 0;
}

.photo-remove:hover {
  text-decoration: underline;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(14, 18, 15, 0.86);
  display: grid;
  place-items: center;
  padding: 30px;
  cursor: zoom-out;
  animation: fadeIn 0.18s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

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

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Scrollbars ---------- */

.list-scroll::-webkit-scrollbar,
.species-row::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 6px;
}

.list-scroll::-webkit-scrollbar-thumb,
.species-row::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: rgba(120, 128, 116, 0.35);
  border-radius: 3px;
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  :root {
    --header-h: 58px;
  }

  .brand-text h1 {
    font-size: 15.5px;
  }

  .brand-text p {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .topbar {
    padding: 0 14px;
  }

  .btn-ghost,
  .btn-solid {
    padding: 6px 12px;
    font-size: 12.5px;
  }

  .user-chip {
    font-size: 12px;
  }

  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 46vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    transition: transform 0.28s ease;
  }

  .panel-top {
    padding: 10px 12px 4px;
  }

  .panel-toggle {
    display: grid;
  }

  .panel.closed {
    transform: translateY(calc(100% - 62px));
  }

  .panel.closed .panel-toggle svg {
    transform: rotate(-90deg);
  }

  .panel:not(.closed) .panel-toggle svg {
    transform: rotate(90deg);
  }

  .map-ui {
    top: 10px;
    right: 10px;
  }

  .layer-switch button {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  .zoom-ctrl button {
    width: 32px;
    height: 30px;
  }

  .fab {
    bottom: calc(76px + env(safe-area-inset-bottom));
    height: 44px;
    font-size: 13px;
    right: 12px;
  }

  .toast,
  .pick-banner {
    top: calc(var(--header-h) + 12px);
  }

  .modal {
    padding: 20px;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }

  .popup .leaflet-popup-content {
    width: 250px !important;
  }
}

@media (max-height: 560px) {
  .panel {
    height: 60vh;
  }
}
