* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  --mode-color: #3388ff;
  --pin-neutral: #555555;
  --pin-neutral-light: #dfe3e8;
}

.screen {
  height: 100vh;
  width: 100vw;
}

.hidden {
  display: none !important;
}

/* ---------- Login screen ---------- */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  text-align: center;
  padding: 2rem;
  max-width: 320px;
}

.login-box h1 {
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

.login-box button {
  background: #3388ff;
  color: white;
  border: none;
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.login-box button:hover {
  background: #2a6fd6;
}

.error {
  color: #d33;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* ---------- Map app screen ---------- */

#app-screen {
  position: relative;
}

#map {
  height: 100%;
  width: 100%;
}

#location-banner {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  z-index: 1000;
  white-space: nowrap;
}

#controls {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 0.4rem 0.6rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

#controls button {
  border: 1px solid #ddd;
  background: white;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #333;
  line-height: 1;
}

/* ---------- Generic dropdown (language + radius) ---------- */

.dropdown {
  position: relative;
}

#lang-toggle {
  font-size: 1.15rem;
  padding: 0.3rem 0.55rem;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  overflow: hidden;
  min-width: 90px;
  z-index: 1001;
}

.dropdown-option {
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-option:hover {
  background: #f0f4ff;
}

.divider {
  width: 1px;
  height: 1.4rem;
  background: #ddd;
  margin: 0 0.2rem;
}

/* ---------- Recenter (crosshair) button ---------- */

#recenter-btn {
  font-size: 1.05rem;
  padding: 0.3rem 0.55rem;
}

/* ---------- Manual mode toggle ---------- */

#manual-mode-btn {
  padding: 0.35rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  background: var(--mode-color);
  transform: rotate(-45deg);
  transition: background 0.15s ease;
}

/* ---------- Map pins: neutral color, not mode-dependent ---------- */

.map-pin-icon .pin-photo-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--pin-neutral);
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.map-pin-icon .pin-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Marker cluster theming: neutral, not mode-dependent ---------- */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: var(--pin-neutral-light);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: var(--pin-neutral);
  color: white;
  font-weight: 600;
}

/* ---------- Article popup ---------- */

.article-popup {
  min-width: 200px;
  max-width: 240px;
}

.article-popup h3 {
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.article-popup img.popup-thumb {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.4rem;
}

.article-popup p {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.35;
}

.article-popup .jump-link {
  color: #3388ff;
  font-weight: 700;
  cursor: pointer;
}

.article-popup .jump-link:hover {
  text-decoration: underline;
}

.article-popup .loading {
  font-size: 0.8rem;
  color: #888;
}

.leaflet-control-attribution { display: none; }