* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
#map { position: absolute; inset: 0; z-index: 1; background: #a9d3e0; }

.hidden { display: none !important; }
.muted { color: #6b7280; font-size: 0.8rem; font-weight: normal; }

.btn-primary {
  background: #2563eb; color: #fff; border: none; border-radius: 10px;
  padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  background: transparent; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 9px 14px; font-size: 14px; cursor: pointer; color: #334155;
}
.btn-ghost:hover { background: #f1f5f9; }
.btn-ghost.small { padding: 6px 10px; font-size: 13px; }

#addPinBtn { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000; }

.btn-locate {
  position: absolute; bottom: 24px; right: 16px; z-index: 1000;
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: #2563eb; font-size: 22px; line-height: 48px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: 0;
}
.btn-locate:hover { background: #f1f5f9; }
.btn-locate.locating { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 1000; background: #111827; color: #fff; padding: 10px 16px;
  border-radius: 10px; display: flex; gap: 14px; align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.3); font-size: 14px; max-width: 92vw;
}
.banner .btn-ghost { color: #cbd5e1; border-color: #374151; }

.overlay {
  position: absolute; inset: 0; z-index: 2000; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.card {
  background: #fff; border-radius: 16px; padding: 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.form-card { width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.form-card h2 { font-size: 1.25rem; margin-bottom: 4px; }
#pinForm { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
#pinForm label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #334155; }
#pinForm input, #pinForm textarea, #pinForm select {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 11px;
  font-size: 14px; font-family: inherit; width: 100%;
}
#pinForm textarea { resize: vertical; }
.link-row { display: flex; gap: 6px; align-items: center; }
.link-row select { flex: 0 0 118px; }
.link-row input { flex: 1; }
.link-row .rm { background: #fee2e2; color: #b91c1c; border: none; border-radius: 6px; width: 30px; height: 34px; cursor: pointer; font-size: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.err { color: #dc2626; font-size: 13px; min-height: 16px; }

/* Popup card */
.pin-popup { min-width: 180px; }
.pin-popup h3 { font-size: 1rem; margin-bottom: 3px; word-break: break-word; }
.pin-popup .bio { font-size: 13px; color: #475569; margin: 4px 0 8px; word-break: break-word; }
.pin-popup .cat-tag { display: inline-block; font-size: 12px; font-weight: 600; color: #2563eb; margin: 2px 0 4px; }
.pin-popup .socials { display: flex; flex-wrap: wrap; gap: 6px; }
.pin-popup .socials a {
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
  background: #f1f5f9; color: #0f172a; padding: 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.pin-popup .socials a:hover { background: #e2e8f0; }
.pin-popup .report-btn {
  margin-top: 10px; background: none; border: none; color: #b91c1c;
  font-size: 12px; cursor: pointer; padding: 2px 0; text-decoration: underline;
}
.pin-popup .report-btn:disabled { color: #16a34a; cursor: default; text-decoration: none; }

/* Category emoji markers */
.cat-marker { background: none; border: none; }
.cat-pin {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: #fff; border: 2px solid #2563eb; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.cat-pin > * { transform: rotate(45deg); }
/* emoji sits upright inside the rotated teardrop */
.cat-marker .cat-pin { line-height: 1; }

.attrib {
  position: absolute; bottom: 6px; left: 8px; z-index: 1000;
  font-size: 12px; color: #1e293b; text-decoration: none; font-weight: 700;
  background: rgba(255,255,255,.7); padding: 2px 7px; border-radius: 6px;
}
