* {
  box-sizing: border-box;
}

html,
body,
#map {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
}

/* =========================
   LAYER PANEL
   ========================= */

.layer-panel {
  background: rgba(255, 255, 255, 0.96);
  padding: 12px;
  border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  min-width: 240px;
  max-width: 300px;
}

.layer-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.layer-row {
  margin: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 6px;
}

.layer-row:last-child {
  border-bottom: none;
}

.layer-row label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  line-height: 16px;
}

.layer-row input[type="checkbox"] {
  margin-top: 1px;
  cursor: pointer;
}

.layer-name {
  flex: 1;
  font-weight: 600;
  color: #333;
  word-break: break-word;
}

.status {
  margin-left: 23px;
  margin-top: 2px;
  color: #7f8c8d;
  font-size: 11px;
  font-weight: 500;
}

.layer-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.small-button {
  flex: 1;
  border: 1px solid #bdc3c7;
  background: #ecf0f1;
  border-radius: 5px;
  padding: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.small-button:hover {
  background: #bdc3c7;
}

/* =========================
   LEGEND
   ========================= */

.legend {
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  line-height: 20px;
}

.legend-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

/* =========================
   CUSTOM ZOOM CONTROL
   ========================= */

.custom-zoom-control {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  width: 34px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.zoom-btn {
  border: 0;
  background: white;
  width: 34px;
  height: 34px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.zoom-btn:hover {
  background: #f1f1f1;
}

.zoom-btn.zoom-in {
  border-radius: 10px 10px 0 0;
}

.zoom-btn.zoom-out {
  border-radius: 0 0 10px 10px;
}

.zoom-level {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #555;
  padding: 4px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

/* =========================
   EDIT PANEL
   ========================= */

.edit-panel {
  background: white;
  width: 280px;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-size: 13px;
}

.edit-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.field select {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.edit-buttons {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.edit-buttons button {
  flex: 1;
  padding: 7px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.save-button { background: #2ecc71; color: white; }
.cancel-button { background: #e74c3c; color: white; }

/* =========================
   MOBILE — SHRINK LAYER PANEL
   ========================= */

@media (max-width: 600px) {

  .layer-panel {
    min-width: 130px;
    max-width: 150px;
    padding: 6px;
    font-size: 9px;
    border-radius: 6px;
  }

  .layer-title {
    font-size: 10px;
    margin-bottom: 4px;
    padding-bottom: 2px;
  }

  .layer-row {
    margin: 3px 0;
    padding-bottom: 2px;
  }

  .layer-row label {
    gap: 4px;
    line-height: 11px;
  }

  .layer-row input[type="checkbox"] {
    width: 11px;
    height: 11px;
  }

  .status {
    margin-left: 15px;
    font-size: 8px;
  }

  .layer-actions {
    gap: 3px;
    margin-top: 5px;
  }

  .small-button {
    padding: 3px;
    font-size: 8px;
  }

  .legend {
    padding: 5px 7px;
    font-size: 9px;
    line-height: 13px;
  }

  .legend-title {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .legend-dot {
    width: 8px;
    height: 8px;
  }

  .custom-zoom-control {
    width: 26px;
  }

  .zoom-btn {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .zoom-level {
    font-size: 8px;
    padding: 2px 0;
  }
}