html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  user-select: none;
  touch-action: none;
}

#viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
}

#viewport:active {
  cursor: grabbing;
}

#map-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.marker {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #2563eb;
  color: #fff;
  font: 700 16px/36px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transform-origin: 50% 50%;
}

.marker[data-type="hotel"] {
  background: #ef4444;
}

.marker[data-type="restaurant"] {
  background: #10b981;
}

.marker[data-type="museum"] {
  background: #8b5cf6;
}

#modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10;
}

#modal-overlay.hidden {
  display: none;
}

#modal {
  width: min(700px, 92vw);
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 24px;
  overflow: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  color: #111;
}

#modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 22px;
  line-height: 30px;
}

#modal-image-wrap {
  width: 100%;
  height: 240px;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

#modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#modal-title {
  margin: 0 0 10px;
  font: 700 22px/1.2 system-ui, sans-serif;
}

#modal-description,
#modal-contacts {
  font: 14px/1.5 system-ui, sans-serif;
  color: #111;
}

#modal-description {
  white-space: pre-line;
}

#modal-contacts {
  margin-top: 12px;
  font-weight: 600;
}

#edit-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 11;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

#edit-toolbar {
  position: fixed;
  top: 16px;
  right: 72px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font: 13px/1.2 system-ui, sans-serif;
  color: #111;
  z-index: 11;
}

#edit-toolbar.hidden {
  display: none;
}

#add-point {
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  padding: 6px 12px;
  cursor: pointer;
  font: 600 13px/1 system-ui, sans-serif;
}

#edit-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 12;
}

#edit-overlay.hidden {
  display: none;
}

#edit-panel {
  width: min(520px, 92vw);
  max-height: 85vh;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  overflow: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  color: #111;
  font: 14px/1.4 system-ui, sans-serif;
}

#edit-panel label {
  display: block;
  margin-bottom: 12px;
}

#edit-panel input,
#edit-panel select,
#edit-panel textarea {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
}

#edit-panel textarea {
  resize: vertical;
}

#edit-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 22px;
  line-height: 30px;
}

.edit-row {
  display: flex;
  gap: 12px;
}

.edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#edit-save {
  border: none;
  background: #10b981;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

#edit-delete {
  border: none;
  background: #ef4444;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
