:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --shadow: 0 10px 24px rgba(0,0,0,.08);
  --radius: 14px;
}

*{ box-sizing: border-box; }
html, body{ height:100%;width:100% }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* App bar */
.appbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.appbar__inner{
  height: 70px;
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}
.brand__title{ font-weight: 800; letter-spacing: .2px; }
.brand__subtitle{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.actions{ display:flex; align-items:center; gap: 10px; }

/* Layout */
.layout{
  max-width: 1700px;
  margin: 14px auto;
  padding: 0 16px 16px;
  display:flex;
  flex-direction: column;
  gap: 12px;
}

/* Panel (options) */
.panel{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel__content{ padding: 14px; }
.panel__content--hidden{ display:none; }

.grid{
  display:grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 12px;
  align-items:end;
}
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
}

.field{ display:flex; flex-direction: column; gap: 6px; }
.label{ font-size: 12px; color: var(--muted); }

.input, .select{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
}
.input:focus, .select:focus{
  border-color: rgba(37,99,235,.6);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.field--actions{
  display:flex;
  flex-direction: row;
  gap: 10px;
  justify-content:flex-start;
}

/* Buttons */
.btn{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.btn:hover{ background: #f9fafb; }
.btn--primary{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn--primary:hover{ background: var(--primary2); }
.btn--ghost{
  background: transparent;
}

/* Meta row */
.metaRow{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.pill{
  font-size: 13px;
  color: #0f172a;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 6px 10px;
  border-radius: 999px;
}

/* Toggle */
.toggle{
  display:flex;
  align-items:center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

/* Map wrapper */
.mapWrap{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
#map{
  height: calc(120vh - 64px - 14px - 16px - 12px - 18px); /* approx */
  min-height: 520px;
  width: 100%;
}

/* Popup */
.popup h3{ margin:0 0 6px; font-size: 16px; }
.popup p{ margin:4px 0; }
.popup .meta{ color:#555; font-size: 13px; }
.popup hr{ border: none; border-top: 1px solid #eee; margin: 8px 0; }

.metaLeft, .metaRight{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}

.pill--gray{
  background:#f3f4f6;
  border-color:#e5e7eb;
  color:#374151;
}

/* Plein écran */
body.is-fullscreen .appbar,
body.is-fullscreen .panel{
  display:none;
}
body.is-fullscreen .layout{
  max-width: none;
  margin: 0;
  padding: 0;
}
body.is-fullscreen .mapWrap{
  border-radius: 0;
  border: none;
  box-shadow: none;
}
body.is-fullscreen #map{
  height: 100vh;
  min-height: 100vh;
}

.user-marker {
  width: 14px;
  height: 14px;
  background: #F0320C; /* rouge */
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 rgba(25,135,84, 0.5);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25,135,84, 0.6);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(25,135,84, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25,135,84, 0);
  }
}

.custom-cluster {

  background: transparent;

}

.cluster-inner {

  width: 100%;
  height: 100%;

  background: linear-gradient(135deg,#ff9800,#ff5722);

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  color: white;

  font-weight: bold;

  border: 4px solid rgba(255,255,255,0.8);

  box-shadow:
    0 4px 12px rgba(0,0,0,0.3),
    inset 0 0 10px rgba(255,255,255,0.2);

  font-size: 18px;

  transition: all 0.2s ease;

}

.cluster-inner:hover {

  transform: scale(1.1);

}