:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #232730;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #ffb43a;
  --accent-2: #ff7a59;
  --gold: #ffd166;
  --ok: #6dd58c;
  --border: #2a2f3a;
  --unverified: #5a6172;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
#map { position: absolute; inset: 0; }

#topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; gap: 12px;
  background: linear-gradient(180deg, rgba(15,17,21,.92), rgba(15,17,21,.6));
  z-index: 5; backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand .logo { font-size: 22px; }
.brand .name { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.brand .tagline { color: var(--muted); font-size: 12px; }

.actions { display: flex; gap: 8px; align-items: center; }
.actions input[type=search] {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 12px; width: 240px; outline: none;
}
.actions select, .actions button {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit;
}
.actions button.primary { background: var(--accent); color: #1a1300; border-color: transparent; font-weight: 600; }
.actions button.active { background: var(--gold, #ffd166); color: #1a1300; border-color: transparent; font-weight: 600; }
.actions button:hover { filter: brightness(1.1); }

.price-filter { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 12px; color: var(--muted); }
.price-filter select { border: none; background: transparent; padding: 4px; color: var(--gold); font-weight: 700; }

#legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 5;
  background: rgba(26,29,36,.92); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; min-width: 220px; backdrop-filter: blur(6px);
}
#legend .row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
#legend .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
#legend .dot-verified { background: var(--gold); border: 1.5px solid #0f1115; box-shadow: 0 0 0 1px var(--gold); }
#legend .dot-unverified { background: var(--unverified); border: 1.5px solid #0f1115; }
#legend .hint { color: var(--muted); margin-top: 4px; font-size: 11px; }

#searchResults {
  position: absolute; top: 60px; right: 14px; width: 360px; max-height: 60vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  z-index: 6;
}
#searchResults .item { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
#searchResults .item:hover { background: var(--panel-2); }
#searchResults .item .type { color: var(--muted); font-size: 11px; margin-left: 6px; }

dialog {
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text);
  padding: 18px; min-width: 360px; max-width: 90vw;
}
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h2 { margin: 0 0 4px; font-size: 18px; }
dialog .hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
dialog label { display: block; font-size: 12px; color: var(--muted); margin-top: 10px; }
dialog input, dialog select, dialog textarea {
  width: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit;
}
.loc { margin-top: 14px; font-size: 12px; color: var(--muted); }
.loc code { color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dialog-actions button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); cursor: pointer; }
.dialog-actions button.primary { background: var(--accent); color: #1a1300; border-color: transparent; font-weight: 600; }

.paypal-btn {
  display: inline-block; margin: 10px 0; padding: 10px 18px; border-radius: 8px;
  background: #0070ba; color: #fff; text-decoration: none; font-weight: 600;
}
.crypto { list-style: none; padding: 0; margin: 10px 0; }
.crypto li { display: flex; justify-content: space-between; gap: 10px; padding: 8px; background: var(--panel-2); border-radius: 8px; margin-bottom: 6px; font-size: 12px; }
.crypto li code { word-break: break-all; }
.crypto li button { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; font-size: 11px; }

.maplibregl-popup-content {
  background: var(--panel) !important; color: var(--text) !important;
  border: 1px solid var(--border); border-radius: 10px;
}
.maplibregl-popup-tip { display: none; }
.popup h3 { margin: 0 0 4px; font-size: 14px; }
.popup .price { color: var(--gold); font-weight: 700; font-size: 16px; }
.popup .price.cheap { color: var(--ok); }
.popup .cat { color: var(--muted); font-size: 12px; }
.popup .tags { margin-top: 6px; color: var(--muted); font-size: 11px; }
.popup .unverified-cta { margin-top: 8px; padding: 6px 10px; background: var(--accent); color: #1a1300; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; }

@media (max-width: 720px) {
  .brand .tagline { display: none; }
  .actions input[type=search] { width: 120px; }
  #legend { font-size: 11px; min-width: 180px; }
}
