:root {
  --bg: #061015;
  --panel: #0b181f;
  --line: #1e313b;
  --text: #e8f2f6;
  --muted: #78909a;
  --cyan: #48e9ff;
  --green: #49f5a0;
  --red: #ff5e68;
  --amber: #ffc45a;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 5vw;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(6, 16, 21, 0.92);
  backdrop-filter: blur(12px);
  z-index: 800;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
}
.logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--cyan) 40%, #0a3a44);
  box-shadow: 0 0 12px #48e9ff88;
}
nav { display: flex; gap: 16px; margin-left: 12px; }
nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
nav a.active, nav a:hover { color: #fff; }
.report {
  margin-left: auto;
  background: linear-gradient(135deg, #1a3a44, #0d2830);
  border: 1px solid #2a4a55;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.report:hover { border-color: var(--cyan); background: #14323c; }

.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 42px 5vw 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: end;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 10px;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 #48e9ff88;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 #48e9ff66; }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 0 0 12px;
}
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero p { color: var(--muted); max-width: 42ch; margin: 0; font-size: 15px; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.stats b { display: block; font-size: 22px; font-weight: 800; }
.stats small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.workspace {
  max-width: 1400px;
  margin: 0 auto 40px;
  padding: 0 5vw;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  align-items: stretch;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  max-height: 720px;
  overflow: hidden;
}
.place {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.place small {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.place h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -0.02em; }
#locate {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a171e;
  color: var(--cyan);
  font-size: 16px;
  cursor: pointer;
}
#locate:hover { border-color: var(--cyan); }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #071219;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  margin-bottom: 12px;
}
.search span { color: var(--muted); font-size: 14px; }
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 11px 0;
  outline: none;
  font-size: 13px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.chip {
  border: 1px solid var(--line);
  background: #0a171e;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.12s;
}
.chip:hover { color: #fff; border-color: #3a5560; }
.chip.active {
  background: #12303a;
  color: var(--cyan);
  border-color: #2a5a66;
}

.listhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.listhead small { letter-spacing: 0; text-transform: none; }

.report-list {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}
.report-list::-webkit-scrollbar { width: 6px; }
.report-list::-webkit-scrollbar-thumb {
  background: #243840;
  border-radius: 4px;
}

.card {
  background: #09151c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.card:hover, .card.active {
  border-color: #3a5a66;
  background: #0c1c24;
}
.card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.confidence {
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta {
  display: flex;
  justify-content: space-between;
  color: #667f89;
  font-size: 10px;
  margin-top: 8px;
}
.card-actions { margin-top: 8px; }
.confirm-btn, .popup-confirm {
  border: 1px solid #2a4a55;
  background: #10212a;
  color: #cfe8ef;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.confirm-btn:hover, .popup-confirm:hover {
  border-color: var(--cyan);
  color: #fff;
}
.empty {
  color: var(--muted);
  font-size: 12px;
  padding: 16px 8px;
  text-align: center;
}

.mapwrap {
  min-height: 690px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #09171d;
}
.mapwrap #map {
  height: 100%;
  min-height: 690px;
}
.maphud {
  position: absolute;
  z-index: 500;
  top: 14px;
  left: 14px;
  background: rgba(6, 16, 21, 0.9);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.maphud strong { font-size: 11px; display: block; }
.maphud span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.map-controls {
  position: absolute;
  z-index: 500;
  bottom: 18px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-controls button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(10, 23, 30, 0.92);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.map-controls button:hover { border-color: var(--cyan); }

.leaflet-popup-content-wrapper {
  background: #0c1c24;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px #0008;
}
.leaflet-popup-tip { background: #0c1c24; }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.leaflet-popup-content strong { font-size: 14px; }
.leaflet-popup-content p { margin: 6px 0; color: var(--muted); font-size: 12px; }
.popup-meta { font-size: 11px; color: var(--green); margin-bottom: 8px; }
.leaflet-container a.leaflet-popup-close-button { color: #8aa; }

.how {
  max-width: 1400px;
  margin: auto;
  padding: 50px 5vw 40px;
  border-top: 1px solid var(--line);
}
.how h2 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.04em;
  margin: 0 0 28px;
  line-height: 1.15;
}
.how h2 em { font-style: normal; color: var(--cyan); }
.howgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.howgrid article {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 22px;
  border-radius: var(--radius);
}
.howgrid b { color: var(--cyan); font-size: 13px; }
.howgrid h3 { margin: 8px 0 6px; font-size: 17px; }
.howgrid p { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.5; }

.about {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 5vw 80px;
}
.about-inner {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 720px;
}
.about h2 {
  margin: 0 0 12px;
  font-size: 26px;
  letter-spacing: -0.03em;
}
.about p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.about ul {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}
.about li { margin-bottom: 4px; }
.fine-print { font-size: 11px !important; color: #5a7078 !important; }
.fine-print a { color: #7aa; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: #000b;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal.open { display: flex; }
.dialog {
  position: relative;
  background: #0a171e;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  width: min(540px, 100%);
  max-height: 92vh;
  overflow-y: auto;
}
.dialog h2 { margin: 0 0 6px; font-size: 20px; }
.dialog > p { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0 0 8px; }
.x {
  position: absolute;
  right: 12px;
  top: 8px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
label {
  display: block;
  color: #b9c9cf;
  font-size: 12px;
  margin: 12px 0 0;
}
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  background: #071219;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  font: inherit;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus { border-color: #3a6a78; }
textarea { min-height: 100px; resize: vertical; }
.coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.geo-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
}
.submit {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #2a5a66;
  background: linear-gradient(135deg, #1a4a55, #0d3038);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.submit:hover:not(:disabled) { border-color: var(--cyan); }
.submit:disabled { opacity: 0.6; cursor: wait; }
.fine {
  font-size: 11px !important;
  text-align: center;
  color: var(--muted) !important;
  margin-top: 10px !important;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: #effdff;
  color: #041115;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  opacity: 0;
  transition: 0.25s;
  z-index: 2000;
  pointer-events: none;
  max-width: min(90vw, 420px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 960px) {
  nav { display: none; }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }
  .stats { margin-top: 8px; }
  .workspace {
    grid-template-columns: 1fr;
  }
  .panel {
    max-height: none;
    order: 2;
  }
  .mapwrap {
    order: 1;
    min-height: 420px;
  }
  .mapwrap #map { min-height: 420px; }
  .howgrid { grid-template-columns: 1fr; }
}
