:root {
  --bg: #f5f8f6;
  --surface: #ffffff;
  --surface-soft: #ecf4ee;
  --text: #1b2b24;
  --muted: #5c6d64;
  --line: #d7e3db;
  --brand: #0e8f5b;
  --brand-deep: #0a6f46;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --shadow: 0 18px 45px rgba(24, 69, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 0% 0%, #f7f2d8 0, transparent 35%),
    radial-gradient(circle at 100% 20%, #dbf5e8 0, transparent 30%),
    var(--bg);
  min-height: 100%;
}

.shell {
  width: min(1120px, 100% - 1.4rem);
  margin: 0 auto 2rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(245, 248, 246, 0.88);
  border-bottom: 1px solid rgba(27, 43, 36, 0.08);
}

.topbar-inner {
  width: min(1120px, 100% - 1.4rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  gap: 0.8rem;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(150deg, #0e8f5b, #0a6f46);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.brand h1 {
  font-family: "Sora", sans-serif;
  margin: 0;
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.68rem 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-deep);
}

.btn-soft {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-report {
  background: #ff914d;
  color: #fff;
}

.btn-report:hover {
  background: #ff6f00;
}

.btn-cancel {
  background: #eceff1;
  color: #30414b;
  border: 1px solid #cfd8dc;
}

.btn-cancel:hover {
  background: #dfe5e8;
}

.btn-warn {
  background: #ff914d;
  color: #fff;
}

.btn-warn:hover {
  background: #ff6f00;
}

.btn-danger {
  background: #d54d4d;
  color: #fff;
}

.btn-danger:hover {
  background: #b63d3d;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-loading {
  position: relative;
  padding-left: 2rem;
}

.btn-loading::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 50%;
  width: 0.8rem;
  height: 0.8rem;
  margin-top: -0.4rem;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hero {
  margin-top: 1rem;
  background: linear-gradient(145deg, #0d7a4f, #0b5b3a);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  animation: fadeUp 0.7s ease both;
}

.hero::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  right: -70px;
  top: -80px;
  background: rgba(241, 182, 63, 0.26);
  pointer-events: none;
}

.hero h2 {
  margin: 0 0 0.5rem;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.2rem, 5vw, 1.9rem);
  line-height: 1.2;
  max-width: 22ch;
}

.hero p {
  margin: 0;
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.section {
  margin-top: 1rem;
  animation: fadeUp 0.7s ease both;
  animation-delay: 0.1s;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px rgba(17, 49, 34, 0.06);
  padding: 1rem;
}

.controls {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 700;
  font-size: 0.9rem;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.68rem 0.72rem;
  font: inherit;
  color: var(--text);
  width: 100%;
}

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

.filter-row {
  margin-top: 0.75rem;
}

.animal-pick-row {
  margin-top: 0.4rem;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
}

.chip.active {
  background: #dbf5e8;
  border-color: #8ed7b7;
  color: #12593c;
}

.layout {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.map-box {
  min-height: 300px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 25%, rgba(14, 143, 91, 0.22), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(241, 182, 63, 0.35), transparent 32%),
    repeating-linear-gradient(
      45deg,
      rgba(14, 143, 91, 0.04),
      rgba(14, 143, 91, 0.04) 10px,
      rgba(14, 143, 91, 0.08) 10px,
      rgba(14, 143, 91, 0.08) 20px
    );
  position: relative;
  overflow: hidden;
  display: block;
  text-align: left;
  padding: 1rem;
}

.map-badge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.map-title {
  margin: 0 0 0.4rem;
  font-family: "Sora", sans-serif;
}

.map-subtitle {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

#leafletMap {
  width: 100%;
  height: 360px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.points-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.points-title {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.count-text {
  color: var(--muted);
  font-weight: 700;
}

.points {
  display: grid;
  gap: 0.75rem;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.2rem;
}

.point-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.78rem;
  background: #fff;
}

.point-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.point-head h3 {
  margin: 0;
  font-size: 1rem;
}

.status {
  border-radius: 999px;
  padding: 0.25rem 0.56rem;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  height: fit-content;
}

.status.active { background: #dbf5e8; color: #0d6a44; }
.status.closed { background: #ffe8e8; color: #9a2f2f; }
.status.temp { background: #fff2db; color: #8d5e10; }

.point-meta {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.point-tags {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.2rem 0.4rem;
  background: var(--surface-soft);
}

.point-actions {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mini {
  padding: 0.45rem 0.65rem;
  font-size: 0.76rem;
  border-radius: 9px;
}

.footer-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 24, 0.55);
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
}

.modal.open {
  display: flex;
}

.sheet {
  width: min(700px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 1rem;
  animation: slideUp 0.26s ease;
  position: relative;
  z-index: 2001;
}

.leaflet-control-container,
.leaflet-pane {
  z-index: 400;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.sheet h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.x {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-weight: 800;
}

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

.full-col {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pick-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.helper {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.location-preview {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.help-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text);
  line-height: 1.5;
}

.turnstile-wrap {
  margin-top: 0.7rem;
}

.turnstile-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

@media (min-width: 760px) {
  .hero,
  .panel {
    padding: 1.25rem;
  }

  .controls {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }

  .layout {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .sheet {
    border-radius: 18px;
    align-self: center;
  }

  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .pick-row {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

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

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
