:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #68645d;
  --paper: #f7f2e9;
  --panel: #fffaf1;
  --line: #d7cbb8;
  --olive: #2f3a35;
  --brass: #b08a57;
  --red: #7a2e1d;
  --blue: #506f83;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
}

.shell {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  min-height: 100vh;
}

.panel {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
  overflow: auto;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.metric {
  min-width: 72px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: right;
  background: #fffdf8;
}

.metric span {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.metric small {
  color: var(--muted);
}

.controls {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf8;
  font: inherit;
  text-transform: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

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

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

.high {
  background: var(--red);
}

.medium {
  background: var(--brass);
}

.low {
  background: var(--blue);
}

.target-list {
  display: grid;
  gap: 10px;
}

.target-card {
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 12px;
  cursor: pointer;
}

.target-card:hover {
  border-color: var(--brass);
}

.target-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
}

.target-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border: 1px solid var(--line);
  padding: 4px 6px;
  color: var(--olive);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.map {
  min-height: 100vh;
}

.leaflet-popup-content {
  min-width: 260px;
}

.popup-title {
  margin: 0 0 6px;
  font-size: 17px;
}

.popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
  font-size: 12px;
}

.popup-grid strong {
  display: block;
  font-size: 14px;
}

.source-link {
  color: var(--red);
  font-weight: 800;
}

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

  .panel {
    max-height: 46vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map {
    min-height: 54vh;
  }
}
