html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#map {
  position: absolute;
  inset: 0;
  background: #ffffff; /* même blanc que le fond de la carte */
}

#topbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(24, 26, 31, 0.92);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

#title {
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

#search {
  width: 240px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}

#search::placeholder { color: rgba(255, 255, 255, 0.45); }
#search:focus { border-color: rgba(255, 255, 255, 0.45); }
#search.error { border-color: #e05c5c; }

#coordbar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 1000;
  background: rgba(24, 26, 31, 0.92);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.leaflet-container {
  font: inherit;
}

.coord-popup {
  font-variant-numeric: tabular-nums;
}

.coord-popup button {
  margin-top: 4px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
}

.debug-control-point {
  border-radius: 50%;
}

#palette {
  position: absolute;
  top: 80px;
  right: 12px;
  z-index: 1000;
  width: 190px;
  background: rgba(24, 26, 31, 0.92);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  padding: 8px;
  font-size: 13px;
}

#paletteTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  padding: 2px 4px 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

#paletteActions {
  display: flex;
  gap: 4px;
}

#editToggle,
#undoBtn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #fff;
  padding: 2px 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
#editToggle:hover,
#undoBtn:not(:disabled):hover { background: rgba(255, 255, 255, 0.18); }
#undoBtn:disabled { opacity: 0.4; cursor: default; }
body:not(.editing) #undoBtn { display: none; }
body.editing #editToggle {
  background: #2f7df6;
  border-color: #2f7df6;
}

/* hors édition, les boutons de la palette ne posent rien */
body:not(.editing) .poi-btn { cursor: default; }
body:not(.editing) .poi-btn:hover { background: none; }

.poi-popup-note:empty { display: none; }

.poi-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.poi-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #fff;
  padding: 4px 6px;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.poi-btn:hover { background: rgba(255, 255, 255, 0.08); }
.poi-btn.active {
  background: rgba(47, 125, 246, 0.25);
  border-color: #2f7df6;
}
.poi-btn svg { flex: none; }

.poi-count {
  min-width: 20px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.poi-eye {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  border-radius: 5px;
}
.poi-eye:hover { background: rgba(255, 255, 255, 0.08); }
.poi-eye.off { color: rgba(255, 255, 255, 0.25); }

.leaflet-container.placing { cursor: crosshair; }

.poi-marker svg {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.poi-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  box-sizing: border-box;
  padding: 0 4px;
  border-radius: 8px;
  border: 1.5px solid #fff;
  background: #d93025;
  color: #fff;
  font: 700 10px/13px "Segoe UI", sans-serif;
  text-align: center;
  pointer-events: none;
}

.poi-variant {
  position: absolute;
  bottom: -5px;
  right: -7px;
  width: 15px;
  height: 15px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1.5px solid #fff;
  color: #fff;
  font: 700 9px/12px "Segoe UI", sans-serif;
  text-align: center;
  pointer-events: none;
}

.poi-variants {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.poi-variants:empty { display: none; }
.poi-variants button {
  flex: 1;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 3px 6px;
  font: inherit;
  font-size: 12px;
}
.poi-variants button.active {
  background: #2f7df6;
  border-color: #2f7df6;
  color: #fff;
}

.poi-done {
  width: 100%;
  cursor: pointer;
  border: 1px solid #2e9e5b;
  background: #2e9e5b;
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
}
.poi-done.on {
  border-color: #e0a0a0;
  background: #fff5f5;
  color: #b33;
}

.poi-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.poi-popup input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
}

.poi-popup-coords {
  margin: 4px 0 6px;
  color: #777;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.poi-delete {
  cursor: pointer;
  border: 1px solid #e0a0a0;
  background: #fff5f5;
  color: #b33;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
}
